|
|
@@ -254,6 +254,10 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
ship.setVersion(1);
|
|
|
baseMapper.insert(ship);
|
|
|
} else {
|
|
|
+ PjShip orderVersion = baseMapper.selectById(ship.getId());
|
|
|
+ if (orderVersion != null && !orderVersion.getVersion().equals(ship.getVersion())) {
|
|
|
+ throw new RuntimeException("订单数据已被修改,请返回列表重新操作!");
|
|
|
+ }
|
|
|
ship.setVersion(ship.getVersion() + 1);
|
|
|
ship.setUpdateUser(AuthUtil.getUserId());
|
|
|
ship.setUpdateTime(new Date());
|
|
|
@@ -915,7 +919,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -979,7 +983,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjHistory history;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()) &&
|
|
|
- ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
+ ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()))
|
|
|
.findFirst().orElse(null);
|
|
|
@@ -1000,11 +1004,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
}
|
|
|
PjOrderItems orderItems = pjOrderItems.stream().filter(e -> e.getId().equals(item.getSrcItemId())).findFirst().orElse(null);
|
|
|
if (orderItems != null) {
|
|
|
- if (ObjectUtils.isNull(orderItems.getDots())) {
|
|
|
- orderItems.setDots(item.getDot());
|
|
|
- } else {
|
|
|
- if (!orderItems.getDots().contains(item.getDot())) {
|
|
|
- orderItems.setDots(orderItems.getDots() + "," + item.getDot());
|
|
|
+ if (ObjectUtils.isNotNull(item.getDot())) {
|
|
|
+ if (ObjectUtils.isNull(orderItems.getDots())) {
|
|
|
+ orderItems.setDots(item.getDot());
|
|
|
+ } else {
|
|
|
+ if (!orderItems.getDots().contains(item.getDot())) {
|
|
|
+ orderItems.setDots(orderItems.getDots() + "," + item.getDot());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (ObjectUtils.isNull(orderItems.getCostprie()) || new BigDecimal("0.00").compareTo(orderItems.getCostprie()) == 0) {
|
|
|
@@ -1504,7 +1510,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockOne1 = pjStockDescList1.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne1 = pjStockDescList1.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -1519,12 +1525,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
orderItems.setRebateProfit(new BigDecimal("0.00"));
|
|
|
}
|
|
|
orderItems.setSendNum(orderItems.getSendNum().subtract(item.getSendNum()));
|
|
|
- if (orderItems.getSendNum().compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
- orderItems.setDots("");
|
|
|
- } else {
|
|
|
- if (ObjectUtils.isNotNull(orderItems.getDots())) {
|
|
|
- if (orderItems.getDots().contains(item.getDot())) {
|
|
|
- orderItems.setDots(orderItems.getDots().replace(item.getDot(), ""));
|
|
|
+ if (ObjectUtils.isNotNull(item.getDot())) {
|
|
|
+ if (orderItems.getSendNum().compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
+ orderItems.setDots("");
|
|
|
+ } else {
|
|
|
+ if (ObjectUtils.isNotNull(orderItems.getDots())) {
|
|
|
+ if (orderItems.getDots().contains(item.getDot())) {
|
|
|
+ orderItems.setDots(orderItems.getDots().replace(item.getDot(), ""));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1541,7 +1549,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -1562,7 +1570,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjHistory history;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()) &&
|
|
|
- ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
+ ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()))
|
|
|
.findFirst().orElse(null);
|
|
|
@@ -2185,11 +2193,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (!"TKSHGD".equals(ship.getBizTypeName())) {
|
|
|
PjOrderItems orderItems = pjOrderItems.stream().filter(e -> e.getId().equals(item.getSrcItemId())).findFirst().orElse(null);
|
|
|
if (orderItems != null) {
|
|
|
- if (ObjectUtils.isNull(orderItems.getDots())) {
|
|
|
- orderItems.setDots(item.getDot());
|
|
|
- } else {
|
|
|
- if (!orderItems.getDots().contains(item.getDot())) {
|
|
|
- orderItems.setDots(orderItems.getDots() + "," + item.getDot());
|
|
|
+ if (ObjectUtils.isNotNull(item.getDot())) {
|
|
|
+ if (ObjectUtils.isNull(orderItems.getDots())) {
|
|
|
+ orderItems.setDots(item.getDot());
|
|
|
+ } else {
|
|
|
+ if (!orderItems.getDots().contains(item.getDot())) {
|
|
|
+ orderItems.setDots(orderItems.getDots() + "," + item.getDot());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (orderItems.getGoodsNum().compareTo(orderItems.getSendNum().add(item.getSendNum())) < 0) {
|
|
|
@@ -2230,7 +2240,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
&& e.getStorageId().equals(ship.getStorageId())
|
|
|
- &&ObjectUtils.isNotNull(e.getDot())&& e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -2263,7 +2273,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockDesc.setRebatePrice(item.getRebatePrice());
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockDesc.setDot(item.getDot());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
stockDesc.setDot(null);
|
|
|
}
|
|
|
long timestamp = System.currentTimeMillis() + count;
|
|
|
@@ -2361,7 +2371,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(item.getId()) &&
|
|
|
e.getReservoirAreaId().equals(itemHistory.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(itemHistory.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(itemHistory.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(item.getId()) &&
|
|
|
e.getReservoirAreaId().equals(itemHistory.getReservoirAreaId())
|
|
|
@@ -2373,7 +2383,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Long reservoirAreaId = itemHistory.getReservoirAreaId();
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
areaRecord = areaRecordList.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&& e.getDot().equals(itemHistory.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(itemHistory.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
areaRecord = areaRecordList.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
@@ -2604,9 +2614,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
item.setPattern(goodsDesc.getBrandItem());
|
|
|
item.setGoodsDescription(goodsDesc.getGoodsDescription());
|
|
|
if ("0".equals(goodsDesc.getWhether())) {//未开启管理批次号
|
|
|
- if (ObjectUtil.isNotEmpty(itemExcel.getDot())) {
|
|
|
item.setDot(null);
|
|
|
- }
|
|
|
} /*else {//已开启批次号管理
|
|
|
if (ObjectUtil.isEmpty(itemExcel.getDot())) {
|
|
|
text.append("第").append(i + 2).append("行,商品已开启管理批次号,请填写批次号").append("\n");
|
|
|
@@ -2712,7 +2720,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
&& e.getStorageId().equals(ship.getStorageId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -2847,7 +2855,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
&& e.getStorageId().equals(ship.getStorageId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -2915,7 +2923,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
BigDecimal quantity;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId())
|
|
|
&& ObjectUtils.isNull(e.getDot()) && ObjectUtils.isNull(reservoirAreaRecord.getDot()))
|
|
|
@@ -2973,12 +2981,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (orderItems != null) {
|
|
|
orderItems.setSendNum(orderItems.getSendNum().subtract(item.getSendNum()));
|
|
|
orderItems.setGoodsTotalShipAmount(orderItems.getSendNum().multiply(item.getPrice()));
|
|
|
- if (orderItems.getSendNum().compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
- orderItems.setDots("");
|
|
|
- } else {
|
|
|
- if (ObjectUtils.isNotNull(orderItems.getDots())) {
|
|
|
- if (orderItems.getDots().contains(item.getDot())) {
|
|
|
- orderItems.setDots(orderItems.getDots().replace(item.getDot(), ""));
|
|
|
+ if (ObjectUtils.isNotNull(item.getDot())) {
|
|
|
+ if (orderItems.getSendNum().compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
+ orderItems.setDots("");
|
|
|
+ } else {
|
|
|
+ if (ObjectUtils.isNotNull(orderItems.getDots())) {
|
|
|
+ if (orderItems.getDots().contains(item.getDot())) {
|
|
|
+ orderItems.setDots(orderItems.getDots().replace(item.getDot(), ""));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -3557,7 +3567,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjStockDesc stockOneC;
|
|
|
//管理批次号
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
- stockOneC = stockOneListC.stream().filter(e -> ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(orderItems.getDot()) &&
|
|
|
+ stockOneC = stockOneListC.stream().filter(e -> ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(orderItems.getDot()) &&
|
|
|
e.getGoodsId().equals(orderItems.getGoodsId())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOneC = stockOneListC.stream().filter(e -> ObjectUtils.isNull(e.getDot()) &&
|
|
|
@@ -3585,7 +3595,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getReservoirAreaId().equals(item.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getReservoirAreaId().equals(item.getReservoirAreaId())
|
|
|
@@ -3597,7 +3607,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Long reservoirAreaId = item.getReservoirAreaId();
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
areaRecord = reservoirAreaRecordListC.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
areaRecord = reservoirAreaRecordListC.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
@@ -3648,7 +3658,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjStockDesc stockOneR;
|
|
|
//管理批次号
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
- stockOneR = stockOneListR.stream().filter(e -> ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(orderItems.getDot()) &&
|
|
|
+ stockOneR = stockOneListR.stream().filter(e -> ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(orderItems.getDot()) &&
|
|
|
e.getGoodsId().equals(orderItems.getGoodsId())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOneR = stockOneListR.stream().filter(e -> ObjectUtils.isNull(e.getDot()) &&
|
|
|
@@ -3677,7 +3687,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getCallInReservoirAreaId().equals(item.getCallInReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getCallInReservoirAreaId().equals(item.getCallInReservoirAreaId())
|
|
|
@@ -3689,7 +3699,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Long reservoirAreaId = item.getCallInReservoirAreaId();
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
areaRecord = reservoirAreaRecordListR.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
areaRecord = reservoirAreaRecordListR.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
@@ -3778,7 +3788,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockDesc.setSalesCompanyName(detail.getSalesCompanyName());
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockDesc.setDot(orderItems.getDot());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
stockDesc.setDot(null);
|
|
|
}
|
|
|
stockDesc.setCreateDept(detail.getCreateDept());
|
|
|
@@ -3809,7 +3819,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getCallInReservoirAreaId().equals(item.getCallInReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getCallInReservoirAreaId().equals(item.getCallInReservoirAreaId())
|
|
|
@@ -3959,7 +3969,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjStockDesc stockOneC;
|
|
|
//管理批次号
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
- stockOneC = stockOneListC.stream().filter(e -> ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(orderItems.getDot()) &&
|
|
|
+ stockOneC = stockOneListC.stream().filter(e -> ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(orderItems.getDot()) &&
|
|
|
e.getGoodsId().equals(orderItems.getGoodsId())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOneC = stockOneListC.stream().filter(e -> ObjectUtils.isNull(e.getDot()) &&
|
|
|
@@ -3987,7 +3997,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getReservoirAreaId().equals(item.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getReservoirAreaId().equals(item.getReservoirAreaId())
|
|
|
@@ -3999,7 +4009,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Long reservoirAreaId = item.getReservoirAreaId();
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
areaRecord = reservoirAreaRecordListC.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
areaRecord = reservoirAreaRecordListC.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
@@ -4038,7 +4048,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjStockDesc stockOneR;
|
|
|
//管理批次号
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
- stockOneR = stockOneListR.stream().filter(e -> ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(orderItems.getDot()) &&
|
|
|
+ stockOneR = stockOneListR.stream().filter(e -> ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(orderItems.getDot()) &&
|
|
|
e.getGoodsId().equals(orderItems.getGoodsId())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOneR = stockOneListR.stream().filter(e -> ObjectUtils.isNull(e.getDot()) &&
|
|
|
@@ -4060,7 +4070,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = histories.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getCallInReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = histories.stream().filter(e -> e.getSrcItemId().equals(orderItems.getId()) &&
|
|
|
e.getCallInReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId())
|
|
|
@@ -4188,9 +4198,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
item.setPattern(goodsDesc.getBrandItem());
|
|
|
item.setGoodsDescription(goodsDesc.getGoodsDescription());
|
|
|
if ("0".equals(goodsDesc.getWhether())) {//未开启管理批次号
|
|
|
- if (ObjectUtil.isNotEmpty(itemExcel.getDot())) {
|
|
|
- item.setDot(null);
|
|
|
- }
|
|
|
+ item.setDot(null);
|
|
|
} /*else {//已开启批次号管理
|
|
|
if (ObjectUtil.isEmpty(itemExcel.getDot())) {
|
|
|
text.append("第").append(i + 2).append("行,商品已开启管理批次号,请填写批次号").append("\n");
|
|
|
@@ -4314,7 +4322,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtils.isNotNull(e.getDots())) {
|
|
|
if (e.getDots().contains(",")) {
|
|
|
shipItems.setDot(e.getDots().substring(e.getDots().indexOf(",")));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
shipItems.setDot(e.getDots());
|
|
|
}
|
|
|
}
|
|
|
@@ -4567,7 +4575,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -4588,7 +4596,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjHistory history;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()) &&
|
|
|
- ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
+ ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()))
|
|
|
.findFirst().orElse(null);
|
|
|
@@ -4887,7 +4895,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -4908,7 +4916,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
PjHistory history;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()) &&
|
|
|
- ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
+ ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
history = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId()))
|
|
|
.findFirst().orElse(null);
|
|
|
@@ -5179,7 +5187,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtils.isNotNull(e.getDots())) {
|
|
|
if (e.getDots().contains(",")) {
|
|
|
shipItems.setDot(e.getDots().substring(e.getDots().indexOf(",")));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
shipItems.setDot(e.getDots());
|
|
|
}
|
|
|
}
|
|
|
@@ -5446,7 +5454,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
&& e.getStorageId().equals(ship.getStorageId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -5473,7 +5481,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockDesc.setRebatePrice(item.getRebatePrice());
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockDesc.setDot(item.getDot());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
stockDesc.setDot(null);
|
|
|
}
|
|
|
if (stockDesc.getBalanceQuantity().compareTo(new BigDecimal("0")) != 0) {
|
|
|
@@ -5565,7 +5573,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(item.getId()) &&
|
|
|
e.getReservoirAreaId().equals(itemHistory.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(itemHistory.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(itemHistory.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = historyList.stream().filter(e -> e.getSrcItemId().equals(item.getId()) &&
|
|
|
e.getReservoirAreaId().equals(itemHistory.getReservoirAreaId())
|
|
|
@@ -5577,7 +5585,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Long reservoirAreaId = itemHistory.getReservoirAreaId();
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
areaRecord = areaRecordList.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(itemHistory.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(itemHistory.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
areaRecord = areaRecordList.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaId)
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
@@ -5951,7 +5959,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
&& e.getStorageId().equals(ship.getStorageId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -5987,7 +5995,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
BigDecimal quantity;
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
quantity = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(reservoirAreaRecord.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(reservoirAreaRecord.getDot())).map(PjHistory::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
} else {
|
|
|
quantity = histories.stream().filter(e -> e.getReservoirAreaId().equals(reservoirAreaRecord.getReservoirAreaId())
|
|
|
&& ObjectUtils.isNull(e.getDot()) && ObjectUtils.isNull(reservoirAreaRecord.getDot()))
|
|
|
@@ -6473,7 +6481,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (ObjectUtil.isNotEmpty(goodsDesc.getWhether()) && "1".equals(goodsDesc.getWhether())) {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
- && ObjectUtils.isNotNull(e.getDot())&&e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
+ && ObjectUtils.isNotNull(e.getDot()) && e.getDot().equals(item.getDot())).findFirst().orElse(null);
|
|
|
} else {
|
|
|
stockOne = pjStockDescList.stream()
|
|
|
.filter(e -> e.getGoodsId().equals(item.getGoodsId())
|
|
|
@@ -6958,6 +6966,17 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
if (reservoirAreaList.isEmpty()) {
|
|
|
throw new RuntimeException("请先维护库区");
|
|
|
}
|
|
|
+ List<String> goodsList = excelList.stream().map(ReservoirAreaExcel::getGoodsName).distinct()
|
|
|
+ .filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ if (excelList.size() != goodsList.size()) {
|
|
|
+ throw new RuntimeException("导入数据存在重复商品编码,请处理后再导入");
|
|
|
+ }
|
|
|
+ String codes = String.join(",", goodsList);
|
|
|
+ LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
+ .apply("find_in_set(cname,'" + codes + "')");
|
|
|
+ List<PjGoodsDesc> goodsDescList = goodsDescMapper.selectList(lambdaQueryWrapper);
|
|
|
List<PjShipItems> shipItemsList = shipItemsService.list(new LambdaQueryWrapper<PjShipItems>()
|
|
|
.eq(PjShipItems::getIsDeleted, 0)
|
|
|
.eq(PjShipItems::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -7002,7 +7021,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
shipItems.setReservoirAreaId(reservoirArea.getId());
|
|
|
shipItems.setReservoirAreaName(reservoirArea.getCname());
|
|
|
shipItems.setSendNum(shipItems.getGoodsNum());
|
|
|
+ PjGoodsDesc goodsDesc = goodsDescList.stream().filter(e -> e.getCname().equals(item.getGoodsName())).findFirst().orElse(null);
|
|
|
shipItems.setDot(item.getDot());
|
|
|
+ if (goodsDesc != null) {
|
|
|
+ if ("0".equals(goodsDesc.getWhether())){
|
|
|
+ shipItems.setDot(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
shipItemsListNew.add(shipItems);
|
|
|
PjHistory history = new PjHistory();
|
|
|
history.setCreateUser(AuthUtil.getUserId());
|