Commit ca335276 authored by zhangsen's avatar zhangsen

安装告知 接收机构给工作流传值

parent 19c75017
...@@ -24,5 +24,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -24,5 +24,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
Map<String,Object> getEnterpriseInfo(String sequenceNbr); Map<String,Object> getEnterpriseInfo(String sequenceNbr);
List<Map<String,Object>> getEnterpriseEmployee(String unitCode); List<Map<String,Object>> getEnterpriseEmployee(String unitCode);
String getOrgCodeByCompanyCode(String companyCode);
} }
...@@ -62,4 +62,8 @@ ...@@ -62,4 +62,8 @@
unit_code = #{unitCode} unit_code = #{unitCode}
AND is_delete = 0 AND is_delete = 0
</select> </select>
<select id="getOrgCodeByCompanyCode" resultType="java.lang.String">
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper> </mapper>
...@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice; ...@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
...@@ -108,6 +109,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -108,6 +109,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired @Autowired
private JgInstallationNoticeMapper jgInstallationNoticeMapper; private JgInstallationNoticeMapper jgInstallationNoticeMapper;
@Autowired
private CommonMapper commonMapper;
// @Autowired // @Autowired
// private EquipmentCategoryServiceImpl equipmentCategoryService; // private EquipmentCategoryServiceImpl equipmentCategoryService;
@Autowired @Autowired
...@@ -230,6 +234,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -230,6 +234,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY); dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey(noticeDto.getSequenceNbr().toString()); dto.setBusinessKey(noticeDto.getSequenceNbr().toString());
dto.setCompleteFirstTask(Boolean.TRUE); dto.setCompleteFirstTask(Boolean.TRUE);
dto.setNextExecuteUserOrgCode(commonMapper.getOrgCodeByCompanyCode(notice.getReceiveOrgCreditCode()));
list.add(dto); list.add(dto);
actWorkflowBatchDTO.setProcess(list); actWorkflowBatchDTO.setProcess(list);
processTaskDTO = iCmWorkflowService.startBatch(actWorkflowBatchDTO).get(0); processTaskDTO = iCmWorkflowService.startBatch(actWorkflowBatchDTO).get(0);
...@@ -263,6 +268,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -263,6 +268,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
commMap.put("approvalStatus", op); commMap.put("approvalStatus", op);
} }
dto.setVariable(commMap); dto.setVariable(commMap);
dto.setNextExecuteUserOrgCode(commonMapper.getOrgCodeByCompanyCode(notice.getReceiveOrgCreditCode()));
processTaskDTO = iCmWorkflowService.complete(notice.getNextTaskId(), dto); processTaskDTO = iCmWorkflowService.complete(notice.getNextTaskId(), dto);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
...@@ -482,7 +488,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -482,7 +488,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} }
// 启动工作流并返回信息 // 启动工作流并返回信息
List<WorkflowResultDto> workflowResultList = workFlowInfo(submitType, deviceList); List<WorkflowResultDto> workflowResultList = workFlowInfo(submitType, deviceList, commonMapper.getOrgCodeByCompanyCode(model.getReceiveOrgCreditCode()));
List<JgInstallationNotice> list = new ArrayList<>(); List<JgInstallationNotice> list = new ArrayList<>();
List<JgInstallationNoticeEq> equipList = new ArrayList<>(); List<JgInstallationNoticeEq> equipList = new ArrayList<>();
...@@ -577,7 +583,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -577,7 +583,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param deviceList 设备信息 * @param deviceList 设备信息
* @return 工作流返回相关数据 * @return 工作流返回相关数据
*/ */
private List<WorkflowResultDto> workFlowInfo(String submitType, List<Map<String, Object>> deviceList) { private List<WorkflowResultDto> workFlowInfo(String submitType, List<Map<String, Object>> deviceList, String receiveOrgCreditCode) {
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO(); ActWorkflowBatchDTO actWorkflowBatchDTO = new ActWorkflowBatchDTO();
List<ActWorkflowStartDTO> list = new ArrayList<>(); List<ActWorkflowStartDTO> list = new ArrayList<>();
...@@ -586,6 +592,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -586,6 +592,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY); dto.setProcessDefinitionKey(PROCESS_DEFINITION_KEY);
dto.setBusinessKey(item.get("SEQUENCE_NBR").toString()); dto.setBusinessKey(item.get("SEQUENCE_NBR").toString());
dto.setCompleteFirstTask(Boolean.TRUE); dto.setCompleteFirstTask(Boolean.TRUE);
dto.setNextExecuteUserOrgCode(receiveOrgCreditCode);
list.add(dto); list.add(dto);
}); });
actWorkflowBatchDTO.setProcess(list); actWorkflowBatchDTO.setProcess(list);
...@@ -879,6 +886,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -879,6 +886,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
} }
workDto.setVariable(commMap); workDto.setVariable(commMap);
workDto.setComment(jgTransferNotice.getProcessAdvice()); workDto.setComment(jgTransferNotice.getProcessAdvice());
workDto.setNextExecuteUserOrgCode(commonMapper.getOrgCodeByCompanyCode(jgTransferNotice.getReceiveOrgCreditCode()));
processTaskDTO = iCmWorkflowService.complete(jgTransferNotice.getNextTaskId(), workDto); processTaskDTO = iCmWorkflowService.complete(jgTransferNotice.getNextTaskId(), workDto);
// 提取节点等信息 // 提取节点等信息
workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0); workflowResultDto = commonService.buildWorkFlowInfo(Collections.singletonList(processTaskDTO)).get(0);
......
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