|
|
@ -39,10 +39,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
import org.springblade.common.constant.Inventory.InventoryBindingStatusConstant; |
|
|
|
import org.springblade.common.constant.Inventory.*; |
|
|
|
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; |
|
|
|
|
|
|
|
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; |
|
|
|
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryTypeConstant; |
|
|
|
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryStatusConstant; |
|
|
|
import org.springblade.common.constant.delivery.DeliveryStatusConstant; |
|
|
|
import org.springblade.common.constant.order.OrderReservationStatusConstant; |
|
|
|
import org.springblade.common.constant.order.OrderReservationStatusConstant; |
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant; |
|
|
|
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant; |
|
|
@ -392,8 +389,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
if (Func.isNotBlank(i.getOrderCode())) { |
|
|
|
if (Func.isNotBlank(i.getOrderCode())) { |
|
|
|
orderNumber.add(i.getOrderCode()); |
|
|
|
orderNumber.add(i.getOrderCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer quantityOccupied = i.getQuantityOccupied(); |
|
|
|
Integer quantityOccupied = i.getQuantityOccupied(); |
|
|
|
i.setQuantityOccupied(quantityOccupied + i.getReservationNum()); |
|
|
|
i.setQuantityOccupied(quantityOccupied + i.getReservationNum()); |
|
|
|
distributionStockListService.updateById(i); |
|
|
|
distributionStockListService.updateById(i); |
|
|
@ -416,7 +411,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionReservationStocklistService.save(distributionReservationStocklistEntity); |
|
|
|
distributionReservationStocklistService.save(distributionReservationStocklistEntity); |
|
|
|
stockListCount.getAndAdd(distributionReservationStocklistEntity.getReservationNum()); |
|
|
|
stockListCount.getAndAdd(distributionReservationStocklistEntity.getReservationNum()); |
|
|
|
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); |
|
|
|
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); |
|
|
|
for (int j = 0; j < quantityOccupied; j++) { |
|
|
|
for (int j = 0; j < i.getReservationNum(); j++) { |
|
|
|
//构建库存品
|
|
|
|
//构建库存品
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity(); |
|
|
|
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity(); |
|
|
|
disStockListDetailEntity.setNum(1); |
|
|
|
disStockListDetailEntity.setNum(1); |
|
|
@ -428,7 +423,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setReservationStockListId(distributionReservationStocklistEntity.getId()); |
|
|
|
disStockListDetailEntity.setReservationId(reservationId); |
|
|
|
|
|
|
|
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.zhengchang.getValue()); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
//完成库存品详情的添加
|
|
|
|
//完成库存品详情的添加
|
|
|
@ -859,6 +855,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionDeliveryListEntity.setDriverName(driverNames.deleteCharAt(driverNames.length() - 1).toString()); |
|
|
|
distributionDeliveryListEntity.setDriverName(driverNames.deleteCharAt(driverNames.length() - 1).toString()); |
|
|
|
distributionDeliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length() - 1).toString()); |
|
|
|
distributionDeliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length() - 1).toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
distributionDeliveryListEntity.setWarehouseName(String.join(",", warehouseNames)); |
|
|
|
distributionDeliveryListEntity.setWarehouseName(String.join(",", warehouseNames)); |
|
|
|
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue()); |
|
|
|
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue()); |
|
|
|
distributionDeliveryListEntity.setCustomersNumber(reservationIds.split(",").length); |
|
|
|
distributionDeliveryListEntity.setCustomersNumber(reservationIds.split(",").length); |
|
|
@ -1104,8 +1101,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setReservationStockListId(reservationStocklistEntity.getId()); |
|
|
|
disStockListDetailEntity.setReservationId(id); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
|
|
|
|
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.xinzneg.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
//完成库存品详情的添加
|
|
|
|
//完成库存品详情的添加
|
|
|
|
disStockListDetailService.saveBatch(detailEntities); |
|
|
|
disStockListDetailService.saveBatch(detailEntities); |
|
|
@ -1119,8 +1117,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
Integer newReservationNum = distributionStockListDTO.getReservationNum(); |
|
|
|
Integer newReservationNum = distributionStockListDTO.getReservationNum(); |
|
|
|
if (oldReservationNum > newReservationNum){ |
|
|
|
if (oldReservationNum > newReservationNum){ |
|
|
|
//对应库存品减少
|
|
|
|
//对应库存品减少
|
|
|
|
}else { |
|
|
|
//查询出对应的库存品信息,进行取消状态标识
|
|
|
|
int count = oldReservationNum - newReservationNum; |
|
|
|
int count = oldReservationNum - newReservationNum; |
|
|
|
|
|
|
|
List<DisStockListDetailEntity> disStockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, id) |
|
|
|
|
|
|
|
.eq(DisStockListDetailEntity::getStockListId,distributionReservationStocklistEntity.getStocklistId()) |
|
|
|
|
|
|
|
.ne(DisStockListDetailEntity::getStockLockingStatus, InventoryPackageStatusConstant.quxiao.getValue())); |
|
|
|
|
|
|
|
for (int i = 0; i < count; i++) { |
|
|
|
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(i); |
|
|
|
|
|
|
|
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()); |
|
|
|
|
|
|
|
disStockListDetailService.updateById(disStockListDetailEntity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
int count =newReservationNum - oldReservationNum ; |
|
|
|
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); |
|
|
|
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); |
|
|
|
for (int i = 0; i < count; i++) { |
|
|
|
for (int i = 0; i < count; i++) { |
|
|
|
//构建库存品
|
|
|
|
//构建库存品
|
|
|
@ -1134,11 +1143,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setReservationStockListId(reservationStocklistEntity.getId()); |
|
|
|
disStockListDetailEntity.setReservationId(id); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
|
|
|
|
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.xinzneg.getValue()); |
|
|
|
//完成库存品详情的添加
|
|
|
|
//完成库存品详情的添加
|
|
|
|
disStockListDetailService.saveBatch(detailEntities); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
disStockListDetailService.saveBatch(detailEntities); |
|
|
|
//对应库存品增加
|
|
|
|
//对应库存品增加
|
|
|
|
} |
|
|
|
} |
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(distributionReservationStocklistEntity.getStocklistId()); |
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(distributionReservationStocklistEntity.getStocklistId()); |
|
|
@ -1168,6 +1178,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionStockListEntity.setQuantityOccupied(newQuantityOccupied); |
|
|
|
distributionStockListEntity.setQuantityOccupied(newQuantityOccupied); |
|
|
|
distributionStockListService.updateById(distributionStockListEntity); |
|
|
|
distributionStockListService.updateById(distributionStockListEntity); |
|
|
|
disStockListDetailMapper.deleteByReservationStockListId(distributionReservationStocklistEntity.getId()); |
|
|
|
disStockListDetailMapper.deleteByReservationStockListId(distributionReservationStocklistEntity.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 删除库存品包件信息
|
|
|
|
}); |
|
|
|
}); |
|
|
|
DistributionReservationEntity reservationEntity = this.getById(id); |
|
|
|
DistributionReservationEntity reservationEntity = this.getById(id); |
|
|
|
Integer reservationNum = reservationEntity.getReservationNum(); |
|
|
|
Integer reservationNum = reservationEntity.getReservationNum(); |
|
|
@ -1201,6 +1213,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
log.error("参数异常allocationDTO+{" + allocationDTO + "}"); |
|
|
|
log.error("参数异常allocationDTO+{" + allocationDTO + "}"); |
|
|
|
return R.fail("服务器正忙!!!"); |
|
|
|
return R.fail("服务器正忙!!!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)){ |
|
|
|
|
|
|
|
return R.fail("无仓库信息!!!"); |
|
|
|
|
|
|
|
} |
|
|
|
//1、添加配送任务
|
|
|
|
//1、添加配送任务
|
|
|
|
DistributionStockupDTO stockup = allocationDTO.getStockup(); |
|
|
|
DistributionStockupDTO stockup = allocationDTO.getStockup(); |
|
|
|
DistributionStockupEntity stockupEntity = Func.copy(stockup, DistributionStockupEntity.class); |
|
|
|
DistributionStockupEntity stockupEntity = Func.copy(stockup, DistributionStockupEntity.class); |
|
|
@ -1464,6 +1480,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionDeliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get()); |
|
|
|
distributionDeliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get()); |
|
|
|
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT)); |
|
|
|
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT)); |
|
|
|
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get()); |
|
|
|
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get()); |
|
|
|
|
|
|
|
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
distributionDeliveryListService.updateById(distributionDeliveryListEntity); |
|
|
|
distributionDeliveryListService.updateById(distributionDeliveryListEntity); |
|
|
|
return R.status(true); |
|
|
|
return R.status(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -1964,7 +1981,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionReservationStocklistService.save(distributionReservationStocklistEntity); |
|
|
|
distributionReservationStocklistService.save(distributionReservationStocklistEntity); |
|
|
|
stockListCount.getAndAdd(distributionReservationStocklistEntity.getReservationNum()); |
|
|
|
stockListCount.getAndAdd(distributionReservationStocklistEntity.getReservationNum()); |
|
|
|
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); |
|
|
|
List<DisStockListDetailEntity> detailEntities = new ArrayList<>(); |
|
|
|
for (int j = 0; j < quantityOccupied; j++) { |
|
|
|
for (int j = 0; j < i.getReservationNum(); j++) { |
|
|
|
//构建库存品
|
|
|
|
//构建库存品
|
|
|
|
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity(); |
|
|
|
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity(); |
|
|
|
disStockListDetailEntity.setNum(1); |
|
|
|
disStockListDetailEntity.setNum(1); |
|
|
@ -1976,8 +1993,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
disStockListDetailEntity.setReservationStockListId(distributionReservationStocklistEntity.getId()); |
|
|
|
disStockListDetailEntity.setReservationId(reservationId); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
detailEntities.add(disStockListDetailEntity); |
|
|
|
|
|
|
|
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.zhengchang.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
//完成库存品详情的添加
|
|
|
|
//完成库存品详情的添加
|
|
|
|
disStockListDetailService.saveBatch(detailEntities); |
|
|
|
disStockListDetailService.saveBatch(detailEntities); |
|
|
|