feat(wms/delivery): 新增根据发货计划ID查询已绑定钢卷功能,优化钢卷查询备注匹配

1. 在发货计划明细服务层新增getBoundCoilIdsByPlanId接口,支持根据计划ID和时间段筛选已绑定的钢卷ID列表
2. 在发货计划明细控制器中扩展已绑定钢卷查询接口,新增planId参数,优先按计划ID查询,兼容原有时间段查询逻辑
3. 在钢卷服务实现中为钢卷查询条件增加remark字段的模糊匹配支持,提升查询灵活性
This commit is contained in:
2026-05-29 14:01:44 +08:00
parent 1b65444ab3
commit 6f488c74fc
4 changed files with 44 additions and 4 deletions

View File

@@ -134,9 +134,12 @@ public class WmsDeliveryWaybillDetailController extends BaseController {
WmsMaterialCoilBo bo,
PageQuery pageQuery,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime,
@RequestParam(required = false) Long planId) {
List<Long> boundCoilIds;
if (startTime != null || endTime != null) {
if (planId != null) {
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIdsByPlanId(planId, startTime, endTime);
} else if (startTime != null || endTime != null) {
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIdsByTimeRange(startTime, endTime);
} else {
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIds();
@@ -157,9 +160,12 @@ public class WmsDeliveryWaybillDetailController extends BaseController {
public R<java.util.Map<String, java.math.BigDecimal>> getStatistics(
WmsMaterialCoilBo bo,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime,
@RequestParam(required = false) Long planId) {
List<Long> boundCoilIds;
if (startTime != null || endTime != null) {
if (planId != null) {
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIdsByPlanId(planId, startTime, endTime);
} else if (startTime != null || endTime != null) {
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIdsByTimeRange(startTime, endTime);
} else {
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIds();

View File

@@ -73,4 +73,9 @@ public interface IWmsDeliveryWaybillDetailService {
* 根据负责人(principal)查询已绑定的钢卷ID列表
*/
List<Long> getBoundCoilIdsByPrincipal(String principal);
/**
* 根据发货计划ID查询已绑定的钢卷ID列表可结合时间段筛选
*/
List<Long> getBoundCoilIdsByPlanId(Long planId, Date startTime, Date endTime);
}

View File

@@ -338,6 +338,33 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
return list.stream().map(WmsDeliveryWaybillDetail::getCoilId).distinct().collect(Collectors.toList());
}
@Override
public List<Long> getBoundCoilIdsByPlanId(Long planId, Date startTime, Date endTime) {
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = Wrappers.lambdaQuery();
waybillWrapper.eq(WmsDeliveryWaybill::getPlanId, planId);
waybillWrapper.eq(WmsDeliveryWaybill::getDelFlag, 0);
if (startTime != null) {
waybillWrapper.ge(WmsDeliveryWaybill::getDeliveryTime, startTime);
}
if (endTime != null) {
waybillWrapper.le(WmsDeliveryWaybill::getDeliveryTime, endTime);
}
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
if (waybills == null || waybills.isEmpty()) {
return Collections.emptyList();
}
List<Long> waybillIds = waybills.stream().map(WmsDeliveryWaybill::getWaybillId).collect(Collectors.toList());
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = Wrappers.lambdaQuery();
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
detailWrapper.isNotNull(WmsDeliveryWaybillDetail::getCoilId);
detailWrapper.eq(WmsDeliveryWaybillDetail::getDelFlag, 0);
detailWrapper.select(WmsDeliveryWaybillDetail::getCoilId);
List<WmsDeliveryWaybillDetail> list = baseMapper.selectList(detailWrapper);
return list.stream().map(WmsDeliveryWaybillDetail::getCoilId).distinct().collect(Collectors.toList());
}
@Override
public List<Long> getBoundCoilIdsByPrincipal(String principal) {
if (principal == null || principal.trim().isEmpty()) {

View File

@@ -630,6 +630,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
qw.eq(StringUtils.isNotBlank(bo.getBusinessPurpose()), "mc.business_purpose", bo.getBusinessPurpose());
// 是否与订单相关0=否1=是)
qw.eq(bo.getIsRelatedToOrder() != null, "mc.is_related_to_order", bo.getIsRelatedToOrder());
// 加上remark的模糊匹配
qw.like(StringUtils.isNotBlank(bo.getRemark()), "mc.remark", bo.getRemark());
//逻辑删除
qw.eq("mc.del_flag", 0);
// 统一处理 warehouseId 与 warehouseIds