yonge 4 år sedan
förälder
incheckning
6f5736fc6d

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

@@ -1,12 +1,17 @@
 package com.ym.mec.biz.dal.dao;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
-import com.ym.mec.biz.dal.dto.CalenderPushDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import org.apache.ibatis.annotations.Param;
 
+import com.ym.mec.biz.dal.dto.CalenderPushDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.common.dal.BaseDAO;
 
@@ -83,6 +88,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
 
     /**
      * @param musicGroupId:
+     * @param payUserType:
      * @param paymentValidStartDate:
      * @param paymentValidEndDate:
      * @return int
@@ -92,7 +98,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @date 2020/9/21
      * @time 10:46
      */
-    int queryIntersectionByValidDate(@Param("musicGroupId") String musicGroupId,
+    int queryIntersectionByValidDate(@Param("musicGroupId") String musicGroupId,@Param("payUserType") PayUserType payUserType,
                                      @Param("paymentValidStartDate") Date paymentValidStartDate,
                                      @Param("paymentValidEndDate") Date paymentValidEndDate,
                                      @Param("calenderId") Long calenderId);

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

@@ -118,7 +118,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
-		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPaymentValidStartDate(),
+		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
 				musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 		if (count > 0) {
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
@@ -259,7 +259,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
-		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPaymentValidStartDate(),
+		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
 				musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 		if (count > 0) {
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
@@ -653,7 +653,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (count > 0) {
 			throw new BizException("缴费时间存在冲突,请修改缴费开始日期");
 		}
-		count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(calender.getMusicGroupId(), paymentCalender.getPaymentValidStartDate(),
+		count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(calender.getMusicGroupId(), paymentCalender.getPayUserType(), paymentCalender.getPaymentValidStartDate(),
 				paymentCalender.getPaymentValidEndDate(), paymentCalender.getId());
 		if (count > 0) {
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");

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

@@ -277,6 +277,9 @@
         WHERE music_group_id_ = #{musicGroupId}
         AND (payment_valid_end_date_ IS NULL OR payment_valid_start_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}
         OR payment_valid_end_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}) AND payment_valid_start_date_ IS NOT NULL
+        <if test="payUserType != null">
+        	and pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        </if>
         <if test="calenderId != null">
             AND mgpc.id_ != #{calenderId}
         </if>