feat(delivery): 添加按负责人查询已绑定钢卷功能
- 在 IWmsDeliveryWaybillDetailService 中新增 getBoundCoilIdsByPrincipal 方法 - 在 WmsDeliveryWaybillDetailController 中添加 coilListByPrincipal 接口 - 实现 WmsDeliveryWaybillDetailServiceImpl 中的 getBoundCoilIdsByPrincipal 逻辑 - 使用 LambdaQueryWrapper 查询指定负责人的运单及关联钢卷信息 - 添加参数校验和空值处理机制
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user