소스 검색

feat: 中智结算调通

李学松 2 년 전
부모
커밋
01a730b87b

+ 11 - 0
db/v2.0/230410.sql

@@ -1,3 +1,14 @@
+create table zhongzhi_input_record
+(
+    id          int auto_increment comment '主键id'
+        primary key,
+    req_type    varchar(20)                        not null comment '请求业务类型',
+    order_no    varchar(64)                        null comment '三方订单号',
+    req_body    text                               null comment '请求body',
+    create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
+)
+    comment '中智回调异步通知记录';
+
 alter table sys_user
     add bank_name varchar(32) null comment '开户行';
 

+ 6 - 6
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/GigThirdApiController.java

@@ -93,15 +93,15 @@ public class GigThirdApiController {
 		// 请求body json
 		JSONObject bodyJson = JSONUtil.parseObj(body);
 
-		// 平台任务编
-		String orderNo = bodyJson.getStr("orderNo");
+		// 三方订单
+		String thirdOrderNo = bodyJson.getStr("thirdOrderNo");
 
 		Map<String, Object> result = new HashMap<>();
 
-		String redisKey = String.format("%s_%s", CacheConstants.ZHONG_ZHI_SETTLE_NOTIFY_KEY, orderNo);
-		Boolean absent = redisTemplate.opsForValue().setIfAbsent(redisKey, orderNo, 30, TimeUnit.MINUTES);
+		String redisKey = String.format("%s_%s", CacheConstants.ZHONG_ZHI_SETTLE_NOTIFY_KEY, thirdOrderNo);
+		Boolean absent = redisTemplate.opsForValue().setIfAbsent(redisKey, thirdOrderNo, 30, TimeUnit.MINUTES);
 		if (Boolean.FALSE.equals(absent)) {
-			log.warn("存在在途操作orderNo={}", orderNo);
+			log.warn("存在在途操作orderNo={}", thirdOrderNo);
 			result.put("code", "00000400");
 			result.put("msg", "成功");
 			return result;
@@ -109,7 +109,7 @@ public class GigThirdApiController {
 
 		// 请求记录到数据库
 		ZhongzhiInputRecord inputRecord = new ZhongzhiInputRecord();
-		inputRecord.setOrderNo(orderNo);
+		inputRecord.setThirdOrderNo(thirdOrderNo);
 		inputRecord.setReqType(ZhongzhiInputRecord.ReqType.SETTLE_NOTIFY.getType());
 		inputRecord.setReqBody(body);
 		zhongzhiInputRecordService.save(inputRecord);

+ 4 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/entity/ZhongzhiInputRecord.java

@@ -2,6 +2,7 @@ package com.qunzhixinxi.hnqz.admin.entity;
 
 import com.baomidou.mybatisplus.annotation.EnumValue;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.AllArgsConstructor;
@@ -33,9 +34,10 @@ public class ZhongzhiInputRecord implements Serializable {
     private String reqType;
 
     /**
-     * 平台任务编
+     * 三方订单
      */
-    private String orderNo;
+	@TableField(value = "orderNo")
+    private String thirdOrderNo;
 
     /**
      * 请求body