diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/GetPurchaseOrderBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/GetPurchaseOrderBo.java index b4a564f..c45b818 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/GetPurchaseOrderBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/GetPurchaseOrderBo.java @@ -19,6 +19,7 @@ import com.lframework.xingyun.sc.service.paytype.OrderPayTypeService; import com.lframework.xingyun.sc.service.purchase.PurchaseOrderService; import com.lframework.xingyun.sc.service.stock.ProductStockService; import com.lframework.xingyun.template.core.service.UserService; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; @@ -330,6 +331,18 @@ public class GetPurchaseOrderBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public OrderDetailBo(String scId, PurchaseOrderFullDto.OrderDetailDto dto) { this.scId = scId; @@ -361,6 +374,8 @@ public class GetPurchaseOrderBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); ProductStockService productStockService = ApplicationUtil.getBean( ProductStockService.class); diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/PurchaseOrderWithReceiveBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/PurchaseOrderWithReceiveBo.java index 8b48e19..c93b3d2 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/PurchaseOrderWithReceiveBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/PurchaseOrderWithReceiveBo.java @@ -233,6 +233,18 @@ public class PurchaseOrderWithReceiveBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商id + */ + @ApiModelProperty(value = "供应商id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public PurchaseProductBo(String scId, PurchaseProductDto dto) { this.scId = scId; diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/GetReceiveSheetBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/GetReceiveSheetBo.java index 1d76c08..8ad0ced 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/GetReceiveSheetBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/GetReceiveSheetBo.java @@ -374,6 +374,18 @@ public class GetReceiveSheetBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商id + */ + @ApiModelProperty(value = "供应商id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public OrderDetailBo(String scId, ReceiveSheetFullDto.OrderDetailDto dto) { this.scId = scId; @@ -405,6 +417,8 @@ public class GetReceiveSheetBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); if (!StringUtil.isBlank(dto.getPurchaseOrderDetailId())) { PurchaseOrderDetailService purchaseOrderDetailService = ApplicationUtil.getBean( diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/ReceiveSheetWithReturnBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/ReceiveSheetWithReturnBo.java index bfdd51f..a9cd210 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/ReceiveSheetWithReturnBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/receive/ReceiveSheetWithReturnBo.java @@ -234,6 +234,18 @@ public class ReceiveSheetWithReturnBo extends BaseBo @JsonIgnore private String scId; + /** + * 供应商id + */ + @ApiModelProperty(value = "供应商id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public DetailBo(String scId, ReceiveSheetWithReturnDto.DetailDto dto) { this.scId = scId; @@ -273,6 +285,8 @@ public class ReceiveSheetWithReturnBo extends BaseBo this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); this.receiveNum = dto.getOrderNum(); this.purchasePrice = dto.getTaxPrice(); diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/returned/GetPurchaseReturnBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/returned/GetPurchaseReturnBo.java index e1ef7f6..c73fbce 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/returned/GetPurchaseReturnBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/purchase/returned/GetPurchaseReturnBo.java @@ -364,6 +364,18 @@ public class GetPurchaseReturnBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商id + */ + @ApiModelProperty(value = "供应商id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public ReturnDetailBo(String scId, PurchaseReturnFullDto.ReturnDetailDto dto) { this.scId = scId; @@ -395,6 +407,8 @@ public class GetPurchaseReturnBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); if (!StringUtil.isBlank(dto.getReceiveSheetDetailId())) { ReceiveSheetDetailService receiveSheetDetailService = ApplicationUtil.getBean( diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseOrderWithReceiveDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseOrderWithReceiveDto.java index a041cff..60a2247 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseOrderWithReceiveDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseOrderWithReceiveDto.java @@ -88,5 +88,15 @@ public class PurchaseOrderWithReceiveDto implements BaseDto, Serializable { * 已收货数量 */ private Integer receiveNum; + + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商名称 + */ + private String supplierName; } } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseProductDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseProductDto.java index 3fe2776..e277e5b 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseProductDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/PurchaseProductDto.java @@ -79,4 +79,14 @@ public class PurchaseProductDto implements BaseDto, Serializable { * 状态 */ private Boolean available; + + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商名称 + */ + private String supplierName; } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/receive/ReceiveSheetWithReturnDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/receive/ReceiveSheetWithReturnDto.java index a73d1ef..2da1a8f 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/receive/ReceiveSheetWithReturnDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/purchase/receive/ReceiveSheetWithReturnDto.java @@ -4,6 +4,8 @@ import com.lframework.starter.web.dto.BaseDto; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; + +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -88,5 +90,15 @@ public class ReceiveSheetWithReturnDto implements BaseDto, Serializable { * 已退货数量 */ private Integer returnNum; + + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商名称 + */ + private String supplierName; } } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/purchase/QueryPurchaseProductVo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/purchase/QueryPurchaseProductVo.java index 2bc96c6..1b498fa 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/purchase/QueryPurchaseProductVo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/purchase/QueryPurchaseProductVo.java @@ -34,4 +34,11 @@ public class QueryPurchaseProductVo extends PageVo { */ @ApiModelProperty("品牌ID") private String brandId; + + /** + * 供应商ID + */ + @ApiModelProperty("供应商ID") + @NotBlank(message = "供应商ID不能为空!") + private 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 998264f..5e189cf 100644 --- a/xingyun-sc/src/main/resources/mappers/purchase/PurchaseOrderMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/purchase/PurchaseOrderMapper.xml @@ -70,6 +70,8 @@ + + @@ -88,6 +90,8 @@ + + @@ -161,12 +165,15 @@ g.unit, purchase.price AS purchase_price, g.tax_rate, - g.available + g.available, + g.supplier_id, + s.name AS supplier_name FROM base_data_product AS g INNER JOIN base_data_product_purchase AS purchase ON purchase.id = g.id LEFT JOIN base_data_product_category AS c ON c.id = g.category_id LEFT JOIN base_data_product_brand AS b ON b.id = g.brand_id LEFT JOIN recursion_mapping AS rm ON rm.node_id = c.id and rm.node_type = 2 + LEFT JOIN base_data_supplier AS s ON s.id = g.supplier_id @@ -326,6 +335,9 @@ AND (c.id = #{vo.categoryId} OR FIND_IN_SET(#{vo.categoryId}, rm.path)) + + AND g.supplier_id = #{vo.supplierId} + AND g.product_type = 1 AND g.available = TRUE diff --git a/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml b/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml index 2fc62bb..4dd1b60 100644 --- a/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/purchase/ReceiveSheetMapper.xml @@ -76,6 +76,8 @@ + + @@ -250,9 +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 + d.return_num AS detail_return_num,p.supplier_id,s.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 AND d.order_num > d.return_num WHERE s.id = #{id} AND s.status = 3