|
|
|
@ -2072,20 +2072,24 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
Long trayTypeId = targetTrayTypeEntity.getId(); |
|
|
|
|
List<WarehouseTrayGoodsEntity> addList = new ArrayList<>(); |
|
|
|
|
for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){ |
|
|
|
|
|
|
|
|
|
Long associationId = trayGoodsEntity.getAssociationId(); |
|
|
|
|
String associationValue = trayGoodsEntity.getAssociationValue(); |
|
|
|
|
Long marketId = trayGoodsEntity.getMarketId(); |
|
|
|
|
String incomingBatch = trayGoodsEntity.getIncomingBatch(); |
|
|
|
|
Integer newNum = trayGoodsEntity.getNum(); |
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("association_id",associationId) |
|
|
|
|
.eq("association_value",associationValue) |
|
|
|
|
.eq("market_id",marketId) |
|
|
|
|
.eq("incoming_batch",incomingBatch) |
|
|
|
|
.eq("tray_type_id",trayTypeId); |
|
|
|
|
WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper); |
|
|
|
|
if(!Objects.isNull(oldTrayGoodsEntity)){ |
|
|
|
|
Integer num = oldTrayGoodsEntity.getNum(); |
|
|
|
|
oldTrayGoodsEntity.setNum(num+newNum); |
|
|
|
|
addList.add(oldTrayGoodsEntity); |
|
|
|
|
sourceTrayGoodsList.remove(trayGoodsEntity); |
|
|
|
|
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity); |
|
|
|
|
// addList.add(oldTrayGoodsEntity);
|
|
|
|
|
// sourceTrayGoodsList.remove(trayGoodsEntity);
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2097,7 +2101,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
trayGoodsEntity.setTrayCode(trayCode); |
|
|
|
|
trayGoodsEntity.setTrayTypeId(trayTypeId); |
|
|
|
|
} |
|
|
|
|
sourceTrayGoodsList.addAll(addList); |
|
|
|
|
// sourceTrayGoodsList.addAll(addList);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void panduanStockByMaterialName(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, Long filterId, String filterValue,WarehouseTrayTypeEntity targetTrayTypeEntity) { |
|
|
|
@ -2108,17 +2112,22 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){ |
|
|
|
|
Long associationId = trayGoodsEntity.getAssociationId(); |
|
|
|
|
String associationValue = trayGoodsEntity.getAssociationValue(); |
|
|
|
|
Long marketId = trayGoodsEntity.getMarketId(); |
|
|
|
|
String incomingBatch = trayGoodsEntity.getIncomingBatch(); |
|
|
|
|
Integer newNum = trayGoodsEntity.getNum(); |
|
|
|
|
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("association_id",associationId) |
|
|
|
|
.eq("association_value",associationValue) |
|
|
|
|
.eq("market_id",marketId) |
|
|
|
|
.eq("incoming_batch",incomingBatch) |
|
|
|
|
.eq("tray_type_id",trayTypeId); |
|
|
|
|
WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper); |
|
|
|
|
if(!Objects.isNull(oldTrayGoodsEntity)){ |
|
|
|
|
Integer num = oldTrayGoodsEntity.getNum(); |
|
|
|
|
oldTrayGoodsEntity.setNum(num+newNum); |
|
|
|
|
addList.add(oldTrayGoodsEntity); |
|
|
|
|
sourceTrayGoodsList.remove(trayGoodsEntity); |
|
|
|
|
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity); |
|
|
|
|
// addList.add(oldTrayGoodsEntity);
|
|
|
|
|
// sourceTrayGoodsList.remove(trayGoodsEntity);
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2130,7 +2139,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
trayGoodsEntity.setTrayCode(trayCode); |
|
|
|
|
trayGoodsEntity.setTrayTypeId(trayTypeId); |
|
|
|
|
} |
|
|
|
|
sourceTrayGoodsList.addAll(addList); |
|
|
|
|
// sourceTrayGoodsList.addAll(addList);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void panduanZeroByOrderCode(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, Long filterId, String filterValue,WarehouseTrayTypeEntity targetTrayTypeEntity) { |
|
|
|
@ -2150,8 +2159,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
if(!Objects.isNull(oldTrayGoodsEntity)){ |
|
|
|
|
Integer num = oldTrayGoodsEntity.getNum(); |
|
|
|
|
oldTrayGoodsEntity.setNum(num+newNum); |
|
|
|
|
addList.add(oldTrayGoodsEntity); |
|
|
|
|
sourceTrayGoodsList.remove(trayGoodsEntity); |
|
|
|
|
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity); |
|
|
|
|
// addList.add(oldTrayGoodsEntity);
|
|
|
|
|
// sourceTrayGoodsList.remove(trayGoodsEntity);
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2186,8 +2196,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
|
|
|
|
|
if(!Objects.isNull(oldTrayGoodsEntity)){ |
|
|
|
|
Integer num = oldTrayGoodsEntity.getNum(); |
|
|
|
|
oldTrayGoodsEntity.setNum(num+newNum); |
|
|
|
|
addList.add(oldTrayGoodsEntity); |
|
|
|
|
sourceTrayGoodsList.remove(trayGoodsEntity); |
|
|
|
|
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity); |
|
|
|
|
// addList.add(oldTrayGoodsEntity);
|
|
|
|
|
// sourceTrayGoodsList.remove(trayGoodsEntity);
|
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|