|
@@ -110,16 +110,40 @@ public class GigThirdApiController {
|
|
|
return "fail";
|
|
|
}
|
|
|
|
|
|
- // 请求记录到数据库
|
|
|
- QifuInputRecord inputRecord = new QifuInputRecord();
|
|
|
- inputRecord.setReqId(reqId);
|
|
|
- inputRecord.setReqType(QifuInputRecord.ReqType.SETTLE_NOTIFY.getType());
|
|
|
- inputRecord.setReqBody(body);
|
|
|
- inputRecord.setDecryptBody(body);
|
|
|
- qifuInputRecordMapper.insert(inputRecord);
|
|
|
+ String decryptDataStr = null;
|
|
|
+ com.alibaba.fastjson.JSONObject unPackMessage = null;
|
|
|
+ try {
|
|
|
+ // 查询deptSub获取desKey
|
|
|
+ SysDeptSub deptSub = sysDeptSubService.getOne(Wrappers.<SysDeptSub>lambdaQuery()
|
|
|
+ .eq(SysDeptSub::getEnableFlag, "1")
|
|
|
+ .eq(SysDeptSub::getSubjectLocation, SubjectLocation.QI_FU)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (deptSub == null || StrUtil.isBlank(deptSub.getAppId())) {
|
|
|
+ log.warn("未配置福建企赋deptSub reqId={}", reqId);
|
|
|
+ return "fail";
|
|
|
+ }
|
|
|
+
|
|
|
+ String publicKey = deptSub.getRsaPublicKey();
|
|
|
+
|
|
|
+ // 验签/解密
|
|
|
+ unPackMessage =
|
|
|
+ SaasApiDemoV2.unPackMessage(JSON.parseObject(body), com.alibaba.fastjson.JSONObject.class, publicKey);
|
|
|
+ decryptDataStr = com.alibaba.fastjson.JSONObject.toJSONString(unPackMessage);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("福建企赋结算回调参数异常", e);
|
|
|
+ return "fail";
|
|
|
+ } finally {
|
|
|
+ // 请求记录到数据库
|
|
|
+ QifuInputRecord inputRecord = new QifuInputRecord();
|
|
|
+ inputRecord.setReqId(reqId);
|
|
|
+ inputRecord.setReqType(QifuInputRecord.ReqType.SETTLE_NOTIFY.getType());
|
|
|
+ inputRecord.setReqBody(body);
|
|
|
+ inputRecord.setDecryptBody(decryptDataStr);
|
|
|
+ qifuInputRecordMapper.insert(inputRecord);
|
|
|
+ }
|
|
|
|
|
|
// 业务处理
|
|
|
- gigThirdApiService.qiFuSettleNotify(bodyJson);
|
|
|
+ gigThirdApiService.qiFuSettleNotify(unPackMessage);
|
|
|
|
|
|
return "success";
|
|
|
}
|