Sfoglia il codice sorgente

Merge branch 'feature/0721-tenant' into develop

liujc 1 anno fa
parent
commit
613d765a0d

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImGroupServiceImpl.java

@@ -497,6 +497,7 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
                 .one();
     }
 
+    @Transactional(rollbackFor = Exception.class)
     @Override
     public void quit(String groupId, Long userId, ClientEnum clientType,Boolean quit) throws Exception {
         try {

+ 6 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java

@@ -540,13 +540,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
                 List<String> orgGroupIdList = imGroupService.listByIds(groupIdList).stream()
                         .filter(next -> ImGroupType.ORG.equals(next.getType())).map(ImGroup::getId)
                         .collect(Collectors.toList());
-                orgGroupIdList.forEach(groupId -> {
+                for (String groupId : orgGroupIdList) {
                     try {
                         imGroupService.quit(groupId, student.getUserId(), ClientEnum.STUDENT,true);
                     } catch (Exception e) {
                         log.error("学生注册,切换机构退群失败:{}", e.getMessage());
+                        throw new BizException("退群失败");
                     }
-                });
+                }
             }
 //             删除好友
             imUserFriendService.delTeacherFriendByTenantId(student.getTenantId(), student.getUserId(),
@@ -588,13 +589,14 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
                 List<String> orgGroupIdList = imGroupService.listByIds(groupIdList).stream()
                         .filter(next -> ImGroupType.ORG.equals(next.getType())).map(ImGroup::getId)
                         .collect(Collectors.toList());
-                orgGroupIdList.forEach(groupId -> {
+                for (String groupId : orgGroupIdList) {
                     try {
                         imGroupService.quit(groupId, student.getUserId(), ClientEnum.STUDENT,true);
                     } catch (Exception e) {
                         log.error("学生注册,切换机构退群失败:{}", e.getMessage());
+                        throw new BizException("退群失败");
                     }
-                });
+                }
             }
 //             删除好友
             imUserFriendService.delTeacherFriendByTenantId(student.getTenantId(), student.getUserId(),

+ 2 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantActivationCodeServiceImpl.java

@@ -450,6 +450,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
                     lines.add(repeatLine);
                 }
                 lines.add(msgRowNo);
+                code_repeat_lines.put(code, lines);
             } else {
                 codeRowMap.put(acCode, msgRowNo);
             }
@@ -507,7 +508,7 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
                     String errLines = value.stream().map(String::valueOf).collect(Collectors.joining("、"));
                     lineErr.add("第" + errLines + "行");
                 }
-                err.append(String.join(",", lineErr)).append("错误,").append(code_repeat);
+                err.append(String.join(",", lineErr)).append("错误,").append(code_repeat);
                 errData.add(err.toString());
             }
             return HttpResponseResult.failed(500, errData,errMsg.toString());

+ 13 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

@@ -908,7 +908,8 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
         DistributedLock.of(redissonClient).runIfLockCanGet(lockName, () -> {
 
             // 下单未拉起三方支付,直接关闭
-            if (StringUtils.isEmpty(paymentOrder.getTransNo()) && EPaymentStatus.WAIT_PAY == paymentOrder.getStatus()) {
+            if (StringUtils.isEmpty(paymentOrder.getTransNo())
+                    && (EPaymentStatus.WAIT_PAY == paymentOrder.getStatus()||EPaymentStatus.PAYING == paymentOrder.getStatus())) {
 
                 // 直接关闭订单
                 UserPaymentOrderWrapper.UserPaymentOrder order = UserPaymentOrderWrapper.UserPaymentOrder
@@ -951,7 +952,7 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
         UserPaymentOrderWrapper.UserPaymentOrderQuery waitPayQuery = UserPaymentOrderWrapper.UserPaymentOrderQuery
             .builder()
             .paymentStatus(Lists.newArrayList(OrderStatusEnum.parse(EPaymentStatus.WAIT_PAY)))
-            .endTime(DateTime.now().minusMinutes(30).toDate())
+//            .endTime(DateTime.now().minusMinutes(30).toDate())
             .build();
 
         IPage<UserPaymentOrderWrapper.UserPaymentOrder> page = QueryInfo.getPage(1, 10);
@@ -1176,7 +1177,7 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
 
                         // 用户下单超进关闭
                         if (EPaymentStatus.WAIT_PAY == paymentStatus
-                            || new DateTime(item.getCreateTime()).plusMinutes(118).isBeforeNow()) {
+                            && new DateTime(item.getCreateTime()).plusMinutes(30).isBeforeNow()) {
 
                             try {
                                 log.info("scanPaymentTimeoutOrderRecord WAIT_PAY, userId={}, orderNo={}", item.getUserId(), item.getOrderNo());
@@ -1213,6 +1214,15 @@ public class UserPaymentCoreServiceImpl implements UserPaymentCoreService {
 
                             }
 
+                        } else {
+
+                            try {
+                                log.info("scanPaymentTimeoutOrderRecord WAIT_PAY, userId={}, orderNo={}", item.getUserId(), item.getOrderNo());
+                                // 关闭待支付、超时订单
+                                applicationContext.getBean(UserPaymentCoreService.class).cancelPayment(userInfo, item.getOrderNo());
+                            } catch (Exception e) {
+                                log.error("scanPaymentTimeoutOrderRecord WAIT_PAY, userId={}, orderNo={}", item.getUserId(), item.getOrderNo(), e);
+                            }
                         }
 
                     }, 60L, TimeUnit.SECONDS);