feat(wms): 添加钢卷发货报表导出功能
- 新增 WmsMaterialCoilDeliveryExportVo 类用于发货报表数据导出 - 在 IWmsMaterialCoilService 中添加 queryDeliveryExportList 方法 - 在 WmsMaterialCoilController 中添加 exportDelivery 接口支持发货报表导出 - 在 WmsMaterialCoilMapper 中添加 selectDeliveryExportListByCoilIds 查询方法 - 实现按 coilIds 联查发货单明细/主表/发货计划的数据导出功能 - 支持通过 POST 请求体传递 coilIds 参数避免 URL 长度限制
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import com.klp.common.core.domain.AjaxResult;
|
||||
import com.klp.domain.vo.WmsMaterialCoilExportVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilDeliveryExportVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -58,6 +59,17 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "钢卷物料表", WmsMaterialCoilExportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出发货报表(按 coilIds,联查发货单明细/主表/发货计划)
|
||||
* 前端仍使用 POST 传参(建议在 body 中传 coilIds,避免 URL 限制)
|
||||
*/
|
||||
@Log(title = "钢卷物料表-发货报表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportDelivery")
|
||||
public void exportDelivery(@RequestBody WmsMaterialCoilBo bo, HttpServletResponse response) {
|
||||
List<WmsMaterialCoilDeliveryExportVo> list = iWmsMaterialCoilService.queryDeliveryExportList(bo);
|
||||
ExcelUtil.exportExcel(list, "发货报表", WmsMaterialCoilDeliveryExportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询钢卷物料表列表(POST请求,支持大量coilIds查询)
|
||||
* 功能与GET /list相同,但使用POST请求体传递参数,避免URL长度限制
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 发货报表导出VO(钢卷导出字段 + 发货单明细/主表/计划字段)
|
||||
*
|
||||
* 说明:
|
||||
* - 继承 {@link WmsMaterialCoilExportVo} 以复用现有钢卷导出字段与接口逻辑
|
||||
* - 追加发货相关字段,满足“按 coilIds 导出发货报表”的需求
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsMaterialCoilDeliveryExportVo extends WmsMaterialCoilExportVo {
|
||||
|
||||
/**
|
||||
* 钢卷ID(用于对账/追溯)
|
||||
*/
|
||||
private Long coilId;
|
||||
|
||||
// -------------------- 发货计划(plan) --------------------
|
||||
private Long planId;
|
||||
|
||||
@ExcelProperty(value = "发货计划名称")
|
||||
private String planName;
|
||||
|
||||
@ExcelProperty(value = "计划日期")
|
||||
private Date planDate;
|
||||
|
||||
// -------------------- 发货单主表(waybill) --------------------
|
||||
private Long waybillId;
|
||||
|
||||
@ExcelProperty(value = "发货单编号")
|
||||
private String waybillNo;
|
||||
|
||||
@ExcelProperty(value = "发货单名称")
|
||||
private String waybillName;
|
||||
|
||||
@ExcelProperty(value = "车牌")
|
||||
private String licensePlate;
|
||||
|
||||
@ExcelProperty(value = "收货单位")
|
||||
private String consigneeUnit;
|
||||
|
||||
@ExcelProperty(value = "发货单位")
|
||||
private String senderUnit;
|
||||
|
||||
@ExcelProperty(value = "发货时间")
|
||||
private Date deliveryTime;
|
||||
|
||||
@ExcelProperty(value = "磅房")
|
||||
private String weighbridge;
|
||||
|
||||
@ExcelProperty(value = "销售")
|
||||
private String salesPerson;
|
||||
|
||||
@ExcelProperty(value = "负责人")
|
||||
private String principal;
|
||||
|
||||
@ExcelProperty(value = "负责人电话")
|
||||
private String principalPhone;
|
||||
|
||||
@ExcelProperty(value = "发货单状态")
|
||||
private Long waybillStatus;
|
||||
|
||||
@ExcelProperty(value = "发货单备注")
|
||||
private String waybillRemark;
|
||||
|
||||
// // -------------------- 发货单明细(detail) --------------------
|
||||
// private Long detailId;
|
||||
//
|
||||
// @ExcelProperty(value = "明细品名")
|
||||
// private String detailProductName;
|
||||
//
|
||||
// @ExcelProperty(value = "明细切边")
|
||||
// private String detailEdgeType;
|
||||
//
|
||||
// @ExcelProperty(value = "明细包装")
|
||||
// private String detailPackaging;
|
||||
//
|
||||
@ExcelProperty(value = "明细结算方式")
|
||||
private String detailSettlementType;
|
||||
//
|
||||
// @ExcelProperty(value = "明细原料厂家")
|
||||
// private String detailRawMaterialFactory;
|
||||
//
|
||||
// @ExcelProperty(value = "明细卷号")
|
||||
// private String detailCoilNo;
|
||||
//
|
||||
// @ExcelProperty(value = "明细规格")
|
||||
// private String detailSpecification;
|
||||
//
|
||||
// @ExcelProperty(value = "明细材质")
|
||||
// private String detailMaterial;
|
||||
//
|
||||
// @ExcelProperty(value = "明细数量")
|
||||
// private Long detailQuantity;
|
||||
//
|
||||
// @ExcelProperty(value = "明细重量")
|
||||
// private BigDecimal detailWeight;
|
||||
//
|
||||
@ExcelProperty(value = "明细单价")
|
||||
private BigDecimal detailUnitPrice;
|
||||
//
|
||||
// @ExcelProperty(value = "明细备注")
|
||||
// private String detailRemark;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsMaterialCoil;
|
||||
import com.klp.domain.vo.WmsMaterialCoilDeliveryExportVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -77,5 +78,13 @@ public interface WmsMaterialCoilMapper extends BaseMapperPlus<WmsMaterialCoilMap
|
||||
*/
|
||||
int updateForWithdrawExport(@Param("coilId") Long coilId, @Param("status") Integer status);
|
||||
|
||||
|
||||
/**
|
||||
* 发货报表导出:按钢卷ID列表联查(钢卷 + 发货单明细 + 发货单主表 + 发货计划)
|
||||
*
|
||||
* @param coilIds 钢卷ID集合
|
||||
* @return 发货报表导出数据
|
||||
*/
|
||||
List<WmsMaterialCoilDeliveryExportVo> selectDeliveryExportListByCoilIds(@Param("coilIds") java.util.Collection<Long> coilIds);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.domain.vo.WmsMaterialCoilDeliveryExportVo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
@@ -99,6 +100,14 @@ public interface IWmsMaterialCoilService {
|
||||
*/
|
||||
List<com.klp.domain.vo.WmsMaterialCoilExportVo> queryExportList(WmsMaterialCoilBo bo);
|
||||
|
||||
/**
|
||||
* 发货报表导出数据列表(按 coilIds)
|
||||
*
|
||||
* @param bo 查询条件(前端通过 POST 传 coilIds)
|
||||
* @return 发货报表导出数据列表
|
||||
*/
|
||||
List<WmsMaterialCoilDeliveryExportVo> queryDeliveryExportList(WmsMaterialCoilBo bo);
|
||||
|
||||
int exportCoil(@NotEmpty(message = "主键不能为空") Long coilId);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user