法规清单-符合性流程,引用交付物接口开发。

This commit is contained in:
wangzhijiang
2023-04-13 14:50:02 +08:00
parent 950ead7f6d
commit 7219ccb0d5
4 changed files with 119 additions and 0 deletions
@@ -512,4 +512,11 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
public Result<?> updateFlowStatusBatch(@RequestBody JSONObject json) {
return this.projectLawsInventoryEOService.updateFlowStatusBatch(json);
}
@AutoLog(value = "项目库-法规清单表-引用交付物")
@ApiOperation(value="项目库-法规清单表-引用交付物", notes="项目库-法规清单表-引用交付物")
@PostMapping(value = "/citeDeliverable")
public Result<?> citeDeliverable(@RequestBody JSONObject json) {
return this.projectLawsInventoryEOService.citeDeliverable(json);
}
}
@@ -81,6 +81,8 @@ public enum OperatorTypeEnum {
LAWS_INVENTORY_ENGINEERING_INTERFACE_PERSON_EXPEDITING("法规清单-工程接口人催办","lawsInventoryEngineeringInterfacePersonExpediting"),
LAWS_INVENTORY_DESIGN_UPDATE_FLOW_STATUS("法规清单-更新设计符合性流程状态","lawsInventoryDesignUpdateFlowStatus"),
LAWS_INVENTORY_VERIFY_UPDATE_FLOW_STATUS("法规清单-更新验证符合性流程状态","lawsInventoryVerifyUpdateFlowStatus"),
LAWS_INVENTORY_DESIGN_CITE_DELIVERABLE("法规清单-设计-引用交付物","lawsInventoryDesignCiteDeliverable"),
LAWS_INVENTORY_VERIFY_CITE_DELIVERABLE("法规清单-验证-引用交付物","lawsInventoryVerifyCiteDeliverable"),
/**
* 待办中心-将法规工程师的法规清单确认待办任务转为已办
@@ -251,4 +251,6 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
* @return
*/
Result<?> updateFlowStatusBatch(JSONObject json);
Result<?> citeDeliverable(JSONObject json);
}
@@ -11897,4 +11897,112 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
return new Result<>().success("批量更新状态成功!");
}
@Override
public Result<?> citeDeliverable(JSONObject json) {
String cut = json.getString("cut");
String operateType = json.getString("operateType");
String flowType = "";
if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_DESIGN_CITE_DELIVERABLE.getValue())){
flowType = FlowTypeEnum.SJFHXSHLC.getValue();
}else if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_VERIFY_CITE_DELIVERABLE.getValue())){
flowType = FlowTypeEnum.YZFHXSCLC.getValue();
}
String resultMsg = "";
ProcessHistoryEO citePhEo = null;
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
resultMsg = "引用交付物成功!";
}else {
resultMsg = "Successfully referenced deliverables!";
}
String serialNumber = json.getString("serialNumber");
String dutyTerritory = json.getString("dutyTerritory");
String citeProjectLibraryId = json.getString("citeProjectLibraryId");
if(StringUtils.isEmpty(citeProjectLibraryId)){
throw new JeroBootException("请选择引用的项目!");
}
// 符合性流程已完成的状态
List<String> complianceFlowStatusList = new ArrayList<>();
complianceFlowStatusList.add(ComplianceFlowStatusEnum.CONFORMITY.getValue());
complianceFlowStatusList.add(ComplianceFlowStatusEnum.INCONFORMITY.getValue());
complianceFlowStatusList.add(ComplianceFlowStatusEnum.TO_TRACK.getValue());
complianceFlowStatusList.add(ComplianceFlowStatusEnum.UNINVOLVED.getValue());
QueryWrapper<ProjectLawsInventoryEO> citePliQueryWrap = new QueryWrapper<>();
citePliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,citeProjectLibraryId);
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
citePliQueryWrap.lambda().in(ProjectLawsInventoryEO::getDesignFlowStatus,complianceFlowStatusList);
} else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
citePliQueryWrap.lambda().in(ProjectLawsInventoryEO::getVerifyFlowStatus,complianceFlowStatusList);
}
List<ProjectLawsInventoryEO> citePliEoList = this.list(citePliQueryWrap);
if(CollectionUtils.isNotEmpty(citePliEoList)){
List<ProjectLawsInventoryEO> citePliEoListTemp = citePliEoList.stream().filter(citePliEo -> {
boolean serialNumberFlag = (StringUtils.equals(serialNumber,citePliEo.getSerialNumber()));
boolean dutyTerritoryFlag = Arrays.equals(dutyTerritory.split(","), citePliEo.getDutyTerritory().split(","));
boolean deliverableTypeFlag = false;
if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_DESIGN_CITE_DELIVERABLE.getValue())){
String designDeliverableType = json.getString("designDeliverableType");
deliverableTypeFlag = Arrays.equals(designDeliverableType.split(","), citePliEo.getDesignDeliverableType().split(","));
}else if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_VERIFY_CITE_DELIVERABLE.getValue())){
String verifyDeliverableType = json.getString("verifyDeliverableType");
deliverableTypeFlag = Arrays.equals(verifyDeliverableType.split(","), citePliEo.getVerifyDeliverableType().split(","));
}
return serialNumberFlag && dutyTerritoryFlag && deliverableTypeFlag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(citePliEoListTemp)){
ProjectLawsInventoryEO citePliEo = citePliEoListTemp.get(0);
String citePliEoId = citePliEo.getId();
QueryWrapper<ProcessInfoEO> citePiQueryWrap = new QueryWrapper<>();
citePiQueryWrap.lambda().eq(ProcessInfoEO::getProjectLawsInventoryId,citePliEoId);
citePiQueryWrap.lambda().eq(ProcessInfoEO::getFlowType,flowType);
citePiQueryWrap.orderByDesc("create_time");
List<ProcessInfoEO> citePiEoList = this.processInfoEOService.list(citePiQueryWrap);
if(CollectionUtils.isNotEmpty(citePiEoList)){
ProcessInfoEO citePiEo = citePiEoList.get(0);
String citePiEoActiProcInstId = citePiEo.getActiProcInstId();
List<String> taskDefinitionKeyList = new ArrayList<>();
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
taskDefinitionKeyList.add(DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue());
taskDefinitionKeyList.add(DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue());
} else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
taskDefinitionKeyList.add(VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue());
taskDefinitionKeyList.add(VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue());
}
QueryWrapper<ProcessHistoryEO> citePhQueryWrap = new QueryWrapper<>();
citePhQueryWrap.lambda().eq(ProcessHistoryEO::getActiProcInstId,citePiEoActiProcInstId);
citePhQueryWrap.lambda().in(ProcessHistoryEO::getTaskDefinitionKey,taskDefinitionKeyList);
citePhQueryWrap.orderByDesc("create_time");
List<ProcessHistoryEO> citePhEoList = this.processHistoryEOService.list(citePhQueryWrap);
if (CollectionUtils.isNotEmpty(citePhEoList)) {
citePhEo = citePhEoList.get(0);
}
}
}
if(ObjectUtils.isEmpty(citePhEo)){
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
resultMsg = "所选引用项目中,没有匹配到数据,请重新选择!";
}else {
resultMsg = "There is no matching data in the selected reference project. Please reselect!";
}
}
}else {
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
resultMsg = "所选引用项目中流程完成数据为空,请重新选择!";
}else {
resultMsg = "The process completion data in the selected reference project is empty, please reselect!";
}
}
return Result.OK(resultMsg,citePhEo);
}
}