mirror of https://github.com/elunez/eladmin
产品统计
parent
bfbfc28246
commit
ca685659de
|
@ -33,6 +33,14 @@ public class ProductInfo implements Serializable {
|
|||
@Column(name = "product_category_name",nullable = false)
|
||||
private String productCategoryName;
|
||||
|
||||
// 产品系列主键
|
||||
@Column(name = "product_series_id",nullable = false)
|
||||
private Long productSeriesId;
|
||||
|
||||
// 产品系列名称
|
||||
@Column(name = "product_series_name",nullable = false)
|
||||
private String productSeriesName;
|
||||
|
||||
// 产品编号
|
||||
@Column(name = "product_code")
|
||||
private String productCode;
|
||||
|
|
|
@ -19,6 +19,10 @@ public class CreateProductInfoRequest implements Serializable {
|
|||
// 产品分类名称
|
||||
private String productCategoryName;
|
||||
|
||||
private Long productSeriesId;
|
||||
|
||||
private String productSeriesName;
|
||||
|
||||
// 产品编号
|
||||
private String productCode;
|
||||
|
||||
|
|
|
@ -21,6 +21,10 @@ public class UpdateProductInfoRequest implements Serializable {
|
|||
// 产品分类名称
|
||||
private String productCategoryName;
|
||||
|
||||
private Long productSeriesId;
|
||||
|
||||
private String productSeriesName;
|
||||
|
||||
// 产品编号
|
||||
private String productCode;
|
||||
|
||||
|
|
|
@ -44,4 +44,10 @@ public class ProductInfoDTO implements Serializable {
|
|||
|
||||
// 更新时间
|
||||
private Timestamp updateTime;
|
||||
|
||||
// 产品系列主键
|
||||
private Long productSeriesId;
|
||||
|
||||
// 产品系列名称
|
||||
private String productSeriesName;
|
||||
}
|
|
@ -9,5 +9,7 @@ import me.zhengjie.annotation.Query;
|
|||
* @date 2020-01-04
|
||||
*/
|
||||
@Data
|
||||
public class ProductSeriesQueryCriteria {
|
||||
public class
|
||||
|
||||
ProductSeriesQueryCriteria {
|
||||
}
|
|
@ -6,6 +6,7 @@ import me.zhengjie.exception.BadRequestException;
|
|||
import me.zhengjie.modules.wms.bd.domain.*;
|
||||
import me.zhengjie.modules.wms.bd.repository.MeasureUnitRepository;
|
||||
import me.zhengjie.modules.wms.bd.repository.ProductCategoryRepository;
|
||||
import me.zhengjie.modules.wms.bd.repository.ProductSeriesRepository;
|
||||
import me.zhengjie.modules.wms.bd.request.*;
|
||||
import me.zhengjie.modules.wms.bd.service.dto.*;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
|
@ -57,6 +58,9 @@ public class ProductInfoServiceImpl implements ProductInfoService {
|
|||
@Autowired
|
||||
private ProductCategoryRepository productCategoryRepository;
|
||||
|
||||
@Autowired
|
||||
private ProductSeriesRepository productSeriesRepository;
|
||||
|
||||
@Override
|
||||
public Object queryAll(ProductInfoQueryCriteria criteria, Pageable pageable){
|
||||
Specification<ProductInfo> specification = new Specification<ProductInfo>() {
|
||||
|
@ -150,6 +154,15 @@ public class ProductInfoServiceImpl implements ProductInfoService {
|
|||
throw new BadRequestException("产品类别不存在!");
|
||||
}
|
||||
|
||||
Long productSeriesId = createProductInfoRequest.getProductSeriesId();
|
||||
if(null == productSeriesId){
|
||||
throw new BadRequestException("产品系列不能为空!");
|
||||
}
|
||||
Optional<ProductSeries> productSeriesOptional = productSeriesRepository.findById(productSeriesId);
|
||||
ProductSeries productSeries = productSeriesOptional.get();
|
||||
if(null == productSeries){
|
||||
throw new BadRequestException("产品系列不存在!");
|
||||
}
|
||||
|
||||
|
||||
ProductInfoDetailDTO productInfoDetailDTO = new ProductInfoDetailDTO();
|
||||
|
@ -172,6 +185,7 @@ public class ProductInfoServiceImpl implements ProductInfoService {
|
|||
|
||||
productInfo.setProductCategoryName(productCategory.getName());
|
||||
productInfo.setMeasureUnitName(measureUnit.getName());
|
||||
productInfo.setProductSeriesName(productSeries.getProductSeriesName());
|
||||
|
||||
productInfo = productInfoRepository.save(productInfo);
|
||||
ProductInfoDTO productInfoDTO = productInfoMapper.toDto(productInfo);
|
||||
|
|
|
@ -40,6 +40,39 @@ public class ProductCount implements Serializable {
|
|||
@CreationTimestamp
|
||||
private Timestamp gmtUpdate;
|
||||
|
||||
@Column(name = "product_category_id")
|
||||
private Long productCategoryId;
|
||||
|
||||
@Column(name = "product_category_name")
|
||||
private String productCategoryName;
|
||||
|
||||
@Column(name = "product_series_id")
|
||||
private Long productSeriesId;
|
||||
|
||||
@Column(name = "product_series_name")
|
||||
private String productSeriesName;
|
||||
|
||||
@Column(name = "mp_number")
|
||||
private Long mpNumber;
|
||||
|
||||
@Column(name = "hj_number")
|
||||
private Long hjNumber;
|
||||
|
||||
@Column(name = "bjc_number")
|
||||
private Long bjcNumber;
|
||||
|
||||
@Column(name = "jc_number")
|
||||
private Long jcNumber;
|
||||
|
||||
@Column(name = "jm_number")
|
||||
private Long jmNumber;
|
||||
|
||||
@Column(name = "dph_number")
|
||||
private Long dphNumber;
|
||||
|
||||
@Column(name = "cm_number")
|
||||
private Long cmNumber;
|
||||
|
||||
public void copy(ProductCount source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
package me.zhengjie.modules.wms.sr.productCount.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import java.sql.Timestamp;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
@ -23,4 +29,26 @@ public class ProductCountDTO implements Serializable {
|
|||
private Timestamp gmtCreate;
|
||||
|
||||
private Timestamp gmtUpdate;
|
||||
|
||||
private Long productCategoryId;
|
||||
|
||||
private String productCategoryName;
|
||||
|
||||
private Long productSeriesId;
|
||||
|
||||
private String productSeriesName;
|
||||
|
||||
private Long mpNumber;
|
||||
|
||||
private Long hjNumber;
|
||||
|
||||
private Long bjcNumber;
|
||||
|
||||
private Long jcNumber;
|
||||
|
||||
private Long jmNumber;
|
||||
|
||||
private Long dphNumber;
|
||||
|
||||
private Long cmNumber;
|
||||
}
|
Loading…
Reference in New Issue