Browse Source

绩效结果考核申报代码优化;问题修改;

wangcahngsheng 1 year ago
parent
commit
955c4fc5d8

+ 1 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IDeptAssessmentDeclarationService.java

@@ -21,7 +21,7 @@ public interface IDeptAssessmentDeclarationService extends IService<DeptAssessme
 
 	boolean removeByIds(List<String> ids);
 
-	boolean editState(String id, String state, String instId, String action);
+	boolean editState(String id, String state, String instId, String destination);
 
 	Object processInformation(String instId, HttpServletRequest request);
 }

+ 8 - 5
ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/impl/WorkflowServiceImpl.java

@@ -2,6 +2,7 @@ package com.ims.eval.service.custom.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.ims.common.utils.StringUtils;
 import com.ims.eval.config.ImaConfig;
 import com.ims.eval.entity.DeptAssessmentDeclaration;
 import com.ims.eval.entity.custom.DoAction;
@@ -88,7 +89,6 @@ public class WorkflowServiceImpl {
 		map.put("businessKey", doAction.getBusinessKey());
 		map.put("action", doAction.getAction());
 		map.put("opinion", doAction.getOpinion());
-
 		HttpEntity<Map> param = new HttpEntity<>(map, headers);
 		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/instance/doAction", HttpMethod.POST, param, String.class);
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
@@ -96,7 +96,7 @@ public class WorkflowServiceImpl {
 			FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
 
 			if (result.getIsOk()) {
-				boolean biz = updateWorkflowState(result.getData(), doAction.getDefKey(), doAction.getBusinessKey(), "", doAction.getAction());
+				boolean biz = updateWorkflowState(result.getData(), doAction.getDefKey(), doAction.getBusinessKey(), "", "");
 				if (biz) {
 					log.info("保存流程实例id成功");
 				}
@@ -224,6 +224,9 @@ public class WorkflowServiceImpl {
 		map.put("instanceId", isOkAction.getInstanceId());
 		map.put("opinion", isOkAction.getOpinion());
 		map.put("iamCode", isOkAction.getIamCode());
+		if ("EndNoneEvent1".equals(isOkAction.getDestination())){
+			map.put("destination", isOkAction.getDestination());
+		}
 		HttpEntity<Map> param = new HttpEntity<>(map, headers);
 		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/task/doAction", HttpMethod.POST, param, String.class);
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
@@ -231,7 +234,7 @@ public class WorkflowServiceImpl {
 
 			FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
 			if (result.getIsOk()) {
-				boolean biz = updateWorkflowState("", isOkAction.getDefKey(), isOkAction.getBizKey(), isOkAction.getTaskName(), isOkAction.getAction());
+				boolean biz = updateWorkflowState("", isOkAction.getDefKey(), isOkAction.getBizKey(), isOkAction.getTaskName(), isOkAction.getDestination());
 				if (biz) {
 					log.info("状态修改成功");
 				}
@@ -295,7 +298,7 @@ public class WorkflowServiceImpl {
 	}
 
 
-	private boolean updateWorkflowState(String instId, String defKey, String bizKey, String taskName, String action) {
+	private boolean updateWorkflowState(String instId, String defKey, String bizKey, String taskName, String destination) {
 
 		switch (defKey) {
 			case "dwkpmbqd"://单位考评目标启动
@@ -320,7 +323,7 @@ public class WorkflowServiceImpl {
 				evaluationDeptBusinessAssessmentService.editState(bizKey, taskName, instId);
 				break;
 			case "jxjgkhsb"://绩效结果考核申报
-				deptAssessmentDeclarationService.editState(bizKey, taskName, instId, action);
+				deptAssessmentDeclarationService.editState(bizKey, taskName, instId, destination);
 				break;
 		}
 		return true;

+ 12 - 3
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptAssessmentDeclarationServiceImpl.java

@@ -94,6 +94,15 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 		deptAssessmentDeclaration.setRatingGrade(deptAssessmentDeclaration.getDeclarationLevel());
 		deptAssessmentDeclaration.setStage("流程未启动");
 		deptAssessmentDeclaration.setCreateTime(DateUtil.date());
+
+		deptAssessmentDeclaration.setDeptLeaderId("0");
+		deptAssessmentDeclaration.setDeptLeaderNo("0");
+		deptAssessmentDeclaration.setDeptLeaderName("0");
+
+		deptAssessmentDeclaration.setSeconderId("0");
+		deptAssessmentDeclaration.setSeconderNo("0");
+		deptAssessmentDeclaration.setSeconderName("0");
+
 		List<DeptAssessmentDeclarationContent> deptAssessmentDeclarationContentList = new ArrayList<>();
 		QueryWrapper<EvaluationDept> deptQw = new QueryWrapper<>();
 		if (StringUtils.isNotEmpty(deptAssessmentDeclaration.getDeptId())) {
@@ -172,7 +181,7 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 	}
 
 	@Override
-	public boolean editState(String id, String state, String instId, String action) {
+	public boolean editState(String id, String state, String instId, String destination) {
 		DeptAssessmentDeclaration deptAssessmentDeclaration = baseMapper.selectById(id);
 		if (StringUtils.isNotEmpty(state)) {
 			if ("组织人事部审核".equals(state)) {
@@ -183,8 +192,8 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 		if (StringUtils.isNotEmpty(instId)) {
 			deptAssessmentDeclaration.setInstId(instId);
 		}
-		if (StringUtils.isNotEmpty(action)) {
-			if ("manualEnd".equals(action)) {
+		if (StringUtils.isNotEmpty(destination)) {
+			if ("EndNoneEvent1".equals(destination)) {
 				deptAssessmentDeclaration.setStage("流程已结束");
 			}
 		}