瀏覽代碼

Merge remote-tracking branch 'origin/master'

周箭河 5 年之前
父節點
當前提交
42d717ed96

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

@@ -5,6 +5,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 import org.apache.ibatis.annotations.Param;
 
@@ -142,7 +143,7 @@ public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudent
 	 * @param musicGroupId
 	 * @return
 	 */
-	List<MusicGroupStudentFee> queryByMusicGroupId(String musicGroupId);
+	List<MusicGroupStudentFee> queryByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("studentIds") String studentIds);
 
 	/**
 	 * 修改学员缴费周期锁定状态
@@ -194,4 +195,11 @@ public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudent
 	 * @param musicGroupPaymentCalenderDetailIds
 	 */
 	void remainNetworkClassTimesAdd(@Param("musicGroupPaymentCalenderDetailIds") String musicGroupPaymentCalenderDetailIds);
+
+	/**
+	 * 获取fee表学员列表
+	 * @param musicGroupId
+	 * @return
+	 */
+    List<FeeStudentDto> queryFeeStudents(String musicGroupId);
 }

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -4,14 +4,11 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Subject;
 import org.apache.ibatis.annotations.Param;
 
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
-import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
-import com.ym.mec.biz.dal.dto.StudentInfo;
-import com.ym.mec.biz.dal.dto.StudentRegisterPerDto;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
@@ -328,4 +325,11 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     List<Subject> findMusicGroupAllStudentSubjects(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 获取学员详情页,包含所在乐团信息
+     * @param studentId
+     * @return
+     */
+    StudentMusicDetailDto getStudentDetail(Integer studentId);
 }

+ 65 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/FeeStudentDto.java

@@ -0,0 +1,65 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.math.BigDecimal;
+
+public class FeeStudentDto {
+    private Integer userId;
+
+    private String username;
+
+    private Integer gender;
+
+    private String subjectName;
+
+    private BigDecimal courseFee;
+
+    private String musicGroupId;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public Integer getGender() {
+        return gender;
+    }
+
+    public void setGender(Integer gender) {
+        this.gender = gender;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public BigDecimal getCourseFee() {
+        return courseFee;
+    }
+
+    public void setCourseFee(BigDecimal courseFee) {
+        this.courseFee = courseFee;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+}

+ 87 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentMusicDetailDto.java

@@ -0,0 +1,87 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.MusicGroup;
+
+import java.util.List;
+
+public class StudentMusicDetailDto {
+    private Integer userId;
+
+    private String username;
+
+    private Integer gender;
+
+    private String subjectName;
+
+    private String phone;
+
+    private String avatar;
+
+    private String imToken;
+
+    private List<MusicGroup> musicGroups;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public Integer getGender() {
+        return gender;
+    }
+
+    public void setGender(Integer gender) {
+        this.gender = gender;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getImToken() {
+        return imToken;
+    }
+
+    public void setImToken(String imToken) {
+        this.imToken = imToken;
+    }
+
+    public List<MusicGroup> getMusicGroups() {
+        return musicGroups;
+    }
+
+    public void setMusicGroups(List<MusicGroup> musicGroups) {
+        this.musicGroups = musicGroups;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java

@@ -57,6 +57,16 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 	/**  */
 	private java.util.Date updateTime;
 
+	private String studentIds;
+
+	public String getStudentIds() {
+		return studentIds;
+	}
+
+	public void setStudentIds(String studentIds) {
+		this.studentIds = studentIds;
+	}
+
 	public void setId(Long id) {
 		this.id = id;
 	}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -43,4 +44,11 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
      * @param userId
      */
     void add(Long musicGroupPaymentCalenderId, Integer userId);
+
+    /**
+     * 获取fee表学员列表
+     * @param musicGroupId
+     * @return
+     */
+    List<FeeStudentDto> queryFeeStudents(String musicGroupId);
 }

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

@@ -242,4 +242,11 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 	 * @return
 	 */
 	List<Subject> findMusicGroupAllStudentSubjects(String musicGroupId);
+
+	/**
+	 * 获取学员详情页,包含所在乐团信息
+	 * @param studentId
+	 * @return
+	 */
+	StudentMusicDetailDto getStudentDetail(Integer studentId);
 }

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
@@ -221,4 +222,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		musicGroupPaymentCalenderDao.update(calender);
 		musicGroupStudentFeeDao.update(studentFee);
 	}
+
+	@Override
+	public List<FeeStudentDto> queryFeeStudents(String musicGroupId) {
+		return musicGroupStudentFeeDao.queryFeeStudents(musicGroupId);
+	}
 }

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

@@ -78,44 +78,40 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.YES);
 		} else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
 			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.OPEN);
-			// 统计缴费人数
-			musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupId);
-			if (musicGroupStudentFeeList == null) {
-				musicGroupStudentFeeList = new ArrayList<>();
-			}
-			musicGroupPaymentCalender.setExpectNum(musicGroupStudentFeeList.size());
 		} else {
 			musicGroupPaymentCalender.setPaymentStatus(PaymentStatusEnum.NO);
 		}
+		// 统计缴费人数
+		musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(musicGroupId,musicGroupPaymentCalender.getStudentIds());
+		if (musicGroupStudentFeeList == null) {
+			musicGroupStudentFeeList = new ArrayList<>();
+		}
+		musicGroupPaymentCalender.setExpectNum(musicGroupStudentFeeList.size());
 
 		this.insert(musicGroupPaymentCalender);
 
 		List<MusicGroupStudentFee> updateMusicGroupStudentFeeList = new ArrayList<MusicGroupStudentFee>();
 
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
-		if (musicGroupPaymentCalender.getPaymentStatus() == PaymentStatusEnum.OPEN) {
-			if (musicGroupStudentFeeList != null && musicGroupStudentFeeList.size() > 0) {
-				Set<Integer> studentIds = new HashSet<Integer>();
-				MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
-				// 创建缴费明细
-				for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
-					/*if (mgsf.getPaymentStatus() != PaymentStatus.PAID_COMPLETED) {
-						continue;
-					}*/
-					musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
-					musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-					musicGroupPaymentCalenderDetail.setCreateTime(date);
-					musicGroupPaymentCalenderDetail.setExpectAmount(mgsf.getCourseFee());
-					musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-					if (mgsf.getCourseFee().doubleValue() != 0) {
-						studentIds.add(mgsf.getUserId());
-					}
-					musicGroupPaymentCalenderDetail.setUpdateTime(date);
-					musicGroupPaymentCalenderDetail.setUserId(mgsf.getUserId());
 
-					musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
+		if (musicGroupStudentFeeList != null && musicGroupStudentFeeList.size() > 0) {
+			Set<Integer> studentIds = new HashSet<>();
+			MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
+			// 创建缴费明细
+			for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
+				musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+				musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalenderDetail.setCreateTime(date);
+				musicGroupPaymentCalenderDetail.setExpectAmount(mgsf.getCourseFee());
+				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
+				if (mgsf.getCourseFee().doubleValue() != 0) {
+					studentIds.add(mgsf.getUserId());
 				}
-
+				musicGroupPaymentCalenderDetail.setUpdateTime(date);
+				musicGroupPaymentCalenderDetail.setUserId(mgsf.getUserId());
+				musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
+			}
+			if (musicGroupPaymentCalender.getPaymentStatus() == PaymentStatusEnum.OPEN) {
 				// 更新学员缴费状态
 				for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
 					mgsf.setPaymentStatus(PaymentStatus.NON_PAYMENT);
@@ -187,7 +183,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 		for (MusicGroupPaymentCalender mgpc : musicGroupPaymentCalenderList) {
 
-			List<MusicGroupStudentFee> musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(mgpc.getMusicGroupId());
+			List<MusicGroupStudentFee> musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(mgpc.getMusicGroupId(),null);
 			Map<Integer, MusicGroupStudentFee> feeMap = musicGroupStudentFeeList.stream()
 					.collect(Collectors.toMap(MusicGroupStudentFee::getUserId, fee -> fee));
 
@@ -226,10 +222,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				// 学生状态更新进行中
 				Set<Integer> studentIds = new HashSet<Integer>();
 				// 创建缴费明细
-				for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
-					/*if (mgsf.getPaymentStatus() != PaymentStatus.PAID_COMPLETED) {
+				/*for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
+					if (mgsf.getPaymentStatus() != PaymentStatus.PAID_COMPLETED) {
 						continue;
-					}*/
+					}
 					musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
 					musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(mgpc.getId());
 					musicGroupPaymentCalenderDetail.setCreateTime(date);
@@ -242,7 +238,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					musicGroupPaymentCalenderDetail.setUserId(mgsf.getUserId());
 
 					musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
-				}
+				}*/
 
 				// 更新学员缴费状态
 				for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {

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

@@ -5,10 +5,7 @@ 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.*;
-import com.ym.mec.biz.dal.dto.StudentAddDto;
-import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
-import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
-import com.ym.mec.biz.dal.dto.StudentInfo;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
@@ -1028,4 +1025,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     public List<Subject> findMusicGroupAllStudentSubjects(String musicGroupId) {
         return studentRegistrationDao.findMusicGroupAllStudentSubjects(musicGroupId);
     }
+
+    @Override
+    public StudentMusicDetailDto getStudentDetail(Integer studentId) {
+        return studentRegistrationDao.getStudentDetail(studentId);
+    }
 }

+ 18 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml

@@ -228,6 +228,24 @@
     </select>
     <select id="queryByMusicGroupId" resultMap="MusicGroupStudentFee">
         SELECT * FROM music_group_student_fee_ WHERE music_group_id_ = #{musicGroupId}
+        <if test="studentIds != null and studentIds != ''">
+            AND FIND_IN_SET(user_id_,#{studentIds})
+        </if>
+    </select>
+    <resultMap id="FeeStudentDto" type="com.ym.mec.biz.dal.dto.FeeStudentDto">
+        <result property="userId" column="id_"/>
+        <result property="username" column="username_"/>
+        <result property="musicGroupId" column="music_group_id_"/>
+        <result property="subjectName" column="name_"/>
+        <result property="courseFee" column="course_fee_"/>
+        <result property="gender" column="gender_"/>
+    </resultMap>
+    <select id="queryFeeStudents" resultMap="FeeStudentDto">
+        SELECT su.id_,su.username_,su.gender_,s.name_,mgsf.course_fee_,mgsf.music_group_id_
+        FROM music_group_student_fee_ mgsf
+        LEFT JOIN sys_user su ON su.id_ = mgsf.user_id_
+        LEFT JOIN `subject` s ON s.id_ = mgsf.subject_id_
+        WHERE mgsf.music_group_id_ = #{musicGroupId}
     </select>
 
     <update id="batchUpdate" parameterType="java.util.List">

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -610,4 +610,27 @@
         LEFT JOIN subject s ON sr.actual_subject_id_=s.id_
         WHERE sr.music_group_id_=#{musicGroupId} ORDER BY s.id_
     </select>
+    <resultMap id="getStudentDetail" type="com.ym.mec.biz.dal.dto.StudentMusicDetailDto">
+        <result property="gender" column="gender_"/>
+        <result column="subject_name_" property="subjectName"/>
+        <result property="username" column="username_"/>
+        <result property="userId" column="id_"/>
+        <result property="phone" column="phone_"/>
+        <result property="avatar" column="avatar_"/>
+        <result property="imToken" column="im_token_"/>
+        <collection property="musicGroups" ofType="com.ym.mec.biz.dal.entity.MusicGroup">
+            <result property="name" column="music_group_name_"/>
+            <result column="music_group_id_" property="id"/>
+        </collection>
+    </resultMap>
+    <select id="getStudentDetail" resultMap="getStudentDetail">
+        SELECT su.username_,su.gender_,su.phone_,su.avatar_,su.id_,su.im_token_,
+        mg.name_ music_group_name_,mg.id_ music_group_id_,sj.name_ subject_name_
+        FROM student s
+        LEFT JOIN music_group_student_fee_ mgsf ON mgsf.user_id_ = s.user_id_
+        LEFT JOIN music_group mg ON mg.id_ = mgsf.music_group_id_
+        LEFT JOIN `subject` sj ON sj.id_ = mgsf.subject_id_
+        LEFT JOIN sys_user su ON su.id_ = s.user_id_
+        WHERE s.user_id_ = #{studentId}
+    </select>
 </mapper>

+ 6 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherManageController.java

@@ -177,4 +177,10 @@ public class TeacherManageController extends BaseController {
         }
         return succeed(studentRegistrationService.batchUpdateSubject(userId, subId,musicGroupId));
     }
+
+    @ApiOperation(value = "获取学员详情页,包含所在乐团信息")
+    @PostMapping("studentManage/detail")
+    public Object getStudentDetail(Integer studentId){
+        return succeed(studentRegistrationService.getStudentDetail(studentId));
+    }
 }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -38,6 +38,13 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation(value = "新增缴费学员列表获取")
+    @PostMapping("/queryFeeStudents")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/queryFeeStudents')")
+    public Object queryFeeStudents(String musicGroupId) {
+        return succeed(musicGroupPaymentCalenderDetailService.queryFeeStudents(musicGroupId));
+    }
+
     @ApiOperation(value = "乐团缴费记录新增学员")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/add')")