feat(wms): 添加发货单明细查询功能支持导出功能

- 在WmsDeliveryWaybillDetailMapper中新增VO查询方法
- 实现联查发货单、计划、钢卷信息的数据映射
- 更新WmsDeliveryWaybillDetailVo实体类字段结构
- 优化服务层查询逻辑并添加分页支持
- 配置MyBatis XML映射文件查询语句
- 整合多表关联数据展示完整业务信息
This commit is contained in:
2026-03-30 10:15:10 +08:00
parent 667c411997
commit cdf49ab8fe
4 changed files with 244 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
package com.klp.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.klp.common.annotation.ExcelDictFormat;
@@ -24,53 +25,135 @@ public class WmsDeliveryWaybillDetailVo extends BaseEntity {
/**
* 明细唯一ID
*/
@ExcelProperty(value = "明细唯一ID")
private Long detailId;
/**
* 关联发货单主表ID
*/
@ExcelProperty(value = "关联发货单主表ID")
private Long waybillId;
/**
* 关联钢卷表ID钢卷基础信息在钢卷表中
*/
@ExcelProperty(value = "关联钢卷表ID", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "钢=卷基础信息在钢卷表中")
private Long coilId;
/**
* 计划名称
*/
@ExcelProperty(value = "计划名称")
private String planName;
// ==================== 关联的发货单主表信息 ====================
/**
* 发货单号
*/
@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 String waybillStatus;
/**
* 发货单备注
*/
@ExcelProperty(value = "发货单备注")
private String waybillRemark;
// ==================== 关联的钢卷信息 ====================
/**
* 入场钢卷号
*/
@ExcelProperty(value = "入场钢卷号")
private String enterCoilNo;
/**
* 当前钢卷号
*/
@ExcelProperty(value = "当前钢卷号")
private String currentCoilNo;
// 实际库区
@ExcelProperty(value = "实际库区")
private String actualWarehouseName;
/**
* 品名(如:冷硬钢卷、冷轧钢卷)
*/
@ExcelProperty(value = "品名", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "如=:冷硬钢卷、冷轧钢卷")
@ExcelProperty(value = "品名")
private String productName;
/**
* 切边(净边/毛边)
*/
@ExcelProperty(value = "切边", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "净=边/毛边")
@ExcelProperty(value = "切边")
private String edgeType;
/**
* 包装(裸包/简包1/精包2等
*/
@ExcelProperty(value = "包装", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "裸=包/简包1/精包2等")
@ExcelProperty(value = "包装")
private String packaging;
/**
* 结算方式(卷重/磅重)
*/
@ExcelProperty(value = "结算方式", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "卷=重/磅重")
@ExcelProperty(value = "结算方式")
private String settlementType;
/**
@@ -100,15 +183,13 @@ public class WmsDeliveryWaybillDetailVo extends BaseEntity {
/**
* 数量(件)
*/
@ExcelProperty(value = "数量", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "件=")
@ExcelProperty(value = "数量")
private Long quantity;
/**
* 重量kg
*/
@ExcelProperty(value = "重量", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "k=g")
@ExcelProperty(value = "重量")
private BigDecimal weight;
/**
@@ -123,5 +204,17 @@ public class WmsDeliveryWaybillDetailVo extends BaseEntity {
@ExcelProperty(value = "备注")
private String remark;
// ==================== 关联的发货计划信息 ====================
/**
* 计划ID
*/
private Long planId;
/**
* 计划日期
*/
private Date planDate;
}

View File

@@ -1,9 +1,12 @@
package com.klp.mapper;
import com.klp.domain.WmsDeliveryWaybillDetail;
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
import com.klp.domain.vo.WmsCoilBindInfoVo;
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
import com.klp.common.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
@@ -26,4 +29,14 @@ public interface WmsDeliveryWaybillDetailMapper extends BaseMapperPlus<WmsDelive
* 按钢卷ID查询绑定来源信息明细->发货单->发货计划)
*/
WmsCoilBindInfoVo selectBindInfoByCoilId(@Param("coilId") Long coilId);
/**
* 查询发货单明细列表(联查发货单、计划、钢卷信息)
*/
List<WmsDeliveryWaybillDetailVo> selectDetailVoList(@Param("bo") WmsDeliveryWaybillDetailBo bo);
/**
* 分页查询发货单明细列表(联查发货单、计划、钢卷信息)
*/
IPage<WmsDeliveryWaybillDetailVo> selectDetailVoPage(Page<WmsDeliveryWaybillDetailVo> page, @Param("bo") WmsDeliveryWaybillDetailBo bo);
}

View File

@@ -6,19 +6,19 @@ import com.klp.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import com.klp.common.exception.ServiceException;
import com.klp.common.utils.StringUtils;
import com.klp.domain.WmsDeliveryWaybill;
import com.klp.domain.WmsDeliveryWaybillDetail;
import com.klp.domain.WmsMaterialCoil;
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
import com.klp.mapper.WmsDeliveryWaybillMapper;
import com.klp.mapper.WmsMaterialCoilMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
import com.klp.domain.WmsDeliveryWaybillDetail;
import com.klp.domain.vo.WmsCoilBindInfoVo;
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
import com.klp.mapper.WmsMaterialCoilMapper;
import com.klp.service.IWmsDeliveryWaybillDetailService;
import java.util.List;
@@ -78,8 +78,7 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
*/
@Override
public List<WmsDeliveryWaybillDetailVo> queryList(WmsDeliveryWaybillDetailBo bo) {
LambdaQueryWrapper<WmsDeliveryWaybillDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
return baseMapper.selectDetailVoList(bo);
}
private LambdaQueryWrapper<WmsDeliveryWaybillDetail> buildQueryWrapper(WmsDeliveryWaybillDetailBo bo) {
@@ -100,7 +99,6 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
lqw.eq(bo.getUnitPrice() != null, WmsDeliveryWaybillDetail::getUnitPrice, bo.getUnitPrice());
return lqw;
}
/**
* 新增发货单明细
*/