Merge remote-tracking branch 'origin/cc_20250325_select' into cc_20250325_select

This commit is contained in:
shuo.wang
2025-04-17 16:37:23 +08:00
16 changed files with 124 additions and 29 deletions

View File

@@ -252,6 +252,7 @@ public enum ErrorCodeEnum {
SYSTEM_DATA_ERROR(151004,"平台账号不能为空",null),
CURRENT_STATUS_NOT_OPERATION(151005,"平台账号当前非审核状态!不能提交审核",null),
CURRENT_ENTRY_STATUS_NOT_OPERATION(151006,"进件状态未审核!不能执行该操作",null),
GET_YLS_CODE_FAIL(151006,"系统无云流水编码无法获取TOKEN请先维护该编码",null),
;

View File

@@ -81,10 +81,9 @@ public class ServiceException extends RuntimeException{
}
public ServiceException(ErrorCodeEnum responseEnum, Object... objects) {
super(responseEnum.getMessage());
String message = MessageFormat.format(responseEnum.getMessage(), objects);
super(MessageFormat.format(responseEnum.getMessage(), objects));
this.errorCode = responseEnum.getCode();
this.errorMessage = message;
this.errorMessage = super.getMessage();
}

View File

@@ -68,6 +68,9 @@ public class HmacSigner {
}
private static String hmacSha256(String secret, String data) throws Exception {
if (StringUtil.isEmpty(secret)){
return "";
}
Mac mac = Mac.getInstance(HMAC_ALGORITHM);
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), HMAC_ALGORITHM));
byte[] hash = mac.doFinal(data.getBytes(StandardCharsets.UTF_8));

View File

@@ -25,7 +25,7 @@ public class OpenSignatureUtil {
// 2. 创建不包含固定参数的临时Map用于排序
Map<String, String> sortedParams = new TreeMap<>(
params.entrySet().stream()
.filter(e -> !"appkey".equals(e.getKey()))
.filter(e -> !"appKey".equals(e.getKey()))
.filter(e -> !"timestamp".equals(e.getKey()))
.filter(e -> !"sign".equals(e.getKey()))
.collect(Collectors.toMap(