From f5315992b504d4a37cdab97a616f864d07417564 Mon Sep 17 00:00:00 2001 From: nixj Date: Wed, 26 Jun 2024 13:07:42 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E3=80=81=E7=94=B3=E8=AF=B7=E5=8D=95=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E7=B1=BB=E6=96=B0=E5=A2=9E=EF=BC=8C=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=83=A8=E5=88=86=E4=B8=9A=E5=8A=A1=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jdbc/JdbcOrderDetailRepository.java | 36 -------- .../chint/manage/entity/OrderDetailBasic.java | 79 ++++++++++++++++ .../chint/manage/entity/RouteOrderBasic.java | 92 ------------------- ...ava => RouteOrderExtensionFieldBasic.java} | 2 +- .../JdbcOrderDetailBasicRepository.java | 59 ++++++++++++ .../mapper/JdbcRouteOrderBasicRepository.java | 20 ---- ...uteOrderExtensionFieldBasicRepository.java | 20 ++++ ...dbcRouteOrderExtensionFieldRepository.java | 22 ----- .../JdbcConsumptionDetailRepositoryImpl.java | 2 - .../service/impl/ManageServiceImpl.java | 50 +++++----- .../java/com/chint/manage/util/BaseUtil.java | 19 ++-- .../manage/util/DataJdbcCreatorUtil.java | 10 +- 12 files changed, 198 insertions(+), 213 deletions(-) create mode 100644 src/main/java/com/chint/manage/entity/OrderDetailBasic.java delete mode 100644 src/main/java/com/chint/manage/entity/RouteOrderBasic.java rename src/main/java/com/chint/manage/entity/{RouteOrderExtensionField.java => RouteOrderExtensionFieldBasic.java} (87%) create mode 100644 src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java delete mode 100644 src/main/java/com/chint/manage/mapper/JdbcRouteOrderBasicRepository.java create mode 100644 src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldBasicRepository.java delete mode 100644 src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldRepository.java diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderDetailRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderDetailRepository.java index cb14e6e1..de97009d 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderDetailRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcOrderDetailRepository.java @@ -33,40 +33,4 @@ public interface JdbcOrderDetailRepository extends CrudRepository findByCreateTimeBetweenAndProductType(LocalDateTime createTime, LocalDateTime createTime2, Integer productType); List findByCreateTimeBetweenAndProductTypeAndOrderNoContaining(LocalDateTime createTime, LocalDateTime createTime2, Integer productType, String orderNo); List findByUpdateTimeBetween(LocalDateTime createTime, LocalDateTime createTime2); - - @Query("SELECT order_no FROM order_detail " + - "WHERE route_id IN (:#{#routeIds})") - List findAllOrderNo(@Param("routeIds") List routeIds); - - @Query("SELECT order_id FROM order_detail " + - "WHERE route_id IN (:#{#routeIds})") - List findAllOrderId(@Param("routeIds") List routeIds); - - @Query("SELECT order_no FROM order_detail " ) - List findAllOrderNo(); - - @Query("SELECT order_id FROM order_detail ") - List findAllOrderId(); - - - @Query("SELECT * FROM order_detail " + -// "WHERE route_id IN (:#{#dto.routeIds}) " + - "WHERE 1=1 " + - "AND (:#{#dto.orderNo} ='' OR order_no LIKE :#{#dto.orderNo}) " + - "AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime}) " + - "AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) " + - "AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " + - "AND (:#{#dto.employeeNosEmpty} = TRUE OR employee_no IN (:#{#dto.employeeNos}))" + - "LIMIT :#{#pageRequest.pageSize} OFFSET :#{#pageRequest.pageNumber}") - List listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest")PageRequest pageRequest); - - @Query("SELECT COUNT(*) FROM order_detail " + -// "WHERE route_id IN (:#{#dto.routeIds}) " + - "WHERE 1=1 " + - "AND (:#{#dto.orderNo} ='' OR order_no LIKE :#{#dto.orderNo}) " + - "AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime} ) " + - "AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) "+ - "AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " + - "AND (:#{#dto.employeeNosEmpty} = TRUE OR employee_no IN (:#{#dto.employeeNos}))") - Integer countByCondition(@Param("dto") OrderPageQuery dto); } diff --git a/src/main/java/com/chint/manage/entity/OrderDetailBasic.java b/src/main/java/com/chint/manage/entity/OrderDetailBasic.java new file mode 100644 index 00000000..dd9cf6c9 --- /dev/null +++ b/src/main/java/com/chint/manage/entity/OrderDetailBasic.java @@ -0,0 +1,79 @@ +package com.chint.manage.entity; + +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * + * @author xx OrderDetailBasic.java + * + **/ +@Data +@Table("order_detail") +public class OrderDetailBasic implements Serializable { + @Serial + private static final long serialVersionUID = 1L; + @Id + private Long orderId; + + /****/ + private Long routeId; + + /****/ + private Long routeOrderKey; + + /****/ + private String orderNo; + + /****/ + private LocalDateTime startTime; + + /****/ + private LocalDateTime endTime; + + /****/ + private Long originId; + + /****/ + private Long destinationId; + + /****/ + private String supplierName; + + /**商品类型 0-火车 1飞机 2酒店 3打车 4其他**/ + private Integer productType; + + /****/ + private String price; + + /****/ + private LocalDateTime updateTime; + + /****/ + private LocalDateTime createTime; + + /****/ + private String currencyType; + + /****/ + private LocalDateTime orderDate; + + /****/ + private Long legId; + + /****/ + private Integer quantity; + + /****/ + private String employeeNo; + + /****/ + private Integer ifOrigin; + + +} diff --git a/src/main/java/com/chint/manage/entity/RouteOrderBasic.java b/src/main/java/com/chint/manage/entity/RouteOrderBasic.java deleted file mode 100644 index 06b7c382..00000000 --- a/src/main/java/com/chint/manage/entity/RouteOrderBasic.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.chint.manage.entity; - -import lombok.Data; -import org.springframework.data.annotation.Id; -import org.springframework.data.relational.core.mapping.Table; -import java.io.Serial; -import java.io.Serializable; - -/** - * - * @author xx RouteOrderBasic.java - * - **/ -@Data -@Table("route_order") -public class RouteOrderBasic implements Serializable { -@Serial -private static final long serialVersionUID = 1L; - @Id - private Long routeId; - - /****/ - private java.util.Date bookingTime; - - /****/ - private String userId; - - /****/ - private java.util.Date createTime; - - /****/ - private String createUser; - - /****/ - private Integer sort; - - /****/ - private Integer status; - - /****/ - private java.util.Date updateTime; - - /****/ - private String updateUser; - - /****/ - private String fakeOrderNo; - - /****/ - private String actualOrderNo; - - /**差旅订单号**/ - private String routeOrderNo; - - /****/ - private String supplierName; - - /****/ - private String accountCompany; - - /****/ - private String sysCode; - - /****/ - private String instructions; - - /****/ - private String standardLevel; - - /****/ - private String creator; - - /****/ - private String accountCompanyName; - - /**入账公司64位编码**/ - private String accountCompanyCode; - - /****/ - private String projectName; - - /****/ - private String costCenter; - - /****/ - private java.util.Date startTime; - - /****/ - private java.util.Date endTime; - - -} diff --git a/src/main/java/com/chint/manage/entity/RouteOrderExtensionField.java b/src/main/java/com/chint/manage/entity/RouteOrderExtensionFieldBasic.java similarity index 87% rename from src/main/java/com/chint/manage/entity/RouteOrderExtensionField.java rename to src/main/java/com/chint/manage/entity/RouteOrderExtensionFieldBasic.java index f675445b..49fba22c 100644 --- a/src/main/java/com/chint/manage/entity/RouteOrderExtensionField.java +++ b/src/main/java/com/chint/manage/entity/RouteOrderExtensionFieldBasic.java @@ -13,7 +13,7 @@ import java.io.Serializable; **/ @Data @Table("route_order_extension_field") -public class RouteOrderExtensionField implements Serializable { +public class RouteOrderExtensionFieldBasic implements Serializable { @Serial private static final long serialVersionUID = 1L; /****/ diff --git a/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java b/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java new file mode 100644 index 00000000..fca7afed --- /dev/null +++ b/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java @@ -0,0 +1,59 @@ +package com.chint.manage.mapper; +import com.chint.domain.aggregates.order.OrderDetail; +import com.chint.manage.entity.OrderDetailBasic; +import com.chint.manage.entity.query.OrderPageQuery; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.jdbc.repository.query.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * + * @author xx JdbcOrderDetailBasicRepository数据库操作接口类 + * + **/ +@Repository +public interface JdbcOrderDetailBasicRepository extends CrudRepository { + + List findByRouteIdIn(List routeIds); + + @Query("SELECT order_no FROM order_detail " + + "WHERE route_id IN (:#{#routeIds})") + List findAllOrderNo(@Param("routeIds") List routeIds); + + @Query("SELECT order_id FROM order_detail " + + "WHERE route_id IN (:#{#routeIds})") + List findAllOrderId(@Param("routeIds") List routeIds); + + @Query("SELECT order_no FROM order_detail " ) + List findAllOrderNo(); + + @Query("SELECT order_id FROM order_detail ") + List findAllOrderId(); + + + @Query("SELECT * FROM order_detail " + +// "WHERE route_id IN (:#{#dto.routeIds}) " + + "WHERE 1=1 " + + "AND (:#{#dto.orderNo} ='' OR order_no LIKE :#{#dto.orderNo}) " + + "AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime}) " + + "AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) " + + "AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " + + "AND (:#{#dto.employeeNosEmpty} = TRUE OR employee_no IN (:#{#dto.employeeNos}))" + + "LIMIT :#{#pageRequest.pageSize} OFFSET :#{#pageRequest.pageNumber}") + List listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest") PageRequest pageRequest); + + @Query("SELECT COUNT(*) FROM order_detail " + +// "WHERE route_id IN (:#{#dto.routeIds}) " + + "WHERE 1=1 " + + "AND (:#{#dto.orderNo} ='' OR order_no LIKE :#{#dto.orderNo}) " + + "AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime} ) " + + "AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) "+ + "AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " + + "AND (:#{#dto.employeeNosEmpty} = TRUE OR employee_no IN (:#{#dto.employeeNos}))") + Integer countByCondition(@Param("dto") OrderPageQuery dto); +} \ No newline at end of file diff --git a/src/main/java/com/chint/manage/mapper/JdbcRouteOrderBasicRepository.java b/src/main/java/com/chint/manage/mapper/JdbcRouteOrderBasicRepository.java deleted file mode 100644 index c10a3180..00000000 --- a/src/main/java/com/chint/manage/mapper/JdbcRouteOrderBasicRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.chint.manage.mapper; -import com.chint.domain.aggregates.order.RouteOrder; -import com.chint.manage.entity.RouteOrderBasic; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Repository; - -import java.util.List; - - -/** - * - * @author xx JdbcRouteOrderBasicRepository数据库操作接口类 - * - **/ -@Repository -public interface JdbcRouteOrderBasicRepository extends CrudRepository { - - List findByRouteIdIn(List routeIds); - -} \ No newline at end of file diff --git a/src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldBasicRepository.java b/src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldBasicRepository.java new file mode 100644 index 00000000..79caee82 --- /dev/null +++ b/src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldBasicRepository.java @@ -0,0 +1,20 @@ +package com.chint.manage.mapper; +import com.chint.manage.entity.RouteOrderExtensionFieldBasic; +import org.springframework.data.jdbc.repository.query.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * + * @author xx JdbcRouteOrderExtensionFieldRepository数据库操作接口类 + * + **/ +@Repository +public interface JdbcRouteOrderExtensionFieldBasicRepository extends CrudRepository { + + List findAllByBelongDeptCodeIn(@Param("belongDeptCode") List belongDeptCode); +} \ No newline at end of file diff --git a/src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldRepository.java b/src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldRepository.java deleted file mode 100644 index bf44e6af..00000000 --- a/src/main/java/com/chint/manage/mapper/JdbcRouteOrderExtensionFieldRepository.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.chint.manage.mapper; -import com.chint.manage.entity.RouteOrderExtensionField; -import org.springframework.data.jdbc.repository.query.Query; -import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - - -/** - * - * @author xx JdbcRouteOrderExtensionFieldRepository数据库操作接口类 - * - **/ -@Repository -public interface JdbcRouteOrderExtensionFieldRepository extends CrudRepository { - - @Query("SELECT * FROM route_order_extension_field " + - "WHERE belong_dept_code IN (:#{#belongDeptCode})") - List findByCondition(@Param("belongDeptCode") List belongDeptCode); -} \ No newline at end of file diff --git a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java index 60ba4768..cdaa38a2 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -84,8 +84,6 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai // if (orderIds==null||orderIds.isEmpty()) { // return PageResult.totalPageNum(0, new ArrayList<>()); // } - - List orderIds=jdbcOrderDetailRepository.findAllOrderId(); Page data=new PageImpl<>(Collections.emptyList()); //申请单查询 if (!dto.getActualOrderNo().isEmpty()){ diff --git a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java index 66bc7108..c89242ff 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -7,14 +7,14 @@ import com.chint.domain.exceptions.CommandException; import com.chint.domain.repository.UserRepository; import com.chint.domain.service.LegDomainService; import com.chint.infrastructure.repository.jdbc.JdbcLocationRepository; -import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository; import com.chint.infrastructure.repository.jdbc.JdbcRouteRepository; import com.chint.infrastructure.repository.jdbc.JdbcUserRepository; import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.PageResult; +import com.chint.manage.entity.OrderDetailBasic; import com.chint.manage.entity.OrderDownloadRecord; import com.chint.manage.entity.OrderExceedStandard; -import com.chint.manage.entity.RouteOrderExtensionField; +import com.chint.manage.entity.RouteOrderExtensionFieldBasic; import com.chint.manage.entity.dto.ItineraryPageDto; import com.chint.manage.entity.excel.OrderPageExcel; import com.chint.manage.entity.excel.BaseExcel; @@ -67,11 +67,11 @@ public class ManageServiceImpl implements ManageService { @Autowired private BaseUtil baseUtil; @Autowired - private JdbcOrderDetailRepository jdbcOrderDetailRepository; + private JdbcOrderDetailBasicRepository jdbcOrderDetailBasicRepository; @Autowired private JdbcLocationRepository locationRepository; @Autowired - private JdbcRouteOrderExtensionFieldRepository jdbcRouteOrderExtensionFieldRepository; + private JdbcRouteOrderExtensionFieldBasicRepository jdbcRouteOrderExtensionFieldBasicRepository; @Autowired private JdbcTrainOrderDetailRepository jdbcTrainOrderDetailRepository; @Autowired @@ -211,12 +211,12 @@ public class ManageServiceImpl implements ManageService { } //部门 if (dto.getBelongDeptCode() != null && !dto.getBelongDeptCode().isEmpty()) { - List routeOrderExtensionFields = jdbcRouteOrderExtensionFieldRepository.findByCondition(dto.getBelongDeptCode()); - if (routeOrderExtensionFields == null || routeOrderExtensionFields.isEmpty()) { + List routeOrderExtensionFieldBasics = jdbcRouteOrderExtensionFieldBasicRepository.findByCondition(dto.getBelongDeptCode()); + if (routeOrderExtensionFieldBasics == null || routeOrderExtensionFieldBasics.isEmpty()) { return PageResult.totalPageNum(0, new ArrayList<>()); } - List routeOrderExtensionFieldIds = routeOrderExtensionFields.stream() - .map(RouteOrderExtensionField::getRouteId) + List routeOrderExtensionFieldIds = routeOrderExtensionFieldBasics.stream() + .map(RouteOrderExtensionFieldBasic::getRouteId) .collect(Collectors.toList()); List updatedRouteIds = dto.getRouteIds() == null ? routeOrderExtensionFieldIds @@ -234,18 +234,18 @@ public class ManageServiceImpl implements ManageService { dto.setApplicant("%"+dto.getApplicant()+"%"); } - List list=jdbcOrderDetailRepository.listByCondition(dto,dto.getPageResult()); + List list=jdbcOrderDetailBasicRepository.listByCondition(dto,dto.getPageResult()); //处理地点信息 - List locationIds = new ArrayList<>(list.stream().map(OrderDetail::getOriginId).toList()); - locationIds.addAll(list.stream().map(OrderDetail::getDestinationId).toList()); + List locationIds = new ArrayList<>(list.stream().map(OrderDetailBasic::getOriginId).toList()); + locationIds.addAll(list.stream().map(OrderDetailBasic::getDestinationId).toList()); locationIds=locationIds.stream().distinct().filter(Objects::nonNull).collect(Collectors.toList()); List locations=locationRepository.findByLocationIdIn(locationIds); //根据类型处理出行订单信息 Map orderPageDtoMap=new HashMap<>(); - Map> collect = list.stream().collect(Collectors.groupingBy(OrderDetail::getProductType)); - for (Map.Entry> entry : collect.entrySet()) { + Map> collect = list.stream().collect(Collectors.groupingBy(OrderDetailBasic::getProductType)); + for (Map.Entry> entry : collect.entrySet()) { int type = entry.getKey(); - List details = entry.getValue(); + List details = entry.getValue(); switch (type) { case LEG_TYPE_TRAIN -> dealOrderTrainRecord(details,orderPageDtoMap); case LEG_TYPE_AIRPLANE -> dealOrderFlightRecord(details,orderPageDtoMap); @@ -254,11 +254,11 @@ public class ManageServiceImpl implements ManageService { } } //处理行程单信息 - List routeIds=list.stream().map(OrderDetail::getRouteId).toList(); + List routeIds=list.stream().map(OrderDetailBasic::getRouteId).toList(); routeIds=routeIds.stream().distinct().filter(Objects::nonNull).collect(Collectors.toList()); List routeOrders=jdbcRouteRepository.findByRouteIdIn(routeIds); - List users=jdbcUserRepository.findAllByEmployeeNoIn(list.stream().map(OrderDetail::getEmployeeNo).collect(Collectors.toList())); + List users=jdbcUserRepository.findAllByEmployeeNoIn(list.stream().map(OrderDetailBasic::getEmployeeNo).collect(Collectors.toList())); List result = list.stream().map(temp -> { OrderPageExcel obj = orderPageDtoMap.get(temp.getOrderId()); @@ -286,7 +286,7 @@ public class ManageServiceImpl implements ManageService { } return finalObj; }).toList(); - Integer count=jdbcOrderDetailRepository.countByCondition(dto); + Integer count=jdbcOrderDetailBasicRepository.countByCondition(dto); return PageResult.totalPageNum(count, result); } @@ -299,9 +299,9 @@ public class ManageServiceImpl implements ManageService { return ExcelUtil.exportReport(orderPageQuery(dto).getRecords()); } - private void dealOrderTrainRecord(List entry,Map orderPageDtoMap){ + private void dealOrderTrainRecord(List entry,Map orderPageDtoMap){ if (entry!=null&&!entry.isEmpty()){ - List trainOrderDetails=jdbcTrainOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetail::getOrderId).toList()); + List trainOrderDetails=jdbcTrainOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetailBasic::getOrderId).toList()); for (TrainOrderDetail trainOrderDetail : trainOrderDetails) { OrderPageExcel orderPageDto=new OrderPageExcel(); orderPageDto.setStatus(trainOrderDetail.getOrderStatus()); @@ -311,9 +311,9 @@ public class ManageServiceImpl implements ManageService { } } - private void dealOrderFlightRecord(List entry,Map orderPageDtoMap){ + private void dealOrderFlightRecord(List entry,Map orderPageDtoMap){ if (entry!=null&&!entry.isEmpty()){ - List flightOrderDetails=jdbcFlightOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetail::getOrderId).toList()); + List flightOrderDetails=jdbcFlightOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetailBasic::getOrderId).toList()); for (FlightOrderDetail flightOrderDetail : flightOrderDetails) { OrderPageExcel orderPageDto=new OrderPageExcel(); orderPageDto.setStatus(flightOrderDetail.getOrderStatus()); @@ -323,9 +323,9 @@ public class ManageServiceImpl implements ManageService { } } - private void dealOrderHotelRecord(List entry,Map orderPageDtoMap){ + private void dealOrderHotelRecord(List entry,Map orderPageDtoMap){ if (entry!=null&&!entry.isEmpty()){ - List hotelOrderDetails=jdbcHotelOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetail::getOrderId).toList()); + List hotelOrderDetails=jdbcHotelOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetailBasic::getOrderId).toList()); for (HotelOrderDetail hotelOrderDetail : hotelOrderDetails) { OrderPageExcel orderPageDto=new OrderPageExcel(); orderPageDto.setStatus(hotelOrderDetail.getOrderStatus()); @@ -338,9 +338,9 @@ public class ManageServiceImpl implements ManageService { } } - private void dealOrderCarRecord(List entry,Map orderPageDtoMap){ + private void dealOrderCarRecord(List entry,Map orderPageDtoMap){ if (entry!=null&&!entry.isEmpty()){ - List carOrderDetails=jdbcCarOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetail::getOrderId).toList()); + List carOrderDetails=jdbcCarOrderDetailRepository.findAllByOrderIdIn(entry.stream().map(OrderDetailBasic::getOrderId).toList()); for (CarOrderDetail carOrderDetail : carOrderDetails) { OrderPageExcel orderPageDto=new OrderPageExcel(); orderPageDto.setStatus(carOrderDetail.getOrderStatus()); diff --git a/src/main/java/com/chint/manage/util/BaseUtil.java b/src/main/java/com/chint/manage/util/BaseUtil.java index 78c8160f..b36690ff 100644 --- a/src/main/java/com/chint/manage/util/BaseUtil.java +++ b/src/main/java/com/chint/manage/util/BaseUtil.java @@ -1,12 +1,11 @@ package com.chint.manage.util; -import com.chint.domain.aggregates.order.OrderDetail; import com.chint.domain.aggregates.user.User; import com.chint.domain.value_object.system.SystemOrganizationVO; -import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository; import com.chint.infrastructure.util.BaseContext; -import com.chint.manage.entity.RouteOrderExtensionField; -import com.chint.manage.mapper.JdbcRouteOrderExtensionFieldRepository; +import com.chint.manage.entity.RouteOrderExtensionFieldBasic; +import com.chint.manage.mapper.JdbcOrderDetailBasicRepository; +import com.chint.manage.mapper.JdbcRouteOrderExtensionFieldBasicRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -20,9 +19,9 @@ import java.util.List; @Component public class BaseUtil { @Autowired - private JdbcRouteOrderExtensionFieldRepository jdbcRouteOrderExtensionFieldRepository; + private JdbcRouteOrderExtensionFieldBasicRepository jdbcRouteOrderExtensionFieldBasicRepository; @Autowired - private JdbcOrderDetailRepository jdbcOrderDetailRepository; + private JdbcOrderDetailBasicRepository jdbcOrderDetailBasicRepository; public User getCurrentUser() { return BaseContext.getCurrentUser(); @@ -31,18 +30,18 @@ public class BaseUtil { public List getRouteIds(){ List list = BaseContext.getCurrentUser().loadRoleOrg().getRoleOrgList() .stream().filter(s->s.getOrgShortCode()!=null).map(SystemOrganizationVO::getOrgShortCode).toList(); - List result=jdbcRouteOrderExtensionFieldRepository.findByCondition(list); - return result.stream().map(RouteOrderExtensionField::getRouteId).toList(); + List result= jdbcRouteOrderExtensionFieldBasicRepository.findAllByBelongDeptCodeIn(list); + return result.stream().map(RouteOrderExtensionFieldBasic::getRouteId).toList(); } public List getOrderIds(){ List routeIds = getRouteIds(); - return jdbcOrderDetailRepository.findAllOrderId(routeIds); + return jdbcOrderDetailBasicRepository.findAllOrderId(routeIds); } public List getOrderNos(){ List routeIds = getRouteIds(); - return jdbcOrderDetailRepository.findAllOrderNo(routeIds); + return jdbcOrderDetailBasicRepository.findAllOrderNo(routeIds); } /** diff --git a/src/main/java/com/chint/manage/util/DataJdbcCreatorUtil.java b/src/main/java/com/chint/manage/util/DataJdbcCreatorUtil.java index 558b52cf..0b6b23d6 100644 --- a/src/main/java/com/chint/manage/util/DataJdbcCreatorUtil.java +++ b/src/main/java/com/chint/manage/util/DataJdbcCreatorUtil.java @@ -39,7 +39,7 @@ public class DataJdbcCreatorUtil { */ private List getTables() throws SQLException { List tables = new ArrayList(); - tables.add("route_order"); + tables.add("order_detail"); return tables; } @@ -179,11 +179,11 @@ public class DataJdbcCreatorUtil { } else if (type.indexOf(type_int) > -1) { return "java.lang.Integer"; } else if (type.indexOf(type_date) > -1) { - return "java.util.Date"; + return "java.time.LocalDateTime"; } else if (type.indexOf(type_text) > -1) { return "java.lang.String"; } else if (type.indexOf(type_timestamp) > -1) { - return "java.util.Date"; + return "java.time.LocalDateTime"; } else if (type.indexOf(type_bit) > -1) { return "java.lang.Boolean"; } else if (type.indexOf(type_decimal) > -1) { @@ -203,11 +203,11 @@ public class DataJdbcCreatorUtil { } else if (type.indexOf(type_longtext) > -1) { return "java.lang.String"; } else if (type.indexOf(type_datetime) > -1) { - return "java.util.Date"; + return "java.time.LocalDateTime"; } else if (type.indexOf(type_binary) > -1) { return "java.lang.Long"; } else if (type.indexOf(type_time) > -1) { - return "java.util.Date"; + return "java.time.LocalDateTime"; }