Commit 1d8d86f2 authored by suhuiguang's avatar suhuiguang

1.撤回修改url参数拼接

parent ba362ad3
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aspose.words.SaveFormat; import com.aspose.words.SaveFormat;
...@@ -850,17 +849,14 @@ public class CommonServiceImpl implements ICommonService { ...@@ -850,17 +849,14 @@ public class CommonServiceImpl implements ICommonService {
* @param obj 自己的实体:taskType为BusinessTypeEnum code;nextExecuteUser * @param obj 自己的实体:taskType为BusinessTypeEnum code;nextExecuteUser
*/ */
public void rollbackTask(String id, JSONObject obj) { public void rollbackTask(String id, JSONObject obj) {
List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(id).getResult(); List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(id).getResult();
List<TaskV2Model> list = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList()); List<TaskV2Model> list = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
TaskV2Model model = list.get(0); TaskV2Model model = list.get(0);
Systemctl.taskV2Client.delete(String.valueOf(model.getSequenceNbr())); Systemctl.taskV2Client.delete(String.valueOf(model.getSequenceNbr()));
String urlParams = ""; String urlParams = "";
try { urlParams = "&" + toQueryParams2(obj);
urlParams = "&" + toQueryParams(obj);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
List<Map> urlList = JsonUtils.getResourceList(urlInfo); List<Map> urlList = JsonUtils.getResourceList(urlInfo);
if (list.size() > 1) { if (list.size() > 1) {
...@@ -911,6 +907,28 @@ public class CommonServiceImpl implements ICommonService { ...@@ -911,6 +907,28 @@ public class CommonServiceImpl implements ICommonService {
} }
} }
private static String toQueryParams2(JSONObject jsonObject) {
StringBuilder sb = new StringBuilder();
Set<String> keys = jsonObject.keySet();
keys.forEach(key->{
Object value = jsonObject.get(key);
if (sb.length() > 0) {
sb.append('&');
}
try {
sb.append(URLEncoder.encode(key, "UTF-8"))
.append('=')
.append(URLEncoder.encode(value.toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
});
return sb.toString();
}
public <T> String toQueryParams(T obj) throws UnsupportedEncodingException { public <T> String toQueryParams(T obj) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
...@@ -938,6 +956,9 @@ public class CommonServiceImpl implements ICommonService { ...@@ -938,6 +956,9 @@ public class CommonServiceImpl implements ICommonService {
return sb.length() > 0 ? sb.substring(0, sb.length() - 1) : ""; return sb.length() > 0 ? sb.substring(0, sb.length() - 1) : "";
} }
/** /**
* 根据流程状态name 获取流程状态code * 根据流程状态name 获取流程状态code
* *
......
...@@ -37,6 +37,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO; ...@@ -37,6 +37,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO; import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO; import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import org.apache.commons.lang3.SerializationUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -409,6 +410,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg ...@@ -409,6 +410,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
JgChangeRegistrationName jgChangeRegistrationName = new JgChangeRegistrationName(); JgChangeRegistrationName jgChangeRegistrationName = new JgChangeRegistrationName();
LambdaQueryWrapper<JgChangeRegistrationName> lambda = new QueryWrapper<JgChangeRegistrationName>().lambda(); LambdaQueryWrapper<JgChangeRegistrationName> lambda = new QueryWrapper<JgChangeRegistrationName>().lambda();
lambda.eq(JgChangeRegistrationName::getInstanceId, instanceId); lambda.eq(JgChangeRegistrationName::getInstanceId, instanceId);
jgChangeRegistrationName = this.getOne(lambda);
List<String> roleListNext = new ArrayList<>(); List<String> roleListNext = new ArrayList<>();
List<String> roleListAll = new ArrayList<>(); List<String> roleListAll = new ArrayList<>();
ProcessTaskDTO processTaskDTO = cmWorkflowService.rollBack(instanceId); ProcessTaskDTO processTaskDTO = cmWorkflowService.rollBack(instanceId);
...@@ -426,10 +428,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg ...@@ -426,10 +428,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
// 更新下一步可执行人 // 更新下一步可执行人
String nextUserIds = workflowResultDtos.get(0).getNextExecutorUserIds(); String nextUserIds = workflowResultDtos.get(0).getNextExecutorUserIds();
jgChangeRegistrationName.setNextExecuteUserIds(nextUserIds); jgChangeRegistrationName.setNextExecuteUserIds(nextUserIds);
this.update(jgChangeRegistrationName, lambda); this.updateById(jgChangeRegistrationName);
// 删除待办 // 删除待办
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationName)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(jgChangeRegistrationName));
jsonObject.put("nextTaskId", jgChangeRegistrationName.getNextTaskId());
jsonObject.put("nextExecuteUser", jgChangeRegistrationName.getNextExecutorIds()); jsonObject.put("nextExecuteUser", jgChangeRegistrationName.getNextExecutorIds());
jsonObject.put("taskType", BusinessTypeEnum.JG_NAME_CHANGE_REGISTRATION.getCode()); jsonObject.put("taskType", BusinessTypeEnum.JG_NAME_CHANGE_REGISTRATION.getCode());
jsonObject.put("flowStatus", this.getTaskCodeByName(jgChangeRegistrationName.getAuditStatus())); jsonObject.put("flowStatus", this.getTaskCodeByName(jgChangeRegistrationName.getAuditStatus()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment