|
|
@@ -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());
|
|
|
@@ -2189,7 +2193,7 @@ 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.isNotNull(item.getDot())){
|
|
|
+ if (ObjectUtils.isNotNull(item.getDot())) {
|
|
|
if (ObjectUtils.isNull(orderItems.getDots())) {
|
|
|
orderItems.setDots(item.getDot());
|
|
|
} else {
|
|
|
@@ -2610,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");
|
|
|
@@ -2979,7 +2981,7 @@ 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 (ObjectUtils.isNotNull(item.getDot())){
|
|
|
+ if (ObjectUtils.isNotNull(item.getDot())) {
|
|
|
if (orderItems.getSendNum().compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
orderItems.setDots("");
|
|
|
} else {
|
|
|
@@ -4196,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");
|
|
|
@@ -6966,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())
|
|
|
@@ -7010,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());
|