소스 검색

Merge branch 'zx_saas_payment_config_0218' of http://git.dayaedu.com/yonge/mec into dev

zouxuan 5 달 전
부모
커밋
ccf2cdc856

+ 3 - 5
mec-application/src/main/java/com/ym/mec/AppServerApplication.java

@@ -5,8 +5,6 @@ import com.ym.mec.config.AppBeanNameGenerator;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.logging.LogLevel;
-import org.springframework.boot.logging.LoggingSystem;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.ComponentScan;
@@ -24,12 +22,12 @@ public class AppServerApplication {
         new SpringApplicationBuilder(AppServerApplication.class)
                 .beanNameGenerator(new AppBeanNameGenerator())
                 .run(args);
-        configureGlobalLogger();
+//        configureGlobalLogger();
     }
-
+/*
     private static void configureGlobalLogger() {
         LoggingSystem loggingSystem = LoggingSystem.get(ClassLoader.getSystemClassLoader());
         // 设置业务日志记录器的日志级别为INFO
         loggingSystem.setLogLevel("businessLogger", LogLevel.INFO);
-    }
+    }*/
 }

+ 2 - 6
mec-biz/pom.xml

@@ -59,10 +59,6 @@
 					<artifactId>mybatis-plus-annotation</artifactId>
 					<groupId>com.baomidou</groupId>
 				</exclusion>
-				<exclusion>
-					<groupId>org.springframework.boot</groupId>
-					<artifactId>spring-boot-starter-log4j2</artifactId>
-				</exclusion>
 			</exclusions>
 		</dependency>
 		<dependency>
@@ -114,6 +110,8 @@
 		</dependency>
 		<dependency>
 			<artifactId>microsvc-common-tools</artifactId>
+			<groupId>com.microsvc.toolkit.common</groupId>
+			<version>${microsvc.version}</version>
 			<exclusions>
 				<exclusion>
 					<artifactId>commons-io</artifactId>
@@ -124,8 +122,6 @@
 					<groupId>com.alibaba</groupId>
 				</exclusion>
 			</exclusions>
-			<groupId>com.microsvc.toolkit.common</groupId>
-			<version>${microsvc.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>com.yonge.log</groupId>

+ 0 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/ActivityUserMapperService.java

@@ -9,8 +9,6 @@ import com.ym.mec.biz.dal.page.ActivityUserQueryInfo;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
-import org.apache.ibatis.annotations.Param;
-import org.snaker.engine.access.Page;
 
 import java.math.BigDecimal;
 import java.util.List;

+ 15 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -323,7 +323,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 
         Date date = new Date();
 
-        if (payingOrders.size() == 0) {
+        if (CollectionUtils.isEmpty(payingOrders)) {
             return;
         }
         
@@ -352,7 +352,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     }
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public OrderCancelModel updateOrderStatus(Date date, StudentPaymentOrder payingOrder) throws Exception {
     	
         /*HfMerchantConfig hfMerchantConfig = hfMerchantConfigService.queryByTenantId(payingOrder.getTenantId(), payingOrder.getPaymentChannel());
@@ -363,8 +363,11 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 //        PaymentChannelEnum paymentChannel = PaymentChannelEnum.codeOf(payingOrder.getPaymentChannel());
         
 //        Map<String, Object> payment = new HashMap<String, Object>();
-        PaymentResp paymentResp = paymentServiceContext.getPaymentService(payingOrder.getPaymentChannel() + "_" + payingOrder.getTenantId())
-                .query(payingOrder.getTransNo(), payingOrder.getOrderNo());
+        BasePaymentService paymentService = paymentServiceContext.getPaymentService(payingOrder.getPaymentChannel() + "_" + payingOrder.getTenantId());
+        if (paymentService == null) {
+            throw new BizException("支付渠道[{}]不支持", payingOrder.getPaymentChannel());
+        }
+        PaymentResp paymentResp = paymentService.query(payingOrder.getTransNo(), payingOrder.getOrderNo());
         if (paymentResp == null) {
             throw new BizException("订单支付状态获取异常,稍后请重试,transNo:{},orderNo:{},paymentChannel:{}", payingOrder.getTransNo(), payingOrder.getOrderNo(), payingOrder.getPaymentChannel());
         }
@@ -687,7 +690,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     }
 
     private void closeOrders(List<String> orderNoList) throws Exception {
-        if (orderNoList.size() == 0) {
+        if (CollectionUtils.isEmpty(orderNoList)) {
             return;
         }
 
@@ -697,15 +700,19 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
 
         List<StudentPaymentOrder> ordersOverTime = findOrdersOverTime(orderNoList, DealStatusEnum.ING, beforeDate);
         for (StudentPaymentOrder order : ordersOverTime) {
+            BasePaymentService paymentService = paymentServiceContext.getPaymentService(order.getPaymentChannel() + "_" + order.getTenantId());
+            if (paymentService == null) {
+                log.error("关闭订单失败,支付渠道[{}]不支持,订单编号{}", order.getPaymentChannel(), order.getOrderNo());
+            }
             try {
+                PaymentClose close = paymentService.close(order.getTransNo(), "超时未支付关闭", order.getOrderNo());
                 TenantContextHolder.setTenantId(order.getTenantId());
-                order.setStatus(DealStatusEnum.FAILED);
-                order.setMemo("超时未支付关闭");
+                order.setStatus(CLOSE);
+                order.setMemo(close.getMsg());
                 callOrderCallBack(order);
                 TenantContextHolder.clearTenantId();
             } catch (Exception e) {
                 e.printStackTrace();
-                continue;
             }
         }
 

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java

@@ -720,7 +720,6 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 				sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, studentPaymentOrder.getMemo() + "支付失败,退还余额");
 			}
 			sysCouponCodeService.quit(studentPaymentOrder.getCouponCodeId());
-			return;
 		}
 	}
 

+ 2 - 2
mec-thirdparty/pom.xml

@@ -156,11 +156,11 @@
 			<version>0.8.14</version>
 		</dependency>
 
-		<dependency>
+		<!--<dependency>
 			<groupId>com.alipay.sdk</groupId>
 			<artifactId>alipay-sdk-java</artifactId>
 			<version>4.35.154.ALL</version>
-		</dependency>
+		</dependency>-->
 	</dependencies>
 
 </project>

+ 0 - 5
pom.xml

@@ -308,11 +308,6 @@
 		</dependency>
 
 		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-test</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
 			<groupId>com.google.guava</groupId>
 			<artifactId>guava</artifactId>
 			<version>20.0</version>