Merge branch 'fix:后台管理功能20240702' of https://devops.chint.com/chint/Chint.Source.Code/_git/Chint.Route.Api into dev
This commit is contained in:
commit
7415086850
|
@ -15,7 +15,7 @@ public class ANExceedStandardDto {
|
||||||
private String applicant;//申请人
|
private String applicant;//申请人
|
||||||
private String applyNo;//差旅申请单号
|
private String applyNo;//差旅申请单号
|
||||||
private String orderNo;//商旅订单号
|
private String orderNo;//商旅订单号
|
||||||
private String orderType;//超标原因
|
private String orderType;//超标类型
|
||||||
private String orderSource;//订单来源
|
private String orderSource;//订单来源
|
||||||
private String legNo;//行程ID
|
private String legNo;//行程ID
|
||||||
private String startPlace;//出发地
|
private String startPlace;//出发地
|
||||||
|
|
|
@ -28,6 +28,8 @@ public class ItineraryPageDto {
|
||||||
// private List<ApprovalEvent> approveEvents;
|
// private List<ApprovalEvent> approveEvents;
|
||||||
|
|
||||||
private String approvalStatus;
|
private String approvalStatus;
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
//差旅订单总价值
|
//差旅订单总价值
|
||||||
private List<LocationRes> locationResList;
|
private List<LocationRes> locationResList;
|
||||||
|
|
|
@ -37,9 +37,12 @@ public class CarOrderDetailExcel extends BaseExcel{
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
public String getOrderStatus() {
|
public String getOrderStatus() {
|
||||||
|
if (orderStatus==null){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return switch (orderStatus) {
|
return switch (orderStatus) {
|
||||||
case "0" -> "取消";
|
case "0" -> "取消";
|
||||||
case "1" -> "出票成功";
|
case "1" -> "行程结束";
|
||||||
case "2" -> "改签成功";
|
case "2" -> "改签成功";
|
||||||
case "3" -> "退票成功";
|
case "3" -> "退票成功";
|
||||||
default -> orderStatus;
|
default -> orderStatus;
|
||||||
|
|
|
@ -36,9 +36,12 @@ public class FlightOrderDetailExcel extends BaseExcel{
|
||||||
|
|
||||||
|
|
||||||
public String getOrderStatus() {
|
public String getOrderStatus() {
|
||||||
|
if (orderStatus==null){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return switch (orderStatus) {
|
return switch (orderStatus) {
|
||||||
case "0" -> "取消";
|
case "0" -> "取消";
|
||||||
case "1" -> "出票成功";
|
case "1" -> "行程结束";
|
||||||
case "2" -> "改签成功";
|
case "2" -> "改签成功";
|
||||||
case "3" -> "退票成功";
|
case "3" -> "退票成功";
|
||||||
default -> orderStatus;
|
default -> orderStatus;
|
||||||
|
|
|
@ -2,9 +2,11 @@ package com.chint.manage.entity.excel;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -33,5 +35,14 @@ public class OrderExceedStandardExcel extends BaseExcel{
|
||||||
private BigDecimal standardAmount;
|
private BigDecimal standardAmount;
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String employeeNo;
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,12 @@ public class TrainOrderDetailExcel extends BaseExcel{
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
public String getOrderStatus() {
|
public String getOrderStatus() {
|
||||||
|
if (orderStatus==null){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
return switch (orderStatus) {
|
return switch (orderStatus) {
|
||||||
case "0" -> "取消";
|
case "0" -> "取消";
|
||||||
case "1" -> "出票成功";
|
case "1" -> "行程结束";
|
||||||
case "2" -> "改签成功";
|
case "2" -> "改签成功";
|
||||||
case "3" -> "退票成功";
|
case "3" -> "退票成功";
|
||||||
default -> orderStatus;
|
default -> orderStatus;
|
||||||
|
|
|
@ -36,7 +36,7 @@ public interface JdbcOrderDetailBasicRepository extends CrudRepository<OrderDeta
|
||||||
List<Long> findAllOrderId();
|
List<Long> 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 "+
|
"LEFT JOIN route_order_extension_field roef ON roef.route_id=od.route_id "+
|
||||||
"WHERE (roef.company_code IN (:#{#dto.companyCodes})) " +
|
"WHERE (roef.company_code IN (:#{#dto.companyCodes})) " +
|
||||||
"AND (:#{#dto.routeIdsEmpty} = TRUE OR roef.route_id IN (:#{#dto.routeIds})) " +
|
"AND (:#{#dto.routeIdsEmpty} = TRUE OR roef.route_id IN (:#{#dto.routeIds})) " +
|
||||||
|
@ -45,7 +45,7 @@ public interface JdbcOrderDetailBasicRepository extends CrudRepository<OrderDeta
|
||||||
"AND (:#{#dto.productType} ='' OR od.product_type = :#{#dto.productType}) " +
|
"AND (:#{#dto.productType} ='' OR od.product_type = :#{#dto.productType}) " +
|
||||||
"AND (:#{#dto.employeeNo} ='' OR od.employee_no = :#{#dto.employeeNo}) " +
|
"AND (:#{#dto.employeeNo} ='' OR od.employee_no = :#{#dto.employeeNo}) " +
|
||||||
"AND (:#{#dto.employeeNosEmpty} = TRUE OR od.employee_no IN (:#{#dto.employeeNos})) " +
|
"AND (:#{#dto.employeeNosEmpty} = TRUE OR od.employee_no IN (:#{#dto.employeeNos})) " +
|
||||||
"LIMIT :#{#pageRequest.pageSize} OFFSET :#{#pageRequest.pageNumber}")
|
"ORDER BY order_date DESC LIMIT :#{#pageRequest.pageSize} OFFSET :#{#pageRequest.pageNumber}")
|
||||||
List<OrderDetailBasic> listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest") PageRequest pageRequest);
|
List<OrderDetailBasic> listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest") PageRequest pageRequest);
|
||||||
|
|
||||||
@Query("SELECT COUNT(*) FROM order_detail od " +
|
@Query("SELECT COUNT(*) FROM order_detail od " +
|
||||||
|
|
|
@ -59,14 +59,14 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
PageRequest pageRequest = PageRequest
|
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("actualOrderNo", dto.getActualOrderNo());
|
||||||
params.put("userIds", dto.getUserIds());
|
params.put("userIds", dto.getUserIds());
|
||||||
params.put("companyCodes", dto.getCompanyCodes());
|
params.put("companyCodes", dto.getCompanyCodes());
|
||||||
params.put("offset", pageRequest.getOffset());
|
params.put("offset", pageRequest.getOffset());
|
||||||
params.put("limit", pageRequest.getPageSize());
|
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<ItineraryPageDto> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(ItineraryPageDto.class));
|
List<ItineraryPageDto> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(ItineraryPageDto.class));
|
||||||
|
|
||||||
String countQuery = "SELECT COUNT(*) FROM route_order ro " + query;
|
String countQuery = "SELECT COUNT(*) FROM route_order ro " + query;
|
||||||
|
@ -112,11 +112,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
PageRequest pageRequest = PageRequest
|
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);
|
query = getString(dto, query, params, pageRequest);
|
||||||
|
|
||||||
String pagedQuery = "SELECT * FROM train_order_detail tod "
|
String pagedQuery = "SELECT tod.* FROM train_order_detail tod "
|
||||||
+ query + " LIMIT :limit OFFSET :offset";
|
+ query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset";
|
||||||
List<TrainOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(TrainOrderDetailExcel.class));
|
List<TrainOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(TrainOrderDetailExcel.class));
|
||||||
|
|
||||||
String countQuery = "SELECT COUNT(*) FROM train_order_detail tod " + query;
|
String countQuery = "SELECT COUNT(*) FROM train_order_detail tod " + query;
|
||||||
|
@ -131,11 +131,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
PageRequest pageRequest = PageRequest
|
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);
|
query = getString(dto, query, params, pageRequest);
|
||||||
|
|
||||||
String pagedQuery = "SELECT * FROM flight_order_detail tod "
|
String pagedQuery = "SELECT tod.* FROM flight_order_detail tod "
|
||||||
+ query + " LIMIT :limit OFFSET :offset";
|
+ query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset";
|
||||||
List<FlightOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(FlightOrderDetailExcel.class));
|
List<FlightOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(FlightOrderDetailExcel.class));
|
||||||
|
|
||||||
String countQuery = "SELECT COUNT(*) FROM flight_order_detail tod " + query;
|
String countQuery = "SELECT COUNT(*) FROM flight_order_detail tod " + query;
|
||||||
|
@ -150,11 +150,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
PageRequest pageRequest = PageRequest
|
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);
|
query = getString(dto, query, params, pageRequest);
|
||||||
|
|
||||||
String pagedQuery = "SELECT * FROM hotel_order_detail tod "
|
String pagedQuery = "SELECT tod.* FROM hotel_order_detail tod "
|
||||||
+ query + " LIMIT :limit OFFSET :offset";
|
+ query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset";
|
||||||
List<HotelOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(HotelOrderDetailExcel.class));
|
List<HotelOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(HotelOrderDetailExcel.class));
|
||||||
|
|
||||||
String countQuery = "SELECT COUNT(*) FROM hotel_order_detail tod " + query;
|
String countQuery = "SELECT COUNT(*) FROM hotel_order_detail tod " + query;
|
||||||
|
@ -169,12 +169,12 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
PageRequest pageRequest = PageRequest
|
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);
|
query = getString(dto, query, params, pageRequest);
|
||||||
|
|
||||||
String pagedQuery = "SELECT * FROM car_order_detail tod "
|
String pagedQuery = "SELECT tod.* FROM car_order_detail tod "
|
||||||
+ query + " LIMIT :limit OFFSET :offset";
|
+ query + " ORDER BY tod.create_time DESC LIMIT :limit OFFSET :offset";
|
||||||
List<CarOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(CarOrderDetailExcel.class));
|
List<CarOrderDetailExcel> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(CarOrderDetailExcel.class));
|
||||||
|
|
||||||
String countQuery = "SELECT COUNT(*) FROM car_order_detail tod " + query;
|
String countQuery = "SELECT COUNT(*) FROM car_order_detail tod " + query;
|
||||||
|
|
|
@ -46,14 +46,17 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dto.getOrderNo().isEmpty()) {
|
if (!dto.getOrderNo().isEmpty()) {
|
||||||
|
dto.setOrderNo(dto.getOrderNo()+"%");
|
||||||
query+="AND oes.order_no LIKE (:orderNo) ";
|
query+="AND oes.order_no LIKE (:orderNo) ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dto.getActualOrderNo().isEmpty()) {
|
if (!dto.getActualOrderNo().isEmpty()) {
|
||||||
|
dto.setActualOrderNo(dto.getActualOrderNo()+"%");
|
||||||
query+="AND oes.actual_order_no LIKE (:actualOrderNo) ";
|
query+="AND oes.actual_order_no LIKE (:actualOrderNo) ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dto.getCompanyName().isEmpty()) {
|
if (!dto.getCompanyName().isEmpty()) {
|
||||||
|
dto.setCompanyName(dto.getCompanyName()+"%");
|
||||||
query+="AND oes.company_name LIKE (:companyName) ";
|
query+="AND oes.company_name LIKE (:companyName) ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +66,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
PageRequest pageRequest = PageRequest
|
PageRequest pageRequest = PageRequest
|
||||||
.of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id").descending());
|
.of(dto.getPageNum() - 1, dto.getPageSize());
|
||||||
params.put("actualOrderNo", dto.getActualOrderNo());
|
params.put("actualOrderNo", dto.getActualOrderNo());
|
||||||
params.put("applicant", dto.getApplicant());
|
params.put("applicant", dto.getApplicant());
|
||||||
params.put("companyName", dto.getCompanyName());
|
params.put("companyName", dto.getCompanyName());
|
||||||
|
@ -72,7 +75,7 @@ public class ManageOrderDetailRepositoryImpl implements ManageOrderDetailReposit
|
||||||
params.put("offset", pageRequest.getOffset());
|
params.put("offset", pageRequest.getOffset());
|
||||||
params.put("limit", pageRequest.getPageSize());
|
params.put("limit", pageRequest.getPageSize());
|
||||||
|
|
||||||
String pagedQuery ="SELECT * FROM order_exceed_standard oes "+ query + " 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<OrderExceedStandard> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(OrderExceedStandard.class));
|
List<OrderExceedStandard> results = jdbcTemplate.query(pagedQuery, params, BeanPropertyRowMapper.newInstance(OrderExceedStandard.class));
|
||||||
|
|
||||||
String countSql="SELECT COUNT(*) AS count FROM order_exceed_standard oes " + query ;
|
String countSql="SELECT COUNT(*) AS count FROM order_exceed_standard oes " + query ;
|
||||||
|
|
|
@ -106,19 +106,6 @@ public class ManageServiceImpl implements ManageService {
|
||||||
}
|
}
|
||||||
dto.setCompanyCods(companyCods);
|
dto.setCompanyCods(companyCods);
|
||||||
Page<OrderExceedStandard> page=manageOrderDetailRepository.OrderExceedStandard(dto);
|
Page<OrderExceedStandard> page=manageOrderDetailRepository.OrderExceedStandard(dto);
|
||||||
List<OrderExceedStandard> content = page.getContent();
|
|
||||||
Set<String> employees=new HashSet<>();
|
|
||||||
for (OrderExceedStandard orderExceedStandard : content) {
|
|
||||||
employees.add(orderExceedStandard.getEmployeeNo());
|
|
||||||
}
|
|
||||||
List<UserBasic> 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<OrderExceedStandardExcel> excelList = getOrderExceedStandardExcels(page);
|
List<OrderExceedStandardExcel> excelList = getOrderExceedStandardExcels(page);
|
||||||
return PageResult.totalPageNum(page.getTotalElements(), excelList);
|
return PageResult.totalPageNum(page.getTotalElements(), excelList);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue