|
|
@@ -124,7 +124,8 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
|
|
|
}
|
|
|
//校验BOM资料是否已被使用
|
|
|
Long prodId = getMapper().selectByPrimaryKey(id).getBo_motherid();
|
|
|
- int count = getMapper().getCountFromMake(prodId);
|
|
|
+ Bom bom = getMapper().selectByPrimaryKey(id);
|
|
|
+ int count = getMapper().getCountFromMake(bom.getBo_mothercode(),bom.getBo_version());
|
|
|
if (count > 0){
|
|
|
throw new BizException(BizExceptionCode.BIZ_RELDELETE);
|
|
|
}
|
|
|
@@ -194,12 +195,13 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
|
|
|
if(id != null && id > 0){
|
|
|
//校验BOM资料是否已被使用
|
|
|
Long prodId = getMapper().selectByPrimaryKey(id).getBo_motherid();
|
|
|
- int count = getMapper().getCountFromMake(prodId);
|
|
|
+ Bom bom = getMapper().selectByPrimaryKey(id);
|
|
|
+ int count = getMapper().getCountFromMake(bom.getBo_mothercode(),bom.getBo_version());
|
|
|
if (count > 0){
|
|
|
throw new BizException(BizExceptionCode.BIZ_RELCLOSE);
|
|
|
}
|
|
|
|
|
|
- Bom bom = new Bom();
|
|
|
+ bom = new Bom();
|
|
|
bom.setId(id);
|
|
|
bom.setBo_status(Status.CLOSE.getDisplay());
|
|
|
bom.setBo_statuscode(Status.CLOSE.name());
|
|
|
@@ -232,7 +234,6 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
|
|
|
bom.setBo_status(Status.OPEN.getDisplay());
|
|
|
bom.setUpdateTime(new Date());
|
|
|
bom.setUpdaterId(BaseContextHolder.getUserId());
|
|
|
-
|
|
|
getMapper().updateByPrimaryKeySelective(bom);
|
|
|
//记录LOG
|
|
|
DocBaseDTO docBaseDTO = generateMsgObj(id, code);
|