Ver código fonte

Merge remote-tracking branch 'origin/master'

Joburgess 4 anos atrás
pai
commit
4d941ce293

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

@@ -603,7 +603,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @author Joburgess
      * @date 2019/11/21
      */
-    List<ClassGroup> findByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds);
+    List<ClassGroup> findByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds, @Param("lockFlag") Integer lockFlag);
 
     List<ImGroupModel> queryStudentGroup();
 

+ 0 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentClassAdjust.java

@@ -40,9 +40,6 @@ public class MusicGroupStudentClassAdjust {
 	@ApiModelProperty(value = "每个班级对应的学员", required = false)
 	private String classGroupStudents;
 
-	@ApiModelProperty(value = "是否排课", required = false)
-	private boolean courseFlag;
-
 	private Integer operatorId;
 
 	private Date createTime;
@@ -130,14 +127,6 @@ public class MusicGroupStudentClassAdjust {
 		this.studentPaymentIds = studentPaymentIds;
 	}
 
-	public boolean isCourseFlag() {
-		return courseFlag;
-	}
-
-	public void setCourseFlag(boolean courseFlag) {
-		this.courseFlag = courseFlag;
-	}
-
 	public String getNewClassGroupJson() {
 		return newClassGroupJson;
 	}

+ 0 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -386,13 +386,6 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      */
     Boolean checkSetSalary(String musicGroupId);
 
-    /**
-     * 根据classGroupIds获取班级列表
-     * @param classGroupIds
-     * @return
-     */
-    List<ClassGroup> findByClassGroupIds(List<Integer> classGroupIds);
-
     boolean updateTotalClassTimes(Integer classGroupId, Integer num);
 
     /**

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

@@ -168,8 +168,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
     @Autowired
-    private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
-    @Autowired
     private IdGeneratorService idGeneratorService;
     @Autowired
     private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
@@ -362,7 +360,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ClassGroup addMixClassGroup(String musicGroupId, String name, String classGroupIds) throws Exception {
+    public ClassGroup addMixClassGroup(String musicGroupId, String name, String classGroupIds){
         Date date;
         date = new Date();
 
@@ -3264,11 +3262,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         return false;
     }
 
-    @Override
-    public List<ClassGroup> findByClassGroupIds(List<Integer> classGroupIds) {
-        return classGroupDao.findByClassGroupIds(classGroupIds);
-    }
-
     public Boolean batchAddImGroup(List<ClassGroupImGroupDto> classGroupImGroupList) {
 
         MusicGroup musicGroup = musicGroupDao.get(classGroupImGroupList.get(0).getClassGroup().getMusicGroupId());
@@ -3696,7 +3689,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //记录申请信息
         MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = new MusicGroupStudentClassAdjust();
         musicGroupStudentClassAdjust.setBatchNo(batchNo);
-        musicGroupStudentClassAdjust.setCourseFlag(false);
         musicGroupStudentClassAdjust.setMusicGroupId(musicGroup.getId());
         musicGroupStudentClassAdjust.setOperatorId(sysUser.getId());
         musicGroupStudentClassAdjust.setNewClassGroupJson(JSON.toJSONString(classGroup4MixDtos));
@@ -3718,9 +3710,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         musicGroupStudentClassAdjust.setStudentPaymentIds(JSON.toJSONString(studentPaymentIds));
         //计算新增班级的可排课时长,总课次*默认时长  (用学员剩余的课程时长加上购买的时长,可能导致同一班级学员时长不一致)
         musicGroupStudentClassAdjust.setClassCourseMinute(JSON.toJSONString(findClassCourseMinuteMap(classGroupIds)));
-        if(status == null || status != AUDITING){
-            musicGroupStudentClassAdjust.setCourseFlag(true);
-        }
         musicGroupStudentClassAdjustDao.insert(musicGroupStudentClassAdjust);
         //如果需要审核,校验参数配置
         checkMergeClassSplitClassAffirmParam(mergeClassSplitClassAffirmDto);
@@ -3783,17 +3772,20 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         if(classGroupIds == null || classGroupIds.size() == 0){
             throw new BizException("请填写班级信息");
         }
+        //所选班级列表,是否包含已冻结的班级
+        List<ClassGroup> lockClassGroupIds = classGroupDao.findByClassGroupIds(classGroupIds, 1);
+        if(lockClassGroupIds != null && lockClassGroupIds.size() > 0){
+            throw new BizException("所选班级有审核中的合班申请");
+        }
         for (Integer classGroupId : classGroupIds) {
             List<CourseSchedule> courseSchedules = courseScheduleDao.findCoursesByClassGroupId(classGroupId,CourseStatusEnum.NOT_START);
             if(courseSchedules != null && courseSchedules.size() > 0){
                 throw new BizException("所选班级不能有未开始的临时合并课程");
             }
         }
-
         List<Integer> allTeacherIds = classGroupTeacherMapperList.stream()
                 .map(ClassGroupTeacherMapper::getUserId)
                 .collect(Collectors.toList());
-
         //所有教师列表
         List<Teacher> teachers = teacherDao.findByTeacherIds(allTeacherIds);
         Map<Integer, Teacher> teacherMap = teachers.stream()

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

@@ -5076,7 +5076,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	@Transactional(rollbackFor = Exception.class)
 	public void batchUpdateClassTeacher(List<Integer> classGroupIds,Integer oldTeacherId,Integer newTeacherId){
 		//修改班级老师
-		List<ClassGroup> classGroupList = classGroupDao.findByClassGroupIds(classGroupIds);
+		List<ClassGroup> classGroupList = classGroupDao.findByClassGroupIds(classGroupIds,null);
 		classGroupList.forEach(e->{
 			e.setUserIds(newTeacherId.toString());
 		});

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

@@ -7,7 +7,6 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.AD
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
 
-import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -22,11 +21,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import com.alibaba.fastjson.JSON;
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.service.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,19 +28,63 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
+import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentClassAdjustDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
+import com.ym.mec.biz.dal.dao.OrganizationDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
+import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
+import com.ym.mec.biz.dal.dto.CalenderPushDto;
+import com.ym.mec.biz.dal.dto.ClassGroup4MixDto;
+import com.ym.mec.biz.dal.dto.CourseTimeDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
+import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
+import com.ym.mec.biz.service.ClassGroupService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -352,8 +390,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 			}
 
-			status = musicGroupPaymentCalender.getStatus();
-
 			// 设置批次号
 			musicGroupPaymentCalender.setBatchNo(batchNo);
 			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
@@ -648,8 +684,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 			}
 
-			status = musicGroupPaymentCalender.getStatus();
-
 			// 设置批次号
 			musicGroupPaymentCalender.setBatchNo(batchNo);
 			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
@@ -918,7 +952,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			classGroup4MixDto.setCourseTimeDtoList(courseTimeDtos);
 			classGroupService.classGroupAdjust2(classGroup4MixDto);
 		}
-		musicGroupStudentClassAdjust.setCourseFlag(true);
 		//排课完成后删除所选课程
 		List<Long> courseIds = JSON.parseArray(musicGroupStudentClassAdjust.getSubLockCourseIds(), Long.class);
 		List<Integer> studentIds = JSON.parseArray(musicGroupStudentClassAdjust.getStudentIds(), Integer.class);
@@ -929,7 +962,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		//解冻班级
 		List<Integer> classGroupIds = JSON.parseArray(musicGroupStudentClassAdjust.getClassGroupIds(), Integer.class);
 		classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds,0);
-		musicGroupStudentClassAdjust.setCourseFlag(true);
 		//删除班级学员
 		musicGroupStudentClassAdjustDao.update(musicGroupStudentClassAdjust);
 		String classGroupStudents = musicGroupStudentClassAdjust.getClassGroupStudents();

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -18,6 +18,7 @@
         <result column="update_time_" property="updateTime"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="del_flag_" property="delFlag"/>
+        <result column="lock_flag_" property="lockFlag"/>
         <result column="expect_student_num_" property="expectStudentNum"/>
         <result column="total_class_times_" property="totalClassTimes"/>
         <result column="img_" property="img"/>
@@ -1074,6 +1075,9 @@
       <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
           #{classGroupId}
       </foreach>
+      <if test="lockFlag != null">
+          lock_flag_ = #{lockFlag}
+      </if>
     </select>
 
     <resultMap id="ImGroupModelMap" type="com.ym.mec.common.entity.ImGroupModel">

+ 2 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupStudentClassAdjustMapper.xml

@@ -18,7 +18,6 @@
 		<result column="sub_lock_course_ids_" property="subLockCourseIds" />
 		<result column="student_payment_ids_" property="studentPaymentIds" />
 		<result column="class_group_students_" property="classGroupStudents" />
-		<result column="course_flag_" property="courseFlag" />
 		<result column="operator_id_" property="operatorId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -38,9 +37,9 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_student_class_adjust (music_group_id_,batch_no_,new_class_group_json_,
 		class_group_ids_,student_ids_,class_course_minute_,all_lock_course_ids_,sub_lock_course_ids_,
-		course_flag_,operator_id_,student_payment_ids_,class_group_students_,create_time_,update_time_)
+		operator_id_,student_payment_ids_,class_group_students_,create_time_,update_time_)
 		VALUES(#{musicGroupId},#{batchNo},#{newClassGroupJson},#{classGroupIds},#{studentIds},
-		#{classCourseMinute},#{allLockCourseIds},#{subLockCourseIds},#{courseFlag},#{operatorId},#{studentPaymentIds},#{classGroupStudents},NOW(),NOW())
+		#{classCourseMinute},#{allLockCourseIds},#{subLockCourseIds},#{operatorId},#{studentPaymentIds},#{classGroupStudents},NOW(),NOW())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -52,9 +51,6 @@
 		<if test="studentPaymentIds != null">
 			student_payment_ids_ = #{studentPaymentIds},
 		</if>
-		<if test="courseFlag != null">
-		course_flag_ = #{courseFlag},
-		</if>
 		<if test="allLockCourseIds != null">
 		all_lock_course_ids_ = #{allLockCourseIds},
 		</if>