时间交换
params.startDate = params.startDate?:(truncateDay(new Date()-7).format('yyyy-MM-dd')) params.endDate = params.endDate?:((new Date()).format('yyyy-MM-dd')) def startDate = Date.parse('yyyy-MM-dd', params.startDate) def endDate=Date.parse('yyyy-MM-dd', params.endDate) if(endDate < startDate){ def temp= startDate; startDate = endDate; endDate = startDate; } if(endDate == startDate){ startDate = new Date()-1 } params.startDate = (startDate).format('yyyy-MM-dd') params.endDate = (endDate).format('yyyy-MM-dd')