Commit f2e90cf2 authored by tianyiming's avatar tianyiming

工作台待办bug修改

parent 030d8193
...@@ -185,6 +185,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -185,6 +185,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
*/ */
@SuppressWarnings({"rawtypes", "Duplicates"}) @SuppressWarnings({"rawtypes", "Duplicates"})
public JgInstallationNoticeDto updateInstallationNotice(String submitType, JgInstallationNoticeDto noticeDto, String op) { public JgInstallationNoticeDto updateInstallationNotice(String submitType, JgInstallationNoticeDto noticeDto, String op) {
boolean instancedId = ObjectUtils.isEmpty(noticeDto.getInstanceId());
if (Objects.isNull(noticeDto) || StringUtils.isEmpty(submitType)) { if (Objects.isNull(noticeDto) || StringUtils.isEmpty(submitType)) {
throw new IllegalArgumentException("参数不能为空"); throw new IllegalArgumentException("参数不能为空");
} }
...@@ -231,11 +232,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -231,11 +232,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
notice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode())); notice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_PROCESSED.getCode()));
jgInstallationNoticeMapper.updateById(notice); jgInstallationNoticeMapper.updateById(notice);
} }
HashMap<String, Object> map = new HashMap<>(); if (!instancedId) {
map.put("relationId", notice.getInstanceId()); HashMap<String, Object> map = new HashMap<>();
map.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode()); map.put("relationId", notice.getInstanceId());
map.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName()); map.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskModel(map); map.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskModel(map);
}
TaskV2Model taskV2Model = new TaskV2Model(); TaskV2Model taskV2Model = new TaskV2Model();
//获取待办任务执行人 //获取待办任务执行人
List<AgencyUserModel> userList = Privilege.agencyUserClient List<AgencyUserModel> userList = Privilege.agencyUserClient
...@@ -250,7 +254,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -250,7 +254,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskV2Model.setTaskType("installNotice"); taskV2Model.setTaskType("installNotice");
taskV2Model.setTaskTypeLabel("安装告知"); taskV2Model.setTaskTypeLabel("安装告知");
String url = getUrl(taskV2Model.getTaskType(), "look"); String url = getUrl(taskV2Model.getTaskType(), "look");
String format = String.format(url, notice.getSequenceNbr(), roleIds, notice.getNextExecuteIds(), notice.getNoticeStatus()); String format = String.format(url, notice.getSequenceNbr(), notice.getNextExecuteIds(), notice.getNextExecuteIds(), notice.getNoticeStatus(), notice.getInstanceId());
taskV2Model.setRoutePath(format); taskV2Model.setRoutePath(format);
...@@ -554,7 +558,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -554,7 +558,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskV2Model.setTaskType("installNotice"); taskV2Model.setTaskType("installNotice");
taskV2Model.setTaskTypeLabel("安装告知"); taskV2Model.setTaskTypeLabel("安装告知");
String url = getUrl(taskV2Model.getTaskType(), "look"); String url = getUrl(taskV2Model.getTaskType(), "look");
String format = String.format(url, item.getSequenceNbr(), roleIds, item.getNextExecuteIds(), item.getNoticeStatus()); String format = String.format(url, item.getSequenceNbr(), item.getNextExecuteIds(), item.getNextExecuteIds(), item.getNoticeStatus(), item.getInstanceId());
taskV2Model.setRoutePath(format); taskV2Model.setRoutePath(format);
taskV2Model.setTaskTitle(item.getStatus()); taskV2Model.setTaskTitle(item.getStatus());
taskV2Model.setTaskName(item.getStatus()); taskV2Model.setTaskName(item.getStatus());
...@@ -880,13 +884,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -880,13 +884,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
map.put("relationId", jgInstallationNotice.getInstanceId()); map.put("relationId", jgInstallationNotice.getInstanceId());
map.put("taskStatus", FlowStatusEnum.REJECTED.getCode()); map.put("taskStatus", FlowStatusEnum.REJECTED.getCode());
map.put("taskStatusLabel", FlowStatusEnum.REJECTED.getName()); map.put("taskStatusLabel", FlowStatusEnum.REJECTED.getName());
updateTaskModel(map); TaskV2Model taskV2ModelOld = updateTaskModel(map);
TaskV2Model taskV2Model = new TaskV2Model(); TaskV2Model taskV2Model = new TaskV2Model();
//获取待办任务执行人 //获取待办任务执行人
List<AgencyUserModel> userList = Privilege.agencyUserClient List<AgencyUserModel> userList = Privilege.agencyUserClient
.queryByRoleId(jgInstallationNotice.getNextExecuteIds(), null,Boolean.FALSE).getResult(); .queryByRoleId(jgInstallationNotice.getNextExecuteIds(), null,Boolean.FALSE).getResult();
List<String> userIds = userList.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList()); List<String> userIds = userList.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
taskV2Model.setExecuteUserIds(CollectionUtils.isEmpty(userIds)?"": String.join(",", userIds)); taskV2Model.setExecuteUserIds(taskV2ModelOld.getCreateUserId());
taskV2Model.setExtras(JSON.toJSONString(jgInstallationNotice)); taskV2Model.setExtras(JSON.toJSONString(jgInstallationNotice));
taskV2Model.setRelationId(jgInstallationNotice.getInstanceId()); taskV2Model.setRelationId(jgInstallationNotice.getInstanceId());
Map<String, Object> userOrgRoleMap = FeignUtil.remoteCall(() -> Privilege.userOrgRoleClient.getme()); Map<String, Object> userOrgRoleMap = FeignUtil.remoteCall(() -> Privilege.userOrgRoleClient.getme());
...@@ -895,7 +899,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -895,7 +899,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskV2Model.setTaskType("installNotice"); taskV2Model.setTaskType("installNotice");
taskV2Model.setTaskTypeLabel("安装告知"); taskV2Model.setTaskTypeLabel("安装告知");
String url = getUrl(taskV2Model.getTaskType(), "edit"); String url = getUrl(taskV2Model.getTaskType(), "edit");
String format = String.format(url, jgInstallationNotice.getSequenceNbr(), roleIds, jgInstallationNotice.getNextExecuteIds(), jgInstallationNotice.getNoticeStatus(), jgInstallationNotice.getPromoter(), ""); String format = String.format(url, jgInstallationNotice.getSequenceNbr(), jgInstallationNotice.getNextExecuteIds(), jgInstallationNotice.getNextExecuteIds(), jgInstallationNotice.getNoticeStatus(), "", jgInstallationNotice.getInstanceId());
taskV2Model.setRoutePath(format); taskV2Model.setRoutePath(format);
taskV2Model.setTaskTitle(jgInstallationNotice.getStatus()); taskV2Model.setTaskTitle(jgInstallationNotice.getStatus());
taskV2Model.setTaskName(jgInstallationNotice.getStatus()); taskV2Model.setTaskName(jgInstallationNotice.getStatus());
...@@ -922,7 +926,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -922,7 +926,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
Systemctl.taskV2Client.create(model); Systemctl.taskV2Client.create(model);
} }
public void updateTaskModel(Map<String, Object> params){ public TaskV2Model updateTaskModel(Map<String, Object> params){
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<TaskV2Model> result =Systemctl.taskV2Client.selectListByRelationId(params.get("relationId").toString()).getResult(); List<TaskV2Model> result =Systemctl.taskV2Client.selectListByRelationId(params.get("relationId").toString()).getResult();
...@@ -930,6 +934,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -930,6 +934,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
.findFirst() .findFirst()
.orElse(null); .orElse(null);
model.setTaskStatus(Integer.valueOf(params.get("taskStatus").toString())); model.setTaskStatus(Integer.valueOf(params.get("taskStatus").toString()));
model.setRoutePath(model.getRoutePath().replace("nextExecuteIds", "nextExecuteIdsOld"));
model.setTaskStatusLabel(params.get("taskStatusLabel").toString()); model.setTaskStatusLabel(params.get("taskStatusLabel").toString());
model.setEndDate(new Date()); model.setEndDate(new Date());
model.setFinishStatus(Boolean.TRUE); model.setFinishStatus(Boolean.TRUE);
...@@ -939,6 +944,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -939,6 +944,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} else { } else {
Systemctl.taskV2Client.update(model, model.getSequenceNbr()); Systemctl.taskV2Client.update(model, model.getSequenceNbr());
} }
return model;
} }
private String getUrl(String type, String pageType) { private String getUrl(String type, String pageType) {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
{ {
"type": "installNotice", "type": "installNotice",
"pageType": "look", "pageType": "look",
"url": "/mixuap?appId=1742358052905971713&id=1735246137364869121&sequenceNbr=%s&roleIds=%s&nextExecuteIds=%s&formType=detail&noticeStatus=%s" "url": "/mixuap?appId=1742358052905971713&id=1735246137364869121&sequenceNbr=%s&roleIds=%s&nextExecuteIds=%s&formType=detail&noticeStatus=%s&instanceId=%s"
}, },
{ {
"type": "installNotice", "type": "installNotice",
"pageType": "edit", "pageType": "edit",
"url": "/mixuap?appId=1742358052905971713&id=1734127099570057217&sequenceNbr=%s&roleIds=%s&nextExecuteIds=%s&formType=edit&noticeStatus=%s&promoter=%s&userId=%s" "url": "/mixuap?appId=1742358052905971713&id=1734127099570057217&sequenceNbr=%s&roleIds=%s&nextExecuteIds=%s&formType=edit&noticeStatus=%s&userId=%s&instanceId=%s"
} }
] ]
\ No newline at end of file
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