|
|
@@ -79,6 +79,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
Product product = productListDTO.getMain();
|
|
|
List<ProductDetail> productDetailList = productListDTO.getItems();
|
|
|
DocBaseDTO docBaseDTO = null;
|
|
|
+
|
|
|
+ //校验明细仓库是否重复
|
|
|
+ validRepeatWarehouse(productDetailList);
|
|
|
+
|
|
|
if(product.getId() == 0){
|
|
|
//保存
|
|
|
String code = pushMaxnubmer(product.getPr_code(), product.getId());
|
|
|
@@ -144,6 +148,27 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
return docBaseDTO;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 校验明细仓库是否重复
|
|
|
+ * @param productDetailList
|
|
|
+ */
|
|
|
+ private void validRepeatWarehouse(List<ProductDetail> productDetailList) {
|
|
|
+ if (productDetailList.size() > 0){
|
|
|
+ boolean flag = true; //假设不重复
|
|
|
+ for (int i = 0; i < productDetailList.size() - 1; i ++){
|
|
|
+ for (int j = i + 1; j < productDetailList.size(); j++){
|
|
|
+ if (productDetailList.get(i).getPd_whcode().equals(productDetailList.get(i).getPd_whcode())){
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag){
|
|
|
+ throw new BizException(BizExceptionCode.BIZ_PRODWHCODE_REPEAT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 物料发生过除库存初始化外的出入库单时,不能新增,修改,删除
|
|
|
* @param id
|