浏览代码

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

Joburgess 4 年之前
父节点
当前提交
5fc8ae78c7

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -337,4 +337,11 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @return
      */
     List<MusicGroupPaymentCalender> getMusicGroupCalenderBatchNoByIds(@Param("ids") List<String> ids);
+
+    /**
+     * 获取缴费状态在审核中或者已拒绝的缴费项目的学员
+     * @param musicGroupId
+     * @return
+     */
+    String queryCalenderStudentIds(@Param("musicGroupId") String musicGroupId, @Param("batchNo") String batchNo);
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -3510,6 +3510,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         if(noPaymentUserIds.size() > 0){
             throw new BizException("操作失败:有欠费的学员不允许创建缴费");
         }
+        //获取缴费状态在审核中或者已拒绝的缴费项目的学员
+        String studentId = musicGroupPaymentCalenderDao.queryCalenderStudentIds(musicGroup.getId(),null);
+        if(StringUtils.isNotEmpty(studentId)){
+            for (Integer integer : studentIds) {
+                if(studentId.contains(integer.toString())){
+                    throw new BizException("操作失败:所选学员有待审核或已拒绝的缴费项目");
+                }
+            }
+        }
         SysUser sysUser = sysUserFeignService.queryUserInfo();
 
         //生成缴费记录,同一个批次
@@ -3896,6 +3905,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 studentIds);
         //创建缴费项目
         MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
+        //获取缴费状态在审核中或者已拒绝的缴费项目的学员
+        String studentId = musicGroupPaymentCalenderDao.queryCalenderStudentIds(musicGroup.getId(),null);
+        if(StringUtils.isNotEmpty(studentId)){
+            for (Integer integer : studentIds) {
+                if(studentId.contains(integer.toString())){
+                    throw new BizException("操作失败:所选学员有待审核或已拒绝的缴费项目");
+                }
+            }
+        }
         BigDecimal masterTotalPrice = getMasterTotalPrice(masterClassGroupId);
         //是否有需要审核的缴费项目
         List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = paymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -441,6 +441,15 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if(noPaymentUserIds.size() > 0){
 			throw new BizException("操作失败:有欠费的学员不允许创建缴费");
 		}
+		//获取缴费状态在审核中或者已拒绝的缴费项目的学员
+		String studentIds = musicGroupPaymentCalenderDao.queryCalenderStudentIds(musicGroupId,batchNo);
+		if(StringUtils.isNotEmpty(studentIds)){
+			for (Integer integer : userIdList) {
+				if(studentIds.contains(integer.toString())){
+					throw new BizException("操作失败:所选学员有待审核或已拒绝的缴费项目");
+				}
+			}
+		}
 		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
 		
 		Long musicGroupPaymentCalenderId = null;

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

@@ -598,15 +598,24 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
 				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
 				//获取默认的学员缴费详情
-				List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
+				List<Integer> studentIdList = JSON.parseArray(adjust.getStudentIds(), Integer.class);
 				//获取欠费学员列表
-				List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroup.getId(), new ArrayList<>(studentIds));
+				List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroup.getId(), studentIdList);
 				if(noPaymentUserIds.size() > 0){
 					throw new BizException("操作失败:有欠费的学员不允许创建缴费");
 				}
+				//获取缴费状态在审核中或者已拒绝的缴费项目的学员
+				String studentIds = musicGroupPaymentCalenderDao.queryCalenderStudentIds(musicGroupId,batchNo);
+				if(StringUtils.isNotEmpty(studentIds)){
+					for (Integer integer : studentIdList) {
+						if(studentIds.contains(integer.toString())){
+							throw new BizException("操作失败:所选学员有待审核或已拒绝的缴费项目");
+						}
+					}
+				}
 
 				List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = classGroupService.queryStudentPaymentCalenders(adjust.getMasterClassGroupId(),
-						adjust.getClassGroupStudents(),studentIds);
+						adjust.getClassGroupStudents(),studentIdList);
 				List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
 
 				boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
@@ -741,7 +750,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			// 设置批次号
 			musicGroupPaymentCalender.setBatchNo(batchNo);
 			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
-
 			List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
 					.getMusicGroupPaymentCalenderCourseSettingsList();
 
@@ -1136,6 +1144,30 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 			}
 			MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
+			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("当前乐团存在未排课的缴费项目,请先完成排课再操作");
+				}
+				List<Integer> userIds = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
+				//获取欠费学员列表
+				List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(),userIds);
+				if(noPaymentUserIds.size() > 0){
+					throw new BizException("操作失败:有欠费的学员不允许创建缴费");
+				}
+				//获取缴费状态在审核中或者已拒绝的缴费项目的学员
+				String studentIds = musicGroupPaymentCalenderDao.queryCalenderStudentIds(calender.getMusicGroupId(),batchNo);
+				if(StringUtils.isNotEmpty(studentIds)){
+					for (Integer integer : userIds) {
+						if(studentIds.contains(integer.toString())){
+							throw new BizException("操作失败:所选学员有待审核或已拒绝的缴费项目");
+						}
+					}
+				}
+			}
 			//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
 			if (calender.getPaymentType() == MUSIC_APPLY) {
 				//统计乐团还在审核中或者审核被拒的缴费

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -2554,7 +2554,7 @@
             AND ta.teacher_id_ = cs.actual_teacher_id_
             AND cs.status_ = 'OVER'
             AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
-            AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
+            AND ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
         </if>
         <if test="searchType == 'NO_ATTENDANCE'">

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -747,7 +747,7 @@
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
 		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
 		AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
-		AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
+		AND ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 		<if test="organIds != null and organIds.size()>0">
 			AND cs.organ_id_ IN

+ 8 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -602,4 +602,12 @@
         AND batch_no_ IS NOT NULL
         GROUP BY music_group_id_,batch_no_
     </select>
+    <select id="queryCalenderStudentIds" resultType="java.lang.String">
+        SELECT GROUP_CONCAT(DISTINCT student_ids_) FROM music_group_payment_calender
+        WHERE status_ IN ('AUDITING','REJECT') AND music_group_id_ = #{musicGroupId}
+        <if test="batchNo != null AND batchNo != ''">
+            AND batch_no_ != #{batchNo}
+        </if>
+
+    </select>
 </mapper>