浏览代码

1、陪练课调整
2、付费陪练课

Joburgess 5 年之前
父节点
当前提交
de58e29036

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/GroupClassService.java

@@ -16,7 +16,17 @@ public interface GroupClassService {
      * @param groupType: 团体类型
      * @return boolean
      */
-    boolean deleteGroupInfo(String groupId, GroupType groupType);
+    boolean deleteAllGroupInfo(String groupId, GroupType groupType);
+
+    /**
+     * @describe 删除团体信息
+     * @author Joburgess
+     * @date 2020/2/17
+     * @param groupId: 团体编号
+     * @param groupType: 团体类型
+     * @return boolean
+     */
+    boolean deleteGroupOtherInfo(String groupId, GroupType groupType);
 
     /**
      * @describe 清理团新相关信息

+ 16 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java

@@ -37,7 +37,7 @@ public class GroupClassServiceImpl implements GroupClassService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean deleteGroupInfo(String groupId, GroupType groupType) {
+    public boolean deleteAllGroupInfo(String groupId, GroupType groupType) {
         groupDao.deleteGroup(groupId,groupType.getCode());
         classGroupDao.deleteByGroup(groupId,groupType);
         classGroupTeacherMapperDao.deleteByGroup(groupId,groupType);
@@ -52,6 +52,21 @@ public class GroupClassServiceImpl implements GroupClassService {
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean deleteGroupOtherInfo(String groupId, GroupType groupType) {
+        classGroupDao.deleteByGroup(groupId,groupType);
+        classGroupTeacherMapperDao.deleteByGroup(groupId,groupType);
+        classGroupTeacherSalaryDao.deleteByGroup(groupId,groupType);
+        classGroupStudentMapperDao.deleteByGroup(groupId,groupType);
+        courseScheduleDao.deleteByGroup(groupId,groupType);
+        courseScheduleTeacherSalaryDao.deleteByGroup(groupId,groupType);
+        courseScheduleStudentPaymentDao.deleteByGroup(groupId,groupType);
+        teacherAttendanceDao.deleteByGroup(groupId,groupType);
+        studentAttendanceDao.deleteByGroup(groupId,groupType);
+        return true;
+    }
+
+    @Override
     public boolean cleanGroupInfo(String groupId, GroupType groupType) {
 
         return false;

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -2996,7 +2996,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 sysUserCashAccountService.updateBalance(order.getUserId(), order.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "陪练课购买失败");
             }
             studentPaymentOrderDao.update(order);
-            groupService.deleteGroupInfo(order.getMusicGroupId(),GroupType.PRACTICE);
+            groupService.deleteGroupOtherInfo(order.getMusicGroupId(),GroupType.PRACTICE);
             return;
         }
         studentPaymentOrderDao.update(order);
@@ -3160,7 +3160,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         }
         PracticeGroup practiceGroup = practiceGroupDao.lockPracticeGroup(practiceGroupId);
         if(Objects.isNull(practiceGroup)){
-            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "此课程组已过期,请重新购买");
+            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "此课程组已失效,请重新购买");
         }
         if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.LOCK)){
             return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "此课程组订单正在支付中");
@@ -3169,7 +3169,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         Map<DealStatusEnum, List<StudentPaymentOrder>> statusOrderMap = userGroupOrders.stream().collect(Collectors.groupingBy(StudentPaymentOrder::getStatus));
         List<StudentPaymentOrder> successOrders=statusOrderMap.get(DealStatusEnum.SUCCESS);
         if(!CollectionUtils.isEmpty(successOrders)&&successOrders.size()>0){
-            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "该订单已经支付成功,请勿重复购买");
+            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "该订单已经支付成功");
         }
 
         StudentPaymentOrder latestOrder=userGroupOrders.stream().max(Comparator.comparing(StudentPaymentOrder::getId)).get();
@@ -3179,7 +3179,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
         List<StudentPaymentOrder> ingOrders = statusOrderMap.get(DealStatusEnum.ING);
         if(CollectionUtils.isEmpty(ingOrders)||ingOrders.size()<=0){
-            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "该订单支付失败,请重新购买");
+            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "此课程组已失效,请重新购买");
         }else{
             for (StudentPaymentOrder ingOrder : ingOrders) {
                 ingOrder.setStatus(DealStatusEnum.CLOSE);