修改bug

This commit is contained in:
yangjun 2026-03-10 13:23:32 +08:00
parent 8044157d1d
commit 627d492f69
2 changed files with 64 additions and 56 deletions

View File

@ -698,6 +698,17 @@ public class EmployeesMQListener {
employeesInfoService.save(employeesInfo); employeesInfoService.save(employeesInfo);
//审核通过 - 给员工添加账号
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
JSONObject j = new JSONObject();
j.put("userName", employeesInfo.getTel());
j.put("realname", employeesInfo.getName());
j.put("orgCode", deptInfo.getString("id"));//这个参数要的是机构的id
j.put("opeType", "employee");
j.put("o_c_", deptInfo.getString("code"));
j.put("employees_id", dto.getEmployeeId());
employeesApplyService.initialization(j);
//去管理平台拉取资源 //去管理平台拉取资源
// { // {
// BizEmployeesInfo mediaData = new BizEmployeesInfo(); // BizEmployeesInfo mediaData = new BizEmployeesInfo();

View File

@ -20,8 +20,10 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -84,64 +86,59 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
if (xsList == null || xsList.isEmpty()) { if (xsList == null || xsList.isEmpty()) {
return; return;
} }
List<ConfigMaterialInfo> inList = new ArrayList<>();
for (NuBizSuppliersMaterialInfo xs : xsList) {
ConfigMaterialInfo wl = wlList.stream()
.filter(wl1 -> Objects.equals(wl1.getMaterialName(), xs.getMaterialName())
&& Objects.equals(wl1.getSpecificationModel(), xs.getSpecificationModel())
&& Objects.equals(wl1.getBrandType(), xs.getBrandType()))
.findFirst()
.orElse(null);
if (wl != null) {
inList.add(wl);
}
}
for(ConfigMaterialInfo wl : inList){
String suppliers = wl.getSuppliers();
if (StringUtils.isEmpty( suppliers)) {
suppliers = configSuppliersInfo.getId();
}else{
suppliers = suppliers +","+configSuppliersInfo.getId();
}
wl.setSuppliers(suppliers);
configMaterialInfoService.updateById(wl);
}
// 取两个列表的交集并设置suppliersId // 取两个列表的交集并设置suppliersId
List<ConfigMaterialInfo> commonList = wlList.stream() // List<ConfigMaterialInfo> commonList = wlList.stream()
.filter(wl -> wl != null) // 过滤掉null的物料 // .filter(wl -> wl != null) // 过滤掉null的物料
.filter(wl -> xsList.stream() // .filter(wl -> xsList.stream()
.filter(xs -> xs != null) // 过滤掉null的供应商物料 // .filter(xs -> xs != null) // 过滤掉null的供应商物料
.anyMatch(xs -> { // .anyMatch(xs -> {
// 安全的字段比较允许null值 // return true;
// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) || // })
// (wl.getMaterialName() != null && xs.getMaterialName() != null && // )
// wl.getMaterialName().equals(xs.getMaterialName())); // .map(wl -> {
// // 找到对应的xs项目
// NuBizSuppliersMaterialInfo matchedXs = xsList.stream()
// .filter(xs -> xs != null)
// .findFirst()
// .orElse(null);
// //
// boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) || // if (matchedXs != null && matchedXs.getId() != null) {
// (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null && // String suppliers = wl.getSuppliers();
// wl.getSpecificationModel().equals(xs.getSpecificationModel())); // if (StringUtils.isEmpty( suppliers)) {
// // suppliers = configSuppliersInfo.getId();
// boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) || // }else{
// (wl.getBrandType() != null && xs.getBrandType() != null && // suppliers = suppliers +","+configSuppliersInfo.getId();
// wl.getBrandType().equals(xs.getBrandType())); // }
// wl.setSuppliers(suppliers);
return true; // configMaterialInfoService.updateById(wl);
}) // }
) // return wl;
.map(wl -> { // })
// 找到对应的xs项目 // .collect(Collectors.toList());
NuBizSuppliersMaterialInfo matchedXs = xsList.stream()
.filter(xs -> xs != null)
// .filter(xs -> {
// // 同样的匹配逻辑
// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) ||
// (wl.getMaterialName() != null && xs.getMaterialName() != null &&
// wl.getMaterialName().equals(xs.getMaterialName()));
//
// boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) ||
// (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null &&
// wl.getSpecificationModel().equals(xs.getSpecificationModel()));
//
// boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) ||
// (wl.getBrandType() != null && xs.getBrandType() != null &&
// wl.getBrandType().equals(xs.getBrandType()));
//
// return materialNameMatch && specificationModelMatch && brandTypeMatch;
// })
.findFirst()
.orElse(null);
if (matchedXs != null && matchedXs.getId() != null) {
String suppliers = wl.getSuppliers();
if (StringUtils.isEmpty( suppliers)) {
suppliers = configSuppliersInfo.getId();
}else{
suppliers = suppliers +","+configSuppliersInfo.getId();
}
wl.setSuppliers(suppliers);
configMaterialInfoService.updateById(wl);
}
return wl;
})
.collect(Collectors.toList());
} }
} }