Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -111,9 +111,11 @@ justauth:
|
|||||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||||
|
|
||||||
|
# erp相关配置
|
||||||
erp:
|
erp:
|
||||||
address: hana-dev.yncic.com
|
address: hana-dev.yncic.com
|
||||||
sapsys: ZTDEV203
|
sapsys: ZTDEV203
|
||||||
|
secretKey: 123456789 # erp秘钥
|
||||||
|
|
||||||
eplat:
|
eplat:
|
||||||
share:
|
share:
|
||||||
|
|||||||
@@ -101,9 +101,11 @@ zt:
|
|||||||
access-log: # 访问日志的配置项
|
access-log: # 访问日志的配置项
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
|
# erp相关配置
|
||||||
erp:
|
erp:
|
||||||
address: hana-dev.yncic.com
|
address: hana-dev.yncic.com
|
||||||
sapsys: ZTDEV203
|
sapsys: ZTDEV203
|
||||||
|
secretKey: 123456789 # erp秘钥
|
||||||
|
|
||||||
eplat:
|
eplat:
|
||||||
share:
|
share:
|
||||||
|
|||||||
@@ -90,6 +90,9 @@
|
|||||||
<logger name="com.zt.plat.module.base.dal.mysql" level="DEBUG" additivity="false">
|
<logger name="com.zt.plat.module.base.dal.mysql" level="DEBUG" additivity="false">
|
||||||
<appender-ref ref="STDOUT"/>
|
<appender-ref ref="STDOUT"/>
|
||||||
</logger>
|
</logger>
|
||||||
|
<logger name="com.zt.plat.module.base.dal.dao" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="STDOUT"/>
|
||||||
|
</logger>
|
||||||
<logger name="com.zt.plat.module.contractorder.dal.mysql" level="DEBUG" additivity="false">
|
<logger name="com.zt.plat.module.contractorder.dal.mysql" level="DEBUG" additivity="false">
|
||||||
<appender-ref ref="STDOUT"/>
|
<appender-ref ref="STDOUT"/>
|
||||||
</logger>
|
</logger>
|
||||||
@@ -107,5 +110,4 @@
|
|||||||
<appender-ref ref="GRPC"/>
|
<appender-ref ref="GRPC"/>
|
||||||
</root>
|
</root>
|
||||||
</springProfile>
|
</springProfile>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
29
sql/dm/2026-1-14物料相关表增加索引.sql
Normal file
29
sql/dm/2026-1-14物料相关表增加索引.sql
Normal file
@@ -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);
|
||||||
@@ -52,7 +52,7 @@ public class MaterialHasPropertiesDeptController {
|
|||||||
public CommonResult<MaterialHasPropertiesBatchSaveRespVO> batchSave(@Valid @RequestBody MaterialHasPropertiesBatchSaveReqVO reqVO) {
|
public CommonResult<MaterialHasPropertiesBatchSaveRespVO> batchSave(@Valid @RequestBody MaterialHasPropertiesBatchSaveReqVO reqVO) {
|
||||||
Long deptId = reqVO.getDeptId();
|
Long deptId = reqVO.getDeptId();
|
||||||
if (deptId == null) {
|
if (deptId == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
MaterialHasPropertiesBatchSaveRespVO resp = materialHasPropertiesService.batchSave(reqVO, deptId);
|
MaterialHasPropertiesBatchSaveRespVO resp = materialHasPropertiesService.batchSave(reqVO, deptId);
|
||||||
return success(resp);
|
return success(resp);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
public CommonResult<MaterialPropertiesRespVO> getMaterialProperties(@RequestParam("id") Long id) {
|
public CommonResult<MaterialPropertiesRespVO> getMaterialProperties(@RequestParam("id") Long id) {
|
||||||
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
|
MaterialPropertiesRespVO materialProperties = materialPropertiesService.getMaterialProperties(id);
|
||||||
if (materialProperties.getDeptId() == null) {
|
if (materialProperties.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "没有权限");
|
throw new ServiceException(500, "没有权限");
|
||||||
}
|
}
|
||||||
return success(materialProperties);
|
return success(materialProperties);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
||||||
public CommonResult<PageResult<MaterialPropertiesRespVO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
|
public CommonResult<PageResult<MaterialPropertiesRespVO>> getMaterialPropertiesPage(@Valid MaterialPropertiesPageReqVO pageReqVO) {
|
||||||
if (pageReqVO.getDeptId() == null) {
|
if (pageReqVO.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
PageResult<MaterialPropertiesRespVO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
|
PageResult<MaterialPropertiesRespVO> pageResult = materialPropertiesService.getMaterialPropertiesPage(pageReqVO);
|
||||||
return success(pageResult);
|
return success(pageResult);
|
||||||
@@ -118,7 +118,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
@PreAuthorize("@ss.hasPermission('base:material-properties-dept:query')")
|
||||||
public CommonResult<PageResult<MaterialPropertiesSimpleRespVO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
|
public CommonResult<PageResult<MaterialPropertiesSimpleRespVO>> getMaterialPropertiesSimplePage(@Valid MaterialPropertiesSimplePageReqVO pageReqVO) {
|
||||||
if (pageReqVO.getDeptId() == null) {
|
if (pageReqVO.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
|
return success(materialPropertiesService.getMaterialPropertiesSimplePage(pageReqVO));
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ public class MaterialPropertiesDeptController {
|
|||||||
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
|
public void exportMaterialPropertiesExcel(@Valid MaterialPropertiesPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
if (pageReqVO.getDeptId() == null) {
|
if (pageReqVO.getDeptId() == null) {
|
||||||
throw new ServiceException(401, "部门ID不能为空");
|
throw new ServiceException(500, "部门ID不能为空");
|
||||||
}
|
}
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<MaterialPropertiesRespVO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
|
List<MaterialPropertiesRespVO> list = materialPropertiesService.getMaterialPropertiesPage(pageReqVO).getList();
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -114,8 +114,14 @@ public class MaterialHasPropertiesServiceImpl implements MaterialHasPropertiesSe
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
// 全量替换:先删除该物料的已有属性
|
// 全量替换:先删除该物料的已有属性
|
||||||
materialHasPropertiesMapper.delete(new LambdaQueryWrapperX<MaterialHasPropertiesDO>()
|
LambdaQueryWrapperX<MaterialHasPropertiesDO> delQuery = new LambdaQueryWrapperX<>();
|
||||||
.eq(MaterialHasPropertiesDO::getInfomationId, infoId));
|
delQuery.eq(MaterialHasPropertiesDO::getInfomationId, infoId);
|
||||||
|
if (deptId == null) {
|
||||||
|
delQuery.isNull(MaterialHasPropertiesDO::getDeptId);
|
||||||
|
} else {
|
||||||
|
delQuery.eq(MaterialHasPropertiesDO::getDeptId, deptId);
|
||||||
|
}
|
||||||
|
materialHasPropertiesMapper.delete(delQuery);
|
||||||
|
|
||||||
List<MaterialHasPropertiesBatchItemReqVO> properties = batchReqVO.getProperties();
|
List<MaterialHasPropertiesBatchItemReqVO> properties = batchReqVO.getProperties();
|
||||||
if (CollUtil.isEmpty(properties)) {
|
if (CollUtil.isEmpty(properties)) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class ErpSubmitReqDTO {
|
|||||||
* "bskey": 调用系统业务单据编号,必须,在外部系统唯一,用于关联
|
* "bskey": 调用系统业务单据编号,必须,在外部系统唯一,用于关联
|
||||||
* "usrid": 外部系统用户id
|
* "usrid": 外部系统用户id
|
||||||
* "usrnm": 外部系统用户名
|
* "usrnm": 外部系统用户名
|
||||||
* "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定
|
* "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,秘钥另行约定
|
||||||
* "req": {具体参数,参见RFC功能列表}
|
* "req": {具体参数,参见RFC功能列表}
|
||||||
*/
|
*/
|
||||||
@Schema(description = "接口编号,必须,参见RFC功能列表,可调用接口编号范围051-900")
|
@Schema(description = "接口编号,必须,参见RFC功能列表,可调用接口编号范围051-900")
|
||||||
@@ -40,7 +40,7 @@ public class ErpSubmitReqDTO {
|
|||||||
@NotBlank(message = "外部系统用户名不能为空")
|
@NotBlank(message = "外部系统用户名不能为空")
|
||||||
private String usrnm;
|
private String usrnm;
|
||||||
|
|
||||||
@Schema(description = "签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定")
|
@Schema(description = "签名,uuid+srcsys+密码,MD5 32位小写签名,秘钥另行约定")
|
||||||
private String sign;
|
private String sign;
|
||||||
|
|
||||||
@Schema(description = "具体参数,参见RFC功能列表")
|
@Schema(description = "具体参数,参见RFC功能列表")
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.zt.plat.module.erp.utils;
|
package com.zt.plat.module.erp.utils;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.crypto.digest.DigestUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
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.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
@@ -13,6 +15,7 @@ import org.springframework.http.MediaType;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@@ -29,6 +32,9 @@ public class ErpConfig {
|
|||||||
@Value("${erp.sapsys:}")
|
@Value("${erp.sapsys:}")
|
||||||
private String sapsys;
|
private String sapsys;
|
||||||
|
|
||||||
|
@Value("${erp.secretKey:}")
|
||||||
|
private String secretKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调用ERP接口获取erp数据
|
* 调用ERP接口获取erp数据
|
||||||
*/
|
*/
|
||||||
@@ -110,7 +116,11 @@ public class ErpConfig {
|
|||||||
requestBody.put("usrid", reqDTO.getUsrid());
|
requestBody.put("usrid", reqDTO.getUsrid());
|
||||||
requestBody.put("usrnm", reqDTO.getUsrnm());
|
requestBody.put("usrnm", reqDTO.getUsrnm());
|
||||||
// todo 密码另行约定
|
// 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) {
|
if (reqDTO.getReq() != null) {
|
||||||
requestBody.put("req", reqDTO.getReq());
|
requestBody.put("req", reqDTO.getReq());
|
||||||
}
|
}
|
||||||
@@ -166,4 +176,5 @@ public class ErpConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user