diff --git a/src/main/java/com/xujie/modules/inspection/controller/InspectionController.java b/src/main/java/com/xujie/modules/inspection/controller/InspectionController.java index b658f26..5e78bf8 100644 --- a/src/main/java/com/xujie/modules/inspection/controller/InspectionController.java +++ b/src/main/java/com/xujie/modules/inspection/controller/InspectionController.java @@ -98,6 +98,24 @@ public class InspectionController { return R.ok().put("page", page); } + /** + * 查询可申请验货的供应商(按PO明细聚合) + */ + @PostMapping("/queryPoSupplierPage") + public R queryPoSupplierPage(@RequestBody InspectionRequestItemVO vo){ + PageUtils page = inspectionRequestService.queryPoSupplierPage(vo); + return R.ok().put("page", page); + } + + /** + * 从订单选择供应商专用分页查询 + */ + @PostMapping("/queryPoSupplierOrderPage") + public R queryPoSupplierOrderPage(@RequestBody InspectionRequestItemVO vo){ + PageUtils page = inspectionRequestService.queryPoSupplierOrderPage(vo); + return R.ok().put("page", page); + } + /** * 保存验货申请 diff --git a/src/main/java/com/xujie/modules/inspection/data/InspectionRequestItemVO.java b/src/main/java/com/xujie/modules/inspection/data/InspectionRequestItemVO.java index e16da24..b870109 100644 --- a/src/main/java/com/xujie/modules/inspection/data/InspectionRequestItemVO.java +++ b/src/main/java/com/xujie/modules/inspection/data/InspectionRequestItemVO.java @@ -99,5 +99,10 @@ public class InspectionRequestItemVO extends QueryPage { */ private String supplierName; + /** + * 供应商可申请验货PO明细数量 + */ + private Long poDetailCount; + } diff --git a/src/main/java/com/xujie/modules/inspection/mapper/InspectionRequestHeaderMapper.java b/src/main/java/com/xujie/modules/inspection/mapper/InspectionRequestHeaderMapper.java index 0e1c5ff..4812d0f 100644 --- a/src/main/java/com/xujie/modules/inspection/mapper/InspectionRequestHeaderMapper.java +++ b/src/main/java/com/xujie/modules/inspection/mapper/InspectionRequestHeaderMapper.java @@ -24,6 +24,10 @@ public interface InspectionRequestHeaderMapper extends BaseMapper queryPoPage(Page page, @Param("query") InspectionRequestItemVO query); + IPage queryPoSupplierPage(Page page, @Param("query") InspectionRequestItemVO query); + + IPage queryPoSupplierOrderPage(Page page, @Param("query") InspectionRequestItemVO query); + int cancel(@Param("site") String site, @Param("requestNo") String requestNo); diff --git a/src/main/java/com/xujie/modules/inspection/service/InspectionRequestService.java b/src/main/java/com/xujie/modules/inspection/service/InspectionRequestService.java index fe08fd0..058cb17 100644 --- a/src/main/java/com/xujie/modules/inspection/service/InspectionRequestService.java +++ b/src/main/java/com/xujie/modules/inspection/service/InspectionRequestService.java @@ -23,6 +23,10 @@ public interface InspectionRequestService extends IService page = baseMapper.queryPoPage(new Page<>(data.getPage(), data.getLimit()), data); return new PageUtils(page); } + @Override + public PageUtils queryPoSupplierPage(InspectionRequestItemVO data) { + // 业务查询必须以前端显式传入的 site 为准,避免跨工厂串数 + if (data == null || !StringUtils.hasText(data.getSite())) { + throw new RuntimeException("请前端传site"); + } + IPage page = + baseMapper.queryPoSupplierPage(new Page<>(data.getPage(), data.getLimit()), data); + return new PageUtils(page); + } + + @Override + public PageUtils queryPoSupplierOrderPage(InspectionRequestItemVO data) { + // 业务查询必须以前端显式传入的 site 为准,避免跨工厂串数 + if (data == null || !StringUtils.hasText(data.getSite())) { + throw new RuntimeException("请前端传site"); + } + IPage page = + baseMapper.queryPoSupplierOrderPage(new Page<>(data.getPage(), data.getLimit()), data); + return new PageUtils(page); + } + @Transactional(rollbackFor = Exception.class) @Override public void saveRequest(InspectionRequestSaveVO vo) { diff --git a/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml b/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml index aeb8015..2385ffb 100644 --- a/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml +++ b/src/main/resources/mapper/inspection/InspectionRequestHeaderMapper.xml @@ -89,7 +89,7 @@ ON pod.part_no = p.part_no AND pod.site = p.site WHERE pod.site = #{query.site} - AND poh.status NOT IN ('Closed','Cancelled') + AND ISNULL(poh.status, '') NOT IN ('Draft','Shipped','Closed','Cancelled','草稿','已发货','已关闭','已取消') AND ( pod.qty - ISNULL(pod.to_inspect_qty,0) ) > 0 @@ -97,7 +97,10 @@ AND poh.supplier_no = #{query.supplierNo} - AND pod.order_no like concat('%',#{query.orderNo},'%') + AND ( + pod.order_ref1 like concat('%',#{query.orderNo},'%') + OR pod.order_no like concat('%',#{query.orderNo},'%') + ) AND pod.part_no like concat('%',#{query.partNo},'%') @@ -108,9 +111,108 @@ AND p.sku like concat('%',#{query.sku},'%') + + AND p.part_desc like concat('%',#{query.partDesc},'%') + + + AND ss.supplier_name like concat('%',#{query.supplierName},'%') + ORDER BY pod.id DESC + + + + UPDATE srm_inspection_request_header SET status = '已取消',