瀏覽代碼

合班拆班

zouxuan 4 年之前
父節點
當前提交
e0350203fd

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java

@@ -65,4 +65,15 @@ public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Inte
 	 * @time 16:04
 	 */
 	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Long calenderId);
+
+	/**
+	 * @param calenderId:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
+	 * @describe 获取收费标准
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/10/30
+	 * @time 16:04
+	 */
+	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettingsByBatchNo(String batchNo);
 }

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

@@ -185,7 +185,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     List<Map<Long, Long>> countActualNum(@Param("id") Long id);
 
     /**
-     * @param calenderId:
+     * @param batchNo:
      * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto
      * @describe 获取审核详情
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
@@ -193,7 +193,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @date 2020/11/2
      * @time 17:46
      */
-    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("calenderId") Long calenderId);
+    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("batchNo") String batchNo);
 
     /**
      * 获取乐团的报名缴费日历

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

@@ -170,11 +170,11 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
      * @author zouxuan
      * @date 2020/10/30
      * @time 16:39
-     * @param calenderId:
+     * @param batchNo:
      * @param musicGroupId:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
-	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Long calenderId, @Param("musicGroupId") String musicGroupId);
+	List<SimpleUserDto> querySimpleUserDto(@Param("batchNo") String batchNo, @Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 统计实际收款金额

+ 12 - 21
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDetailDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -9,37 +11,26 @@ public class MusicGroupPaymentCalenderAuditDetailDto {
     @ApiModelProperty(value = "缴费项基本信息",required = false)
     private MusicGroupPaymentCalenderAuditDto auditDto;
 
-    @ApiModelProperty(value = "学员数量",required = false)
-    private Integer studentNum;
-
-    @ApiModelProperty(value = "学员名单",required = false)
-    private List<SimpleUserDto> simpleUserDtos;
-
     @ApiModelProperty(value = "收费标准列表",required = false)
     private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings;
 
-    public MusicGroupPaymentCalenderAuditDto getAuditDto() {
-        return auditDto;
-    }
+    @ApiModelProperty(value = "缴费周期列表",required = false)
+    private List<MusicGroupPaymentCalender> musicGroupPaymentCalenders;
 
-    public void setAuditDto(MusicGroupPaymentCalenderAuditDto auditDto) {
-        this.auditDto = auditDto;
+    public List<MusicGroupPaymentCalender> getMusicGroupPaymentCalenders() {
+        return musicGroupPaymentCalenders;
     }
 
-    public Integer getStudentNum() {
-        return studentNum;
+    public void setMusicGroupPaymentCalenders(List<MusicGroupPaymentCalender> musicGroupPaymentCalenders) {
+        this.musicGroupPaymentCalenders = musicGroupPaymentCalenders;
     }
 
-    public void setStudentNum(Integer studentNum) {
-        this.studentNum = studentNum;
-    }
-
-    public List<SimpleUserDto> getSimpleUserDto() {
-        return simpleUserDtos;
+    public MusicGroupPaymentCalenderAuditDto getAuditDto() {
+        return auditDto;
     }
 
-    public void setBasicUserDtos(List<SimpleUserDto> simpleUserDtos) {
-        this.simpleUserDtos = simpleUserDtos;
+    public void setAuditDto(MusicGroupPaymentCalenderAuditDto auditDto) {
+        this.auditDto = auditDto;
     }
 
     public List<MusicGroupPaymentCalenderCourseSettings> getMusicGroupPaymentCalenderCourseSettings() {

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDto.java

@@ -22,6 +22,9 @@ public class MusicGroupPaymentCalenderAuditDto {
     @ApiModelProperty(value = "乐团编号",required = false)
     private String musicGroupId;
 
+    @ApiModelProperty(value = "批次号",required = false)
+    private String batchNo;
+
     @ApiModelProperty(value = "创建时间",required = false)
     private Date createTime;
 
@@ -78,6 +81,14 @@ public class MusicGroupPaymentCalenderAuditDto {
     @ApiModelProperty(value = "是否赠送网管课",required = false)
     private Boolean isGiveMusicNetwork;
 
+    public String getBatchNo() {
+        return batchNo;
+    }
+
+    public void setBatchNo(String batchNo) {
+        this.batchNo = batchNo;
+    }
+
     public Boolean getIsGiveMusicNetwork() {
         return isGiveMusicNetwork;
     }

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

@@ -107,7 +107,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @param calenderId:
 	 * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto
 	 */
-	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId);
+	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(String batchNo);
 
 	/**
 	 * @describe 审核通过

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

@@ -595,20 +595,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	}
 
 	@Override
-	public MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId) {
+	public MusicGroupPaymentCalenderAuditDetailDto auditListDetail(String batchNo) {
 		MusicGroupPaymentCalenderAuditDetailDto calenderAuditDetailDto = new MusicGroupPaymentCalenderAuditDetailDto();
-		MusicGroupPaymentCalenderAuditDto auditDto = musicGroupPaymentCalenderDao.getAuditDetail(calenderId);
-		if(auditDto.getOrganId() != null){
-			Organization organization = organizationDao.get(auditDto.getOrganId());
-			auditDto.setOrganName(organization.getName());
-		}
+		MusicGroupPaymentCalenderAuditDto auditDto = musicGroupPaymentCalenderDao.getAuditDetail(batchNo);
 		calenderAuditDetailDto.setAuditDto(auditDto);
-
 		//获取收费标准
-		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId));
+		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
 		//获取学员列表
-		calenderAuditDetailDto.setBasicUserDtos(musicGroupPaymentCalenderDetailDao.querySimpleUserDto(calenderId,auditDto.getMusicGroupId()));
-		calenderAuditDetailDto.setStudentNum(calenderAuditDetailDto.getSimpleUserDto().size());
+//		calenderAuditDetailDto.setBasicUserDtos(musicGroupPaymentCalenderDetailDao.querySimpleUserDto(batchNo,auditDto.getMusicGroupId()));
+//		calenderAuditDetailDto.setStudentNum(calenderAuditDetailDto.getSimpleUserDto().size());
+		//获取缴费周期
+		List<MusicGroupPaymentCalender> groupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+		calenderAuditDetailDto.setMusicGroupPaymentCalenders(groupPaymentCalenders);
 		return calenderAuditDetailDto;
 	}
 

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

@@ -137,4 +137,12 @@
 		SELECT * FROM music_group_payment_calender_course_settings mgpccs
 		WHERE mgpccs.music_group_payment_calender_id_ = #{calenderId}
 	</select>
+	<select id="queryCalenderCourseSettingsByBatchNo" resultMap="MusicGroupPaymentCalenderCourseSettings">
+		SELECT MAX(mgpccs.music_group_payment_calender_id_) music_group_payment_calender_id_,
+		mgpccs.course_type_,SUM(mgpccs.course_total_minuties_) course_total_minuties_,SUM(mgpccs.unit_price_) unit_price_,SUM(mgpccs.course_original_price_)course_original_price_,
+				SUM(mgpccs.course_current_price_)course_current_price_,MAX(mgpccs.is_student_optional_)is_student_optional_,MAX(mgpccs.name_)name_ FROM music_group_payment_calender_course_settings mgpccs
+		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
+		WHERE mgpc.batch_no_ = #{batchNo}
+		GROUP BY mgpccs.course_type_
+	</select>
 </mapper>

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

@@ -351,10 +351,11 @@
     <select id="querySimpleUserDto" resultMap="SimpleUserDtoMap">
 		SELECT su.id_,su.username_,s.name_ subject_name_,mgpcd.actual_amount_
 		FROM music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
 		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
-		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_ AND sr.music_group_status_ != 'QUIT' AND sr.music_group_id_ = #{musicGroupId}
+		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_ AND sr.music_group_status_ != 'QUIT' AND sr.music_group_id_ = mgpc.music_group_id_
 		LEFT JOIN `subject` s ON s.id_ = sr.subject_id_
-		WHERE mgpcd.music_group_payment_calender_id_ = #{calenderId}
+		WHERE mgpc.batch_no_ = #{batchNo}
 	</select>
 	<select id="sumActualAmount" resultType="java.math.BigDecimal">
 		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd

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

@@ -402,8 +402,10 @@
 
     <resultMap id="MusicGroupPaymentCalenderAuditDtoMap" type="com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto">
         <result property="musicGroupId" column="music_group_id_"/>
+        <result property="batchNo" column="batch_no_"/>
         <result property="musicGroupName" column="music_group_name_"/>
         <result property="organId" column="organ_id_"/>
+        <result property="organName" column="organ_name_"/>
         <result property="createTime" column="create_time_"/>
         <result property="paymentType" column="payment_type_"/>
         <result property="memo" column="memo_"/>
@@ -441,21 +443,20 @@
         </where>
     </sql>
     <select id="countAuditList" resultType="java.lang.Integer">
-        SELECT COUNT(DISTINCT mgpc.id_)
+        SELECT COUNT(DISTINCT mgpc.batch_no_)
         FROM music_group_payment_calender mgpc
         LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
         <include refid="MusicGroupPaymentCalenderAuditDtoSql"/>
     </select>
     <select id="queryAuditList" resultMap="MusicGroupPaymentCalenderAuditDtoMap">
-        SELECT mgpc.id_,mgpc.music_group_id_,mgpc.create_time_,mgpc.payment_type_,mgpc.operator_,
-        mgpc.pay_user_type_,mgpc.memo_,mgpc.status_,SUM(mgpccs.course_total_minuties_) course_total_minuties_,
+        SELECT mgpc.batch_no_,MAX(mgpc.music_group_id_) music_group_id_
+        ,MAX(mgpc.create_time_) create_time_,MAX(mgpc.payment_type_) payment_type_,MAX(mgpc.operator_) operator_,
+        MAX(mgpc.pay_user_type_) pay_user_type_,MAX(mgpc.memo_) memo_,MAX(mgpc.status_) status_,
+        SUM(mgpccs.course_total_minuties_) course_total_minuties_,
         SUM(mgpccs.course_original_price_) course_original_price_,SUM(mgpccs.course_current_price_) course_current_price_,
-        MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,mgpc.payment_pattern_
-        FROM music_group_payment_calender mgpc
-        LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
-        LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
+        MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,MAX(mgpc.payment_pattern_)payment_pattern_
         <include refid="MusicGroupPaymentCalenderAuditDtoSql"/>
-        GROUP BY mgpc.id_
+        GROUP BY mgpc.batch_no_
         ORDER BY create_time_ DESC
         <include refid="global.limit"/>
     </select>
@@ -471,15 +472,14 @@
         GROUP BY mgpcd.music_group_payment_calender_id_
     </select>
     <select id="getAuditDetail" resultMap="MusicGroupPaymentCalenderAuditDtoMap">
-        SELECT mgpc.id_,mgpc.music_group_id_,mgpc.create_time_,mgpc.payment_type_,mgpc.operator_,
-        mgpc.pay_user_type_,mgpc.memo_,mgpc.status_,SUM(mgpccs.course_total_minuties_) course_total_minuties_,
-        SUM(mgpccs.course_original_price_) course_original_price_,SUM(mgpccs.course_current_price_) course_current_price_,
-        MAX(mg.name_) music_group_name_,MAX(mg.organ_id_) organ_id_,MAX(mgpccs.name_) calender_settings_name_,mgpc.payment_pattern_,mgpc.payment_valid_start_date_,
-        mgpc.payment_valid_end_date_,mgpc.start_payment_date_,mgpc.deadline_payment_date_,mgpc.audit_memo_,mgpc.payment_amount_,mgpc.is_give_music_network_
+        SELECT mgpc.batch_no_,MAX(mgpc.music_group_id_) music_group_id_
+        ,MAX(mgpc.create_time_) create_time_,MAX(mgpc.payment_type_) payment_type_,
+        MAX(mgpc.pay_user_type_) pay_user_type_,MAX(mg.name_) music_group_name_,MAX(mgpc.payment_pattern_)payment_pattern_,MAX(o.name_) organ_name_
         FROM music_group_payment_calender mgpc
         LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
-        LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
-        WHERE mgpc.id_ = #{calenderId} LIMIT 1
+        LEFT JOIN organization o ON o.id_ = mg.organ_id_
+        WHERE mgpc.batch_no_ = #{batchNo}
+        GROUP BY mgpc.batch_no_
     </select>
     <select id="findByMusicGroupRegCalender" resultMap="MusicGroupPaymentCalender">
         SELECT * FROM music_group_payment_calender WHERE music_group_id_=#{musicGroupId} AND payment_type_='MUSIC_APPLY'

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -130,8 +130,8 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @ApiOperation(value = "乐团缴费日历审核列表详情")
     @GetMapping("/auditListDetail")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditListDetail')")
-    public Object auditListDetail(Long calenderId) {
-        return succeed(musicGroupPaymentCalenderService.auditListDetail(calenderId));
+    public Object auditListDetail(String batchNo) {
+        return succeed(musicGroupPaymentCalenderService.auditListDetail(batchNo));
     }
 
     @ApiOperation(value = "乐团缴费日历审核通过")