浏览代码

增加分润财务订单

周箭河 5 年之前
父节点
当前提交
7a79db69c2

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/NotifyCallback.java

@@ -2,7 +2,9 @@ package com.ym.mec.biz.service;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.huifu.adapay.Adapay;
 import com.huifu.adapay.notify.MQTTCallbackHandler;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
@@ -23,12 +25,16 @@ public class NotifyCallback implements MQTTCallbackHandler {
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
     private TenantPaymentOrderService tenantPaymentOrderService;
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
     private static NotifyCallback notifyCallback;
 
     @PostConstruct
     public void init() {
         notifyCallback = this;
+        String baseUrl = notifyCallback.sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+        Adapay.setDeviceID(baseUrl);
     }
 
     /**

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -107,4 +107,12 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 
 	PageInfoOrder<StudentPaymentOrder> OrderQueryPage(StudentPaymentOrderQueryInfo queryInfo);
 
+
+	/**
+	 * 获取订单第三方状态
+	 * @param id
+	 * @return
+	 */
+	Boolean getOrderStatus(Long id);
+
 }

+ 9 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -163,7 +163,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             rpMap.put("orderNo", (String) payment.get("id"));
             rpMap.put("channelType", (String) payment.get("pay_channel"));
             String status = (String) payment.get("status");
-            if(payment.containsKey("error_msg")){
+            if (payment.containsKey("error_msg")) {
                 rpMap.put("remarks", (String) payment.get("error_msg"));
             }
             if (status.equals("succeeded")) {
@@ -215,7 +215,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             sporadicChargeInfoService.renewForCallback(order);
         } else if (order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_BUY) || order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_RENEW)) {
             practiceGroupService.orderCallback(order);
-        }else if (order.getType().equals(OrderTypeEnum.REPAIR)) {
+        } else if (order.getType().equals(OrderTypeEnum.REPAIR)) {
             studentRepairService.orderCallback(order);
         }
     }
@@ -250,7 +250,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                     sporadicChargeInfoService.renewForCallback(order);
                 } else if (order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_BUY) || order.getType().equals(OrderTypeEnum.PRACTICE_GROUP_RENEW)) {
                     practiceGroupService.orderCallback(order);
-                }else if (order.getType().equals(OrderTypeEnum.REPAIR)) {
+                } else if (order.getType().equals(OrderTypeEnum.REPAIR)) {
                     studentRepairService.orderCallback(order);
                 }
             } catch (Exception e) {
@@ -327,4 +327,10 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public Boolean getOrderStatus(Long id) {
+        return null;
+        //StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(id);
+    }
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -763,6 +763,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
         //成功报名状态变更
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
+
+        if(studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.YES)){
+            return studentPaymentOrder;
+        }
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
 
         if (studentPaymentOrder.getStatus().equals(DealStatusEnum.SUCCESS)) {

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

@@ -11,6 +11,7 @@ import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -221,4 +222,13 @@ public class StudentPaymentOrderController extends BaseController {
     }
 
 
+    @ApiOperation(value = "查询订单状态")
+    @GetMapping("/getOrderStatus")
+    @PreAuthorize("@pcs.hasPermissions('order/getOrderStatus')")
+    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "订单id", required = true, dataType = "int")})
+    public HttpResponseResult<Boolean> getOrderStatus(Long id) {
+        return succeed(studentPaymentOrderService.getOrderStatus(id));
+    }
+
+
 }