From 070cdcd5de8b4bd18dad23fb3a5939624a833c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Fri, 14 Aug 2026 14:36:46 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E4=BB=93=E7=A0=81820?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/vo/ReservedInventory.java | 5 ++ ...ReserveStockInOrderApplicationService.java | 29 ++++++++++++ .../entity/ReserveStockOutOrder.java | 5 ++ .../repository/po/ReserveStockOutOrderPO.java | 4 ++ .../todo/ReserveStockOutOrderDO.java | 4 ++ .../todo/ReserveStockOutOrderDTO.java | 4 ++ .../repository/vo/ReservedInventoryOut.java | 10 ++++ ...eserveStockOutOrderApplicationService.java | 42 +++++++++++++++-- .../ReserveStockOutOrderApi.java | 25 ++++++++++ .../ReserveStockInOrderApi.java | 46 +++++++++++++++++++ .../ReserveStockOutOrderMapper.xml | 4 +- .../entity/MaterialBaseInfo.java | 3 ++ .../repository/po/MaterialBaseInfoPO.java | 3 ++ .../repository/todo/MaterialBaseInfoDO.java | 3 ++ .../materialBaseInfo/MaterialBaseInfoDTO.java | 2 + .../MaterialBaseInfoMapper.xml | 3 +- 16 files changed, 187 insertions(+), 5 deletions(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java index a6b5c2830..1e86c733b 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java @@ -68,4 +68,9 @@ public class ReservedInventory { * 验证结果(导入后自动填充,不映射Excel) */ private String validationResult; + + /** + * WMS物料id(解析预览接口根据货物名称匹配后自动填充,匹配不到为空,不映射Excel) + */ + private Long materialBaseInfoId; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderApplicationService.java index 571dfa51c..fe2015eb2 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/service/ReserveStockInOrderApplicationService.java @@ -1972,6 +1972,35 @@ public class ReserveStockInOrderApplicationService { return stockInOrderDomainService.queryNoticePrintDetail(stockInOrderDO); } + /** + * Excel解析预览:根据货物名称匹配WMS对应物料并填充物料id, + * 匹配不到物料id保持为空,不阻断解析 + */ + public void fillMaterialBaseInfoId(List dataList) { + if (dataList == null || dataList.isEmpty()) { + return; + } + // 物料名称匹配结果缓存,避免同名重复查库 + Map materialCache = new HashMap<>(); + for (ReservedInventory reservedInventory : dataList) { + String goodsName = reservedInventory.getGoodsName(); + if (StringUtils.isBlank(goodsName)) { + continue; + } + MaterialBaseInfoPO materialBaseInfoPO = materialCache.get(goodsName); + if (materialBaseInfoPO == null && !materialCache.containsKey(goodsName)) { + List materialBaseInfoPOS = reserveStockInOrderMapper.getByName(goodsName); + if (materialBaseInfoPOS != null && !materialBaseInfoPOS.isEmpty()) { + materialBaseInfoPO = materialBaseInfoPOS.get(0); + } + materialCache.put(goodsName, materialBaseInfoPO); + } + if (materialBaseInfoPO != null) { + reservedInventory.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId()); + } + } + } + public void importInData(List dataList) { LoginUser loginUser = SecurityUtils.getLoginUser(); ReserveStockInOrderDO reserveStockInOrder = new ReserveStockInOrderDO(); diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java index 464ccbb11..df53789da 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java @@ -444,4 +444,9 @@ public class ReserveStockOutOrder extends BaseVOEntity { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; + @ApiModelProperty("预约业务类型") + private String reserveBusinessType; + @ApiModelProperty("预约业务类型名称") + private String reserveBusinessTypeName; + } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java index 6a1049f85..42a258d5c 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java @@ -452,4 +452,8 @@ public class ReserveStockOutOrderPO extends BaseVOEntity { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; + @ApiModelProperty("预约业务类型") + private String reserveBusinessType; + @ApiModelProperty("预约业务类型名称") + private String reserveBusinessTypeName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java index 1e7a27c9c..e15ccd96b 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java @@ -490,4 +490,8 @@ public class ReserveStockOutOrderDO extends BaseVOEntity { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; + @ApiModelProperty("预约业务类型") + private String reserveBusinessType; + @ApiModelProperty("预约业务类型名称") + private String reserveBusinessTypeName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDTO.java index 677164a2d..41fa9e8c1 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDTO.java @@ -479,4 +479,8 @@ public class ReserveStockOutOrderDTO extends ReserveStockOutOrderBaseDTO { @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; + @ApiModelProperty("预约业务类型") + private String reserveBusinessType; + @ApiModelProperty("预约业务类型名称") + private String reserveBusinessTypeName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java index 618ef5324..bc2638873 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java @@ -1,5 +1,6 @@ package com.mhd.oms.domain.reserveStockOutOrder.repository.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.mhd.oms.domain.reserveStockInOrder.repository.util.StringToBigDecimalConverter; import com.mhd.oms.domain.reserveStockInOrder.repository.util.StringToDateConverter; @@ -35,6 +36,15 @@ public class ReservedInventoryOut { /** * 验证结果(导入后自动填充,不映射Excel) + * @ExcelIgnore:排除在Excel列映射之外,避免被自动分配列索引 */ + @ExcelIgnore private String validationResult; + + /** + * WMS库存id(解析预览接口根据货物名称查询可用库存后自动填充,不映射Excel) + * @ExcelIgnore:Long类型字段若被自动映射到非数字列,会抛出ExcelDataConvertException + */ + @ExcelIgnore + private Long materialInventoryId; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java index 4dc2f9a89..160b18a08 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java @@ -841,7 +841,7 @@ public class ReserveStockOutOrderApplicationService { * @description 审核入库单 * @author ZhouGY * @date 2024/5/21 13:53 - * @param stockInOrderDO + * @param stockOutOrderDO * @return Boolean */ public Boolean auditState(ReserveStockOutOrderDO stockOutOrderDO){ @@ -852,7 +852,7 @@ public class ReserveStockOutOrderApplicationService { * @description 下发入库单 * @author ZhouGY * @date 2024/5/21 13:53 - * @param stockInOrderDO + * @param stockOutOrderDO * @return Boolean */ public Boolean issueOrder(ReserveStockOutOrderDO stockOutOrderDO){ @@ -862,7 +862,7 @@ public class ReserveStockOutOrderApplicationService { * @description 审核入库单 * @author ZhouGY * @date 2024/5/21 13:53 - * @param stockInOrderDO + * @param stockOutOrderDO * @return Boolean */ public Boolean orderReject(ReserveStockOutOrderDO stockOutOrderDO){ @@ -1355,6 +1355,42 @@ public class ReserveStockOutOrderApplicationService { return result; } + /** + * Excel解析预览:根据货物名称查询WMS对应物料的库存信息, + * 可用数量大于导入数据件数的填充库存id; + * 物料不存在、无库存或可用数量不足时库存id保持为空,不抛异常 + */ + public void fillMaterialInventoryId(List dataList) { + if (CollectionUtils.isEmpty(dataList)) { + return; + } + for (ReservedInventoryOut reservedInventory : dataList) { + String goodsName = reservedInventory.getGoodsName(); + BigDecimal importQuantity = reservedInventory.getQuantity() == null ? BigDecimal.ZERO : reservedInventory.getQuantity(); + // 根据货物名称查询对应物料,匹配不到则库存id为空 + List materialBaseInfoPOS = reserveStockInOrderMapper.getByName(goodsName); + if (materialBaseInfoPOS == null || materialBaseInfoPOS.isEmpty()) { + continue; + } + Long materialBaseInfoId = materialBaseInfoPOS.get(0).getMaterialBaseInfoId(); + // 根据物料id查询对应库存,无库存则库存id为空 + List reservationMaterialInventories = reservationMaterialInventoryMapper.selectList( + new LambdaQueryWrapper() + .eq(ReservationMaterialInventory::getMaterialBaseInfoId, materialBaseInfoId)); + if (reservationMaterialInventories == null || reservationMaterialInventories.isEmpty()) { + continue; + } + // 取可用数量大于导入数据件数的库存,填充库存id;都不满足则库存id为空 + for (ReservationMaterialInventory inventory : reservationMaterialInventories) { + BigDecimal allocationQuantity = inventory.getAllocationQuantity() == null ? BigDecimal.ZERO : inventory.getAllocationQuantity(); + if (allocationQuantity.compareTo(importQuantity) > 0) { + reservedInventory.setMaterialInventoryId(inventory.getMaterialInventoryId()); + break; + } + } + } + } + public void importInData(List dataList) { LoginUser loginUser = SecurityUtils.getLoginUser(); ReserveStockOutOrderDO reserveStockOutOrder = new ReserveStockOutOrderDO(); diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/ReserveStockOutOrder/ReserveStockOutOrderApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/ReserveStockOutOrder/ReserveStockOutOrderApi.java index 14e6d1f9e..5be6eb209 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/ReserveStockOutOrder/ReserveStockOutOrderApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/ReserveStockOutOrder/ReserveStockOutOrderApi.java @@ -296,6 +296,31 @@ public class ReserveStockOutOrderApi extends BaseController { } } + /** + * 仅解析Excel文件内容并返回,不执行入库 + * 同时根据货物名称查询WMS对应物料库存,可用数量大于件数的返回库存id,匹配不到库存id返回空 + */ + @ApiOperation("解析导入Excel(仅解析不入库)") + @PostMapping("/parseExcel") + public ResponseEntity> parseExcel(@RequestParam("file") MultipartFile file) { + List dataList = null; + try { + dataList = ExcelParseUtil.parseExcel(file); + } catch (IOException e) { + throw new RuntimeException(e); + } + + // 根据货物名称查询WMS库存并填充库存id,匹配不到库存id返回空 + stockOutOrderApplicationService.fillMaterialInventoryId(dataList); + + Map successResponse = new HashMap<>(); + successResponse.put("code", 200); + successResponse.put("message", "Excel解析成功"); + successResponse.put("dataCount", dataList.size()); + successResponse.put("details", dataList); + return ResponseEntity.ok(successResponse); + } + /** * 生成出库预约单号 */ diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reserveStockInOrder/ReserveStockInOrderApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reserveStockInOrder/ReserveStockInOrderApi.java index f1526fe43..66a8e66a6 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reserveStockInOrder/ReserveStockInOrderApi.java +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/reserveStockInOrder/ReserveStockInOrderApi.java @@ -260,6 +260,52 @@ public class ReserveStockInOrderApi extends BaseController { } } + /** + * 仅解析Excel文件内容并返回,不执行入库 + * 同时根据货物名称匹配WMS物料并返回物料id,匹配不到返回空 + */ + @ApiOperation("解析导入Excel(仅解析不入库)") + @PostMapping("/parseExcel") + public ResponseEntity> parseExcel(@RequestParam("file") MultipartFile file) { + try { + List dataList = ExcelParseUtil.parseExcel(file); + + // 根据货物名称匹配WMS物料并填充物料id,匹配不到返回空 + stockInOrderApplicationService.fillMaterialBaseInfoId(dataList); + + Map successResponse = new HashMap<>(); + successResponse.put("code", 200); + successResponse.put("message", "Excel解析成功"); + successResponse.put("dataCount", dataList.size()); + successResponse.put("details", dataList); + return ResponseEntity.ok(successResponse); + + } catch (ValidationException e) { + // 数据验证失败响应 + Map errorResponse = new HashMap<>(); + errorResponse.put("code", 400); + errorResponse.put("message", "数据验证失败"); + errorResponse.put("errorDetails", e.getMessage()); + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(errorResponse); + + } catch (IOException e) { + // 文件处理失败响应 + Map errorResponse = new HashMap<>(); + errorResponse.put("code", 500); + errorResponse.put("message", "文件处理失败"); + errorResponse.put("errorDetails", e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorResponse); + + } catch (Exception e) { + // 其他未知错误响应 + Map errorResponse = new HashMap<>(); + errorResponse.put("code", 500); + errorResponse.put("message", e.getMessage()); + errorResponse.put("errorDetails", e.getMessage()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorResponse); + } + } + /** * 老系统入库预约单数据导入(主表+明细两个Excel文件批量导入,按名称匹配基础数据) */ diff --git a/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml index 5d27761f8..f73673720 100644 --- a/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml @@ -95,6 +95,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -112,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.COMPLETE_TIME,a.ORDER_DATE,a.TRANSPORT_MODE_CODE,a.TRANSPORT_MODE_NAME,a.SUPERVISION_MODE_CODE,a.SUPERVISION_MODE_NAME, a.CUSTOMS_INSPECTION_FLAG,a.NEED_DECLARE_FLAG,a.NEED_TRANSPORT_FLAG,a.picture_app,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.tms_order_number, - a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.RESERVATION_ORDER_SOURCE,a.OUTBOUND_TIME + a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.RESERVATION_ORDER_SOURCE,a.OUTBOUND_TIME,a.RESERVE_BUSINESS_TYPE,a.RESERVE_BUSINESS_TYPE_NAME diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java index 127ea97b2..7250d613b 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -240,4 +240,7 @@ public class MaterialBaseInfo extends BaseVOEntity { @ApiModelProperty(name = "组织(多个用,分开)") private String orgId; + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; + } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java index a07dbd095..0f7b436ba 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java @@ -289,4 +289,7 @@ public class MaterialBaseInfoPO extends BaseVOEntity { @ApiModelProperty(name = "组织(多个用,分开)") private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java index 4f12be185..a0976ccac 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java @@ -262,4 +262,7 @@ public class MaterialBaseInfoDO extends BaseVOEntity { @ApiModelProperty(name = "组织(多个用,分开)") private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java index 94f769e21..85c38d9e5 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java @@ -314,4 +314,6 @@ public class MaterialBaseInfoDTO extends BaseVOEntity { @ApiModelProperty(name = "组织(多个用,分开)") private String orgId; + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml index e2fd31cd5..3a6054c5d 100644 --- a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml @@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -77,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_shape_name, a.material_size, a.material_length, a.material_width, a.material_height, a.remark, a.nullify, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.common, sku_code, a.unit_price, a.currency, a.origin_country, a.hs_code, a.declaration_unit, a.statutory_unit, a.statutory_second_unit, a.copy_code, a.push_status,a.push_time,a.push_by,a.goods_type,a.gross_weight,a.push_by_name,a.unit,a.INSURE_AMOUNT,a.CHARGE_STANDARD, - specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity,c.charge_standard as charge_standard_class + specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity,c.charge_standard as charge_standard_class,a.is_normal_material from material_base_info a left join ( select material_base_info_id, sum(INVENTORY_QUANTITY) as stock_qty from MATERIAL_INVENTORY group by material_base_info_id From 1d9632237020dd325ca336141e23fc29797323af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Tue, 18 Aug 2026 09:53:30 +0800 Subject: [PATCH 02/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=8E=BB=E9=99=A4=E8=B4=A7=E4=B8=BB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialBaseInfoApplicationService.java | 23 +++-- .../MaterialBaseInfoApplicationService.java | 95 ++++++++++--------- 2 files changed, 63 insertions(+), 55 deletions(-) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java index ae9cd97a9..645c45a44 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java @@ -157,15 +157,18 @@ public class MaterialBaseInfoApplicationService { * @param materialBaseInfoDO */ private void shipperParam(MaterialBaseInfoDO materialBaseInfoDO){ - AjaxResult ajaxResult = userServiceFeign.getInfo(materialBaseInfoDO.getShipperId()); - if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ - throw new ServiceException("获取货主信息失败"); - } - UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class); - // 如果原始shipperName不为空,保留原始值(导入或手动输入时应该保留完整名称) - // 只有在原始shipperName为空时,才使用查询到的userName - if (materialBaseInfoDO.getShipperName() == null || materialBaseInfoDO.getShipperName().trim().isEmpty()) { - materialBaseInfoDO.setShipperName(userPo.getUserName()); + Long shipperId = materialBaseInfoDO.getShipperId(); + if (shipperId != null && shipperId != 0l) { + AjaxResult ajaxResult = userServiceFeign.getInfo(materialBaseInfoDO.getShipperId()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ + throw new ServiceException("获取货主信息失败"); + } + UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class); + // 如果原始shipperName不为空,保留原始值(导入或手动输入时应该保留完整名称) + // 只有在原始shipperName为空时,才使用查询到的userName + if (materialBaseInfoDO.getShipperName() == null || materialBaseInfoDO.getShipperName().trim().isEmpty()) { + materialBaseInfoDO.setShipperName(userPo.getUserName()); + } } } @@ -182,4 +185,4 @@ public class MaterialBaseInfoApplicationService { //return materialBaseInfoDomainService.getMaterialStockList(shipperName,materialName,machineCode,topOrganizationId,pageNum,pageSize);/**/ return null; } -} +} \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java index 10b12490c..23bd5b08b 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java @@ -257,31 +257,33 @@ public class MaterialBaseInfoApplicationService { } } Long shipperId = materialBaseInfoDO.getShipperId(); - String customerCodeNcJson = null; - if (shipperId != null) { - customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString()); - } - if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) { - ObjectMapper objectMapper = new ObjectMapper(); - List> listNc = null; - try { - listNc = objectMapper.readValue( - customerCodeNcJson, - new com.fasterxml.jackson.core.type.TypeReference>>() {} - ); - String codeStr = ""; - if (listNc != null && listNc.size() > 0) { - // 方式1:Stream拼接,逗号分隔 - codeStr = listNc.stream() - .map(map -> map.get("code")) - .filter(Objects::nonNull) // 过滤code为空 - .map(Object::toString) - .collect(Collectors.joining(",")); - materialBaseInfoDO.setOrgId(codeStr); + if (shipperId != null&&shipperId != 0L) { + String customerCodeNcJson = null; + if (shipperId != null) { + customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString()); + } + if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) { + ObjectMapper objectMapper = new ObjectMapper(); + List> listNc = null; + try { + listNc = objectMapper.readValue( + customerCodeNcJson, + new com.fasterxml.jackson.core.type.TypeReference>>() {} + ); + String codeStr = ""; + if (listNc != null && listNc.size() > 0) { + // 方式1:Stream拼接,逗号分隔 + codeStr = listNc.stream() + .map(map -> map.get("code")) + .filter(Objects::nonNull) // 过滤code为空 + .map(Object::toString) + .collect(Collectors.joining(",")); + materialBaseInfoDO.setOrgId(codeStr); + } + // codeStr 就是拼接好的字符串 + } catch (JsonProcessingException e) { + throw new RuntimeException(e); } - // codeStr 就是拼接好的字符串 - } catch (JsonProcessingException e) { - throw new RuntimeException(e); } } Long materialBaseInfoId = materialBaseInfoDomainService.insert(materialBaseInfoDO); @@ -316,30 +318,33 @@ public class MaterialBaseInfoApplicationService { */ public Boolean update(MaterialBaseInfoDO materialBaseInfoDO) { Long shipperId = materialBaseInfoDO.getShipperId(); - String customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString()); - if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) { - ObjectMapper objectMapper = new ObjectMapper(); - List> listNc = null; - try { - listNc = objectMapper.readValue( - customerCodeNcJson, - new com.fasterxml.jackson.core.type.TypeReference>>() {} - ); - String codeStr = ""; - if (listNc != null && listNc.size() > 0) { - // 方式1:Stream拼接,逗号分隔 - codeStr = listNc.stream() - .map(map -> map.get("code")) - .filter(Objects::nonNull) // 过滤code为空 - .map(Object::toString) - .collect(Collectors.joining(",")); - materialBaseInfoDO.setOrgId(codeStr); + if (shipperId != null&&shipperId!=0l) { + String customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString()); + if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) { + ObjectMapper objectMapper = new ObjectMapper(); + List> listNc = null; + try { + listNc = objectMapper.readValue( + customerCodeNcJson, + new com.fasterxml.jackson.core.type.TypeReference>>() {} + ); + String codeStr = ""; + if (listNc != null && listNc.size() > 0) { + // 方式1:Stream拼接,逗号分隔 + codeStr = listNc.stream() + .map(map -> map.get("code")) + .filter(Objects::nonNull) // 过滤code为空 + .map(Object::toString) + .collect(Collectors.joining(",")); + materialBaseInfoDO.setOrgId(codeStr); + } + // codeStr 就是拼接好的字符串 + } catch (JsonProcessingException e) { + throw new RuntimeException(e); } - // codeStr 就是拼接好的字符串 - } catch (JsonProcessingException e) { - throw new RuntimeException(e); } } + materialBaseInfoDomainService.update(materialBaseInfoDO); Long materialBaseInfoId = materialBaseInfoDO.getMaterialBaseInfoId(); // 商品/公共/仓控 子表:Feign/前端常只带业务字段、未带子表主键,需按 material_base_info_id 补全后再 update,否则 WHERE xxx_id=? 为 null 导致 Updates: 0 From 58e3882ef4a5dd6ba59fc863e793b804e19f3733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Tue, 18 Aug 2026 10:20:26 +0800 Subject: [PATCH 03/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=8E=BB=E9=99=A4=E8=B4=A7=E4=B8=BB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mhd/system/api/domain/MaterialBaseInfoFeign.java | 6 ++++++ .../domain/materialBaseInfo/entity/MaterialBaseInfo.java | 5 +++++ .../materialBaseInfo/repository/po/MaterialBaseInfoPO.java | 6 ++++++ .../repository/todo/MaterialBaseInfoDO.java | 6 ++++++ .../dto/materialBaseInfo/MaterialBaseInfoDTO.java | 6 ++++++ 5 files changed, 29 insertions(+) diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java index 44ff2f082..2d70d66e6 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/MaterialBaseInfoFeign.java @@ -244,4 +244,10 @@ public class MaterialBaseInfoFeign extends BaseVOEntity{ @ApiModelProperty(name = "单位") private String unit; + + @ApiModelProperty(name = "组织(多个用,分开)") + private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java index 4a902da82..60f7a3d5d 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -404,4 +404,9 @@ public class MaterialBaseInfo extends BaseVOEntity{ @ApiModelProperty(name = "收费标准") private BigDecimal chargeStandard; + @ApiModelProperty(name = "组织(多个用,分开)") + private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java index d7fb53ff9..b876cb1c2 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java @@ -393,4 +393,10 @@ public class MaterialBaseInfoPO extends BaseVOEntity{ @ApiModelProperty(name = "收费标准") private BigDecimal chargeStandard; + + @ApiModelProperty(name = "组织(多个用,分开)") + private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java index 3b3ae1181..d1e95243e 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/repository/todo/MaterialBaseInfoDO.java @@ -399,4 +399,10 @@ public class MaterialBaseInfoDO extends BaseVOEntity{ @ApiModelProperty(name = "收费标准") private BigDecimal chargeStandard; + + @ApiModelProperty(name = "组织(多个用,分开)") + private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; } \ No newline at end of file diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java index 54f093650..9ab26e7a9 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java @@ -379,4 +379,10 @@ public class MaterialBaseInfoDTO extends BaseVOEntity{ @ApiModelProperty(name = "收费标准") private BigDecimal chargeStandard; + @ApiModelProperty(name = "组织(多个用,分开)") + private String orgId; + + @ApiModelProperty(name = "是否正常物料: 0-是 1-否") + private Integer isNormalMaterial; + } \ No newline at end of file From 0376f8328c7c25d4d48323545321f89b340ecbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Tue, 18 Aug 2026 16:35:33 +0800 Subject: [PATCH 04/24] =?UTF-8?q?=E6=97=A0=E8=B4=A7=E4=B8=BB=E6=B5=81?= =?UTF-8?q?=E7=A8=8B;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/MaterialBaseInfo.java | 4 ++++ .../repository/vo/ReservedInventory.java | 2 ++ .../repository/vo/ReservedInventoryOut.java | 4 ++++ ...eserveStockOutOrderApplicationService.java | 1 + .../MaterialBaseInfoApplicationService.java | 24 +++++++++++++++++++ .../entity/MaterialBaseInfo.java | 8 +++---- .../MaterialBaseInfoMapper.xml | 4 ++-- 7 files changed, 41 insertions(+), 6 deletions(-) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java index 60f7a3d5d..95a81b9dd 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -1,5 +1,6 @@ package com.mhd.basic.domain.materialBaseInfo.entity; +import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -44,14 +45,17 @@ public class MaterialBaseInfo extends BaseVOEntity{ @ApiModelProperty("货主id") @Excel(name = "货主id") + @TableField(updateStrategy = FieldStrategy.IGNORED) private Long shipperId; @ApiModelProperty("货主名称") @Excel(name = "货主名称") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String shipperName; @ApiModelProperty("物料编码") @Excel(name = "物料编码") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String materialCode; @ApiModelProperty("物料名称") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java index 1e86c733b..ae068746f 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/ReservedInventory.java @@ -1,5 +1,6 @@ package com.mhd.oms.domain.reserveStockInOrder.repository.vo; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.mhd.oms.domain.reserveStockInOrder.repository.util.StringToBigDecimalConverter; @@ -72,5 +73,6 @@ public class ReservedInventory { /** * WMS物料id(解析预览接口根据货物名称匹配后自动填充,匹配不到为空,不映射Excel) */ + @ExcelIgnore private Long materialBaseInfoId; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java index bc2638873..9beb82261 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/vo/ReservedInventoryOut.java @@ -47,4 +47,8 @@ public class ReservedInventoryOut { */ @ExcelIgnore private Long materialInventoryId; + + + @ExcelIgnore + private Long materialBaseInfoId; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java index 160b18a08..be8106675 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/service/ReserveStockOutOrderApplicationService.java @@ -1385,6 +1385,7 @@ public class ReserveStockOutOrderApplicationService { BigDecimal allocationQuantity = inventory.getAllocationQuantity() == null ? BigDecimal.ZERO : inventory.getAllocationQuantity(); if (allocationQuantity.compareTo(importQuantity) > 0) { reservedInventory.setMaterialInventoryId(inventory.getMaterialInventoryId()); + reservedInventory.setMaterialBaseInfoId(inventory.getMaterialBaseInfoId()); break; } } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java index 23bd5b08b..0a9729fd3 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java @@ -318,6 +318,8 @@ public class MaterialBaseInfoApplicationService { */ public Boolean update(MaterialBaseInfoDO materialBaseInfoDO) { Long shipperId = materialBaseInfoDO.getShipperId(); + //设置货主信息 + shipperParam(materialBaseInfoDO); if (shipperId != null&&shipperId!=0l) { String customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString()); if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) { @@ -386,6 +388,28 @@ public class MaterialBaseInfoApplicationService { return true; } + /** + * @description 封装货主信息 + * @author ZhouGY + * @date 2024/5/9 20:43 + * @param materialBaseInfoDO + */ + private void shipperParam(MaterialBaseInfoDO materialBaseInfoDO){ + Long shipperId = materialBaseInfoDO.getShipperId(); + if (shipperId != null && shipperId != 0l) { + AjaxResult ajaxResult = userServiceFeign.getInfo(materialBaseInfoDO.getShipperId()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ + throw new ServiceException("获取货主信息失败"); + } + UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class); + // 如果原始shipperName不为空,保留原始值(导入或手动输入时应该保留完整名称) + // 只有在原始shipperName为空时,才使用查询到的userName + if (materialBaseInfoDO.getShipperName() == null || materialBaseInfoDO.getShipperName().trim().isEmpty()) { + materialBaseInfoDO.setShipperName(userPo.getUserName()); + } + } + } + /** * 编辑物料时从库中反查子表主键,避免仅传 batchId 等字段时子表主键为 null 无法 UPDATE。 */ diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java index 7250d613b..a227976e3 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -1,9 +1,6 @@ package com.mhd.wms.domain.materialBaseInfo.entity; -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.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import com.mhd.common.core.annotation.Excel; import com.mhd.common.core.handler.ListTypeHandler; @@ -47,14 +44,17 @@ public class MaterialBaseInfo extends BaseVOEntity { @ApiModelProperty("货主id") @Excel(name = "货主id") + @TableField(updateStrategy = FieldStrategy.IGNORED) private Long shipperId; @ApiModelProperty("货主编码") @Excel(name = "货主编码") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String shipperCode; @ApiModelProperty("货主名称") @Excel(name = "货主名称") + @TableField(updateStrategy = FieldStrategy.IGNORED) private String shipperName; @ApiModelProperty("物料编码") diff --git a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml index 3a6054c5d..7f4bc7e12 100644 --- a/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialBaseInfo/MaterialBaseInfoMapper.xml @@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.top_organization_id = #{topOrganizationId} - and a.shipper_id = #{shipperId} + and (a.shipper_id = #{shipperId} or a.shipper_id is null or a.shipper_id = 0) and a.shipper_code like concat('%', #{shipperCode}, '%') @@ -268,7 +268,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM ... LEFT JOIN material_base_info b ON ... 因此这里所有列名都加上 b. 前缀以避免和主表列名歧义 --> - and b.shipper_id = #{shipperId} + and (b.shipper_id = #{shipperId} or b.shipper_id is null or b.shipper_id = 0) and b.shipper_code like concat('%', #{shipperCode}, '%') From 15c8a2b6e6af0c6b8148ef2ad367ea2042d2851b Mon Sep 17 00:00:00 2001 From: zhaoqing <3160641494@qq.com> Date: Wed, 19 Aug 2026 09:14:44 +0800 Subject: [PATCH 05/24] =?UTF-8?q?fix(wms):=E6=98=8E=E7=BB=86=E8=A1=A8?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/po/ExecutionInMaterialDetailWithOrderPO.java | 5 +++++ .../executionInMaterialDetailMapper.xml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/executionInMaterialDetail/repository/po/ExecutionInMaterialDetailWithOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/executionInMaterialDetail/repository/po/ExecutionInMaterialDetailWithOrderPO.java index 4697b3ba3..3bb849e16 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/executionInMaterialDetail/repository/po/ExecutionInMaterialDetailWithOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/executionInMaterialDetail/repository/po/ExecutionInMaterialDetailWithOrderPO.java @@ -3,6 +3,8 @@ package com.mhd.oms.domain.executionInMaterialDetail.repository.po; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.Date; + /** * 入库明细查询结果(关联入库执行单) * @@ -27,4 +29,7 @@ public class ExecutionInMaterialDetailWithOrderPO extends ExecutionInMaterialDet @ApiModelProperty("货主名称") private String orderShipperName; + + @ApiModelProperty("入库日期") + private Date warehouseDate; } diff --git a/mhd_oms/src/main/resources/mapper/executionInMaterialDetail/executionInMaterialDetailMapper.xml b/mhd_oms/src/main/resources/mapper/executionInMaterialDetail/executionInMaterialDetailMapper.xml index fd4e7b2d0..82b62fb9c 100644 --- a/mhd_oms/src/main/resources/mapper/executionInMaterialDetail/executionInMaterialDetailMapper.xml +++ b/mhd_oms/src/main/resources/mapper/executionInMaterialDetail/executionInMaterialDetailMapper.xml @@ -366,6 +366,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + SELECT in_order_number FROM reserve_stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} @@ -847,7 +847,7 @@ SELECT in_order_number FROM reservation_stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND AND organization_id = #{organizationId} @@ -859,7 +859,7 @@ SELECT in_order_number FROM execution_stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} @@ -871,7 +871,7 @@ SELECT in_order_number FROM NGWL_TEST_WMS.stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} diff --git a/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml index f73673720..ddcf20d59 100644 --- a/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reserveStockOutOrder/ReserveStockOutOrderMapper.xml @@ -555,7 +555,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT in_order_number FROM NGWL_TEST_OMS.reserve_stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} @@ -636,7 +636,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT in_order_number FROM NGWL_TEST_OMS.reservation_stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} @@ -648,7 +648,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT in_order_number FROM NGWL_TEST_OMS.execution_stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} @@ -660,7 +660,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT in_order_number FROM stock_in_order WHERE in_order_number LIKE concat(#{prefix}, '%') - AND del_flag = 1 + AND organization_id = #{organizationId} diff --git a/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml index 8babfe003..ac19f2b19 100644 --- a/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockOutOrder/StockOutOrderMapper.xml @@ -531,7 +531,7 @@