Commit 179e1db6 authored by hezhuozhi's avatar hezhuozhi

修改待办

parent 3e4df50f
...@@ -151,7 +151,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService { ...@@ -151,7 +151,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
//发起待办 //发起待办
WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO)).get(0);
workflowResultDto.setInstanceId(basicGridAcceptanc.getInstanceId()); workflowResultDto.setInstanceId(basicGridAcceptanc.getInstanceId());
updateAcceptanceTask(basicGridAcceptanc, workflowResultDto); commonService.updateTaskModelAndAddTask(basicGridAcceptanc, workflowResultDto,BusinessTypeEnum.HYGF_BWYS);
basicGridAcceptanceMapper.updateById(basicGridAcceptanc); basicGridAcceptanceMapper.updateById(basicGridAcceptanc);
//线上验收 //线上验收
...@@ -165,17 +165,4 @@ public class AcceptanceServiceImpl implements IAcceptanceService { ...@@ -165,17 +165,4 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
} }
} }
private void updateAcceptanceTask(BasicGridAcceptance basicGridAcceptance, WorkflowResultDto workflowResultDto) {
Map<String, Object> updateTaskParam = new HashMap<>();
updateTaskParam.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskParam.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskParam.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskParam.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskParam.put("model", basicGridAcceptance);
updateTaskParam.put("relationId", workflowResultDto.getInstanceId());
commonService.updateTaskModel(updateTaskParam);
commonService.buildTaskModel((commonService.buildTaskModelDto(basicGridAcceptance, workflowResultDto, BusinessTypeEnum.HYGF_BWYS)));
}
} }
...@@ -256,59 +256,64 @@ public class CommonServiceImpl { ...@@ -256,59 +256,64 @@ public class CommonServiceImpl {
* flowCode 任务id * flowCode 任务id
**/ **/
public TaskV2Model updateTaskModel(Map<String, Object> params) { public TaskV2Model updateTaskModel(Map<String, Object> params) {
String exeUserId = RequestContext.getExeUserId(); try {
List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(params.get("relationId").toString()).getResult(); String exeUserId = RequestContext.getExeUserId();
List<TaskV2Model> collect = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList()); List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(params.get("relationId").toString()).getResult();
List<TaskV2Model> collect = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
if (collect.isEmpty()) { if (collect.isEmpty()) {
return null; return null;
}
collect.get(0).setFlowStatus(Integer.valueOf(params.get("flowStatus").toString()));
collect.get(0).setFlowStatusLabel(params.get("flowStatusLabel").toString());
collect.get(0).setTaskStatus(Integer.valueOf(params.get("taskStatus").toString()));
collect.get(0).setTaskStatusLabel(params.get("taskStatusLabel").toString());
collect.get(0).setEndUserId(exeUserId);
collect.get(0).setEndDate(new Date());
// 当流程完成时将所有待办状态统一修改为已完成
String urlParams = "&formType=detail";
if (collect.get(0).getFlowStatusLabel().equals(FlowStatusEnum.TO_BE_FINISHED.getName())) {
try {
urlParams = "&" + toQueryParams(params.get("model"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} }
List<Map> urlList = JsonUtils.getResourceList(urlInfo); collect.get(0).setFlowStatus(Integer.valueOf(params.get("flowStatus").toString()));
for (Map map : urlList) { collect.get(0).setFlowStatusLabel(params.get("flowStatusLabel").toString());
//此处单独处理经销商审核 审核完成后跳转列表页面 collect.get(0).setTaskStatus(Integer.valueOf(params.get("taskStatus").toString()));
if("jxs_03".equals(collect.get(0).getTaskCode())){ collect.get(0).setTaskStatusLabel(params.get("taskStatusLabel").toString());
urlParams = "/mixuap?appId=1678340647909617665&id=1678365817248444417"+ urlParams; collect.get(0).setEndUserId(exeUserId);
break; collect.get(0).setEndDate(new Date());
// 当流程完成时将所有待办状态统一修改为已完成
String urlParams = "&formType=detail";
if (collect.get(0).getFlowStatusLabel().equals(FlowStatusEnum.TO_BE_FINISHED.getName())) {
try {
urlParams = "&" + toQueryParams(params.get("model"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} }
if (map.get("type").equals(collect.get(0).getTaskCode())) { List<Map> urlList = JsonUtils.getResourceList(urlInfo);
urlParams = map.get("url").toString() + urlParams; for (Map map : urlList) {
break; //此处单独处理经销商审核 审核完成后跳转列表页面
if("jxs_03".equals(collect.get(0).getTaskCode())){
urlParams = "/mixuap?appId=1678340647909617665&id=1678365817248444417"+ urlParams;
break;
}
if (map.get("type").equals(collect.get(0).getTaskCode())) {
urlParams = map.get("url").toString() + urlParams;
break;
}
} }
collect.get(0).setRoutePath(urlParams);
for (TaskV2Model taskV2Model : collect) {
taskV2Model.setTaskStatusLabel((FlowStatusEnum.TO_BE_FINISHED.getName()));
taskV2Model.setTaskStatus(FlowStatusEnum.TO_BE_FINISHED.getCode());
taskV2Model.setFlowStatusLabel((FlowStatusEnum.TO_BE_FINISHED.getName()));
taskV2Model.setFlowStatus(FlowStatusEnum.TO_BE_FINISHED.getCode());
}
taskV2FeignService.batchUpdate(collect);
} else {
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=", "roleIds=55555&fq="));
taskV2FeignService.update(collect.get(0), collect.get(0).getSequenceNbr());
} }
collect.get(0).setRoutePath(urlParams); // 修改model并返回 用于组装新待办
for (TaskV2Model taskV2Model : collect) { collect.get(0).setEndUserId(null);
taskV2Model.setTaskStatusLabel((FlowStatusEnum.TO_BE_FINISHED.getName())); collect.get(0).setTaskStatus(null);
taskV2Model.setTaskStatus(FlowStatusEnum.TO_BE_FINISHED.getCode()); collect.get(0).setEndDate(null);
taskV2Model.setFlowStatusLabel((FlowStatusEnum.TO_BE_FINISHED.getName())); collect.get(0).setSequenceNbr(null);
taskV2Model.setFlowStatus(FlowStatusEnum.TO_BE_FINISHED.getCode()); collect.get(0).setCreateDate(new Date());
} collect.get(0).setStartDate(new Date());
taskV2FeignService.batchUpdate(collect); return collect.get(0);
} else { }catch (Exception e){
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=", "roleIds=55555&fq=")); log.error(e.getMessage(),e);
taskV2FeignService.update(collect.get(0), collect.get(0).getSequenceNbr());
} }
// 修改model并返回 用于组装新待办 return null;
collect.get(0).setEndUserId(null);
collect.get(0).setTaskStatus(null);
collect.get(0).setEndDate(null);
collect.get(0).setSequenceNbr(null);
collect.get(0).setCreateDate(new Date());
collect.get(0).setStartDate(new Date());
return collect.get(0);
} }
......
...@@ -425,7 +425,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -425,7 +425,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
//更新待办 //更新待办
WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO)).get(0);
workflowResultDto.setInstanceId(powerStation.getProcessInstanceId()); workflowResultDto.setInstanceId(powerStation.getProcessInstanceId());
updatePowerStationTask(powerStation, workflowResultDto); commonService.updateTaskModelAndAddTask(powerStation, workflowResultDto,BusinessTypeEnum.HYGF_DZ_SH);
powerStationService.savePowerStation(powerStation, flag, powerStation.getOwnersName(), meg); powerStationService.savePowerStation(powerStation, flag, powerStation.getOwnersName(), meg);
if (!flag) { if (!flag) {
// 更新农户状态 // 更新农户状态
...@@ -534,17 +534,6 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -534,17 +534,6 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// return code; // return code;
} }
private void updatePowerStationTask(PowerStation powerStation, WorkflowResultDto workflowResultDto) {
Map<String, Object> updateTaskParam = new HashMap<>();
updateTaskParam.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskParam.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskParam.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskParam.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskParam.put("model", powerStation);
updateTaskParam.put("relationId", workflowResultDto.getInstanceId());
commonService.updateTaskModel(updateTaskParam);
commonService.buildTaskModel((commonService.buildTaskModelDto(powerStation, workflowResultDto, BusinessTypeEnum.HYGF_DZ_SH)));
}
public WorkDto getNodeInfoCode(String flowTaskId) { public WorkDto getNodeInfoCode(String flowTaskId) {
......
...@@ -704,7 +704,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -704,7 +704,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//更新待办 //更新待办
WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO)).get(0); WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(CollectionUtil.newArrayList(processTaskDTO)).get(0);
workflowResultDto.setInstanceId(dealerReview.getProcessInstanceId()); workflowResultDto.setInstanceId(dealerReview.getProcessInstanceId());
updateUnitInfoTask(unitInfo, workflowResultDto); commonService.updateTaskModelAndAddTask(unitInfo, workflowResultDto,BusinessTypeEnum.HYGF_JXS_SH);
}catch (Exception e){ }catch (Exception e){
...@@ -845,18 +845,6 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -845,18 +845,6 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
return code; return code;
} }
private void updateUnitInfoTask(UnitInfo unitInfo, WorkflowResultDto workflowResultDto) {
Map<String, Object> updateTaskParam = new HashMap<>();
updateTaskParam.put("flowStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskParam.put("flowStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskParam.put("taskStatus", FlowStatusEnum.TO_BE_FINISHED.getCode());
updateTaskParam.put("taskStatusLabel", FlowStatusEnum.TO_BE_FINISHED.getName());
updateTaskParam.put("model", unitInfo);
updateTaskParam.put("relationId", workflowResultDto.getInstanceId());
commonService.updateTaskModel(updateTaskParam);
commonService.buildTaskModel((commonService.buildTaskModelDto(unitInfo, workflowResultDto, BusinessTypeEnum.HYGF_JXS_SH)));
}
@Override @Override
public IPage<CompanyDto> getCompanyDto(CompanyDto dto) { public IPage<CompanyDto> getCompanyDto(CompanyDto dto) {
//列表数据组装 //列表数据组装
......
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