【泛微流程接口】处理创建流程与提交流程的区分

【采购订单推送泛微】区分创建流程与提交流程
This commit is contained in:
tanfengling@x-ri.com 2025-10-17 17:06:33 +08:00
parent 36207396b8
commit 6453839d00
2 changed files with 14 additions and 15 deletions

View File

@ -499,11 +499,7 @@ public class FWImpl {
String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_XZCGDD");
FWRestfulUtils fwRestfulUtils = new FWRestfulUtils();
//如果单据上纯在泛微流程id重新提交调用泛微提交接口如果没有泛微流程id就调用新增接口
boolean isCreate = true;
if(StringUtils.isNotBlank(tqq9_fwrequestid)){
isCreate = false;
}
String resultStr = fwRestfulUtils.doBillAction(mainArr, detailRootArr, "新增采购单", fw_wfid_xzcgdd, billno, isCreate);
String resultStr = fwRestfulUtils.doBillAction(mainArr, detailRootArr, "新增采购单", fw_wfid_xzcgdd, billno, tqq9_fwrequestid);
return resultStr;
}

View File

@ -175,7 +175,7 @@ public class FWRestfulUtils {
* @param billno
* @return
*/
public String doBillAction(JSONArray mainData, JSONArray detailData, String requestName, String workflowid, String billno, boolean isCreate){
public String doBillAction(JSONArray mainData, JSONArray detailData, String requestName, String workflowid, String billno, String requestId){
Map<String, Object> registMap = regist();
if(registMap != null && registMap.size() > 0){
String spk = StrUtil.nullToEmpty((String) registMap.get("spk"));
@ -185,12 +185,21 @@ public class FWRestfulUtils {
if(StringUtils.isNotBlank(token)){
CloseableHttpResponse response;// 响应类,
CloseableHttpClient httpClient = HttpClients.createDefault();
//装填参数
List<BasicNameValuePair> list = new ArrayList<>();
list.add(new BasicNameValuePair("mainData", JSON.toJSONString(mainData)));
list.add(new BasicNameValuePair("detailData", JSON.toJSONString(detailData)));
//restful接口url
String url = "http://180.166.208.42:8043/";
if(isCreate){
url = url + "api/workflow/paService/doCreateRequest";
}else{
if(StringUtils.isNotBlank(requestId)){
url = url + "api/workflow/paService/submitRequest";
list.add(new BasicNameValuePair("requestId", requestId));
}else{
url = url + "api/workflow/paService/doCreateRequest";
list.add(new BasicNameValuePair("requestName", requestName));
list.add(new BasicNameValuePair("workflowId", workflowid));
}
HttpPost httpPost = new HttpPost(url);
//当前日期
@ -202,12 +211,6 @@ public class FWRestfulUtils {
RSA rsa = new RSA(null,spk);
//对用户信息进行加密传输,暂仅支持传输OA用户ID
String encryptUserid = rsa.encryptBase64("363", CharsetUtil.CHARSET_UTF_8, KeyType.PublicKey);
//装填参数
List<BasicNameValuePair> list = new ArrayList<>();
list.add(new BasicNameValuePair("mainData", JSON.toJSONString(mainData)));
list.add(new BasicNameValuePair("detailData", JSON.toJSONString(detailData)));
list.add(new BasicNameValuePair("requestName", requestName));
list.add(new BasicNameValuePair("workflowId", workflowid));
DynamicObject pushlog = BusinessDataServiceHelper.newDynamicObject("tqq9_fwpushlog");
pushlog.set("name", requestName);