ソースを参照

1:创建基本的返回实体
2:lombok

wangming 3 年 前
コミット
d6d94e7cea

+ 49 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/opt/OptController.java

@@ -1,10 +1,13 @@
 package com.ruoyi.web.controller.opt;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.request.ProcessInfoReq;
 import com.ruoyi.common.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 /**
@@ -19,24 +22,66 @@ public class OptController {
 
 
     /**
-    * @desc : 
+    * @desc : 此接口用来接收订单推送服务,只用来判断是否成功
     * @author : wangming
     * @createTime : 2022/9/6 11:04
     * @param : [processId 订单id]
     * @return : com.ruoyi.common.core.domain.AjaxResult
     */
-    public AjaxResult chargeOrderNotice(@Param("processId") String processId){
+    @PostMapping("/getValue")
+    public R chargeOrderNotice(@Param("processId") String processId){
         try {
             //先验证参数
             if (StringUtils.isEmpty(processId)){
                 //返回接收失败
-//                return AjaxResult
+                return R.paramNull("参数不可为空!");
             }
+            //参数确认没问题以后去请求www服务进行订单信息获取
+
+            //入本地库
         } catch (Exception e) {
             e.printStackTrace();
-            log.error("订单接收出错" + e.getLocalizedMessage());
+            log.error("订单接收出错:" + e.getLocalizedMessage());
+            return R.fail();
+        }
+        return R.okwww();
+    }
+    
+
+    /**
+    * @desc : 此接口用来接收到订单推送以后去获取订单信息,然后入库使用
+    * @author : wangming
+    * @createTime : 2022/9/6 11:34
+    * @param : [processId]
+    * @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;
         }
         return null;
     }
+
+    
+    /**
+    * @desc : 此接口为给www推送状态修改数据
+    * @author : wangming
+    * @createTime : 2022/9/6 11:40
+    * @param : []
+    * @return : com.ruoyi.common.core.domain.R
+    */
+
+    public R pushProcessStatus(){
+        return null;
+    }
+
 }

+ 4 - 0
ruoyi-common/pom.xml

@@ -100,6 +100,10 @@
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 15 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java

@@ -14,9 +14,15 @@ public class R<T> implements Serializable
     /** 成功 */
     public static final int SUCCESS = 0;
 
+    /** 成功 */
+    public static final int SUCCESS_WWW = 01;
+
     /** 失败 */
     public static final int FAIL = 500;
 
+    /** 参数为空 */
+    public static final int PARAM_NULL = 401;
+
     private int code;
 
     private String msg;
@@ -28,6 +34,11 @@ public class R<T> implements Serializable
         return restResult(null, SUCCESS, "操作成功");
     }
 
+    public static <T> R<T> okwww()
+    {
+        return restResult(null, SUCCESS_WWW, "操作成功");
+    }
+
     public static <T> R<T> ok(T data)
     {
         return restResult(data, SUCCESS, "操作成功");
@@ -57,6 +68,10 @@ public class R<T> implements Serializable
     {
         return restResult(data, FAIL, msg);
     }
+    public static <T> R<T> paramNull(String msg)
+    {
+        return restResult(null, PARAM_NULL, msg);
+    }
 
     public static <T> R<T> fail(int code, String msg)
     {

+ 38 - 0
ruoyi-common/src/main/java/com/ruoyi/common/request/ProcessInfoReq.java

@@ -0,0 +1,38 @@
+package com.ruoyi.common.request;
+
+import lombok.Data;
+
+/**
+ * @Author : wangming
+ * @CreateTime : 2022-09-06
+ * @Desc : 请求
+ */
+@Data
+public class ProcessInfoReq {
+
+    private String processId;     //业务流水号
+    private String projectId;     //招标项目编号
+    private String projectName;   //招标项目名称
+    private String tenderNo;      //标段编号
+    private String tenderTime;    //开标时间
+    private String bailAmt;       //投标保证金金额
+    private String loanAmt;       //申请保额
+    private String premium;       //保费
+    private String bizid;         //投标保证金形式
+    private String companyName;   //投标人名称
+    private String companyDtType; //投标人证件类型
+    private String companySocialno; //投标人证件号码
+    private String companyAddr;    //投标人地址
+    private String applyName;      //投标人联系人
+    private String applyTel;       //投标人联系人电话
+    private String basicAccountBank;  //投标企业基本户开户行
+    private String basicAccountNo;   //投标企业基本户帐号
+    private String applyTime;      //申请时间
+    private String expireDate;     //保函有效期限(天)
+    private String tendereeName;   //保函受益人名称
+    private String tendereeCode;   //保函受益人代码
+    private String tendererAddress;  //保函受益人地址
+    private String noticeSendTime;   //招标公告发布时间
+    private String areaCode;         //项目地区区域码6位
+
+}