diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/purchase/PurchaseOrderController.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/purchase/PurchaseOrderController.java index 2689d8d..b315ec4 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/purchase/PurchaseOrderController.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/purchase/PurchaseOrderController.java @@ -391,19 +391,21 @@ public class PurchaseOrderController extends DefaultBaseController { @ApiOperation("根据关键字查询可采购商品") @ApiImplicitParams({ @ApiImplicitParam(value = "仓库ID", name = "scId", paramType = "query", required = true), - @ApiImplicitParam(value = "关键字", name = "condition", paramType = "query", required = true)}) + @ApiImplicitParam(value = "关键字", name = "condition", paramType = "query", required = true), + @ApiImplicitParam(value = "供应商ID", name = "supplierId", paramType = "query",required = true) + }) @HasPermission({"purchase:order:add", "purchase:order:modify", "purchase:receive:add", "purchase:receive:modify", "purchase:return:add", "purchase:return:modify"}) @GetMapping("/product/search") public InvokeResult> searchPurchaseProducts( - @NotBlank(message = "仓库ID不能为空!") String scId, String condition) { + @NotBlank(message = "仓库ID不能为空!") String scId, String condition,@NotBlank(message = "供应商ID不能为空!") String supplierId) { if (StringUtil.isBlank(condition)) { return InvokeResultBuilder.success(CollectionUtil.emptyList()); } PageResult pageResult = purchaseOrderService.queryPurchaseByCondition( - getPageIndex(), getPageSize(), condition); + getPageIndex(), getPageSize(), condition, supplierId); List results = CollectionUtil.emptyList(); List datas = pageResult.getDatas(); if (!CollectionUtil.isEmpty(datas)) { @@ -421,18 +423,20 @@ public class PurchaseOrderController extends DefaultBaseController { @ApiOperation("根据SKU查询可采购商品") @ApiImplicitParams({ @ApiImplicitParam(value = "仓库ID", name = "scId", paramType = "query", required = true), - @ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true)}) + @ApiImplicitParam(value = "SKU", name = "sku", paramType = "query", required = true), + @ApiImplicitParam(value = "供应商ID", name = "supplierId", paramType = "query", required = true) + }) @HasPermission({"purchase:order:add", "purchase:order:modify", "purchase:receive:add", "purchase:receive:modify", "purchase:return:add", "purchase:return:modify"}) @GetMapping("/product/sku") public InvokeResult searchPurchaseProductBySku( - @NotBlank(message = "仓库ID不能为空!") String scId, String sku) { + @NotBlank(message = "仓库ID不能为空!") String scId, String sku,@NotBlank(message = "供应商ID不能为空!") String supplierId) { if (StringUtil.isBlank(sku)) { throw new DefaultClientException("SKU不能为空"); } - PurchaseProductDto dto = purchaseOrderService.queryPurchaseBySku(sku); + PurchaseProductDto dto = purchaseOrderService.queryPurchaseBySku(sku,supplierId); if (dto == null) { throw new DefaultClientException("该SKU不存在"); } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java index 2b4528f..08199bd 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java @@ -575,14 +575,14 @@ public class PurchaseOrderServiceImpl extends BaseMpServiceImpl queryPurchaseByCondition(Integer pageIndex, - Integer pageSize, String condition) { + Integer pageSize, String condition,String supplierId) { Assert.greaterThanZero(pageIndex); Assert.greaterThanZero(pageSize); PageHelperUtil.startPage(pageIndex, pageSize); - List datas = getBaseMapper().queryPurchaseByCondition(condition); + List datas = getBaseMapper().queryPurchaseByCondition(condition,supplierId); PageResult pageResult = PageResultUtil.convert(new PageInfo<>(datas)); return pageResult; @@ -693,8 +693,8 @@ public class PurchaseOrderServiceImpl extends BaseMpServiceImpl { @DataPermission(template = "category", alias = "c") }) List queryPurchaseByCondition( - @Param("condition") String condition); + @Param("condition") String condition,@Param("supplierId")String supplierId); /** * 查询可采购商品信息 @@ -128,5 +128,5 @@ public interface PurchaseOrderMapper extends BaseMapper { @DataPermission(template = "brand", alias = "b"), @DataPermission(template = "category", alias = "c") }) - PurchaseProductDto queryPurchaseBySku( @Param("sku") String sku); + PurchaseProductDto queryPurchaseBySku( @Param("sku") String sku,@Param("supplierId")String supplierId); } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/purchase/PurchaseOrderService.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/purchase/PurchaseOrderService.java index 81358b6..f44562d 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/purchase/PurchaseOrderService.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/purchase/PurchaseOrderService.java @@ -158,7 +158,7 @@ public interface PurchaseOrderService extends BaseMpService { * @param condition * @return */ - PageResult queryPurchaseByCondition(Integer pageIndex, Integer pageSize, String condition); + PageResult queryPurchaseByCondition(Integer pageIndex, Integer pageSize, String condition,String supplierId); /** * 查询可采购商品信息 @@ -196,5 +196,5 @@ public interface PurchaseOrderService extends BaseMpService { * @param sku * @return */ - PurchaseProductDto queryPurchaseBySku(String sku); + PurchaseProductDto queryPurchaseBySku(String sku,String supplierId); } diff --git a/xingyun-sc/src/main/resources/mappers/purchase/PurchaseOrderMapper.xml b/xingyun-sc/src/main/resources/mappers/purchase/PurchaseOrderMapper.xml index 5e189cf..fabb659 100644 --- a/xingyun-sc/src/main/resources/mappers/purchase/PurchaseOrderMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/purchase/PurchaseOrderMapper.xml @@ -263,7 +263,7 @@ o.id, o.sc_id, o.supplier_id, o.purchaser_id, d.id AS detail_id, d.product_id AS detail_product_id, d.order_num AS detail_order_num, d.tax_price AS detail_tax_price, d.is_gift AS detail_is_gift, d.tax_rate AS detail_tax_rate, d.description AS detail_description, d.order_no AS detail_order_no, - d.receive_num AS detail_receive_num,g.p.supplier_id, s.name AS supplier_name + d.receive_num AS detail_receive_num,p.supplier_id, s.name AS supplier_name FROM tbl_purchase_order AS o LEFT JOIN tbl_purchase_order_detail AS d ON d.order_id = o.id LEFT JOIN base_data_product AS p ON p.id = d.product_id @@ -314,6 +314,7 @@ ) AND g.product_type = 1 AND g.available = TRUE + AND g.supplier_id = #{supplierId} ORDER BY g.code @@ -354,6 +355,7 @@ AND g.sku_code = #{sku} AND g.product_type = 1 AND g.available = TRUE + AND g.supplier_id = #{supplierId} ORDER BY g.code diff --git a/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml b/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml index 4dd1b60..7c29116 100644 --- a/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml @@ -252,11 +252,11 @@ s.id, s.sc_id, s.supplier_id, s.purchaser_id, d.id AS detail_id, d.product_id AS detail_product_id, d.order_num AS detail_order_num, d.tax_price AS detail_tax_price, d.is_gift AS detail_is_gift, d.tax_rate AS detail_tax_rate, d.description AS detail_description, d.order_no AS detail_order_no, - d.return_num AS detail_return_num,p.supplier_id,s.name AS supplier_name + d.return_num AS detail_return_num,p.supplier_id,sa.name AS supplier_name FROM tbl_receive_sheet AS s LEFT JOIN tbl_receive_sheet_detail AS d ON d.sheet_id = s.id LEFT JOIN base_data_product AS p ON p.id = d.product_id - LEFT JOIN base_data_supplier AS s ON s.id = p.supplier_id + LEFT JOIN base_data_supplier AS sa ON sa.id = p.supplier_id AND d.order_num > d.return_num WHERE s.id = #{id} AND s.status = 3