Commit f47bb920 authored by chenzhao's avatar chenzhao

批量推送支持 整改待推送及审核不通过 排除审核记录多次生成问题

parent da9297c2
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
......@@ -121,7 +122,6 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
} else {
ids = Arrays.asList(new String[]{model.getPeasantHouseholdIds()});
}
Map<String, Object> orgInfo = this.getBaseMapper().selectRZOrgInfo(model.getFinancingCompaniesSeq());
model.setFinancingCompaniesCode(orgInfo.getOrDefault("ORG_CODE", "").toString());
model.setFinancingCompaniesName(orgInfo.getOrDefault("COMPANY_NAME", "").toString());
......@@ -136,33 +136,36 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
BeanUtils.copyProperties(model, financingInfoDto);
financingInfoDto.setSequenceNbr(null);
this.createWithModel(financingInfoDto);
} else {
//开启工作流 并执行一步
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESSKEY);
Date date = new Date();
dto.setBusinessKey(String.valueOf(date.getTime()));
dto.setCompleteFirstTask(true);
//工作流程图第一步执行后存在互斥网关 isFlag为表达式 默认为1执行到融资审核
HashMap<String, Object> map = new HashMap<>();
map.put("isFlag", "0");
dto.setVariables(map);
list.add(dto);
actWorkflowBatchDTO.setProcess(list);
List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS);
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
FinancingAuditingDto financingAuditingDto = new FinancingAuditingDto();
BeanUtils.copyProperties(workflowResultDto, financingAuditingDto);
financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e));
financingAuditingDto.setPromoter(RequestContext.getExeUserId());
financingAuditingService.createWithModel(financingAuditingDto);
} else if (financingInfos.getStatus().equals(FinancingAuditEnum.审核不通过.getName()) || financingInfos.getStatus().equals(FinancingAuditEnum.整改待推送.getName()) ){
financingInfos.setStatus(FinancingAuditEnum.待融资审核.getName());
this.updateById(financingInfos);
Map<String, Object> map = BeanUtil.beanToMap(model);
map.put("isFlag","0");
this.execueFlow(map);
}
//开启工作流 并执行一步
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>();
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey(PROCESSKEY);
Date date = new Date();
dto.setBusinessKey(String.valueOf(date.getTime()));
dto.setCompleteFirstTask(true);
//工作流程图第一步执行后存在互斥网关 isFlag为表达式 默认为1执行到融资审核
HashMap<String, Object> map = new HashMap<>();
map.put("isFlag", "0");
dto.setVariables(map);
list.add(dto);
actWorkflowBatchDTO.setProcess(list);
List<ProcessTaskDTO> processTaskDTOS = workFlowService.startBatch(actWorkflowBatchDTO);
List<WorkflowResultDto> workflowResultDtos = workFlowService.buildWorkFlowInfo(processTaskDTOS);
WorkflowResultDto workflowResultDto = workflowResultDtos.get(0);
FinancingAuditingDto financingAuditingDto = new FinancingAuditingDto();
BeanUtils.copyProperties(workflowResultDto, financingAuditingDto);
financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e));
financingAuditingDto.setPromoter(RequestContext.getExeUserId());
financingAuditingService.createWithModel(financingAuditingDto);
//发起待办
// commonService.buildTaskModel(buildDZTRZTaskModel(model, workflowResultDto, date));
});
......
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