From 5c4e460cacaabd3b3fbb9b70f06a7b3caeedb6b8 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, 15 Sep 2026 14:52:28 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=A3=E7=A7=9F=E8=BF=87=E6=BB=A4=E6=9D=A1?=
=?UTF-8?q?=E4=BB=B6;?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MaterialInventoryApplicationService.java | 2 ++
.../repository/po/MaterialInventoryPO.java | 3 +++
.../mapper/materialInventory/MaterialInventoryMapper.xml | 6 ++++--
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
index f8c74da3e..99fefa42b 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
@@ -1021,6 +1021,8 @@ public class MaterialInventoryApplicationService {
//未查询到库存记录
if (materialInventoryPOS==null || materialInventoryPOS.size()==0) return;
for (MaterialInventoryPO materialInventoryPO : materialInventoryPOS) {
+ String businessChargeType = materialInventoryPO.getBusinessChargeType();
+ if (!"散租".equals(businessChargeType)) continue;
Date createTime = materialInventoryPO.getCreateTime();
Long materialBaseInfoId = materialInventoryPO.getMaterialBaseInfoId();
String lotNumber = materialInventoryPO.getLotNumber();
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java
index 0a1007541..d5157b036 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/po/MaterialInventoryPO.java
@@ -277,4 +277,7 @@ public class MaterialInventoryPO extends MaterialBasePO {
@ApiModelProperty("半月仓租单位")
@Excel(name = "半月仓租单位")
private String halfMonthWarehouseRentUnit;
+
+ @ApiModelProperty("业务计价类型")
+ private String businessChargeType;
}
\ No newline at end of file
diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
index 3f5e19f8d..384540582 100644
--- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
+++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
@@ -75,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
@@ -1822,8 +1823,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
From ae4e0e129b464d81a0801241fdf3e9899a08f53e 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, 15 Sep 2026 16:21:28 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9;?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MaterialInventoryApplicationService.java | 14 ++++++++++----
.../facade/IMaterialInventoryService.java | 2 ++
.../repository/mapper/MaterialInventoryMapper.java | 2 ++
.../persistence/MaterialInventoryImpl.java | 5 +++++
.../service/MaterialInventoryDomainService.java | 4 ++++
.../materialInventory/MaterialInventoryMapper.xml | 10 ++++++++++
6 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
index 99fefa42b..11acc0e39 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
@@ -904,7 +904,9 @@ public class MaterialInventoryApplicationService {
String inOrderNumber = materialInventoryPO.getInOrderNumber();
Long warehouseId = materialInventoryPO.getWarehouseId();
Date lastBillingTime = materialInventoryPO.getLastBillingTime();
- if (warehouseId==19) {//干仓计费
+ String warehouseCode = materialInventoryMapper.queryWarehouseCode(warehouseId);
+ if (warehouseCode == null) return;
+ if ("CMD".equals(warehouseCode)) {//干仓计费
Map shipperParameters = materialInventoryDomainService.queryShipperParameters(shipperId,"干仓计费配置");
//客户未配置干仓计费配置
if (shipperParameters == null || shipperParameters.size()==0) return;
@@ -962,7 +964,7 @@ public class MaterialInventoryApplicationService {
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D01","租金(固定租)",contractManageId,"冻仓");
buildBusinessDocument(fireInsureFee, materialInventoryPO,"0D08","火险保费",contractManageId,"冻仓");
}
- } else if (warehouseId==20) {//冻仓计费
+ } else if ("CMC".equals(warehouseCode)) {//冻仓计费
Map shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"冻仓计费配置");
if (shipperParameters == null || shipperParameters.size()==0) return;
Long contractManageId = (Long) shipperParameters.get("contractManageId");
@@ -1022,6 +1024,7 @@ public class MaterialInventoryApplicationService {
if (materialInventoryPOS==null || materialInventoryPOS.size()==0) return;
for (MaterialInventoryPO materialInventoryPO : materialInventoryPOS) {
String businessChargeType = materialInventoryPO.getBusinessChargeType();
+ //非散租
if (!"散租".equals(businessChargeType)) continue;
Date createTime = materialInventoryPO.getCreateTime();
Long materialBaseInfoId = materialInventoryPO.getMaterialBaseInfoId();
@@ -1029,7 +1032,10 @@ public class MaterialInventoryApplicationService {
String inOrderNumber = materialInventoryPO.getInOrderNumber();
Long warehouseId = materialInventoryPO.getWarehouseId();
Date lastBillingTime = materialInventoryPO.getLastBillingTime();
- if (warehouseId==19) {//干仓计费
+ String warehouseCode = materialInventoryDomainService.queryWarehouseCode(warehouseId);
+ //仓库代码为空
+ if (warehouseCode==null) continue;
+ if ("CMD".equals(warehouseCode)) {//干仓计费
Map shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"干仓计费配置");
//客户未配置干仓计费配置
if (shipperParameters == null || shipperParameters.size()==0) continue;
@@ -1087,7 +1093,7 @@ public class MaterialInventoryApplicationService {
buildBusinessDocument(totalWarehouseRent, materialInventoryPO,"0D01","租金(固定租)",contractManageId,"干仓");
buildBusinessDocument(fireInsureFee, materialInventoryPO,"0D08","火险保费",contractManageId,"干仓");
}
- } else if (warehouseId==20) {//冻仓计费
+ } else if ("CMC".equals(warehouseCode)) {//冻仓计费
Map shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"冻仓计费配置");
if (shipperParameters == null || shipperParameters.size()==0) continue;
Long contractManageId = (Long) shipperParameters.get("contractManageId");
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/facade/IMaterialInventoryService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/facade/IMaterialInventoryService.java
index 7168ca15b..9b768df7e 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/facade/IMaterialInventoryService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/facade/IMaterialInventoryService.java
@@ -136,4 +136,6 @@ public interface IMaterialInventoryService extends IService
public Map queryShipperParameters(Long shipperId,String parametersName);
Map queryMaterialClassify(Long id);
+
+ String queryWarehouseCode(Long id);
}
\ No newline at end of file
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java
index 7e0ed1acc..b5865656b 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java
@@ -140,4 +140,6 @@ public interface MaterialInventoryMapper extends BaseMapper
public Map queryShipperParameters(@Param("shipperId") Long shipperId,@Param("parametersName") String parametersName);
public Map queryMaterialClassify(@Param("id") Long id);
+
+ public String queryWarehouseCode(@Param("id") Long id);
}
\ No newline at end of file
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 10f3c5202..5b6dfe0ac 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
@@ -1286,4 +1286,9 @@ public class MaterialInventoryImpl extends ServiceImpl queryMaterialClassify(Long id) {
return materialInventoryMapper.queryMaterialClassify(id);
}
+
+ @Override
+ public String queryWarehouseCode(Long id) {
+ return materialInventoryMapper.queryWarehouseCode(id);
+ }
}
\ No newline at end of file
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/service/MaterialInventoryDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/service/MaterialInventoryDomainService.java
index 95a0b8718..00787f65a 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/service/MaterialInventoryDomainService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/service/MaterialInventoryDomainService.java
@@ -149,4 +149,8 @@ public class MaterialInventoryDomainService {
public Map queryMaterialClassify(Long id) {
return materialInventoryService.queryMaterialClassify(id);
}
+
+ public String queryWarehouseCode(Long id) {
+ return materialInventoryService.queryWarehouseCode(id);
+ }
}
\ No newline at end of file
diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
index 384540582..97b34c7a8 100644
--- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
+++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
@@ -1896,4 +1896,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
1 = 1
AND MATERIAL_CLASSIFY_ID = #{id} AND DEL_FLAG = 1
+
+
\ No newline at end of file
From 5892efccaf0f0052e811ebd61bbb674d5b441679 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, 15 Sep 2026 16:42:02 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97;?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20260915_wms_push_billing_record_log.sql | 46 ++
mhd_wms/sql/__write_test.sql | 2 +
.../MaterialInventoryApplicationService.java | 401 ++++++++++++------
.../entity/PushBillingRecordLog.java | 66 +++
.../mapper/PushBillingRecordLogMapper.java | 13 +
...le_dm_szwl_wms_push_billing_record_log.sql | 46 ++
sql/20260915_wms_billing_job_log.sql | 46 ++
7 files changed, 493 insertions(+), 127 deletions(-)
create mode 100644 mhd_wms/sql/20260915_wms_push_billing_record_log.sql
create mode 100644 mhd_wms/sql/__write_test.sql
create mode 100644 mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/entity/PushBillingRecordLog.java
create mode 100644 mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/PushBillingRecordLogMapper.java
create mode 100644 sql/20260915_create_table_dm_szwl_wms_push_billing_record_log.sql
create mode 100644 sql/20260915_wms_billing_job_log.sql
diff --git a/mhd_wms/sql/20260915_wms_push_billing_record_log.sql b/mhd_wms/sql/20260915_wms_push_billing_record_log.sql
new file mode 100644
index 000000000..b393cda67
--- /dev/null
+++ b/mhd_wms/sql/20260915_wms_push_billing_record_log.sql
@@ -0,0 +1,46 @@
+-- ----------------------------
+-- 入库业务单推送bms计费流水定时任务(XXL-Job: pushBillingRecord)执行日志表 -- 达梦(DM)数据库版
+-- 适用:mhd-wms-service 连接的达梦库(生产/测试按环境选择,在WMS服务连接的用户/模式下执行)
+-- 用途:记录任务执行过程中的例外情况(执行异常报错、业务continue跳过、生成业务单据失败),
+-- 本次执行全程无任何例外时保留一条成功记录(LOG_TYPE=SUCCESS)
+-- @date 2026-09-15
+-- ----------------------------
+
+CREATE TABLE WMS_PUSH_BILLING_RECORD_LOG (
+ ID BIGINT IDENTITY(1,1) NOT NULL,
+ JOB_NAME VARCHAR(100) DEFAULT NULL,
+ SHIPPER_ID VARCHAR(50) DEFAULT NULL,
+ MATERIAL_INVENTORY_ID BIGINT DEFAULT NULL,
+ IN_ORDER_NUMBER VARCHAR(100) DEFAULT NULL,
+ MATERIAL_BASE_INFO_ID BIGINT DEFAULT NULL,
+ LOT_NUMBER VARCHAR(100) DEFAULT NULL,
+ WAREHOUSE_CODE VARCHAR(50) DEFAULT NULL,
+ LOG_TYPE VARCHAR(20) DEFAULT NULL,
+ LOG_MESSAGE VARCHAR(2000) DEFAULT NULL,
+ EXECUTION_TIME DATETIME DEFAULT NULL,
+ DEL_FLAG INT DEFAULT 1,
+ CONSTRAINT PK_WMS_PUSH_BILLING_RECORD_LOG PRIMARY KEY (ID)
+);
+
+COMMENT ON TABLE WMS_PUSH_BILLING_RECORD_LOG IS '入库业务单推送bms计费流水任务执行日志表';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.ID IS '主键ID';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.JOB_NAME IS '任务名称(XXL-Job任务标识,如pushBillingRecord)';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.SHIPPER_ID IS '货主ID(任务参数)';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.MATERIAL_INVENTORY_ID IS '物料库存ID';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.IN_ORDER_NUMBER IS '入库单号';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.MATERIAL_BASE_INFO_ID IS '物料基础信息ID';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.LOT_NUMBER IS 'LOT编号';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.WAREHOUSE_CODE IS '仓库编码';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.LOG_TYPE IS '日志类型:SUCCESS-全部执行成功 SKIP-业务跳过(continue) ERROR-执行异常';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.LOG_MESSAGE IS '日志信息(成功说明/跳过原因/异常信息)';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.EXECUTION_TIME IS '执行时间';
+COMMENT ON COLUMN WMS_PUSH_BILLING_RECORD_LOG.DEL_FLAG IS '删除标记:0-无状态,1-正常,2-已删除';
+
+CREATE INDEX IDX_WPBR_JOB_NAME ON WMS_PUSH_BILLING_RECORD_LOG (JOB_NAME);
+CREATE INDEX IDX_WPBR_SHIPPER_ID ON WMS_PUSH_BILLING_RECORD_LOG (SHIPPER_ID);
+CREATE INDEX IDX_WPBR_EXECUTION_TIME ON WMS_PUSH_BILLING_RECORD_LOG (EXECUTION_TIME);
+
+-- ----------------------------
+-- 回滚脚本
+-- DROP TABLE WMS_PUSH_BILLING_RECORD_LOG;
+-- ----------------------------
diff --git a/mhd_wms/sql/__write_test.sql b/mhd_wms/sql/__write_test.sql
new file mode 100644
index 000000000..e05719756
--- /dev/null
+++ b/mhd_wms/sql/__write_test.sql
@@ -0,0 +1,2 @@
+-- test write permission
+SELECT 1;
diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
index 11acc0e39..30ae45c48 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialInventory/MaterialInventoryApplicationService.java
@@ -20,7 +20,9 @@ import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo;
import com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper;
import com.mhd.wms.domain.materialInventory.entity.MaterialInventory;
+import com.mhd.wms.domain.materialInventory.entity.PushBillingRecordLog;
import com.mhd.wms.domain.materialInventory.repository.mapper.MaterialInventoryMapper;
+import com.mhd.wms.domain.materialInventory.repository.mapper.PushBillingRecordLogMapper;
import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryPO;
import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryQueryListPO;
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO;
@@ -75,6 +77,11 @@ public class MaterialInventoryApplicationService {
private OutMaterialDetailMapper outMaterialDetailMapper;
@Autowired
private MaterialBaseInfoMapper materialBaseInfoMapper;
+ @Autowired
+ private PushBillingRecordLogMapper pushBillingRecordLogMapper;
+
+ /** XXL-Job任务标识:入库业务单推送bms计费流水 */
+ private static final String JOB_NAME_PUSH_BILLING_RECORD = "pushBillingRecord";
/**
@@ -1019,140 +1026,270 @@ public class MaterialInventoryApplicationService {
public void pushBillingRecord(String shipperId) {
- List materialInventoryPOS = materialInventoryDomainService.queryPushBms(shipperId);
- //未查询到库存记录
- if (materialInventoryPOS==null || materialInventoryPOS.size()==0) return;
- for (MaterialInventoryPO materialInventoryPO : materialInventoryPOS) {
- String businessChargeType = materialInventoryPO.getBusinessChargeType();
- //非散租
- if (!"散租".equals(businessChargeType)) continue;
- Date createTime = materialInventoryPO.getCreateTime();
- Long materialBaseInfoId = materialInventoryPO.getMaterialBaseInfoId();
- String lotNumber = materialInventoryPO.getLotNumber();
- String inOrderNumber = materialInventoryPO.getInOrderNumber();
- Long warehouseId = materialInventoryPO.getWarehouseId();
- Date lastBillingTime = materialInventoryPO.getLastBillingTime();
- String warehouseCode = materialInventoryDomainService.queryWarehouseCode(warehouseId);
- //仓库代码为空
- if (warehouseCode==null) continue;
- if ("CMD".equals(warehouseCode)) {//干仓计费
- Map shipperParameters = materialInventoryDomainService.queryShipperParameters(Long.valueOf(shipperId),"干仓计费配置");
- //客户未配置干仓计费配置
- if (shipperParameters == null || shipperParameters.size()==0) continue;
- Long contractManageId = (Long) shipperParameters.get("contractManageId");
- Long settlementCustomersId = (Long) shipperParameters.get("settlementCustomersId");
- String contractNumber = (String) shipperParameters.get("contractNumber");
- String content = (String) shipperParameters.get("content");
- Map contentMap = content != null ? JSON.parseObject(content, Map.class) : new HashMap<>();
- Integer sfzdcz = (Integer) contentMap.get("sfzdcz");
- //客户未配置或是否自动推送设置为否
- if (sfzdcz==null) continue;
- if (sfzdcz!=1) continue;
- //计算费用
- List