Преглед изворни кода

Merge remote-tracking branch 'origin/master'

chengpan пре 2 година
родитељ
комит
48a50fa62a

+ 35 - 29
ruoyi-admin/src/main/java/com/ruoyi/web/controller/opt/OptController.java

@@ -25,26 +25,32 @@ import java.util.HashMap;
  * @Desc : 订单类
  */
 @Controller
-@RequestMapping("/mo/cace")
+@RequestMapping("/process/operation")
 @Slf4j
 public class OptController {
 
     //订单信息请求接口
     @Value("processUrl")
     private String processUrl;
+    //审核通知接口
+    @Value("checkUrl")
+    private String checklUrl;
+    //支付通知接口
+    @Value("payUrl")
+    private String payUrl;
 
     @Autowired
     private ISysInfoConfigService sysInfoConfigService;
 
 
     /**
-    * @desc : 此接口用来接收订单推送服务,只用来判断是否成功
+    * @desc : 此接口用来接收订单推送服务,只用来判断是否成功,,入库操作
     * @author : wangming
     * @createTime : 2022/9/6 11:04
     * @param : [processId 订单id]
     * @return : com.ruoyi.common.core.domain.AjaxResult
     */
-    @PostMapping("/gue")
+    @PostMapping("/put_in_storage")
     public R chargeOrderNotice(@Param("processId") String processId){
         try {
             //先验证参数
@@ -54,55 +60,55 @@ public class OptController {
             }
             //参数确认没问题以后去请求www服务进行订单信息获取
             HashMap<String, String> process = new HashMap<>();
-//            String string = JSON.toJSONString(process);
+            process.put("processId", processId);
             String string = JSONObject.valueAsStr(process);
             String processResult = HttpUtils.sendPost(processUrl, string);
             //拿到解析结果,进行解析
-            JSONArray objects = JSON.parseArray(processResult);
-//            objects.
-            //入本地库
+            ProcessInfoReq processInfoReq = JSON.parseObject(processResult, ProcessInfoReq.class);
+            if (StringUtils.isNotNull(processInfoReq)){
+                //入本地库
+
+            } else {
+                log.info("订单数据为空,请求失败,请求id为:" + processId);
+                return R.failwww("订单数据为空,接收失败");
+            }
+
         } catch (Exception e) {
             e.printStackTrace();
             log.error("订单接收出错:" + e.getLocalizedMessage());
-            return R.fail();
+            return R.failwww("订单接收时程序出错");
         }
         return R.okwww();
     }
-    
 
+    
     /**
-    * @desc : 此接口用来接收到订单推送以后去获取订单信息,然后入库使用
+    * @desc : 此接口为给www推送审核状态通知
     * @author : wangming
-    * @createTime : 2022/9/6 11:34
-    * @param : [processId]
+    * @createTime : 2022/9/6 11:40
+    * @param : []
     * @return : com.ruoyi.common.core.domain.R
     */
-    @PostMapping("/sadfsaf")
-    public R getProcessInfo(@Param("processId") String processId){
-        try {
-            //首先对参数进行判断
-            if (StringUtils.isEmpty(processId)){
-                return R.paramNull("参数不可为空!");
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("订单入库失败:" + e.getLocalizedMessage());
-            return null;
-        }
+    @PostMapping("/check_inform")
+    public R checkInform(){
         return null;
     }
 
-    
+
     /**
-    * @desc : 此接口为给www推送状态修改数据
+    * @desc : 此接口为支付通知
     * @author : wangming
-    * @createTime : 2022/9/6 11:40
+    * @createTime : 2022/9/6 15:48
     * @param : []
     * @return : com.ruoyi.common.core.domain.R
     */
+    @PostMapping("/pay_inform")
+    public R payInform(){
+        return null;
+    }
 
-    public R pushProcessStatus(){
+    @PostMapping("fill_template")
+    public R fillTemplate(){
         return null;
     }
 

+ 5 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -17,6 +17,11 @@ ruoyi:
 
 # 请求订单信息的url
 processUrl: https://www.cyc-fund.com.cn/
+# www审核通知接口url
+checkUrl:
+# www支付回调接口通知
+payUrl:
+# www承保回调接口通知
 
 
 # 开发环境配置

+ 11 - 4
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java

@@ -16,6 +16,8 @@ public class R<T> implements Serializable
 
     /** 成功 */
     public static final int SUCCESS_WWW = 01;
+    /** 成功 */
+    public static final int FAIL_WWW = 02;
 
     /** 失败 */
     public static final int FAIL = 500;
@@ -25,7 +27,7 @@ public class R<T> implements Serializable
 
     private int code;
 
-    private String msg;
+    private String message;
 
     private T data;
 
@@ -54,6 +56,11 @@ public class R<T> implements Serializable
         return restResult(null, FAIL, "操作失败");
     }
 
+    public static <T> R<T> failwww(String msg)
+    {
+        return restResult(null, FAIL_WWW, msg);
+    }
+
     public static <T> R<T> fail(String msg)
     {
         return restResult(null, FAIL, msg);
@@ -70,7 +77,7 @@ public class R<T> implements Serializable
     }
     public static <T> R<T> paramNull(String msg)
     {
-        return restResult(null, PARAM_NULL, msg);
+        return restResult(null, FAIL_WWW, msg);
     }
 
     public static <T> R<T> fail(int code, String msg)
@@ -99,12 +106,12 @@ public class R<T> implements Serializable
 
     public String getMsg()
     {
-        return msg;
+        return message;
     }
 
     public void setMsg(String msg)
     {
-        this.msg = msg;
+        this.message = msg;
     }
 
     public T getData()