浏览代码

Merge remote-tracking branch 'origin/master'

全业务考评 1 年之前
父节点
当前提交
321c9a04e9

+ 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);
+	boolean editState(String id, String state, String instId, String action);
 
 	Object processInformation(String instId, HttpServletRequest request);
 }

+ 51 - 49
ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/impl/WorkflowServiceImpl.java

@@ -3,6 +3,7 @@ package com.ims.eval.service.custom.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.ims.eval.config.ImaConfig;
+import com.ims.eval.entity.DeptAssessmentDeclaration;
 import com.ims.eval.entity.custom.DoAction;
 import com.ims.eval.entity.custom.IsOkAction;
 import com.ims.eval.entity.custom.TodoTask;
@@ -68,7 +69,7 @@ public class WorkflowServiceImpl {
 	private WorkflowSeasonServiceImpl workflowSeasonService;
 
 	@Autowired
-	private  WorkflowYearsServiceImpl workflowYearsService;
+	private WorkflowYearsServiceImpl workflowYearsService;
 
 	/**
 	 * 发起流程
@@ -89,13 +90,13 @@ public class WorkflowServiceImpl {
 		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);
+		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());
 		if (200 == responseEntity2.getStatusCodeValue()) {
 			FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
 
 			if (result.getIsOk()) {
-				boolean biz = updateWorkflowState(result.getData(), doAction.getDefKey(), doAction.getBusinessKey(), "");
+				boolean biz = updateWorkflowState(result.getData(), doAction.getDefKey(), doAction.getBusinessKey(), "", doAction.getAction());
 				if (biz) {
 					log.info("保存流程实例id成功");
 				}
@@ -124,7 +125,7 @@ public class WorkflowServiceImpl {
 		map.put("offset", todoTask.getOffset());
 		map.put("limit", todoTask.getLimit());
 		HttpEntity<Map> param = new HttpEntity<>(map, headers);
-		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() +"/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
+		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
 		//
 		if (200 == responseEntity2.getStatusCodeValue()) {
@@ -133,26 +134,27 @@ public class WorkflowServiceImpl {
 				List<JSONObject> ds = new ArrayList<>();
 				for (int i = 0; i < result.getRows().size(); i++) {
 					String typeId = result.getRows().getJSONObject(i).get("typeId").toString();
-					if(!"440219646351376385".equals(typeId)){
+					if (!"440219646351376385".equals(typeId)) {
 						ds.add(result.getRows().getJSONObject(i));
 						continue;
 					}
 				}
 				result.getRows().removeAll(ds);
 			}
-				return result;
-			}
-			return null;
+			return result;
 		}
+		return null;
+	}
 
 
 	/**
 	 * 检查当前数据(对应的用户)是或否存在代办
+	 *
 	 * @param instId
 	 * @param request
 	 * @return
 	 */
-	public boolean todoTaskList2(String instId,HttpServletRequest request) {
+	public boolean todoTaskList2(String instId, HttpServletRequest request) {
 		try {
 			HttpHeaders headers = new HttpHeaders();
 			headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
@@ -165,7 +167,7 @@ public class WorkflowServiceImpl {
 			map.put("offset", "");
 			map.put("limit", "99999");
 			HttpEntity<Map> param = new HttpEntity<>(map, headers);
-			ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() +"/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
+			ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
 			log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
 			//
 			if (200 == responseEntity2.getStatusCodeValue()) {
@@ -174,12 +176,12 @@ public class WorkflowServiceImpl {
 					List<JSONObject> ds = new ArrayList<>();
 					for (int i = 0; i < result.getRows().size(); i++) {
 						String typeId = result.getRows().getJSONObject(i).get("typeId").toString();
-						if(!"440219646351376385".equals(typeId)){
+						if (!"440219646351376385".equals(typeId)) {
 							ds.add(result.getRows().getJSONObject(i));
 							continue;
 						}
 						String resinstId = result.getRows().getJSONObject(i).get("instId").toString();
-						if(instId.equals(resinstId)){
+						if (instId.equals(resinstId)) {
 							return true;
 						}
 					}
@@ -193,44 +195,44 @@ public class WorkflowServiceImpl {
 	}
 
 
-
 	/**
 	 * 流程审批
+	 *
 	 * @param isOkAction
 	 * @return
 	 */
-	public JSONObject isOkAction(IsOkAction isOkAction, HttpServletRequest request){
+	public JSONObject isOkAction(IsOkAction isOkAction, HttpServletRequest request) {
 		HttpHeaders headers = new HttpHeaders();
 		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
 		headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
 		headers.add("code", request.getHeader("code"));
 
 		//流程开始前的动作
-		if(!"reject".equals(isOkAction.getAction())){
-			beforeCheckAction("",isOkAction.getDefKey(),isOkAction.getBizKey(),isOkAction.getTaskName());
+		if (!"reject".equals(isOkAction.getAction())) {
+			beforeCheckAction("", isOkAction.getDefKey(), isOkAction.getBizKey(), isOkAction.getTaskName());
 		}
 
 		Map<String, String> map = new LinkedHashMap<>();
 
-		map.put("taskId",isOkAction.getTaskId());
-		map.put("nodeId",isOkAction.getNodeId());
-		map.put("action",isOkAction.getAction());
+		map.put("taskId", isOkAction.getTaskId());
+		map.put("nodeId", isOkAction.getNodeId());
+		map.put("action", isOkAction.getAction());
 		//发起提条件不是同意
-		if(!"agree".equals(isOkAction.getAction())){
-			map.put("destination",isOkAction.getDestination());
+		if (!"agree".equals(isOkAction.getAction())) {
+			map.put("destination", isOkAction.getDestination());
 		}
-		map.put("instanceId",isOkAction.getInstanceId());
-		map.put("opinion",isOkAction.getOpinion());
-		map.put("iamCode",isOkAction.getIamCode());
+		map.put("instanceId", isOkAction.getInstanceId());
+		map.put("opinion", isOkAction.getOpinion());
+		map.put("iamCode", isOkAction.getIamCode());
 		HttpEntity<Map> param = new HttpEntity<>(map, headers);
-		ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() +"/bpm/task/doAction", HttpMethod.POST,param,String.class);
+		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());
-		if(200== responseEntity2.getStatusCodeValue()){
+		if (200 == responseEntity2.getStatusCodeValue()) {
 
 			FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
-			if(result.getIsOk()){
-				boolean biz = updateWorkflowState("",isOkAction.getDefKey(),isOkAction.getBizKey(),isOkAction.getTaskName());
-				if(biz){
+			if (result.getIsOk()) {
+				boolean biz = updateWorkflowState("", isOkAction.getDefKey(), isOkAction.getBizKey(), isOkAction.getTaskName(), isOkAction.getAction());
+				if (biz) {
 					log.info("状态修改成功");
 				}
 			}
@@ -243,23 +245,24 @@ public class WorkflowServiceImpl {
 
 	/**
 	 * 获取业务id
+	 *
 	 * @param id
 	 * @param iamCode
 	 * @param request
 	 * @return
 	 */
-	public JSONObject getInstanceAndChildren(String id,String iamCode, HttpServletRequest request){
+	public JSONObject getInstanceAndChildren(String id, String iamCode, HttpServletRequest request) {
 		HttpHeaders headers = new HttpHeaders();
 		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
 		headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
 		headers.add("code", request.getHeader("code"));
 
 		HttpEntity<Map> param = new HttpEntity<>(null, headers);
-		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getFlowUrl() +"/bpm/instance/getInstanceAndChildren?id={1}&iamCode={2}",
+		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getFlowUrl() + "/bpm/instance/getInstanceAndChildren?id={1}&iamCode={2}",
 			param, String.class, id, iamCode);
 
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
-		if(200== responseEntity2.getStatusCodeValue()){
+		if (200 == responseEntity2.getStatusCodeValue()) {
 			return JSON.parseObject(responseEntity2.getBody());
 		}
 		return null;
@@ -268,57 +271,56 @@ public class WorkflowServiceImpl {
 
 	/**
 	 * 获取流程审批意见
+	 *
 	 * @param instId
 	 * @param iamCode
 	 * @param request
 	 * @return
 	 */
-	public JSONObject getOpinion(String instId,String iamCode, HttpServletRequest request){
+	public JSONObject getOpinion(String instId, String iamCode, HttpServletRequest request) {
 		HttpHeaders headers = new HttpHeaders();
 		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
 		headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
 		headers.add("code", request.getHeader("code"));
 
 		HttpEntity<Map> param = new HttpEntity<>(null, headers);
-		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getFlowUrl() +"/bpm/instance/getOpinion?instId={1}&iamCode={2}",
+		ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getFlowUrl() + "/bpm/instance/getOpinion?instId={1}&iamCode={2}",
 			param, String.class, instId, iamCode);
 
 		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
-		if(200== responseEntity2.getStatusCodeValue()){
+		if (200 == responseEntity2.getStatusCodeValue()) {
 			return JSON.parseObject(responseEntity2.getBody());
 		}
 		return null;
 	}
 
 
-
-
-	private boolean updateWorkflowState(String instId, String defKey, String bizKey,String taskName) {
+	private boolean updateWorkflowState(String instId, String defKey, String bizKey, String taskName, String action) {
 
 		switch (defKey) {
 			case "dwkpmbqd"://单位考评目标启动
-				deptResponsibilityService.editState(bizKey,taskName,instId);
+				deptResponsibilityService.editState(bizKey, taskName, instId);
 				break;
 			case "yddwkplc"://月度单位考评流程
-				organizationEvaluationService.editState(bizKey, taskName,instId);
+				organizationEvaluationService.editState(bizKey, taskName, instId);
 				break;
 			case "jddwkplc"://季度单位考评流程
-				 organizationEvaluationService.editState(bizKey, taskName,instId);
+				organizationEvaluationService.editState(bizKey, taskName, instId);
 				break;
 			case "nddwkplc"://年度单位考评流程
-				organizationEvaluationService.editState(bizKey, taskName,instId);
+				organizationEvaluationService.editState(bizKey, taskName, instId);
 				break;
 			case "dwkpmbxd"://单位考评目标修订
-				evaluationRevisionService.editState(bizKey,taskName,instId);
+				evaluationRevisionService.editState(bizKey, taskName, instId);
 				break;
 			case "bbbmyjzbjh"://本部部门业绩指标计划
-				evaluationDeptBusinessPlanService.editState(bizKey,taskName,instId);
+				evaluationDeptBusinessPlanService.editState(bizKey, taskName, instId);
 				break;
 			case "bbbmyjzbkh"://本部部门业绩指标考核
-				evaluationDeptBusinessAssessmentService.editState(bizKey,taskName,instId);
+				evaluationDeptBusinessAssessmentService.editState(bizKey, taskName, instId);
 				break;
 			case "jxjgkhsb"://绩效结果考核申报
-				deptAssessmentDeclarationService.editState(bizKey,taskName,instId);
+				deptAssessmentDeclarationService.editState(bizKey, taskName, instId, action);
 				break;
 		}
 		return true;
@@ -331,13 +333,13 @@ public class WorkflowServiceImpl {
 			case "dwkpmbqd"://单位考评目标启动
 				break;
 			case "yddwkplc"://月度单位考评流程
-				workflowMonthService.beforeCheckAction(instId,defKey,bizKey,taskName);
+				workflowMonthService.beforeCheckAction(instId, defKey, bizKey, taskName);
 				break;
 			case "jddwkplc"://季度单位考评流程
-				workflowSeasonService.beforeCheckAction(instId,defKey,bizKey,taskName);
+				workflowSeasonService.beforeCheckAction(instId, defKey, bizKey, taskName);
 				break;
 			case "nddwkplc"://年度单位考评流程
-				workflowYearsService.beforeCheckAction(instId,defKey,bizKey,taskName);
+				workflowYearsService.beforeCheckAction(instId, defKey, bizKey, taskName);
 				break;
 			case "dwkpmbxd"://单位考评目标修订
 				break;

+ 7 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/DeptAssessmentDeclarationServiceImpl.java

@@ -172,7 +172,7 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 	}
 
 	@Override
-	public boolean editState(String id, String state, String instId) {
+	public boolean editState(String id, String state, String instId, String action) {
 		DeptAssessmentDeclaration deptAssessmentDeclaration = baseMapper.selectById(id);
 		if (StringUtils.isNotEmpty(state)) {
 			if ("组织人事部审核".equals(state)) {
@@ -183,7 +183,12 @@ public class DeptAssessmentDeclarationServiceImpl extends ServiceImpl<DeptAssess
 		if (StringUtils.isNotEmpty(instId)) {
 			deptAssessmentDeclaration.setInstId(instId);
 		}
-		super.updateById(deptAssessmentDeclaration);
+		if (StringUtils.isNotEmpty(action)) {
+			if ("manualEnd".equals(action)) {
+				deptAssessmentDeclaration.setStage("流程已结束");
+			}
+		}
+		baseMapper.updateById(deptAssessmentDeclaration);
 		if ("流程已结束".equals(deptAssessmentDeclaration.getStage())) {
 			QueryWrapper<EvaluationDeptRating> qw = new QueryWrapper<>();
 			if (StringUtils.isNotEmpty(deptAssessmentDeclaration.getDeptId())) {