From d37a342d6b4ebe95fa9fb9af3891408047deb68e Mon Sep 17 00:00:00 2001 From: nixj Date: Wed, 3 Jul 2024 08:20:59 +0800 Subject: [PATCH] =?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