|
@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.thirdparty.adapay.NotifyEvent;
|
|
|
import com.ym.mec.thirdparty.adapay.Pay;
|
|
|
import com.ym.mec.thirdparty.yqpay.Msg;
|
|
@@ -236,17 +237,15 @@ public class StudentOrderController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/fixOrder")
|
|
|
- private int fixOrder() throws Exception {
|
|
|
- List<StudentPaymentOrder> payingOrders = studentPaymentOrderDao.findFixOrder(DealStatusEnum.SUCCESS, "YQPAY");
|
|
|
+ private HttpResponseResult fixOrder(String orderNo) throws Exception {
|
|
|
|
|
|
- if (payingOrders.size() == 0) {
|
|
|
- return 0;
|
|
|
+ if (orderNo == null || orderNo.isEmpty()) {
|
|
|
+ return failed("订单号必须填");
|
|
|
}
|
|
|
- String merOrderNos = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.joining(","));
|
|
|
|
|
|
String notifyUrl = ""; //回调地址
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>();
|
|
|
- resultMap.put("merOrderNoList", merOrderNos);
|
|
|
+ resultMap.put("merOrderNoList", orderNo);
|
|
|
Map<String, Object> requestMap = YqPayUtil.getRequestMap(notifyUrl, resultMap);
|
|
|
|
|
|
RsqMsg rsqMsg = new RsqMsg(requestMap);
|
|
@@ -256,33 +255,8 @@ public class StudentOrderController extends BaseController {
|
|
|
if (queryRs.getCode().equals("88")) {
|
|
|
String responseParameters = queryRs.getResponseParameters();
|
|
|
List<Map<String, Object>> responseList = JSON.parseObject(responseParameters, List.class);
|
|
|
- for (Map<String, Object> response : responseList) {
|
|
|
- String type = "per";
|
|
|
- String orderNo = (String) response.get("merOrderNo");
|
|
|
- String tempRoutingResultList = response.get("tempRoutingResultList").toString();
|
|
|
- System.out.println(tempRoutingResultList);
|
|
|
-
|
|
|
- if (tempRoutingResultList.contains("武汉大雅乐盟教育咨询有限公司")) {
|
|
|
- type = "com";
|
|
|
- }
|
|
|
- fixUpdateOrder(orderNo,type);
|
|
|
- }
|
|
|
- }
|
|
|
- return payingOrders.size();
|
|
|
- }
|
|
|
-
|
|
|
- void fixUpdateOrder(String orderNo,String type) {
|
|
|
- StudentPaymentOrder order = studentPaymentOrderService.findOrderByOrderNo(orderNo);
|
|
|
- if(type.equals("com")){
|
|
|
- order.setComAmount(order.getActualAmount());
|
|
|
- order.setPerAmount(BigDecimal.ZERO);
|
|
|
- order.setMerNos("0023115");
|
|
|
- }else {
|
|
|
- order.setComAmount(BigDecimal.ZERO);
|
|
|
- order.setPerAmount(order.getActualAmount());
|
|
|
- order.setMerNos("0031215");
|
|
|
+ return succeed(responseList);
|
|
|
}
|
|
|
- studentPaymentOrderService.update(order);
|
|
|
+ return succeed("订单不存在");
|
|
|
}
|
|
|
-
|
|
|
}
|