feat(xingyun-sc): 销售相关 BO 和 DTO 类中增加供应商信息字段

- 在多个销售相关的 BO 和 DTO 类中添加供应商 ID 和供应商名称字段
- 更新数据库查询语句,加入供应商信息的查询
- 通过这些修改,可以在销售订单、出库单等业务对象中直接获取供应商信息,无需额外查询
This commit is contained in:
lijiaqi 2024-11-22 13:59:05 +08:00
parent 123ea7101c
commit a973b5d8a8
8 changed files with 100 additions and 1 deletions

View File

@ -341,6 +341,18 @@ public class GetSaleOrderBo extends BaseBo<SaleOrderFullDto> {
@ApiModelProperty("库存数量") @ApiModelProperty("库存数量")
private Integer stockNum; private Integer stockNum;
/**
* 供应商Id
*/
@ApiModelProperty(value = "供应商Id")
private String supplierId;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
public OrderDetailBo(String scId, SaleOrderFullDto.OrderDetailDto dto) { public OrderDetailBo(String scId, SaleOrderFullDto.OrderDetailDto dto) {
this.scId = scId; this.scId = scId;
@ -372,6 +384,8 @@ public class GetSaleOrderBo extends BaseBo<SaleOrderFullDto> {
this.spec = product.getSpec(); this.spec = product.getSpec();
this.categoryName = product.getCategoryName(); this.categoryName = product.getCategoryName();
this.brandName = product.getBrandName(); this.brandName = product.getBrandName();
this.supplierId = product.getSupplierId();
this.supplierName = product.getSupplierName();
ProductStockService productStockService = ApplicationUtil.getBean( ProductStockService productStockService = ApplicationUtil.getBean(
ProductStockService.class); ProductStockService.class);

View File

@ -253,6 +253,18 @@ public class SaleOrderWithOutBo extends BaseBo<SaleOrderWithOutDto> {
@JsonIgnore @JsonIgnore
private String scId; private String scId;
/**
* 供应商Id
*/
@ApiModelProperty(value = "供应商Id")
private String supplierId;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
public DetailBo() { public DetailBo() {
} }
@ -292,6 +304,8 @@ public class SaleOrderWithOutBo extends BaseBo<SaleOrderWithOutDto> {
this.spec = product.getSpec(); this.spec = product.getSpec();
this.categoryName = product.getCategoryName(); this.categoryName = product.getCategoryName();
this.brandName = product.getBrandName(); this.brandName = product.getBrandName();
this.supplierId = product.getSupplierId();
this.supplierName = product.getSupplierName();
this.orderNum = dto.getOrderNum(); this.orderNum = dto.getOrderNum();
this.salePrice = dto.getOriPrice(); this.salePrice = dto.getOriPrice();

View File

@ -98,6 +98,19 @@ public class SaleProductBo extends BaseBo<SaleProductDto> {
@JsonIgnore @JsonIgnore
private String scId; private String scId;
/**
* 供应商Id
*/
@ApiModelProperty(value = "供应商Id")
private String supplierId;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
public SaleProductBo(String scId, SaleProductDto dto) { public SaleProductBo(String scId, SaleProductDto dto) {
this.scId = scId; this.scId = scId;

View File

@ -387,6 +387,18 @@ public class GetSaleOutSheetBo extends BaseBo<SaleOutSheetFullDto> {
@JsonIgnore @JsonIgnore
private String scId; private String scId;
/**
* 供应商Id
*/
@ApiModelProperty(value = "供应商Id")
private String supplierId;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
public OrderDetailBo(String scId, SaleOutSheetFullDto.SheetDetailDto dto) { public OrderDetailBo(String scId, SaleOutSheetFullDto.SheetDetailDto dto) {
this.scId = scId; this.scId = scId;
@ -418,6 +430,8 @@ public class GetSaleOutSheetBo extends BaseBo<SaleOutSheetFullDto> {
this.spec = product.getSpec(); this.spec = product.getSpec();
this.categoryName = product.getCategoryName(); this.categoryName = product.getCategoryName();
this.brandName = product.getBrandName(); this.brandName = product.getBrandName();
this.supplierId = product.getSupplierId();
this.supplierName = product.getSupplierName();
if (!StringUtil.isBlank(dto.getSaleOrderDetailId())) { if (!StringUtil.isBlank(dto.getSaleOrderDetailId())) {
SaleOrderDetailService saleOrderDetailService = ApplicationUtil.getBean( SaleOrderDetailService saleOrderDetailService = ApplicationUtil.getBean(

View File

@ -240,6 +240,19 @@ public class SaleOutSheetWithReturnBo extends BaseBo<SaleOutSheetWithReturnDto>
@JsonIgnore @JsonIgnore
private String scId; private String scId;
/**
* 供应商Id
*/
@ApiModelProperty(value = "供应商Id")
private String supplierId;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
public DetailBo(String scId, SaleOutSheetWithReturnDto.SheetDetailDto dto) { public DetailBo(String scId, SaleOutSheetWithReturnDto.SheetDetailDto dto) {
this.scId = scId; this.scId = scId;
@ -277,6 +290,8 @@ public class SaleOutSheetWithReturnBo extends BaseBo<SaleOutSheetWithReturnDto>
this.spec = product.getSpec(); this.spec = product.getSpec();
this.categoryName = product.getCategoryName(); this.categoryName = product.getCategoryName();
this.brandName = product.getBrandName(); this.brandName = product.getBrandName();
this.supplierId = product.getSupplierId();
this.supplierName = product.getSupplierName();
this.outNum = dto.getOrderNum(); this.outNum = dto.getOrderNum();
this.salePrice = dto.getOriPrice(); this.salePrice = dto.getOriPrice();

View File

@ -362,6 +362,18 @@ public class GetSaleReturnBo extends BaseBo<SaleReturnFullDto> {
@JsonIgnore @JsonIgnore
private String scId; private String scId;
/**
* 供应商Id
*/
@ApiModelProperty(value = "供应商Id")
private String supplierId;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
public ReturnDetailBo(String scId, SaleReturnFullDto.ReturnDetailDto dto) { public ReturnDetailBo(String scId, SaleReturnFullDto.ReturnDetailDto dto) {
this.scId = scId; this.scId = scId;
@ -394,6 +406,8 @@ public class GetSaleReturnBo extends BaseBo<SaleReturnFullDto> {
this.spec = product.getSpec(); this.spec = product.getSpec();
this.categoryName = product.getCategoryName(); this.categoryName = product.getCategoryName();
this.brandName = product.getBrandName(); this.brandName = product.getBrandName();
this.supplierId = product.getSupplierId();
this.supplierName = product.getSupplierName();
if (!StringUtil.isBlank(dto.getOutSheetDetailId())) { if (!StringUtil.isBlank(dto.getOutSheetDetailId())) {
SaleOutSheetDetailLotService receiveSheetDetailService = ApplicationUtil.getBean( SaleOutSheetDetailLotService receiveSheetDetailService = ApplicationUtil.getBean(

View File

@ -79,4 +79,14 @@ public class SaleProductDto implements BaseDto, Serializable {
* 状态 * 状态
*/ */
private Boolean available; private Boolean available;
/**
* 供应商Id
*/
private String supplierId;
/**
* 供应商名称
*/
private String supplierName;
} }

View File

@ -92,6 +92,8 @@
<result column="sale_price" property="salePrice"/> <result column="sale_price" property="salePrice"/>
<result column="sale_tax_rate" property="taxRate"/> <result column="sale_tax_rate" property="taxRate"/>
<result column="available" property="available"/> <result column="available" property="available"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
</resultMap> </resultMap>
<sql id="SaleOrderDto_sql"> <sql id="SaleOrderDto_sql">
@ -167,12 +169,15 @@
g.unit, g.unit,
sale.price AS sale_price, sale.price AS sale_price,
g.sale_tax_rate, g.sale_tax_rate,
g.available g.available,
g.supplier_id,
s.name AS supplier_name
FROM base_data_product AS g FROM base_data_product AS g
INNER JOIN base_data_product_sale AS sale ON sale.id = g.id INNER JOIN base_data_product_sale AS sale ON sale.id = g.id
LEFT JOIN base_data_product_category AS c ON c.id = g.category_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 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 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
</sql> </sql>
<select id="query" resultMap="SaleOrder"> <select id="query" resultMap="SaleOrder">