通用作业 检验时间

This commit is contained in:
闫阳 2023-06-25 15:28:23 +08:00
parent 445c7c0c3f
commit 3a583ac09f

View File

@ -39,10 +39,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -79,6 +77,12 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetM
String batchNumber = (String) params.get("batchNumber");
QueryWrapper<InspectionSheet> wrapper = new QueryWrapper<>();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
if(params.get("startTime")!=null && params.get("endTime")!=null){
LocalDateTime startTime = LocalDate.parse(params.get("startTime").toString(),df).atStartOfDay();
LocalDateTime endTime = LocalDate.parse(params.get("endTime").toString(),df).atStartOfDay();
wrapper.between(startTime!=null && endTime!=null,"create_time", startTime, endTime);
}
wrapper.like(ObjectUtils.isNotNull(id), "id", id);
wrapper.like(StringUtils.isNotBlank(inspectionSite), "inspection_stage", inspectionSite);
wrapper.like(StringUtils.isNotBlank(orderNumber), "order_number", orderNumber);