Browse Source

增加回调信息类

周箭河 5 năm trước cách đây
mục cha
commit
fe05d67249

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java

@@ -74,6 +74,8 @@ public class StudentPaymentOrder {
 	/**  */
 	@ApiModelProperty(value = "课程组编号",required = true)
 	private Integer classGroupId;
+
+	private Integer version;
 	
 	public void setId(Long id){
 		this.id = id;
@@ -203,6 +205,14 @@ public class StudentPaymentOrder {
 		this.status = status;
 	}
 
+	public Integer getVersion() {
+		return version;
+	}
+
+	public void setVersion(Integer version) {
+		this.version = version;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -48,13 +48,15 @@ public class PayServiceImpl implements PayService {
         HashMap<String, Object> unionPay = new HashMap<>();
         String type = "YQPAY";
         Map payMap;
-        if (routingAccount != null) {
-            //易乾支付
-            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo());
-        } else {
-            type = "UNIONPAY";
-            payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
-        }
+//        if (routingAccount != null) {
+//            //易乾支付
+//            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo());
+//        } else {
+//            type = "UNIONPAY";
+//            payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
+//        }
+        type = "UNIONPAY";
+        payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
         unionPay.put("orderNo", orderNo);
         unionPay.put("type", type);
         unionPay.put("payMap", payMap);

+ 5 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -23,6 +23,7 @@
         <result column="order_no_" property="orderNo"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="class_group_id_" property="classGroupId"/>
+        <result column="version_" property="version"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.Goods" id="Goods">
@@ -121,8 +122,11 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="version != null">
+                version_ = version_+1,
+            </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} AND version_ = #{version}
     </update>
 
     <!-- 根据主键删除一条记录 -->

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -348,8 +348,8 @@ public class MusicGroupController extends BaseController {
 //
         IdWorker idWorker = new IdWorker(0, 0);
         String orderNo = "1017" + idWorker.nextId();
-        BigDecimal amount = new BigDecimal("200");
-        Map map = payService.getPayMap(amount, orderNo, "https://pay.dayaedu.com/notify", "https://baodiu.com", "测试订单", "测试订单");
+        BigDecimal amount = new BigDecimal("0.01");
+        Map map = payService.getPayMap(amount, orderNo, "http://47.99.212.176:8000/studentOrder/notify", "https://baodiu.com", "测试订单", "测试订单");
        return succeed(map);
     }
 

+ 126 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/NotifyMsg.java

@@ -0,0 +1,126 @@
+package com.ym.mec.thirdparty.union;
+
+import java.math.BigDecimal;
+
+/**
+ * 异步通知具体信息
+ */
+public class NotifyMsg {
+    private String mid;//商户号
+    private String tid;//终端号
+    private String instMid;//业务类型
+    private String billFunds;//资金渠道
+    private String billFundsDesc;//资金渠道说明
+    private Integer totalAmount;//订单总金额(分)
+    private String merOrderId;//商户订单号
+    private String payTime;//支付时间
+    private String seqId; //支付系统交易流水号
+    private String status; //交易状态,NEW_ORDER-新订单 UNKNOWN-不明交易状态 TRADE_CLOSED-关闭的交易 WAIT_BUYER_PAY-交易创建等待付款 TRADE_SUCCESS-交易成功
+    private String targetOrderId; //渠道订单号
+    private String targetSys;//支付渠道,WXPay,等
+    private String sign;//签名
+
+    public String getMid() {
+        return mid;
+    }
+
+    public void setMid(String mid) {
+        this.mid = mid;
+    }
+
+    public String getTid() {
+        return tid;
+    }
+
+    public void setTid(String tid) {
+        this.tid = tid;
+    }
+
+    public String getInstMid() {
+        return instMid;
+    }
+
+    public void setInstMid(String instMid) {
+        this.instMid = instMid;
+    }
+
+    public String getBillFunds() {
+        return billFunds;
+    }
+
+    public void setBillFunds(String billFunds) {
+        this.billFunds = billFunds;
+    }
+
+    public String getBillFundsDesc() {
+        return billFundsDesc;
+    }
+
+    public void setBillFundsDesc(String billFundsDesc) {
+        this.billFundsDesc = billFundsDesc;
+    }
+
+    public Integer getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Integer totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public String getMerOrderId() {
+        return merOrderId;
+    }
+
+    public void setMerOrderId(String merOrderId) {
+        this.merOrderId = merOrderId;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getSeqId() {
+        return seqId;
+    }
+
+    public void setSeqId(String seqId) {
+        this.seqId = seqId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getTargetOrderId() {
+        return targetOrderId;
+    }
+
+    public void setTargetOrderId(String targetOrderId) {
+        this.targetOrderId = targetOrderId;
+    }
+
+    public String getTargetSys() {
+        return targetSys;
+    }
+
+    public void setTargetSys(String targetSys) {
+        this.targetSys = targetSys;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+}

+ 10 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -168,4 +168,14 @@ public class ClassGroupController extends BaseController {
         return succeed();
     }
 
+
+    @ApiOperation(value = "合并班级")
+    @PostMapping("/mergeClassGroup")
+    @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})
+    public HttpResponseResult mergeClassGroup(String classGroupIds) throws Exception {
+        //软删除班级
+
+        return succeed();
+    }
+
 }