From d9d18e1b2719282c32cb9fbb7768dfcc15f92aa3 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Fri, 1 Mar 2024 16:44:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/infrastructure/constant/LegConstant.java | 6 ++++-- .../chint/infrastructure/constant/RouteConstant.java | 2 +- .../repository/RouteRepositoryImpl.java | 8 ++++---- .../repository/jdbc/JdbcRouteRepository.java | 8 ++++---- src/test/java/com/chint/RouteApplicationTests.java | 11 +++++++++++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/chint/infrastructure/constant/LegConstant.java b/src/main/java/com/chint/infrastructure/constant/LegConstant.java index d9159a59..0220090a 100644 --- a/src/main/java/com/chint/infrastructure/constant/LegConstant.java +++ b/src/main/java/com/chint/infrastructure/constant/LegConstant.java @@ -12,10 +12,12 @@ public class LegConstant { public static final String LEG_STATUS_ORDERED_NAME = "已下单"; public static final int LEG_STATUS_PAYED = 5; public static final String LEG_STATUS_PAYED_NAME = "已付款"; - public static final int LEG_STATUS_FINISH = -2; + public static final int LEG_STATUS_FINISH = 9; public static final String LEG_STATUS_FINISH_NAME = "已结束"; public static final int LEG_STATUS_REJECT = -1; public static final String LEG_STATUS_REJECT_NAME = "审批未通过"; + + // 规划节点运输方式 public static final int LEG_TYPE_TRAIN = 0; public static final String LEG_TYPE_TRAIN_NAME = "火车"; @@ -58,7 +60,7 @@ public class LegConstant { public static final String LEG_EVENT_ORDERED_NAME = "下单事件"; public static final int LEG_EVENT_PAYED = 5; public static final String LEG_EVENT_PAYED_NAME = "付款事件"; - public static final int LEG_EVENT_FINISH = -2; + public static final int LEG_EVENT_FINISH = 9; public static final String LEG_EVENT_FINISH_NAME = "结束事件"; public static final int LEG_EVENT_REJECT = -1; public static final String LEG_EVENT_REJECT_NAME = "拒绝事件"; diff --git a/src/main/java/com/chint/infrastructure/constant/RouteConstant.java b/src/main/java/com/chint/infrastructure/constant/RouteConstant.java index e0bbac0f..8f8be66a 100644 --- a/src/main/java/com/chint/infrastructure/constant/RouteConstant.java +++ b/src/main/java/com/chint/infrastructure/constant/RouteConstant.java @@ -12,7 +12,7 @@ public class RouteConstant { public static final String ORDER_STATUS_ORDERED_NAME = "已下单"; public static final int ORDER_STATUS_PAYED = 4; public static final String ORDER_STATUS_PAYED_NAME = "已付款"; - public static final int ORDER_STATUS_FINISH = 5; + public static final int ORDER_STATUS_FINISH = 9; public static final String ORDER_STATUS_FINISH_NAME = "已结束"; public static final int ORDER_STATUS_REJECT = -1; public static final String ORDER_STATUS_REJECT_NAME = "审批拒绝"; diff --git a/src/main/java/com/chint/infrastructure/repository/RouteRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/RouteRepositoryImpl.java index b84816b7..2e68e7a8 100644 --- a/src/main/java/com/chint/infrastructure/repository/RouteRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/RouteRepositoryImpl.java @@ -53,7 +53,7 @@ public class RouteRepositoryImpl implements RouteRepository { String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString(); return jdbcRouteRepository .findByUserIdAndRouteOrderNoContainingOrApproveOrderNo_CreatorAndRouteOrderNoContaining( - Long.valueOf(employeeNo), + employeeNo, orderQueryData.getOrderNo(), employeeNo, orderQueryData.getOrderNo(), @@ -66,7 +66,7 @@ public class RouteRepositoryImpl implements RouteRepository { .of(orderQueryData.getPageNum() - 1, orderQueryData.getPageSize(), Sort.by("updateTime")); String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString(); return jdbcRouteRepository.findByUserIdAndApproveOrderNo_InstructionsContainingOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContaining( - Long.valueOf(employeeNo), + employeeNo, orderQueryData.getInstructions(), employeeNo, orderQueryData.getInstructions(), @@ -84,7 +84,7 @@ public class RouteRepositoryImpl implements RouteRepository { .of(orderQueryData.getPageNum() - 1, orderQueryData.getPageSize(), Sort.by("updateTime")); String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString(); Page byUserId = jdbcRouteRepository - .findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long.valueOf(employeeNo), employeeNo, sort); + .findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(employeeNo, employeeNo, sort); List orders = byUserId.toList(); orders.forEach(RouteOrder::reloadStatus); return new PageResult<>(byUserId.getTotalElements(), orders); @@ -93,6 +93,6 @@ public class RouteRepositoryImpl implements RouteRepository { @Override public List findByActualOrderNoNotNull(OrderQueryData orderQueryData) { String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString(); - return jdbcRouteRepository.findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long.valueOf(employeeNo), employeeNo); + return jdbcRouteRepository.findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(employeeNo, employeeNo); } } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java index 08711078..38e7ec66 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java @@ -23,17 +23,17 @@ public interface JdbcRouteRepository extends CrudRepository { RouteOrder findByRouteOrderNo(String routeOrderNo); - Page findByUserIdAndRouteOrderNoContainingOrApproveOrderNo_CreatorAndRouteOrderNoContaining(Long userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable); + Page findByUserIdAndRouteOrderNoContainingOrApproveOrderNo_CreatorAndRouteOrderNoContaining(String userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable); - Page findByUserIdAndApproveOrderNo_InstructionsContainingOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContaining(Long userId, String approveOrderNo_instructions, String approveOrderNo_creator, String approveOrderNo_instructions2, Pageable pageable); + Page findByUserIdAndApproveOrderNo_InstructionsContainingOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContaining(String userId, String approveOrderNo_instructions, String approveOrderNo_creator, String approveOrderNo_instructions2, Pageable pageable); - Page findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long userId, String approveOrderNo_creator, Pageable pageable); + Page findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator, Pageable pageable); - List findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long userId, String approveOrderNo_creator); + List findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator); } diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index 799b92db..f831e2ab 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -4,8 +4,10 @@ import cn.hutool.extra.pinyin.PinyinUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.chint.application.services.login.strategy.PailaLoginStrategy; +import com.chint.domain.aggregates.order.Leg; import com.chint.domain.aggregates.order.Location; import com.chint.domain.aggregates.user.User; +import com.chint.domain.repository.LegRepository; import com.chint.domain.repository.LocationRepository; import com.chint.domain.repository.OrderDetailRepository; import com.chint.domain.repository.RouteRepository; @@ -53,6 +55,9 @@ class RouteApplicationTests { @Autowired private PailaLoginStrategy pailaLoginStrategy; + @Autowired + private LegRepository legRepository; + private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365"); @@ -202,6 +207,12 @@ class RouteApplicationTests { orderDetailRepository.deleteById(31L); orderDetailRepository.deleteById(33L); } + @Test + void deleteLeg(){ + + legRepository.deleteById(Leg.of(506L)); + legRepository.deleteById(Leg.of(507L)); + } // @Test void ssoLogin(){