feat(delivery): 添加按负责人查询已绑定钢卷功能

- 在 IWmsDeliveryWaybillDetailService 中新增 getBoundCoilIdsByPrincipal 方法
- 在 WmsDeliveryWaybillDetailController 中添加 coilListByPrincipal 接口
- 实现 WmsDeliveryWaybillDetailServiceImpl 中的 getBoundCoilIdsByPrincipal 逻辑
- 使用 LambdaQueryWrapper 查询指定负责人的运单及关联钢卷信息
- 添加参数校验和空值处理机制
This commit is contained in:
2026-04-27 17:28:19 +08:00
parent 702de37397
commit dc170c77d9
3 changed files with 49 additions and 4 deletions

View File

@@ -337,5 +337,30 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
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()) {
return Collections.emptyList();
}
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = Wrappers.lambdaQuery();
waybillWrapper.eq(WmsDeliveryWaybill::getPrincipal, principal);
waybillWrapper.eq(WmsDeliveryWaybill::getDelFlag, 0);
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());
}
}