|
@@ -6,6 +6,7 @@ import cn.hutool.core.util.NumberUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.OladingCommonRequest;
|
|
@@ -27,6 +28,7 @@ import com.qunzhixinxi.hnqz.admin.service.ZhongyiyunInputRecordService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.ZhongzhiInputRecordService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.gig.GigThirdApiService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.gig.OladingInputRecordService;
|
|
|
+import com.qunzhixinxi.hnqz.admin.util.SaasApiDemoV2;
|
|
|
import com.qunzhixinxi.hnqz.admin.util.ZhongyiyunUtils;
|
|
|
import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
|
|
|
import com.qunzhixinxi.hnqz.common.security.annotation.Inner;
|
|
@@ -150,10 +152,8 @@ public class GigThirdApiController {
|
|
|
}
|
|
|
|
|
|
String decryptDataStr = null;
|
|
|
- JSONObject newBodyJson = null;
|
|
|
+ com.alibaba.fastjson.JSONObject unPackMessage = null;
|
|
|
try {
|
|
|
- Boolean encryptedState = bodyJson.getBool("encryptedState");
|
|
|
-
|
|
|
// 查询deptSub获取desKey
|
|
|
SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
|
|
|
.eq(SysDeptSub::getEnableFlag, "1")
|
|
@@ -164,20 +164,11 @@ public class GigThirdApiController {
|
|
|
return "fail";
|
|
|
}
|
|
|
|
|
|
- String desKey = StrUtil.split(deptSub.getAppId(), "|").get(2);
|
|
|
+ String publicKey = deptSub.getRsaPublicKey();
|
|
|
|
|
|
- // 验签 略
|
|
|
- if (encryptedState) {
|
|
|
- // 解密data
|
|
|
- decryptDataStr = ZhongyiyunUtils.decrypt(data, desKey);
|
|
|
- newBodyJson = JSONUtil.parseObj(decryptDataStr);
|
|
|
- } else {
|
|
|
- decryptDataStr = data;
|
|
|
- newBodyJson = JSONUtil.parseObj(data);
|
|
|
- }
|
|
|
- // 解密data
|
|
|
- decryptDataStr = ZhongyiyunUtils.decrypt(data, desKey);
|
|
|
- newBodyJson = JSONUtil.parseObj(decryptDataStr);
|
|
|
+ // 验签/解密
|
|
|
+ unPackMessage =
|
|
|
+ SaasApiDemoV2.unPackMessage(JSON.parseObject(body), com.alibaba.fastjson.JSONObject.class, publicKey);
|
|
|
} catch (Exception e) {
|
|
|
log.error("福建企赋签约回调参数异常", e);
|
|
|
return "fail";
|
|
@@ -192,7 +183,7 @@ public class GigThirdApiController {
|
|
|
}
|
|
|
|
|
|
// 业务处理
|
|
|
- gigThirdApiService.qiFuSignNotify(newBodyJson);
|
|
|
+ gigThirdApiService.qiFuSignNotify(unPackMessage);
|
|
|
|
|
|
return "success";
|
|
|
}
|