|
|
@@ -559,6 +559,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
.in(PjOrderItems::getId, srcItemIds));
|
|
|
BigDecimal number = new BigDecimal("0.00");
|
|
|
String msg = "";
|
|
|
+ List<PjOrderItems> orderItemsList = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
|
|
|
+ .eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjOrderItems::getIsDeleted, 0)
|
|
|
+ .eq(PjOrderItems::getBsType, "PD")
|
|
|
+ .ne(PjOrderItems::getStatus, "已确认")
|
|
|
+ .in(PjOrderItems::getGoodsId, goodIds)
|
|
|
+ );
|
|
|
+ StringBuilder msg1 = new StringBuilder();
|
|
|
for (PjShipItems item : ship.getShipItemsList()) {
|
|
|
number = number.add(item.getSendNum());
|
|
|
if (item.getId() == null) {
|
|
|
@@ -574,6 +582,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
}
|
|
|
shipItemsList.add(item);
|
|
|
//获得商品
|
|
|
+ List<PjOrderItems> pjOrderItemsList1 = orderItemsList.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
+ if (!pjOrderItemsList1.isEmpty()) {
|
|
|
+ msg1.append(item.getGoodsName()).append(",");
|
|
|
+ }
|
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(e -> e.getId().equals(item.getGoodsId())).findFirst().orElse(null);
|
|
|
if (ObjectUtil.isEmpty(goodsDesc)) {
|
|
|
throw new RuntimeException("商品数据异常");
|
|
|
@@ -606,8 +618,8 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
}
|
|
|
if (stockOne != null) {
|
|
|
if (stockOne.getBalanceQuantity().compareTo(item.getSendNum()) < 0) {
|
|
|
- System.err.println("商品:"+goodsDesc.getCname());
|
|
|
- msg += goodsDesc.getCname()+",";
|
|
|
+ System.err.println("商品:" + goodsDesc.getCname());
|
|
|
+ msg += goodsDesc.getCname() + ",";
|
|
|
}
|
|
|
stockOne.setBalanceQuantity(stockOne.getBalanceQuantity().subtract(item.getSendNum()));
|
|
|
stockOne.setStoreInventory(stockOne.getBalanceQuantity());
|
|
|
@@ -622,8 +634,11 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
throw new RuntimeException("未查到库存账");
|
|
|
}
|
|
|
}
|
|
|
- if (!msg.isEmpty()){
|
|
|
- throw new RuntimeException("商品:"+msg+"库存不足,出库失败");
|
|
|
+ if (!msg.isEmpty()) {
|
|
|
+ throw new RuntimeException("商品:" + msg + "库存不足,出库失败");
|
|
|
+ }
|
|
|
+ if (msg1.length() > 0) {
|
|
|
+ throw new RuntimeException("商品:" + msg1 + "正在盘点中,操作失败");
|
|
|
}
|
|
|
R res = iStockDescService.updateBatchByIdNew(pjStockDescArrayList);
|
|
|
if (!res.isSuccess()) {
|
|
|
@@ -718,6 +733,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjOrderItems::getIsDeleted, 0)
|
|
|
.in(PjOrderItems::getId, srcItemIds));
|
|
|
+ List<PjOrderItems> orderItemsList = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
|
|
|
+ .eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjOrderItems::getIsDeleted, 0)
|
|
|
+ .eq(PjOrderItems::getBsType, "PD")
|
|
|
+ .ne(PjOrderItems::getStatus, "已确认")
|
|
|
+ .in(PjOrderItems::getGoodsId, goodIds)
|
|
|
+ );
|
|
|
+ StringBuilder msg1 = new StringBuilder();
|
|
|
BigDecimal number = new BigDecimal("0.00");
|
|
|
for (PjShipItems item : ship.getShipItemsList()) {
|
|
|
number = number.add(item.getSendNum());
|
|
|
@@ -728,7 +751,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
} else {
|
|
|
throw new RuntimeException("数据异常请联系管理员");
|
|
|
}
|
|
|
-
|
|
|
+ List<PjOrderItems> pjOrderItemsList1 = orderItemsList.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
+ if (!pjOrderItemsList1.isEmpty()) {
|
|
|
+ msg1.append(item.getGoodsName()).append(",");
|
|
|
+ }
|
|
|
//获得商品
|
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(e -> e.getId().equals(item.getGoodsId())).findFirst().orElse(null);
|
|
|
if (ObjectUtil.isEmpty(goodsDesc)) {
|
|
|
@@ -760,6 +786,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
}
|
|
|
itemsList.add(item);
|
|
|
}
|
|
|
+ if (msg1.length() > 0) {
|
|
|
+ throw new RuntimeException("商品:" + msg1 + "正在盘点中,操作失败");
|
|
|
+ }
|
|
|
R res = iStockDescService.updateBatchByIdNew(pjStockDescArrayList);
|
|
|
if (!res.isSuccess()) {
|
|
|
throw new RuntimeException(res.getMsg());
|
|
|
@@ -1008,6 +1037,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjOrderItems::getIsDeleted, 0)
|
|
|
.in(PjOrderItems::getId, srcItemIds));
|
|
|
+ List<PjOrderItems> orderItemsList = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
|
|
|
+ .eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjOrderItems::getIsDeleted, 0)
|
|
|
+ .eq(PjOrderItems::getBsType, "PD")
|
|
|
+ .ne(PjOrderItems::getStatus, "已确认")
|
|
|
+ .in(PjOrderItems::getGoodsId, goodIds)
|
|
|
+ );
|
|
|
+ StringBuilder msg1 = new StringBuilder();
|
|
|
//获得仓库
|
|
|
PjStorageDesc storageDesc = storageDescMapper.selectById(ship.getStorageId());
|
|
|
for (PjShipItems item : ship.getShipItemsList()) {
|
|
|
@@ -1023,7 +1060,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
item.setPid(ship.getId());
|
|
|
}
|
|
|
shipItemsList.add(item);
|
|
|
-
|
|
|
+ List<PjOrderItems> pjOrderItemsList1 = orderItemsList.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
+ if (!pjOrderItemsList1.isEmpty()) {
|
|
|
+ msg1.append(item.getGoodsName()).append(",");
|
|
|
+ }
|
|
|
//获得商品
|
|
|
PjGoodsDesc goodsDesc = pjGoodsDescList.stream().filter(e -> e.getId().equals(item.getGoodsId())).findFirst().orElse(null);
|
|
|
if (ObjectUtil.isEmpty(goodsDesc)) {
|
|
|
@@ -1112,6 +1152,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
throw new RuntimeException(stockOne.getCname() + "该产品库存正在操作,请稍后刷新在进行操作!");
|
|
|
}*/
|
|
|
}
|
|
|
+ if (msg1.length() > 0) {
|
|
|
+ throw new RuntimeException("商品:" + msg1 + "正在盘点中,操作失败");
|
|
|
+ }
|
|
|
shipItemsService.saveOrUpdateBatch(shipItemsList);
|
|
|
if (!pjStockDescArrayListSave.isEmpty()) {
|
|
|
iStockDescService.saveBatch(pjStockDescArrayListSave);
|
|
|
@@ -1437,6 +1480,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
.eq(PjOrderItems::getIsDeleted, 0)
|
|
|
.in(PjOrderItems::getId, srcItemIds));
|
|
|
List<PjStockDesc> pjStockDescArrayList = new ArrayList<>();
|
|
|
+ List<PjOrderItems> orderItemsList = orderItemsService.list(new LambdaQueryWrapper<PjOrderItems>()
|
|
|
+ .eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjOrderItems::getIsDeleted, 0)
|
|
|
+ .eq(PjOrderItems::getBsType, "PD")
|
|
|
+ .ne(PjOrderItems::getStatus, "已确认")
|
|
|
+ .in(PjOrderItems::getGoodsId, goodIds)
|
|
|
+ );
|
|
|
+ StringBuilder msg1 = new StringBuilder();
|
|
|
for (PjShipItems item : ship.getShipItemsList()) {
|
|
|
number = number.add(item.getSendNum());
|
|
|
//获得商品
|
|
|
@@ -1444,6 +1495,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isEmpty(goodsDesc)) {
|
|
|
throw new RuntimeException("商品数据异常");
|
|
|
}
|
|
|
+ List<PjOrderItems> pjOrderItemsList1 = orderItemsList.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
+ if (!pjOrderItemsList1.isEmpty()) {
|
|
|
+ msg1.append(item.getGoodsName()).append(",");
|
|
|
+ }
|
|
|
//管理批次号
|
|
|
PjStockDesc stockOne;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
@@ -1481,6 +1536,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
throw new RuntimeException("未查到库存数据");
|
|
|
}
|
|
|
}
|
|
|
+ if (msg1.length() > 0) {
|
|
|
+ throw new RuntimeException("商品:" + msg1 + "正在盘点中,操作失败");
|
|
|
+ }
|
|
|
iStockDescService.updateBatchByIdNew(pjStockDescArrayList);
|
|
|
List<PjProductLaunch> pjProductLaunchList = new ArrayList<>();
|
|
|
List<PjOrderItems> pjOrderItemsList = new ArrayList<>();
|