项目库-法规清单表-批量更新流程状态接口修改。
This commit is contained in:
+27
-13
@@ -11862,22 +11862,36 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
|
||||
@Override
|
||||
public Result<?> updateFlowStatusBatch(JSONObject json) {
|
||||
String ids = json.getString("ids");
|
||||
String flowStatus = json.getString("flowStatus");
|
||||
String operateType = json.getString("operateType");
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
JSONArray lawsInventoryArray = json.getJSONArray("lawsInventoryArray");
|
||||
if(CollectionUtils.isNotEmpty(lawsInventoryArray)){
|
||||
List<Map<String,Object>> lawsInventoryMapList = new ArrayList<>();
|
||||
Map<String,Object> lawsInventoryMap = null;
|
||||
for (Object lawsInventory : lawsInventoryArray) {
|
||||
lawsInventoryMap = JSONObject.parseObject(JSONObject.toJSONString(lawsInventory),Map.class);
|
||||
lawsInventoryMapList.add(lawsInventoryMap);
|
||||
}
|
||||
|
||||
List<String> lawsInventoryIdList = lawsInventoryMapList.stream().map(e -> (String) e.get("id")).distinct().collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> pliQueryWrap = new QueryWrapper<>();
|
||||
pliQueryWrap.lambda().in(ProjectLawsInventoryEO::getId,Arrays.asList(ids.split(",")));
|
||||
pliQueryWrap.lambda().in(ProjectLawsInventoryEO::getId,lawsInventoryIdList);
|
||||
List<ProjectLawsInventoryEO> pliEoList = this.list(pliQueryWrap);
|
||||
if(CollectionUtils.isNotEmpty(pliEoList)){
|
||||
pliEoList.forEach(pliEo -> {
|
||||
if(StringUtils.contains(operateType,OperatorTypeEnum.LAWS_INVENTORY_DESIGN_UPDATE_FLOW_STATUS.getValue())){
|
||||
pliEo.setDesignFlowStatus(flowStatus);
|
||||
}
|
||||
if(StringUtils.contains(operateType,OperatorTypeEnum.LAWS_INVENTORY_VERIFY_UPDATE_FLOW_STATUS.getValue())){
|
||||
pliEo.setVerifyFlowStatus(flowStatus);
|
||||
}
|
||||
});
|
||||
if(CollectionUtils.isNotEmpty(pliEoList) && CollectionUtils.isNotEmpty(lawsInventoryMapList)){
|
||||
for (Map<String, Object> map : lawsInventoryMapList) {
|
||||
String id = (String) map.get("id");
|
||||
String operateType = (String) map.get("operateType");
|
||||
pliEoList.forEach(pliEo -> {
|
||||
if (StringUtils.equals(id,pliEo.getId())) {
|
||||
if(StringUtils.contains(operateType,OperatorTypeEnum.LAWS_INVENTORY_DESIGN_UPDATE_FLOW_STATUS.getValue())){
|
||||
pliEo.setDesignFlowStatus(flowStatus);
|
||||
}
|
||||
if(StringUtils.contains(operateType,OperatorTypeEnum.LAWS_INVENTORY_VERIFY_UPDATE_FLOW_STATUS.getValue())){
|
||||
pliEo.setVerifyFlowStatus(flowStatus);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
this.updateBatchById(pliEoList);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user