|  |  | @ -42,6 +42,9 @@ import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.web.bind.annotation.*; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import javax.servlet.http.HttpServletResponse; | 
			
		
	
		
			
				
					|  |  |  | import java.text.ParseException; | 
			
		
	
		
			
				
					|  |  |  | import java.text.SimpleDateFormat; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Date; | 
			
		
	
		
			
				
					|  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  | import java.util.regex.Pattern; | 
			
		
	
	
		
			
				
					|  |  | @ -145,9 +148,18 @@ public class UserAdviceController { | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("advicelist") | 
			
		
	
		
			
				
					|  |  |  |     public Result<PageData<AdviceListResultDTO>> adviceList(@RequestBody AdviceListFormDTO dto) { | 
			
		
	
		
			
				
					|  |  |  |         ValidatorUtils.validateEntity(dto); | 
			
		
	
		
			
				
					|  |  |  |         if (dto.getStartTime() != null && dto.getEndTime() != null) { | 
			
		
	
		
			
				
					|  |  |  |             if (dto.getStartTime().after(dto.getEndTime())) { | 
			
		
	
		
			
				
					|  |  |  |                 throw new RenException("开始时间不能大于结束时间"); | 
			
		
	
		
			
				
					|  |  |  |         //校验时间
 | 
			
		
	
		
			
				
					|  |  |  |         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         if (StringUtils.isNotBlank(dto.getStartTime()) && StringUtils.isNotBlank(dto.getEndTime())){ | 
			
		
	
		
			
				
					|  |  |  |             try { | 
			
		
	
		
			
				
					|  |  |  |                 Date start = sdf.parse(dto.getStartTime()); | 
			
		
	
		
			
				
					|  |  |  |                 Date end = sdf.parse(dto.getEndTime()); | 
			
		
	
		
			
				
					|  |  |  |                 if (start.after(end)){ | 
			
		
	
		
			
				
					|  |  |  |                     throw new RenException("开始时间不能大于结束时间"); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             }catch (ParseException e){ | 
			
		
	
		
			
				
					|  |  |  |                 throw new RenException("日期转换失败"); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         PageData<AdviceListResultDTO> page = userAdviceService.adviceList(dto); | 
			
		
	
	
		
			
				
					|  |  | 
 |