|  | @@ -14,6 +14,7 @@ import com.ym.mec.common.exception.BizException;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.page.PageInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.service.impl.BaseServiceImpl;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  | +import com.ym.mec.util.date.DateUtil;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
	
		
			
				|  | @@ -41,6 +42,8 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
 | 
	
		
			
				|  |  |      private ChildrenDayDegreeDetailService childrenDayDegreeDetailService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private StudentPaymentOrderService studentPaymentOrderService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private SysConfigDao sysConfigDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public BaseDAO<Integer, ChildrenDayReserve> getDAO() {
 | 
	
	
		
			
				|  | @@ -49,9 +52,21 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public ChildrenDayReserve addReserve(SysUser user) {
 | 
	
		
			
				|  |  | +        Date nowTime = new Date();
 | 
	
		
			
				|  |  | +        String startTimeStr = sysConfigDao.findConfigValue("children_day_start_time");
 | 
	
		
			
				|  |  | +        Date startTime = DateUtil.stringToDate(startTimeStr);
 | 
	
		
			
				|  |  | +        if (startTime.compareTo(nowTime) > 0) {
 | 
	
		
			
				|  |  | +            throw new BizException("活动还未开始,谢谢关注");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        String endTimeStr = sysConfigDao.findConfigValue("children_day_end_time");
 | 
	
		
			
				|  |  | +        Date endTime = DateUtil.stringToDate(endTimeStr);
 | 
	
		
			
				|  |  | +        if (endTime.compareTo(nowTime) <= 0) {
 | 
	
		
			
				|  |  | +            throw new BizException("活动已结束,谢谢关注");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          ChildrenDayReserve hasOne = childrenDayReserveDao.getByUserId(user.getId());
 | 
	
		
			
				|  |  |          if (hasOne != null) {
 | 
	
		
			
				|  |  | -            throw new BizException("您已成功占位");
 | 
	
		
			
				|  |  | +            throw new BizException("您已预报名");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          MusicGroup studentLastMusicGroup = musicGroupDao.getStudentLastMusicGroup(user.getId());
 | 
	
		
			
				|  |  |          ChildrenDayReserve childrenDayReserve = new ChildrenDayReserve();
 |