From cd294b3d3f311ad73f41ab728faa5f33b95d6098 Mon Sep 17 00:00:00 2001
From: qianshijiang <1965297290@qq.com>
Date: Wed, 14 Jan 2026 14:33:26 +0800
Subject: [PATCH 1/5] =?UTF-8?q?erp=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../zt/plat/module/erp/api/dto/ErpSubmitReqDTO.java | 4 ++--
.../com/zt/plat/module/erp/utils/ErpConfig.java | 13 ++++++++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/zt-module-erp/zt-module-erp-api/src/main/java/com/zt/plat/module/erp/api/dto/ErpSubmitReqDTO.java b/zt-module-erp/zt-module-erp-api/src/main/java/com/zt/plat/module/erp/api/dto/ErpSubmitReqDTO.java
index d7e5ab14..e2a5b551 100644
--- a/zt-module-erp/zt-module-erp-api/src/main/java/com/zt/plat/module/erp/api/dto/ErpSubmitReqDTO.java
+++ b/zt-module-erp/zt-module-erp-api/src/main/java/com/zt/plat/module/erp/api/dto/ErpSubmitReqDTO.java
@@ -21,7 +21,7 @@ public class ErpSubmitReqDTO {
* "bskey": 调用系统业务单据编号,必须,在外部系统唯一,用于关联
* "usrid": 外部系统用户id
* "usrnm": 外部系统用户名
- * "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定
+ * "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,秘钥另行约定
* "req": {具体参数,参见RFC功能列表}
*/
@Schema(description = "接口编号,必须,参见RFC功能列表,可调用接口编号范围051-900")
@@ -40,7 +40,7 @@ public class ErpSubmitReqDTO {
@NotBlank(message = "外部系统用户名不能为空")
private String usrnm;
- @Schema(description = "签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定")
+ @Schema(description = "签名,uuid+srcsys+密码,MD5 32位小写签名,秘钥另行约定")
private String sign;
@Schema(description = "具体参数,参见RFC功能列表")
diff --git a/zt-module-erp/zt-module-erp-server/src/main/java/com/zt/plat/module/erp/utils/ErpConfig.java b/zt-module-erp/zt-module-erp-server/src/main/java/com/zt/plat/module/erp/utils/ErpConfig.java
index b8585886..fa6dabd7 100644
--- a/zt-module-erp/zt-module-erp-server/src/main/java/com/zt/plat/module/erp/utils/ErpConfig.java
+++ b/zt-module-erp/zt-module-erp-server/src/main/java/com/zt/plat/module/erp/utils/ErpConfig.java
@@ -1,10 +1,12 @@
package com.zt.plat.module.erp.utils;
import cn.hutool.core.util.StrUtil;
+import cn.hutool.crypto.digest.DigestUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpEntity;
@@ -13,6 +15,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
+import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@@ -29,6 +32,9 @@ public class ErpConfig {
@Value("${erp.sapsys:}")
private String sapsys;
+ @Value("${erp.secretKey:}")
+ private String secretKey;
+
/**
* 调用ERP接口获取erp数据
*/
@@ -110,7 +116,11 @@ public class ErpConfig {
requestBody.put("usrid", reqDTO.getUsrid());
requestBody.put("usrnm", reqDTO.getUsrnm());
// todo 密码另行约定
- //requestBody.put("sign", StrUtil.(uuid + sapsys + "密码另行约定"));
+ if (StringUtils.isBlank(reqDTO.getSign())) {
+ requestBody.put("sign", DigestUtil.md5Hex(uuid + "DSC" + secretKey, StandardCharsets.UTF_8));
+ } else {
+ requestBody.put("sign", reqDTO.getSign());
+ }
if (reqDTO.getReq() != null) {
requestBody.put("req", reqDTO.getReq());
}
@@ -166,4 +176,5 @@ public class ErpConfig {
}
}
+
}
From c31b08f648a6ce326f474aedda4251c40a648182 Mon Sep 17 00:00:00 2001
From: qianshijiang <1965297290@qq.com>
Date: Wed, 14 Jan 2026 14:37:15 +0800
Subject: [PATCH 2/5] =?UTF-8?q?erp=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
base-server/src/main/resources/application-dev.yml | 2 ++
base-server/src/main/resources/application-local.yml | 2 ++
2 files changed, 4 insertions(+)
diff --git a/base-server/src/main/resources/application-dev.yml b/base-server/src/main/resources/application-dev.yml
index dde03828..7fe41af2 100644
--- a/base-server/src/main/resources/application-dev.yml
+++ b/base-server/src/main/resources/application-dev.yml
@@ -111,9 +111,11 @@ justauth:
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
+# erp相关配置
erp:
address: hana-dev.yncic.com
sapsys: ZTDEV203
+ secretKey: 123456789 # erp秘钥
eplat:
share:
diff --git a/base-server/src/main/resources/application-local.yml b/base-server/src/main/resources/application-local.yml
index 0f27eee8..3511ab7f 100644
--- a/base-server/src/main/resources/application-local.yml
+++ b/base-server/src/main/resources/application-local.yml
@@ -101,9 +101,11 @@ zt:
access-log: # 访问日志的配置项
enable: true
+# erp相关配置
erp:
address: hana-dev.yncic.com
sapsys: ZTDEV203
+ secretKey: 123456789 # erp秘钥
eplat:
share:
From bea4a3fe74735e351a9ba53ce51c37ca54c86783 Mon Sep 17 00:00:00 2001
From: wuzongyong <13203449218@163.com>
Date: Wed, 14 Jan 2026 15:21:42 +0800
Subject: [PATCH 3/5] =?UTF-8?q?feat(job):=20=E6=B7=BB=E5=8A=A0=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=E7=9A=84xxljob?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/zt/plat/module/base/job/TestJob.java | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/job/TestJob.java
diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/job/TestJob.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/job/TestJob.java
new file mode 100644
index 00000000..ef389213
--- /dev/null
+++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/job/TestJob.java
@@ -0,0 +1,60 @@
+package com.zt.plat.module.base.job;
+
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.zt.plat.framework.tenant.core.job.TenantJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * 测试定时任务
+ *
+ * @author base
+ */
+@Component
+@Slf4j
+public class TestJob {
+
+ private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+ /**
+ * 简单测试任务
+ */
+ @XxlJob("testSimpleJob")
+ @TenantJob
+ public void testSimpleJob() {
+ String currentTime = LocalDateTime.now().format(FORMATTER);
+ log.info("[testSimpleJob][开始执行] 当前时间: {}", currentTime);
+
+ try {
+ // 模拟业务处理
+ Thread.sleep(2000);
+ log.info("[testSimpleJob][执行成功] 任务已完成");
+ } catch (Exception e) {
+ log.error("[testSimpleJob][执行失败] 错误信息: {}", e.getMessage(), e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * 带参数的测试任务
+ */
+ @XxlJob("testParamJob")
+ @TenantJob
+ public void testParamJob() {
+ String currentTime = LocalDateTime.now().format(FORMATTER);
+ log.info("[testParamJob][开始执行] 当前时间: {}", currentTime);
+
+ try {
+ // 模拟带参数的业务处理
+ log.info("[testParamJob][处理中] 正在处理业务逻辑...");
+ Thread.sleep(1000);
+ log.info("[testParamJob][执行成功] 任务已完成");
+ } catch (Exception e) {
+ log.error("[testParamJob][执行失败] 错误信息: {}", e.getMessage(), e);
+ throw new RuntimeException(e);
+ }
+ }
+}
From f8d83607a7eaa4e44ef9a3ad738ba5366ec43d9d Mon Sep 17 00:00:00 2001
From: ranke <213539@qq.com>
Date: Wed, 14 Jan 2026 15:25:00 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=B1=95=E7=A4=BA=E5=BC=B9=E7=AA=97=EF=BC=8C?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=9A=E7=94=A8=E7=89=A9=E6=96=99=E5=B1=9E?=
=?UTF-8?q?=E6=80=A7=E7=9A=84=E5=8F=AA=E8=AF=BB=E5=B1=95=E7=A4=BA,=20?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E6=95=88=E7=8E=87=20=20http://172.16.46.63:31560/inde?=
=?UTF-8?q?x.php=3Fm=3Dtask&f=3Dview&taskID=3D706?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/logback-spring.xml | 4 +++
sql/dm/2026-1-14物料相关表增加索引.sql | 29 +++++++++++++++++++
.../MaterialHasPropertiesDeptController.java | 2 +-
.../MaterialPropertiesDeptController.java | 8 ++---
.../MaterialHasPropertiesServiceImpl.java | 10 +++++--
5 files changed, 46 insertions(+), 7 deletions(-)
create mode 100644 sql/dm/2026-1-14物料相关表增加索引.sql
diff --git a/base-server/src/main/resources/logback-spring.xml b/base-server/src/main/resources/logback-spring.xml
index 19d38bf5..2156fc14 100644
--- a/base-server/src/main/resources/logback-spring.xml
+++ b/base-server/src/main/resources/logback-spring.xml
@@ -108,4 +108,8 @@
+
+
+
+
diff --git a/sql/dm/2026-1-14物料相关表增加索引.sql b/sql/dm/2026-1-14物料相关表增加索引.sql
new file mode 100644
index 00000000..2ab2ea62
--- /dev/null
+++ b/sql/dm/2026-1-14物料相关表增加索引.sql
@@ -0,0 +1,29 @@
+CREATE INDEX idx_hs_cls_tenant_deleted_cls
+ ON bse_mtrl_hs_cls(tenant_id, deleted, CLS_ID, INF_ID);
+
+CREATE INDEX idx_hs_cls_composite
+ ON bse_mtrl_hs_cls(tenant_id, deleted, CLS_ID);
+
+CREATE INDEX idx_mtrl_inf_tenant_deleted_id
+ ON bse_mtrl_inf(tenant_id, deleted, id);
+
+CREATE INDEX idx_mtrl_inf_tenant_deleted_cd
+ ON bse_mtrl_inf(tenant_id, deleted, CD, id);
+
+CREATE INDEX idx_mtrl_inf_cover
+ ON bse_mtrl_inf(tenant_id, deleted, CD, id, NAME, RMK, create_time, update_time, creator, updater);
+
+CREATE INDEX idx_hs_prps_tenant_deleted_inf
+ ON bse_mtrl_hs_prps(tenant_id, deleted, INF_ID, PRPS_ID);
+
+CREATE INDEX idx_hs_prps_tenant_inf_deleted
+ ON bse_mtrl_hs_prps(tenant_id, INF_ID, deleted);
+
+CREATE INDEX idx_hs_prps_cover
+ ON bse_mtrl_hs_prps(tenant_id, deleted, INF_ID, PRPS_ID, UNT_ID, IS_KY, IS_MTNG, SRT, DEPT_ID);
+
+CREATE INDEX idx_mtrl_prps_tenant_deleted_id
+ ON bse_mtrl_prps(tenant_id, deleted, id);
+
+CREATE INDEX idx_mtrl_prps_cover
+ ON bse_mtrl_prps(tenant_id, deleted, id, CD, NAME, UNT_QTY_ID, DIC_DAT_VAL, DAT_TP, RMK, DEPT_ID);
\ No newline at end of file
diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialhasproperties/MaterialHasPropertiesDeptController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialhasproperties/MaterialHasPropertiesDeptController.java
index 27e8fb63..08bb476a 100644
--- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialhasproperties/MaterialHasPropertiesDeptController.java
+++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialhasproperties/MaterialHasPropertiesDeptController.java
@@ -52,7 +52,7 @@ public class MaterialHasPropertiesDeptController {
public CommonResult batchSave(@Valid @RequestBody MaterialHasPropertiesBatchSaveReqVO reqVO) {
Long deptId = reqVO.getDeptId();
if (deptId == null) {
- throw new ServiceException(401, "部门ID不能为空");
+ throw new ServiceException(500, "部门ID不能为空");
}
MaterialHasPropertiesBatchSaveRespVO resp = materialHasPropertiesService.batchSave(reqVO, deptId);
return success(resp);
diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialproperties/MaterialPropertiesDeptController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialproperties/MaterialPropertiesDeptController.java
index fe37ca8e..e1237a90 100644
--- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialproperties/MaterialPropertiesDeptController.java
+++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/materialproperties/MaterialPropertiesDeptController.java
@@ -97,7 +97,7 @@ public class MaterialPropertiesDeptController {
public CommonResult getMaterialProperties(@RequestParam("id") Long id) {
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
if (materialProperties.getDeptId() == null) {
- throw new ServiceException(401, "没有权限");
+ throw new ServiceException(500, "没有权限");
}
return success(materialProperties);
}
@@ -107,7 +107,7 @@ public class MaterialPropertiesDeptController {
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
public CommonResult> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
if (pageReqVO.getDeptId() == null) {
- throw new ServiceException(401, "部门ID不能为空");
+ throw new ServiceException(500, "部门ID不能为空");
}
PageResult pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
return success(pageResult);
@@ -118,7 +118,7 @@ public class MaterialPropertiesDeptController {
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
public CommonResult> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
if (pageReqVO.getDeptId() == null) {
- throw new ServiceException(401, "部门ID不能为空");
+ throw new ServiceException(500, "部门ID不能为空");
}
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
}
@@ -130,7 +130,7 @@ public class MaterialPropertiesDeptController {
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
if (pageReqVO.getDeptId() == null) {
- throw new ServiceException(401, "部门ID不能为空");
+ throw new ServiceException(500, "部门ID不能为空");
}
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/materialhasproperties/MaterialHasPropertiesServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/materialhasproperties/MaterialHasPropertiesServiceImpl.java
index 6681d747..d9903e76 100644
--- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/materialhasproperties/MaterialHasPropertiesServiceImpl.java
+++ b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/materialhasproperties/MaterialHasPropertiesServiceImpl.java
@@ -114,8 +114,14 @@ public class MaterialHasPropertiesServiceImpl implements MaterialHasPropertiesSe
return resp;
}
// 全量替换:先删除该物料的已有属性
- materialHasPropertiesMapper.delete(new LambdaQueryWrapperX()
- .eq(MaterialHasPropertiesDO::getInfomationId, infoId));
+ LambdaQueryWrapperX delQuery = new LambdaQueryWrapperX<>();
+ delQuery.eq(MaterialHasPropertiesDO::getInfomationId, infoId);
+ if (deptId == null) {
+ delQuery.isNull(MaterialHasPropertiesDO::getDeptId);
+ } else {
+ delQuery.eq(MaterialHasPropertiesDO::getDeptId, deptId);
+ }
+ materialHasPropertiesMapper.delete(delQuery);
List properties = batchReqVO.getProperties();
if (CollUtil.isEmpty(properties)) {
From 1732d1424b4c1c1c8be7985eb5c417988ef0eaab Mon Sep 17 00:00:00 2001
From: qianshijiang <1965297290@qq.com>
Date: Wed, 14 Jan 2026 15:41:49 +0800
Subject: [PATCH 5/5] =?UTF-8?q?erp=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
base-server/src/main/resources/logback-spring.xml | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/base-server/src/main/resources/logback-spring.xml b/base-server/src/main/resources/logback-spring.xml
index 2156fc14..c932c0af 100644
--- a/base-server/src/main/resources/logback-spring.xml
+++ b/base-server/src/main/resources/logback-spring.xml
@@ -90,6 +90,9 @@
+
+
+
@@ -107,9 +110,4 @@
-
-
-
-
-