|
|
@@ -202,9 +202,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
}
|
|
|
List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
|
|
|
addList.addAll(releaseProductByBatchs);
|
|
|
- if (!isAPerson) {
|
|
|
- resetRepeatData(addList);
|
|
|
- }
|
|
|
+ resetRepeatData(addList, isAPerson);
|
|
|
commonDao.save(addList, ReleaseProductByBatch.class);
|
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
@@ -224,7 +222,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
* 判断是否重复,重复则重设状态
|
|
|
* @param data
|
|
|
*/
|
|
|
- private void resetRepeatData(List<ReleaseProductByBatch> data) {
|
|
|
+ private void resetRepeatData(List<ReleaseProductByBatch> data, boolean isAPerson) {
|
|
|
Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
|
|
|
if (enuu == null) {
|
|
|
throw new IllegalOperatorException("企业enuu丢失");
|
|
|
@@ -235,6 +233,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
each.setB2cBranden(standardList.get(0).getPbranden());
|
|
|
each.setB2cCode(standardList.get(0).getPcmpcode());
|
|
|
}
|
|
|
+ if (isAPerson) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enuu, each.getB2cCode(), each.getB2cBranden(), IntegerConstant.YES_SHORT);
|
|
|
if (!CollectionUtils.isEmpty(productList)) {
|
|
|
List<Goods> goodsList = goodsDao.findRepeatGoodsInProductId(productList.get(0).getId(), each.getProductDate(), each.getPackaging(), each.getMinPackage(), each.getMinBuyQty(), each.getSelfMaxDelivery(), each.getSelfMinDelivery(), each.getUnit());
|