feat(wms): 添加根据钢卷ID查询发货关联信息功能

- 在 IWmsDeliveryWaybillDetailService 中新增 queryRelationByCoilId 方法
- 在 WmsDeliveryWaybillDetailController 中新增 /coilRelation/{coilId} 接口
- 在 WmsDeliveryWaybillDetailServiceImpl 中实现完整的关联查询逻辑
- 创建 WmsDeliveryCoilRelationVo 数据传输对象
- 支持查询发货单明细、发货单、发货计划和钢卷的完整关联信息
This commit is contained in:
2026-04-23 09:54:22 +08:00
parent a553b8ddc4
commit b840574286
4 changed files with 290 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import com.klp.domain.vo.WmsMaterialCoilBindVo; import com.klp.domain.vo.WmsMaterialCoilBindVo;
import com.klp.domain.vo.WmsDeliveryCoilRelationVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@@ -71,6 +72,17 @@ public class WmsDeliveryWaybillDetailController extends BaseController {
return R.ok(iWmsDeliveryWaybillDetailService.queryById(detailId)); return R.ok(iWmsDeliveryWaybillDetailService.queryById(detailId));
} }
/**
* 根据钢卷ID查询发货关联信息发货单明细+发货单+发货计划+钢卷信息)
*
* @param coilId 钢卷ID
*/
@GetMapping("/coilRelation/{coilId}")
public R<WmsDeliveryCoilRelationVo> getCoilRelation(@NotNull(message = "钢卷ID不能为空")
@PathVariable Long coilId) {
return R.ok(iWmsDeliveryWaybillDetailService.queryRelationByCoilId(coilId));
}
/** /**
* 新增发货单明细 * 新增发货单明细
*/ */

View File

@@ -0,0 +1,183 @@
package com.klp.domain.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
/**
* 根据钢卷ID查询发货关联信息VO
*
* @author klp
* @date 2025-11-25
*/
@Data
public class WmsDeliveryCoilRelationVo implements Serializable {
private static final long serialVersionUID = 1L;
// ==================== 发货单明细信息 ====================
/**
* 明细唯一ID
*/
private Long detailId;
/**
* 关联发货单主表ID
*/
private Long waybillId;
/**
* 关联钢卷表ID
*/
private Long coilId;
private String productName;
private String edgeType;
private String packaging;
private String settlementType;
private String rawMaterialFactory;
private String coilNo;
private String specification;
private String material;
private Long quantity;
private BigDecimal weight;
private BigDecimal unitPrice;
private String remark;
// ==================== 发货单信息 ====================
/**
* 发货单唯一ID
*/
private Long waybillId2;
/**
* 发货单编号
*/
private String waybillNo;
/**
* 发货单名称
*/
private String waybillName;
/**
* 关联发货计划ID
*/
private Long planId;
/**
* 车牌
*/
private String licensePlate;
/**
* 收货单位
*/
private String consigneeUnit;
/**
* 发货单位
*/
private String senderUnit;
/**
* 发货时间
*/
private Date deliveryTime;
/**
* 磅房
*/
private String weighbridge;
/**
* 销售
*/
private String salesPerson;
/**
* 负责人
*/
private String principal;
/**
* 负责人电话
*/
private String principalPhone;
/**
* 完成状态0=待发货1=已发货2=已完成3=取消)
*/
private Long status;
/**
* 发货单备注
*/
private String waybillRemark;
// ==================== 发货计划信息 ====================
/**
* 计划唯一ID
*/
private Long planId2;
/**
* 发货计划名称
*/
private String planName;
/**
* 计划日期
*/
private Date planDate;
/**
* 计划类型: 发货0收货1
*/
private Integer planType;
/**
* 计划备注
*/
private String planRemark;
/**
* 审核状态
*/
private Integer auditStatus;
/**
* 审核人
*/
private String auditBy;
/**
* 审核时间
*/
private Date auditTime;
// ==================== 钢卷信息 ====================
/**
* 入场钢卷号
*/
private String enterCoilNo;
/**
* 当前钢卷号
*/
private String currentCoilNo;
}

View File

@@ -2,6 +2,7 @@ package com.klp.service;
import com.klp.domain.WmsDeliveryWaybillDetail; import com.klp.domain.WmsDeliveryWaybillDetail;
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo; import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
import com.klp.domain.vo.WmsDeliveryCoilRelationVo;
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo; import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
import com.klp.common.core.page.TableDataInfo; import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery; import com.klp.common.core.domain.PageQuery;
@@ -23,6 +24,11 @@ public interface IWmsDeliveryWaybillDetailService {
*/ */
WmsDeliveryWaybillDetailVo queryById(Long detailId); WmsDeliveryWaybillDetailVo queryById(Long detailId);
/**
* 根据钢卷ID查询发货关联信息发货单明细+发货单+发货计划+钢卷信息)
*/
WmsDeliveryCoilRelationVo queryRelationByCoilId(Long coilId);
/** /**
* 查询发货单明细列表 * 查询发货单明细列表
*/ */

View File

@@ -8,15 +8,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.exception.ServiceException; import com.klp.common.exception.ServiceException;
import com.klp.common.utils.StringUtils; import com.klp.common.utils.StringUtils;
import com.klp.domain.WmsDeliveryPlan;
import com.klp.domain.WmsDeliveryWaybill; import com.klp.domain.WmsDeliveryWaybill;
import com.klp.domain.WmsDeliveryWaybillDetail; import com.klp.domain.WmsDeliveryWaybillDetail;
import com.klp.domain.WmsMaterialCoil; import com.klp.domain.WmsMaterialCoil;
import com.klp.mapper.WmsDeliveryPlanMapper;
import com.klp.mapper.WmsDeliveryWaybillDetailMapper; import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
import com.klp.mapper.WmsDeliveryWaybillMapper; import com.klp.mapper.WmsDeliveryWaybillMapper;
import com.klp.mapper.WmsMaterialCoilMapper; import com.klp.mapper.WmsMaterialCoilMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo; import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
import com.klp.domain.vo.WmsDeliveryCoilRelationVo;
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo; import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
import com.klp.domain.vo.WmsCoilBindInfoVo; import com.klp.domain.vo.WmsCoilBindInfoVo;
import com.klp.service.IWmsDeliveryWaybillDetailService; import com.klp.service.IWmsDeliveryWaybillDetailService;
@@ -40,6 +43,8 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
private final WmsMaterialCoilMapper wmsMaterialCoilMapper; private final WmsMaterialCoilMapper wmsMaterialCoilMapper;
private final WmsDeliveryPlanMapper wmsDeliveryPlanMapper;
/** /**
* 查询发货单明细 * 查询发货单明细
*/ */
@@ -48,6 +53,90 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
return baseMapper.selectVoById(detailId); return baseMapper.selectVoById(detailId);
} }
/**
* 根据钢卷ID查询发货关联信息发货单明细+发货单+发货计划+钢卷信息)
*/
@Override
public WmsDeliveryCoilRelationVo queryRelationByCoilId(Long coilId) {
if (coilId == null) {
return null;
}
// 查询发货单明细
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = Wrappers.lambdaQuery();
detailWrapper.eq(WmsDeliveryWaybillDetail::getCoilId, coilId);
detailWrapper.eq(WmsDeliveryWaybillDetail::getDelFlag, 0);
WmsDeliveryWaybillDetail detail = baseMapper.selectOne(detailWrapper);
if (detail == null) {
return null;
}
WmsDeliveryCoilRelationVo vo = new WmsDeliveryCoilRelationVo();
// 发货单明细信息
vo.setDetailId(detail.getDetailId());
vo.setWaybillId(detail.getWaybillId());
vo.setCoilId(detail.getCoilId());
vo.setProductName(detail.getProductName());
vo.setEdgeType(detail.getEdgeType());
vo.setPackaging(detail.getPackaging());
vo.setSettlementType(detail.getSettlementType());
vo.setRawMaterialFactory(detail.getRawMaterialFactory());
vo.setCoilNo(detail.getCoilNo());
vo.setSpecification(detail.getSpecification());
vo.setMaterial(detail.getMaterial());
vo.setQuantity(detail.getQuantity());
vo.setWeight(detail.getWeight());
vo.setUnitPrice(detail.getUnitPrice());
vo.setRemark(detail.getRemark());
if (detail.getWaybillId() != null) {
// 查询发货单信息
WmsDeliveryWaybill waybill = wmsDeliveryWaybillMapper.selectById(detail.getWaybillId());
if (waybill != null) {
vo.setWaybillId2(waybill.getWaybillId());
vo.setWaybillNo(waybill.getWaybillNo());
vo.setWaybillName(waybill.getWaybillName());
vo.setPlanId(waybill.getPlanId());
vo.setLicensePlate(waybill.getLicensePlate());
vo.setConsigneeUnit(waybill.getConsigneeUnit());
vo.setSenderUnit(waybill.getSenderUnit());
vo.setDeliveryTime(waybill.getDeliveryTime());
vo.setWeighbridge(waybill.getWeighbridge());
vo.setSalesPerson(waybill.getSalesPerson());
vo.setPrincipal(waybill.getPrincipal());
vo.setPrincipalPhone(waybill.getPrincipalPhone());
vo.setStatus(waybill.getStatus());
vo.setWaybillRemark(waybill.getRemark());
if (waybill.getPlanId() != null) {
// 查询发货计划信息
WmsDeliveryPlan plan = wmsDeliveryPlanMapper.selectById(waybill.getPlanId());
if (plan != null) {
vo.setPlanId2(plan.getPlanId());
vo.setPlanName(plan.getPlanName());
vo.setPlanDate(plan.getPlanDate());
vo.setPlanType(plan.getPlanType());
vo.setPlanRemark(plan.getRemark());
vo.setAuditStatus(plan.getAuditStatus());
vo.setAuditBy(plan.getAuditBy());
vo.setAuditTime(plan.getAuditTime());
}
}
}
}
// 查询钢卷信息
WmsMaterialCoil coil = wmsMaterialCoilMapper.selectById(coilId);
if (coil != null) {
vo.setEnterCoilNo(coil.getEnterCoilNo());
vo.setCurrentCoilNo(coil.getCurrentCoilNo());
}
return vo;
}
/** /**
* 查询发货单明细列表 * 查询发货单明细列表
*/ */