Browse Source

[fix]

工程管理 bom信息
修改修改bom导入方法,更新/插入父级bom时添加导入审核流程;
dev
王晓迪 4 months ago
parent
commit
8e70e86971
  1. 24
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

24
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -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 + " 新增成功");

Loading…
Cancel
Save