diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInventoryOmsParamDO.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInventoryOmsParamDO.java index a070f5b25..242ad102f 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInventoryOmsParamDO.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInventoryOmsParamDO.java @@ -84,4 +84,6 @@ public class MaterialInventoryOmsParamDO extends BaseVOEntity { //过期日期 private Date expiryDate; + private String executioOrderNumber; + } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/executionStockOutOrder/service/ExecutionStockOutOrderDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/executionStockOutOrder/service/ExecutionStockOutOrderDomainService.java index a36b58f22..5afab346e 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/executionStockOutOrder/service/ExecutionStockOutOrderDomainService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/executionStockOutOrder/service/ExecutionStockOutOrderDomainService.java @@ -33,6 +33,10 @@ import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockO import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink; import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IReservationDeliveryDetailsLinkService; //import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper; +import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory; +import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper; import com.mhd.system.api.SystemServiceFeign; import com.mhd.system.api.WmsServiceFeign; import com.mhd.system.api.domain.*; @@ -85,6 +89,10 @@ public class ExecutionStockOutOrderDomainService { private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService; @Autowired private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper; + @Autowired + private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper; + @Autowired + private ReservationMaterialInventoryMapper reservationMaterialInventoryMapper; /** * 分页查询出库单列表 @@ -317,6 +325,33 @@ public class ExecutionStockOutOrderDomainService { stockOutOrder.setOutOrderNumber(outOrderNumber); wmsServiceFeign.omsCancelExecutionOrder(stockOutOrder); //还原oms库存及调整记录 + List reservationInventoryAdjustmentRecords = inventoryAdjustmentRecordMapper.selectList(new LambdaQueryWrapper() + .eq(ReservationInventoryAdjustmentRecord::getExecutionOrderNumber, outOrderNumber) + .eq(ReservationInventoryAdjustmentRecord::getDelFlag, 1)); + for (ReservationInventoryAdjustmentRecord reservationInventoryAdjustmentRecord : reservationInventoryAdjustmentRecords) { + Long materialInventoryId = reservationInventoryAdjustmentRecord.getMaterialInventoryId(); + ReservationMaterialInventory reservationMaterialInventory = reservationMaterialInventoryMapper.selectById(materialInventoryId); +// BigDecimal inventoryBeforeQuantity = reservationInventoryAdjustmentRecord.getInventoryBeforeQuantity(); +// BigDecimal inventoryAfterQuantity = reservationInventoryAdjustmentRecord.getInventoryAfterQuantity(); + BigDecimal allocationBeforeQuantity = reservationInventoryAdjustmentRecord.getAllocationBeforeQuantity(); + BigDecimal allocationAfterQuantity = reservationInventoryAdjustmentRecord.getAllocationAfterQuantity(); + BigDecimal allocation = allocationBeforeQuantity.subtract(allocationAfterQuantity); + BigDecimal freezeBeforeQuantity = reservationInventoryAdjustmentRecord.getFreezeBeforeQuantity(); + BigDecimal freezeAfterQuantity = reservationInventoryAdjustmentRecord.getFreezeAfterQuantity(); + BigDecimal freeze = freezeAfterQuantity.subtract(freezeBeforeQuantity); + BigDecimal allocationQuantity = reservationMaterialInventory.getAllocationQuantity(); + BigDecimal freezeQuantity = reservationMaterialInventory.getFreezeQuantity(); + allocationQuantity.add(allocation); + freezeQuantity.subtract(freeze); + reservationMaterialInventory.setAllocationQuantity(allocationQuantity); + reservationMaterialInventory.setFreezeQuantity(freezeQuantity); + reservationMaterialInventory.setUpdateTime(new Date()); + reservationMaterialInventory.setUpdateBy(loginUser.getUserid()); + reservationMaterialInventory.setUpdateByName(userRealName); + reservationMaterialInventoryMapper.updateById(reservationMaterialInventory); + reservationInventoryAdjustmentRecord.setDelFlag(2); + inventoryAdjustmentRecordMapper.updateById(reservationInventoryAdjustmentRecord); + } } } diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/entity/ReservationInventoryAdjustmentRecord.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/entity/ReservationInventoryAdjustmentRecord.java index b322cd6fa..2c90e06fc 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/entity/ReservationInventoryAdjustmentRecord.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/entity/ReservationInventoryAdjustmentRecord.java @@ -199,4 +199,8 @@ public class ReservationInventoryAdjustmentRecord extends BaseVOEntity { @Excel(name = "批次号") private String batchNumber; + @ApiModelProperty("执行单号") + @Excel(name = "执行单号") + private String executionOrderNumber; + } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/po/ReservationInventoryAdjustmentRecordPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/po/ReservationInventoryAdjustmentRecordPO.java index 8395484d6..00338b43f 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/po/ReservationInventoryAdjustmentRecordPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/po/ReservationInventoryAdjustmentRecordPO.java @@ -255,4 +255,7 @@ public class ReservationInventoryAdjustmentRecordPO extends BaseVOEntity { @ApiModelProperty("批次号") @Excel(name = "批次号") private String batchNumber; + @ApiModelProperty("执行单号") + @Excel(name = "执行单号") + private String executionOrderNumber; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDO.java index 8ac097c2d..4a68a2ddb 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDO.java @@ -214,4 +214,7 @@ public class ReservationInventoryAdjustmentRecordDO extends BaseVOEntity { private String lotCode; private String expiryDate; private String productionDate; + @ApiModelProperty("执行单号") + @Excel(name = "执行单号") + private String executionOrderNumber; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDTO.java index 0a2734c2c..57c14bd21 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDTO.java @@ -172,4 +172,7 @@ public class ReservationInventoryAdjustmentRecordDTO extends BaseVOEntity { @ApiModelProperty(name = "权限菜单ID") private Long permissionMenuId; + @ApiModelProperty("执行单号") + @Excel(name = "执行单号") + private String executionOrderNumber; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java index 0b5ca9081..edf99e0ec 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java @@ -296,7 +296,10 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl queryNoticePrint(ReserveStockInOrderDO stockInOrderDO); - List queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO);} \ No newline at end of file + List queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO); + + public String getJsbz(@Param("id") Long id); +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderDomainService.java index 118ebfa72..41d0f6a55 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderDomainService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderDomainService.java @@ -451,6 +451,9 @@ public class ReserveStockInOrderDomainService { reservationStockInOrder.setOrderTypeCode("pu_tong_ru_ku"); reservationStockInOrder.setOrderTypeName("普通入库"); reservationStockInOrder.setReservationOrderSource("客户预约"); + Long shipperId = reservationStockInOrder.getShipperId(); + String jsbz = reservationStockInOrderMapper.getJsbz(shipperId); + reservationStockInOrder.setSettlementCurrency(jsbz); String inOrderNumber = reservationStockInOrder.getInOrderNumber(); List materialDetailList = materialDetailService.list(new QueryWrapper().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber)); List inMaterialDetailList = new ArrayList<>(); diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderDomainService.java index a9e8de8ad..600cef7f2 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderDomainService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderDomainService.java @@ -282,6 +282,9 @@ public class ReserveStockOutOrderDomainService { reservationStockOutOrder.setOrderTypeCode("pu_tong_chu_ku"); reservationStockOutOrder.setOrderTypeName("普通出库"); reservationStockOutOrder.setReservationOrderSource("客户预约"); + Long shipperId = reservationStockOutOrder.getShipperId(); + String jsbz = reservationStockInOrderMapper.getJsbz(shipperId); + reservationStockOutOrder.setSettlementCurrency(jsbz); reservationStockOutOrderService.save(reservationStockOutOrder); String outOrderNumber = reservationStockOutOrder.getOutOrderNumber(); List materialDetailList = outMaterialDetailService.list(new QueryWrapper().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outOrderNumber)); diff --git a/mhd_oms/src/main/resources/mapper/reserveStockInOrder/ReserveStockInOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reserveStockInOrder/ReserveStockInOrderMapper.xml index b04c68208..7546d26e8 100644 --- a/mhd_oms/src/main/resources/mapper/reserveStockInOrder/ReserveStockInOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reserveStockInOrder/ReserveStockInOrderMapper.xml @@ -769,4 +769,12 @@ + + \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/todo/MaterialInventoryQueryListDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/todo/MaterialInventoryQueryListDO.java index b1213a20f..4b26a1140 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/todo/MaterialInventoryQueryListDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/todo/MaterialInventoryQueryListDO.java @@ -255,5 +255,7 @@ public class MaterialInventoryQueryListDO extends MaterialBaseDO { /** 为 true 时 SQL 排除库存数量为 0(含 null 视为 0) */ private Boolean excludeZeroInventoryQuantity; - + private String expiryDateStr; + private String productionDateStr; + private String updateTimeStr; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/persistence/OutMaterialDetailImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/persistence/OutMaterialDetailImpl.java index 52af94400..1cbe42c5e 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/persistence/OutMaterialDetailImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/persistence/OutMaterialDetailImpl.java @@ -598,6 +598,7 @@ public class OutMaterialDetailImpl extends ServiceImpl