流程待办集成0.4:泛微syscode根据单据配置化
This commit is contained in:
parent
50e677b4d4
commit
29115f3041
|
@ -10,6 +10,7 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
|
@ -25,6 +26,8 @@ import org.springframework.http.MediaType;
|
|||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.json.JsonObject;
|
||||
|
||||
public class MessageListen extends AbstractMessageServiceHandler {
|
||||
private static final Log log = LogFactory.getLog(MessageListen.class);
|
||||
static Map<String, String> processInstanceStateMap = new HashMap();
|
||||
|
@ -184,6 +187,7 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
Long startUserId = messageContext.getStartUserId();
|
||||
String startUserMobile = "";
|
||||
String startUserName = "";
|
||||
String startUserTrueName = "";
|
||||
Long executionId = messageContext.getExecutionId();
|
||||
String executionName = "";
|
||||
Long taskId = messageContext.getTaskId();
|
||||
|
@ -202,12 +206,14 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
String billno = "";
|
||||
String title = isdel ? "流程撤回" : toDoInfo.getContent();
|
||||
String entityName = messageContext.getEntityName();
|
||||
if (title != null) {
|
||||
int dex = title.indexOf("单", 0);
|
||||
if (dex != -1) {
|
||||
title = title.substring(dex);//截取单后面的字符串
|
||||
}
|
||||
}
|
||||
// if (title != null) {
|
||||
// int dex = title.indexOf("单", 0);
|
||||
// if (dex != -1) {
|
||||
// title = title.substring(dex);//截取单后面的字符串
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// if (title == null) {
|
||||
// title = "任务:" + taskId + "已办";
|
||||
// }
|
||||
|
@ -228,6 +234,7 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
if (startUser != null) {
|
||||
startUserMobile = startUser.getString("phone");
|
||||
startUserName = startUser.getString("username");
|
||||
startUserTrueName = startUser.getString("name");
|
||||
}
|
||||
|
||||
|
||||
|
@ -316,15 +323,18 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
userNames.add(startUserName);
|
||||
List<Map<String, Object>> requestBodyList = new ArrayList();
|
||||
Iterator var47 = userNames.iterator();
|
||||
String syscode = System.getProperty("cxkg.integration.MessageListen.oakey");
|
||||
JSONObject jsonCode = JSON.parseObject(syscode);
|
||||
title = "请处理" + startUserTrueName + "提交的" + entityName + ":" + messageContext.getBillNo();
|
||||
|
||||
while (var47.hasNext()) {
|
||||
String userName = (String) var47.next();
|
||||
if (userName.equals(startUserName)) {
|
||||
Map<String, Object> requestBody = new HashMap();
|
||||
requestBody.put("syscode", "JD");
|
||||
requestBody.put("syscode", jsonCode.getString(entityName));
|
||||
requestBody.put("flowid", String.valueOf(processInstanceId));
|
||||
requestBody.put("requestname", "主题:"+title);
|
||||
requestBody.put("workflowname", entityName + "审批流程");
|
||||
requestBody.put("requestname", title);
|
||||
requestBody.put("workflowname", entityName); // + "审批流程"
|
||||
requestBody.put("nodename", taskName);
|
||||
requestBody.put("pcurl", url + "&closeType=closeWin");
|
||||
requestBody.put("appurl", url != null ? getAppurl(url) : null);
|
||||
|
@ -342,7 +352,7 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
// requestBodyList.add(requestBody);
|
||||
} else {
|
||||
Map<String, Object> requestBody = new HashMap();
|
||||
requestBody.put("syscode", "JD");
|
||||
requestBody.put("syscode", jsonCode.getString(entityName));
|
||||
requestBody.put("flowid", String.valueOf(processInstanceId));
|
||||
if (title != null) {
|
||||
requestBody.put("requestname", title);
|
||||
|
@ -350,7 +360,7 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
requestBody.put("requestname", entityName);
|
||||
}
|
||||
|
||||
requestBody.put("workflowname", entityName + "审批流程");
|
||||
requestBody.put("workflowname", entityName);// + "审批流程"
|
||||
requestBody.put("nodename", taskName);
|
||||
requestBody.put("pcurl", url);
|
||||
requestBody.put("appurl", getAppurl(url));
|
||||
|
@ -642,7 +652,8 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
// String kd21_largetextfield = kd21_oa_matters.getString("kd21_largetextfield");
|
||||
// String apiUrl = kd21_largetextfield;
|
||||
// "/api/hrm/resful/getHrmUserInfoWithPage"
|
||||
String apiUrl = "http://" + "10.157.226.9:8088" + "/rest/ofs/ReceiveRequestInfoByJson";
|
||||
// "http://" + "10.157.226.9:8088"
|
||||
String apiUrl = System.getProperty("cxkg.integration.MessageListen.apiUrl") + "/rest/ofs/ReceiveRequestInfoByJson";
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
@ -761,7 +772,7 @@ public class MessageListen extends AbstractMessageServiceHandler {
|
|||
// DynamicObject kd21_oa_matters = BusinessDataServiceHelper.loadSingle("kd21_oa_matters", "id,name,kd21_largetextfield", new QFilter[]{filter});
|
||||
// String kd21_largetextfield = kd21_oa_matters.getString("kd21_largetextfield");
|
||||
// String apiUrl = kd21_largetextfield;
|
||||
String apiUrl = "http://" + "10.157.226.9:8088" + "/rest/ofs/deleteUserRequestInfoByJson";
|
||||
String apiUrl = System.getProperty("cxkg.integration.MessageListen.apiUrl") + "/rest/ofs/deleteUserRequestInfoByJson";
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
|
Loading…
Reference in New Issue