|
|
@@ -51,9 +51,10 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
|
|
|
DocBaseDTO docBaseDTO = null;
|
|
|
if(id == 0){
|
|
|
//校验编号和版本 是否已存在
|
|
|
- int count = getMapper().validCodeAndVersion(bom.getBo_mothercode(), bom.getBo_version(), companyId);
|
|
|
+ int count = getMapper().validCodeAndVersionWhenInsert(bom.getBo_mothercode(), bom.getBo_version(), companyId);
|
|
|
if(count == 0){
|
|
|
- String code = pushMaxnubmer(bom.getBo_mothercode(), bom.getId());
|
|
|
+// String code = pushMaxnubmer(bom.getBo_mothercode(), bom.getId());
|
|
|
+ String code = bom.getBo_mothercode();
|
|
|
bom.setBo_mothercode(code);
|
|
|
bom.setCompanyId(companyId);
|
|
|
//保存BOM
|
|
|
@@ -79,8 +80,11 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
|
|
|
}
|
|
|
}else{
|
|
|
//校验编号和版本 是否已存在
|
|
|
- int count = getMapper().validCodeAndVersion(bom.getBo_mothercode(), bom.getBo_version(), companyId);
|
|
|
+ int count = getMapper().validCodeAndVersionWhenUpdate(bom.getBo_mothercode(),bom.getId(),bom.getBo_version(),companyId);
|
|
|
//更新主表
|
|
|
+ if (count != 0) {
|
|
|
+ throw new BizException(BizExceptionCode.BOM_SAVE);
|
|
|
+ }
|
|
|
getMapper().updateByPrimaryKeySelective(bom);
|
|
|
if (bomDetailList.size() > 0) {
|
|
|
List<BomDetail> insertItems = new ArrayList<BomDetail>();
|