Browse Source

Merge branch 'saas' into master_saas

yonge 3 years ago
parent
commit
27adb2d490

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -246,7 +246,7 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @param musicGroupId
 	 * @return
 	 */
-	List<Integer> queryNoPaymentUserIds(@Param("musicGroupId") String musicGroupId, @Param("userIds") List<Integer> userIds);
+	List<Integer> queryNoPaymentUserIds(@Param("musicGroupId") String musicGroupId, @Param("userIds") List<Integer> userIds, @Param("batchNo") String batchNo);
 
 	/**
 	 * @describe 未缴费学员列表

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

@@ -137,7 +137,7 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @param newMusicGroupId 主乐团
      * @return
      */
-    void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId, Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect);
+    void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId, Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect,String batchNo);
 
     /**
      * 获取班级学生

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

@@ -4136,7 +4136,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         MusicGroup musicGroup = musicGroupDao.findByClassGroupId(classGroupIds.get(0));
         //获取欠费学员列表
-        List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroup.getId(), new ArrayList<>(studentIds));
+        List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroup.getId(), new ArrayList<>(studentIds),null);
         if (noPaymentUserIds.size() > 0) {
             throw new BizException("操作失败:有欠费的学员不允许创建缴费");
         }
@@ -4715,7 +4715,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = calenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
             for (Map<Integer, String> classGroupStudent : classGroupStudents) {
                 Integer classGroupId = classGroupStudent.keySet().iterator().next();
-                studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId), musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroup.getId(), collect);
+                studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId), musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroup.getId(), collect,paymentCalenderDto.getBatchNo());
             }
             List<Map> classGroupStudents1 = JSON.parseArray(musicGroupStudentClassAdjust.getClassGroupStudents(), Map.class);
             spanGroupClassAdjustPass(masterClassGroupId, studentIds, courseIds, classGroupStudents1, allLockCourseIds, paymentCalenderDto.getBatchNo(), masterTotalPrice);

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

@@ -186,7 +186,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
 		}*/
 		//获取欠费学员列表
-		List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroupId, new ArrayList<>(userIdList));
+		List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroupId, new ArrayList<>(userIdList),null);
 		if(noPaymentUserIds.size() > 0){
 			throw new BizException("操作失败:有欠费的学员不允许创建缴费");
 		}

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

@@ -554,7 +554,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         //获取默认的学员缴费详情
         List<Integer> studentIdList = JSON.parseArray(adjust.getStudentIds(), Integer.class);
         //获取欠费学员列表
-        List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroup.getId(), studentIdList);
+        List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(musicGroup.getId(), studentIdList,null);
         if (noPaymentUserIds.size() > 0) {
             throw new BizException("操作失败:有欠费的学员不允许创建缴费");
         }
@@ -963,7 +963,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                 }
                 List<Integer> userIds = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
                 //获取欠费学员列表
-                List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(), userIds);
+                List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(), userIds,null);
                 if (noPaymentUserIds.size() > 0) {
                     throw new BizException("{} 有欠费的学员不允许创建缴费", musicGroup.getName());
                 }
@@ -1012,7 +1012,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                 List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(), Map.class);
                 for (Map<Integer, String> classGroupStudent : classGroupStudents) {
                     Integer classGroupId = classGroupStudent.keySet().iterator().next();
-                    studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId), musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroup.getId(), collect);
+                    studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId), musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroup.getId(), collect,null);
                 }
                 //删除和解冻班级,课程信息
                 List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);

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

@@ -500,7 +500,7 @@ public class StudentManageServiceImpl implements StudentManageService {
             }
         }
         if(userIds.size() > 0 && queryInfo.getOweFlag() != null){
-            List<Integer> studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(queryInfo.getMusicGroupId(),userIds);
+            List<Integer> studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(queryInfo.getMusicGroupId(),userIds,null);
             if(queryInfo.getOweFlag()){
                 userIds = studentIds;
             }else {

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -977,10 +977,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-    public void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId, Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect) {
+    public void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId,
+                              Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect,String batchNo) {
         //获取欠费学员列表
         List<Integer> studentIdList = Arrays.asList(studentIds.split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
-        List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(newMusicGroupId, studentIdList);
+        List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(newMusicGroupId, studentIdList,batchNo);
         if (noPaymentUserIds.size() > 0) {
             throw new BizException("操作失败:有欠费的学员不允许创建缴费");
         }

+ 11 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -2,10 +2,8 @@ package com.ym.mec.biz.service.impl;
 
 import java.math.BigDecimal;
 import java.time.DayOfWeek;
-import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -20,7 +18,6 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -59,6 +56,7 @@ import com.ym.mec.biz.dal.enums.IndexDataType;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.TeachTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import com.ym.mec.biz.service.StudentServeService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysTenantConfigService;
@@ -373,6 +371,8 @@ public class StudentServeServiceImpl implements StudentServeService {
         	return;
         }
         
+        Map<String,List<Integer>> musicGroupStudentMap = studentRegistrationList.stream().collect(Collectors.groupingBy(StudentRegistration :: getMusicGroupId, Collectors.mapping(StudentRegistration :: getUserId, Collectors.toList())));
+        
         List<Integer> studentIds = studentRegistrationList.stream().map(t -> t.getUserId()).distinct().collect(Collectors.toList());
 
         Set<String> holidayDays = new HashSet<>();
@@ -456,12 +456,15 @@ public class StudentServeServiceImpl implements StudentServeService {
 		Set<Long> courseIdList = null;
 		ClassGroupTypeEnum teacherType;
 		Map<Integer,Integer> teacherCourseNumMap = null;
+		List<Integer> musicGroupStudentIdList = null;
         
         //理论上一个学生一个乐团只布置一次作业
 		for (Entry<String, List<Integer>> entry : musicGroupStudentIdListMap.entrySet()) {
 			
 			musicGroupId = entry.getKey();
 			
+			musicGroupStudentIdList = musicGroupStudentMap.get(musicGroupId);
+			
 			MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 			if(musicGroup == null || musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS){
 				continue;
@@ -477,6 +480,11 @@ public class StudentServeServiceImpl implements StudentServeService {
 			userCourseMap = musicGroupStudentCurrentWeekCourseMap.get(musicGroupId);
 			
 			for(Integer studentId : entry.getValue()){
+				
+				if(musicGroupStudentIdList == null || musicGroupStudentIdList.contains(studentId) == false){
+					continue;
+				}
+				
 				//在当前乐团,学生本周是否有课
 				if(userCourseMap == null || userCourseMap.get(studentId) == null){//如果本周没课
 					

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -105,6 +105,9 @@ public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicS
 		sysMusicScoreDao.insert(sysMusicScore);
 		List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = musicScoreDto.getSysMusicScoreAccompaniments();
 		if(sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0){
+			sysMusicScoreAccompaniments.forEach(e -> {
+				e.setIsOpenMetronome(sysMusicScore.getIsOpenMetronome());
+			});
 			sysMusicScoreAccompanimentDao.batchInsert(sysMusicScoreAccompaniments,sysMusicScore.getId(),sysMusicScore.getIsOpenMetronome());
 		}
 		Integer categoriesId = sysMusicScore.getMusicScoreCategoriesId();

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -417,6 +417,9 @@
 				#{item}
 			</foreach>
 		</if>
+		<if test="batchNo != null and batchNo != ''">
+			AND mgpc.batch_no_ != #{batchNo}
+		</if>
 		GROUP BY mgpcd.user_id_
 	</select>
 

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/DegreeController.java

@@ -94,7 +94,7 @@ public class DegreeController extends BaseController {
             teacherDao.updateUser(user);
         }
         degreeRegistration.setOrganId(user.getOrganId());
-        if(Objects.isNull(degreeRegistration.getOrganId())){
+        if(Objects.isNull(degreeRegistration.getOrganId()) || degreeRegistration.getOrganId() == 4){
             return failed("该分部暂未开放此活动");
         }
         HttpResponseResult pay = degreeRegistrationService.pay(degreeRegistration);

+ 0 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -406,7 +406,6 @@ public class StudentManageController extends BaseController {
 
     @ApiOperation(value = "云教练学员数据预览")
     @GetMapping("/getCloudStudyStudentOverView")
-    @PreAuthorize("@pcs.hasPermissions('studentManage/getCloudStudyStudentOverView')")
     public HttpResponseResult<Object> getCloudStudyStudentOverView(String organIds) throws Exception {
         List<Integer> organIdsList;
         if(StringUtils.isNotBlank(organIds)){