feat(delivery): 添加查询已绑定钢卷列表功能

- 在 IWmsDeliveryWaybillDetailService 中新增 getBoundCoilIds 方法
- 在 WmsDeliveryWaybillDetailController 中新增 boundCoilList 接口
- 实现 WmsDeliveryWaybillDetailServiceImpl 的 getBoundCoilIds 查询逻辑
- 集成 WmsMaterialCoilService 查询已发货绑定的钢卷信息
- 添加钢卷 ID 去重处理确保数据准确性
- 支持分页查询返回 TableDataInfo 格式数据
This commit is contained in:
2026-03-05 09:57:00 +08:00
parent 28839275d2
commit dfd2ba15d9
3 changed files with 38 additions and 0 deletions

View File

@@ -20,6 +20,9 @@ import com.klp.common.utils.poi.ExcelUtil;
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
import com.klp.service.IWmsDeliveryWaybillDetailService;
import com.klp.domain.vo.WmsMaterialCoilVo;
import com.klp.domain.bo.WmsMaterialCoilBo;
import com.klp.service.IWmsMaterialCoilService;
import com.klp.common.core.page.TableDataInfo;
/**
@@ -35,6 +38,7 @@ import com.klp.common.core.page.TableDataInfo;
public class WmsDeliveryWaybillDetailController extends BaseController {
private final IWmsDeliveryWaybillDetailService iWmsDeliveryWaybillDetailService;
private final IWmsMaterialCoilService iWmsMaterialCoilService;
/**
* 查询发货单明细列表
@@ -106,4 +110,17 @@ public class WmsDeliveryWaybillDetailController extends BaseController {
@PathVariable Long[] detailIds) {
return toAjax(iWmsDeliveryWaybillDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
}
/**
* 查询已发货绑定的钢卷列表
*/
@GetMapping("/boundCoilList")
public TableDataInfo<WmsMaterialCoilVo> boundCoilList(WmsMaterialCoilBo bo, PageQuery pageQuery) {
List<Long> boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIds();
if (boundCoilIds == null || boundCoilIds.isEmpty()) {
return new TableDataInfo<>();
}
bo.setCoilIds(boundCoilIds.stream().map(String::valueOf).collect(java.util.stream.Collectors.joining(",")));
return iWmsMaterialCoilService.queryPageList(bo, pageQuery);
}
}

View File

@@ -51,4 +51,9 @@ public interface IWmsDeliveryWaybillDetailService {
* 校验并批量删除发货单明细信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 查询所有已绑定的钢卷ID列表
*/
List<Long> getBoundCoilIds();
}

View File

@@ -211,4 +211,20 @@ public class WmsDeliveryWaybillDetailServiceImpl implements IWmsDeliveryWaybillD
}
return baseMapper.deleteBatchIds(ids) > 0;
}
/**
* 查询所有已绑定的钢卷 ID 列表
*/
@Override
public List<Long> getBoundCoilIds() {
LambdaQueryWrapper<WmsDeliveryWaybillDetail> lqw = Wrappers.lambdaQuery();
lqw.isNotNull(WmsDeliveryWaybillDetail::getCoilId);
lqw.eq(WmsDeliveryWaybillDetail::getDelFlag, 0);
lqw.select(WmsDeliveryWaybillDetail::getCoilId);
// Deleted:lqw.distinct();
List<WmsDeliveryWaybillDetail> list = baseMapper.selectList(lqw);
return list.stream().map(WmsDeliveryWaybillDetail::getCoilId).distinct().collect(Collectors.toList());
}
}