From afe1cd5011f72661013a5da779a5f57f13f0bc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Tue, 21 Apr 2026 17:41:53 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=9C=AA=E6=8C=89=E7=85=A7=E4=BB=93=E5=BA=93=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InOrderAbnormalApplicationService.java | 10 ++++++++-- .../OutOrderAbnormalApplicationService.java | 10 ++++++++++ .../dto/inOrderAbnormal/InOrderAbnormalDTO.java | 2 ++ .../dto/outOrderAbnormal/OutOrderAbnormalDTO.java | 8 ++++++++ .../mapper/outOrderAbnormal/OutOrderAbnormalMapper.xml | 6 +++--- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java index a9547a025..16738fa25 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java @@ -37,8 +37,14 @@ public class InOrderAbnormalApplicationService { if (topOrganizationId != null && topOrganizationId != 1){ inOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); } - AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); - inOrderAbnormalDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId()); + // 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与出库异常一致) + if (inOrderAbnormalDO.getWarehouseId() == null) { + AssociationWarehouseCacheDO cache = + SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); + if (cache != null && cache.getWarehouseId() != null) { + inOrderAbnormalDO.setWarehouseId(cache.getWarehouseId()); + } + } } return inOrderAbnormalDomainService.queryList(inOrderAbnormalDO); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java index fa7ea2f63..0fb1aa5e6 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java @@ -1,6 +1,8 @@ package com.mhd.wms.application.service.outOrderAbnormal; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO; +import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; import com.mhd.system.api.model.LoginUser; import com.mhd.wms.domain.outOrderAbnormal.repository.po.OutOrderAbnormalPO; import com.mhd.wms.domain.outOrderAbnormal.repository.todo.OutOrderAbnormalDO; @@ -35,6 +37,14 @@ public class OutOrderAbnormalApplicationService { if (topOrganizationId != null && topOrganizationId != 1){ outOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); } + // 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与入库异常一致) + if (outOrderAbnormalDO.getWarehouseId() == null) { + AssociationWarehouseCacheDO cache = + SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); + if (cache != null && cache.getWarehouseId() != null) { + outOrderAbnormalDO.setWarehouseId(cache.getWarehouseId()); + } + } } return outOrderAbnormalDomainService.queryList(outOrderAbnormalDO); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inOrderAbnormal/InOrderAbnormalDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inOrderAbnormal/InOrderAbnormalDTO.java index 7f3b04279..ca738269b 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inOrderAbnormal/InOrderAbnormalDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/inOrderAbnormal/InOrderAbnormalDTO.java @@ -82,6 +82,8 @@ public class InOrderAbnormalDTO extends BaseVOEntity { @Excel(name = "备注") private String remark; + @ApiModelProperty("仓库id(列表筛选,关联 stock_in_order)") + private Long warehouseId; @ApiModelProperty(name = "组织ID集合") private List organizationIdList; diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outOrderAbnormal/OutOrderAbnormalDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outOrderAbnormal/OutOrderAbnormalDTO.java index 3048e6c1c..30f15c850 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outOrderAbnormal/OutOrderAbnormalDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outOrderAbnormal/OutOrderAbnormalDTO.java @@ -78,6 +78,14 @@ public class OutOrderAbnormalDTO extends BaseVOEntity { @Excel(name = "备注") private String remark; + @ApiModelProperty("仓库id(列表筛选,关联 stock_out_order)") + private Long warehouseId; + + @ApiModelProperty("货主id(列表筛选,关联 stock_out_order)") + private Long shipperId; + + @ApiModelProperty("出库单类型编码(列表筛选,关联 stock_out_order)") + private String orderTypeCode; @ApiModelProperty(name = "组织ID集合") private List organizationIdList; diff --git a/mhd_wms/src/main/resources/mapper/outOrderAbnormal/OutOrderAbnormalMapper.xml b/mhd_wms/src/main/resources/mapper/outOrderAbnormal/OutOrderAbnormalMapper.xml index c40d0fb1d..1244b2790 100644 --- a/mhd_wms/src/main/resources/mapper/outOrderAbnormal/OutOrderAbnormalMapper.xml +++ b/mhd_wms/src/main/resources/mapper/outOrderAbnormal/OutOrderAbnormalMapper.xml @@ -92,14 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + and b.warehouse_id = #{warehouseId} - + and b.shipper_id = #{shipperId} - and a.order_type_code = #{orderTypeCode} + and b.order_type_code = #{orderTypeCode} and b.del_flag = #{delFlag} From 404c1e1225498206a39f2b62586ac343fa898fc1 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Tue, 21 Apr 2026 17:44:27 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E5=87=BA=E5=BA=93=E4=BA=A4=E6=8E=A5?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=87=BA=E5=BA=93=E5=8D=95=E5=8F=B7=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=92=8C=E4=B8=9A=E5=8A=A1id=EF=BC=8C=E4=B8=8A?= =?UTF-8?q?=E6=9E=B6=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AElot=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E5=90=8C=E6=AD=A5oms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mhd_wms/sql/pdaSql.sql | 2 ++ .../HandoverTaskOrderDomainService.java | 20 +++++++++++++++++++ .../persistence/ShelfMaterialDetailImpl.java | 18 +++++++++++------ .../facade/IStockShelfOrderService.java | 4 ++++ .../mapper/StockShelfOrderMapper.java | 4 ++++ .../persistence/StockShelfOrderImpl.java | 10 ++++++++++ .../stockShelfOrder/StockShelfOrderMapper.xml | 10 ++++++++++ 7 files changed, 62 insertions(+), 6 deletions(-) diff --git a/mhd_wms/sql/pdaSql.sql b/mhd_wms/sql/pdaSql.sql index 605b8cf75..2d4db8d6d 100644 --- a/mhd_wms/sql/pdaSql.sql +++ b/mhd_wms/sql/pdaSql.sql @@ -42,4 +42,6 @@ ALTER TABLE NGWL_TEST_WMS.RECEIPT_MATERIAL_DETAIL ADD oms_in_material_detail var ALTER TABLE NGWL_TEST_WMS.SHELF_MATERIAL_DETAIL ADD OMS_IN_MATERIAL_DETAIL varchar(100) NULL; ALTER TABLE NGWL_TEST_OMS.RESERVATION_IN_MATERIAL_DETAIL ADD INBOUND_ITEMS varchar(100) NULL; +ALTER TABLE NGWL_TEST_OMS.RESERVATION_OUT_MATERIAL_DETAIL ADD INBOUND_ITEMS varchar(100) NULL; + diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java index 78088622d..fbceee889 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java @@ -30,7 +30,9 @@ import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail; import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper; import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper; import com.mhd.wms.domain.pickingMaterialDetail.repository.po.PickingMaterialDetailPO; +import com.mhd.wms.domain.shelfMaterialDetail.repository.todo.ShelfMaterialDetailDO; import com.mhd.wms.domain.stockOutOrder.repository.facade.IStockOutOrderService; +import com.mhd.wms.domain.stockShelfOrder.repository.facade.IStockShelfOrderService; import com.mhd.wms.domain.taskHandoverMaterialDetail.repository.po.TaskHandoverMaterialDetailPO; import com.mhd.wms.domain.shiftManage.repository.po.ShiftManagePO; import com.mhd.wms.domain.shiftManage.repository.todo.ShiftManageDO; @@ -333,6 +335,8 @@ public class HandoverTaskOrderDomainService { .eq(OutMaterialDetail::getDelFlag, 1)); Integer review = stockOutOrder != null ? stockOutOrder.getReview() : null; for (OutMaterialDetail outMaterialDetail : outMaterialDetailList) { + //oms详情同步 + OMSWarehouseEntryDetails(outMaterialDetail); if (outMaterialDetail.getCopyCodeReferenceIds() != null){ List copyCodeReferenceIds = Arrays.stream(outMaterialDetail.getCopyCodeReferenceIds().split(",")) .map(Integer::parseInt).collect(Collectors.toList()); @@ -486,6 +490,22 @@ public class HandoverTaskOrderDomainService { } } + @Autowired + private IStockShelfOrderService stockShelfOrderService; + private void OMSWarehouseEntryDetails(OutMaterialDetail outMaterialDetail) { + outMaterialDetail.getOutOrderNumber();//出库单号 + outMaterialDetail.getUniqueId(); + outMaterialDetail.getCheckQuantity();//入库件数 + outMaterialDetail.getTotalNetWeight();//重量 + //以出库单号和业务唯一id判断 + stockShelfOrderService.updateOmsHandover( + outMaterialDetail.getCheckQuantity(), + outMaterialDetail.getTotalNetWeight(), + outMaterialDetail.getOutOrderNumber(), + outMaterialDetail.getUniqueId() + ); + } + private void getBarCode(MaterialInventory materialInventoryPO, InventoryAdjustmentRecord inventoryAdjustmentRecord) { List materialBarCodePOList = materialBarCodeService.getInfoByMaterialBaseInfoIds(materialInventoryPO.getMaterialBaseInfoId()); diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/shelfMaterialDetail/repository/persistence/ShelfMaterialDetailImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/shelfMaterialDetail/repository/persistence/ShelfMaterialDetailImpl.java index bb559b75a..b5c4e88b0 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/shelfMaterialDetail/repository/persistence/ShelfMaterialDetailImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/shelfMaterialDetail/repository/persistence/ShelfMaterialDetailImpl.java @@ -470,13 +470,19 @@ public class ShelfMaterialDetailImpl extends ServiceImpl public void updateOmsOrder(String orderNumber, Integer status, Integer shelvesQuantity); public void updateOmsDocument(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String omsInMaterialDetail); + + public void updateOmsHandover(BigDecimal checkQuantity, BigDecimal totalNetWeight, String outOrderNumber, Long uniqueId); + + public void updateOmsDocumentLot(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String lotNumber); } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/mapper/StockShelfOrderMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/mapper/StockShelfOrderMapper.java index 55f889658..58dd29f6a 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/mapper/StockShelfOrderMapper.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/mapper/StockShelfOrderMapper.java @@ -25,4 +25,8 @@ public interface StockShelfOrderMapper extends BaseMapper public void updateOmsOrder(@Param("orderNumber") String orderNumber, @Param("status") Integer status, @Param("shelvesQuantity") Integer shelvesQuantity); void updateOmsDocument(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String omsInMaterialDetail); + + void updateOmsHandover(BigDecimal checkQuantity, BigDecimal totalNetWeight, String outOrderNumber, Long uniqueId); + + void updateOmsDocumentLot(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String lotNumber); } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/persistence/StockShelfOrderImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/persistence/StockShelfOrderImpl.java index 14f4b1e76..3562c3b29 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/persistence/StockShelfOrderImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/repository/persistence/StockShelfOrderImpl.java @@ -118,6 +118,16 @@ public class StockShelfOrderImpl extends ServiceImpl update "NGWL_TEST_OMS".RESERVATION_IN_MATERIAL_DETAIL set INBOUND_ITEMS = #{shelvesQuantity}, TOTAL_NET_WEIGHT= #{totalNetWeight},STORAGE_TIME = CURRENT_TIMESTAMP where MATERIAL_DETAIL_ID = #{omsInMaterialDetail} + + update "NGWL_TEST_OMS".RESERVATION_OUT_MATERIAL_DETAIL set INBOUND_ITEMS = #{checkQuantity}, + TOTAL_NET_WEIGHT= #{totalNetWeight} + ,STORAGE_TIME = CURRENT_TIMESTAMP + where OUT_ORDER_NUMBER = #{outOrderNumber} and UNIQUE_ID = #{uniqueId} + + + update "NGWL_TEST_OMS".RESERVATION_IN_MATERIAL_DETAIL set INBOUND_ITEMS = #{shelvesQuantity}, TOTAL_NET_WEIGHT= #{totalNetWeight},STORAGE_TIME = CURRENT_TIMESTAMP + where LOT_NO = #{lotNumber} + \ No newline at end of file From 6899e642c7f60b5918d37e1af56cdb0f6afbb94b Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Tue, 21 Apr 2026 18:01:07 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=AD=89=E4=BA=8E0?= =?UTF-8?q?=E4=B9=9F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/materialInventory/MaterialInventoryMapper.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml index c4a45d740..980657c29 100644 --- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml @@ -170,10 +170,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.container_type_name like concat('%', #{containerTypeName}, '%') - + + + and a.inventory_quantity = #{inventoryQuantity} + and a.allocation_quantity = #{allocationQuantity} From 4c1831ec6b78836a86b35af4f7e7c5075d785af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Wed, 22 Apr 2026 09:18:18 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=9C=AA=E6=8C=89=E7=85=A7=E4=BB=93=E5=BA=93=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InOrderAbnormalApplicationService.java | 34 ++++++++++++------ .../OutOrderAbnormalApplicationService.java | 35 +++++++++++++------ 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java index 16738fa25..816a002c6 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/inOrderAbnormal/InOrderAbnormalApplicationService.java @@ -32,17 +32,31 @@ public class InOrderAbnormalApplicationService { public List queryList(InOrderAbnormalDO inOrderAbnormalDO) { LoginUser loginUser = SecurityUtils.getLoginUser(); - if (loginUser != null){ - Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); - if (topOrganizationId != null && topOrganizationId != 1){ - inOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + if (loginUser != null && loginUser.getUserPo() != null) { + AssociationWarehouseCacheDO cache = + SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); + if (inOrderAbnormalDO.getWarehouseId() == null && cache != null + && cache.getWarehouseId() != null) { + inOrderAbnormalDO.setWarehouseId(cache.getWarehouseId()); } - // 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与出库异常一致) - if (inOrderAbnormalDO.getWarehouseId() == null) { - AssociationWarehouseCacheDO cache = - SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); - if (cache != null && cache.getWarehouseId() != null) { - inOrderAbnormalDO.setWarehouseId(cache.getWarehouseId()); + if (inOrderAbnormalDO.getTopOrganizationId() == null) { + Long top = loginUser.getUserPo().getTopOrganizationId(); + if (top == null || Long.valueOf(1L).equals(top)) { + if (cache != null) { + top = cache.getTopOrganizationId(); + } + } + if (top != null && !Long.valueOf(1L).equals(top)) { + inOrderAbnormalDO.setTopOrganizationId(top); + } + } + if (inOrderAbnormalDO.getOrganizationId() == null) { + Long orgId = loginUser.getUserPo().getOrganizationId(); + if (orgId == null && cache != null) { + orgId = cache.getOrganizationId(); + } + if (orgId != null) { + inOrderAbnormalDO.setOrganizationId(orgId); } } } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java index 0fb1aa5e6..708f1d052 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/outOrderAbnormal/OutOrderAbnormalApplicationService.java @@ -32,17 +32,32 @@ public class OutOrderAbnormalApplicationService { public List queryList(OutOrderAbnormalDO outOrderAbnormalDO) { LoginUser loginUser = SecurityUtils.getLoginUser(); - if (loginUser != null){ - Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); - if (topOrganizationId != null && topOrganizationId != 1){ - outOrderAbnormalDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + if (loginUser != null && loginUser.getUserPo() != null) { + // 请求带仓库时也会读关联缓存,用于补全「会话里为空的组织」(UserPo 常见无 organizationId) + AssociationWarehouseCacheDO cache = + SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); + if (outOrderAbnormalDO.getWarehouseId() == null && cache != null + && cache.getWarehouseId() != null) { + outOrderAbnormalDO.setWarehouseId(cache.getWarehouseId()); } - // 请求未带 warehouseId 时用用户关联仓库;带了则以请求为准(与入库异常一致) - if (outOrderAbnormalDO.getWarehouseId() == null) { - AssociationWarehouseCacheDO cache = - SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); - if (cache != null && cache.getWarehouseId() != null) { - outOrderAbnormalDO.setWarehouseId(cache.getWarehouseId()); + if (outOrderAbnormalDO.getTopOrganizationId() == null) { + Long top = loginUser.getUserPo().getTopOrganizationId(); + if (top == null || Long.valueOf(1L).equals(top)) { + if (cache != null) { + top = cache.getTopOrganizationId(); + } + } + if (top != null && !Long.valueOf(1L).equals(top)) { + outOrderAbnormalDO.setTopOrganizationId(top); + } + } + if (outOrderAbnormalDO.getOrganizationId() == null) { + Long orgId = loginUser.getUserPo().getOrganizationId(); + if (orgId == null && cache != null) { + orgId = cache.getOrganizationId(); + } + if (orgId != null) { + outOrderAbnormalDO.setOrganizationId(orgId); } } } From 0238cf44892aed5c82ccb6f78499096907420643 Mon Sep 17 00:00:00 2001 From: zhaoqing <1670883518@qq.com> Date: Wed, 22 Apr 2026 10:58:56 +0800 Subject: [PATCH 05/22] =?UTF-8?q?wms-=E6=8A=84=E7=A0=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/copyCodeReference/CopyCodeReferenceMapper.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml b/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml index 1cc5b163b..6bf467ab9 100644 --- a/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml +++ b/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml @@ -84,6 +84,12 @@ del_flag FROM copy_code_reference WHERE del_flag = 1 + + AND top_organization_id = #{topOrganizationId} + + + AND organization_id = #{organizationId} + AND warehouse_id = #{warehouseId} From 706747650561124cf93fa296002c1a4864e67d3f Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 11:02:19 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=88=B0=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E5=A2=9E=E5=8A=A0=E4=B8=9A=E5=8A=A1=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mhd_wms/sql/pdaSql.sql | 1 + .../domain/stockReceiptOrder/entity/StockReceiptOrder.java | 4 ++++ .../stockReceiptOrder/repository/po/StockReceiptOrderPO.java | 4 ++++ .../repository/todo/StockReceiptOrderDO.java | 4 ++++ .../mapper/stockReceiptOrder/StockReceiptOrderMapper.xml | 3 ++- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mhd_wms/sql/pdaSql.sql b/mhd_wms/sql/pdaSql.sql index 2d4db8d6d..ed9e05c1e 100644 --- a/mhd_wms/sql/pdaSql.sql +++ b/mhd_wms/sql/pdaSql.sql @@ -43,5 +43,6 @@ ALTER TABLE NGWL_TEST_WMS.SHELF_MATERIAL_DETAIL ADD OMS_IN_MATERIAL_DETAIL varch ALTER TABLE NGWL_TEST_OMS.RESERVATION_IN_MATERIAL_DETAIL ADD INBOUND_ITEMS varchar(100) NULL; ALTER TABLE NGWL_TEST_OMS.RESERVATION_OUT_MATERIAL_DETAIL ADD INBOUND_ITEMS varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.STOCK_RECEIPT_ORDER ADD BUSINESS_ORDER_NO varchar(100) NULL; diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/entity/StockReceiptOrder.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/entity/StockReceiptOrder.java index f60271d0b..db246a2ab 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/entity/StockReceiptOrder.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/entity/StockReceiptOrder.java @@ -136,5 +136,9 @@ public class StockReceiptOrder extends BaseVOEntity { @Excel(name = "oms入库单id") private String omsStockInOrderId; + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String businessOrderNo; + } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/po/StockReceiptOrderPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/po/StockReceiptOrderPO.java index 471b0dcb2..fd149b881 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/po/StockReceiptOrderPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/po/StockReceiptOrderPO.java @@ -186,4 +186,8 @@ public class StockReceiptOrderPO extends StockInOrderBasePO { @ApiModelProperty(name = "费用参数json") private String billingJson; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String businessOrderNo; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/todo/StockReceiptOrderDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/todo/StockReceiptOrderDO.java index 58bfb756c..017330f15 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/todo/StockReceiptOrderDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockReceiptOrder/repository/todo/StockReceiptOrderDO.java @@ -192,4 +192,8 @@ public class StockReceiptOrderDO extends StockInOrderBaseDO { @ApiModelProperty("oms入库单id") @Excel(name = "oms入库单id") private String omsStockInOrderId; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String businessOrderNo; } \ No newline at end of file diff --git a/mhd_wms/src/main/resources/mapper/stockReceiptOrder/StockReceiptOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockReceiptOrder/StockReceiptOrderMapper.xml index 57252c476..055191902 100644 --- a/mhd_wms/src/main/resources/mapper/stockReceiptOrder/StockReceiptOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockReceiptOrder/StockReceiptOrderMapper.xml @@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -51,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.status, a.platform_id, a.platform_code, a.platform_name, a.platform_use_time_id, a.platform_use_start_time, a.platform_use_end_time, a.platform_use_status, a.quantity, a.receipt_quantity, a.receipt_material_quantity, a.material_quantity, a.abnormal, a.task_distribution, a.task_distribution_time, a.operators_by, a.operators_name, a.remark, a.create_time, a.create_by, a.create_by_name, - a.update_time, a.update_by, a.update_by_name, a.del_flag, a.billing_json + a.update_time, a.update_by, a.update_by_name, a.del_flag, a.billing_json,a.business_order_no From 64990d01edb2835f1982a1f0b9d8902dd922ed99 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 11:24:06 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=88=B0=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E5=A2=9E=E5=8A=A0=E4=B8=9A=E5=8A=A1=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/persistence/ReceiptMaterialDetailImpl.java | 2 +- .../main/resources/mapper/stockInOrder/StockInOrderMapper.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/receiptMaterialDetail/repository/persistence/ReceiptMaterialDetailImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/receiptMaterialDetail/repository/persistence/ReceiptMaterialDetailImpl.java index 9d42fc6cf..ef5dc2610 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/receiptMaterialDetail/repository/persistence/ReceiptMaterialDetailImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/receiptMaterialDetail/repository/persistence/ReceiptMaterialDetailImpl.java @@ -733,7 +733,7 @@ public class ReceiptMaterialDetailImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("unique_id", receiptMaterialDetailPO.getInUniqueId()); queryWrapper.eq("del_flag", 1); - InMaterialDetail inMaterialDetail = iInMaterialDetailService.getOne(queryWrapper); + InMaterialDetail inMaterialDetail = iInMaterialDetailService.list(queryWrapper).get(0); if (inMaterialDetail == null) { return; } diff --git a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml index b0de5b893..0f8274b2b 100644 --- a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml @@ -95,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -128,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a."TO", a.CONTACT_PERSON, a.VEHICLE_INFO, a.CONSIGNMENT_NO, a.TEL, a.DRIVER_SIGNATURE, a.FAX, a.DECLARATION_AREA, a.MANUFACTURER, a.CUSTOMS_BROKER_INFO, a.DELIVERY_ADDRESS, a.ENTRY_EXIT_CUSTOMS, a.ORIGIN_DESTINATION_COUNTRY, a.CARRIER, a.CONTAINER_NO, a.TRANSPORT_METHOD, a.SUPERVISION_METHOD, a.CUSTOMS_INSPECTION, a.NEED_CUSTOMS_DECLARATION, a.NEED_TRANSPORT, - a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.stock_in_order + a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.stock_in_order,a.business_order_no From 93dfd9c97ea656e4cabf54f03ca17412579d6ead Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 13:16:28 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StockReceiptOrderApplicationService.java | 1 + .../dto/stockReceiptOrder/StockReceiptOrderDTO.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockReceiptOrder/StockReceiptOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockReceiptOrder/StockReceiptOrderApplicationService.java index 6e926cd24..aee534eb7 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockReceiptOrder/StockReceiptOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockReceiptOrder/StockReceiptOrderApplicationService.java @@ -2844,6 +2844,7 @@ public class StockReceiptOrderApplicationService { throw new ServiceException("收货单已完成收货"); } StockReceiptOrderDO returnStockReceiptOrderDO = new StockReceiptOrderDO(); + returnStockReceiptOrderDO.setBusinessOrderNo(stockReceiptOrderPO.getBusinessOrderNo()); returnStockReceiptOrderDO.setBillingJson(stockReceiptOrderDO.getBillingJson()); returnStockReceiptOrderDO.setReceiptOrderAccountList(stockReceiptOrderDO.getReceiptOrderAccountList()); returnStockReceiptOrderDO.setUpdateTime(stockReceiptOrderDO.getUpdateTime()); diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockReceiptOrder/StockReceiptOrderDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockReceiptOrder/StockReceiptOrderDTO.java index 73c390d8f..230432704 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockReceiptOrder/StockReceiptOrderDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/stockReceiptOrder/StockReceiptOrderDTO.java @@ -163,4 +163,8 @@ public class StockReceiptOrderDTO extends StockInOrderBaseDTO { @ApiModelProperty("oms入库单id") @Excel(name = "oms入库单id") private String omsStockInOrderId; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String businessOrderNo; } \ No newline at end of file From 51ec8e7fe0be17a456d95aaa31f7b60c454bb687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Wed, 22 Apr 2026 13:55:50 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=88=86=E9=85=8D?= =?UTF-8?q?=E5=92=8C=E5=87=BA=E5=BA=93=E7=94=9F=E6=88=90=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=B2=A1=E6=9C=89lot=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/MaterialInventoryImpl.java | 20 ++++++++++++++++--- .../mapper/StockShelfOrderMapper.java | 6 +++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java index 7dab18412..9a5be85bc 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java @@ -584,9 +584,23 @@ public class MaterialInventoryImpl extends ServiceImpl public void updateOmsOrder(@Param("orderNumber") String orderNumber, @Param("status") Integer status, @Param("shelvesQuantity") Integer shelvesQuantity); - void updateOmsDocument(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String omsInMaterialDetail); + void updateOmsDocument(@Param("shelvesQuantity") BigDecimal shelvesQuantity, @Param("totalNetWeight") BigDecimal totalNetWeight, @Param("omsInMaterialDetail") String omsInMaterialDetail); - void updateOmsHandover(BigDecimal checkQuantity, BigDecimal totalNetWeight, String outOrderNumber, Long uniqueId); + void updateOmsHandover(@Param("checkQuantity") BigDecimal checkQuantity, @Param("totalNetWeight") BigDecimal totalNetWeight, @Param("outOrderNumber") String outOrderNumber, @Param("uniqueId") Long uniqueId); - void updateOmsDocumentLot(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String lotNumber); + void updateOmsDocumentLot(@Param("shelvesQuantity") BigDecimal shelvesQuantity, @Param("totalNetWeight") BigDecimal totalNetWeight, @Param("lotNumber") String lotNumber); } \ No newline at end of file From 775dfecf9fa7d445237476598dadf9443506a6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 22 Apr 2026 14:41:20 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E9=83=A8=E9=97=A8id=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2;=E4=BF=AE=E6=94=B9=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=8E=A8=E9=80=81oms;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mhd/system/api/OmsServiceFeign.java | 9 +- .../domain/MaterialInventoryOmsParamDO.java | 79 ++ .../com/mhd/common/core/domain/po/UserPo.java | 2 +- .../ReservationInventoryAdjustmentRecord.java | 202 +++++ ...ationInventoryAdjustmentRecordService.java | 43 + ...vationInventoryAdjustmentRecordMapper.java | 23 + ...ervationInventoryAdjustmentRecordImpl.java | 81 ++ ...eservationInventoryAdjustmentRecordPO.java | 258 ++++++ ...eservationInventoryAdjustmentRecordDO.java | 214 +++++ ...servationInventoryAdjustmentRecordDTO.java | 171 ++++ ...oryAdjustmentRecordApplicationService.java | 169 ++++ ...ionInventoryAdjustmentRecordAssembler.java | 28 + ...nventoryAdjustmentRecordDomainService.java | 305 +++++++ .../entity/ReservationMaterialInventory.java | 239 +++++ .../IReservationMaterialInventoryService.java | 116 +++ .../ReservationMaterialInventoryMapper.java | 37 + .../ReservationMaterialInventoryImpl.java | 832 ++++++++++++++++++ .../po/ReservationMaterialInventoryPO.java | 228 +++++ ...servationMaterialInventoryQueryListPO.java | 289 ++++++ .../repository/todo/MaterialBarCodePO.java | 81 ++ .../repository/todo/MaterialBaseDO.java | 73 ++ .../repository/todo/MaterialBaseDTO.java | 61 ++ .../repository/todo/MaterialBaseInfo.java | 207 +++++ .../repository/todo/MaterialBaseInfoDTO.java | 261 ++++++ .../repository/todo/MaterialBasePO.java | 65 ++ .../todo/MaterialInventoryParamDO.java | 102 +++ .../todo/MaterialInventoryParentDO.java | 23 + .../todo/MaterialInventoryQueryListDO.java | 255 ++++++ .../todo/MaterialInventoryQueryListDTO.java | 186 ++++ .../todo/ReservationMaterialInventoryDO.java | 246 ++++++ .../todo/ReservationMaterialInventoryDTO.java | 187 ++++ ...onMaterialInventoryApplicationService.java | 567 ++++++++++++ ...ReservationMaterialInventoryAssembler.java | 73 ++ ...rvationMaterialInventoryDomainService.java | 113 +++ ...servationInventoryAdjustmentRecordApi.java | 120 +++ .../ReservationMaterialInventoryApi.java | 194 ++++ .../InventoryAdjustmentRecordMapper.xml | 202 +++++ .../MaterialInventoryMapper.xml | 404 +++++++++ .../HandoverTaskOrderDomainService.java | 10 + ...nventoryAdjustmentRecordDomainService.java | 6 + .../persistence/OutMaterialDetailImpl.java | 20 + .../service/StockShelfOrderDomainService.java | 14 + sql/wkx.sql | 283 +++++- 43 files changed, 7072 insertions(+), 6 deletions(-) create mode 100644 mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInventoryOmsParamDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/entity/ReservationInventoryAdjustmentRecord.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/facade/IReservationInventoryAdjustmentRecordService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/mapper/ReservationInventoryAdjustmentRecordMapper.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/persistence/ReservationInventoryAdjustmentRecordImpl.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/po/ReservationInventoryAdjustmentRecordPO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDTO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordApplicationService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordAssembler.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordDomainService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/facade/IReservationMaterialInventoryService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/mapper/ReservationMaterialInventoryMapper.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryQueryListPO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBarCodePO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDTO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfo.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfoDTO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBasePO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParamDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParentDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDTO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDTO.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryAssembler.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryDomainService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inventoryAdjustmentRecord/ReservationInventoryAdjustmentRecordApi.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reservationMaterialInventory/ReservationMaterialInventoryApi.java create mode 100644 mhd_oms/src/main/resources/mapper/reservationInventoryAdjustmentRecord/InventoryAdjustmentRecordMapper.xml create mode 100644 mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java index 9a7a2fab9..10d1f72d5 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java @@ -2,10 +2,7 @@ package com.mhd.system.api; import com.mhd.common.core.constant.ServiceNameConstants; import com.mhd.common.core.web.domain.AjaxResult; -import com.mhd.system.api.domain.InMaterialDetail; -import com.mhd.system.api.domain.OutMaterialDetail; -import com.mhd.system.api.domain.StockInOrder; -import com.mhd.system.api.domain.StockOutOrder; +import com.mhd.system.api.domain.*; import com.mhd.system.api.factory.RemoteBmsFeignFallbackFactory; import com.mhd.system.api.feign.FeignAutoConfiguration; import io.swagger.annotations.ApiOperation; @@ -33,4 +30,8 @@ public interface OmsServiceFeign { @ApiOperation("wms推送入库单明细") @PostMapping(value = "/reservationStockOutOrderApi/pushOutOrderDetail") public AjaxResult pushOutOrderDetail(@RequestBody OutMaterialDetail outMaterialDetail); + + @ApiOperation("编辑物料库存") + @PostMapping("/materialInventoryApi/omsEdit") + public AjaxResult omsEdit(@RequestBody MaterialInventoryOmsParamDO materialInventoryOmsParamDO); } \ No newline at end of file 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 new file mode 100644 index 000000000..c42b3a996 --- /dev/null +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialInventoryOmsParamDO.java @@ -0,0 +1,79 @@ +package com.mhd.system.api.domain; + +import com.mhd.common.core.web.domain.BaseVOEntity; +import com.mhd.system.api.model.LoginUser; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class MaterialInventoryOmsParamDO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + //库存id + private Long materialInventoryId; + //物料基础信息id + private Long materialBaseInfoId; + //物料明细ID + private Long materialDetailId; + //仓库信息参数 + private Long organizationId; + private String organizationName; + private Long topOrganizationId; + //仓库ID + private Long warehouseId; + //仓库编码 + private String warehouseCode; + //仓库名称 + private String warehouseName; + //存储区ID + private Long storageSectionId; + //存储区编码 + private String storageCode; + //存储区名称 + private String storageName; + //存储位置ID + private Long storageLocationId; + //存储位置编码 + private String storageLocationCode; + //存储位置名称 + private String storageLocationName; + //调整数量 + private BigDecimal quantity; + //净重 + private BigDecimal netWeight; + //毛重 + private BigDecimal grossWeight; + //体积 + private BigDecimal volume; + //面积 + private BigDecimal area; + //类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结) + private String type; + + private String barCode; + + private String inOrderNumber; + + private String lotNumber; + + private String batchNumber; + + private String isNew; + + /** 业务关联单号(出库单号、交接单对应单号等),用于库存调整记录 relate_no;可与入库单号区分 */ + private String relateNo; + + private String kctzType; + + private LoginUser loginUser; + +} \ No newline at end of file diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserPo.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserPo.java index c801c53d7..5a4143bb1 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserPo.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/po/UserPo.java @@ -203,7 +203,7 @@ public class UserPo { private Integer esignEnterpriseStatus; @ApiModelProperty(name = "部门ID") - private Integer departmentId; + private String departmentId; @ApiModelProperty(name = "钉钉user_id") private String dingUserId; 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 new file mode 100644 index 000000000..b322cd6fa --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/entity/ReservationInventoryAdjustmentRecord.java @@ -0,0 +1,202 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + + +/** + * 库存调整记录对象 inventory_adjustment_record + * + * @author gen + * @date 2024-07-17 + */ + +@Data +public class ReservationInventoryAdjustmentRecord extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("库存调整记录id") + @TableId(type = IdType.AUTO) + private Long inventoryAdjustmentId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + @Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + private Long adjustType; + + @ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存") + @Excel(name = "调整方向:0:无状态 1:增库存 2:减库存") + private Long adjustDirection; + + @ApiModelProperty("调整前状态编码") + @Excel(name = "调整前状态编码") + private String adjustBeforeStatusCode; + + @ApiModelProperty("调整前状态名称") + @Excel(name = "调整前状态名称") + private String adjustBeforeStatusName; + + @ApiModelProperty("调整后状态编码") + @Excel(name = "调整后状态编码") + private String adjustAfterStatusCode; + + @ApiModelProperty("调整后状态名称") + @Excel(name = "调整后状态名称") + private String adjustAfterStatusName; + + @ApiModelProperty("调整前库存数量") + @Excel(name = "调整前库存数量") + private BigDecimal inventoryBeforeQuantity; + + @ApiModelProperty("调整前可用数量") + @Excel(name = "调整前可用数量") + private BigDecimal allocationBeforeQuantity; + + @ApiModelProperty("调整前冻结数量") + @Excel(name = "调整前冻结数量") + private BigDecimal freezeBeforeQuantity; + + @ApiModelProperty("调整后库存数量") + @Excel(name = "调整后库存数量") + private BigDecimal inventoryAfterQuantity; + + @ApiModelProperty("调整后可用数量") + @Excel(name = "调整后可用数量") + private BigDecimal allocationAfterQuantity; + + @ApiModelProperty("调整后冻结数量") + @Excel(name = "调整后冻结数量") + private BigDecimal freezeAfterQuantity; + + @ApiModelProperty("调整动作") + @Excel(name = "调整动作") + private String adjustAction; + + @ApiModelProperty("关联单号") + @Excel(name = "关联单号") + private String relateNo; + + @ApiModelProperty("调整前净重(KG)") + @Excel(name = "调整前净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("调整前毛重(KG)") + @Excel(name = "调整前毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("调整前体积") + @Excel(name = "调整前体积") + private BigDecimal volume; + + @ApiModelProperty("调整前面积") + @Excel(name = "调整前面积") + private BigDecimal area; + + @ApiModelProperty("调整后净重(KG)") + @Excel(name = "调整后净重(KG)") + private BigDecimal adjustedNetWeight; + + @ApiModelProperty("调整后毛重(KG)") + @Excel(name = "调整后毛重(KG)") + private BigDecimal adjustedGrossWeight; + + @ApiModelProperty("调整后体积") + @Excel(name = "调整后体积") + private BigDecimal adjustedVolume; + + @ApiModelProperty("调整后面积") + @Excel(name = "调整后面积") + private BigDecimal adjustedArea; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("LOT编号") + @Excel(name = "LOT编号") + private String lotNumber; + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/facade/IReservationInventoryAdjustmentRecordService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/facade/IReservationInventoryAdjustmentRecordService.java new file mode 100644 index 000000000..f566a5667 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/facade/IReservationInventoryAdjustmentRecordService.java @@ -0,0 +1,43 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; + +import java.util.List; + +/** + * 库存调整记录Service接口 + * + * @author gen + * @date 2024-07-17 + */ +public interface IReservationInventoryAdjustmentRecordService extends IService +{ + /** + * 分页查询库存调整记录列表 + */ + public List queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO); + + /** + * 新增库存调整记录 + */ + public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO); + + /** + * 修改库存调整记录 + */ + public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO); + + /** + * 批量删除库存调整记录 + */ + public Boolean delete(Long[] inventoryAdjustmentIds); + + + /** + * 查询库存调整记录 + */ + public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId); +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/mapper/ReservationInventoryAdjustmentRecordMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/mapper/ReservationInventoryAdjustmentRecordMapper.java new file mode 100644 index 000000000..514373f34 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/mapper/ReservationInventoryAdjustmentRecordMapper.java @@ -0,0 +1,23 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; + +import java.util.List; + +/** + * 库存调整记录Mapper接口 + * + * @author gen + * @date 2024-07-17 + */ +public interface ReservationInventoryAdjustmentRecordMapper extends BaseMapper +{ + /** + * 查询库存调整记录列表 + */ + public List queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO); + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/persistence/ReservationInventoryAdjustmentRecordImpl.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/persistence/ReservationInventoryAdjustmentRecordImpl.java new file mode 100644 index 000000000..77529e6d7 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/persistence/ReservationInventoryAdjustmentRecordImpl.java @@ -0,0 +1,81 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.persistence; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.facade.IReservationInventoryAdjustmentRecordService; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 库存调整记录Service业务层处理 + * + * @author gen + * @date 2024-07-17 + */ +@Service +public class ReservationInventoryAdjustmentRecordImpl extends ServiceImpl implements IReservationInventoryAdjustmentRecordService { + @Autowired + private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper; + + /** + * 查询库存调整记录列表 + */ + @Override + public List queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) + { + return inventoryAdjustmentRecordMapper.queryList(inventoryAdjustmentRecordDO); + } + + /** + * 新增库存调整记录 + */ + @Override + public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord(); + BeanUtils.copyProperties(inventoryAdjustmentRecordDO,inventoryAdjustmentRecord); + return this.save(inventoryAdjustmentRecord); + } + + /** + * 修改库存调整记录 + */ + @Override + public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord(); + BeanUtils.copyProperties(inventoryAdjustmentRecordDO,inventoryAdjustmentRecord); + return this.updateById(inventoryAdjustmentRecord); + } + + /** + * 批量删除库存调整记录 + */ + @Override + public Boolean delete(Long[] inventoryAdjustmentIds ) { + List list = new ArrayList<>(); + for (Long id : inventoryAdjustmentIds) { + ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord(); + inventoryAdjustmentRecord.setInventoryAdjustmentId(id); + inventoryAdjustmentRecord.setDelFlag(2); + list.add(inventoryAdjustmentRecord); + } + return this.updateBatchById(list); + } + + /** + * 修改库存调整记录 + */ + @Override + public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId) { + ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = this.getById(inventoryAdjustmentId); + ReservationInventoryAdjustmentRecordPO inventoryAdjustmentRecordPO = new ReservationInventoryAdjustmentRecordPO(); + BeanUtils.copyProperties(inventoryAdjustmentRecord,inventoryAdjustmentRecordPO); + return inventoryAdjustmentRecordPO; + } +} \ 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 new file mode 100644 index 000000000..6778ad71f --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/po/ReservationInventoryAdjustmentRecordPO.java @@ -0,0 +1,258 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import com.mhd.system.api.domain.MaterialMoreDetailPO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * 库存调整记录对象 inventory_adjustment_record + * + * @author gen + * @date 2024-07-17 + */ + +@Data +@ApiModel(value = "库存调整记录对象", description = "库存调整记录响应对象") +public class ReservationInventoryAdjustmentRecordPO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("库存调整记录id") + private Long inventoryAdjustmentId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + @Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + private Long adjustType; + + @ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存") + @Excel(name = "调整方向:0:无状态 1:增库存 2:减库存") + private Long adjustDirection; + + @ApiModelProperty("调整前状态编码") + @Excel(name = "调整前状态编码") + private String adjustBeforeStatusCode; + + @ApiModelProperty("调整前状态名称") + @Excel(name = "调整前状态名称") + private String adjustBeforeStatusName; + + @ApiModelProperty("调整后状态编码") + @Excel(name = "调整后状态编码") + private String adjustAfterStatusCode; + + @ApiModelProperty("调整后状态名称") + @Excel(name = "调整后状态名称") + private String adjustAfterStatusName; + + @ApiModelProperty("调整前库存数量") + @Excel(name = "调整前库存数量") + private BigDecimal inventoryBeforeQuantity; + + @ApiModelProperty("调整前可用数量") + @Excel(name = "调整前可用数量") + private BigDecimal allocationBeforeQuantity; + + @ApiModelProperty("调整前冻结数量") + @Excel(name = "调整前冻结数量") + private BigDecimal freezeBeforeQuantity; + + @ApiModelProperty("调整后库存数量") + @Excel(name = "调整后库存数量") + private BigDecimal inventoryAfterQuantity; + + @ApiModelProperty("调整后可用数量") + @Excel(name = "调整后可用数量") + private BigDecimal allocationAfterQuantity; + + @ApiModelProperty("调整后冻结数量") + @Excel(name = "调整后冻结数量") + private BigDecimal freezeAfterQuantity; + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + + @ApiModelProperty("扩展字段1") + @Excel(name = "扩展字段1") + private String extAttr1; + + @ApiModelProperty("扩展字段2") + @Excel(name = "扩展字段2") + private String extAttr2; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + + @ApiModelProperty("过期日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date expiryDate; + + @ApiModelProperty("存货日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inventoryDate; + + @ApiModelProperty("ExtAttr3") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr3; + + @ApiModelProperty("ExtAttr4") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr4; + + @ApiModelProperty("物料更多属性列表(批次属性)") + private List materialMoreDetailList; + + @ApiModelProperty("调整动作") + @Excel(name = "调整动作") + private String adjustAction; + + @ApiModelProperty("关联单号") + @Excel(name = "关联单号") + private String relateNo; + + @ApiModelProperty("调整前净重(KG)") + @Excel(name = "调整前净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("调整前毛重(KG)") + @Excel(name = "调整前毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("调整前体积") + @Excel(name = "调整前体积") + private BigDecimal volume; + + @ApiModelProperty("调整前面积") + @Excel(name = "调整前面积") + private BigDecimal area; + + @ApiModelProperty("调整后净重(KG)") + @Excel(name = "调整后净重(KG)") + private BigDecimal adjustedNetWeight; + + @ApiModelProperty("调整后毛重(KG)") + @Excel(name = "调整后毛重(KG)") + private BigDecimal adjustedGrossWeight; + + @ApiModelProperty("调整后体积") + @Excel(name = "调整后体积") + private BigDecimal adjustedVolume; + + @ApiModelProperty("调整后面积") + @Excel(name = "调整后面积") + private BigDecimal adjustedArea; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("LOT编号") + @Excel(name = "LOT编号") + private String LotNumber; + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; +} \ 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 new file mode 100644 index 000000000..9bc66291d --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDO.java @@ -0,0 +1,214 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + + +/** + * 库存调整记录对象 inventory_adjustment_record + * + * @author gen + * @date 2024-07-17 + */ + +@Data +public class ReservationInventoryAdjustmentRecordDO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("库存调整记录id") + private Long inventoryAdjustmentId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + @Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + private Long adjustType; + + @ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存") + @Excel(name = "调整方向:0:无状态 1:增库存 2:减库存") + private Long adjustDirection; + + @ApiModelProperty("调整前状态编码") + @Excel(name = "调整前状态编码") + private String adjustBeforeStatusCode; + + @ApiModelProperty("调整前状态名称") + @Excel(name = "调整前状态名称") + private String adjustBeforeStatusName; + + @ApiModelProperty("调整后状态编码") + @Excel(name = "调整后状态编码") + private String adjustAfterStatusCode; + + @ApiModelProperty("调整后状态名称") + @Excel(name = "调整后状态名称") + private String adjustAfterStatusName; + + @ApiModelProperty("调整数量") + @Excel(name = "调整数量") + private BigDecimal adjustQuantity; + + @ApiModelProperty("调整前库存数量") + @Excel(name = "调整前库存数量") + private BigDecimal inventoryBeforeQuantity; + + @ApiModelProperty("调整前可用数量") + @Excel(name = "调整前可用数量") + private BigDecimal allocationBeforeQuantity; + + @ApiModelProperty("调整前冻结数量") + @Excel(name = "调整前冻结数量") + private BigDecimal freezeBeforeQuantity; + + @ApiModelProperty("调整后库存数量") + @Excel(name = "调整后库存数量") + private BigDecimal inventoryAfterQuantity; + + @ApiModelProperty("调整后可用数量") + @Excel(name = "调整后可用数量") + private BigDecimal allocationAfterQuantity; + + @ApiModelProperty("调整后冻结数量") + @Excel(name = "调整后冻结数量") + private BigDecimal freezeAfterQuantity; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("调整动作") + @Excel(name = "调整动作") + private String adjustAction; + + @ApiModelProperty("关联单号") + @Excel(name = "关联单号") + private String relateNo; + + @ApiModelProperty("调整前净重(KG)") + @Excel(name = "调整前净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("调整前毛重(KG)") + @Excel(name = "调整前毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("调整前体积") + @Excel(name = "调整前体积") + private BigDecimal volume; + + @ApiModelProperty("调整前面积") + @Excel(name = "调整前面积") + private BigDecimal area; + + @ApiModelProperty("调整后净重(KG)") + @Excel(name = "调整后净重(KG)") + private BigDecimal adjustedNetWeight; + + @ApiModelProperty("调整后毛重(KG)") + @Excel(name = "调整后毛重(KG)") + private BigDecimal adjustedGrossWeight; + + @ApiModelProperty("调整后体积") + @Excel(name = "调整后体积") + private BigDecimal adjustedVolume; + + @ApiModelProperty("调整后面积") + @Excel(name = "调整后面积") + private BigDecimal adjustedArea; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("LOT编号") + @Excel(name = "LOT编号") + private String lotNumber; +} \ 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 new file mode 100644 index 000000000..bcc56a552 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/repository/todo/ReservationInventoryAdjustmentRecordDTO.java @@ -0,0 +1,171 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 库存调整记录对象 inventory_adjustment_record + * + * @author gen + * @date 2024-07-17 + */ + +@Data +public class ReservationInventoryAdjustmentRecordDTO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("库存调整记录id") + private Long inventoryAdjustmentId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + @Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结") + private Long adjustType; + + @ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存") + @Excel(name = "调整方向:0:无状态 1:增库存 2:减库存") + private Long adjustDirection; + + @ApiModelProperty("调整前状态编码") + @Excel(name = "调整前状态编码") + private String adjustBeforeStatusCode; + + @ApiModelProperty("调整前状态名称") + @Excel(name = "调整前状态名称") + private String adjustBeforeStatusName; + + @ApiModelProperty("调整后状态编码") + @Excel(name = "调整后状态编码") + private String adjustAfterStatusCode; + + @ApiModelProperty("调整后状态名称") + @Excel(name = "调整后状态名称") + private String adjustAfterStatusName; + + @ApiModelProperty("调整数量") + @Excel(name = "调整数量") + private BigDecimal adjustQuantity; + + @ApiModelProperty("调整前库存数量") + @Excel(name = "调整前库存数量") + private BigDecimal inventoryBeforeQuantity; + + @ApiModelProperty("调整前可用数量") + @Excel(name = "调整前可用数量") + private BigDecimal allocationBeforeQuantity; + + @ApiModelProperty("调整前冻结数量") + @Excel(name = "调整前冻结数量") + private BigDecimal freezeBeforeQuantity; + + @ApiModelProperty("调整后库存数量") + @Excel(name = "调整后库存数量") + private BigDecimal inventoryAfterQuantity; + + @ApiModelProperty("调整后可用数量") + @Excel(name = "调整后可用数量") + private BigDecimal allocationAfterQuantity; + + @ApiModelProperty("调整后冻结数量") + @Excel(name = "调整后冻结数量") + private BigDecimal freezeAfterQuantity; + + @ApiModelProperty("调整动作") + private String adjustAction; + + @ApiModelProperty("关联单号") + private String relateNo; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordApplicationService.java new file mode 100644 index 000000000..0a9d861a8 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordApplicationService.java @@ -0,0 +1,169 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service.ReservationInventoryAdjustmentRecordDomainService; +import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.domain.BatchDetailFeignPO; +import com.mhd.system.api.domain.MaterialMoreDetailPO; +import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO; +import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.lang.reflect.Field; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 库存调整记录ApplicationService + * + * @author gen + * @date 2024-07-17 + */ +@Service +@Slf4j +public class ReservationInventoryAdjustmentRecordApplicationService { + @Autowired + private ReservationInventoryAdjustmentRecordDomainService inventoryAdjustmentRecordDomainService; + @Autowired + private ReservationMaterialInventoryMapper materialInventoryMapper; + @Autowired + private SystemServiceFeign systemServiceFeign; + + + /** + * 分页查询库存调整记录列表 + */ + + public List queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null && loginUser.getUserPo() != null){ + Long userOrganizationId = loginUser.getUserPo().getOrganizationId(); + Long frontendOrganizationId = inventoryAdjustmentRecordDO.getOrganizationId(); // 前端传递的 organizationId + + // 数据权限:根据 organizationId 来设置查询权限 + // 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己 + if (userOrganizationId != null && userOrganizationId == 2827L) { + // 南光组织(organizationId=2827):可以查询所有组织的数据 + // 如果前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤 + // 如果前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据 + if (frontendOrganizationId != null) { + // 前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤 + inventoryAdjustmentRecordDO.setOrganizationId(frontendOrganizationId); + inventoryAdjustmentRecordDO.setTopOrganizationId(null); // 明确设置为 null,避免使用 topOrganizationId 条件 + } else { + // 前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据 + inventoryAdjustmentRecordDO.setOrganizationId(null); + inventoryAdjustmentRecordDO.setTopOrganizationId(null); + } + } else { + // 其他组织:设置organizationId,只查询当前组织的数据 + // 如果前端传递了 organizationId,验证是否与当前登录用户的组织ID一致 + if (frontendOrganizationId != null && userOrganizationId != null) { + // 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致 + if (!frontendOrganizationId.equals(userOrganizationId)) { + // 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询 + inventoryAdjustmentRecordDO.setOrganizationId(userOrganizationId); + } + // 如果前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值 + } else { + // 前端没有传递 organizationId,使用当前登录用户的组织ID + if (userOrganizationId != null) { + inventoryAdjustmentRecordDO.setOrganizationId(userOrganizationId); + } + } + // 只有当 organizationId 为 null 时,才使用 topOrganizationId 作为查询条件 + // 如果 organizationId 不为 null,则优先使用 organizationId,不使用 topOrganizationId + if (inventoryAdjustmentRecordDO.getOrganizationId() == null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + inventoryAdjustmentRecordDO.setTopOrganizationId(topOrganizationId); + } + } else { + // 对于非2827组织,必须设置 topOrganizationId=2827 + inventoryAdjustmentRecordDO.setTopOrganizationId(2827L); + } + } + AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); + if (associationWarehouseCacheDO != null) { + inventoryAdjustmentRecordDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId()); + } + } + List inventoryAdjustmentRecordPOS = inventoryAdjustmentRecordDomainService.queryList(inventoryAdjustmentRecordDO); + + // 性能优化:批量获取批次属性,避免N+1查询问题 + // 1. 收集所有唯一的materialBaseInfoId + Set materialBaseInfoIdSet = inventoryAdjustmentRecordPOS.stream() + .map(ReservationInventoryAdjustmentRecordPO::getMaterialBaseInfoId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + // 2. 批量查询批次属性(使用Map缓存,避免重复查询相同的materialBaseInfoId) + Map> batchDetailMap = new HashMap<>(); + for (Long materialBaseInfoId : materialBaseInfoIdSet) { + try { + AjaxResult ajaxResult = systemServiceFeign.getBatchDetailListByMaterialBaseInfoId(materialBaseInfoId); + if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) { + List batchDetailFeignPOList = JSON.parseArray( + JSONObject.toJSONString(ajaxResult.get("data")), BatchDetailFeignPO.class); + if (!CollectionUtils.isEmpty(batchDetailFeignPOList)) { + // 过滤isDisplay=1的属性 + List filteredList = batchDetailFeignPOList.stream() + .filter(batchDetail -> batchDetail.getIsDisplay() != null && batchDetail.getIsDisplay() == 1) + .collect(Collectors.toList()); + batchDetailMap.put(materialBaseInfoId, filteredList); + } + } + } catch (Exception e) { + log.warn("获取物料批次属性失败,物料基础信息ID:{},错误:{}", materialBaseInfoId, e.getMessage()); + } + } + + // 3. 为每个物料明细设置更多属性(从库存表中获取值) + //setMaterialMoreDetailListFromInventory(inventoryAdjustmentRecordPOS, batchDetailMap); + inventoryAdjustmentRecordPOS.sort(Comparator.comparing(ReservationInventoryAdjustmentRecordPO::getCreateTime).reversed()); + return inventoryAdjustmentRecordPOS; + } + + + /** + * 新增库存调整记录 + */ + public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + + return inventoryAdjustmentRecordDomainService.insert(inventoryAdjustmentRecordDO); + } + + /** + * 修改库存调整记录 + */ + public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + return inventoryAdjustmentRecordDomainService.update(inventoryAdjustmentRecordDO); + } + + /** + * 批量删除库存调整记录 + */ + public boolean delete(Long[] inventoryAdjustmentIds) { + return inventoryAdjustmentRecordDomainService.delete(inventoryAdjustmentIds); + } + + /** + * 获取库存调整记录详细信息 + */ + public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId) + { + return inventoryAdjustmentRecordDomainService.getInfo(inventoryAdjustmentId); + } +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordAssembler.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordAssembler.java new file mode 100644 index 000000000..a84354531 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordAssembler.java @@ -0,0 +1,28 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service; + +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDTO; +import org.springframework.stereotype.Component; + +/** + * 库存调整记录Assembler + * + * @author gen + * @date 2024-07-17 + */ +@Component +public class ReservationInventoryAdjustmentRecordAssembler { + + /** + * 转换实体 + */ + public ReservationInventoryAdjustmentRecordDO toDO(ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO) { + ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = new ReservationInventoryAdjustmentRecordDO(); + // 拷贝 + BeanUtils.copyProperties(inventoryAdjustmentRecordDTO, inventoryAdjustmentRecordDO, IgnoreNullUtil.getNullPropertyNames(inventoryAdjustmentRecordDTO)); + return inventoryAdjustmentRecordDO; + } + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordDomainService.java new file mode 100644 index 000000000..4b21756f9 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationInventoryAdjustmentRecord/service/ReservationInventoryAdjustmentRecordDomainService.java @@ -0,0 +1,305 @@ +package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service; + +import cn.hutool.core.util.ObjectUtil; +import com.aliyun.oss.ServiceException; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.mhd.common.core.constant.SnowFlakeConstants; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.utils.OrderSequence; +import com.mhd.common.core.utils.uuid.IdGenerator; +import com.mhd.common.core.web.domain.BaseVOEntity; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.facade.IReservationInventoryAdjustmentRecordService; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; +import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory; +import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService; +import com.mhd.system.api.OmsServiceFeign; +import com.mhd.system.api.domain.InMaterialDetail; +import com.mhd.system.api.domain.OutMaterialDetail; +import com.mhd.system.api.domain.StockOutOrder; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * 库存调整记录 + * + * @author gen + * @date 2024-07-17 + */ +@Service +@Slf4j +public class ReservationInventoryAdjustmentRecordDomainService { + + @Autowired + private IReservationInventoryAdjustmentRecordService inventoryAdjustmentRecordService; + @Autowired + private IReservationMaterialInventoryService materialInventoryService; +// @Autowired +// private IMaterialBaseInfoService materialBaseInfoService; +// @Autowired +// private IInventoryStandingDetailService inventoryStandingDetailService; + @Autowired + private IdGenerator idGenerator; + @Autowired + private OmsServiceFeign omsServiceFeign; + + + + /** + * 分页查询库存调整记录列表 + */ + public List queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + return inventoryAdjustmentRecordService.queryList(inventoryAdjustmentRecordDO); + } + + + /** + * 新增库存调整记录 + */ + public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + + return inventoryAdjustmentRecordService.insert(inventoryAdjustmentRecordDO); + } + + /** + * 修改库存调整记录 + */ + public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { + return inventoryAdjustmentRecordService.update(inventoryAdjustmentRecordDO); + } + + /** + * 批量删除库存调整记录 + */ + public Boolean delete(Long[] inventoryAdjustmentIds) { + return inventoryAdjustmentRecordService.delete(inventoryAdjustmentIds); + } + + /** + * 获取库存调整记录详细信息 + */ + public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId) + { + return inventoryAdjustmentRecordService.getInfo(inventoryAdjustmentId); + } + + /** + * @description:库存调整 + * @param inventoryAdjustmentRecordDO + * @return: java.lang.Boolean + * @author: lianzj + * @time: 2024-07-18 9:30:30 + */ +// @Transactional +// public Boolean inventoryAdjust(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { +// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecordDO(); +// inventoryAdjustmentRecord.setAdjustAction("库存调整"); +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// inventoryAdjustmentRecord.setOrganizationId(loginUser.getUserPo().getOrganizationId()); +// inventoryAdjustmentRecord.setOrganizationName(loginUser.getUserPo().getOrganizationName()); +// inventoryAdjustmentRecord.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); +// inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); +// inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername()); +// inventoryAdjustmentRecord.setCreateTime(new Date()); +// ReservationMaterialInventory materialInventory = null; +// //根据调整类型判断,数量调整只调整当前库存记录数量,状态调整减少当前原物料状态库存数量和可用数量,增加到现状态库存数量和可用数量 +// if (inventoryAdjustmentRecordDO.getAdjustType() != null && inventoryAdjustmentRecordDO.getAdjustType() == 1) { +// inventoryAdjustmentRecord.setAdjustType(1L); +// if (inventoryAdjustmentRecordDO.getReservationMaterialInventoryId() != null) { +// materialInventory = materialInventoryService.getById(inventoryAdjustmentRecordDO.getReservationMaterialInventoryId()); +// if (ObjectUtil.isNotNull(materialInventory)) { +// BeanUtils.copyProperties(materialInventory, inventoryAdjustmentRecord); +// inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity()); +// MaterialBaseInfo materialBaseInfo = materialBaseInfoService.getOne(new QueryWrapper().lambda() +// .eq(MaterialBaseInfo::getMaterialBaseInfoId,materialInventory.getMaterialBaseInfoId()).eq(BaseVOEntity::getDelFlag,1)); +// if (ObjectUtil.isNotNull(materialBaseInfo)) { +// inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode()); +// inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName()); +// inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode()); +// inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId()); +// inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName()); +// } +// //根据调整方向判断 +// if (inventoryAdjustmentRecordDO.getAdjustDirection() != null && inventoryAdjustmentRecordDO.getAdjustDirection() == 1) { +// materialInventory.setInventoryQuantity(materialInventory.getInventoryQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// +// } else if (inventoryAdjustmentRecordDO.getAdjustDirection() != null && inventoryAdjustmentRecordDO.getAdjustDirection() == 2) { +// materialInventory.setInventoryQuantity(materialInventory.getInventoryQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// if (materialInventory.getInventoryQuantity().compareTo(BigDecimal.ZERO) < 0) { +// throw new ServiceException("库存数量调整之后不能小于0"); +// } +// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) { +// throw new ServiceException("可用数量调整之后不能小于0"); +// } +// } +// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity()); +// // 调整前:库存数量(净重、毛重、体积、面积) +// inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight()); +// inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight()); +// inventoryAdjustmentRecord.setVolume(materialInventory.getVolume()); +// inventoryAdjustmentRecord.setArea(materialInventory.getArea()); +// // 调整后:库存数量 - 复核时填写的数量 +// inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight()); +// inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight()); +// inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume()); +// inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea()); +// +// } else { +// throw new ServiceException("根据物料库存id查询不到物料库存信息!"); +// } +// } +// } else if (inventoryAdjustmentRecordDO.getAdjustType() != null && inventoryAdjustmentRecordDO.getAdjustType() == 2) { +// inventoryAdjustmentRecord.setAdjustType(2L); +// inventoryAdjustmentRecord.setAdjustBeforeStatusCode(inventoryAdjustmentRecordDO.getAdjustBeforeStatusCode()); +// inventoryAdjustmentRecord.setAdjustBeforeStatusName(inventoryAdjustmentRecordDO.getAdjustBeforeStatusName()); +// //根据物料基本信息id,仓库id,库区id,库位id,原物料状态查询 +// materialInventory = materialInventoryService.getOne(new QueryWrapper().lambda() +// .eq(ReservationMaterialInventory::getReservationMaterialInventoryId,inventoryAdjustmentRecordDO.getReservationMaterialInventoryId()) +// .eq(ReservationMaterialInventory::getMaterialBaseInfoId,inventoryAdjustmentRecordDO.getMaterialBaseInfoId()) +// .eq(ReservationMaterialInventory::getWarehouseId,inventoryAdjustmentRecordDO.getWarehouseId()) +// .eq(ReservationMaterialInventory::getStorageSectionId,inventoryAdjustmentRecordDO.getStorageSectionId()) +// .eq(ReservationMaterialInventory::getStorageLocationId,inventoryAdjustmentRecordDO.getStorageLocationId()) +// .eq(ReservationMaterialInventory::getMaterialStatusCode,inventoryAdjustmentRecordDO.getAdjustBeforeStatusCode()) +// .eq(ReservationMaterialInventory::getBatchNumber,inventoryAdjustmentRecordDO.getBatchNumber()) +// .eq(ReservationMaterialInventory::getContainerId,inventoryAdjustmentRecordDO.getContainerId()) +// .eq(BaseVOEntity::getDelFlag, 1)); +// if (ObjectUtil.isNotNull(materialInventory)) { +// BeanUtils.copyProperties(materialInventory, inventoryAdjustmentRecord); +// inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity()); +// MaterialBaseInfo materialBaseInfo = materialBaseInfoService.getOne(new QueryWrapper().lambda() +// .eq(MaterialBaseInfo::getMaterialBaseInfoId,materialInventory.getMaterialBaseInfoId()).eq(BaseVOEntity::getDelFlag,1)); +// if (ObjectUtil.isNotNull(materialBaseInfo)) { +// inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode()); +// inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName()); +// inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode()); +// inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId()); +// inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName()); +// } +// materialInventory.setInventoryQuantity(materialInventory.getInventoryQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// if (materialInventory.getInventoryQuantity().compareTo(BigDecimal.ZERO) < 0) { +// throw new ServiceException("库存数量调整之后不能小于0"); +// } +// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) { +// throw new ServiceException("可用数量调整之后不能小于0"); +// } +// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity()); +// // 调整前:库存数量(净重、毛重、体积、面积) +// inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight()); +// inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight()); +// inventoryAdjustmentRecord.setVolume(materialInventory.getVolume()); +// inventoryAdjustmentRecord.setArea(materialInventory.getArea()); +// // 调整后:库存数量 - 复核时填写的数量 +// inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight()); +// inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight()); +// inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume()); +// inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea()); +// } else { +// throw new ServiceException("根据原物料状态查询不到物料库存信息!"); +// } +// //根据物料基本信息id,仓库id,库区id,库位id,现物料状态查询 +// ReservationMaterialInventory materialInventory1 = materialInventoryService.getOne(new QueryWrapper().lambda() +// .eq(ReservationMaterialInventory::getMaterialBaseInfoId,inventoryAdjustmentRecordDO.getMaterialBaseInfoId()) +// .eq(ReservationMaterialInventory::getWarehouseId,inventoryAdjustmentRecordDO.getWarehouseId()) +// .eq(ReservationMaterialInventory::getStorageSectionId,inventoryAdjustmentRecordDO.getStorageSectionId()) +// .eq(ReservationMaterialInventory::getStorageLocationId,inventoryAdjustmentRecordDO.getStorageLocationId()) +// .eq(ReservationMaterialInventory::getMaterialStatusCode,inventoryAdjustmentRecordDO.getAdjustAfterStatusCode()) +// .eq(ReservationMaterialInventory::getBatchNumber,inventoryAdjustmentRecordDO.getBatchNumber()) +// .eq(ReservationMaterialInventory::getContainerId,inventoryAdjustmentRecordDO.getContainerId()) +// .eq(BaseVOEntity::getDelFlag, 1)); +// if (ObjectUtil.isNotNull(materialInventory1)) { +// materialInventory1.setInventoryQuantity(materialInventory1.getInventoryQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// materialInventory1.setAllocationQuantity(materialInventory1.getAllocationQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// materialInventoryService.updateById(materialInventory1); +// +// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory1.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory1.getFreezeQuantity()); +// } else { +// throw new ServiceException("根据现物料状态查询不到调整库存库存信息!"); +// } +// inventoryAdjustmentRecord.setAdjustAfterStatusCode(inventoryAdjustmentRecordDO.getAdjustAfterStatusCode()); +// inventoryAdjustmentRecord.setAdjustAfterStatusName(inventoryAdjustmentRecordDO.getAdjustAfterStatusName()); +// } +// //生成库存调整追溯记录 +// if (ObjectUtil.isNotNull(materialInventory)){ +// genInventoryStandingDetail(materialInventory, inventoryAdjustmentRecordDO.getAdjustQuantity()); +// } +// +// +// materialInventoryService.updateById(materialInventory); +// Boolean insert = inventoryAdjustmentRecordService.insert(inventoryAdjustmentRecord); +// //推送oms库存调整记录 +// pushOms(materialInventory, inventoryAdjustmentRecordDO); +// return insert; +// } + + /** + * @description:库存冻结 + * @param inventoryAdjustmentRecordDO + * @return: java.lang.Boolean + * @author: lianzj + * @time: 2024-07-18 14:58:50 + */ +// @Transactional +// public Boolean inventoryFrozen(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) { +// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecordDO(); +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// inventoryAdjustmentRecord.setOrganizationId(loginUser.getUserPo().getOrganizationId()); +// inventoryAdjustmentRecord.setOrganizationName(loginUser.getUserPo().getOrganizationName()); +// inventoryAdjustmentRecord.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); +// inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); +// inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername()); +// inventoryAdjustmentRecord.setCreateTime(new Date()); +// ReservationMaterialInventory materialInventory = materialInventoryService.getById(inventoryAdjustmentRecordDO.getReservationMaterialInventoryId()); +// inventoryAdjustmentRecord.setAdjustType(3L); +// if (ObjectUtil.isNotNull(materialInventory)) { +// BeanUtils.copyProperties(materialInventory, inventoryAdjustmentRecord); +// inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity()); +// MaterialBaseInfo materialBaseInfo = materialBaseInfoService.getOne(new QueryWrapper().lambda() +// .eq(MaterialBaseInfo::getMaterialBaseInfoId,materialInventory.getMaterialBaseInfoId()).eq(BaseVOEntity::getDelFlag,1)); +// if (ObjectUtil.isNotNull(materialBaseInfo)) { +// inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode()); +// inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName()); +// inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode()); +// inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId()); +// inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName()); +// } +// //可用数量减,冻结数量加 +// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// materialInventory.setFreezeQuantity(materialInventory.getFreezeQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity())); +// if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) { +// throw new ServiceException("冻结可用数量不能小于0"); +// } +// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); +// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity()); +// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity()); +// } else { +// throw new ServiceException("根据物料库存id查询不到物料库存信息!"); +// } +// materialInventoryService.updateById(materialInventory); +// return inventoryAdjustmentRecordService.insert(inventoryAdjustmentRecord); +// } +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java new file mode 100644 index 000000000..830011805 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/entity/ReservationMaterialInventory.java @@ -0,0 +1,239 @@ +package com.mhd.oms.domain.reservationMaterialInventory.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class ReservationMaterialInventory extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + @TableId(type = IdType.AUTO) + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("货主ID") + @Excel(name = "货主ID") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("上架单物料明细id") + @Excel(name = "上架单物料明细id") + private Long materialDetailId; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + @ApiModelProperty("单位") + @Excel(name = "单位") + private String unit; + + @ApiModelProperty("单位名称") + @Excel(name = "单位名称") + private String unitName; + + @ApiModelProperty("净重(KG)") + @Excel(name = "净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("毛重(KG)") + @Excel(name = "毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("体积") + @Excel(name = "体积") + private BigDecimal volume; + + @ApiModelProperty("面积") + @Excel(name = "面积") + private BigDecimal area; + + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + + @ApiModelProperty("扩展字段1") + @Excel(name = "扩展字段1") + @TableField("ext_attr_1") + private String extAttr1; + + @ApiModelProperty("扩展字段2") + @Excel(name = "扩展字段2") + @TableField("ext_attr_2") + private String extAttr2; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + + @ApiModelProperty("过期日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date expiryDate; + + @ApiModelProperty("存货日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inventoryDate; + + @ApiModelProperty("ExtAttr3") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @TableField("ext_attr_3") + private Date extAttr3; + + @ApiModelProperty("ExtAttr4") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @TableField("ext_attr_4") + private Date extAttr4; + + @ApiModelProperty("条码") + @Excel(name = "条码") + private String barCode; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("LOT编号") + @Excel(name = "LOT编号") + private String lotNumber; + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/facade/IReservationMaterialInventoryService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/facade/IReservationMaterialInventoryService.java new file mode 100644 index 000000000..5344f3163 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/facade/IReservationMaterialInventoryService.java @@ -0,0 +1,116 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryParamDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryQueryListDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; +import com.mhd.system.api.domain.MaterialInventoryPO; +import com.mhd.system.api.model.LoginUser; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 物料库存Service接口 + * + * @author gen + * @date 2024-05-29 + */ +public interface IReservationMaterialInventoryService extends IService +{ + /** + * 分页查询物料库存列表 + */ + public List queryList(ReservationMaterialInventoryDO materialInventoryDO); + + /** + * 新增物料库存 + */ + public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO); + + /** + * 修改物料库存 + */ + public Boolean update(ReservationMaterialInventoryDO materialInventoryDO); + + /** + * 批量删除物料库存 + */ + public Boolean delete(Long[] materialInventoryIds); + + + /** + * 查询物料库存 + */ + public ReservationMaterialInventoryPO getInfo(Long materialInventoryId); + + public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO); + + /** + * @description 修改物料库存信息 + * @author ZhouGY + * @date 2024/5/29 16:31 + * @param materialInventoryDOList + */ + //public void updateReservationMaterialInventoryInfo(List materialInventoryDOList, Integer type); + + /** + * @description:库存查询列表 + * @param materialInventoryQueryListDO + * @return: java.util.List + * @author: lianzj + * @time: 2024-07-16 14:46:10 + */ + //List materialQueryList(MaterialInventoryQueryListDO materialInventoryQueryListDO); + + /** + * 分页查询物料库存列表 + */ + //public List queryImmediateInventoryList(ImmediateInventoryDO immediateInventoryDO); + + /** + * @description 增加指定库存 + * @author ZhouGY + * @date 2024/7/21 0:27 + * @param materialInventoryParentDO + * @return Boolean + */ + //public Boolean batchAddInventoryQuantity(ReservationMaterialInventoryParentDO materialInventoryParentDO); + + /** + * @description 减少指定库存 + * @author ZhouGY + * @date 2024/7/21 0:29 + * @param materialInventoryParentDO + * @return Boolean + */ + //public Boolean batchSubtractInventoryQuantity(ReservationMaterialInventoryParentDO materialInventoryParentDO); + + /** + * @description 货主编码和物料编码统计库存数量 + * @author ZhouGY + * @date 2024/7/25 13:44 + * @return BigDecimal + */ + //public BigDecimal sumInventoryQuantityByShipperAndMaterialCode(Long shipperCode, Long materialBaseInfoId); + + //ReservationMaterialInventoryPO selectOneByWhere(ReservationMaterialInventoryDO materialInventoryDO); + + /* + * 库存调整方法 + * netWeight 总净重 + * grossWeight 总毛重 + * volume 体积 + * area 面积 + * quantity 数量 + * type 类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结) + * materialInventoryId 物料库存ID + * */ + public void xgkc(MaterialInventoryOmsParamDO materialInventoryParamDO); + + public void kctzjl(MaterialInventoryOmsParamDO materialInventoryParamDO,String adjustAction,LoginUser loginUser); +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/mapper/ReservationMaterialInventoryMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/mapper/ReservationMaterialInventoryMapper.java new file mode 100644 index 000000000..5676fa84d --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/mapper/ReservationMaterialInventoryMapper.java @@ -0,0 +1,37 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBaseInfo; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 物料库存Mapper接口 + * + * @author gen + * @date 2024-05-29 + */ +public interface ReservationMaterialInventoryMapper extends BaseMapper +{ + //查全部 + public List queryList(ReservationMaterialInventoryDO materialInventoryDO); + //查物料库存列表-物料/库位 + public List queryListByWlKw(ReservationMaterialInventoryDO materialInventoryDO); + //查物料库存列表-库位 + public List queryListByKw(ReservationMaterialInventoryDO materialInventoryDO); + //查物料库存列表-物料 + public List queryListByWl(ReservationMaterialInventoryDO materialInventoryDO); + //查物料库存列表-货主 + public List queryListByHz(ReservationMaterialInventoryDO materialInventoryDO); + + + public MaterialBaseInfo getByInfoId(@Param("id") Long id); + + public List getInfoByMaterialBaseInfoIds(@Param("id") Long id); +} \ 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 new file mode 100644 index 000000000..f1dbc09dd --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/persistence/ReservationMaterialInventoryImpl.java @@ -0,0 +1,832 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.persistence; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.exception.ServiceException; +import com.mhd.common.core.web.domain.BaseVOEntity; +import com.mhd.common.security.utils.SecurityUtils; +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.facade.IReservationMaterialInventoryService; +import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBaseInfo; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryParamDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; +import com.mhd.system.api.domain.MaterialInventoryPO; +import com.mhd.system.api.model.LoginUser; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 物料库存Service业务层处理 + * + * @author gen + * @date 2024-05-29 + */ +@Service +public class ReservationMaterialInventoryImpl extends ServiceImpl implements IReservationMaterialInventoryService { + @Autowired + private ReservationMaterialInventoryMapper materialInventoryMapper; + @Autowired + private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper; + + /** + * 查询物料库存列表 + */ + @Override + public List queryList(ReservationMaterialInventoryDO materialInventoryDO) + { + String queryRule = materialInventoryDO.getQueryRule(); + if ("hz".equals(queryRule)) { + return materialInventoryMapper.queryListByHz(materialInventoryDO); + } else if ("wl".equals(queryRule)) { + return materialInventoryMapper.queryListByWl(materialInventoryDO); + } else if ("kw".equals(queryRule)) { + return materialInventoryMapper.queryListByKw(materialInventoryDO); + } else if ("wlkw".equals(queryRule)) { + return materialInventoryMapper.queryListByWlKw(materialInventoryDO); + } else if ("all".equals(queryRule)) { + return materialInventoryMapper.queryList(materialInventoryDO); + } else { + //不传返回全部 + return materialInventoryMapper.queryList(materialInventoryDO); + } + } + + /** + * 新增物料库存 + */ + @Override + public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO) { + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + BeanUtils.copyProperties(materialInventoryDO,materialInventory); + return this.save(materialInventory); + } + + /** + * 修改物料库存 + */ + @Override + public Boolean update(ReservationMaterialInventoryDO materialInventoryDO) { + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + BeanUtils.copyProperties(materialInventoryDO,materialInventory); + return this.updateById(materialInventory); + } + + /** + * 批量删除物料库存 + */ + @Override + public Boolean delete(Long[] materialInventoryIds ) { + List list = new ArrayList<>(); + for (Long id : materialInventoryIds) { + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + materialInventory.setMaterialInventoryId(id); + materialInventory.setDelFlag(2); + list.add(materialInventory); + } + return this.updateBatchById(list); + } + + /** + * 修改物料库存 + */ + @Override + public ReservationMaterialInventoryPO getInfo(Long materialInventoryId) { + ReservationMaterialInventory materialInventory = this.getById(materialInventoryId); + ReservationMaterialInventoryPO materialInventoryPO = new ReservationMaterialInventoryPO(); + BeanUtils.copyProperties(materialInventory,materialInventoryPO); + return materialInventoryPO; + } + + @Override + public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO) { + String inOrderNumber = materialInventoryOmsParamDO.getInOrderNumber(); + String lotNumber = materialInventoryOmsParamDO.getLotNumber(); + String batchNumber = materialInventoryOmsParamDO.getBatchNumber(); + Long materialBaseInfoId = materialInventoryOmsParamDO.getMaterialBaseInfoId(); + Long warehouseId = materialInventoryOmsParamDO.getWarehouseId(); + List reservationMaterialInventories = materialInventoryMapper.selectList(new LambdaQueryWrapper() + .eq(ReservationMaterialInventory::getInOrderNumber, inOrderNumber) + .eq(ReservationMaterialInventory::getLotNumber, lotNumber) + .eq(ReservationMaterialInventory::getBatchNumber, batchNumber) + .eq(ReservationMaterialInventory::getMaterialBaseInfoId, materialBaseInfoId) + .eq(ReservationMaterialInventory::getWarehouseId, warehouseId)); + if (reservationMaterialInventories != null && reservationMaterialInventories.size() > 0) { + ReservationMaterialInventory reservationMaterialInventory = reservationMaterialInventories.get(0); + Long materialInventoryId = reservationMaterialInventory.getMaterialInventoryId(); + materialInventoryOmsParamDO.setMaterialInventoryId(materialInventoryId); + } + kctzjl(materialInventoryOmsParamDO, materialInventoryOmsParamDO.getKctzType(), materialInventoryOmsParamDO.getLoginUser()); + xgkc(materialInventoryOmsParamDO); + return true; + } + + /** + * @description 修改物料库存信息 + * @author ZhouGY + * @date 2024/5/23 14:03 + */ +// @Override +// @Transactional(rollbackFor = Exception.class) +// public void updateReservationMaterialInventoryInfo(List materialInventoryDOList, Integer type){ +// if (type == 1){ +// //增加 +// addReservationMaterialInventory(materialInventoryDOList); +// }else if (type == 2) { +// //减少 +// subtractReservationMaterialInventory(materialInventoryDOList); +// }else { +// throw new ServiceException("修改库存指定方式不存在"); +// } +// } + + @Override + public void xgkc(MaterialInventoryOmsParamDO materialInventoryParamDO) { + BigDecimal netWeight = materialInventoryParamDO.getNetWeight() != null ? materialInventoryParamDO.getNetWeight() : BigDecimal.ZERO; + BigDecimal grossWeight = materialInventoryParamDO.getGrossWeight() != null ? materialInventoryParamDO.getGrossWeight() : BigDecimal.ZERO; + BigDecimal volume = materialInventoryParamDO.getVolume() != null ? materialInventoryParamDO.getVolume() : BigDecimal.ZERO; + BigDecimal area = materialInventoryParamDO.getArea() != null ? materialInventoryParamDO.getArea() : BigDecimal.ZERO; + BigDecimal quantity = materialInventoryParamDO.getQuantity() != null ? materialInventoryParamDO.getQuantity() : BigDecimal.ZERO; + String type = materialInventoryParamDO.getType(); + Long materialInventoryId = materialInventoryParamDO.getMaterialInventoryId(); + + //类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结) + switch (type) { + case "1": + // 上架 + sj(netWeight, grossWeight, volume, area, quantity, materialInventoryId, materialInventoryParamDO); + break; + case "2": + // 分配 + ff(netWeight, grossWeight, volume, area, quantity, materialInventoryId); + break; + case "3": + // 取消分配 + qxff(netWeight, grossWeight, volume, area, quantity, materialInventoryId); + break; + case "4": + // 出库交接 + ckjj(netWeight, grossWeight, volume, area, quantity, materialInventoryId); + break; + case "5": + // 移位 + yw(netWeight, grossWeight, volume, area, quantity, materialInventoryId); + break; + case "6": + // 库存调整 + kctz(netWeight, grossWeight, volume, area, quantity, materialInventoryId); + break; + case "7": + // 库存冻结 + kcdj(netWeight, grossWeight, volume, area, quantity, materialInventoryId); + break; + default: + throw new ServiceException("错误的类型"); + } + } + + @Override + public synchronized void kctzjl(MaterialInventoryOmsParamDO materialInventoryParamDO, + String adjustAction,LoginUser loginUser) { + //库存调整记录(在 xgkc 更新库存前调用,materialInventory 为调整前快照) + Long materialInventoryId = materialInventoryParamDO.getMaterialInventoryId(); + ReservationMaterialInventory materialInventory = materialInventoryMapper.selectOne(new QueryWrapper().lambda() + .eq(ReservationMaterialInventory::getMaterialInventoryId, materialInventoryId)); + if (materialInventory == null) { + throw new ServiceException("物料库存不存在,无法生成库存调整记录"); + } + Long materialBaseInfoId = materialInventory.getMaterialBaseInfoId(); + MaterialBaseInfo materialBaseInfo = materialInventoryMapper.getByInfoId(materialBaseInfoId); + ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord(); + inventoryAdjustmentRecord.setAdjustAction(adjustAction); + String relateNo = StringUtils.hasText(materialInventoryParamDO.getRelateNo()) + ? materialInventoryParamDO.getRelateNo() + : materialInventoryParamDO.getInOrderNumber(); + inventoryAdjustmentRecord.setRelateNo(relateNo); + inventoryAdjustmentRecord.setAdjustAfterStatusCode(materialInventory.getMaterialStatusCode() == null ? "" : materialInventory.getMaterialStatusCode()); + inventoryAdjustmentRecord.setAdjustBeforeStatusCode(materialInventory.getMaterialStatusCode() == null ? "" : materialInventory.getMaterialStatusCode()); + inventoryAdjustmentRecord.setAdjustAfterStatusName(materialInventory.getMaterialStatusName() == null ? "" : materialInventory.getMaterialStatusName()); + inventoryAdjustmentRecord.setAdjustBeforeStatusName(materialInventory.getMaterialStatusName() == null ? "" : materialInventory.getMaterialStatusName()); + inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId()); + + inventoryAdjustmentRecord.setLotNumber(materialInventoryParamDO.getLotNumber()); + inventoryAdjustmentRecord.setInOrderNumber(materialInventoryParamDO.getInOrderNumber()); + inventoryAdjustmentRecord.setBatchNumber(materialInventoryParamDO.getBatchNumber()); + if (ObjectUtil.isNotNull(materialBaseInfo)) { + inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode()); + inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName()); + inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode()); + inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId()); + inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName()); + } + if (inventoryAdjustmentRecord.getBarCode() == null || inventoryAdjustmentRecord.getBarCode().isEmpty()){ + getBarCode(materialInventory, inventoryAdjustmentRecord); + } + inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId()); + inventoryAdjustmentRecord.setAdjustType(1L); + if ("库存冻结".equals(adjustAction)) { + inventoryAdjustmentRecord.setAdjustType(3L); + } + inventoryAdjustmentRecord.setOrganizationId(materialInventory.getOrganizationId()); + inventoryAdjustmentRecord.setOrganizationName(materialInventory.getOrganizationName()); + inventoryAdjustmentRecord.setTopOrganizationId(materialInventory.getTopOrganizationId()); + inventoryAdjustmentRecord.setWarehouseCode(materialInventory.getWarehouseCode()); + inventoryAdjustmentRecord.setWarehouseName(materialInventory.getWarehouseName()); + inventoryAdjustmentRecord.setWarehouseId(materialInventory.getWarehouseId()); + inventoryAdjustmentRecord.setStorageCode(materialInventory.getStorageCode()); + inventoryAdjustmentRecord.setStorageName(materialInventory.getStorageName()); + inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId()); + inventoryAdjustmentRecord.setStorageLocationCode(materialInventory.getStorageLocationCode()); + inventoryAdjustmentRecord.setStorageLocationName(materialInventory.getStorageLocationName()); + inventoryAdjustmentRecord.setMaterialInventoryId(materialInventory.getMaterialInventoryId()); + inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId()); + inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId()); + inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId()); + inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid()); + UserPo userPo = loginUser.getUserPo(); + if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName()); + inventoryAdjustmentRecord.setCreateTime(new Date()); + + BigDecimal qty = nz(materialInventoryParamDO.getQuantity()); + if ("分配库存".equals(adjustAction)) { + // 总库存不变;可用减少、冻结增加(数量从可用转至冻结) + BigDecimal invBefore = nz(materialInventory.getInventoryQuantity()); + BigDecimal allocBefore = nz(materialInventory.getAllocationQuantity()); + BigDecimal freezeBefore = nz(materialInventory.getFreezeQuantity()); + inventoryAdjustmentRecord.setInventoryBeforeQuantity(invBefore); //调整前库存数量 + inventoryAdjustmentRecord.setInventoryAfterQuantity(invBefore); //调整后库存数量 + inventoryAdjustmentRecord.setAllocationBeforeQuantity(allocBefore); //调整前可用数量 + inventoryAdjustmentRecord.setAllocationAfterQuantity(allocBefore.subtract(qty));//调整后可用数量 + inventoryAdjustmentRecord.setFreezeBeforeQuantity(freezeBefore);//调整前冻结数量 + inventoryAdjustmentRecord.setFreezeAfterQuantity(freezeBefore.add(qty));//调整后冻结数量 + inventoryAdjustmentRecord.setNetWeight(nz(materialInventory.getNetWeight()));//净重 + inventoryAdjustmentRecord.setGrossWeight(nz(materialInventory.getGrossWeight()));//毛重 + inventoryAdjustmentRecord.setVolume(nz(materialInventory.getVolume()));//体积 + inventoryAdjustmentRecord.setArea(nz(materialInventory.getArea()));//积 + inventoryAdjustmentRecord.setAdjustedNetWeight(nz(materialInventory.getNetWeight()));//净重 + inventoryAdjustmentRecord.setAdjustedGrossWeight(nz(materialInventory.getGrossWeight()));//毛重 + inventoryAdjustmentRecord.setAdjustedVolume(nz(materialInventory.getVolume()));//体积 + inventoryAdjustmentRecord.setAdjustedArea(nz(materialInventory.getArea()));//积 + } else if ("取消分配".equals(adjustAction)) { + // 与分配相反:可用增加、冻结减少,总库存不变 + BigDecimal invBefore = nz(materialInventory.getInventoryQuantity()); + BigDecimal allocBefore = nz(materialInventory.getAllocationQuantity()); + BigDecimal freezeBefore = nz(materialInventory.getFreezeQuantity()); + inventoryAdjustmentRecord.setInventoryBeforeQuantity(invBefore); + inventoryAdjustmentRecord.setInventoryAfterQuantity(invBefore); + inventoryAdjustmentRecord.setAllocationBeforeQuantity(allocBefore); + inventoryAdjustmentRecord.setAllocationAfterQuantity(allocBefore.add(qty)); + inventoryAdjustmentRecord.setFreezeBeforeQuantity(freezeBefore); + inventoryAdjustmentRecord.setFreezeAfterQuantity(freezeBefore.subtract(qty)); + inventoryAdjustmentRecord.setNetWeight(nz(materialInventory.getNetWeight())); + inventoryAdjustmentRecord.setGrossWeight(nz(materialInventory.getGrossWeight())); + inventoryAdjustmentRecord.setVolume(nz(materialInventory.getVolume())); + inventoryAdjustmentRecord.setArea(nz(materialInventory.getArea())); + inventoryAdjustmentRecord.setAdjustedNetWeight(nz(materialInventory.getNetWeight())); + inventoryAdjustmentRecord.setAdjustedGrossWeight(nz(materialInventory.getGrossWeight())); + inventoryAdjustmentRecord.setAdjustedVolume(nz(materialInventory.getVolume())); + inventoryAdjustmentRecord.setAdjustedArea(nz(materialInventory.getArea())); + } else if ("入库".equals(adjustAction)){ + if ("1".equals(materialInventoryParamDO.getIsNew())) { + inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO); + inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryParamDO.getQuantity()); + inventoryAdjustmentRecord.setFreezeBeforeQuantity(BigDecimal.ZERO); + inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);//调整后 冻结-出库 + inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO); + inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryParamDO.getQuantity()); + // 调整前:库存数量(净重、毛重、体积、面积) + inventoryAdjustmentRecord.setNetWeight(BigDecimal.ZERO); + inventoryAdjustmentRecord.setGrossWeight(BigDecimal.ZERO); + inventoryAdjustmentRecord.setVolume(BigDecimal.ZERO); + inventoryAdjustmentRecord.setArea(BigDecimal.ZERO); + // 调整后:库存数量 - 复核时填写的数量 + inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventoryParamDO.getNetWeight()); + inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventoryParamDO.getGrossWeight()); + inventoryAdjustmentRecord.setAdjustedVolume(materialInventoryParamDO.getVolume()); + inventoryAdjustmentRecord.setAdjustedArea(materialInventoryParamDO.getArea()); + } else { + inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity()); + inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity().add(materialInventoryParamDO.getQuantity())); + inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity()); + inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());//调整后 冻结-出库 + inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity()); + inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity().add(materialInventoryParamDO.getQuantity())); + // 调整前:库存数量(净重、毛重、体积、面积) + inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setVolume(materialInventory.getVolume()); + inventoryAdjustmentRecord.setArea(materialInventory.getArea()); + // 调整后:库存数量 - 复核时填写的数量 + inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight().add(inventoryAdjustmentRecord.getNetWeight())); + inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight().add(inventoryAdjustmentRecord.getGrossWeight())); + inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume().add(inventoryAdjustmentRecord.getVolume())); + inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea().add(inventoryAdjustmentRecord.getArea())); + } + } else if ("出库".equals(adjustAction)){ + // 出库交接:总库存与冻结同减 checkQuantity;可用数量不变(与 ckjj 中不修改 allocation_quantity 一致) + BigDecimal invBefore = nz(materialInventory.getInventoryQuantity()); + BigDecimal allocBefore = nz(materialInventory.getAllocationQuantity()); + BigDecimal freezeBefore = nz(materialInventory.getFreezeQuantity()); + inventoryAdjustmentRecord.setInventoryBeforeQuantity(invBefore);// 调整前:库存数量 + inventoryAdjustmentRecord.setInventoryAfterQuantity(invBefore.subtract(qty));// 调整后:库存数量 + inventoryAdjustmentRecord.setAllocationBeforeQuantity(allocBefore);// 调整前:可用数量 + inventoryAdjustmentRecord.setAllocationAfterQuantity(allocBefore);// 调整后:可用数量 + inventoryAdjustmentRecord.setFreezeBeforeQuantity(freezeBefore);// 调整前:冻结数量 + inventoryAdjustmentRecord.setFreezeAfterQuantity(freezeBefore.subtract(qty));// 调整后:冻结数量 + BigDecimal nw = nz(materialInventory.getNetWeight()); + BigDecimal gw = nz(materialInventory.getGrossWeight()); + BigDecimal vol = nz(materialInventory.getVolume()); + BigDecimal ar = nz(materialInventory.getArea()); + inventoryAdjustmentRecord.setNetWeight(nw); + inventoryAdjustmentRecord.setGrossWeight(gw); + inventoryAdjustmentRecord.setVolume(vol); + inventoryAdjustmentRecord.setArea(ar); + inventoryAdjustmentRecord.setAdjustedNetWeight(nw.subtract(nz(materialInventoryParamDO.getNetWeight()))); + inventoryAdjustmentRecord.setAdjustedGrossWeight(gw.subtract(nz(materialInventoryParamDO.getGrossWeight()))); + inventoryAdjustmentRecord.setAdjustedVolume(vol.subtract(nz(materialInventoryParamDO.getVolume()))); + inventoryAdjustmentRecord.setAdjustedArea(ar.subtract(nz(materialInventoryParamDO.getArea()))); + } else if ("移位".equals(adjustAction)){ + inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity()); + inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryParamDO.getQuantity()); + //inventoryAdjustmentRecord.setFreezeBeforeQuantity(oldFreezeQuantity); + inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());//调整后 冻结-出库 + //inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity); + inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); + // 调整前:库存数量(净重、毛重、体积、面积) + inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setVolume(materialInventory.getVolume()); + inventoryAdjustmentRecord.setArea(materialInventory.getArea()); + // 调整后:库存数量 - 复核时填写的数量 + inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume()); + inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea()); + } else if ("库存冻结".equals(adjustAction)) { + inventoryAdjustmentRecord.setAllocationBeforeQuantity(nz(materialInventory.getAllocationQuantity())); + inventoryAdjustmentRecord.setAllocationAfterQuantity(nz(materialInventory.getAllocationQuantity()).subtract(qty)); + inventoryAdjustmentRecord.setFreezeBeforeQuantity(nz(materialInventory.getFreezeQuantity())); + inventoryAdjustmentRecord.setFreezeAfterQuantity(nz(materialInventory.getFreezeQuantity()).add(qty));//调整后 冻结-出库 + inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity()); + inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); + + // 调整前:库存数量(净重、毛重、体积、面积) + inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setVolume(materialInventory.getVolume()); + inventoryAdjustmentRecord.setArea(materialInventory.getArea()); + // 调整后:库存数量 - 复核时填写的数量 + inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight()); + inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight()); + inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume()); + inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea()); + } + + + + + inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord); + } + + private static BigDecimal nz(BigDecimal v) { + return v == null ? BigDecimal.ZERO : v; + } + + private void getBarCode(ReservationMaterialInventory materialInventoryPO, ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord) { + List materialBarCodePOList = materialInventoryMapper.getInfoByMaterialBaseInfoIds(materialInventoryPO.getMaterialBaseInfoId()); + if (materialBarCodePOList != null && !materialBarCodePOList.isEmpty()) { + Map collect = materialBarCodePOList.stream() + .collect(Collectors.toMap( + MaterialBarCodePO::getMaterialBaseInfoId, + po -> po, + (existing, replacement) -> existing + )); + MaterialBarCodePO materialBarCodePO = collect.get(materialInventoryPO.getMaterialBaseInfoId()); + if (materialBarCodePO != null && materialBarCodePO.getBarCode() != null) { + inventoryAdjustmentRecord.setBarCode(materialBarCodePO.getBarCode()); + } + } + } + + private void sj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId,MaterialInventoryOmsParamDO materialInventoryParamDO) { + if (materialInventoryId == null) { + Long materialBaseInfoId = materialInventoryParamDO.getMaterialBaseInfoId(); + MaterialBaseInfo materialBaseInfo = materialInventoryMapper.getByInfoId(materialBaseInfoId); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + materialInventory.setInventoryQuantity(quantity); + materialInventory.setAllocationQuantity(quantity); + materialInventory.setFreezeQuantity(BigDecimal.ZERO); + materialInventory.setArea(area); + materialInventory.setVolume(volume); + materialInventory.setGrossWeight(grossWeight); + materialInventory.setNetWeight(netWeight); + materialInventory.setMaterialBaseInfoId(materialInventoryParamDO.getMaterialBaseInfoId()); + materialInventory.setInOrderNumber(materialInventoryParamDO.getInOrderNumber()); + if (materialBaseInfo != null) { + materialInventory.setShipperId(materialBaseInfo.getShipperId()); + materialInventory.setShipperName(materialBaseInfo.getShipperName()); + materialInventory.setShipperCode(materialBaseInfo.getShipperCode()); + } + //仓库信息 + materialInventory.setOrganizationId(materialInventoryParamDO.getOrganizationId()); + materialInventory.setOrganizationName(materialInventoryParamDO.getOrganizationName()); + materialInventory.setTopOrganizationId(materialInventoryParamDO.getTopOrganizationId()); + materialInventory.setWarehouseCode(materialInventoryParamDO.getWarehouseCode()); + materialInventory.setWarehouseName(materialInventoryParamDO.getWarehouseName()); + materialInventory.setWarehouseId(materialInventoryParamDO.getWarehouseId()); +// materialInventory.setStorageCode(materialInventoryParamDO.getStorageCode()); +// materialInventory.setStorageName(materialInventoryParamDO.getStorageName()); +// materialInventory.setStorageLocationId(materialInventoryParamDO.getStorageLocationId()); +// materialInventory.setStorageLocationCode(materialInventoryParamDO.getStorageLocationCode()); +// materialInventory.setStorageLocationName(materialInventoryParamDO.getStorageLocationName()); +// materialInventory.setStorageSectionId(materialInventoryParamDO.getStorageSectionId()); + //更多属性 +// materialInventory.setBatchRefNo(materialInventoryParamDO.getBatchRefNo()); +// materialInventory.setSheetRefNo(materialInventoryParamDO.getSheetRefNo()); +// materialInventory.setBoxPalletNo(materialInventoryParamDO.getBoxPalletNo()); +// materialInventory.setProductionDate(materialInventoryParamDO.getProductionDate()); +// materialInventory.setExtAttr1(materialInventoryParamDO.getExtAttr1()); +// materialInventory.setExtAttr2(materialInventoryParamDO.getExtAttr2()); +// materialInventory.setExtAttr3(materialInventoryParamDO.getExtAttr3()); +// materialInventory.setExtAttr4(materialInventoryParamDO.getExtAttr4()); +// materialInventory.setExpiryDate(materialInventoryParamDO.getExpiryDate()); +// materialInventory.setInventoryDate(materialInventoryParamDO.getInventoryDate()); + materialInventory.setBatchNumber(materialInventoryParamDO.getBatchNumber()); + materialInventory.setUnit(materialBaseInfo.getUnitCode()); + materialInventory.setUnitName(materialBaseInfo.getUnitName()); + //创建人信息 + materialInventory.setCreateBy(materialInventoryParamDO.getCreateBy()); + materialInventory.setCreateByName(materialInventoryParamDO.getCreateByName()); + materialInventory.setCreateTime(new Date()); + materialInventory.setUpdateTime(new Date()); + materialInventory.setBarCode(materialInventoryParamDO.getBarCode()); + materialInventory.setLotNumber(materialInventoryParamDO.getLotNumber()); + materialInventory.setBatchNumber((materialInventoryParamDO.getBatchNumber())); + materialInventory.setInOrderNumber((materialInventoryParamDO.getInOrderNumber())); + materialInventoryMapper.insert(materialInventory); + materialInventoryParamDO.setMaterialInventoryId(materialInventory.getMaterialInventoryId()); + } else { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.add(area); + BigDecimal newVolume = oldVolume.add(volume); + BigDecimal newGrossWeight = oldGrossWeight.add(grossWeight); + BigDecimal newNetWeight = oldNetWeight.add(netWeight); + + materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + //materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity()); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + materialInventoryPO.setUpdateTime(new Date()); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } + } + private void ff(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.add(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.subtract(area); + BigDecimal newVolume = oldVolume.subtract(volume); + BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight); + BigDecimal newNetWeight = oldNetWeight.subtract(netWeight); + + //materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + materialInventoryPO.setAllocationQuantity(newAllocationQuantity); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + materialInventoryPO.setUpdateTime(new Date()); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } + private void qxff(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.add(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.subtract(area); + BigDecimal newVolume = oldVolume.subtract(volume); + BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight); + BigDecimal newNetWeight = oldNetWeight.subtract(netWeight); + + //materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + materialInventoryPO.setAllocationQuantity(newAllocationQuantity); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + materialInventoryPO.setUpdateTime(new Date()); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } + private void ckjj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.subtract(area); + BigDecimal newVolume = oldVolume.subtract(volume); + BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight); + BigDecimal newNetWeight = oldNetWeight.subtract(netWeight); + + materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + //materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity()); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + materialInventoryPO.setUpdateTime(new Date()); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } + private void yw(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.subtract(area); + BigDecimal newVolume = oldVolume.subtract(volume); + BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight); + BigDecimal newNetWeight = oldNetWeight.subtract(netWeight); + + materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + //materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity()); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + materialInventoryPO.setUpdateTime(new Date()); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } + private void kctz(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.subtract(area); + BigDecimal newVolume = oldVolume.subtract(volume); + BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight); + BigDecimal newNetWeight = oldNetWeight.subtract(netWeight); + + materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + //materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity()); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + materialInventoryPO.setUpdateTime(new Date()); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } + private void kcdj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) { + ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); + if (materialInventoryPO != null) { + //库存数量 + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + //可用数量 + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + //冻结数量(出库交接不变动冻结数量) + BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; + //扣减后库存数量 + BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity); + //扣减后可用数量 + BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity); + BigDecimal newFreezeQuantity = oldFreezeQuantity.add(quantity); + + + + BigDecimal oldArea = materialInventoryPO.getArea(); + BigDecimal oldVolume = materialInventoryPO.getVolume(); + BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); + BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + + BigDecimal newArea = oldArea.subtract(area); + BigDecimal newVolume = oldVolume.subtract(volume); + BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight); + BigDecimal newNetWeight = oldNetWeight.subtract(netWeight); + + //materialInventoryPO.setInventoryQuantity(newInventoryQuantity); + materialInventoryPO.setAllocationQuantity(newAllocationQuantity); + materialInventoryPO.setFreezeQuantity(newFreezeQuantity); + materialInventoryPO.setArea(newArea); + materialInventoryPO.setVolume(newVolume); + materialInventoryPO.setGrossWeight(newGrossWeight); + materialInventoryPO.setNetWeight(newNetWeight); + materialInventoryPO.setUpdateTime(new Date()); + ReservationMaterialInventory materialInventory = new ReservationMaterialInventory(); + com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory); + materialInventoryMapper.updateById(materialInventory); + } + } +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java new file mode 100644 index 000000000..0ad83ba4d --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryPO.java @@ -0,0 +1,228 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBasePO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +@ApiModel(value = "物料库存对象", description = "物料库存响应对象") +public class ReservationMaterialInventoryPO extends MaterialBasePO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("上架单物料明细id") + @Excel(name = "上架单物料明细id") + private Long materialDetailId; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + + @ApiModelProperty("单位") + @Excel(name = "单位") + private String unit; + + @ApiModelProperty("净重(KG)") + @Excel(name = "净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("毛重(KG)") + @Excel(name = "毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("体积") + @Excel(name = "体积") + private BigDecimal volume; + + @ApiModelProperty("面积") + @Excel(name = "面积") + private BigDecimal area; + + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + + @ApiModelProperty("扩展字段1") + @Excel(name = "扩展字段1") + private String extAttr1; + + @ApiModelProperty("扩展字段2") + @Excel(name = "扩展字段2") + private String extAttr2; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + + @ApiModelProperty("过期日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date expiryDate; + + @ApiModelProperty("存货日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inventoryDate; + + @ApiModelProperty("ExtAttr3") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr3; + + @ApiModelProperty("ExtAttr4") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr4; + + + @ApiModelProperty("包装名") + @Excel(name = "包装名") + private String packName; + + + @ApiModelProperty("单位名") + @Excel(name = "单位名") + private String unitName; + + @ApiModelProperty("条码") + @Excel(name = "条码") + private String barCode; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("LOT编号") + @Excel(name = "LOT编号") + private String lotNumber; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryQueryListPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryQueryListPO.java new file mode 100644 index 000000000..9e3d67792 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/po/ReservationMaterialInventoryQueryListPO.java @@ -0,0 +1,289 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.po; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBasePO; +import com.mhd.system.api.domain.MaterialMoreDetailPO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * 库存查询对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +@ApiModel(value = "库存查询对象", description = "库存查询响应对象") +public class ReservationMaterialInventoryQueryListPO extends MaterialBasePO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("包装规格id") + @Excel(name = "包装规格id") + private Long packId; + + @ApiModelProperty("包装规格编码") + @Excel(name = "包装规格编码") + private String packCode; + + @ApiModelProperty("包装规格名称") + @Excel(name = "包装规格名称") + private String packName; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("移入库位id,供 PDA 底部表单区填写") + private Long newStorageLocationId; + + @ApiModelProperty("移入库位编码,供 PDA 底部表单区填写") + private String newStorageLocationCode; + + @ApiModelProperty("移入库位名称,供 PDA 底部表单区显示") + private String newStorageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("批号/LOT") + @Excel(name = "批号") + private String lotNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("移位数量,供 PDA 底部表单区显示,库存查询时等于可用数量") + @Excel(name = "移位数量") + private BigDecimal shiftQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + + @ApiModelProperty("单位") + @Excel(name = "单位") + private String unit; + + @ApiModelProperty("单位名称") + @Excel(name = "单位名称") + private String unitName; + + @ApiModelProperty("净重(KG)") + @Excel(name = "净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("毛重(KG)") + @Excel(name = "毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("体积") + @Excel(name = "体积") + private BigDecimal volume; + + @ApiModelProperty("面积") + @Excel(name = "面积") + private BigDecimal area; + + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + + @ApiModelProperty("扩展字段1") + @Excel(name = "扩展字段1") + private String extAttr1; + + @ApiModelProperty("扩展字段2") + @Excel(name = "扩展字段2") + private String extAttr2; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + + @ApiModelProperty("过期日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date expiryDate; + + @ApiModelProperty("存货日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inventoryDate; + + @ApiModelProperty("ExtAttr3") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr3; + + @ApiModelProperty("ExtAttr4") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr4; + + + @ApiModelProperty("层级深度,与移位详情一致:1-主项 2-子项") + private Integer level; + + @ApiModelProperty("业务唯一id,与移位详情一致") + private Long uniqueId; + + @ApiModelProperty("父级唯一Id,子项时使用") + private Long parentUniqueId; + + @ApiModelProperty("子项列表,与移位详情一致,主项下含一条 parent_copy 子项") + private List children; + + @ApiModelProperty("总净重(KG),PDA 表单区显示") + private BigDecimal totalNetWeight; + + @ApiModelProperty("总毛重(KG),PDA 表单区显示") + private BigDecimal totalGrossWeight; + + @ApiModelProperty("总体积(CBM),PDA 表单区显示") + private BigDecimal totalVolume; + + @ApiModelProperty("总面积(SQM),PDA 表单区显示") + private BigDecimal totalArea; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBarCodePO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBarCodePO.java new file mode 100644 index 000000000..e5c9ae447 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBarCodePO.java @@ -0,0 +1,81 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + + +/** + * 物料条码信息对象 material_bar_code + * + * @author gen + * @date 2024-05-07 + */ + +@Data +@ApiModel(value = "物料条码信息对象", description = "物料条码信息响应对象") +public class MaterialBarCodePO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("商品规则id") + private Long materialBarCodeId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("条码") + @Excel(name = "条码") + private String barCode; + + @ApiModelProperty("包装id") + @Excel(name = "包装id") + private Long packId; + + @ApiModelProperty("包装编码") + @Excel(name = "包装编码") + private String packCode; + + @ApiModelProperty("包装名称") + @Excel(name = "包装名称") + private String packName; + + @ApiModelProperty("包装详情id") + @Excel(name = "包装详情id") + private Long packDetailId; + + @ApiModelProperty("单位代码:EA IP CS PL OT") + @Excel(name = "单位代码:EA IP CS PL OT") + private String unitCode; + + @ApiModelProperty("名称") + @Excel(name = "名称") + private String name; + + @ApiModelProperty("数量") + @Excel(name = "数量") + private BigDecimal number; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDO.java new file mode 100644 index 000000000..13acabd26 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDO.java @@ -0,0 +1,73 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.handler.ListTypeHandler; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author ZhouGY + * @title MaterialBaseDO + * @description: TODO + * @date 2024/7/5 10:59 + **/ +@EqualsAndHashCode(callSuper = true) +@Data +public class MaterialBaseDO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("物料分类编码") + @Excel(name = "物料分类编码") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyCode; + + @ApiModelProperty("物料分类名称") + @Excel(name = "物料分类名称") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyName; + + @ApiModelProperty("物料种类编码 数据字典") + @Excel(name = "物料种类编码 数据字典") + private String materialType; + + @ApiModelProperty("物料种类名称 数据字典") + @Excel(name = "物料种类名称 数据字典") + private String materialTypeName; + + @ApiModelProperty("货主信息") + @Excel(name = "货主信息") + private String shipperInfo; + + @ApiModelProperty("物料信息") + @Excel(name = "物料信息") + private String materialInfo; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDTO.java new file mode 100644 index 000000000..08d6ea497 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseDTO.java @@ -0,0 +1,61 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.handler.ListTypeHandler; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author ZhouGY + * @title MaterialBaseDO + * @description: TODO + * @date 2024/7/5 10:59 + **/ +@EqualsAndHashCode(callSuper = true) +@Data +public class MaterialBaseDTO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("物料分类编码") + @Excel(name = "物料分类编码") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyCode; + + @ApiModelProperty("物料分类名称") + @Excel(name = "物料分类名称") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyName; + + @ApiModelProperty("物料种类编码 数据字典") + @Excel(name = "物料种类编码 数据字典") + private String materialType; + + @ApiModelProperty("物料种类名称 数据字典") + @Excel(name = "物料种类名称 数据字典") + private String materialTypeName; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfo.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfo.java new file mode 100644 index 000000000..4faf81b74 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfo.java @@ -0,0 +1,207 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.handler.ListTypeHandler; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + + +/** + * 物料基础信息对象 material_base_info + * + * @author gen + * @date 2024-05-07 + */ + +//@TableName(value = "material_base_info", autoResultMap = true) +@Data +public class MaterialBaseInfo extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料基础信息id") + @TableId(type = IdType.AUTO) + private Long materialBaseInfoId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料分类id") + @Excel(name = "物料分类id") + private String materialClassifyId; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("物料分类编码") + @Excel(name = "物料分类编码") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyCode; + + @ApiModelProperty("物料分类名称") + @Excel(name = "物料分类名称") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyName; + + @ApiModelProperty("物料种类编码 数据字典") + @Excel(name = "物料种类编码 数据字典") + private String materialType; + + @ApiModelProperty("物料种类名称 数据字典") + @Excel(name = "物料种类名称 数据字典") + private String materialTypeName; + + @ApiModelProperty("包装规格id") + @Excel(name = "包装规格id") + private Long packId; + + @ApiModelProperty("包装规格编码") + @Excel(name = "包装规格编码") + private String packCode; + + @ApiModelProperty("包装规格名称") + @Excel(name = "包装规格名称") + private String packName; + + @ApiModelProperty("包装单位编码") + @Excel(name = "包装单位编码") + private String unitCode; + + @ApiModelProperty("包装单位名称") + @Excel(name = "包装单位名称") + private String unitName; + + @ApiModelProperty("品牌id") + @Excel(name = "品牌id") + private Long brandId; + + @ApiModelProperty("品牌编码") + @Excel(name = "品牌编码") + private String brandCode; + + @ApiModelProperty("品牌名称") + @Excel(name = "品牌名称") + private String brandName; + + @ApiModelProperty("保质期 单位:天") + @Excel(name = "保质期 单位:天") + private Long shelfLife; + + @ApiModelProperty("净重 单位:千克") + @Excel(name = "净重 单位:千克") + private BigDecimal weightLimit; + + @ApiModelProperty("体积 单位:立方米") + @Excel(name = "体积 单位:立方米") + private BigDecimal volumeLimit; + + @ApiModelProperty("商品形态编码 数据字典") + @Excel(name = "商品形态编码 数据字典") + private String materialShape; + + @ApiModelProperty("商品形态名称 数据字典") + @Excel(name = "商品形态名称 数据字典") + private String materialShapeName; + + @ApiModelProperty("物料大小 长*宽*高 单位:米") + @Excel(name = "物料大小 长*宽*高 单位:米") + private String materialSize; + + @ApiModelProperty("物料大小-长 单位:米") + @Excel(name = "物料大小-长 单位:米") + private BigDecimal materialLength; + + @ApiModelProperty("物料大小-宽 单位:米") + @Excel(name = "物料大小-宽 单位:米") + private BigDecimal materialWidth; + + @ApiModelProperty("物料大小-高 单位:米") + @Excel(name = "物料大小-高 单位:米") + private BigDecimal materialHeight; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("是否作废: 1-是 2-否") + @Excel(name = "是否作废: 1-是 2-否") + private Integer nullify; + + @ApiModelProperty("单位数量") + @Excel(name = "单位数量") + private BigDecimal unitNumber; + + @ApiModelProperty("是否公用: 1-是 2-否") + @Excel(name = "是否公用: 1-是 2-否") + private Integer common; + + @ApiModelProperty("SKU码") + private String skuCode; + + @ApiModelProperty("单价") + private BigDecimal unitPrice; + + @ApiModelProperty("币制") + private String currency; + + @ApiModelProperty("原产国") + private String originCountry; + + @ApiModelProperty("HS码") + private String hsCode; + + @ApiModelProperty("申报单位") + private String declarationUnit; + + @ApiModelProperty("法定单位") + private String statutoryUnit; + + @ApiModelProperty("法定第二单位") + private String statutorySecondUnit; + + @ApiModelProperty("规格型号") + private String specificationModel; + + @ApiModelProperty("是否抄码: 1-是 2-否") + @Excel(name = "是否抄码: 1-是 2-否") + @TableField("copy_code") + private Integer copyCode; + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfoDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfoDTO.java new file mode 100644 index 000000000..e997694b1 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBaseInfoDTO.java @@ -0,0 +1,261 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.handler.ListTypeHandler; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 物料基础信息对象 material_base_info + * + * @author gen + * @date 2024-05-07 + */ + +@Data +public class MaterialBaseInfoDTO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("物料分类编码") + @Excel(name = "物料分类编码") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyCode; + + @ApiModelProperty("物料分类名称") + @Excel(name = "物料分类名称") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyName; + @ApiModelProperty("物料分类(导入)") + @Excel(name = "物料分类") + private String materialClassifyImport; + + @ApiModelProperty("物料种类编码 数据字典") + @Excel(name = "物料种类编码 数据字典") + private String materialType; + + @ApiModelProperty("物料种类名称 数据字典") + @Excel(name = "物料种类名称 数据字典") + private String materialTypeName; + @ApiModelProperty("物料种类(导入)") + @Excel(name = "物料种类") + private String materialTypeImport; + + @ApiModelProperty("包装规格id") + @Excel(name = "包装规格id") + private Long packId; + + @ApiModelProperty("包装规格编码") + @Excel(name = "包装规格编码") + private String packCode; + + @ApiModelProperty("包装规格名称") + @Excel(name = "包装规格名称") + private String packName; + @ApiModelProperty("包装规格(导入)") + @Excel(name = "包装规格") + private String packImport; + + @ApiModelProperty("包装单位编码") + @Excel(name = "包装单位编码") + private String unitCode; + + @ApiModelProperty("包装单位名称") + @Excel(name = "包装单位名称") + private String unitName; + @ApiModelProperty("物料单位(导入)") + @Excel(name = "物料单位") + private String unitImport; + @ApiModelProperty("单位(导入)") + @Excel(name = "单位") + private String unitImport2; + + @ApiModelProperty("品牌id") + @Excel(name = "品牌id") + private Long brandId; + + @ApiModelProperty("品牌编码") + @Excel(name = "品牌编码") + private String brandCode; + + @ApiModelProperty("品牌名称") + @Excel(name = "品牌名称") + private String brandName; + + @ApiModelProperty("保质期 单位:天") + @Excel(name = "保质期 单位:天") + private Long shelfLife; + + @ApiModelProperty("净重 单位:千克") + @Excel(name = "净重 单位:千克") + private BigDecimal weightLimit; + + @ApiModelProperty("体积 单位:立方米") + @Excel(name = "体积 单位:立方米") + private BigDecimal volumeLimit; + + @ApiModelProperty("商品形态编码 数据字典") + @Excel(name = "商品形态编码 数据字典") + private String materialShape; + + @ApiModelProperty("商品形态名称 数据字典") + @Excel(name = "商品形态名称 数据字典") + private String materialShapeName; + + @ApiModelProperty("物料大小 长*宽*高 单位:米") + @Excel(name = "物料大小 长*宽*高 单位:米") + private String materialSize; + + @ApiModelProperty("物料大小-长 单位:米") + @Excel(name = "物料大小-长 单位:米") + private BigDecimal materialLength; + + @ApiModelProperty("物料大小-宽 单位:米") + @Excel(name = "物料大小-宽 单位:米") + private BigDecimal materialWidth; + + @ApiModelProperty("物料大小-高 单位:米") + @Excel(name = "物料大小-高 单位:米") + private BigDecimal materialHeight; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty("是否作废: 1-是 2-否") + @Excel(name = "是否作废: 1-是 2-否") + private Integer nullify; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; +// +// @ApiModelProperty("商品规则") +// private MaterialGoodsRuleDO materialGoodsRule; +// +// @ApiModelProperty("公共信息") +// private MaterialCommonDTO materialCommon; +// +// @ApiModelProperty("仓库控制信息") +// private MaterialWarehouseControlDTO materialWarehouseControl; +// +// @ApiModelProperty("库存预警信息") +// private List materialInventoryWarningList; +// +// @ApiModelProperty("条码信息") +// private List materialBarCodeList; + + @ApiModelProperty("复合条件查询 物料名称 物料编码 物料条码") + private String compoundOrQuery; + + @ApiModelProperty("feign 是否是修改: 1-是 2-否") + private Integer updateFeign; + + @ApiModelProperty("是否公用: 1-是 2-否") + @Excel(name = "是否公用: 1-是 2-否") + private Integer common; + + @ApiModelProperty("SKU码") + @Excel(name = "SKU码") + private String skuCode; + + @ApiModelProperty("单价") + @Excel(name = "单价") + private BigDecimal unitPrice; + + @ApiModelProperty("币制") + @Excel(name = "币制") + private String currency; + + @ApiModelProperty("原产国") + @Excel(name = "原产国") + private String originCountry; + + @ApiModelProperty("HS码") + @Excel(name = "HS码") + private String hsCode; + @ApiModelProperty("HS编码(导入)") + @Excel(name = "HS编码") + private String hsCodeImport; + + @ApiModelProperty("申报单位") + @Excel(name = "申报单位") + private String declarationUnit; + + @ApiModelProperty("法定单位") + @Excel(name = "法定单位") + private String statutoryUnit; + + @ApiModelProperty("法定第二单位") + @Excel(name = "法定第二单位") + private String statutorySecondUnit; + + @ApiModelProperty("规格型号") + @Excel(name = "规格型号") + private String specificationModel; + + @ApiModelProperty("批次ID") + private Long batchId; + + @ApiModelProperty("批次规则(导入:批次名称)") + @Excel(name = "批次规则") + private String batchRuleNameImport; + + @ApiModelProperty("批次名称(导入)") + @Excel(name = "批次名称") + private String batchName; + + @ApiModelProperty("批次(导入)") + @Excel(name = "批次") + private String batchImport; + + @ApiModelProperty("是否抄码: 1-是 2-否") + @Excel(name = "是否抄码: 1-是 2-否") + private Integer copyCode; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBasePO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBasePO.java new file mode 100644 index 000000000..929d0cd9f --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialBasePO.java @@ -0,0 +1,65 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.mhd.common.core.annotation.Excel; +import com.mhd.common.core.handler.ListTypeHandler; +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * @author ZhouGY + * @title MaterialBaseDO + * @description: TODO + * @date 2024/7/5 10:59 + **/ +@EqualsAndHashCode(callSuper = true) +@Data +public class MaterialBasePO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("物料分类编码") + @Excel(name = "物料分类编码") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyCode; + + @ApiModelProperty("物料分类名称") + @Excel(name = "物料分类名称") + @TableField(typeHandler = ListTypeHandler.class) + private List materialClassifyName; + + @ApiModelProperty("物料种类编码 数据字典") + @Excel(name = "物料种类编码 数据字典") + private String materialType; + + @ApiModelProperty("物料种类名称 数据字典") + @Excel(name = "物料种类名称 数据字典") + private String materialTypeName; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParamDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParamDO.java new file mode 100644 index 000000000..d488e4718 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParamDO.java @@ -0,0 +1,102 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class MaterialInventoryParamDO extends MaterialBaseDO { + private static final long serialVersionUID = 1L; + //库存id + private Long materialInventoryId; + //物料基础信息id + private Long materialBaseInfoId; + //物料明细ID + private Long materialDetailId; + + //仓库信息参数 + private Long organizationId; + private String organizationName; + private Long topOrganizationId; + //仓库ID + private Long warehouseId; + //仓库编码 + private String warehouseCode; + //仓库名称 + private String warehouseName; + //存储区ID + private Long storageSectionId; + //存储区编码 + private String storageCode; + //存储区名称 + private String storageName; + //存储位置ID + private Long storageLocationId; + //存储位置编码 + private String storageLocationCode; + //存储位置名称 + private String storageLocationName; + + + //调整参数 + + //调整数量 + private BigDecimal quantity; + //净重 + private BigDecimal netWeight; + //毛重 + private BigDecimal grossWeight; + //体积 + private BigDecimal volume; + //面积 + private BigDecimal area; + //类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结) + private String type; + + private String barCode; + + + + + //更多属性 + private String batchRefNo; + private String sheetRefNo; + //箱码 + private String boxPalletNo; + //扩展字段2 + private String extAttr1; + //扩展字段1 + private String extAttr2; + //生产日期 + private Date productionDate; + //过期日期 + private Date expiryDate; + //库存日期 + private Date inventoryDate; + //扩展字段3 + private Date extAttr3; + //扩展字段4 + private Date extAttr4; + + + private String inOrderNumber; + + private String lotNumber; + + private String batchNumber; + + private String isNew; + + /** 业务关联单号(出库单号、交接单对应单号等),用于库存调整记录 relate_no;可与入库单号区分 */ + private String relateNo; + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParentDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParentDO.java new file mode 100644 index 000000000..cee146fd3 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryParentDO.java @@ -0,0 +1,23 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class MaterialInventoryParentDO extends BaseVOEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存对象") + private List materialInventoryDOList; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDO.java new file mode 100644 index 000000000..b757c551b --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDO.java @@ -0,0 +1,255 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class MaterialInventoryQueryListDO extends MaterialBaseDO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + @ApiModelProperty("查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询") + @Excel(name = "查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询") + private Integer queryType; + + @ApiModelProperty("货主信息") + @Excel(name = "货主信息") + private String shipperInfo; + + @ApiModelProperty("物料信息") + @Excel(name = "物料信息") + private String materialInfo; + + @ApiModelProperty("物料/库位信息") + @Excel(name = "物料/库位信息") + private String storageInfo; + + @ApiModelProperty("容器号或批次号,输入后同时按容器号、批次号模糊匹配") + @Excel(name = "容器号或批次号") + private String containerOrBatch; + + @ApiModelProperty("单位") + @Excel(name = "单位") + private String unit; + + @ApiModelProperty("单位名称") + @Excel(name = "单位名称") + private String unitName; + + @ApiModelProperty("净重(KG)") + @Excel(name = "净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("毛重(KG)") + @Excel(name = "毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("体积") + @Excel(name = "体积") + private BigDecimal volume; + + @ApiModelProperty("面积") + @Excel(name = "面积") + private BigDecimal area; + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + + @ApiModelProperty("扩展字段1") + @Excel(name = "扩展字段1") + private String extAttr1; + + @ApiModelProperty("扩展字段2") + @Excel(name = "扩展字段2") + private String extAttr2; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + + @ApiModelProperty("过期日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date expiryDate; + + @ApiModelProperty("存货日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inventoryDate; + + @ApiModelProperty("ExtAttr3") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr3; + + @ApiModelProperty("ExtAttr4") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr4; + + @ApiModelProperty("订单物料明细id") + private Long materialDetailId; + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDTO.java new file mode 100644 index 000000000..d04f90f92 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/MaterialInventoryQueryListDTO.java @@ -0,0 +1,186 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class MaterialInventoryQueryListDTO extends MaterialBaseDTO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("货主id") + @Excel(name = "货主id") + private Long shipperId; + + @ApiModelProperty("货主编码") + @Excel(name = "货主编码") + private String shipperCode; + + @ApiModelProperty("货主名称") + @Excel(name = "货主名称") + private String shipperName; + + @ApiModelProperty("物料编码") + @Excel(name = "物料编码") + private String materialCode; + + @ApiModelProperty("物料名称") + @Excel(name = "物料名称") + private String materialName; + + @ApiModelProperty("物料条形码") + @Excel(name = "物料条形码") + private String barCode; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + @ApiModelProperty("查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询") + @Excel(name = "查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询") + private Integer queryType; + + @ApiModelProperty("货主信息") + @Excel(name = "货主信息") + private String shipperInfo; + + @ApiModelProperty("物料信息") + @Excel(name = "物料信息") + private String materialInfo; + + @ApiModelProperty("物料/库位信息") + @Excel(name = "物料/库位信息") + private String storageInfo; + + @ApiModelProperty("容器号或批次号,输入后同时按容器号、批次号模糊匹配") + @Excel(name = "容器号或批次号") + private String containerOrBatch; + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDO.java new file mode 100644 index 000000000..fcd0afe63 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDO.java @@ -0,0 +1,246 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class ReservationMaterialInventoryDO extends MaterialBaseDO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("上架单物料明细id") + @Excel(name = "上架单物料明细id") + private Long materialDetailId; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器号或批次号(PDA单输入框模糊查询,优先于 batchNumber/containerCode 单独传参)") + private String containerOrBatch; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + @ApiModelProperty("货主信息") + @Excel(name = "货主信息") + private String shipperInfo; + + @ApiModelProperty("物料信息") + @Excel(name = "物料信息") + private String materialInfo; + + @ApiModelProperty("物料/库位信息") + @Excel(name = "物料/库位信息") + private String storageInfo; + + + @ApiModelProperty("单位") + @Excel(name = "单位") + private String unit; + + @ApiModelProperty("单位名称") + @Excel(name = "单位名称") + private String unitName; + + @ApiModelProperty("净重(KG)") + @Excel(name = "净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("毛重(KG)") + @Excel(name = "毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("体积") + @Excel(name = "体积") + private BigDecimal volume; + + @ApiModelProperty("面积") + @Excel(name = "面积") + private BigDecimal area; + + @ApiModelProperty("货主id") + private Long shipperId; + + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + + @ApiModelProperty("扩展字段1") + @Excel(name = "扩展字段1") + private String extAttr1; + + @ApiModelProperty("扩展字段2") + @Excel(name = "扩展字段2") + private String extAttr2; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + + @ApiModelProperty("过期日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date expiryDate; + + @ApiModelProperty("存货日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date inventoryDate; + + @ApiModelProperty("ExtAttr3") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr3; + + @ApiModelProperty("ExtAttr4") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date extAttr4; + + //查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部 + private String queryRule; + + @ApiModelProperty("冻结数量大于0条件") + @Excel(name = "冻结数量大于0条件") + private String greaterThanFreezeQuantity; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; + + @ApiModelProperty("LOT编号") + @Excel(name = "LOT编号") + private String lotNumber; +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDTO.java new file mode 100644 index 000000000..1a5521eaa --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/repository/todo/ReservationMaterialInventoryDTO.java @@ -0,0 +1,187 @@ +package com.mhd.oms.domain.reservationMaterialInventory.repository.todo; + +import com.mhd.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 物料库存对象 material_inventory + * + * @author gen + * @date 2024-05-29 + */ + +@Data +public class ReservationMaterialInventoryDTO extends MaterialBaseDTO { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("物料库存id") + private Long materialInventoryId; + + @ApiModelProperty("组织表ID") + @Excel(name = "组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + @Excel(name = "组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + @Excel(name = "一级组织表ID") + private Long topOrganizationId; + + @ApiModelProperty("物料基础信息id") + @Excel(name = "物料基础信息id") + private Long materialBaseInfoId; + + @ApiModelProperty("上架单物料明细id") + @Excel(name = "上架单物料明细id") + private Long materialDetailId; + + @ApiModelProperty("仓库id") + @Excel(name = "仓库id") + private Long warehouseId; + + @ApiModelProperty("仓库编码") + @Excel(name = "仓库编码") + private String warehouseCode; + + @ApiModelProperty("仓库名称") + @Excel(name = "仓库名称") + private String warehouseName; + + @ApiModelProperty("库区id") + @Excel(name = "库区id") + private Long storageSectionId; + + @ApiModelProperty("库区编码") + @Excel(name = "库区编码") + private String storageCode; + + @ApiModelProperty("库区名称") + @Excel(name = "库区名称") + private String storageName; + + @ApiModelProperty("库位id") + @Excel(name = "库位id") + private Long storageLocationId; + + @ApiModelProperty("库位编码") + @Excel(name = "库位编码") + private String storageLocationCode; + + @ApiModelProperty("库位名称") + @Excel(name = "库位名称") + private String storageLocationName; + + @ApiModelProperty("批次号") + @Excel(name = "批次号") + private String batchNumber; + + @ApiModelProperty("物料状态编码") + @Excel(name = "物料状态编码") + private String materialStatusCode; + + @ApiModelProperty("物料状态名称") + @Excel(name = "物料状态名称") + private String materialStatusName; + + @ApiModelProperty("容器id") + @Excel(name = "容器id") + private Long containerId; + + @ApiModelProperty("容器编码") + @Excel(name = "容器编码") + private String containerCode; + + @ApiModelProperty("容器号或批次号(PDA单输入框模糊查询,优先于 batchNumber/containerCode 单独传参)") + private String containerOrBatch; + + @ApiModelProperty("容器类型 数据字典") + @Excel(name = "容器类型 数据字典") + private String containerType; + + @ApiModelProperty("容器类型名称 数据字典") + @Excel(name = "容器类型名称 数据字典") + private String containerTypeName; + + @ApiModelProperty("库存数量") + @Excel(name = "库存数量") + private BigDecimal inventoryQuantity; + + @ApiModelProperty("可用数量") + @Excel(name = "可用数量") + private BigDecimal allocationQuantity; + + @ApiModelProperty("冻结数量") + @Excel(name = "冻结数量") + private BigDecimal freezeQuantity; + + @ApiModelProperty("备注") + @Excel(name = "备注") + private String remark; + + + @ApiModelProperty(name = "组织ID集合") + private List organizationIdList; + + @ApiModelProperty(name = "权限菜单ID") + private Long permissionMenuId; + + @ApiModelProperty("盘点是否可用:0-禁用 1-可用") + @Excel(name = "盘点是否可用:0-禁用 1-可用") + private Integer isAble; + + @ApiModelProperty("货主信息") + @Excel(name = "货主信息") + private String shipperInfo; + + @ApiModelProperty("物料信息") + @Excel(name = "物料信息") + private String materialInfo; + + @ApiModelProperty("物料/库位信息") + @Excel(name = "物料/库位信息") + private String storageInfo; + + @ApiModelProperty("货主id") + private Long shipperId; + + @ApiModelProperty("Batch Ref NO's") + @Excel(name = "Batch Ref NO's") + private String batchRefNo; + + @ApiModelProperty("Sheet Ref NO's") + @Excel(name = "Sheet Ref NO's") + private String sheetRefNo; + + @ApiModelProperty("箱号/卡板号") + @Excel(name = "箱号/卡板号") + private String boxPalletNo; + //查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部 + private String queryRule; + + @ApiModelProperty("净重(KG)") + @Excel(name = "净重(KG)") + private BigDecimal netWeight; + + @ApiModelProperty("毛重(KG)") + @Excel(name = "毛重(KG)") + private BigDecimal grossWeight; + + @ApiModelProperty("体积") + @Excel(name = "体积") + private BigDecimal volume; + + @ApiModelProperty("面积") + @Excel(name = "面积") + private BigDecimal area; + + @ApiModelProperty("冻结数量大于0条件") + @Excel(name = "冻结数量大于0条件") + private String greaterThanFreezeQuantity; + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java new file mode 100644 index 000000000..1aa314ba7 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java @@ -0,0 +1,567 @@ +package com.mhd.oms.domain.reservationMaterialInventory.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import com.mhd.oms.domain.reservationMaterialInventory.service.ReservationMaterialInventoryDomainService; +import com.mhd.system.api.SystemServiceFeign; +import com.mhd.system.api.domain.BatchDetailFeignPO; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; +import com.mhd.system.api.domain.MaterialInventoryPO; +import com.mhd.system.api.domain.MaterialMoreDetailPO; +import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO; +import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; +import com.mhd.system.api.model.LoginUser; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 物料库存ApplicationService + * + * @author gen + * @date 2024-05-29 + */ +@Service +@Slf4j +public class ReservationMaterialInventoryApplicationService { + @Autowired + private ReservationMaterialInventoryDomainService materialInventoryDomainService; + @Autowired + private SystemServiceFeign systemServiceFeign; + @Autowired + private ReservationMaterialInventoryMapper materialInventoryMapper; + + + + /** + * 分页查询物料库存列表 + */ + + public List queryList(ReservationMaterialInventoryDO materialInventoryDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null && loginUser.getUserPo() != null){ + Long userOrganizationId = loginUser.getUserPo().getOrganizationId(); + Long frontendOrganizationId = materialInventoryDO.getOrganizationId(); // 前端传递的 organizationId + + // 数据权限:根据 organizationId 来设置查询权限 + // 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己 + if (userOrganizationId != null && userOrganizationId == 2827L) { + // 南光组织(organizationId=2827):可以查询所有组织的数据 + // 如果前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤 + // 如果前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据 + if (frontendOrganizationId != null) { + // 前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤 + materialInventoryDO.setOrganizationId(frontendOrganizationId); + materialInventoryDO.setTopOrganizationId(null); // 明确设置为 null,避免使用 topOrganizationId 条件 + } else { + // 前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据 + materialInventoryDO.setOrganizationId(null); + materialInventoryDO.setTopOrganizationId(null); + } + } else { + // 其他组织:设置organizationId,只查询当前组织的数据 + // 如果前端传递了 organizationId,验证是否与当前登录用户的组织ID一致 + if (frontendOrganizationId != null && userOrganizationId != null) { + // 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致 + if (!frontendOrganizationId.equals(userOrganizationId)) { + // 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询 + materialInventoryDO.setOrganizationId(userOrganizationId); + } + // 如果前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值 + } else { + // 前端没有传递 organizationId,使用当前登录用户的组织ID + if (userOrganizationId != null) { + materialInventoryDO.setOrganizationId(userOrganizationId); + } + } + // 只有当 organizationId 为 null 时,才使用 topOrganizationId 作为查询条件 + // 如果 organizationId 不为 null,则优先使用 organizationId,不使用 topOrganizationId + if (materialInventoryDO.getOrganizationId() == null) { + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1) { + materialInventoryDO.setTopOrganizationId(topOrganizationId); + } + } else { + // 对于非2827组织,必须设置 topOrganizationId=2827 + materialInventoryDO.setTopOrganizationId(2827L); + } + } + // 前端有传warehouseId则优先使用传参;未传时才使用"用户关联仓库"作为默认值 +// if (materialInventoryDO.getWarehouseId() == null) { +// AssociationWarehouseCacheDO associationWarehouseCacheDO = +// SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); +// if (associationWarehouseCacheDO != null) { +// materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId()); +// } +// } + } + return materialInventoryDomainService.queryList(materialInventoryDO); + } + + /** + * 查询物料库存列表(带批次属性) + * 批次属性值从库存表中获取 + */ + public List queryListWithBatchAttributes(ReservationMaterialInventoryDO materialInventoryDO) { + List list = queryList(materialInventoryDO); + + if (CollectionUtils.isEmpty(list)) { + return list; + } + + // 性能优化:批量获取批次属性,避免N+1查询问题 + // 1. 收集所有唯一的materialBaseInfoId + Set materialBaseInfoIdSet = list.stream() + .map(ReservationMaterialInventoryPO::getMaterialBaseInfoId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + // 2. 批量查询批次属性(使用Map缓存,避免重复查询相同的materialBaseInfoId) + Map> batchDetailMap = new HashMap<>(); + for (Long materialBaseInfoId : materialBaseInfoIdSet) { + try { + AjaxResult ajaxResult = systemServiceFeign.getBatchDetailListByMaterialBaseInfoId(materialBaseInfoId); + if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) { + List batchDetailFeignPOList = JSON.parseArray( + JSONObject.toJSONString(ajaxResult.get("data")), BatchDetailFeignPO.class); + if (!CollectionUtils.isEmpty(batchDetailFeignPOList)) { + // 过滤isDisplay=1的属性 + List filteredList = batchDetailFeignPOList.stream() + .filter(batchDetail -> batchDetail.getIsDisplay() != null && batchDetail.getIsDisplay() == 1) + .collect(Collectors.toList()); + batchDetailMap.put(materialBaseInfoId, filteredList); + } + } + } catch (Exception e) { + log.warn("获取物料批次属性失败,物料基础信息ID:{},错误:{}", materialBaseInfoId, e.getMessage()); + } + } + + // 3. 为每个物料库存设置更多属性(从库存表中获取值) + //setMaterialMoreDetailListFromInventory(list, batchDetailMap); + + return list; + } + + + + public BigDecimal sumInventoryQuantity(ReservationMaterialInventoryDO materialInventoryDO) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (loginUser != null){ + Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); + if (topOrganizationId != null && topOrganizationId != 1){ + materialInventoryDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + } + // 前端有传warehouseId则优先使用传参;未传时才使用“用户关联仓库”作为默认值 + if (materialInventoryDO.getWarehouseId() == null) { + AssociationWarehouseCacheDO associationWarehouseCacheDO = + SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid()); + if (associationWarehouseCacheDO != null) { + materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId()); + } + } + } + List materialInventoryPOS = materialInventoryDomainService.queryList(materialInventoryDO); + if (CollectionUtils.isNotEmpty(materialInventoryPOS)){ + return materialInventoryPOS.stream().map(ReservationMaterialInventoryPO::getAllocationQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); + } + return BigDecimal.ZERO; + } + + /** + * 新增物料库存 + */ + public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO) { + + return materialInventoryDomainService.insert(materialInventoryDO); + } + + /** + * 修改物料库存 + */ + public Boolean update(ReservationMaterialInventoryDO materialInventoryDO) { + return materialInventoryDomainService.update(materialInventoryDO); + } + + /** + * 批量删除物料库存 + */ + public boolean delete(Long[] materialInventoryIds) { + return materialInventoryDomainService.delete(materialInventoryIds); + } + + /** + * 获取物料库存详细信息 + */ + public ReservationMaterialInventoryPO getInfo(Long materialInventoryId) + { + return materialInventoryDomainService.getInfo(materialInventoryId); + } + + /** + * @description 根据库位Id和物料基础信息Id 获取物料库存详细信息 + * @author ZhouGY + * @date 2024/5/29 17:15 + * @param storageLocationId + * @param materialBaseInfoId + * @return BigDecimal + */ + public BigDecimal getInventoryByStorageLocationIdAndMaterialBaseInfoId(Long storageLocationId, Long materialBaseInfoId) { + return materialInventoryDomainService.getInventoryByStorageLocationIdAndMaterialBaseInfoId(storageLocationId, materialBaseInfoId); + } + + /** + * @description:库存查询列表 + * @param materialInventoryQueryListDO + * @return: java.util.List + * @author: lianzj + * @time: 2024-07-16 14:43:38 + */ +// public List materialQueryList(ReservationMaterialInventoryQueryListDO materialInventoryQueryListDO) { +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// //topOrganizationId 会查到一级组织下全部子组织 +// if (loginUser != null && loginUser.getUserPo() != null) { +// Long userOrganizationId = loginUser.getUserPo().getOrganizationId(); +// Long frontendOrganizationId = materialInventoryQueryListDO.getOrganizationId(); +// if (userOrganizationId != null && userOrganizationId == 2827L) { +// if (frontendOrganizationId != null) { +// materialInventoryQueryListDO.setOrganizationId(frontendOrganizationId); +// materialInventoryQueryListDO.setTopOrganizationId(null); +// } else { +// materialInventoryQueryListDO.setOrganizationId(null); +// materialInventoryQueryListDO.setTopOrganizationId(null); +// } +// } else { +// if (frontendOrganizationId != null && userOrganizationId != null) { +// if (!frontendOrganizationId.equals(userOrganizationId)) { +// materialInventoryQueryListDO.setOrganizationId(userOrganizationId); +// } +// } else { +// if (userOrganizationId != null) { +// materialInventoryQueryListDO.setOrganizationId(userOrganizationId); +// } +// } +// if (materialInventoryQueryListDO.getOrganizationId() == null) { +// Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId(); +// if (topOrganizationId != null && topOrganizationId != 1) { +// materialInventoryQueryListDO.setTopOrganizationId(topOrganizationId); +// } +// } else { +// materialInventoryQueryListDO.setTopOrganizationId(2827L); +// } +// } +// } +// List list = materialInventoryDomainService.materialQueryList(materialInventoryQueryListDO); +// // 批次属性填充,与按单移位一致 +// fillMaterialMoreDetailForInventoryQueryList(list); +// // 主项子项结构仅用于 0-全部、6-按容器,供移位表单复用;1-5 按货主/物料/批次/库位/物料库位 为合并汇总展示,不转主项子项 +// Integer queryType = materialInventoryQueryListDO.getQueryType(); +// if (queryType == null || queryType == 0 || queryType == 6) { +// buildParentChildForInventoryQueryList(list); +// } +// return list; +// } +// +// /** +// * 将库存查询列表转为主项子项结构,与移位详情一致,供 PDA 表单复用 +// */ +// private void buildParentChildForInventoryQueryList(List list) { +// if (CollectionUtils.isEmpty(list)) return; +// for (ReservationMaterialInventoryQueryListPO parent : list) { +// Long uid = parent.getReservationMaterialInventoryId(); +// parent.setLevel(1); +// parent.setUniqueId(uid); +// parent.setParentUniqueId(null); +// ReservationMaterialInventoryQueryListPO child = new ReservationMaterialInventoryQueryListPO(); +// BeanUtils.copyProperties(parent, child, "children"); +// child.setLevel(2); +// child.setUniqueId(uid); +// child.setParentUniqueId(uid); +// child.setChildren(null); +// BigDecimal qty = parent.getShiftQuantity() != null ? parent.getShiftQuantity() : parent.getAllocationQuantity(); +// if (qty == null) qty = BigDecimal.ONE; +// if (parent.getNetWeight() != null) child.setTotalNetWeight(parent.getNetWeight().multiply(qty)); +// if (parent.getGrossWeight() != null) child.setTotalGrossWeight(parent.getGrossWeight().multiply(qty)); +// if (parent.getVolume() != null) child.setTotalVolume(parent.getVolume().multiply(qty)); +// if (parent.getArea() != null) child.setTotalArea(parent.getArea().multiply(qty)); +// parent.setTotalNetWeight(child.getTotalNetWeight()); +// parent.setTotalGrossWeight(child.getTotalGrossWeight()); +// parent.setTotalVolume(child.getTotalVolume()); +// parent.setTotalArea(child.getTotalArea()); +// List children = new ArrayList<>(); +// children.add(child); +// parent.setChildren(children); +// } +// } +// +// /** +// * 根据 materialInventoryId 获取单条库存(含批次属性、shiftQuantity),供移位表单预填,内部使用 +// */ +// public ReservationMaterialInventoryQueryListPO getInventoryForShiftForm(Long materialInventoryId) { +// if (materialInventoryId == null) return null; +// ReservationMaterialInventoryQueryListDO do_ = new ReservationMaterialInventoryQueryListDO(); +// do_.setReservationMaterialInventoryId(materialInventoryId); +// do_.setQueryType(0); +// List list = materialQueryList(do_); +// return CollectionUtils.isEmpty(list) ? null : list.get(0); +// } + + /** + * 库存查询列表批次属性填充,与按单移位 fillMaterialMoreDetailForShiftDetail 一致 + * 物料条码、包装规格:优先用 material_base_info,为空时从 material_bar_code 取条码(参考收货单实现) + */ +// private void fillMaterialMoreDetailForInventoryQueryList(List list) { +// if (CollectionUtils.isEmpty(list)) { +// return; +// } +// Set materialBaseInfoIdSet = list.stream() +// .map(ReservationMaterialInventoryQueryListPO::getMaterialBaseInfoId) +// .filter(Objects::nonNull) +// .collect(Collectors.toSet()); +// // 物料条码:material_base_info.bar_code 为空时,从 material_bar_code 取第一条(参考 StockReceiptOrderApplicationService) +// Map materialBarCodeMap = buildMaterialBarCodeMap(materialBaseInfoIdSet); +// list.forEach(po -> { +// if (StringUtils.isBlank(po.getBarCode()) && po.getMaterialBaseInfoId() != null) { +// String barCode = materialBarCodeMap.get(po.getMaterialBaseInfoId()); +// if (StringUtils.isNotBlank(barCode)) { +// po.setBarCode(barCode); +// } +// } +// }); +// Map> batchDetailMap = new HashMap<>(); +// for (Long materialBaseInfoId : materialBaseInfoIdSet) { +// try { +// AjaxResult ajaxResult = systemServiceFeign.getBatchDetailListByMaterialBaseInfoId(materialBaseInfoId); +// if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) { +// List batchList = JSON.parseArray( +// JSONObject.toJSONString(ajaxResult.get("data")), BatchDetailFeignPO.class); +// if (!CollectionUtils.isEmpty(batchList)) { +// batchDetailMap.put(materialBaseInfoId, batchList); +// } +// } +// } catch (Exception e) { +// log.warn("获取物料批次属性失败,materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage()); +// } +// } +// list.forEach(po -> { +// fillMaterialMoreDetailForInventoryQueryPO(po, batchDetailMap); +// // 移位数量供 PDA 底部表单区显示,库存查询时等于可用数量 +// po.setShiftQuantity(po.getAllocationQuantity()); +// }); +// } +// +// private void fillMaterialMoreDetailForInventoryQueryPO(ReservationMaterialInventoryQueryListPO po, +// Map> batchDetailMap) { +// if (po == null || po.getMaterialBaseInfoId() == null) { +// po.setMaterialMoreDetailList(new ArrayList<>()); +// return; +// } +// List materialMoreDetailList = new ArrayList<>(); +// List batchList = batchDetailMap.get(po.getMaterialBaseInfoId()); +// if (!CollectionUtils.isEmpty(batchList)) { +// materialMoreDetailList = filterAndConvertToMaterialMoreDetail(batchList); +// } +// // 与按单移位一致:净重、毛重、体积、面积、移位数量不放在上面 materialMoreDetailList,由 PO 顶层字段在底部表单区(移入数量、移入库位、容器旁)显示 +// materialMoreDetailList = excludeWeightVolumeAreaShiftFromList(materialMoreDetailList); +// fillAttributeValueFromInventoryQueryPO(po, materialMoreDetailList); +// List filtered = materialMoreDetailList.stream() +// .filter(m -> m.getAttributeValue() != null && !m.getAttributeValue().trim().isEmpty()) +// .collect(Collectors.toList()); +// po.setMaterialMoreDetailList(filtered); +// } + + /** + * 批量查询物料条码,取 material_bar_code 表第一条 barCode(参考 StockReceiptOrderApplicationService) + */ +// private Map buildMaterialBarCodeMap(Set materialBaseInfoIdSet) { +// Map map = new HashMap<>(); +// if (materialBaseInfoIdSet == null || materialBaseInfoIdSet.isEmpty()) return map; +// for (Long materialBaseInfoId : materialBaseInfoIdSet) { +// try { +// List list = materialBarCodeService.getInfoByMaterialBaseInfoIds(materialBaseInfoId); +// if (!CollectionUtils.isEmpty(list) && StringUtils.isNotBlank(list.get(0).getBarCode())) { +// map.put(materialBaseInfoId, list.get(0).getBarCode()); +// } +// } catch (Exception e) { +// log.warn("获取物料条码失败,materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage()); +// } +// } +// return map; +// } +// +// /** 净重、毛重、体积、面积、移位数量在底部表单区显示,从上面 materialMoreDetailList 中排除,与按单移位一致 */ +// private static final String[] WEIGHT_VOLUME_AREA_SHIFT_LABELS = { +// "净重(KG)", "净重", "总净重", +// "毛重(KG)", "毛重", "总毛重", +// "体积(CBM)", "体积", "总体积", +// "面积(SQM)", "面积", "总面积", +// "移位数量", "可移位数量" +// }; +// +// private List excludeWeightVolumeAreaShiftFromList(List list) { +// if (CollectionUtils.isEmpty(list)) { +// return list; +// } +// return list.stream() +// .filter(m -> { +// String label = m.getBatchLabels(); +// if (label == null) return true; +// for (String exclude : WEIGHT_VOLUME_AREA_SHIFT_LABELS) { +// if (exclude.equals(label.trim())) return false; +// } +// return true; +// }) +// .collect(Collectors.toList()); +// } +// +// private List filterAndConvertToMaterialMoreDetail(List batchList) { +// List result = new ArrayList<>(); +// if (CollectionUtils.isEmpty(batchList)) { +// return result; +// } +// for (BatchDetailFeignPO po : batchList) { +// if (po.getIsDisplay() == null || po.getIsDisplay() != 1) { +// continue; +// } +// MaterialMoreDetailPO mpo = new MaterialMoreDetailPO(); +// mpo.setBatchId(po.getBatchId()); +// mpo.setBatchDetailId(po.getBatchDetailId()); +// mpo.setBatchLabels(po.getBatchLabels()); +// mpo.setInputControl(po.getInputControl()); +// mpo.setAttributeFormat(po.getAttributeFormat()); +// mpo.setAttributeOption(po.getAttributeOption()); +// result.add(mpo); +// } +// return result; +// } +// +// private void fillAttributeValueFromInventoryQueryPO(ReservationMaterialInventoryQueryListPO po, +// List materialMoreDetailList) { +// if (CollectionUtils.isEmpty(materialMoreDetailList)) { +// return; +// } +// for (MaterialMoreDetailPO materialMoreDetail : materialMoreDetailList) { +// if (materialMoreDetail.getAttributeValue() != null && !materialMoreDetail.getAttributeValue().trim().isEmpty()) { +// continue; +// } +// String batchLabels = materialMoreDetail.getBatchLabels(); +// String attributeOption = materialMoreDetail.getAttributeOption(); +// String refVal = null; +// if (StringUtils.isNotBlank(batchLabels)) { +// switch (batchLabels.trim()) { +// case "Invoice No.": +// case "Invoice No": +// case "发票号": +// refVal = po.getExtAttr1(); +// break; +// case "Batch Ref NO's": +// case "Batch Ref NO": +// case "批次参考号": +// refVal = po.getBatchRefNo(); +// break; +// case "Sheet Ref NO's": +// case "Sheet Ref NO": +// case "单据参考号": +// refVal = po.getSheetRefNo(); +// break; +// case "箱号/卡板号": +// case "箱号": +// case "卡板号": +// refVal = po.getBoxPalletNo(); +// break; +// case "扩展字段1": +// case "扩展属性1": +// refVal = po.getExtAttr1(); +// break; +// case "扩展字段2": +// case "扩展属性2": +// refVal = po.getExtAttr2(); +// break; +// case "扩展字段3": +// case "扩展属性3": +// refVal = po.getExtAttr3() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExtAttr3()) : null; +// break; +// case "扩展字段4": +// case "扩展属性4": +// refVal = po.getExtAttr4() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExtAttr4()) : null; +// break; +// case "生产日期": +// refVal = po.getProductionDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getProductionDate()) : null; +// break; +// case "过期日期": +// refVal = po.getExpiryDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExpiryDate()) : null; +// break; +// case "存货日期": +// refVal = po.getInventoryDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getInventoryDate()) : null; +// break; +// case "批次号": +// refVal = po.getBatchNumber(); +// break; +// case "总净重": +// case "净重(KG)": +// case "净重": +// refVal = po.getNetWeight() != null ? po.getNetWeight().toString() : null; +// break; +// case "总毛重": +// case "毛重(KG)": +// case "毛重": +// refVal = po.getGrossWeight() != null ? po.getGrossWeight().toString() : null; +// break; +// case "总体积": +// case "体积(CBM)": +// case "体积": +// refVal = po.getVolume() != null ? po.getVolume().toString() : null; +// break; +// case "总面积": +// case "面积(SQM)": +// case "面积": +// refVal = po.getArea() != null ? po.getArea().toString() : null; +// break; +// default: +// if ("InvoiceNo".equalsIgnoreCase(attributeOption)) refVal = po.getExtAttr1(); +// else if ("BatchRefNo".equalsIgnoreCase(attributeOption)) refVal = po.getBatchRefNo(); +// else if ("SheetRefNo".equalsIgnoreCase(attributeOption)) refVal = po.getSheetRefNo(); +// else if ("BoxPalletNo".equalsIgnoreCase(attributeOption)) refVal = po.getBoxPalletNo(); +// else if ("ProductionDate".equalsIgnoreCase(attributeOption) && po.getProductionDate() != null) +// refVal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getProductionDate()); +// else if ("ExpiryDate".equalsIgnoreCase(attributeOption) && po.getExpiryDate() != null) +// refVal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExpiryDate()); +// else if ("InventoryDate".equalsIgnoreCase(attributeOption) && po.getInventoryDate() != null) +// refVal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getInventoryDate()); +// else if ("NetWeight".equalsIgnoreCase(attributeOption) && po.getNetWeight() != null) refVal = po.getNetWeight().toString(); +// else if ("GrossWeight".equalsIgnoreCase(attributeOption) && po.getGrossWeight() != null) refVal = po.getGrossWeight().toString(); +// else if ("Volume".equalsIgnoreCase(attributeOption) && po.getVolume() != null) refVal = po.getVolume().toString(); +// else if ("Area".equalsIgnoreCase(attributeOption) && po.getArea() != null) refVal = po.getArea().toString(); +// break; +// } +// } +// if (refVal != null) { +// materialMoreDetail.setAttributeValue(refVal); +// } +// } +// } + + /** + * 获取物料库存详细信息 + */ + public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO) + { + return materialInventoryDomainService.omsEdit(materialInventoryOmsParamDO); + } +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryAssembler.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryAssembler.java new file mode 100644 index 000000000..9a83ec3c9 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryAssembler.java @@ -0,0 +1,73 @@ +package com.mhd.oms.domain.reservationMaterialInventory.service; + +import cn.hutool.core.util.ObjectUtil; +import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException; +import com.mhd.common.core.exception.digitalLogisticsException.UserError; +import com.mhd.common.core.utils.IgnoreNullUtil; +import com.mhd.common.core.utils.bean.BeanUtils; +import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryQueryListDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryQueryListDTO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDTO; +import com.mhd.system.api.model.LoginUser; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * 物料库存Assembler + * + * @author gen + * @date 2024-05-29 + */ +@Component +public class ReservationMaterialInventoryAssembler { + + /** + * 转换实体 + */ + public ReservationMaterialInventoryDO toDO(ReservationMaterialInventoryDTO materialInventoryDTO) { + ReservationMaterialInventoryDO materialInventoryDO = new ReservationMaterialInventoryDO(); + // 拷贝 + BeanUtils.copyProperties(materialInventoryDTO, materialInventoryDO, IgnoreNullUtil.getNullPropertyNames(materialInventoryDTO)); + return materialInventoryDO; + } + + /** + * 转换实体 + */ + public ReservationMaterialInventoryDO toDOByEdit(ReservationMaterialInventoryDTO materialInventoryDTO) { + ReservationMaterialInventoryDO materialInventoryDO = new ReservationMaterialInventoryDO(); + // 拷贝 + BeanUtils.copyProperties(materialInventoryDTO, materialInventoryDO, IgnoreNullUtil.getNullPropertyNames(materialInventoryDTO)); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + throw new DigitalLogisticsException(UserError.TIMEOUT); + } + String userName = loginUser.getUsername(); + // 获取登录人id + Long userId = loginUser.getUserid(); + if(materialInventoryDTO.getMaterialInventoryId() != null){ + materialInventoryDO.setUpdateBy(userId); + materialInventoryDO.setUpdateByName(userName); + materialInventoryDO.setUpdateTime(new Date()); + }else { + materialInventoryDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); + materialInventoryDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); + materialInventoryDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); + materialInventoryDO.setCreateBy(userId); + materialInventoryDO.setCreateByName(userName); + materialInventoryDO.setCreateTime(new Date()); + materialInventoryDO.setDelFlag(1); + } + return materialInventoryDO; + } + + public MaterialInventoryQueryListDO toDOByQueryList(MaterialInventoryQueryListDTO materialInventoryQueryListDTO) { + MaterialInventoryQueryListDO materialInventoryQueryListDO = new MaterialInventoryQueryListDO(); + // 拷贝 + BeanUtils.copyProperties(materialInventoryQueryListDTO, materialInventoryQueryListDO, IgnoreNullUtil.getNullPropertyNames(materialInventoryQueryListDTO)); + return materialInventoryQueryListDO; + } +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryDomainService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryDomainService.java new file mode 100644 index 000000000..fc73a5f42 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryDomainService.java @@ -0,0 +1,113 @@ +package com.mhd.oms.domain.reservationMaterialInventory.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory; +import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; +import com.mhd.system.api.domain.MaterialInventoryPO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 物料库存 + * + * @author gen + * @date 2024-05-29 + */ +@Service +@Slf4j +public class ReservationMaterialInventoryDomainService { + + @Autowired + private IReservationMaterialInventoryService materialInventoryService; + + + /** + * 分页查询物料库存列表 + */ + public List queryList(ReservationMaterialInventoryDO materialInventoryDO) { + return materialInventoryService.queryList(materialInventoryDO); + } + + + /** + * 新增物料库存 + */ + public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO) { + + return materialInventoryService.insert(materialInventoryDO); + } + + /** + * 修改物料库存 + */ + public Boolean update(ReservationMaterialInventoryDO materialInventoryDO) { + return materialInventoryService.update(materialInventoryDO); + } + + /** + * 批量删除物料库存 + */ + public Boolean delete(Long[] materialInventoryIds) { + return materialInventoryService.delete(materialInventoryIds); + } + + /** + * 获取物料库存详细信息 + */ + public ReservationMaterialInventoryPO getInfo(Long materialInventoryId) + { + return materialInventoryService.getInfo(materialInventoryId); + } + + public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO) + { + return materialInventoryService.omsEdit(materialInventoryOmsParamDO); + } + + + /** + * 根据库位Id和物料基础信息Id 获取物料库存详细信息 + */ + public BigDecimal getInventoryByStorageLocationIdAndMaterialBaseInfoId(Long storageLocationId, Long materialBaseInfoId) { + ReservationMaterialInventory materialInventory = materialInventoryService.getOne(new QueryWrapper().lambda() + .select(ReservationMaterialInventory::getAllocationQuantity) + .eq(ReservationMaterialInventory::getStorageLocationId, storageLocationId) + .eq(ReservationMaterialInventory::getMaterialBaseInfoId, materialBaseInfoId) + .eq(ReservationMaterialInventory::getDelFlag, 1)); + if (materialInventory == null){ + return BigDecimal.ZERO; + } + return materialInventory.getInventoryQuantity(); + } + + /** + * @description:库存查询列表 + * @param materialInventoryQueryListDO + * @return: java.util.List + * @author: lianzj + * @time: 2024-07-16 14:45:23 + */ +// public List materialQueryList(ReservationMaterialInventoryQueryListDO materialInventoryQueryListDO) { +// return materialInventoryService.materialQueryList(materialInventoryQueryListDO); +// } +// +// +// /** +// * 分页查询即时库存列表 +// */ +// public List queryImmediateInventoryList(ImmediateInventoryDO immediateInventoryDO) { +// return materialInventoryService.queryImmediateInventoryList(immediateInventoryDO); +// } +// +// public ReservationMaterialInventoryPO selectOneByWhere(ReservationMaterialInventoryDO materialInventoryDO) { +// return materialInventoryService.selectOneByWhere(materialInventoryDO); +// } +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inventoryAdjustmentRecord/ReservationInventoryAdjustmentRecordApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inventoryAdjustmentRecord/ReservationInventoryAdjustmentRecordApi.java new file mode 100644 index 000000000..1f6405492 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/inventoryAdjustmentRecord/ReservationInventoryAdjustmentRecordApi.java @@ -0,0 +1,120 @@ +package com.mhd.oms.interfaces.facade.inventoryAdjustmentRecord; + +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDTO; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service.ReservationInventoryAdjustmentRecordApplicationService; +import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service.ReservationInventoryAdjustmentRecordAssembler; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 库存调整记录 + * + * @author gen + * @date 2024-07-17 + */ +@RestController +@RequestMapping("/reservationInventoryAdjustmentRecordApi") +public class ReservationInventoryAdjustmentRecordApi extends BaseController { + @Autowired + private ReservationInventoryAdjustmentRecordApplicationService inventoryAdjustmentRecordApplicationService; + + @Resource + private ReservationInventoryAdjustmentRecordAssembler inventoryAdjustmentRecordAssembler; + + /** + * 分页查询库存调整记录列表 + */ + @ApiOperation("查询库存调整记录列表") + @GetMapping("/list") + public TableDataInfo list(ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO) + { + //转换实体 + ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO); + startPage(); + List list = inventoryAdjustmentRecordApplicationService.queryList(inventoryAdjustmentRecordDO); + return getDataTable(list); + } + + /** + * 编辑库存调整记录 + */ + @ApiOperation("编辑库存调整记录") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO) + { + //转换实体 + ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO); + if(inventoryAdjustmentRecordDTO.getInventoryAdjustmentId() != null){ + return toAjax(inventoryAdjustmentRecordApplicationService.update(inventoryAdjustmentRecordDO)); + } else { + return toAjax(inventoryAdjustmentRecordApplicationService.insert(inventoryAdjustmentRecordDO)); + } + } + + /** + * 批量删除库存调整记录 + */ + @ApiOperation("批量删除库存调整记录") + @DeleteMapping("/deleteByIds/{inventoryAdjustmentIds}") + public AjaxResult delete(@PathVariable Long[] inventoryAdjustmentIds) + { + return toAjax(inventoryAdjustmentRecordApplicationService.delete(inventoryAdjustmentIds)); + } + + /** + * 获取库存调整记录详细信息 + */ + @ApiOperation("获取库存调整记录") + @GetMapping(value = "/getInfo/{inventoryAdjustmentId}") + public AjaxResult getInfo(@PathVariable("inventoryAdjustmentId") Long inventoryAdjustmentId) + { + return AjaxResult.success(inventoryAdjustmentRecordApplicationService.getInfo(inventoryAdjustmentId)); + } + + /** + * @description:库存调整 + * @param inventoryAdjustmentRecordDTO + * @return: com.mhd.common.core.web.domain.AjaxResult + * @author: lianzj + * @time: 2024-07-18 9:28:47 + */ +// @ApiOperation("库存调整") +// @PostMapping("/inventoryAdjust") +// public AjaxResult inventoryAdjust(@RequestBody ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO) +// { +// //转换实体 +// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO); +// return AjaxResult.success(inventoryAdjustmentRecordApplicationService.inventoryAdjust(inventoryAdjustmentRecordDO)); +// } + + + /** + * @description:库存冻结 + * @param inventoryAdjustmentRecordDTO + * @return: com.mhd.common.core.web.domain.AjaxResult + * @author: lianzj + * @time: 2024-07-18 14:57:51 + */ +// @ApiOperation("库存冻结") +// @PostMapping("/inventoryFrozen") +// public AjaxResult inventoryFrozen(@RequestBody ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO) +// { +// //转换实体 +// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO); +// return AjaxResult.success(inventoryAdjustmentRecordApplicationService.inventoryFrozenForAll(inventoryAdjustmentRecordDO)); +// } + + + + + +} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reservationMaterialInventory/ReservationMaterialInventoryApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reservationMaterialInventory/ReservationMaterialInventoryApi.java new file mode 100644 index 000000000..398cce5d8 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reservationMaterialInventory/ReservationMaterialInventoryApi.java @@ -0,0 +1,194 @@ +package com.mhd.oms.interfaces.facade.reservationMaterialInventory; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.mhd.common.core.domain.po.UserPo; +import com.mhd.common.core.utils.StringUtils; +import com.mhd.common.core.web.controller.BaseController; +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO; +import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDTO; +import com.mhd.oms.domain.reservationMaterialInventory.service.ReservationMaterialInventoryApplicationService; +import com.mhd.oms.domain.reservationMaterialInventory.service.ReservationMaterialInventoryAssembler; +import com.mhd.system.api.UserServiceFeign; +import com.mhd.system.api.domain.MaterialInventoryDTO; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; +import com.mhd.system.api.domain.MaterialInventoryPO; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 物料库存Api + * + * @author gen + * @date 2024-05-29 + */ +@RestController +@RequestMapping("/materialInventoryApi") +@Slf4j +public class ReservationMaterialInventoryApi extends BaseController { + @Autowired + private ReservationMaterialInventoryApplicationService materialInventoryApplicationService; + + @Resource + private ReservationMaterialInventoryAssembler materialInventoryAssembler; + + @Autowired + private UserServiceFeign userServiceFeign; + + /** + * 分页查询物料库存列表 + */ + @ApiOperation("查询物料库存列表") + @GetMapping("/list") + public TableDataInfo list(ReservationMaterialInventoryDTO materialInventoryDTO, + @RequestParam(value = "customerName", required = false) String customerName) + { + // 出库分配前端传的是客户名称 customerName,这里通过名称查询货主ID,使用精确匹配(不模糊匹配) + String shipperName = null; // 保存查询到的货主名称 + if (StringUtils.isNotBlank(customerName) && materialInventoryDTO.getShipperId() == null) { + try { + AjaxResult ajaxResult = userServiceFeign.getInfoByName(customerName); + if ("200".equals(String.valueOf(ajaxResult.get("code"))) && ajaxResult.get("data") != null) { + UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class); + if (userPo != null && userPo.getUserId() != null) { + materialInventoryDTO.setShipperId(userPo.getUserId()); + // 获取货主名称:优先使用企业名称,如果没有则使用用户名称 + shipperName = StringUtils.isNotBlank(userPo.getShipperEnterpriseName()) + ? userPo.getShipperEnterpriseName() + : userPo.getUserName(); + log.info("根据客户名称查询到货主信息,客户名称:{},货主ID:{},货主名称:{}", + customerName, userPo.getUserId(), shipperName); + } + } + } catch (Exception e) { + log.warn("根据客户名称查询货主ID失败,客户名称:{},错误:{}", customerName, e.getMessage()); + } + } + + //转换实体 + ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO); + startPage(); + // 使用带批次属性的查询方法,批次属性值从库存表中获取 + List list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO); + // 按更新时间倒序排序;update_time 为空的数据放最后 + list.sort((o1, o2) -> { + Date t1 = o1.getUpdateTime(); + Date t2 = o2.getUpdateTime(); + if (t1 == null && t2 == null) return 0; + if (t1 == null) return 1; + if (t2 == null) return -1; + return t2.compareTo(t1); // desc + }); + TableDataInfo tableDataInfo = getDataTable(list); + return tableDataInfo; + } + + @ApiOperation("查询物料库存列表不分页") + @GetMapping("/listAll") + public TableDataInfo listAll(ReservationMaterialInventoryDTO materialInventoryDTO) + { + //转换实体 + ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO); + List list = materialInventoryApplicationService.queryList(materialInventoryDO); + return getDataTable(list); + } + + /** + * 编辑物料库存 + */ + @ApiOperation("编辑物料库存") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody ReservationMaterialInventoryDTO materialInventoryDTO) + { + //转换实体 + ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDOByEdit(materialInventoryDTO); + if(materialInventoryDTO.getMaterialInventoryId() != null){ + return toAjax(materialInventoryApplicationService.update(materialInventoryDO)); + }else { + // 新增时补齐更新时间(update_time),避免新增数据 update_time 为空 + materialInventoryDO.setUpdateTime(new Date()); + // update_by/update_by_name 与 create_by/create_by_name 保持一致 + materialInventoryDO.setUpdateBy(materialInventoryDO.getCreateBy()); + materialInventoryDO.setUpdateByName(materialInventoryDO.getCreateByName()); + return toAjax(materialInventoryApplicationService.insert(materialInventoryDO)); + } + } + + /** + * 批量删除物料库存 + */ + @ApiOperation("批量删除物料库存") + @DeleteMapping("/deleteByIds/{materialInventoryIds}") + public AjaxResult delete(@PathVariable Long[] materialInventoryIds) + { + return toAjax(materialInventoryApplicationService.delete(materialInventoryIds)); + } + + /** + * 获取物料库存详细信息 + */ + @ApiOperation("获取物料库存") + @GetMapping(value = "/getInfo/{materialInventoryId}") + public AjaxResult getInfo(@PathVariable("materialInventoryId") Long materialInventoryId) + { + return AjaxResult.success(materialInventoryApplicationService.getInfo(materialInventoryId)); + } + + + + /** + * 根据库位Id和物料基础信息Id 获取物料库存详细信息 + */ + @ApiOperation("根据库位Id和物料基础信息Id 获取物料库存详细信息") + @GetMapping(value = "/getInventory/{storageLocationId}/{materialBaseInfoId}") + public AjaxResult getInventoryByStorageLocationIdAndMaterialBaseInfoId(@PathVariable("storageLocationId") Long storageLocationId, @PathVariable("materialBaseInfoId") Long materialBaseInfoId) + { + return AjaxResult.success(materialInventoryApplicationService.getInventoryByStorageLocationIdAndMaterialBaseInfoId(storageLocationId, materialBaseInfoId)); + } + + + + /** + * 分页库存列表 + */ +// @ApiOperation("查询库存列表") +// @GetMapping("/queryList") +// public TableDataInfo queryList(MaterialInventoryQueryListDTO materialInventoryQueryListDTO) +// { +// //转换实体 +// MaterialInventoryQueryListDO materialInventoryQueryListDO = materialInventoryAssembler.toDOByQueryList(materialInventoryQueryListDTO); +// startPage(); +// List list = materialInventoryApplicationService.materialQueryList(materialInventoryQueryListDO); +// return getDataTable(list); +// } + + @ApiOperation("查询物料库存数量") + @GetMapping("/sumInventoryQuantity") + public AjaxResult sumInventoryQuantity(ReservationMaterialInventoryDTO materialInventoryDTO) + { + //转换实体 + ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO); + return AjaxResult.success(materialInventoryApplicationService.sumInventoryQuantity(materialInventoryDO)); + } + + /** + * 编辑物料库存 + */ + @ApiOperation("编辑物料库存") + @PostMapping("/omsEdit") + public AjaxResult omsEdit(@RequestBody MaterialInventoryOmsParamDO materialInventoryOmsParamDO) + { + materialInventoryApplicationService.omsEdit(materialInventoryOmsParamDO); + return AjaxResult.success(); + } + +} \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/reservationInventoryAdjustmentRecord/InventoryAdjustmentRecordMapper.xml b/mhd_oms/src/main/resources/mapper/reservationInventoryAdjustmentRecord/InventoryAdjustmentRecordMapper.xml new file mode 100644 index 000000000..6dec04c8d --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/reservationInventoryAdjustmentRecord/InventoryAdjustmentRecordMapper.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select a.inventory_adjustment_id, a.organization_id, a.organization_name, a.top_organization_id, a.material_inventory_id, + a.material_base_info_id, a.material_code, a.material_name, a.bar_code, a.shipper_id, a.shipper_name, a.warehouse_id, + a.warehouse_code, a.warehouse_name, a.storage_section_id, a.storage_code, a.storage_name, a.storage_location_id, + a.storage_location_code, a.storage_location_name, a.adjust_type, a.adjust_direction, a.adjust_before_status_code, + a.adjust_before_status_name, a.adjust_after_status_code, a.adjust_after_status_name, a.inventory_before_quantity, + a.allocation_before_quantity, a.freeze_before_quantity, a.inventory_after_quantity, a.allocation_after_quantity, + a.freeze_after_quantity, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, + a.del_flag,a.net_weight, + a.gross_weight, + a.volume, + a.area, + a.adjusted_net_weight, + a.adjusted_gross_weight, + a.adjusted_volume, + a.adjusted_area, + b.ext_attr_1, b.ext_attr_2, b.ext_attr_3, b.ext_attr_4, + b.production_date, b.expiry_date, b.inventory_date, + b.batch_ref_no, b.sheet_ref_no, b.box_pallet_no,a.ADJUST_ACTION,a.RELATE_NO, + a.in_order_number,a.lot_number,b.batch_number + from inventory_adjustment_record a left join material_inventory b on a.material_inventory_id = b.material_inventory_id + where a.del_flag = 1 + + + + + and a.organization_id = #{organizationId} + + + and a.organization_name like concat('%', #{organizationName}, '%') + + + and a.top_organization_id = #{topOrganizationId} + + + and a.material_base_info_id = #{materialBaseInfoId} + + + and a.material_inventory_id = #{materialInventoryId} + + + and a.material_code = #{materialCode} + + + and a.adjust_action = #{adjustAction} + + + and a.relate_no = #{relateNo} + + + and a.material_name like concat('%', #{materialName}, '%') + + + and a.bar_code = #{barCode} + + + and a.shipper_id = #{shipperId} + + + and a.shipper_name like concat('%', #{shipperName}, '%') + + + and a.warehouse_id = #{warehouseId} + + + and a.warehouse_code = #{warehouseCode} + + + and a.warehouse_name like concat('%', #{warehouseName}, '%') + + + and a.storage_section_id = #{storageSectionId} + + + and a.storage_code = #{storageCode} + + + and a.storage_name like concat('%', #{storageName}, '%') + + + and a.storage_location_id = #{storageLocationId} + + + and a.storage_location_code = #{storageLocationCode} + + + and a.storage_location_name like concat('%', #{storageLocationName}, '%') + + + and a.adjust_type = #{adjustType} + + + and a.adjust_direction = #{adjustDirection} + + + and a.adjust_before_status_code = #{adjustBeforeStatusCode} + + + and a.adjust_before_status_name = #{adjustBeforeStatusName} + + + and a.adjust_after_status_code = #{adjustAfterStatusCode} + + + and a.adjust_after_status_name = #{adjustAfterStatusName} + + + and a.inventory_before_quantity = #{inventoryBeforeQuantity} + + + and a.allocation_before_quantity = #{allocationBeforeQuantity} + + + and a.freeze_before_quantity = #{freezeBeforeQuantity} + + + and a.inventory_after_quantity = #{inventoryAfterQuantity} + + + and a.allocation_after_quantity = #{allocationAfterQuantity} + + + and a.freeze_after_quantity = #{freezeAfterQuantity} + + + and a.create_by_name like concat('%', #{createByName}, '%') + + + and a.update_by_name like concat('%', #{updateByName}, '%') + + order by a.create_time desc + + + + \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml b/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml new file mode 100644 index 000000000..dddb25bcb --- /dev/null +++ b/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id, + a.shipper_id, a.shipper_code, a.shipper_name, + a.warehouse_id, a.warehouse_code, a.warehouse_name, + a.storage_section_id, a.storage_code, a.storage_name, a.storage_location_id, a.storage_location_code, a.storage_location_name, a.material_base_info_id,a.material_detail_id, + a.batch_number,a.material_status_code,a.material_status_name,a.container_id,a.container_code,a.container_type,a.container_type_name + ,IFNULL (sum(a.freeze_quantity), 0) freeze_quantity,a.is_able, + IFNULL (sum(a.inventory_quantity), 0) inventory_quantity, + IFNULL (sum(a.allocation_quantity), 0) allocation_quantity, + a.remark, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, + a.del_flag,a.unit, + IFNULL (sum(a.area), 0) area, + IFNULL (sum(a.NET_WEIGHT), 0) NET_WEIGHT, + IFNULL (sum(a.GROSS_WEIGHT), 0) GROSS_WEIGHT, + IFNULL (sum(a.VOLUME), 0) VOLUME, + a.ext_attr_1, a.ext_attr_2, a.ext_attr_3, a.ext_attr_4, + a.production_date, a.expiry_date, a.inventory_date, + a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name, + a.bar_code as inv_bar_code, + a.in_order_number,a.lot_number + + + + + and a.material_inventory_id = #{materialInventoryId} + + + and a.organization_id = #{organizationId} + + + and a.organization_name like concat('%', #{organizationName}, '%') + + + and a.top_organization_id = #{topOrganizationId} + + + and a.warehouse_id = #{warehouseId} + + + and a.shipper_id = #{shipperId} + + + and a.warehouse_code = #{warehouseCode} + + + and a.warehouse_name like concat('%', #{warehouseName}, '%') + + + and a.storage_section_id = #{storageSectionId} + + + and a.storage_code = #{storageCode} + + + and a.storage_name like concat('%', #{storageName}, '%') + + + and a.storage_location_id = #{storageLocationId} + + + and a.storage_location_code = #{storageLocationCode} + + + and a.storage_location_name like concat('%', #{storageLocationName}, '%') + + + and a.material_base_info_id = #{materialBaseInfoId} + + + and a.material_detail_id, = #{materialDetailId} + + + + + and (a.container_code like concat('%', #{containerOrBatch}, '%') or a.batch_number like concat('%', #{containerOrBatch}, '%')) + + + and (a.batch_number like concat('%', #{batchNumber}, '%') or a.container_code like concat('%', #{containerCode}, '%')) + + + + and a.batch_number like concat('%', #{batchNumber}, '%') + + + and a.container_code like concat('%', #{containerCode}, '%') + + + + + and a.material_status_code like concat('%', #{materialStatusCode}, '%') + + + and a.material_status_name like concat('%', #{materialStatusName}, '%') + + + and a.container_id = #{containerId} + + + and a.container_type like concat('%', #{containerType}, '%') + + + and a.container_type_name like concat('%', #{containerTypeName}, '%') + + + and a.inventory_quantity = #{inventoryQuantity} + and a.inventory_quantity != 0 + + + and a.allocation_quantity = #{allocationQuantity} + + + and a.freeze_quantity = #{freezeQuantity} + + + + and a.create_by_name like concat('%', #{createByName}, '%') + + + and a.update_by_name like concat('%', #{updateByName}, '%') + + + and a.del_flag = #{delFlag} + and a.del_flag = 1 + + + and (a.storage_location_code = #{storageInfo} or material_code = #{storageInfo} or material_name like concat('%', #{storageInfo}, '%') or bar_code = #{storageInfo}) + + + and a.BATCH_REF_NO like concat('%', #{batchRefNo}, '%') + + + and a.SHEET_REF_NO like concat('%', #{sheetRefNo}, '%') + + + and a.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%') + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + group by a.shipper_id + order by max(a.shipper_name) + + + group by b.material_base_info_id, a.shipper_id + order by max(b.material_name), max(a.shipper_name) + + + group by b.material_base_info_id, a.shipper_id, a.batch_number + order by max(b.material_name), max(a.shipper_name), a.batch_number + + + group by a.storage_location_id + order by max(a.storage_location_code) + + + group by b.material_base_info_id, a.storage_location_id, a.shipper_id + order by max(b.material_name), max(a.storage_location_code), max(a.shipper_name) + + + group by a.container_id, a.container_code, a.container_type, a.container_type_name + order by a.container_type_name, b.material_name, a.storage_location_name + + + group by a.material_inventory_id + order by a.shipper_name, b.material_name, a.storage_location_name, a.batch_number + + + + + + + + + + + + + \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java index 78088622d..44ef09502 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java @@ -8,6 +8,8 @@ import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.utils.OrderSequence; import com.mhd.common.core.utils.bean.BeanUtils; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.OmsServiceFeign; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; import com.mhd.system.api.model.LoginUser; import com.mhd.wms.domain.copyCodeReference.entity.CopyCodeReference; import com.mhd.wms.domain.copyCodeReference.repository.facade.ICopyCodeReferenceService; @@ -79,6 +81,8 @@ public class HandoverTaskOrderDomainService { private IStockOutOrderService stockOutOrderService; @Autowired private CopyCodeReferenceDomainService copyCodeReferenceDomainService; + @Autowired + private OmsServiceFeign omsServiceFeign; /** @@ -423,6 +427,12 @@ public class HandoverTaskOrderDomainService { materialInventoryParamDO.setType("4"); materialInventoryService.kctzjl(materialInventoryParamDO,"出库",loginUser); materialInventoryService.xgkc(materialInventoryParamDO); + MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO(); + BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO); + materialInventoryOmsParamDO.setKctzType("出库"); + materialInventoryOmsParamDO.setLoginUser(loginUser); + //库存推送oms + omsServiceFeign.omsEdit(materialInventoryOmsParamDO); //库存调整记录 // InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord(); // inventoryAdjustmentRecord.setAdjustAction("出库"); diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java index 5afbda11b..e8cf5ed71 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java @@ -11,6 +11,7 @@ import com.mhd.common.core.web.domain.BaseVOEntity; import com.mhd.common.security.utils.SecurityUtils; import com.mhd.system.api.OmsServiceFeign; import com.mhd.system.api.domain.InMaterialDetail; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; import com.mhd.system.api.domain.OutMaterialDetail; import com.mhd.system.api.domain.StockOutOrder; import com.mhd.system.api.model.LoginUser; @@ -466,6 +467,11 @@ public class InventoryAdjustmentRecordDomainService { materialInventoryParamDO.setType("7"); materialInventoryService.kctzjl(materialInventoryParamDO,"库存冻结",loginUser); materialInventoryService.xgkc(materialInventoryParamDO); + MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO(); + BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO); + materialInventoryOmsParamDO.setKctzType("库存冻结"); + materialInventoryOmsParamDO.setLoginUser(loginUser); + omsServiceFeign.omsEdit(materialInventoryOmsParamDO); return true; } catch (Exception e) { e.printStackTrace(); 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 f61eff64e..2a483b3f5 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 @@ -13,6 +13,8 @@ import com.mhd.common.core.utils.StringUtils; import com.mhd.common.core.utils.bean.BeanUtils; import com.mhd.common.core.utils.uuid.IdGenerator; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.OmsServiceFeign; +import com.mhd.system.api.domain.MaterialInventoryOmsParamDO; import com.mhd.system.api.model.LoginUser; import com.mhd.wms.domain.copyCodeReference.entity.CopyCodeReference; import com.mhd.wms.domain.copyCodeReference.repository.facade.ICopyCodeReferenceService; @@ -84,6 +86,8 @@ public class OutMaterialDetailImpl extends ServiceImpl Date: Wed, 22 Apr 2026 14:52:23 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E6=8B=A3=E8=B4=A7=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E7=BC=BA=E5=B0=91=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mhd_wms/sql/pdaSql.sql | 8 +++++++ .../entity/PickingMaterialDetail.java | 4 ++++ .../po/PickingMaterialDetailPO.java | 3 +++ .../todo/PickingMaterialDetailDO.java | 4 ++++ .../repository/po/PickingOrderPO.java | 24 +++++++++++++++++++ .../repository/todo/PickingOrderDO.java | 24 +++++++++++++++++++ .../PickingMaterialDetailMapper.xml | 4 +++- .../pickingOrder/PickingOrderMapper.xml | 8 ++++++- 8 files changed, 77 insertions(+), 2 deletions(-) diff --git a/mhd_wms/sql/pdaSql.sql b/mhd_wms/sql/pdaSql.sql index ed9e05c1e..fdaa5ddb3 100644 --- a/mhd_wms/sql/pdaSql.sql +++ b/mhd_wms/sql/pdaSql.sql @@ -44,5 +44,13 @@ ALTER TABLE NGWL_TEST_WMS.SHELF_MATERIAL_DETAIL ADD OMS_IN_MATERIAL_DETAIL varch ALTER TABLE NGWL_TEST_OMS.RESERVATION_IN_MATERIAL_DETAIL ADD INBOUND_ITEMS varchar(100) NULL; ALTER TABLE NGWL_TEST_OMS.RESERVATION_OUT_MATERIAL_DETAIL ADD INBOUND_ITEMS varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.STOCK_RECEIPT_ORDER ADD BUSINESS_ORDER_NO varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD BUSINESS_ORDER_NO varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD OUT_ORDER_NUMBER varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD ORDER_TYPE_CODE varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD ORDER_TYPE_NAME varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD PRIORITY_LEVEL_CODE varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD PRIORITY_LEVEL_NAME varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_MATERIAL_DETAIL ADD lotNo varchar(100) NULL; + diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java index 0e1f8eb87..c7801c0b1 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java @@ -291,4 +291,8 @@ public class PickingMaterialDetail extends BaseVOEntity { @ApiModelProperty("已拣抄码对照id(逗号分隔,乱序拣货用)") @Excel(name = "已拣抄码对照id") private String pickedCopyCodeReferenceIds; + + @ApiModelProperty("lot编号") + @Excel(name = "lot编号") + private String lotNo; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/po/PickingMaterialDetailPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/po/PickingMaterialDetailPO.java index 2eb7ff4d5..8bdff5c5a 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/po/PickingMaterialDetailPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/po/PickingMaterialDetailPO.java @@ -321,4 +321,7 @@ public class PickingMaterialDetailPO extends BaseVOEntity { @TableField(exist = false) private List weightList; + @ApiModelProperty("LOT编码2") + private String lotNo; + } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java index 3a2bda4e7..4c0efd050 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java @@ -298,4 +298,8 @@ public class PickingMaterialDetailDO extends BaseVOEntity { @ApiModelProperty("已拣抄码对照id(逗号分隔,合并写入)") private String pickedCopyCodeReferenceIds; + + @ApiModelProperty("lot编号") + @Excel(name = "lot编号") + private String lotNo; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/po/PickingOrderPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/po/PickingOrderPO.java index cd41e9b41..a6a317102 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/po/PickingOrderPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/po/PickingOrderPO.java @@ -122,6 +122,30 @@ public class PickingOrderPO extends StockOutOrderBasePO { @ApiModelProperty("物料明细") private List materialDetailList; + @ApiModelProperty("出库单号") + @Excel(name = "出库单号") + private String outOrderNumber; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String businessOrderNo; + + @ApiModelProperty("出库单类型编码") + @Excel(name = "出库单类型编码") + private String orderTypeCode; + + @ApiModelProperty("出库单类型名称") + @Excel(name = "出库单类型名称") + private String orderTypeName; + + @ApiModelProperty("优先级别编码") + @Excel(name = "优先级别编码") + private String priorityLevelCode; + + @ApiModelProperty("优先级别名称") + @Excel(name = "优先级别名称") + private String priorityLevelName; + } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/todo/PickingOrderDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/todo/PickingOrderDO.java index 26f598f16..6d69bc094 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/todo/PickingOrderDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/repository/todo/PickingOrderDO.java @@ -168,4 +168,28 @@ public class PickingOrderDO extends BaseVOEntity { @ApiModelProperty("作业拣货物料种数(当前拣货作业物料种数)") @Excel(name = "作业拣货物料种数(当前拣货作业物料种数)") private Integer actualPickingMaterialQuantity; + + @ApiModelProperty("出库单号") + @Excel(name = "出库单号") + private String outOrderNumber; + + @ApiModelProperty("业务单号") + @Excel(name = "业务单号") + private String businessOrderNo; + + @ApiModelProperty("出库单类型编码") + @Excel(name = "出库单类型编码") + private String orderTypeCode; + + @ApiModelProperty("出库单类型名称") + @Excel(name = "出库单类型名称") + private String orderTypeName; + + @ApiModelProperty("优先级别编码") + @Excel(name = "优先级别编码") + private String priorityLevelCode; + + @ApiModelProperty("优先级别名称") + @Excel(name = "优先级别名称") + private String priorityLevelName; } diff --git a/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml b/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml index 88f8ad258..f47a431f7 100644 --- a/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml +++ b/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml @@ -64,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -81,7 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.total_area, a.total_gross_weight, a.total_net_weight, a.total_volume, a.out_unique_id, a.COPY_CODE_REFERENCE_IDS, a.picked_copy_code_reference_ids, - omd.in_order_number, omd.lot_no as lot_number + omd.in_order_number, omd.lot_no as lot_number, + a.lot_No diff --git a/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml b/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml index 152f67423..470bfba95 100644 --- a/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/pickingOrder/PickingOrderMapper.xml @@ -26,6 +26,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + @@ -34,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.status, a.type, a.warehouse_id, a.warehouse_code, a.warehouse_name, a.shipper_id, a.shipper_name, a.quantity, a.weight_limit, a.volume_limit, a.material_quantity, IFNULL((SELECT SUM(b.picking_quantity) FROM picking_material_detail b WHERE b.picking_order_number = a.picking_order_number AND b.del_flag = 1), 0) AS picking_quantity, a.picking_material_quantity, a.abnormal, a.task_distribution, a.remark, a.create_time, a.create_by, a.create_by_name, a.update_time, - a.update_by, a.update_by_name, a.del_flag + a.update_by, a.update_by_name, a.del_flag,a.out_order_number, a.business_order_no, a.order_type_code, a.order_type_name, a.priority_level_code, a.priority_level_name From f11c7aad9a133b4001b17e98b302035913f1df2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 22 Apr 2026 15:16:59 +0800 Subject: [PATCH 12/22] =?UTF-8?q?sql=E6=8A=A5=E9=94=99=E4=BF=AE=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialInventoryMapper.xml | 84 ++++++++++++++++--- 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml b/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml index dddb25bcb..5118ae68b 100644 --- a/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml @@ -66,6 +66,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + ,b.shipper_id AS base_shipper_id, + b.shipper_code AS base_shipper_code, + b.shipper_name AS base_shipper_name, + b.material_code, + b.material_name, + b.bar_code, + b.material_classify_code, + b.material_classify_name, + b.material_type, + b.material_type_name, + b.common, + b.pack_id, + b.pack_code, + b.pack_name + + + + + + and b.shipper_id = #{shipperId} + + + and b.shipper_code like concat('%', #{shipperCode}, '%') + + + and b.shipper_name like concat('%', #{shipperName}, '%') + + + and b.material_code = #{materialCode} + + + and b.material_name like concat('%', #{materialName}, '%') + + + and b.bar_code = #{barCode} + + + + FIND_IN_SET(#{code}, b.material_classify_code) > 0 + + + + + b.material_classify_name like concat('%', #{name}, '%') + + + + and b.material_type = #{materialType} + + + and b.material_type_name like concat('%', #{materialTypeName}, '%') + + + and (b.shipper_code like concat('%', #{shipperInfo}, '%') or b.shipper_name like concat('%', #{shipperInfo}, '%')) + + + and (b.material_code = #{materialInfo} or b.material_name like concat('%', #{materialInfo}, '%') or b.bar_code = #{materialInfo}) + + + a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id, @@ -208,12 +272,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -221,12 +285,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -234,12 +298,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -247,12 +311,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -260,12 +324,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" From 39f1a6d891a239cd29554ac49f4422196ad83438 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 15:17:20 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=A4=8D=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mhd_wms/sql/pdaSql.sql | 5 ++++ .../service/ReviewOrderDomainService.java | 8 ++++++- .../entity/ReviewMaterialDetail.java | 24 +++++++++++++++++++ .../mapper/reviewOrder/ReviewOrderMapper.xml | 3 ++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/mhd_wms/sql/pdaSql.sql b/mhd_wms/sql/pdaSql.sql index fdaa5ddb3..f4fc20c89 100644 --- a/mhd_wms/sql/pdaSql.sql +++ b/mhd_wms/sql/pdaSql.sql @@ -51,6 +51,11 @@ ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD ORDER_TYPE_NAME varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD PRIORITY_LEVEL_CODE varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.PICKING_ORDER ADD PRIORITY_LEVEL_NAME varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.PICKING_MATERIAL_DETAIL ADD lotNo varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_ID varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_CODE varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_NAME varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_DETAIL_ID varchar(100) NULL; + diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java index 2e75023fb..4180927fb 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingOrder/service/ReviewOrderDomainService.java @@ -163,7 +163,7 @@ public class ReviewOrderDomainService { if (reviewOrderId == null) { throw new ServiceException("复核单主表保存失败"); } - + String outOrderNumber1 = stockOutOrder.getOutOrderNumber(); int detailInserted = 0; for (PickingOrder po : pickingOrders) { List lines = pickingMaterialDetailService.list(new LambdaQueryWrapper() @@ -175,6 +175,7 @@ public class ReviewOrderDomainService { continue; } ReviewMaterialDetail row = buildDetailFromPicking(line, reviewOrderId, reviewOrderNumber, outOrderNumber, loginUser, now); + row.setOutOrderNumber(outOrderNumber1); reviewMaterialDetailMapper.insert(row); detailInserted++; } @@ -211,6 +212,11 @@ public class ReviewOrderDomainService { d.setBarCode(line.getBarCode()); d.setUnitCode(line.getUnitCode()); d.setUnitName(line.getUnitName()); + d.setLotNo(line.getLotNo()); + d.setPackId(String.valueOf(line.getPackId())); + d.setPackCode(line.getPackCode()); + d.setPackName(line.getPackName()); + d.setPackDetailId(String.valueOf(line.getPackDetailId())); BigDecimal pending = line.getPickingQuantity() != null ? line.getPickingQuantity() : line.getQuantity(); if (pending == null) { diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java index 91cc15d6b..b7ed7fb08 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/reviewOrder/entity/ReviewMaterialDetail.java @@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.mhd.common.core.annotation.Excel; import com.mhd.common.core.web.domain.BaseVOEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.util.Date; @@ -54,6 +58,10 @@ public class ReviewMaterialDetail extends BaseVOEntity { private String batchNumber; + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date productionDate; private Date expiryDate; @@ -89,4 +97,20 @@ public class ReviewMaterialDetail extends BaseVOEntity { private BigDecimal areaSqm; private String remark; + + @ApiModelProperty("包装规格id") + @Excel(name = "包装规格id") + private String packId; + + @ApiModelProperty("包装规格编码") + @Excel(name = "包装规格编码") + private String packCode; + + @ApiModelProperty("包装规格名称") + @Excel(name = "包装规格名称") + private String packName; + + @ApiModelProperty("包装详情id") + @Excel(name = "包装详情id") + private String packDetailId; } diff --git a/mhd_wms/src/main/resources/mapper/reviewOrder/ReviewOrderMapper.xml b/mhd_wms/src/main/resources/mapper/reviewOrder/ReviewOrderMapper.xml index 4c3727d08..45e447da6 100644 --- a/mhd_wms/src/main/resources/mapper/reviewOrder/ReviewOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/reviewOrder/ReviewOrderMapper.xml @@ -233,7 +233,8 @@ d.update_by, d.update_by_name, d.update_time, - d.del_flag + d.del_flag, + d.pack_id, d.pack_code, d.pack_name, d.pack_detail_id From 882aa8740e043affd67525a5c3a4c135b8890170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Wed, 22 Apr 2026 15:21:36 +0800 Subject: [PATCH 14/22] =?UTF-8?q?bug=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ssociationWarehouseApplicationService.java | 41 ++----------------- .../persistence/AssociationWarehouseImpl.java | 15 ++++++- .../AssociationWarehouseApi.java | 6 +-- .../AssociationWarehouseMapper.xml | 3 ++ 4 files changed, 23 insertions(+), 42 deletions(-) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/associationWarehouse/AssociationWarehouseApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/associationWarehouse/AssociationWarehouseApplicationService.java index fe77199d9..21ca62aba 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/associationWarehouse/AssociationWarehouseApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/associationWarehouse/AssociationWarehouseApplicationService.java @@ -17,7 +17,6 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.stream.Collectors; /** @@ -73,36 +72,6 @@ public class AssociationWarehouseApplicationService { } } - /** - * 排除「默认仓」关联(is_default=2),与 Mapper 条件双保险,避免 OGNL/参数未绑定导致仍查出默认行。 - */ - private List filterExcludeDefaultWarehouse( - AssociationWarehouseDO associationWarehouseDO, - List list) { - if (!Boolean.TRUE.equals(associationWarehouseDO.getExcludeDefaultWarehouse()) - || list == null || list.isEmpty()) { - return list; - } - return list.stream() - .filter(po -> po.getIsDefault() == null || !Objects.equals(po.getIsDefault(), 2)) - .collect(Collectors.toList()); - } - - /** - * 按「组织 + 仓库」查该仓下全部绑定(未带 correlationId)时,默认排除新建仓自动产生的默认仓关联(is_default=2)。 - * 需要保留时显式传 excludeDefaultWarehouse=false。 - * 仅在没有显式指定 excludeDefaultWarehouse 时生效。 - */ - private void applyDefaultExcludeForWarehouseBindList(AssociationWarehouseDO associationWarehouseDO) { - if (associationWarehouseDO.getExcludeDefaultWarehouse() != null) { - return; - } - if (associationWarehouseDO.getWarehouseId() != null - && associationWarehouseDO.getCorrelationId() == null) { - associationWarehouseDO.setExcludeDefaultWarehouse(true); - } - } - /** * 分页查询关联仓库列表 */ @@ -128,16 +97,14 @@ public class AssociationWarehouseApplicationService { associationWarehousePO.setTopOrganizationId(warehousePO.getTopOrganizationId()); associationWarehousePOList.add(associationWarehousePO); }); - return filterExcludeDefaultWarehouse(associationWarehouseDO, associationWarehousePOList); + return associationWarehousePOList; }else { applyAssociationWarehouseOrgScope(associationWarehouseDO, loginUser); // 未指定仓库时:只查当前登录人在关联表中的记录;指定了 warehouseId 时:查该仓下全部绑定(绑定用户列表),勿收窄为当前用户 if (associationWarehouseDO.getWarehouseId() == null) { associationWarehouseDO.setCorrelationId(loginUser.getUserid()); } - applyDefaultExcludeForWarehouseBindList(associationWarehouseDO); - return filterExcludeDefaultWarehouse(associationWarehouseDO, - associationWarehouseDomainService.queryList(associationWarehouseDO)); + return associationWarehouseDomainService.queryList(associationWarehouseDO); } } @@ -146,9 +113,7 @@ public class AssociationWarehouseApplicationService { if (loginUser != null && loginUser.getUserPo() != null) { applyAssociationWarehouseOrgScope(associationWarehouseDO, loginUser); } - applyDefaultExcludeForWarehouseBindList(associationWarehouseDO); - List associationWarehousePOList = filterExcludeDefaultWarehouse(associationWarehouseDO, - associationWarehouseDomainService.queryList(associationWarehouseDO)); + List associationWarehousePOList = associationWarehouseDomainService.queryList(associationWarehouseDO); return associationWarehousePOList.stream() .map(AssociationWarehousePO::getCorrelationId) .collect(Collectors.toList()); diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java index c50c93e9d..dc3fc8eb6 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/associationWarehouse/repository/persistence/AssociationWarehouseImpl.java @@ -133,17 +133,30 @@ public class AssociationWarehouseImpl extends ServiceImpl list = new ArrayList<>(); for (Long id : associationWarehouseIds) { + if (id == null) { + continue; + } + AssociationWarehouse row = this.getById(id); + if (row == null) { + continue; + } + if (row.getIsDefault() != null && row.getIsDefault() == 2) { + continue; + } AssociationWarehouse associationWarehouse = new AssociationWarehouse(); associationWarehouse.setAssociationWarehouseId(id); associationWarehouse.setDelFlag(2); list.add(associationWarehouse); } + if (list.isEmpty()) { + return Boolean.TRUE; + } return this.updateBatchById(list); } diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/associationWarehouse/AssociationWarehouseApi.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/associationWarehouse/AssociationWarehouseApi.java index e3616e2dd..2858b2787 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/associationWarehouse/AssociationWarehouseApi.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/facadeApi/associationWarehouse/AssociationWarehouseApi.java @@ -40,9 +40,9 @@ public class AssociationWarehouseApi extends BaseController{ private AssociationWarehouseAssembler associationWarehouseAssembler; /** - * 分页查询关联仓库列表。按组织+仓库(warehouseId)查该仓全部绑定时,默认不返回 is_default=2(默认仓)关联行;需要含该条时传 excludeDefaultWarehouse=false。 + * 分页查询关联仓库列表;含 is_default=2 的默认仓关联。删除时此类记录不可删。 */ - @ApiOperation("查询关联仓库列表(按仓查绑定时默认不含 is_default=2)") + @ApiOperation("查询关联仓库列表") @GetMapping("/list") public AjaxResult list(AssociationWarehouseDTO associationWarehouseDTO) { @@ -52,7 +52,7 @@ public class AssociationWarehouseApi extends BaseController{ return AjaxResult.success(list); } - @ApiOperation("查询仓库关联的用户 id 集合(按仓查时默认不含仅 is_default=2 的绑定)") + @ApiOperation("查询仓库关联的用户 id 集合") @GetMapping("/queryListCorrelationId") public AjaxResult listUser(AssociationWarehouseDTO associationWarehouseDTO) { diff --git a/mhd-modules/mhd-system/src/main/resources/mapper/basic/associationWarehouse/AssociationWarehouseMapper.xml b/mhd-modules/mhd-system/src/main/resources/mapper/basic/associationWarehouse/AssociationWarehouseMapper.xml index cd2d13642..2cb017994 100644 --- a/mhd-modules/mhd-system/src/main/resources/mapper/basic/associationWarehouse/AssociationWarehouseMapper.xml +++ b/mhd-modules/mhd-system/src/main/resources/mapper/basic/associationWarehouse/AssociationWarehouseMapper.xml @@ -49,9 +49,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.warehouse_id = #{warehouseId} + + and a.warehouse_code = #{warehouseCode} From a47e5aafcafbf3650ac3b08701d28c3d46820ab6 Mon Sep 17 00:00:00 2001 From: zhaoqing <1670883518@qq.com> Date: Wed, 22 Apr 2026 15:40:50 +0800 Subject: [PATCH 15/22] =?UTF-8?q?wms-=E6=8A=84=E7=A0=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/copyCodeReference/CopyCodeReferenceDTO.java | 9 +++++++++ .../mapper/copyCodeReference/CopyCodeReferenceMapper.xml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/copyCodeReference/CopyCodeReferenceDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/copyCodeReference/CopyCodeReferenceDTO.java index 1bb18d645..33deb6af3 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/copyCodeReference/CopyCodeReferenceDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/copyCodeReference/CopyCodeReferenceDTO.java @@ -15,6 +15,15 @@ public class CopyCodeReferenceDTO extends BaseVOEntity { @ApiModelProperty("ID") private Long id; + @ApiModelProperty("组织表ID") + private Long organizationId; + + @ApiModelProperty("组织名称") + private String organizationName; + + @ApiModelProperty("一级组织表ID") + private Long topOrganizationId; + @ApiModelProperty("货主ID") private Long shipperId; diff --git a/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml b/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml index 6bf467ab9..433e294d0 100644 --- a/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml +++ b/mhd_wms/src/main/resources/mapper/copyCodeReference/CopyCodeReferenceMapper.xml @@ -125,6 +125,12 @@ AND material_code = #{materialCode} AND batch_number = #{batchNumber} AND box_pallet_no = #{boxPalletNo} + + AND top_organization_id = #{topOrganizationId} + + + AND organization_id = #{organizationId} + ORDER BY serial_number From 6cbbf1305c9c843d02876335015a6884a901a031 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 15:45:40 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=88=86=E9=85=8D?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=AD=98=E5=85=A5=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/todo/OutMaterialDetailDO.java | 9 +++++++++ .../dto/outMaterialDetail/OutMaterialDetailDTO.java | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java index 0e9d62727..a11834637 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/outMaterialDetail/repository/todo/OutMaterialDetailDO.java @@ -1,6 +1,7 @@ package com.mhd.wms.domain.outMaterialDetail.repository.todo; import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.mhd.common.core.annotation.Excel; @@ -8,8 +9,10 @@ import com.mhd.common.core.web.domain.BaseVOEntity; import com.mhd.wms.domain.outMaterialDetailSerialNumber.repository.todo.OutMaterialDetailSerialNumberDO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; +import java.util.Date; import java.util.List; @@ -485,4 +488,10 @@ public class OutMaterialDetailDO extends BaseVOEntity { @ApiModelProperty("取消分配抄码id数组") @Excel(name = "取消分配抄码id数组") private List copyCodeReferenceIdsCancel; + + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outMaterialDetail/OutMaterialDetailDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outMaterialDetail/OutMaterialDetailDTO.java index 3b0900e51..c74e8933f 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outMaterialDetail/OutMaterialDetailDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/outMaterialDetail/OutMaterialDetailDTO.java @@ -1,5 +1,7 @@ package com.mhd.wms.interfaces.dto.outMaterialDetail; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.mhd.common.core.annotation.Excel; @@ -8,8 +10,10 @@ import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO; import com.mhd.wms.interfaces.dto.outMaterialDetailSerialNumber.OutMaterialDetailSerialNumberDTO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; +import java.util.Date; import java.util.List; @@ -475,4 +479,10 @@ public class OutMaterialDetailDTO extends BaseVOEntity { @Excel(name = "取消分配抄码id数组") private List copyCodeReferenceIdsCancel; + @ApiModelProperty("生产日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date productionDate; + } \ No newline at end of file From 1f8b7ef0e865c6b747455ffe1a9ee8781244c12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 22 Apr 2026 15:48:21 +0800 Subject: [PATCH 17/22] =?UTF-8?q?oms=E5=85=A5=E5=BA=93=E5=8D=95=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E9=87=8F;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/ReservationStockInOrder.java | 4 ++++ .../repository/po/ReservationStockInOrderPO.java | 4 ++++ .../repository/todo/ReservationStockInOrderDO.java | 4 ++++ .../repository/todo/ReservationStockInOrderDTO.java | 4 ++++ .../reservationStockInOrder/ReservationStockInOrderMapper.xml | 3 ++- .../mapper/stockShelfOrder/StockShelfOrderMapper.xml | 2 +- 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/entity/ReservationStockInOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/entity/ReservationStockInOrder.java index b6a97cb93..e14ece158 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/entity/ReservationStockInOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/entity/ReservationStockInOrder.java @@ -153,6 +153,10 @@ public class ReservationStockInOrder extends BaseVOEntity { @Excel(name = "计划数量") private BigDecimal quantity; + @ApiModelProperty("入库数量") + @Excel(name = "入库数量") + private BigDecimal inQuantity; + @ApiModelProperty("净重 单位:千克") @Excel(name = "净重 单位:千克") private BigDecimal weightLimit; diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java index 37c553b2c..2cd9e2228 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java @@ -154,6 +154,10 @@ public class ReservationStockInOrderPO extends BaseVOEntity { @Excel(name = "计划数量(原字段)") private BigDecimal quantity; + @ApiModelProperty("入库数量") + @Excel(name = "入库数量") + private BigDecimal inQuantity; + /** * 计划入库数量:取入库单明细中的入库数量汇总 */ diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java index b2f5e4b54..a54360ff5 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java @@ -151,6 +151,10 @@ public class ReservationStockInOrderDO extends BaseVOEntity { @Excel(name = "计划数量") private BigDecimal quantity; + @ApiModelProperty("入库数量") + @Excel(name = "入库数量") + private BigDecimal inQuantity; + @ApiModelProperty("净重 单位:千克") @Excel(name = "净重 单位:千克") private BigDecimal weightLimit; diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java index d019b2074..dff5e4837 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java @@ -149,6 +149,10 @@ public class ReservationStockInOrderDTO extends ReservationStockInOrderBaseDTO { @Excel(name = "计划数量") private BigDecimal quantity; + @ApiModelProperty("入库数量") + @Excel(name = "入库数量") + private BigDecimal inQuantity; + @ApiModelProperty("净重 单位:千克") @Excel(name = "净重 单位:千克") private BigDecimal weightLimit; diff --git a/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml index 650d3edec..aec6f074a 100644 --- a/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml @@ -92,6 +92,7 @@ + @@ -127,7 +128,7 @@ a.TRANSPORT_METHOD, a.SUPERVISION_METHOD, a.CUSTOMS_INSPECTION, a.NEED_CUSTOMS_DECLARATION, a.NEED_TRANSPORT, a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name ,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number - ,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME + ,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity diff --git a/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml index 28412209b..b5b15dc94 100644 --- a/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockShelfOrder/StockShelfOrderMapper.xml @@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update "NGWL_TEST_OMS".RESERVATION_STOCK_IN_ORDER set ISSUE_STATUS = #{status},quantity = #{shelvesQuantity},STORAGE_TIME = CURRENT_TIMESTAMP where IN_ORDER_NUMBER = #{orderNumber} + update "NGWL_TEST_OMS".RESERVATION_STOCK_IN_ORDER set ISSUE_STATUS = #{status},in_quantity = #{shelvesQuantity},STORAGE_TIME = CURRENT_TIMESTAMP where IN_ORDER_NUMBER = #{orderNumber} update "NGWL_TEST_OMS".RESERVATION_IN_MATERIAL_DETAIL set INBOUND_ITEMS = #{shelvesQuantity}, TOTAL_NET_WEIGHT= #{totalNetWeight},STORAGE_TIME = CURRENT_TIMESTAMP where MATERIAL_DETAIL_ID = #{omsInMaterialDetail} From f40ed734ac67426fff3f1e0a08b11dd396270f25 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 16:04:26 +0800 Subject: [PATCH 18/22] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=8F=B7=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mhd_wms/sql/pdaSql.sql | 1 + .../pickingMaterialDetail/entity/PickingMaterialDetail.java | 4 ++++ .../repository/todo/PickingMaterialDetailDO.java | 4 ++++ .../pickingMaterialDetail/PickingMaterialDetailMapper.xml | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mhd_wms/sql/pdaSql.sql b/mhd_wms/sql/pdaSql.sql index f4fc20c89..920387f00 100644 --- a/mhd_wms/sql/pdaSql.sql +++ b/mhd_wms/sql/pdaSql.sql @@ -55,6 +55,7 @@ ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_ID varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_CODE varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_NAME varchar(100) NULL; ALTER TABLE NGWL_TEST_WMS.REVIEW_MATERIAL_DETAIL ADD PACK_DETAIL_ID varchar(100) NULL; +ALTER TABLE NGWL_TEST_WMS.PICKING_MATERIAL_DETAIL ADD IN_ORDER_NUMBER varchar(100) NULL; diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java index c7801c0b1..a4277b9da 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/entity/PickingMaterialDetail.java @@ -295,4 +295,8 @@ public class PickingMaterialDetail extends BaseVOEntity { @ApiModelProperty("lot编号") @Excel(name = "lot编号") private String lotNo; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java index 4c0efd050..d66a493a7 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/todo/PickingMaterialDetailDO.java @@ -302,4 +302,8 @@ public class PickingMaterialDetailDO extends BaseVOEntity { @ApiModelProperty("lot编号") @Excel(name = "lot编号") private String lotNo; + + @ApiModelProperty("入库单号") + @Excel(name = "入库单号") + private String inOrderNumber; } \ No newline at end of file diff --git a/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml b/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml index f47a431f7..11bcd9ca1 100644 --- a/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml +++ b/mhd_wms/src/main/resources/mapper/pickingMaterialDetail/PickingMaterialDetailMapper.xml @@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -83,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.COPY_CODE_REFERENCE_IDS, a.picked_copy_code_reference_ids, omd.in_order_number, omd.lot_no as lot_number, - a.lot_No + a.lot_No,a.in_order_number From f0bb9bcba1234f700c63dc7125511ad5437e9f45 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Wed, 22 Apr 2026 16:15:49 +0800 Subject: [PATCH 19/22] =?UTF-8?q?=E6=8B=A3=E8=B4=A7=E5=8D=95=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=86=99=E5=85=A5=E5=85=A5=E5=BA=93=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/PickingMaterialDetailImpl.java | 3 +++ .../PickingMaterialDetailDTO.java | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/persistence/PickingMaterialDetailImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/persistence/PickingMaterialDetailImpl.java index 324dd000e..d9617bee3 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/persistence/PickingMaterialDetailImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/pickingMaterialDetail/repository/persistence/PickingMaterialDetailImpl.java @@ -184,6 +184,9 @@ public class PickingMaterialDetailImpl extends ServiceImpl Date: Wed, 22 Apr 2026 16:21:16 +0800 Subject: [PATCH 20/22] =?UTF-8?q?bms=E7=94=B3=E8=AF=B7=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/persistence/BmsInvoiceListServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java index 2b058e5a3..5d248fb5c 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java @@ -193,6 +193,10 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl billManageIds = bmsInvoiceListAddDTO.getBillManageIds(); + if (billManageIds != null && billManageIds.size() > 0){ + } else { + billManageIds.add(bmsInvoiceListAddDTO.getBillManageId()); + } List billManages = billManageMapper.selectList(new LambdaQueryWrapper().in(BillManage::getBillManageId, billManageIds)); if (billManages != null && billManages.size() > 0) { for (BillManage billManage : billManages) { From 38fb1c8ce501375f4abcdd14ad2ad56f2ea81be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 22 Apr 2026 16:52:40 +0800 Subject: [PATCH 21/22] =?UTF-8?q?oms=E6=8E=A8=E9=80=81wms=E5=8A=A0?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=B8=81=E7=A7=8D=E4=B8=9A=E5=8A=A1=E5=91=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mhd/system/api/domain/StockInOrder.java | 6 ++++++ .../main/java/com/mhd/system/api/domain/StockOutOrder.java | 7 +++++++ sql/wkx.sql | 6 +++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockInOrder.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockInOrder.java index f022e8c30..062b19092 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockInOrder.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockInOrder.java @@ -356,4 +356,10 @@ public class StockInOrder extends BaseVOEntity { @ApiModelProperty("oms入库单id") @Excel(name = "oms入库单id") private String omsStockInOrderId; + @ApiModelProperty("结算币种") + private String settlementCurrency; + @ApiModelProperty("业务员ID") + private String salesmanId; + @ApiModelProperty("业务员名称") + private String salesmanName; } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockOutOrder.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockOutOrder.java index 857e1387c..f1c0d57ed 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockOutOrder.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/StockOutOrder.java @@ -395,4 +395,11 @@ public class StockOutOrder extends BaseVOEntity { @Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd") private Date documentDate; + @ApiModelProperty("结算币种") + private String settlementCurrency; + @ApiModelProperty("业务员ID") + private String salesmanId; + @ApiModelProperty("业务员名称") + private String salesmanName; + } \ No newline at end of file diff --git a/sql/wkx.sql b/sql/wkx.sql index e24502278..30729b2bd 100644 --- a/sql/wkx.sql +++ b/sql/wkx.sql @@ -457,4 +457,8 @@ COMMENT ON TABLE "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD" IS ' -- ---------------------------- -- Primary Key structure for table RESERVATION_INVENTORY_ADJUSTMENT_RECORD -- ---------------------------- -ALTER TABLE "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD" ADD PRIMARY KEY ("INVENTORY_ADJUSTMENT_ID"); \ No newline at end of file +ALTER TABLE "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD" ADD PRIMARY KEY ("INVENTORY_ADJUSTMENT_ID"); + +ALTER TABLE "NGWL_TEST_OMS"."RESERVATION_STOCK_IN_ORDER" ADD COLUMN "IN_QUANTITY" DECIMAL(20,2) DEFAULT 0.; + +COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_STOCK_IN_ORDER"."IN_QUANTITY" IS '计划数量'; \ No newline at end of file From 7b4d4cb9a9c845ad9c4aff90b32592247981901d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 22 Apr 2026 16:58:36 +0800 Subject: [PATCH 22/22] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/persistence/BmsInvoiceListServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java b/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java index 5d248fb5c..1a6b37416 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java +++ b/mhd_bms/src/main/java/com/mhd/bms/domain/bmsInvoiceList/repository/persistence/BmsInvoiceListServiceImpl.java @@ -195,6 +195,7 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl billManageIds = bmsInvoiceListAddDTO.getBillManageIds(); if (billManageIds != null && billManageIds.size() > 0){ } else { + billManageIds = new ArrayList<>(); billManageIds.add(bmsInvoiceListAddDTO.getBillManageId()); } List billManages = billManageMapper.selectList(new LambdaQueryWrapper().in(BillManage::getBillManageId, billManageIds));