|
|
@ -501,6 +501,7 @@ private ISysAttachService attachService; |
|
|
|
int failureNum = 0; |
|
|
|
StringBuilder successMsg = new StringBuilder(); |
|
|
|
StringBuilder failureMsg = new StringBuilder(); |
|
|
|
SysUser user = ShiroUtils.getSysUser(); |
|
|
|
for (int i=0;i<bomImportVos.size();i++){ |
|
|
|
ErpBomImportVo bomImportVo = bomImportVos.get(i); |
|
|
|
String materialNo = bomImportVo.getMaterialNo(); |
|
|
@ -545,6 +546,25 @@ private ISysAttachService attachService; |
|
|
|
erpBom.setRemark(remark); |
|
|
|
erpBom.setUpdateBy(loginName); |
|
|
|
erpBom.setUpdateTime(now); |
|
|
|
erpBom.setApplyUser(loginName); |
|
|
|
erpBom.setApplyTime(DateUtils.getNowDate()); |
|
|
|
// 启动流程
|
|
|
|
erpBom.setAuditStatus("0"); |
|
|
|
erpBomMapper.updateErpBom(erpBom); |
|
|
|
String applyTitle = loginName+"发起了物料BOM信息提交审批-"+DateUtils.dateTimeNow(); |
|
|
|
String instanceType = "submit"; |
|
|
|
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,erpBom, user); |
|
|
|
String processInstanceId = processInstance.getProcessInstanceId(); |
|
|
|
// 提交实例id
|
|
|
|
erpBom.setSubmitInstanceId(processInstanceId); |
|
|
|
// 存在提交完就流程结束的情况
|
|
|
|
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId); |
|
|
|
if(processIsFinish){ |
|
|
|
// 审核状态-审核通过
|
|
|
|
erpBom.setAuditStatus("1"); |
|
|
|
// 使用状态-是
|
|
|
|
erpBom.setUseStatus("1"); |
|
|
|
} |
|
|
|
erpBomMapper.updateErpBom(erpBom); |
|
|
|
successNum++; |
|
|
|
successMsg.append("<br/>" + successNum + "、料号 " + materialNo + " 更新成功"); |
|
|
@ -570,7 +590,9 @@ private ISysAttachService attachService; |
|
|
|
fatherBom.setWarehouseDept(erpMaterialVo.getWarehouseDept()); |
|
|
|
fatherBom.setParentId(0L); |
|
|
|
fatherBom.setLevel(0L); |
|
|
|
erpBomMapper.insertErpBom(fatherBom); |
|
|
|
// erpBomMapper.insertErpBom(fatherBom);
|
|
|
|
fatherBom.setAuditStatus("0"); |
|
|
|
submitApply(fatherBom); |
|
|
|
parentId = fatherBom.getId(); |
|
|
|
successNum++; |
|
|
|
successMsg.append("<br/>" + successNum + "、料号 " + materialNo + " 新增成功"); |
|
|
|