Merge remote-tracking branch 'origin/dev' into test
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:
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ public class AccountController {
|
|||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建账户条款")
|
@Operation(summary = "创建账户条款")
|
||||||
@PreAuthorize("@ss.hasPermission('base:account:create')")
|
// @PreAuthorize("@ss.hasPermission('base:account:create')")
|
||||||
public CommonResult<AccountRespVO> createAccount(@Valid @RequestBody AccountSaveReqVO createReqVO) {
|
public CommonResult<AccountRespVO> createAccount(@Valid @RequestBody AccountSaveReqVO createReqVO) {
|
||||||
return success(accountService.createAccount(createReqVO));
|
return success(accountService.createAccount(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新账户条款")
|
@Operation(summary = "更新账户条款")
|
||||||
@PreAuthorize("@ss.hasPermission('base:account:update')")
|
//@PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||||
public CommonResult<Boolean> updateAccount(@Valid @RequestBody AccountSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateAccount(@Valid @RequestBody AccountSaveReqVO updateReqVO) {
|
||||||
accountService.updateAccount(updateReqVO);
|
accountService.updateAccount(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -56,7 +56,7 @@ public class AccountController {
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除账户条款")
|
@Operation(summary = "删除账户条款")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('base:account:delete')")
|
//@PreAuthorize("@ss.hasPermission('base:account:delete')")
|
||||||
public CommonResult<Boolean> deleteAccount(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteAccount(@RequestParam("id") Long id) {
|
||||||
accountService.deleteAccount(id);
|
accountService.deleteAccount(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -65,7 +65,7 @@ public class AccountController {
|
|||||||
@DeleteMapping("/delete-list")
|
@DeleteMapping("/delete-list")
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
@Operation(summary = "批量删除账户条款")
|
@Operation(summary = "批量删除账户条款")
|
||||||
@PreAuthorize("@ss.hasPermission('base:account:delete')")
|
//@PreAuthorize("@ss.hasPermission('base:account:delete')")
|
||||||
public CommonResult<Boolean> deleteAccountList(@RequestBody BatchDeleteReqVO req) {
|
public CommonResult<Boolean> deleteAccountList(@RequestBody BatchDeleteReqVO req) {
|
||||||
accountService.deleteAccountListByIds(req.getIds());
|
accountService.deleteAccountListByIds(req.getIds());
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -103,7 +103,7 @@ public class AccountController {
|
|||||||
|
|
||||||
@PutMapping("/enable-list")
|
@PutMapping("/enable-list")
|
||||||
@Operation(summary = "批量更新账户条款")
|
@Operation(summary = "批量更新账户条款")
|
||||||
@PreAuthorize("@ss.hasPermission('base:account:update')")
|
// @PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||||
public CommonResult<Boolean> enableAccountList(@RequestBody List<AccountSaveReqVO> saveReqVOS) {
|
public CommonResult<Boolean> enableAccountList(@RequestBody List<AccountSaveReqVO> saveReqVOS) {
|
||||||
accountService.enableAccountList(saveReqVOS);
|
accountService.enableAccountList(saveReqVOS);
|
||||||
return success(true);
|
return success(true);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class AccountSaveReqVO {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@NotEmpty(message = "类型不能为空")
|
// @NotEmpty(message = "类型不能为空")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
@Schema(description = "户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
|||||||
@@ -67,41 +67,41 @@ public class AccountDO extends BusinessBaseDO {
|
|||||||
@TableField("CSTM_NAME")
|
@TableField("CSTM_NAME")
|
||||||
private String customerName;
|
private String customerName;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 公司编号
|
// * 公司编号
|
||||||
*/
|
// */
|
||||||
@TableField("COMPANY_ID")
|
// @TableField("COMPANY_ID")
|
||||||
private Long companyId;
|
// private Long companyId;
|
||||||
/**
|
// /**
|
||||||
* 公司名称
|
// * 公司名称
|
||||||
*/
|
// */
|
||||||
@TableField("COMPANY_NAME")
|
// @TableField("COMPANY_NAME")
|
||||||
private String companyName;
|
// private String companyName;
|
||||||
/**
|
// /**
|
||||||
* 部门编号
|
// * 部门编号
|
||||||
*/
|
// */
|
||||||
@TableField("DEPT_ID")
|
// @TableField("DEPT_ID")
|
||||||
private Long deptId;
|
// private Long deptId;
|
||||||
/**
|
// /**
|
||||||
* 部门名称
|
// * 部门名称
|
||||||
*/
|
// */
|
||||||
@TableField("DEPT_NAME")
|
// @TableField("DEPT_NAME")
|
||||||
private String deptName;
|
// private String deptName;
|
||||||
/**
|
// /**
|
||||||
* 岗位编号
|
// * 岗位编号
|
||||||
*/
|
// */
|
||||||
@TableField("POST_ID")
|
// @TableField("POST_ID")
|
||||||
private Long postId;
|
// private Long postId;
|
||||||
/**
|
// /**
|
||||||
* 创建人名称
|
// * 创建人名称
|
||||||
*/
|
// */
|
||||||
@TableField("CREATOR_NAME")
|
// @TableField("CREATOR_NAME")
|
||||||
private String creatorName;
|
// private String creatorName;
|
||||||
/**
|
// /**
|
||||||
* 更新人名称
|
// * 更新人名称
|
||||||
*/
|
// */
|
||||||
@TableField("UPDATER_NAME")
|
// @TableField("UPDATER_NAME")
|
||||||
private String updaterName;
|
// private String updaterName;
|
||||||
|
|
||||||
@TableField("ADDRESS")
|
@TableField("ADDRESS")
|
||||||
private String address;
|
private String address;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ElementServiceImpl implements ElementService {
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateElementExists(updateReqVO.getId());
|
validateElementExists(updateReqVO.getId());
|
||||||
// 校验存在
|
// 校验存在
|
||||||
// validateElementCodeExists(updateReqVO.getAbbreviation());
|
validateElementCodeExists(updateReqVO.getAbbreviation());
|
||||||
// 更新
|
// 更新
|
||||||
ElementDO updateObj = BeanUtils.toBean(updateReqVO, ElementDO.class);
|
ElementDO updateObj = BeanUtils.toBean(updateReqVO, ElementDO.class);
|
||||||
elementMapper.updateById(updateObj);
|
elementMapper.updateById(updateObj);
|
||||||
|
|||||||
@@ -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