修改bug
This commit is contained in:
parent
8044157d1d
commit
627d492f69
|
|
@ -698,6 +698,17 @@ public class EmployeesMQListener {
|
|||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ import org.springframework.stereotype.Service;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -84,64 +86,59 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
|
|||
if (xsList == null || xsList.isEmpty()) {
|
||||
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
|
||||
List<ConfigMaterialInfo> commonList = wlList.stream()
|
||||
.filter(wl -> wl != null) // 过滤掉null的物料
|
||||
.filter(wl -> xsList.stream()
|
||||
.filter(xs -> xs != null) // 过滤掉null的供应商物料
|
||||
.anyMatch(xs -> {
|
||||
// 安全的字段比较,允许null值
|
||||
// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) ||
|
||||
// (wl.getMaterialName() != null && xs.getMaterialName() != null &&
|
||||
// wl.getMaterialName().equals(xs.getMaterialName()));
|
||||
// List<ConfigMaterialInfo> commonList = wlList.stream()
|
||||
// .filter(wl -> wl != null) // 过滤掉null的物料
|
||||
// .filter(wl -> xsList.stream()
|
||||
// .filter(xs -> xs != null) // 过滤掉null的供应商物料
|
||||
// .anyMatch(xs -> {
|
||||
// return true;
|
||||
// })
|
||||
// )
|
||||
// .map(wl -> {
|
||||
// // 找到对应的xs项目
|
||||
// NuBizSuppliersMaterialInfo matchedXs = xsList.stream()
|
||||
// .filter(xs -> xs != null)
|
||||
// .findFirst()
|
||||
// .orElse(null);
|
||||
//
|
||||
// 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 true;
|
||||
})
|
||||
)
|
||||
.map(wl -> {
|
||||
// 找到对应的xs项目
|
||||
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());
|
||||
// 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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue