zouxuan hace 4 años
padre
commit
94bc760671

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

@@ -1,10 +1,8 @@
 package com.ym.mec.biz.dal.dao;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
+import com.ym.mec.biz.dal.dto.CalenderPushDto;
 import org.apache.ibatis.annotations.Param;
 
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
@@ -108,4 +106,21 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @return int
      */
     int queryIntersectionByValidDate(@Param("musicGroupId") String musicGroupId, @Param("paymentValidStartDate") String paymentValidStartDate, @Param("paymentValidEndDate") String paymentValidEndDate);
+
+    /**
+     * @describe 获取指定时间后的缴费信息
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/9/21
+     * @time 17:35
+     * @param configValue:
+     * @return void
+     */
+    List<Map<Long, Long>> queryCalenderByDay(String configValue);
+
+    List<MusicGroupPaymentCalender> queryByIds(@Param("calenderId") Set<Long> calenderId);
+
+    List<Long> queryEndIds(@Param("configValue1") String configValue1, @Param("format") String format);
+
+    List<CalenderPushDto> getCalenderPushDto(@Param("calenderIds") Collection<Long> calenderIds);
 }

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

@@ -209,4 +209,15 @@ public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudent
 	 * @param paymentStatus
 	 */
 	void updatePaymentStatus(@Param("calenderId") Long calenderId, @Param("paymentStatus") String paymentStatus);
+
+	/**
+	 * @describe 将缴费截止的缴费状态更改为未缴费
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/9/21
+	 * @time 14:34
+	 * @param format:
+	 * @return void
+	 */
+    void updateFeeStatus(@Param("format") String format);
 }

+ 64 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CalenderPushDto.java

@@ -0,0 +1,64 @@
+package com.ym.mec.biz.dal.dto;
+
+public class CalenderPushDto{
+
+    private Long calenderId;
+
+    private Integer teacherId;
+
+    private String teacherPhone;
+
+    private String musicGroupName;
+
+    private String paymentValidStartDate;
+
+    private String paymentValidEndDate;
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Long getCalenderId() {
+        return calenderId;
+    }
+
+    public void setCalenderId(Long calenderId) {
+        this.calenderId = calenderId;
+    }
+
+    public String getTeacherPhone() {
+        return teacherPhone;
+    }
+
+    public void setTeacherPhone(String teacherPhone) {
+        this.teacherPhone = teacherPhone;
+    }
+
+    public String getMusicGroupName() {
+        return musicGroupName;
+    }
+
+    public void setMusicGroupName(String musicGroupName) {
+        this.musicGroupName = musicGroupName;
+    }
+
+    public String getPaymentValidStartDate() {
+        return paymentValidStartDate;
+    }
+
+    public void setPaymentValidStartDate(String paymentValidStartDate) {
+        this.paymentValidStartDate = paymentValidStartDate;
+    }
+
+    public String getPaymentValidEndDate() {
+        return paymentValidEndDate;
+    }
+
+    public void setPaymentValidEndDate(String paymentValidEndDate) {
+        this.paymentValidEndDate = paymentValidEndDate;
+    }
+}

+ 33 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroup.java

@@ -86,6 +86,15 @@ public class MusicGroup {
 	/** 缴费截止日期 */
 	@ApiModelProperty(value = "乐团缴费截止日期",required = false)
 	private java.util.Date paymentExpireDate;
+
+	@ApiModelProperty(value = "缴费有效期开始时间", required = false)
+	private String paymentValidStartDate;
+
+	@ApiModelProperty(value = "缴费有效期结束时间", required = false)
+	private String paymentValidEndDate;
+
+	@ApiModelProperty(value = "缴费方式0按月,1按季,2一次性", required = false)
+	private Integer paymentPattern;
 	
 	/** 计费开始日期 */
 	@ApiModelProperty(value = "乐团计费开始日期 ",required = false)
@@ -156,6 +165,30 @@ public class MusicGroup {
 
 	private Boolean hasVerifyMusicalList = false;
 
+	public Integer getPaymentPattern() {
+		return paymentPattern;
+	}
+
+	public void setPaymentPattern(Integer paymentPattern) {
+		this.paymentPattern = paymentPattern;
+	}
+
+	public String getPaymentValidStartDate() {
+		return paymentValidStartDate;
+	}
+
+	public void setPaymentValidStartDate(String paymentValidStartDate) {
+		this.paymentValidStartDate = paymentValidStartDate;
+	}
+
+	public String getPaymentValidEndDate() {
+		return paymentValidEndDate;
+	}
+
+	public void setPaymentValidEndDate(String paymentValidEndDate) {
+		this.paymentValidEndDate = paymentValidEndDate;
+	}
+
 	public String getSubjectName() {
 		return subjectName;
 	}

+ 22 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java

@@ -43,31 +43,32 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 		}
 	}
 
-	/**  */
 	private Long id;
 
-	/**  */
 	@ApiModelProperty(value = "乐团编号", required = false)
 	private String musicGroupId;
 
-	/** 缴费月份 */
 	@ApiModelProperty(value = "缴费月份", required = false)
 	private Integer paymentMonth;
 
-	/** 开始缴费日期 */
 	@ApiModelProperty(value = "开始缴费日期", required = false)
 	private java.util.Date startPaymentDate;
 
 	@ApiModelProperty(value = "截止缴费日期", required = false)
 	private Date deadlinePaymentDate;
 
-	/** 开始缴费日期 */
 	@ApiModelProperty(value = "缴费有效期开始时间", required = false)
 	private String paymentValidStartDate;
 
 	@ApiModelProperty(value = "缴费有效期截止时间", required = false)
 	private String paymentValidEndDate;
 
+	@ApiModelProperty(value = "缴费方式0按月,1按季,2一次性", required = false)
+	private Integer paymentPattern;
+
+	@ApiModelProperty(value = "缴费类型0续费,1报名", required = false)
+	private Integer paymentType;
+
 	private PaymentStatusEnum paymentStatus;
 
 	private Integer expectNum;
@@ -78,14 +79,28 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 
 	private FeeType type;
 
-	/**  */
 	private java.util.Date createTime;
 
-	/**  */
 	private java.util.Date updateTime;
 
 	private String studentIds;
 
+	public Integer getPaymentType() {
+		return paymentType;
+	}
+
+	public void setPaymentType(Integer paymentType) {
+		this.paymentType = paymentType;
+	}
+
+	public Integer getPaymentPattern() {
+		return paymentPattern;
+	}
+
+	public void setPaymentPattern(Integer paymentPattern) {
+		this.paymentPattern = paymentPattern;
+	}
+
 	public String getPaymentValidStartDate() {
 		return paymentValidStartDate;
 	}

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

@@ -58,9 +58,6 @@ public class MusicGroupStudentFee {
 	@ApiModelProperty(value = "最近缴费时间", required = false)
 	private Date latestPaidTime;
 
-	@ApiModelProperty(value = "缴费有效期开始时间", required = false)
-	private String paymentValidStartDate;
-
 	@ApiModelProperty(value = "缴费有效期结束时间", required = false)
 	private String paymentValidEndDate;
 
@@ -104,14 +101,6 @@ public class MusicGroupStudentFee {
 	public MusicGroupStudentFee() {
 	}
 
-	public String getPaymentValidStartDate() {
-		return paymentValidStartDate;
-	}
-
-	public void setPaymentValidStartDate(String paymentValidStartDate) {
-		this.paymentValidStartDate = paymentValidStartDate;
-	}
-
 	public String getPaymentValidEndDate() {
 		return paymentValidEndDate;
 	}

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

@@ -82,9 +82,6 @@ public class StudentRegistration {
     @ApiModelProperty(value = "缴费状态(1-已缴费 0-未交费)", required = false)
     private PaymentStatusEnum paymentStatus;
 
-    @ApiModelProperty(value = "缴费有效期截止时间", required = false)
-    private String paymentValidEndDate;
-
     @ApiModelProperty(value = "用户所在乐团状态)",required = false)
     private StudentMusicGroupStatusEnum musicGroupStatus;
 
@@ -114,14 +111,6 @@ public class StudentRegistration {
     //乐团
     private OwnershipType ownershipType;
 
-    public String getPaymentValidEndDate() {
-        return paymentValidEndDate;
-    }
-
-    public void setPaymentValidEndDate(String paymentValidEndDate) {
-        this.paymentValidEndDate = paymentValidEndDate;
-    }
-
     public BigDecimal getBalance() {
         return balance;
     }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -154,6 +154,8 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     SMS_REPAIR_ONLINE_PAYMENT_SUCCESS("SMS_REPAIR_ONLINE_PAYMENT_SUCCESS","乐器线上维修支付成功"),
     SMS_REPAIR_OFFLINE_PAYMENT_SUCCESS("SMS_REPAIR_OFFLINE_PAYMENT_SUCCESS","乐器线下维修支付成功"),
     SMS_REPAIR_UNSEND_COMPLETED("SMS_REPAIR_UNSEND_COMPLETED","乐器维修完成自取"),
+    SMS_PAYMENT_DETAIL("SMS_PAYMENT_DETAIL","缴费项目缴费详情提醒"),
+    SMS_PAYMENT_CREATE("SMS_PAYMENT_CREATE","缴费项目创建提醒"),
     SMS_REPAIR_SEND_COMPLETED("SMS_REPAIR_SEND_COMPLETED","乐器维修完成邮寄");
 
 

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

@@ -73,4 +73,15 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @return
 	 */
 	void paymentPush(Long id, String userIds);
+
+	/**
+	 * @describe 更新乐团学员缴费状态
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/9/21
+	 * @time 13:56
+	 * @param :
+	 * @return void
+	 */
+	void autoUpdateMusicGroupStudentFeeStatus();
 }

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

@@ -58,7 +58,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 		List<FinancialExpenditure> financialExpenditures = new ArrayList<>();
 		Map<String, Integer> organMap = getMap("organization", "name_", "id_", true, String.class, Integer.class);
 		Map<String, Integer> cooperationOrganMap = getMap("cooperation_organ", "name_", "id_", true, String.class, Integer.class);
-		Map<String, Integer> phoneMap = getMap("sys_user", "phone_", "id_", true, String.class, Integer.class);
+//		Map<String, Integer> phoneMap = getMap("sys_user", "phone_", "id_", true, String.class, Integer.class);
 		for (String e : sheetsListMap.keySet()) {
 			List<Map<String, Object>> sheet = sheetsListMap.get(e);
 			List<Object> collect = sheet.stream().map(m -> m.get("钉钉流程编号")).collect(Collectors.toList());

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

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.CalenderPushDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
@@ -47,6 +49,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private SysConfigDao sysConfigDao;
 	@Autowired
 	private SysMessageService sysMessageService;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
 	@Override
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
@@ -154,6 +158,45 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	}
 
 	@Override
+	public void autoUpdateMusicGroupStudentFeeStatus() {
+		Date date = new Date();
+		String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
+		//将有效期已截止的学员缴费信息修改为未缴费
+		musicGroupStudentFeeDao.updateFeeStatus(format);
+		//获取距离缴费开启指定天数后的缴费明细
+		String configValue = sysConfigDao.findConfigValue("push_payment_detail");
+		Map<Long, Long> maps = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryCalenderByDay(configValue));
+		if(maps != null && maps.size() > 0){
+			Set<Long> calenderId = maps.keySet();
+			List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getCalenderPushDto(calenderId);
+			Map<Long, List<CalenderPushDto>> collect = calenderPushDtos.stream().collect(Collectors.groupingBy(CalenderPushDto::getCalenderId));
+			calenderId.forEach(e->{
+				CalenderPushDto calenderPushDto = collect.get(e).get(0);
+				Map<Integer, String> receivers = new HashMap<>(1);
+				receivers.put(calenderPushDto.getTeacherId(),calenderPushDto.getTeacherPhone());
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_PAYMENT_DETAIL,
+						receivers, null, 0, null, null,calenderPushDto.getMusicGroupName(),
+						calenderPushDto.getPaymentValidStartDate(),calenderPushDto.getPaymentValidEndDate(),maps.get(e));
+			});
+		}
+		//获取离截止还有指定时间的缴费项,并发送推送消息给指定老师
+		String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
+		List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1,format);
+		if(calenderIds != null && calenderIds.size() > 0){
+			List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getCalenderPushDto(calenderIds);
+			Map<Long, List<CalenderPushDto>> collect = calenderPushDtos.stream().collect(Collectors.groupingBy(CalenderPushDto::getCalenderId));
+			calenderIds.forEach(e->{
+				CalenderPushDto calenderPushDto = collect.get(e).get(0);
+				Map<Integer, String> receivers = new HashMap<>(1);
+				receivers.put(calenderPushDto.getTeacherId(),calenderPushDto.getTeacherPhone());
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_PAYMENT_CREATE,
+						receivers, null, 0, null, null,calenderPushDto.getMusicGroupName(),
+						calenderPushDto.getPaymentValidStartDate(),calenderPushDto.getPaymentValidEndDate());
+			});
+		}
+	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public boolean autoUpdateMusicGroupPaymentCalenderStatus() {
 		// 获取当天创建且未缴费的数据,并推送

+ 14 - 2
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -36,6 +36,9 @@
                 typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="fee_type_" property="feeType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="del_flag_" property="delFlag"/>
+        <result column="payment_valid_start_date_" property="paymentValidStartDate"/>
+        <result column="payment_valid_end_date_" property="paymentValidEndDate"/>
+        <result column="payment_pattern_" property="paymentPattern"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -68,7 +71,7 @@
          bill_start_date_, improvent_classes_num_, enroll_classes_, payment_expire_date_, is_extra_class_,
          settlement_type_, cooperation_organ_id_, enlightenment_course_time_,
          parent_meeting_time_, img_, director_user_id_, is_classroom_lessons_, memo_, expect_start_group_date_,
-         ownership_type_, repair_user_id_, fee_type_, del_flag_)
+         ownership_type_, repair_user_id_, fee_type_, del_flag_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_)
         VALUES (#{id}, #{name}, #{organId}, #{schoolId}, #{applyExpireDate}, #{teamTeacherId}, #{educationalTeacherId},
                 #{chargeTypeId}, #{courseForm}, now(), now(),
                 #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{billStartDate},
@@ -78,13 +81,22 @@
                 #{cooperationOrganId}, #{enlightenmentCourseTime}, #{parentMeetingTime}, #{img}, #{directorUserId},
                 #{isClassroomLessons}, #{memo}, #{expectStartGroupDate},
                 #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{repairUserId},
-                #{feeType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{delFlag})
+                #{feeType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{delFlag},#{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroup">
         UPDATE music_group
         <set>
+            <if test="paymentPattern != null">
+                payment_pattern_ = #{paymentPattern},
+            </if>
+            <if test="paymentValidStartDate != null">
+                payment_valid_start_date_ = #{paymentValidStartDate},
+            </if>
+            <if test="paymentValidEndDate != null">
+                payment_valid_end_date_ = #{paymentValidEndDate},
+            </if>
             <if test="ownershipType != null">
                 ownership_type_ = #{ownershipType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>

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

@@ -19,6 +19,10 @@
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
+        <result column="payment_valid_start_date_" property="paymentValidStartDate"/>
+        <result column="payment_valid_end_date_" property="paymentValidEndDate"/>
+        <result column="payment_pattern_" property="paymentPattern"/>
+        <result column="payment_type_" property="paymentType"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -35,9 +39,11 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO music_group_payment_calender
-        (music_group_id_,payment_month_,start_payment_date_,deadline_payment_date_,payment_status_,expect_num_,actual_num_,memo_,type_,create_time_,update_time_)
+        (music_group_id_,payment_month_,start_payment_date_,deadline_payment_date_,payment_status_,expect_num_,
+        actual_num_,memo_,type_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_type_)
         VALUES(#{musicGroupId},#{paymentMonth},#{startPaymentDate},#{deadlinePaymentDate},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{expectNum},#{actualNum},#{memo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now())
+        #{expectNum},#{actualNum},#{memo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),
+        #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType})
     </insert>
     <insert id="batchAdd">
         INSERT INTO music_group_payment_calender
@@ -52,6 +58,18 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
         UPDATE music_group_payment_calender
         <set>
+            <if test="paymentType != null">
+                payment_type_ = #{paymentType},
+            </if>
+            <if test="paymentValidStartDate != null">
+                payment_valid_start_date_ = #{paymentValidStartDate},
+            </if>
+            <if test="paymentValidEndDate != null">
+                payment_valid_end_date_ = #{paymentValidEndDate},
+            </if>
+            <if test="paymentPattern != null">
+                payment_pattern_ = #{paymentPattern},
+            </if>
             <if test="type != null">
                 type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
@@ -90,6 +108,9 @@
 	    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
 	        UPDATE music_group_payment_calender
 	        <set>
+                <if test="paymentPattern != null">
+                    payment_pattern_ = #{paymentPattern},
+                </if>
 	            <if test="item.type != null">
 	                type_ = #{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 	            </if>
@@ -210,4 +231,41 @@
         AND (payment_valid_start_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}
         OR payment_valid_end_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate})
     </select>
+    <select id="queryCalenderByDay" resultType="java.util.Map">
+        SELECT mgpcd.music_group_payment_calender_id_ 'key',COUNT(mgpcd.payment_status_) 'value'
+        FROM music_group_payment_calender_detail mgpcd
+        WHERE mgpcd.music_group_payment_calender_id_ IN
+        (SELECT id_ FROM music_group_payment_calender WHERE payment_status_ != 0 AND DATEDIFF('',DATE_FORMAT(start_payment_date_,'%Y-%m-%d')) = #{configValue})
+        AND mgpcd.payment_status_ = 'NON_PAYMENT'
+        GROUP BY mgpcd.music_group_payment_calender_id_
+    </select>
+    <select id="queryByIds" resultMap="MusicGroupPaymentCalender">
+        SELECT * FROM music_group_payment_calender WHERE id_ IN
+        <foreach collection="calenderId" open="(" close=")" item="item" separator=",">
+            #{item}
+        </foreach>
+    </select>
+    <select id="queryEndIds" resultType="java.lang.Long">
+        SELECT DISTINCT mgpc.id_ FROM music_group_payment_calender mgpc
+        WHERE mgpc.payment_status_ = 2 AND DATEDIFF(#{format},DATE_FORMAT(mgpc.payment_valid_end_date_,'%Y-%m-%d')) = #{configValue1};
+    </select>
+    <resultMap id="CalenderPushDto" type="com.ym.mec.biz.dal.dto.CalenderPushDto">
+        <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
+        <result property="paymentValidStartDate" column="payment_valid_start_date_"/>
+        <result property="teacherId" column="educational_teacher_id_"/>
+        <result property="musicGroupName" column="name_"/>
+        <result property="teacherPhone" column="phone_"/>
+        <result property="calenderId" column="id_"/>
+    </resultMap>
+    <select id="getCalenderPushDto" resultMap="CalenderPushDto">
+        SELECT mgpc.id_,mgpc.payment_valid_start_date_,mgpc.payment_valid_end_date_,
+        mg.educational_teacher_id_,su.real_name_,mg.name_,su.phone_
+        FROM music_group_payment_calender mgpc
+        LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
+        LEFT JOIN sys_user su ON su.id_ = mg.educational_teacher_id_
+        WHERE mgpc.id_ IN
+        <foreach collection="calenderIds" open="(" close=")" separator="," item="item">
+            #{item}
+        </foreach>
+    </select>
 </mapper>

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

@@ -15,7 +15,6 @@
         <result column="course_fee_" property="courseFee"/>
         <result column="next_payment_date_" property="nextPaymentDate"/>
         <result column="latest_paid_time_" property="latestPaidTime"/>
-        <result column="payment_valid_start_date_" property="paymentValidStartDate"/>
         <result column="payment_valid_end_date_" property="paymentValidEndDate"/>
         <result column="continuous_absenteeism_times_" property="continuousAbsenteeismTimes"/>
         <result column="create_time_" property="createTime"/>
@@ -46,19 +45,19 @@
             keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_student_fee_ (id_,music_group_id_,user_id_,course_fee_,create_time_,
 		update_time_,next_payment_date_,latest_paid_time_,continuous_absenteeism_times_,subject_id_,
-		payment_status_,temporary_course_fee_,payment_period_list_,remain_network_class_times_,payment_valid_start_date_,payment_valid_end_date_)
+		payment_status_,temporary_course_fee_,payment_period_list_,remain_network_class_times_,payment_valid_end_date_)
 		VALUES(#{id},#{musicGroupId},#{userId},#{courseFee},now(),now(),#{nextPaymentDate},#{latestPaidTime},
 		#{continuousAbsenteeismTimes},#{subjectId},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		#{temporaryCourseFee},#{paymentPeriodList},#{remainNetworkClassTimes},#{paymentValidStartDate},#{paymentValidEndDate})
+		#{temporaryCourseFee},#{paymentPeriodList},#{remainNetworkClassTimes},#{paymentValidEndDate})
 	</insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentFee">
         INSERT INTO music_group_student_fee_ (music_group_id_,user_id_,create_time_,update_time_,next_payment_date_,
-        subject_id_,payment_status_,course_fee_,payment_period_list_,remain_network_class_times_,payment_valid_start_date_,payment_valid_end_date_)
+        subject_id_,payment_status_,course_fee_,payment_period_list_,remain_network_class_times_,payment_valid_end_date_)
 		VALUES
 		<foreach collection="musicGroupStudentFees" item="item" separator=",">
             (#{item.musicGroupId},#{item.userId},NOW(),NOW(),#{nextPaymentDate},#{item.subjectId},
-            #{paymentStatus},#{item.courseFee},#{item.paymentPeriodList},#{item.remainNetworkClassTimes},#{paymentValidStartDate},#{paymentValidEndDate})
+            #{paymentStatus},#{item.courseFee},#{item.paymentPeriodList},#{item.remainNetworkClassTimes},#{item.paymentValidEndDate})
         </foreach>
     </insert>
 
@@ -66,9 +65,6 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentFee">
         UPDATE music_group_student_fee_
         <set>
-            <if test="paymentValidStartDate != null">
-                payment_valid_start_date_ = #{paymentValidStartDate},
-            </if>
             <if test="paymentValidEndDate != null">
                 payment_valid_end_date_ = #{paymentValidEndDate},
             </if>

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

@@ -26,7 +26,6 @@
         <result column="parents_phone_" property="parentsPhone"/>
         <result column="parents_company_" property="parentsCompany"/>
         <result column="payment_status_" property="paymentStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <result column="payment_valid_end_date_" property="paymentValidEndDate"/>
         <result column="music_group_status_" property="musicGroupStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="class_group_name_" property="classGroupName"/>
         <result column="temporary_course_fee_" property="temporaryCourseFee" />
@@ -104,7 +103,6 @@
             <if test="parentsPhone!=null">parents_phone_,</if>
             <if test="parentsCompany!=null">parents_company_,</if>
             <if test="paymentStatus!=null">payment_status_,</if>
-            <if test="paymentValidEndDate != null and paymentValidEndDate != ''">payment_valid_end_date_,</if>
             <if test="classGroupId!=null">class_group_id_,</if>
             <if test="musicGroupStatus!=null">music_group_status_,</if>
             <if test="temporaryCourseFee != null">temporary_course_fee_,</if>
@@ -132,7 +130,6 @@
             <if test="parentsCompany!=null">#{parentsCompany},</if>
             <if test="paymentStatus!=null">#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
-            <if test="paymentValidEndDate != null and paymentValidEndDate != ''">#{paymentStatus},</if>
             <if test="classGroupId!=null">#{classGroupId},</if>
             <if test="musicGroupStatus!=null">
                 #{musicGroupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
@@ -147,9 +144,6 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
         UPDATE student_registration
         <set>
-            <if test="paymentValidEndDate != null and paymentValidEndDate != ''">
-                payment_valid_end_date_ = #{paymentValidEndDate},
-            </if>
             <if test="parentsPhone != null">
                 parents_phone_ = #{parentsPhone},
             </if>

+ 6 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -248,6 +248,12 @@ public class TaskController extends BaseController {
 		musicGroupPaymentCalenderService.autoUpdateMusicGroupPaymentCalenderStatus();
 	}
 
+	// 更新乐团学员缴费状态
+	@GetMapping("/updateMusicGroupStudentFeeStatus")
+	public void updateMusicGroupStudentFeeStatus() {
+		musicGroupPaymentCalenderService.autoUpdateMusicGroupStudentFeeStatus();
+	}
+
 	// 推送教师异常考勤
 	@GetMapping("/pushTeacherExceptionAttendanceTask")
 	public void pushTeacherExceptionAttendanceTask() {