|
@@ -259,8 +259,8 @@ public class StudentOrderController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/fixOrder")
|
|
|
- private HttpResponseResult fixOrder(String orderNo) throws Exception {
|
|
|
+ @GetMapping("/getOrderStatus")
|
|
|
+ private HttpResponseResult getOrderStatus(String orderNo) throws Exception {
|
|
|
|
|
|
if (orderNo == null || orderNo.isEmpty()) {
|
|
|
return failed("订单号必须填");
|
|
@@ -337,4 +337,54 @@ public class StudentOrderController extends BaseController {
|
|
|
luckStatisDto.setTotalMoney(totalMoney);
|
|
|
return succeed(luckStatisDto);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/fixOrder")
|
|
|
+ private void fixOrder() throws Exception {
|
|
|
+ List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.SUCCESS, "YQPAY");
|
|
|
+
|
|
|
+ if (payingOrders.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String merOrderNos = payingOrders.stream().map(StudentPaymentOrder::getOrderNo).collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ String notifyUrl = ""; //回调地址
|
|
|
+ Map<String, Object> resultMap = new LinkedHashMap<>();
|
|
|
+ resultMap.put("merOrderNoList", merOrderNos);
|
|
|
+ Map<String, Object> requestMap = YqPayUtil.getRequestMap(notifyUrl, resultMap);
|
|
|
+
|
|
|
+ RsqMsg rsqMsg = new RsqMsg(requestMap);
|
|
|
+
|
|
|
+ Msg queryRs = yqPayFeignService.orderQuery(rsqMsg);
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+ studentPaymentOrderService.update(order);
|
|
|
+ }
|
|
|
}
|