【add】新增报表导出为空判断,行程单'-'处理,超标报表新增SF工号查询条件
This commit is contained in:
parent
a3fc44e83e
commit
9e8807c19f
|
@ -1,5 +1,6 @@
|
|||
package com.chint.manage.entity.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -30,5 +31,7 @@ public class OrderExceedStandardExcel extends BaseExcel{
|
|||
private String approvalStatus;
|
||||
@ExcelProperty("超标金额")
|
||||
private BigDecimal standardAmount;
|
||||
@ExcelIgnore
|
||||
private String employeeNo;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.chint.manage.entity.query;
|
|||
|
||||
import com.chint.domain.value_object.BaseQuery;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import com.chint.manage.util.BaseUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -13,4 +14,9 @@ public class ItineraryPageQuery extends BaseQuery {
|
|||
private String actualOrderNo=""; //申请单号
|
||||
private List<String> userIds=new ArrayList<>();
|
||||
private List<Long> routeIds;
|
||||
|
||||
|
||||
public String getActualOrderNo() {
|
||||
return BaseUtil.extractAfterDash(actualOrderNo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,4 +9,5 @@ public class StandardQuery extends BaseQuery {
|
|||
private String companyName=""; // 出差公司
|
||||
private String orderNo=""; //订单号
|
||||
private String actualOrderNo=""; //申请单号
|
||||
private String employeeNo=""; //SF工号
|
||||
}
|
||||
|
|
|
@ -18,5 +18,5 @@ public interface JdbcOrderExceedStandardRepository extends CrudRepository<OrderE
|
|||
@Query("UPDATE order_exceed_standard SET approval_status = :status WHERE order_no = :orderNo")
|
||||
void updateApprovalStatusById(@Param("status") String status, @Param("orderNo") String orderNo);
|
||||
|
||||
Page<OrderExceedStandard> findAllByApplicantContainsAndCompanyNameContainsAndActualOrderNoContainsAndOrderNoContainsAndOrderNoIn(String applicant, String company, String actualOrderNo, String orderNo, List<String> orderNos, Pageable pageable);
|
||||
Page<OrderExceedStandard> findAllByApplicantContainsAndCompanyNameContainsAndActualOrderNoContainsAndOrderNoContainsAndEmployeeNoContainsAndOrderNoIn(String applicant, String company, String actualOrderNo, String orderNo,String employeeNo, List<String> orderNos, Pageable pageable);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.chint.manage.service.impl;
|
|||
import com.chint.application.dtos.response.LocationRes;
|
||||
import com.chint.domain.aggregates.order.*;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
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;
|
||||
|
@ -87,7 +88,11 @@ public class ManageServiceImpl implements ManageService {
|
|||
|
||||
@Override
|
||||
public File saveConsumptionDetail(ConsumptionDetailQuery dto) {
|
||||
return ExcelUtil.exportReport(jdbcConsumptionDetailRepository.pageConsumptionDetail(dto).getRecords());
|
||||
List<? extends BaseExcel> records=jdbcConsumptionDetailRepository.pageConsumptionDetail(dto).getRecords();
|
||||
if (records.isEmpty()){
|
||||
throw new CommandException("导出数据为空");
|
||||
}
|
||||
return ExcelUtil.exportReport(records);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -100,10 +105,11 @@ public class ManageServiceImpl implements ManageService {
|
|||
|
||||
PageRequest pageRequest = PageRequest
|
||||
.of(dto.getPageNum() - 1, dto.getPageSize(), Sort.by("id").descending());
|
||||
Page<OrderExceedStandard> page=jdbcOrderExceedStandardRepository.findAllByApplicantContainsAndCompanyNameContainsAndActualOrderNoContainsAndOrderNoContainsAndOrderNoIn(dto.getApplicant(),
|
||||
Page<OrderExceedStandard> page=jdbcOrderExceedStandardRepository.findAllByApplicantContainsAndCompanyNameContainsAndActualOrderNoContainsAndOrderNoContainsAndEmployeeNoContainsAndOrderNoIn(dto.getApplicant(),
|
||||
dto.getCompanyName(),
|
||||
dto.getActualOrderNo(),
|
||||
dto.getOrderNo(),
|
||||
dto.getEmployeeNo(),
|
||||
orderNos,
|
||||
pageRequest);
|
||||
|
||||
|
@ -113,7 +119,11 @@ public class ManageServiceImpl implements ManageService {
|
|||
|
||||
@Override
|
||||
public File standardExport(StandardQuery dto) {
|
||||
return ExcelUtil.exportReport(standardQuery(dto).getRecords());
|
||||
List<OrderExceedStandardExcel> records=standardQuery(dto).getRecords();
|
||||
if (records.isEmpty()){
|
||||
throw new CommandException("导出数据为空");
|
||||
}
|
||||
return ExcelUtil.exportReport(records);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -284,6 +294,10 @@ public class ManageServiceImpl implements ManageService {
|
|||
|
||||
@Override
|
||||
public File orderExport(OrderPageQuery dto) {
|
||||
List<OrderPageExcel> records=orderPageQuery(dto).getRecords();
|
||||
if (records.isEmpty()){
|
||||
throw new CommandException("导出数据为空");
|
||||
}
|
||||
return ExcelUtil.exportReport(orderPageQuery(dto).getRecords());
|
||||
}
|
||||
|
||||
|
|
|
@ -45,4 +45,19 @@ public class BaseUtil {
|
|||
return jdbcOrderDetailRepository.findAllByRouteIdIn(routeIds).stream().map(OrderDetail::getOrderNo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理行程单
|
||||
*/
|
||||
|
||||
public static String extractAfterDash(String input) {
|
||||
if(input==null){
|
||||
return null;
|
||||
}
|
||||
int index = input.indexOf('-');
|
||||
if (index != -1) {
|
||||
return input.substring(index + 1);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue