Browse Source

乐团缴费项目改造

zouxuan 2 years ago
parent
commit
1fbabd8103

+ 0 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentStudentCourseDetailService.java

@@ -1,13 +1,8 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
-import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
 
 
 public interface MusicGroupPaymentStudentCourseDetailService extends BaseService<Long, MusicGroupPaymentStudentCourseDetail> {
 public interface MusicGroupPaymentStudentCourseDetailService extends BaseService<Long, MusicGroupPaymentStudentCourseDetail> {
 
 
-    String getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(String musicGroupId,Integer studentId,CourseSchedule.CourseScheduleType courseType,List<String> batchNos);
 }
 }

+ 6 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -898,12 +898,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
             }
             }
             if (calender.getPaymentType() == ADD_STUDENT || calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
             if (calender.getPaymentType() == ADD_STUDENT || calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
                 // 所有缴费项目已完成排课才能创建下一个缴费项目
                 // 所有缴费项目已完成排课才能创建下一个缴费项目
-                List<String> batchNoList = new ArrayList<>();
-                batchNoList.add(batchNo);
-                String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(calender.getMusicGroupId(), null, null, batchNoList);
-                if (StringUtils.isNoneBlank(orignBatchNo)) {
-                    throw new BizException("{} 存在未排课的缴费项目,请先完成排课再操作", musicGroup.getName());
-                }
+//                List<String> batchNoList = new ArrayList<>();
+//                batchNoList.add(batchNo);
+//                String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(calender.getMusicGroupId(), null, null, batchNoList);
+//                if (StringUtils.isNoneBlank(orignBatchNo)) {
+//                    throw new BizException("{} 存在未排课的缴费项目,请先完成排课再操作", musicGroup.getName());
+//                }
                 List<Integer> userIds = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
                 List<Integer> userIds = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
                 //获取欠费学员列表
                 //获取欠费学员列表
                 List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(), userIds,null);
                 List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(), userIds,null);

+ 2 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentStudentCourseDetailServiceImpl.java

@@ -1,16 +1,12 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 import com.ym.mec.biz.service.MusicGroupPaymentStudentCourseDetailService;
 import com.ym.mec.biz.service.MusicGroupPaymentStudentCourseDetailService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-
-import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 
 @Service
 @Service
 public class MusicGroupPaymentStudentCourseDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentStudentCourseDetail>  implements MusicGroupPaymentStudentCourseDetailService {
 public class MusicGroupPaymentStudentCourseDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentStudentCourseDetail>  implements MusicGroupPaymentStudentCourseDetailService {
@@ -22,9 +18,4 @@ public class MusicGroupPaymentStudentCourseDetailServiceImpl extends BaseService
 	public BaseDAO<Long, MusicGroupPaymentStudentCourseDetail> getDAO() {
 	public BaseDAO<Long, MusicGroupPaymentStudentCourseDetail> getDAO() {
 		return musicGroupPaymentStudentCourseDetailDao;
 		return musicGroupPaymentStudentCourseDetailDao;
 	}
 	}
-
-    @Override
-    public String getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(String musicGroupId, Integer studentId, CourseSchedule.CourseScheduleType courseType, List<String> batchNos) {
-        return musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, studentId, courseType, batchNos);
-    }
 }
 }

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1451,7 +1451,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
         if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
             throw new BizException("当前乐团状态不支持此操作");
             throw new BizException("当前乐团状态不支持此操作");
         }
         }
-        
+        List<MusicGroupSubjectPlan> musicSubjectClassPlan = musicGroupSubjectPlanDao.getMusicSubjectClassPlan(musicGroupId);
+        if(CollectionUtils.isEmpty(musicSubjectClassPlan)){
+            throw new BizException("请填写乐团声部信息");
+        }
+
         //记录操作日志
         //记录操作日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交审核(草稿 -> 审核中)", sysUser.getId(), ""));
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交审核(草稿 -> 审核中)", sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
         musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);

+ 21 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentStudentCourseDetailMapper.xml

@@ -218,6 +218,27 @@
         where tenant_id_ = #{tenantId}
         where tenant_id_ = #{tenantId}
     </select>
     </select>
 
 
+    <select id="getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes" resultType="string">
+        SELECT
+        mgpc.batch_no_
+        FROM music_group_payment_calender mgpc
+        LEFT JOIN music_group_payment_student_course_detail mgpscd ON mgpscd.music_group_payment_calender_id_ = mgpc.id_
+        WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpscd.sub_course_minutes_ > 0
+        <if test="studentId != null">
+            AND mgpscd.user_id_ = #{studentId}
+        </if>
+        <if test="batchNos != null">
+            AND mgpc.batch_no_ NOT IN
+            <foreach collection="batchNos" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="courseType != null">
+            AND mgpscd.course_type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        </if>
+        GROUP BY mgpc.batch_no_ ORDER BY MIN(mgpc.id_) LIMIT 1;
+    </select>
+
     <select id="getUnUseWithStudentAndCourseTypeAndCourseMinutes" resultMap="MusicGroupPaymentStudentCourseDetail">
     <select id="getUnUseWithStudentAndCourseTypeAndCourseMinutes" resultMap="MusicGroupPaymentStudentCourseDetail">
         SELECT mgpscd.*
         SELECT mgpscd.*
         FROM music_group_payment_student_course_detail mgpscd
         FROM music_group_payment_student_course_detail mgpscd