|
@@ -5,8 +5,13 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.ims.eval.config.ImaConfig;
|
|
import com.ims.eval.config.ImaConfig;
|
|
import com.ims.eval.entity.custom.DoAction;
|
|
import com.ims.eval.entity.custom.DoAction;
|
|
import com.ims.eval.entity.custom.IsOkAction;
|
|
import com.ims.eval.entity.custom.IsOkAction;
|
|
|
|
+import com.ims.eval.entity.custom.Menu;
|
|
import com.ims.eval.entity.custom.TodoTask;
|
|
import com.ims.eval.entity.custom.TodoTask;
|
|
|
|
+import com.ims.eval.entity.flow.FlowResult;
|
|
|
|
+import com.ims.eval.service.IDeptResponsibilityService;
|
|
|
|
+import com.ims.eval.service.IOrganizationEvaluationService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.ibatis.annotations.Case;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.*;
|
|
import org.springframework.http.*;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -14,6 +19,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashMap;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@@ -35,6 +41,12 @@ public class WorkflowService {
|
|
@Autowired
|
|
@Autowired
|
|
private ImaConfig imaConfig;
|
|
private ImaConfig imaConfig;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IDeptResponsibilityService deptResponsibilityService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IOrganizationEvaluationService organizationEvaluationService;
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -117,6 +129,15 @@ public class WorkflowService {
|
|
ResponseEntity<String> responseEntity2 = restTemplate.exchange("http://10.65.78.23:8080/bpm/task/doAction", HttpMethod.POST,param,String.class);
|
|
ResponseEntity<String> responseEntity2 = restTemplate.exchange("http://10.65.78.23:8080/bpm/task/doAction", HttpMethod.POST,param,String.class);
|
|
log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
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.getInstanceId(),isOkAction.getDefKey(),isOkAction.getBizKey(),isOkAction.getTaskName());
|
|
|
|
+ if(biz){
|
|
|
|
+ log.info("状态修改成功");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return JSON.parseObject(responseEntity2.getBody());
|
|
return JSON.parseObject(responseEntity2.getBody());
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
@@ -148,4 +169,48 @@ public class WorkflowService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取流程意见
|
|
|
|
+ * @param instId
|
|
|
|
+ * @param iamCode
|
|
|
|
+ * @param request
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ 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("http://10.65.78.23:8080/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()){
|
|
|
|
+ return JSON.parseObject(responseEntity2.getBody());
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private boolean updateWorkflowState(String instanceId, String defKey, String bizKey,String taskName) {
|
|
|
|
+
|
|
|
|
+ switch (defKey) {
|
|
|
|
+ case "dwkpmbqd"://单位考评目标启动
|
|
|
|
+ deptResponsibilityService.editState(bizKey,taskName);
|
|
|
|
+ break;
|
|
|
|
+ case "yddwkplc"://月度单位考评流程
|
|
|
|
+ organizationEvaluationService.editState(bizKey,taskName);
|
|
|
|
+ break;
|
|
|
|
+ case "dwkpmbxd"://单位考评目标修订
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|