|
|
@ -345,22 +345,24 @@ private ISysAttachService attachService; |
|
|
|
/** |
|
|
|
* 修改bom |
|
|
|
* |
|
|
|
* @param erpBomVo bom |
|
|
|
* @param erpBom bom |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public int updateErpBom(ErpBomVo erpBomVo) |
|
|
|
public int updateErpBom(ErpBom erpBom) |
|
|
|
{ |
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
|
erpBomVo.setUpdateBy(loginName); |
|
|
|
erpBomVo.setEngineer(loginName); |
|
|
|
erpBomVo.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
int editFlag = erpBomMapper.updateErpBom(erpBomVo); |
|
|
|
Long id = erpBomVo.getId(); |
|
|
|
erpBom.setUpdateBy(loginName); |
|
|
|
erpBom.setEngineer(loginName); |
|
|
|
erpBom.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
int editFlag = erpBomMapper.updateErpBom(erpBom); |
|
|
|
|
|
|
|
Long id = erpBom.getId(); |
|
|
|
try { |
|
|
|
//todo 添加bom信息子组件列表
|
|
|
|
List<ErpBom> erpBomSubList = erpBomVo.getErpBomList(); |
|
|
|
List<ErpBom> erpBomSubList = erpBom.getErpBomList(); |
|
|
|
if (CollectionUtils.isNotEmpty(erpBomSubList)) { |
|
|
|
erpBomMapper.deleteErpBomByParentId(id); |
|
|
|
for (int i = 0; i < erpBomSubList.size(); i++) { |
|
|
|
ErpBom erpBom1 = erpBomSubList.get(i); |
|
|
|
erpBom1.setId(null); |
|
|
@ -368,7 +370,7 @@ private ISysAttachService attachService; |
|
|
|
erpBom1.setParentId(id); |
|
|
|
erpBom1.setCreateBy(ShiroUtils.getLoginName()); |
|
|
|
erpBom1.setCreateTime(DateUtils.getNowDate()); |
|
|
|
erpBomMapper.updateErpBom(erpBom1); |
|
|
|
erpBomMapper.insertErpBom(erpBom1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -703,6 +705,38 @@ private ISysAttachService attachService; |
|
|
|
return processInstance; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 提交更新申请 |
|
|
|
* @param erpBom |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public ProcessInstance submitUpdateApply(ErpBom erpBom) { |
|
|
|
SysUser user = ShiroUtils.getSysUser(); |
|
|
|
erpBom.setApplyUser(user.getLoginName()); |
|
|
|
erpBom.setApplyTime(DateUtils.getNowDate()); |
|
|
|
//获取插入的Bom列表的id
|
|
|
|
updateErpBom(erpBom); |
|
|
|
// 启动流程
|
|
|
|
String applyTitle = user.getUserName()+"发起了物料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); |
|
|
|
return processInstance; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ErpBom selectErpBomByOneMaterialNo(String materialNo) { |
|
|
|
return erpBomMapper.selectErpBomByOneMaterialNo(materialNo); |
|
|
|