Commit ce290e8d authored by 韩桐桐's avatar 韩桐桐

fix(设备注销):提交流程

parent 0674b8c6
......@@ -29,7 +29,6 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
......@@ -45,11 +44,9 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.servlet.http.HttpServletResponse;
import java.awt.print.Book;
import java.io.File;
import java.io.FileInputStream;
import java.io.UnsupportedEncodingException;
......@@ -577,7 +574,7 @@ public class CommonServiceImpl implements ICommonService {
JSONObject jsonObject = new JSONObject(provideMap);
jgChangeRegistrationUnitServiceImpl.saveNotice(submitType, jsonObject, reginParams);
} else if (type.equals(ApplicationFormTypeEnum.WBBA.getBusinessCode())) {
noticeObj.put("pageType","add");
noticeObj.put("pageType", "add");
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
JSONObject jsonObject = new JSONObject(noticeObj);
jgMaintenanceContractServiceImpl.saveOrSubmit(submitType, jsonObject, reginParams);
......@@ -586,8 +583,8 @@ public class CommonServiceImpl implements ICommonService {
JgEquipTransferDto jgEquipTransferDto = JSON.parseObject(JSON.toJSONString(noticeObj), JgEquipTransferDto.class);
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(jgEquipTransferDto);
jgEquipTransferServiceImpl.saveTransfer(submitType, jsonObject, reginParams);
} else if (type.contains(ApplicationFormTypeEnum.YZBF.getBusinessCode())||type.contains(ApplicationFormTypeEnum.ZXBF.getBusinessCode())) {
} else if (type.contains(ApplicationFormTypeEnum.YZBF.getBusinessCode()) || type.contains(ApplicationFormTypeEnum.ZXBF.getBusinessCode())) {
noticeObj.put("cancelType", type.equals("BF_ZX") ? "1" : "2");
noticeObj.put("receiveOrgCreditCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
provideMap.put(SBZX_PAGE_ID, noticeObj);
JSONObject jsonObject = new JSONObject(provideMap);
......@@ -600,7 +597,7 @@ public class CommonServiceImpl implements ICommonService {
jgChangeRegistrationNameService.save2(submitType, jsonObject);
} else if (type.equals(ApplicationFormTypeEnum.SBQY.getBusinessCode()) || type.equals(ApplicationFormTypeEnum.SBTY.getBusinessCode())) {
noticeObj.put("submit", submitType);
noticeObj.put("pageType","add");
noticeObj.put("pageType", "add");
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
JSONObject jsonObject = new JSONObject(noticeObj);
jgEnableDisableServiceImpl.saveOrUpdate(jsonObject, reginParams);
......@@ -633,11 +630,11 @@ public class CommonServiceImpl implements ICommonService {
}
List<Map> urlList = JsonUtils.getResourceList(urlInfo);
for (Map map : urlList) {
if (map.get("type").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) &&obj.getTaskType().equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) &&
if (map.get("type").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && obj.getTaskType().equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) &&
!obj.getFlowStatus().toString().equals("16723") && map.get("pageType").equals("edit")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getNextExecuteUser()) + urlParams + "&nextExecuteUserIds=" + model.getExecuteUserIds());
break;
}else if (map.get("type").equals(obj.getTaskType()) && map.get("pageType").equals("look")) {
} else if (map.get("type").equals(obj.getTaskType()) && map.get("pageType").equals("look")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getNextExecuteUser()) + urlParams + "&nextExecuteUserIds=" + model.getExecuteUserIds());
break;
}
......@@ -665,7 +662,6 @@ public class CommonServiceImpl implements ICommonService {
* flowStatusLabel 任务状态枚举code
* 流程实例id instanceId
* flowCode 任务id
**/
public TaskV2Model updateTaskModel(Map<String, Object> params) {
String exeUserId = RequestContext.getExeUserId();
......@@ -693,7 +689,7 @@ public class CommonServiceImpl implements ICommonService {
// tarUrl+"&executeUserIds="
// model.setRoutePath( roleIds[0]+"roleIds="+"55555"+"&userId"+userIds[1]);
//当流程完成时将所有待办状态统一修改为已完成
if (collect.get(0).getFlowStatusLabel().equals(FlowStatusEnum.TO_BE_FINISHED.getName())){
if (collect.get(0).getFlowStatusLabel().equals(FlowStatusEnum.TO_BE_FINISHED.getName())) {
String urlParams = "";
......@@ -717,8 +713,8 @@ public class CommonServiceImpl implements ICommonService {
taskV2Model.setFlowStatus(FlowStatusEnum.TO_BE_FINISHED.getCode());
}
Systemctl.taskV2Client.batchUpdate(collect);
}else {
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=","roleIds=55555&fq="));
} else {
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=", "roleIds=55555&fq="));
Systemctl.taskV2Client.update(collect.get(0), collect.get(0).getSequenceNbr());
}
......@@ -740,7 +736,6 @@ public class CommonServiceImpl implements ICommonService {
* flowStatusLabel 任务状态枚举code
* 流程实例id instanceId
* flowCode 任务id
**/
public TaskV2Model updateTaskModelNew(Map<String, Object> params) {
String exeUserId = RequestContext.getExeUserId();
......@@ -750,7 +745,7 @@ public class CommonServiceImpl implements ICommonService {
// .findFirst()
// .orElse(null);
List<TaskV2Model> collect = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
if (null ==collect || collect.size() == 0) {
if (null == collect || collect.size() == 0) {
TaskV2Model model = new TaskV2Model();
model.setFlowStatus(Integer.valueOf(params.get("flowStatus").toString()));
model.setFlowStatusLabel(params.get("flowStatusLabel").toString());
......@@ -765,7 +760,7 @@ public class CommonServiceImpl implements ICommonService {
collect.get(0).setEndUserId(exeUserId);
collect.get(0).setEndDate(new Date());
//当流程完成时将所有待办状态统一修改为已完成
if (collect.get(0).getFlowStatusLabel().equals(FlowStatusEnum.TO_BE_FINISHED.getName())){
if (collect.get(0).getFlowStatusLabel().equals(FlowStatusEnum.TO_BE_FINISHED.getName())) {
String urlParams = "";
try {
urlParams = "&" + toQueryParams(params.get("model"));
......@@ -787,8 +782,8 @@ public class CommonServiceImpl implements ICommonService {
taskV2Model.setFlowStatus(FlowStatusEnum.TO_BE_FINISHED.getCode());
}
Systemctl.taskV2Client.batchUpdate(collect);
}else {
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=","roleIds=55555&fq="));
} else {
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=", "roleIds=55555&fq="));
Systemctl.taskV2Client.update(collect.get(0), collect.get(0).getSequenceNbr());
}
collect.get(0).setEndUserId(null);
......@@ -803,6 +798,7 @@ public class CommonServiceImpl implements ICommonService {
/**
* 待办 撤回
*
* @param id 工作流实例id
* @param obj 自己的实体:taskType为BusinessTypeEnum code;nextExecuteUser
*/
......@@ -811,17 +807,17 @@ public class CommonServiceImpl implements ICommonService {
List<TaskV2Model> list = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
TaskV2Model model = list.get(0);
Systemctl.taskV2Client.delete(String.valueOf(model.getSequenceNbr()));
if (list.size() >1){
if (list.size() > 1) {
TaskV2Model lastTaskModel = list.get(1);
lastTaskModel.setEndUserId(null);
lastTaskModel.setEndDate(null);
lastTaskModel.setTaskStatus(0);
lastTaskModel.setTaskStatusLabel("待处理");
lastTaskModel.setFlowCode(obj.get("nextTaskId").toString());
if(obj.get("flowStatus") != null){
if (obj.get("flowStatus") != null) {
lastTaskModel.setFlowStatus(Integer.valueOf(obj.get("flowStatus").toString()));
}
if(obj.get("flowStatusLabel") != null){
if (obj.get("flowStatusLabel") != null) {
lastTaskModel.setFlowStatusLabel(obj.get("flowStatusLabel").toString());
}
String urlParams = "";
......@@ -835,7 +831,7 @@ public class CommonServiceImpl implements ICommonService {
if (map.get("type").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && obj.getString("taskType").equals(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getCode()) && map.get("pageType").equals("edit")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.getString("nextExecuteUser")) + urlParams + "&nextExecuteUserIds=" + model.getExecuteUserIds());
break;
}else if (map.get("type").equals(obj.get("taskType")) && map.get("pageType").equals("look")) {
} else if (map.get("type").equals(obj.get("taskType")) && map.get("pageType").equals("look")) {
model.setRoutePath(map.get("url").toString().replace("{roleIds}", obj.get("nextExecuteUser").toString()) + urlParams);
break;
}
......
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