Commit ca335276 authored by zhangsen's avatar zhangsen

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

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