Commit 3d25f8e6 by 丁伟峰

for test

1 parent d1ae14cb
...@@ -8,17 +8,18 @@ import org.springframework.data.jpa.repository.Query; ...@@ -8,17 +8,18 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Date;
@Repository @Repository
public interface OrderEventDao extends JpaRepository<OrderEventEntity, Integer> { public interface OrderEventDao extends JpaRepository<OrderEventEntity, Integer> {
@Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgClusterId = :clusterId and DATE(a.createTime) = :date") @Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgClusterId = :clusterId and DATE(a.createTime) = :date")
Page<OrderEventEntity> findAllByClusterId(String clusterId, LocalDate date, Pageable pageable); Page<OrderEventEntity> findAllByClusterId(String clusterId, Date date, Pageable pageable);
@Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgBranchId = :branchId and DATE(a.createTime) = :date") @Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgBranchId = :branchId and DATE(a.createTime) = :date")
Page<OrderEventEntity> findAllByBranchId(String branchId, LocalDate date, Pageable pageable); Page<OrderEventEntity> findAllByBranchId(String branchId, Date date, Pageable pageable);
@Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgGroupId = :groupId and DATE(a.createTime) = :date") @Query("select a from OrderEventEntity a join OrderRequestEntity b on a.orderId=b.orderId where b.orgGroupId = :groupId and DATE(a.createTime) = :date")
Page<OrderEventEntity> findAllByGroupId(String groupId, LocalDate date, Pageable pageable); Page<OrderEventEntity> findAllByGroupId(String groupId, Date date, Pageable pageable);
} }
package com.dituhui.pea.order.service.impl; package com.dituhui.pea.order.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.dao.*; import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.OrderChangeListDTO; import com.dituhui.pea.order.dto.OrderChangeListDTO;
import com.dituhui.pea.order.dto.WorkbenchSummaryResp; import com.dituhui.pea.order.dto.WorkbenchSummaryResp;
...@@ -11,6 +11,7 @@ import com.dituhui.pea.order.entity.OrderRequest; ...@@ -11,6 +11,7 @@ import com.dituhui.pea.order.entity.OrderRequest;
import com.dituhui.pea.order.entity.OrderRequestEntity; import com.dituhui.pea.order.entity.OrderRequestEntity;
import com.dituhui.pea.order.service.WorkbenchService; import com.dituhui.pea.order.service.WorkbenchService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
...@@ -19,10 +20,7 @@ import org.springframework.stereotype.Service; ...@@ -19,10 +20,7 @@ import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.dituhui.pea.order.config.OrderConfig.PATTERN_DATE; import static com.dituhui.pea.order.config.OrderConfig.PATTERN_DATE;
...@@ -54,7 +52,7 @@ public class WorkbenchServiceImpl implements WorkbenchService { ...@@ -54,7 +52,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
Page<?> changes; Page<?> changes;
String levelType = reqDTO.getLevelType(); String levelType = reqDTO.getLevelType();
String levelValue = reqDTO.getLevelValue(); String levelValue = reqDTO.getLevelValue();
LocalDate date = LocalDate.parse(reqDTO.getDate()); Date date = DateUtil.parse(reqDTO.getDate());
if ("cluster".equals(levelType)) { if ("cluster".equals(levelType)) {
changes = orderEventDao.findAllByClusterId(levelValue, date, pageable); changes = orderEventDao.findAllByClusterId(levelValue, date, pageable);
} else if ("branch".equals(levelType)) { } else if ("branch".equals(levelType)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!