Browse Source

Merge remote-tracking branch 'origin/master_saas' into master_saas

zouxuan 2 years ago
parent
commit
933d9b9a47

+ 12 - 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类型
@@ -1337,6 +1338,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
         studentPaymentOrder.setVersion(orderByOrderNo.getVersion());
         studentPaymentOrder.setId(orderByOrderNo.getId());
+        studentPaymentOrder.setTenantId(orderByOrderNo.getTenantId());
         if (autoReceive) {
             studentPaymentOrder.setReceiveStatus("AUTO_RECEIVE");
         } else {

+ 6 - 0
mec-mall/mall-portal/pom.xml

@@ -23,6 +23,12 @@
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
         </dependency>
 
+        <!--集成seata服务-->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-seata</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>

+ 4 - 3
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 {
@@ -279,7 +279,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
         order.setFreightAmount(new BigDecimal(0));
         order.setPromotionAmount(calcPromotionAmount(orderItemList));
         order.setPromotionInfo(getOrderPromotionInfo(orderItemList));
-        order.setPlatformType(orderParam.getPlatformType() == null?"STUDENT":orderParam.getPlatformType());
+        order.setPlatformType(StringUtil.isEmpty(orderParam.getPlatformType())?"STUDENT":orderParam.getPlatformType());
         if (StringUtil.isEmpty(orderParam.getCouponId())) {
             order.setCouponAmount(new BigDecimal(0));
         } 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

+ 7 - 0
pom.xml

@@ -130,6 +130,13 @@
 				<version>0.9.0.RELEASE</version>
 			</dependency>
 
+			<!--集成seata服务-->
+			<dependency>
+				<groupId>com.alibaba.cloud</groupId>
+				<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
+				<version>2.1.4.RELEASE</version>
+			</dependency>
+
 			<dependency>
 				<groupId>io.zipkin.java</groupId>
 				<artifactId>zipkin-server</artifactId>