zouxuan 5 年 前
コミット
dd2aa8ef3c

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

@@ -69,7 +69,7 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	List<MusicGroupPaymentCalenderDetail> queryCanOpenList(@Param("ids") String ids);
 
 	/**
-	 * 当前用户所在乐团
+	 * 当前用户是否有进行中的订单
 	 * @param musicGroupId
 	 * @param userId
 	 * @return

+ 10 - 3
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.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
@@ -32,6 +33,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	@Autowired
 	private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
 	@Autowired
+	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+	@Autowired
 	private MusicGroupDao musicGroupDao;
 	@Autowired
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
@@ -78,15 +81,19 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			return;
 		}
 		Date date = new Date();
-		/*Iterator<MusicGroupPaymentCalenderDetail> iterator = calenderDetails.iterator();
+		Iterator<MusicGroupPaymentCalenderDetail> iterator = calenderDetails.iterator();
 		MusicGroupPaymentCalenderDetail next;
 		while(iterator.hasNext()){
 			next = iterator.next();
+			int count1 = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),date,date);
 			int count = musicGroupPaymentCalenderDetailDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),next.getUserId());
-			if(count > 0){
+			if(count > 0 || count1 > 0){
 				iterator.remove();
 			}
-		}*/
+		}
+		if(calenderDetails.size() == 0){
+			return;
+		}
 		String musicGroupId = calenderDetails.get(0).getMusicGroupId();
 		calenderDetails.forEach(e->{
 			e.setUpdateTime(date);

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

@@ -239,7 +239,6 @@
 		SELECT COUNT(mgpcd.id_) FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
 		WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpcd.user_id_ = #{userId}
-		AND (mgpcd.start_payment_date_ BETWEEN NOW() AND NOW()
-		OR mgpcd.deadline_payment_date_ BETWEEN NOW() AND NOW())
+		AND  mgpcd.open_ = 1
 	</select>
 </mapper>