Переглянути джерело

Merge remote-tracking branch 'origin/master'

周箭河 5 роки тому
батько
коміт
11a0a23606

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentEduTeacherDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.enums.GroupType;
+
 public class StudentEduTeacherDto {
 
     private Integer studentId;
@@ -8,6 +10,16 @@ public class StudentEduTeacherDto {
 
     private String educationalTeacherName;
 
+    private String groupType;
+
+    public String getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(String groupType) {
+        this.groupType = groupType;
+    }
+
     public Integer getStudentId() {
         return studentId;
     }

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

@@ -53,6 +53,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+		String musicGroupId = musicGroupPaymentCalender.getMusicGroupId();
+
+		musicGroupDao.getLocked(musicGroupId);
 
 		Date date = new Date();
 		List<MusicGroupStudentFee> musicGroupStudentFeeList = null;
@@ -61,8 +64,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setUpdateTime(date);
 		musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		// 判断缴费开始时间、结束时间是否被其他缴费记录占用
-		int count = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(musicGroupPaymentCalender.getMusicGroupId(),
-				musicGroupPaymentCalender.getStartPaymentDate(), musicGroupPaymentCalender.getDeadlinePaymentDate());
+		int count = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(musicGroupId, musicGroupPaymentCalender.getStartPaymentDate(),
+				musicGroupPaymentCalender.getDeadlinePaymentDate());
 		if (count > 0) {
 			throw new BizException("缴费时间存在冲突,请修改缴费开始日期");
 		}
@@ -71,7 +74,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OPEN);
 			// 统计缴费人数
-			musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupPaymentCalender.getMusicGroupId());
+			musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupId);
 			if (musicGroupStudentFeeList == null) {
 				musicGroupStudentFeeList = new ArrayList<>();
 			}

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

@@ -14,6 +14,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -76,8 +77,29 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 				exercisesSituationDto.setExpectExercisesNum((int) until+1);
 				List<StudentEduTeacherDto> studentEduTeachers = studentEduTeachersMap.get(exercisesSituationDto.getStudentId());
 				if(!CollectionUtils.isEmpty(studentEduTeachers)){
-					exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
-					exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
+					List<StudentEduTeacherDto> t1 = studentEduTeachers.stream().filter(set -> set.getGroupType().equals(GroupType.VIP.getCode())||set.getGroupType().equals(GroupType.PRACTICE.getCode())).collect(Collectors.toList());
+					if(CollectionUtils.isEmpty(t1)){
+						for (StudentEduTeacherDto studentEduTeacherDto : t1) {
+							if(StringUtils.isNoneBlank(studentEduTeacherDto.getEducationalTeacherName())){
+								exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
+								exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
+								break;
+							}
+						}
+					}
+					if(StringUtils.isNoneBlank(exercisesSituationDto.getEducationalTeacherName())){
+						continue;
+					}
+					List<StudentEduTeacherDto> t2 = studentEduTeachers.stream().filter(set -> set.getGroupType().equals(GroupType.MUSIC.getCode())).collect(Collectors.toList());
+					if(CollectionUtils.isEmpty(t2)){
+						for (StudentEduTeacherDto studentEduTeacherDto : t2) {
+							if(StringUtils.isNoneBlank(studentEduTeacherDto.getEducationalTeacherName())){
+								exercisesSituationDto.setEducationalTeacherId(studentEduTeachers.get(0).getEducationalTeacherId());
+								exercisesSituationDto.setEducationalTeacherName(studentEduTeachers.get(0).getEducationalTeacherName());
+								break;
+							}
+						}
+					}
 				}
 			}
 		}

+ 8 - 4
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -458,12 +458,14 @@
         SELECT
         t.user_id_ studentId,
         t.educational_teacher_id_ educationalTeacherId,
-        su.real_name_ educationalTeacherName
+        su.real_name_ educationalTeacherName,
+        t.group_type_ groupType
         FROM
         (
         SELECT
         mgsf.user_id_,
-        g.educational_teacher_id_
+        g.educational_teacher_id_,
+        'MUSIC' group_type_
         FROM
         music_group_student_fee_ mgsf
         LEFT JOIN music_group g ON mgsf.music_group_id_ = g.id_
@@ -475,7 +477,8 @@
         UNION ALL
         SELECT
         cgsm.user_id_,
-        g.educational_teacher_id_
+        g.educational_teacher_id_,
+        'VIP' group_type_
         FROM
         class_group_student_mapper cgsm
         LEFT JOIN vip_group g ON cgsm.music_group_id_ = g.id_
@@ -488,7 +491,8 @@
         UNION ALL
         SELECT
         cgsm.user_id_,
-        g.educational_teacher_id_
+        g.educational_teacher_id_,
+        'PRACTICE' group_type_
         FROM
         class_group_student_mapper cgsm
         LEFT JOIN practice_group g ON cgsm.music_group_id_ = g.id_

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

@@ -21,6 +21,7 @@
 		<result column="open_" property="open" />
 		<association property="sysUser" javaType="com.ym.mec.auth.api.entity.SysUser">
 			<result column="username_" property="username" />
+			<result column="phone_" property="phone" />
 		</association>
 		<association property="studentRegistration" javaType="com.ym.mec.biz.dal.entity.StudentRegistration">
 			<result column="subject_names_" property="subjectName" />
@@ -157,7 +158,7 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderDetail"
 		parameterType="map">
-		SELECT mgpcd.*,su.username_,st.name_ subject_names_,sr.music_group_status_
+		SELECT mgpcd.*,su.username_,su.phone_,st.name_ subject_names_,sr.music_group_status_
 		FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
 		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
@@ -166,7 +167,7 @@
 		<where>
 			mgpc.music_group_id_ = sr.music_group_id_
 			<if test="search != null and search != ''">
-				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%'))
+				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 			<if test="id != null">
 				AND mgpcd.music_group_payment_calender_id_ = #{id}
@@ -190,7 +191,7 @@
 		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
 		<where>
 			<if test="search != null and search != ''">
-				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%'))
+				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 			<if test="id != null">
 				AND mgpcd.music_group_payment_calender_id_ = #{id}

+ 4 - 4
mec-task/src/main/java/com/ym/mec/task/controller/TaskController.java

@@ -43,7 +43,7 @@ public class TaskController extends BaseController {
 
 	@ApiOperation("任务列表分页查询")
 	@GetMapping("/list")
-	public HttpResponseResult list(TaskQueryInfo queryInfo) {
+	public HttpResponseResult<PageInfo<Task>> list(TaskQueryInfo queryInfo) {
 		PageInfo<Task> pageInfo = new PageInfo<Task>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
@@ -65,7 +65,7 @@ public class TaskController extends BaseController {
 	@ApiOperation("执行当前任务")
 	@ApiImplicitParam(name = "taskId", value = "任务编号", required = true, dataType = "Integer", paramType = "path")
 	@PostMapping("/execute/{taskId}")
-	public HttpResponseResult execute(@PathVariable("taskId") int taskId) {
+	public HttpResponseResult<Object> execute(@PathVariable("taskId") int taskId) {
 		boolean result = false;
 		try {
 			result = taskService.execute(taskId, scheduler);
@@ -79,7 +79,7 @@ public class TaskController extends BaseController {
 	@ApiOperation("暂停当前任务")
 	@ApiImplicitParam(name = "taskId", value = "任务编号", required = true, dataType = "Integer", paramType = "path")
 	@PostMapping("/pause/{taskId}")
-	public HttpResponseResult pause(@PathVariable("taskId") int taskId) {
+	public HttpResponseResult<Object> pause(@PathVariable("taskId") int taskId) {
 		boolean result = false;
 		try {
 			result = taskService.pause(taskId, scheduler);
@@ -93,7 +93,7 @@ public class TaskController extends BaseController {
 	@ApiOperation("暂停当前任务")
 	@ApiImplicitParam(name = "taskId", value = "任务编号", required = true, dataType = "Integer", paramType = "path")
 	@PostMapping("/resume/{taskId}")
-	public HttpResponseResult resume(@PathVariable("taskId") int taskId) {
+	public HttpResponseResult<Object> resume(@PathVariable("taskId") int taskId) {
 		boolean result = false;
 		try {
 			result = taskService.resume(taskId, scheduler);