|
|
@@ -50,11 +50,18 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
|
|
|
Bom bom = bomList.getMain();
|
|
|
List<BomDetail> bomDetailList = bomList.getItems();
|
|
|
DocBaseDTO docBaseDTO = null;
|
|
|
+ //校验组合件和子件不允许相同
|
|
|
+ if (bomDetailList.size() > 0){
|
|
|
+ for (BomDetail bomDetail : bomDetailList){
|
|
|
+ if (bom.getBo_mothercode().equals(bomDetail.getProductDTO().getPr_code())){
|
|
|
+ throw new BizException(BizExceptionCode.BOM_CODE_REPEAT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(id == 0){
|
|
|
//校验编号和版本 是否已存在
|
|
|
int count = getMapper().validCodeAndVersionWhenInsert(bom.getBo_mothercode(), bom.getBo_version(), companyId);
|
|
|
if(count == 0){
|
|
|
-// String code = pushMaxnubmer(bom.getBo_mothercode(), bom.getId());
|
|
|
String code = bom.getBo_mothercode();
|
|
|
bom.setBo_mothercode(code);
|
|
|
bom.setBo_statuscode(Status.ENABLE.name());
|