Commit b39daaac by 刘鑫

fix(工程师动态): 【ID1003746】 博西PEA_V1.0-工作台-工单详情:查看工程师动态弹窗页面报“服务器错误,请联系管理员”

日期查询参数类型与数据库类型不匹配, 造成非法参数错误
1 parent 47ca8aea
......@@ -2,9 +2,16 @@ package com.dituhui.pea.order.service.impl;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dao.EngineerInfoDao;
import com.dituhui.pea.order.dao.OrderInfoDao;
import com.dituhui.pea.order.dao.OrgGroupDao;
import com.dituhui.pea.order.dao.OrgWarehouseInfoDao;
import com.dituhui.pea.order.dto.EngineerTimelineResp;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.entity.EngineerInfoEntity;
import com.dituhui.pea.order.entity.OrderEventEntity;
import com.dituhui.pea.order.entity.OrderInfoEntity;
import com.dituhui.pea.order.entity.OrgGroupEntity;
import com.dituhui.pea.order.entity.OrgWarehouseInfoEntity;
import com.dituhui.pea.order.service.EngineerTimelineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -17,7 +24,15 @@ import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.time.LocalDate;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
......@@ -87,8 +102,9 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
List<Predicate> predicates = new ArrayList<>();
predicates.add(root.get("orderId").in(orderIds));
predicates.add(criteriaBuilder.greaterThanOrEqualTo(root.get("happen"), date + " 00:00:00"));
predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("happen"), date + " 23:59:59"));
LocalDate paramLocalDate = LocalDate.parse(date);
predicates.add(criteriaBuilder.greaterThanOrEqualTo(root.get("happen"), LocalDateTime.of(paramLocalDate, LocalTime.MIN)));
predicates.add(criteriaBuilder.lessThanOrEqualTo(root.get("happen"), LocalDateTime.of(paramLocalDate, LocalTime.MAX)));
predicates.add(root.get("event").in(events));
criteriaQuery.where(predicates.toArray(new Predicate[0]));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!