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::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
|
||||
# erp相关配置
|
||||
erp:
|
||||
address: hana-dev.yncic.com
|
||||
sapsys: ZTDEV203
|
||||
secretKey: 123456789 # erp秘钥
|
||||
|
||||
eplat:
|
||||
share:
|
||||
|
||||
@@ -101,9 +101,11 @@ zt:
|
||||
access-log: # 访问日志的配置项
|
||||
enable: true
|
||||
|
||||
# erp相关配置
|
||||
erp:
|
||||
address: hana-dev.yncic.com
|
||||
sapsys: ZTDEV203
|
||||
secretKey: 123456789 # erp秘钥
|
||||
|
||||
eplat:
|
||||
share:
|
||||
|
||||
@@ -40,14 +40,14 @@ public class AccountController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建账户条款")
|
||||
@PreAuthorize("@ss.hasPermission('base:account:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('base:account:create')")
|
||||
public CommonResult<AccountRespVO> createAccount(@Valid @RequestBody AccountSaveReqVO createReqVO) {
|
||||
return success(accountService.createAccount(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新账户条款")
|
||||
@PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||
//@PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||
public CommonResult<Boolean> updateAccount(@Valid @RequestBody AccountSaveReqVO updateReqVO) {
|
||||
accountService.updateAccount(updateReqVO);
|
||||
return success(true);
|
||||
@@ -56,7 +56,7 @@ public class AccountController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除账户条款")
|
||||
@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) {
|
||||
accountService.deleteAccount(id);
|
||||
return success(true);
|
||||
@@ -65,7 +65,7 @@ public class AccountController {
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除账户条款")
|
||||
@PreAuthorize("@ss.hasPermission('base:account:delete')")
|
||||
//@PreAuthorize("@ss.hasPermission('base:account:delete')")
|
||||
public CommonResult<Boolean> deleteAccountList(@RequestBody BatchDeleteReqVO req) {
|
||||
accountService.deleteAccountListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -103,7 +103,7 @@ public class AccountController {
|
||||
|
||||
@PutMapping("/enable-list")
|
||||
@Operation(summary = "批量更新账户条款")
|
||||
@PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||
// @PreAuthorize("@ss.hasPermission('base:account:update')")
|
||||
public CommonResult<Boolean> enableAccountList(@RequestBody List<AccountSaveReqVO> saveReqVOS) {
|
||||
accountService.enableAccountList(saveReqVOS);
|
||||
return success(true);
|
||||
|
||||
@@ -13,7 +13,7 @@ public class AccountSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "类型不能为空")
|
||||
// @NotEmpty(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
|
||||
@@ -67,41 +67,41 @@ public class AccountDO extends BusinessBaseDO {
|
||||
@TableField("CSTM_NAME")
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 公司编号
|
||||
*/
|
||||
@TableField("COMPANY_ID")
|
||||
private Long companyId;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
@TableField("COMPANY_NAME")
|
||||
private String companyName;
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
@TableField("DEPT_ID")
|
||||
private Long deptId;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@TableField("DEPT_NAME")
|
||||
private String deptName;
|
||||
/**
|
||||
* 岗位编号
|
||||
*/
|
||||
@TableField("POST_ID")
|
||||
private Long postId;
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
@TableField("CREATOR_NAME")
|
||||
private String creatorName;
|
||||
/**
|
||||
* 更新人名称
|
||||
*/
|
||||
@TableField("UPDATER_NAME")
|
||||
private String updaterName;
|
||||
// /**
|
||||
// * 公司编号
|
||||
// */
|
||||
// @TableField("COMPANY_ID")
|
||||
// private Long companyId;
|
||||
// /**
|
||||
// * 公司名称
|
||||
// */
|
||||
// @TableField("COMPANY_NAME")
|
||||
// private String companyName;
|
||||
// /**
|
||||
// * 部门编号
|
||||
// */
|
||||
// @TableField("DEPT_ID")
|
||||
// private Long deptId;
|
||||
// /**
|
||||
// * 部门名称
|
||||
// */
|
||||
// @TableField("DEPT_NAME")
|
||||
// private String deptName;
|
||||
// /**
|
||||
// * 岗位编号
|
||||
// */
|
||||
// @TableField("POST_ID")
|
||||
// private Long postId;
|
||||
// /**
|
||||
// * 创建人名称
|
||||
// */
|
||||
// @TableField("CREATOR_NAME")
|
||||
// private String creatorName;
|
||||
// /**
|
||||
// * 更新人名称
|
||||
// */
|
||||
// @TableField("UPDATER_NAME")
|
||||
// private String updaterName;
|
||||
|
||||
@TableField("ADDRESS")
|
||||
private String address;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ElementServiceImpl implements ElementService {
|
||||
// 校验存在
|
||||
validateElementExists(updateReqVO.getId());
|
||||
// 校验存在
|
||||
// validateElementCodeExists(updateReqVO.getAbbreviation());
|
||||
validateElementCodeExists(updateReqVO.getAbbreviation());
|
||||
// 更新
|
||||
ElementDO updateObj = BeanUtils.toBean(updateReqVO, ElementDO.class);
|
||||
elementMapper.updateById(updateObj);
|
||||
|
||||
@@ -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功能列表")
|
||||
|
||||
@@ -39,7 +39,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
@RestController
|
||||
@RequestMapping("/base/internal-warehouse")
|
||||
@Validated
|
||||
public class InternalWarehouseController implements BusinessControllerMarker {
|
||||
public class InternalWarehouseController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user