From 0817f897f6644e7da725dd54bf437333454f546d Mon Sep 17 00:00:00 2001 From: nixj Date: Tue, 2 Jul 2024 14:05:42 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E3=80=90update=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=B6=85=E6=A0=87=E6=8A=A5=E8=A1=A8=E5=85=AC=E5=8F=B8=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=A8=A1=E7=B3=8A=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E9=99=A4=E7=94=A8=E6=88=B7=E5=90=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=B8=B4=E6=97=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rest/bpm/dto/ANExceedStandardDto.java | 2 +- .../impl/ManageOrderDetailRepositoryImpl.java | 3 ++- .../manage/service/impl/ManageServiceImpl.java | 13 ------------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/chint/interfaces/rest/bpm/dto/ANExceedStandardDto.java b/src/main/java/com/chint/interfaces/rest/bpm/dto/ANExceedStandardDto.java index aaecd117..fc926587 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/dto/ANExceedStandardDto.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/dto/ANExceedStandardDto.java @@ -15,7 +15,7 @@ public class ANExceedStandardDto { private String applicant;//申请人 private String applyNo;//差旅申请单号 private String orderNo;//商旅订单号 - private String orderType;//超标原因 + private String orderType;//超标类型 private String orderSource;//订单来源 private String legNo;//行程ID private String startPlace;//出发地 diff --git a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java index 9fbec593..0cedb558 100644 --- a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java @@ -54,6 +54,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit } if (!dto.getCompanyName().isEmpty()) { + dto.setCompanyName(dto.getCompanyName()+"%"); query+="AND oes.company_name LIKE (:companyName) "; } @@ -63,7 +64,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("order_date").descending()); params.put("actualOrderNo", dto.getActualOrderNo()); params.put("applicant", dto.getApplicant()); params.put("companyName", dto.getCompanyName()); 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 1d48b334..0028c25f 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -106,19 +106,6 @@ public class ManageServiceImpl implements ManageService { } dto.setCompanyCods(companyCods); Page page=manageOrderDetailRepository.OrderExceedStandard(dto); - List content = page.getContent(); - Set employees=new HashSet<>(); - for (OrderExceedStandard orderExceedStandard : content) { - employees.add(orderExceedStandard.getEmployeeNo()); - } - List allByEmployeeNoIn = userBasicRepository. - findAllByEmployeeNoIn(employees.stream().toList()); - for (OrderExceedStandard orderExceedStandard : content) { - for (UserBasic userBasic : allByEmployeeNoIn) { - if(userBasic.getEmployeeNo().equals(orderExceedStandard.getEmployeeNo())){} - orderExceedStandard.setApplicant(userBasic.getName()); - } - } List excelList = getOrderExceedStandardExcels(page); return PageResult.totalPageNum(page.getTotalElements(), excelList); } From be31c7101407037f861f8cdf34c79083b59b7b5d Mon Sep 17 00:00:00 2001 From: nixj Date: Tue, 2 Jul 2024 16:08:27 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E3=80=90fix=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E4=B8=BAnull=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E6=8C=89=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/entity/dto/ItineraryPageDto.java | 2 ++ .../entity/excel/CarOrderDetailExcel.java | 5 +++- .../entity/excel/FlightOrderDetailExcel.java | 5 +++- .../excel/OrderExceedStandardExcel.java | 11 ++++++++ .../entity/excel/TrainOrderDetailExcel.java | 5 +++- .../JdbcOrderDetailBasicRepository.java | 4 +-- .../JdbcConsumptionDetailRepositoryImpl.java | 28 +++++++++---------- .../impl/ManageOrderDetailRepositoryImpl.java | 4 +-- 8 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/chint/manage/entity/dto/ItineraryPageDto.java b/src/main/java/com/chint/manage/entity/dto/ItineraryPageDto.java index 94ec51e1..51b5c2eb 100644 --- a/src/main/java/com/chint/manage/entity/dto/ItineraryPageDto.java +++ b/src/main/java/com/chint/manage/entity/dto/ItineraryPageDto.java @@ -28,6 +28,8 @@ public class ItineraryPageDto { // private List approveEvents; private String approvalStatus; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime createTime; //差旅订单总价值 private List locationResList; diff --git a/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java index d5b8fb09..ed710453 100644 --- a/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java +++ b/src/main/java/com/chint/manage/entity/excel/CarOrderDetailExcel.java @@ -37,9 +37,12 @@ public class CarOrderDetailExcel extends BaseExcel{ private String createTime; public String getOrderStatus() { + if (orderStatus==null){ + return ""; + } return switch (orderStatus) { case "0" -> "取消"; - case "1" -> "出票成功"; + case "1" -> "行程结束"; case "2" -> "改签成功"; case "3" -> "退票成功"; default -> orderStatus; diff --git a/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java index 872cf4cd..d71eae10 100644 --- a/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java +++ b/src/main/java/com/chint/manage/entity/excel/FlightOrderDetailExcel.java @@ -36,9 +36,12 @@ public class FlightOrderDetailExcel extends BaseExcel{ public String getOrderStatus() { + if (orderStatus==null){ + return ""; + } return switch (orderStatus) { case "0" -> "取消"; - case "1" -> "出票成功"; + case "1" -> "行程结束"; case "2" -> "改签成功"; case "3" -> "退票成功"; default -> orderStatus; diff --git a/src/main/java/com/chint/manage/entity/excel/OrderExceedStandardExcel.java b/src/main/java/com/chint/manage/entity/excel/OrderExceedStandardExcel.java index a2ed2d5a..6e9fb8d0 100644 --- a/src/main/java/com/chint/manage/entity/excel/OrderExceedStandardExcel.java +++ b/src/main/java/com/chint/manage/entity/excel/OrderExceedStandardExcel.java @@ -2,9 +2,11 @@ package com.chint.manage.entity.excel; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.math.BigDecimal; +import java.time.LocalDateTime; /** * @@ -33,5 +35,14 @@ public class OrderExceedStandardExcel extends BaseExcel{ private BigDecimal standardAmount; @ExcelIgnore private String employeeNo; + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime orderDate; + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime createTime; + @ExcelIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private LocalDateTime updateTime; } diff --git a/src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java b/src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java index b38e53d7..f137ab58 100644 --- a/src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java +++ b/src/main/java/com/chint/manage/entity/excel/TrainOrderDetailExcel.java @@ -37,9 +37,12 @@ public class TrainOrderDetailExcel extends BaseExcel{ private String createTime; public String getOrderStatus() { + if (orderStatus==null){ + return ""; + } return switch (orderStatus) { case "0" -> "取消"; - case "1" -> "出票成功"; + case "1" -> "行程结束"; case "2" -> "改签成功"; case "3" -> "退票成功"; default -> orderStatus; diff --git a/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java b/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java index 00f290c8..8327a590 100644 --- a/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java +++ b/src/main/java/com/chint/manage/mapper/JdbcOrderDetailBasicRepository.java @@ -36,7 +36,7 @@ public interface JdbcOrderDetailBasicRepository extends CrudRepository findAllOrderId(); - @Query("SELECT * FROM order_detail od " + + @Query("SELECT od.* FROM order_detail od " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id "+ "WHERE (roef.company_code IN (:#{#dto.companyCodes})) " + "AND (:#{#dto.routeIdsEmpty} = TRUE OR roef.route_id IN (:#{#dto.routeIds})) " + @@ -45,7 +45,7 @@ public interface JdbcOrderDetailBasicRepository extends CrudRepository listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest") PageRequest pageRequest); @Query("SELECT COUNT(*) FROM order_detail od " + 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 1d4f2c17..ca3ef777 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -59,14 +59,14 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("create_time").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize()); params.put("actualOrderNo", dto.getActualOrderNo()); params.put("userIds", dto.getUserIds()); params.put("companyCodes", dto.getCompanyCodes()); params.put("offset", pageRequest.getOffset()); params.put("limit", pageRequest.getPageSize()); - String pagedQuery = "SELECT * FROM route_order ro " + query + " LIMIT :limit OFFSET :offset"; + String pagedQuery = "SELECT ro.* FROM route_order ro " + query + " ORDER BY create_time DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(ItineraryPageDto.class)); String countQuery = "SELECT COUNT(*) FROM route_order ro " + query; @@ -112,11 +112,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("create_time").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize()); query = getString(dto, query, params, pageRequest); - String pagedQuery = "SELECT * FROM train_order_detail tod " - + query + " LIMIT :limit OFFSET :offset"; + String pagedQuery = "SELECT tod.* FROM train_order_detail tod " + + query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(TrainOrderDetailExcel.class)); String countQuery = "SELECT COUNT(*) FROM train_order_detail tod " + query; @@ -131,11 +131,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("create_time").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize()); query = getString(dto, query, params, pageRequest); - String pagedQuery = "SELECT * FROM flight_order_detail tod " - + query + " LIMIT :limit OFFSET :offset"; + String pagedQuery = "SELECT tod.* FROM flight_order_detail tod " + + query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(FlightOrderDetailExcel.class)); String countQuery = "SELECT COUNT(*) FROM flight_order_detail tod " + query; @@ -150,11 +150,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("create_time").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize()); query = getString(dto, query, params, pageRequest); - String pagedQuery = "SELECT * FROM hotel_order_detail tod " - + query + " LIMIT :limit OFFSET :offset"; + String pagedQuery = "SELECT tod.* FROM hotel_order_detail tod " + + query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(HotelOrderDetailExcel.class)); String countQuery = "SELECT COUNT(*) FROM hotel_order_detail tod " + query; @@ -169,12 +169,12 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("create_time").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize()); query = getString(dto, query, params, pageRequest); - String pagedQuery = "SELECT * FROM car_order_detail tod " - + query + " LIMIT :limit OFFSET :offset"; + String pagedQuery = "SELECT tod.* FROM car_order_detail tod " + + query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(CarOrderDetailExcel.class)); String countQuery = "SELECT COUNT(*) FROM car_order_detail tod " + query; diff --git a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java index 0cedb558..d0f51a91 100644 --- a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java @@ -64,7 +64,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit Map params = new HashMap<>(); PageRequest pageRequest = PageRequest - .of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("order_date").descending()); + .of(dto.getPageNum() - 1, dto.getPageSize()); params.put("actualOrderNo", dto.getActualOrderNo()); params.put("applicant", dto.getApplicant()); params.put("companyName", dto.getCompanyName()); @@ -73,7 +73,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit params.put("offset", pageRequest.getOffset()); params.put("limit", pageRequest.getPageSize()); - String pagedQuery ="SELECT * FROM order_exceed_standard oes "+ query + " LIMIT :limit OFFSET :offset"; + String pagedQuery ="SELECT * FROM order_exceed_standard oes "+ query + " ORDER BY oes.order_date DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(OrderExceedStandard.class)); String countSql="SELECT COUNT(*) AS count FROM order_exceed_standard oes " + query ; From f8f99479e903ad491cc52b443e6a4a61612c928e Mon Sep 17 00:00:00 2001 From: nixj Date: Tue, 2 Jul 2024 16:19:55 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E3=80=90fix=E3=80=91=E8=B6=85=E6=A0=87?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E7=AD=9B=E9=80=89=E6=9C=AA=E7=94=9F=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/mapper/impl/ManageOrderDetailRepositoryImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java index d0f51a91..e2d048ef 100644 --- a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java @@ -46,10 +46,12 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit } if (!dto.getOrderNo().isEmpty()) { + dto.setOrderNo(dto.getOrderNo()+"%"); query+="AND oes.order_no LIKE (:orderNo) "; } if (!dto.getActualOrderNo().isEmpty()) { + dto.setActualOrderNo(dto.getActualOrderNo()+"%"); query+="AND oes.actual_order_no LIKE (:actualOrderNo) "; } From 6f172c0a3bdc0343115bb966df50e477b50168f3 Mon Sep 17 00:00:00 2001 From: nixj Date: Tue, 2 Jul 2024 17:08:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E3=80=90fix=E3=80=91=E6=8C=87=E5=AE=9Aoes.?= =?UTF-8?q?*=E6=9F=A5=E8=AF=A2=EF=BC=8C=E9=A2=84=E9=98=B2=E5=90=8C?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=AE=B5=E5=8F=96=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/mapper/impl/ManageOrderDetailRepositoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java index e2d048ef..e4fd9066 100644 --- a/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/ManageOrderDetailRepositoryImpl.java @@ -75,7 +75,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit params.put("offset", pageRequest.getOffset()); params.put("limit", pageRequest.getPageSize()); - String pagedQuery ="SELECT * FROM order_exceed_standard oes "+ query + " ORDER BY oes.order_date DESC LIMIT :limit OFFSET :offset"; + String pagedQuery ="SELECT oes.* FROM order_exceed_standard oes "+ query + " ORDER BY oes.order_date DESC LIMIT :limit OFFSET :offset"; List results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(OrderExceedStandard.class)); String countSql="SELECT COUNT(*) AS count FROM order_exceed_standard oes " + query ; From c726a33b9fce08b50a83e16295ca97aa197e6910 Mon Sep 17 00:00:00 2001 From: nixj Date: Tue, 2 Jul 2024 22:51:10 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E3=80=90fix=E3=80=91=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E7=A9=BA=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=83=A8=E5=88=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/chint/manage/entity/OrderDownloadRecord.java | 3 +++ .../manage/mapper/JdbcOrderDownloadRecordRepository.java | 2 +- .../mapper/impl/JdbcConsumptionDetailRepositoryImpl.java | 8 ++++---- src/main/java/com/chint/manage/service/MinioService.java | 5 ++++- .../com/chint/manage/service/impl/ManageServiceImpl.java | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java b/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java index 66066927..b86e1b1d 100644 --- a/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java +++ b/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java @@ -1,6 +1,7 @@ package com.chint.manage.entity; import com.chint.manage.entity.query.OrderPageQuery; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -28,8 +29,10 @@ public class OrderDownloadRecord implements Serializable { //查询条件 private OrderPageQuery queryCriteria; //执行时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; //过期时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime expireTime; //员工ID private String employeeNo; diff --git a/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java b/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java index 650726d7..3d7f8cf6 100644 --- a/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java +++ b/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java @@ -9,5 +9,5 @@ import java.util.List; @Repository public interface JdbcOrderDownloadRecordRepository extends CrudRepository { - List findAllByEmployeeNoOrderByIdDesc(String employeeNo); + List findAllByEmployeeNoOrderByCreateTimeDesc(String employeeNo); } 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 ca3ef777..7fbc9624 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -108,7 +108,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page trainPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE 1=1 "; + "WHERE tod.order_status IS NOT NULL "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest @@ -127,7 +127,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page flightPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE 1=1 "; + "WHERE tod.order_status IS NOT NULL "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest @@ -146,7 +146,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page hotelPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE 1=1 "; + "WHERE tod.order_status IS NOT NULL "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest @@ -165,7 +165,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page carPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE 1=1 "; + "WHERE tod.order_status IS NOT NULL "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest diff --git a/src/main/java/com/chint/manage/service/MinioService.java b/src/main/java/com/chint/manage/service/MinioService.java index 65b0671b..e61dd158 100644 --- a/src/main/java/com/chint/manage/service/MinioService.java +++ b/src/main/java/com/chint/manage/service/MinioService.java @@ -11,6 +11,8 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.Objects; @Service @@ -36,7 +38,8 @@ public class MinioService { minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build()); } //上传文件到MinIO - String fileName = UUID.randomUUID().toString(); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + String fileName =sdf.format(new Date())+"-"+UUID.randomUUID().toString(); InputStream inputStream = file.getInputStream(); ObjectWriteResponse objectWriteResponse = minioClient.putObject(PutObjectArgs.builder() .object(fileName.concat(".").concat(FileUtil.extName(file.getOriginalFilename()))) 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 0028c25f..26ff14f6 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -166,7 +166,7 @@ public class ManageServiceImpl implements ManageService { @Override public List orderDownloadRecordQuery() { User user=BaseContext.getCurrentUser(); - return jdbcOrderDownloadRecordRepository.findAllByEmployeeNoOrderByIdDesc(user.getEmployeeNo()); + return jdbcOrderDownloadRecordRepository.findAllByEmployeeNoOrderByCreateTimeDesc(user.getEmployeeNo()); } @Override From d37a342d6b4ebe95fa9fb9af3891408047deb68e Mon Sep 17 00:00:00 2001 From: nixj Date: Wed, 3 Jul 2024 08:20:59 +0800 Subject: [PATCH 6/6] =?UTF-8?q?Revert=20"=E3=80=90fix=E3=80=91=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=A9=BA=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E5=8C=96"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c726a33b9fce08b50a83e16295ca97aa197e6910. --- .../java/com/chint/manage/entity/OrderDownloadRecord.java | 3 --- .../manage/mapper/JdbcOrderDownloadRecordRepository.java | 2 +- .../mapper/impl/JdbcConsumptionDetailRepositoryImpl.java | 8 ++++---- src/main/java/com/chint/manage/service/MinioService.java | 5 +---- .../com/chint/manage/service/impl/ManageServiceImpl.java | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java b/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java index b86e1b1d..66066927 100644 --- a/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java +++ b/src/main/java/com/chint/manage/entity/OrderDownloadRecord.java @@ -1,7 +1,6 @@ package com.chint.manage.entity; import com.chint.manage.entity.query.OrderPageQuery; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -29,10 +28,8 @@ public class OrderDownloadRecord implements Serializable { //查询条件 private OrderPageQuery queryCriteria; //执行时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createTime; //过期时间 - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime expireTime; //员工ID private String employeeNo; diff --git a/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java b/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java index 3d7f8cf6..650726d7 100644 --- a/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java +++ b/src/main/java/com/chint/manage/mapper/JdbcOrderDownloadRecordRepository.java @@ -9,5 +9,5 @@ import java.util.List; @Repository public interface JdbcOrderDownloadRecordRepository extends CrudRepository { - List findAllByEmployeeNoOrderByCreateTimeDesc(String employeeNo); + List findAllByEmployeeNoOrderByIdDesc(String employeeNo); } 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 7fbc9624..ca3ef777 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -108,7 +108,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page trainPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE tod.order_status IS NOT NULL "; + "WHERE 1=1 "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest @@ -127,7 +127,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page flightPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE tod.order_status IS NOT NULL "; + "WHERE 1=1 "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest @@ -146,7 +146,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page hotelPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE tod.order_status IS NOT NULL "; + "WHERE 1=1 "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest @@ -165,7 +165,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai private Page carPageConsumptionDetail(ConsumptionDetailQuery dto) { String query = "LEFT JOIN order_detail od ON tod.order_id=od.order_id " + "LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id " + - "WHERE tod.order_status IS NOT NULL "; + "WHERE 1=1 "; Map params = new HashMap<>(); PageRequest pageRequest = PageRequest diff --git a/src/main/java/com/chint/manage/service/MinioService.java b/src/main/java/com/chint/manage/service/MinioService.java index e61dd158..65b0671b 100644 --- a/src/main/java/com/chint/manage/service/MinioService.java +++ b/src/main/java/com/chint/manage/service/MinioService.java @@ -11,8 +11,6 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.Objects; @Service @@ -38,8 +36,7 @@ public class MinioService { minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build()); } //上传文件到MinIO - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - String fileName =sdf.format(new Date())+"-"+UUID.randomUUID().toString(); + String fileName = UUID.randomUUID().toString(); InputStream inputStream = file.getInputStream(); ObjectWriteResponse objectWriteResponse = minioClient.putObject(PutObjectArgs.builder() .object(fileName.concat(".").concat(FileUtil.extName(file.getOriginalFilename()))) 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 26ff14f6..0028c25f 100644 --- a/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java +++ b/src/main/java/com/chint/manage/service/impl/ManageServiceImpl.java @@ -166,7 +166,7 @@ public class ManageServiceImpl implements ManageService { @Override public List orderDownloadRecordQuery() { User user=BaseContext.getCurrentUser(); - return jdbcOrderDownloadRecordRepository.findAllByEmployeeNoOrderByCreateTimeDesc(user.getEmployeeNo()); + return jdbcOrderDownloadRecordRepository.findAllByEmployeeNoOrderByIdDesc(user.getEmployeeNo()); } @Override