Sfoglia il codice sorgente

Merge branch 'master' of http://49.234.186.218:9000/root/ieplus

jinxia.mo 1 mese fa
parent
commit
e9c33c86a8

+ 23 - 14
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontECardController.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.front;
 import com.alibaba.fastjson.JSONObject;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request;
 import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryV3Result;
+import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result;
 import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
@@ -248,25 +249,33 @@ public class FrontECardController extends BaseController {
 
         order.setNotifyUrl(notifyUrl).setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(totalFee2));
 
-        WxPayUnifiedOrderV3Request.SceneInfo sceneInfo = new WxPayUnifiedOrderV3Request.SceneInfo();
-        sceneInfo.setPayerClientIp(IpUtils.getIpAddr(request));
-        WxPayUnifiedOrderV3Request.H5Info h5Info = new WxPayUnifiedOrderV3Request.H5Info();
-        String os = UserAgent.parseUserAgentString(request.getHeader("User-Agent")).getOperatingSystem().getName();
-        h5Info.setType(os);
-        sceneInfo.setH5Info(h5Info);
-        order.setSceneInfo(sceneInfo);
-        String h5Url = wxService.createOrderV3(TradeTypeEnum.H5, order);
-        String prepayId = StringUtils.substringBetween(h5Url, "prepay_id=", "&package=");
-
+        Map data = new HashMap<>();
         BBusiPaymentOrders upOrder = new BBusiPaymentOrders();
-        upOrder.setPrepayId(prepayId);
-        upOrder.setDetail(h5Url);
+        if("h5".equals(type)) {
+            WxPayUnifiedOrderV3Request.SceneInfo sceneInfo = new WxPayUnifiedOrderV3Request.SceneInfo();
+            sceneInfo.setPayerClientIp(IpUtils.getIpAddr(request));
+            WxPayUnifiedOrderV3Request.H5Info h5Info = new WxPayUnifiedOrderV3Request.H5Info();
+            String os = UserAgent.parseUserAgentString(request.getHeader("User-Agent")).getOperatingSystem().getName();
+            h5Info.setType(os);
+            sceneInfo.setH5Info(h5Info);
+            order.setSceneInfo(sceneInfo);
+            String h5Url = wxService.createOrderV3(TradeTypeEnum.H5, order);
+            String prepayId = StringUtils.substringBetween(h5Url, "prepay_id=", "&package=");
+            upOrder.setPrepayId(prepayId);
+            upOrder.setDetail(h5Url);
+            data.put("h5url", h5Url);
+        } else {
+            WxPayUnifiedOrderV3Result.JsapiResult jsapiResult = wxService.createOrderV3(TradeTypeEnum.JSAPI, order);
+            String detail = JSONObject.toJSONString(jsapiResult);
+            String prepayId = StringUtils.substringAfterLast(jsapiResult.getPackageValue(), "prepay_id=");
+            upOrder.setPrepayId(prepayId);
+            upOrder.setDetail(detail);
+            data.put("wcPayData", detail);
+        }
         upOrder.setOutTradeNo(outTradeNo);
         upOrder.setId(orderId);
         paymentOrdersService.updateBBusiPaymentOrders(upOrder);
 
-        Map data = new HashMap<>();
-        data.put("h5url", h5Url);
         data.put("outTradeNo", outTradeNo);
         data.put("orderId", String.valueOf(orderId));
         return AjaxResult.success(data);

+ 1 - 1
ie-admin/src/main/java/com/ruoyi/web/service/VoluntaryService.java

@@ -737,7 +737,7 @@ public class VoluntaryService {
                 continue;
             }
             for(Map<Long, List<AMarjorPlan>> tmpMap : bothPlanList) {
-                if (!mp.getYear().equals(planYear) && tmpMap == currUniversityMajorPlansMap) {
+                if (!mp.getMatchYear().equals(planYear) && tmpMap == currUniversityMajorPlansMap) {
                     continue;
                 }
                 List<AMarjorPlan> tmpMpList = tmpMap.get(mp.getUniversityId());

+ 1 - 1
ie-system/src/main/resources/mapper/syzy/BBusiWishUniversitiesMapper.xml

@@ -275,7 +275,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </where>
     <choose>
       <when test="filterRank!= null and filterRank"> order by star desc, code </when>
-      <otherwise> code</otherwise>
+      <otherwise> order by code</otherwise>
     </choose>
   </select>