|
@@ -1,10 +1,13 @@
|
|
|
package com.huyi.flowable.message;
|
|
|
|
|
|
+import com.huyi.flowable.api.FlowProcess;
|
|
|
import com.huyi.flowable.mapper.MeHistoryMapper;
|
|
|
import com.huyi.flowable.server.mapper.MessageMapper;
|
|
|
import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.flowable.engine.IdentityService;
|
|
|
+import org.flowable.engine.ProcessEngine;
|
|
|
+import org.flowable.engine.RuntimeService;
|
|
|
import org.flowable.engine.TaskService;
|
|
|
import org.flowable.engine.runtime.ProcessInstance;
|
|
|
import org.flowable.identitylink.api.IdentityLink;
|
|
@@ -26,13 +29,16 @@ public class MessageService {
|
|
|
protected IdentityService identityService;
|
|
|
@Autowired
|
|
|
protected MeHistoryMapper meHistoryMapper;
|
|
|
+ @Autowired
|
|
|
+ protected RuntimeService runtimeService;
|
|
|
|
|
|
//TODO 不同项目不适用
|
|
|
public void addStartFlowMessage(ProcessInstance instance){
|
|
|
if (instance == null) {
|
|
|
return;
|
|
|
}
|
|
|
- Map<String, Object> paras = instance.getProcessVariables();
|
|
|
+ Map<String, Object> paras = runtimeService.getVariables(instance.getId());
|
|
|
+// Map<String, Object> paras = instance.getProcessVariables();
|
|
|
System.out.println("paras======>"+paras);
|
|
|
// 获取公司ID
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
@@ -49,7 +55,7 @@ public class MessageService {
|
|
|
param.put("openType", "01");
|
|
|
// 融资审批
|
|
|
if ("1000000006".equals(menuId)) {
|
|
|
- param.put("workType", "03");
|
|
|
+ param.put("workType", "08");
|
|
|
//TODO 加标题
|
|
|
param.put("title","加标题");
|
|
|
// 融信审批
|
|
@@ -110,4 +116,26 @@ public class MessageService {
|
|
|
System.out.println("消息增加失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void completeMessage(ProcessInstance instance){
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ String businessKey = instance.getBusinessKey();
|
|
|
+ param.put("tableId", businessKey);
|
|
|
+
|
|
|
+ // 获取公司ID
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("procdefId", instance.getProcessDefinitionId());
|
|
|
+ List<Map<String, Object>> historyList = meHistoryMapper.queryMeHistory(map);
|
|
|
+ // 1000000006 为融资审批,其他为融信审批
|
|
|
+ String menuId = historyList.get(0).get("menuId").toString();
|
|
|
+
|
|
|
+ // 融资审批
|
|
|
+ if ("1000000006".equals(menuId)) {
|
|
|
+ param.put("workType", "08");
|
|
|
+ // 融信审批
|
|
|
+ } else {
|
|
|
+ param.put("workType", "00");
|
|
|
+ }
|
|
|
+ messageMapper.updateNotice(param);
|
|
|
+ }
|
|
|
}
|