feat(lease): 新增仓库出租率及客户租赁明细导出功能
- 新增 WarehouseLeaseExportVO(10列:仓库/业务日期/整租面积/散租面积/总面积/日租率/组织/货主/租赁方式/租赁面积) - LeaseApplicationService 新增 exportOccupancyRate 方法,复用出租率与明细查询,按日期+仓库映射拼接汇总列 - ShipperLeaseDetailsApi 新增 GET /export 接口,入参与查询接口一致,使用项目通用 ExcelUtil 导出 - 业务日期按降序排序,日期格式 yyyy-MM-dd 对应需求:仓库出租率 - 增加导出功能(出租率+客户租赁明细)
This commit is contained in:
+65
@@ -0,0 +1,65 @@
|
||||
package com.mhd.basic.interfaces.dto.shipperLeaseDetailsApi;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 仓库出租率及客户租赁明细 导出VO(单 sheet)
|
||||
* 明细为主行,附该仓库当日汇总列
|
||||
*/
|
||||
@Data
|
||||
public class WarehouseLeaseExportVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("仓库")
|
||||
@Excel(name = "仓库")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("业务日期")
|
||||
@Excel(name = "业务日期", width = 20, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date businessDate;
|
||||
|
||||
@ApiModelProperty("整租面积(m²)")
|
||||
@Excel(name = "整租面积(m²)")
|
||||
private BigDecimal entireLeaseArea;
|
||||
|
||||
@ApiModelProperty("散租面积(m²)")
|
||||
@Excel(name = "散租面积(m²)")
|
||||
private BigDecimal fractionalLeaseArea;
|
||||
|
||||
@ApiModelProperty("总面积(m²)")
|
||||
@Excel(name = "总面积(m²)")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("日租率(%)")
|
||||
@Excel(name = "日租率(%)")
|
||||
private BigDecimal dailyRentalRate;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String cargoOwnerName;
|
||||
|
||||
@ApiModelProperty("租赁方式")
|
||||
@Excel(name = "租赁方式")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty("租赁面积(m²)")
|
||||
@Excel(name = "租赁面积(m²)")
|
||||
private BigDecimal leaseArea;
|
||||
|
||||
// ===== 以下为仓库当日汇总列(同一仓库同一天的多行会重复,属正常)=====
|
||||
|
||||
}
|
||||
+14
@@ -20,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -157,5 +159,17 @@ public class ShipperLeaseDetailsApi extends BaseController{
|
||||
return getDataTable(warehouseOccupancyRates);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出仓库出租率及客户租赁明细
|
||||
* 参数与 /warehouseOccupancyRate、/list 一致
|
||||
*/
|
||||
@ApiOperation("导出仓库出租率及客户租赁明细")
|
||||
@GetMapping(value = "/export", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
public void export(ShipperLeaseDetailsDTO shipperLeaseDetailsDTO, HttpServletResponse response) throws IOException
|
||||
{
|
||||
ShipperLeaseDetailsDO shipperLeaseDetailsDO = shipperLeaseDetailsAssembler.toDO(shipperLeaseDetailsDTO);
|
||||
leaseApplicationService.exportOccupancyRate(response, shipperLeaseDetailsDO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user