Forráskód Böngészése

Merge branch '20220930' into master_saas

liujunchi 2 éve
szülő
commit
b6a74b9664

+ 11 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -1146,16 +1146,6 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         studentPaymentOrderService.update(studentPaymentOrder);
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion() + 1);
 
-        if (amount.compareTo(BigDecimal.ZERO) == 0) {
-            studentPaymentRouteOrderService.addRouteOrder(model.getOrderNo(), student.getOrganId(), balance);
-            Map<String, String> notifyMap = new HashMap<>();
-            notifyMap.put("tradeState", "1");
-            notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
-            studentPaymentOrderService.updateOrder(notifyMap);
-            notifyMap.put("orderNo", model.getOrderNo());
-            return notifyMap;
-        }
-
         studentGoodsSell.setCouponMarketAmount(studentPaymentOrder.getCouponRemitFee());
         studentGoodsSell.setOrganId(student.getOrganId());
         studentGoodsSell.setTotalAmount(studentPaymentOrder.getActualAmount());
@@ -1169,6 +1159,17 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         studentGoodsSell.setTenantId(student.getTenantId());
         studentGoodsSellDao.insert(studentGoodsSell);
 
+
+        if (amount.compareTo(BigDecimal.ZERO) == 0) {
+            studentPaymentRouteOrderService.addRouteOrder(model.getOrderNo(), student.getOrganId(), balance);
+            Map<String, String> notifyMap = new HashMap<>();
+            notifyMap.put("tradeState", "1");
+            notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
+            studentPaymentOrderService.updateOrder(notifyMap);
+            notifyMap.put("orderNo", model.getOrderNo());
+            return notifyMap;
+        }
+
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
 
         //  receiver类型

+ 10 - 1
mec-mall/mall-portal/pom.xml

@@ -23,11 +23,20 @@
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
         </dependency>
 
+        <!--集成seata服务-->
         <dependency>
-            <groupId>org.springframework.cloud</groupId>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
+            <version>2.1.4.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+            <version>2.1.4.RELEASE</version>
         </dependency>
 
+
         <dependency>
             <groupId>com.ym</groupId>
             <artifactId>common-core</artifactId>

+ 3 - 2
mec-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/service/impl/OmsPortalOrderServiceImpl.java

@@ -154,7 +154,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
                 userOrderPayment.setCreateTime(new Date());
                 userOrderPaymentService.saveOrUpdate(userOrderPayment);
 
-                return feignMecCreateOrder(detail.getCouponId(), oldOrderNo, orderSn, orderParam.getTeacherId().intValue()
+                return feignMecCreateOrder(detail.getCouponId(), oldOrderNo, orderSn, orderParam.getTeacherId() == null?null:orderParam.getTeacherId().intValue()
                         , detail.getMemberId().intValue(), detail.getTotalAmount(),
                        JSON.toJSONString(detail),detail.getPayType()!= null && detail.getPayType() == 3);
             } else {
@@ -407,7 +407,8 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
         model.setAmount(amount);
         HttpResponseResult<Map> mapHttpResponseResult = webFeignService.couponAmount(model);
         if (!mapHttpResponseResult.getStatus()) {
-            throw new BizException("管乐迷获取优惠券优惠失败");
+            LOG.error("管乐迷获取优惠券优惠失败:{}",mapHttpResponseResult.getMsg());
+            throw new BizException(mapHttpResponseResult.getMsg());
         }
         return mapHttpResponseResult.getData();
     }

+ 4 - 1
mec-mall/mall-portal/src/main/resources/bootstrap-pre.yml

@@ -9,4 +9,7 @@ spring:
         file-extension: yaml
         refresh:
           enabled: true
-        enabled: true
+        enabled: true
+    alibaba:
+      seata:
+        tx-service-group: default_tx_group

+ 4 - 1
mec-mall/mall-portal/src/main/resources/bootstrap-prod.yml

@@ -9,4 +9,7 @@ spring:
         file-extension: yaml
         refresh:
           enabled: true
-        enabled: true
+        enabled: true
+    alibaba:
+      seata:
+        tx-service-group: default_tx_group