sku等一些覆盖问题
This commit is contained in:
parent
3023c11442
commit
268d211f5b
|
|
@ -56,11 +56,11 @@ public class TbProductSku implements Serializable {
|
||||||
|
|
||||||
@Column(name = "`origin_price`")
|
@Column(name = "`origin_price`")
|
||||||
@ApiModelProperty(value = "原价")
|
@ApiModelProperty(value = "原价")
|
||||||
private BigDecimal originPrice = new BigDecimal("0.00");
|
private BigDecimal originPrice;
|
||||||
|
|
||||||
@Column(name = "`cost_price`")
|
@Column(name = "`cost_price`")
|
||||||
@ApiModelProperty(value = "成本价")
|
@ApiModelProperty(value = "成本价")
|
||||||
private BigDecimal costPrice = new BigDecimal("0.00");
|
private BigDecimal costPrice;
|
||||||
|
|
||||||
@Column(name = "`member_price`")
|
@Column(name = "`member_price`")
|
||||||
@ApiModelProperty(value = "会员价")
|
@ApiModelProperty(value = "会员价")
|
||||||
|
|
@ -68,11 +68,11 @@ public class TbProductSku implements Serializable {
|
||||||
|
|
||||||
@Column(name = "`meal_price`")
|
@Column(name = "`meal_price`")
|
||||||
@ApiModelProperty(value = "mealPrice")
|
@ApiModelProperty(value = "mealPrice")
|
||||||
private BigDecimal mealPrice = new BigDecimal("0.00");
|
private BigDecimal mealPrice;
|
||||||
|
|
||||||
@Column(name = "`sale_price`")
|
@Column(name = "`sale_price`")
|
||||||
@ApiModelProperty(value = "售价")
|
@ApiModelProperty(value = "售价")
|
||||||
private BigDecimal salePrice = new BigDecimal("0.00");
|
private BigDecimal salePrice;
|
||||||
|
|
||||||
@Column(name = "`guide_price`")
|
@Column(name = "`guide_price`")
|
||||||
@ApiModelProperty(value = "进货参考价")
|
@ApiModelProperty(value = "进货参考价")
|
||||||
|
|
@ -84,7 +84,7 @@ public class TbProductSku implements Serializable {
|
||||||
|
|
||||||
@Column(name = "`stock_number`")
|
@Column(name = "`stock_number`")
|
||||||
@ApiModelProperty(value = "库存数量")
|
@ApiModelProperty(value = "库存数量")
|
||||||
private Double stockNumber = 0.00;
|
private Double stockNumber;
|
||||||
|
|
||||||
@Column(name = "`spec_snap`")
|
@Column(name = "`spec_snap`")
|
||||||
@ApiModelProperty(value = "标签镜像")
|
@ApiModelProperty(value = "标签镜像")
|
||||||
|
|
@ -108,7 +108,7 @@ public class TbProductSku implements Serializable {
|
||||||
|
|
||||||
@Column(name = "`real_sales_number`")
|
@Column(name = "`real_sales_number`")
|
||||||
@ApiModelProperty(value = "销量")
|
@ApiModelProperty(value = "销量")
|
||||||
private Double realSalesNumber = 0.00;
|
private Double realSalesNumber;
|
||||||
|
|
||||||
@Column(name = "`first_shared`")
|
@Column(name = "`first_shared`")
|
||||||
@ApiModelProperty(value = "一级分销金额")
|
@ApiModelProperty(value = "一级分销金额")
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
@ -119,7 +120,7 @@ public class TbProductServiceImpl implements TbProductService {
|
||||||
//sku
|
//sku
|
||||||
if (sku.getProductId().equals(product.getId().toString())) {
|
if (sku.getProductId().equals(product.getId().toString())) {
|
||||||
skuList.add(sku);
|
skuList.add(sku);
|
||||||
realSalesNumber = realSalesNumber + sku.getRealSalesNumber();
|
realSalesNumber = realSalesNumber + (sku.getRealSalesNumber()==null?0:sku.getRealSalesNumber());
|
||||||
stockNumber = stockNumber + sku.getStockNumber();
|
stockNumber = stockNumber + sku.getStockNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -185,9 +186,9 @@ public class TbProductServiceImpl implements TbProductService {
|
||||||
tbProductVo.setGroupSnap(ListUtil.stringChangeList(tbProduct.getGroupSnap()));
|
tbProductVo.setGroupSnap(ListUtil.stringChangeList(tbProduct.getGroupSnap()));
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(tbProduct, tbProductVo);
|
BeanUtils.copyProperties(tbProduct, tbProductVo);
|
||||||
|
if(!org.apache.commons.lang3.StringUtils.isBlank(tbProduct.getImages())){
|
||||||
tbProductVo.setImages(ListUtil.stringChangeStringList(tbProduct.getImages()));
|
tbProductVo.setImages(ListUtil.stringChangeStringList(tbProduct.getImages()));
|
||||||
|
}
|
||||||
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
//商品规格
|
//商品规格
|
||||||
if (tbProductSpec.get() == null) {
|
if (tbProductSpec.get() == null) {
|
||||||
|
|
@ -245,7 +246,9 @@ public class TbProductServiceImpl implements TbProductService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!CollectionUtils.isEmpty(resources.getImages())){
|
||||||
product.setImages(resources.getImages().toString());
|
product.setImages(resources.getImages().toString());
|
||||||
|
}
|
||||||
product.setCategoryId(String.valueOf(resources.getCategoryId()));
|
product.setCategoryId(String.valueOf(resources.getCategoryId()));
|
||||||
product.setIsDel(0);
|
product.setIsDel(0);
|
||||||
product.setIsDelete(0);
|
product.setIsDelete(0);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import cn.ysk.cashier.repository.product.TbProductSkuRepository;
|
import cn.ysk.cashier.repository.product.TbProductSkuRepository;
|
||||||
import cn.ysk.cashier.service.product.TbProductSkuService;
|
import cn.ysk.cashier.service.product.TbProductSkuService;
|
||||||
import cn.ysk.cashier.dto.product.TbProductSkuDto;
|
import cn.ysk.cashier.dto.product.TbProductSkuDto;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
|
@ -43,6 +44,7 @@ import java.util.LinkedHashMap;
|
||||||
* @author lyf
|
* @author lyf
|
||||||
* @date 2024-01-03
|
* @date 2024-01-03
|
||||||
**/
|
**/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class TbProductSkuServiceImpl implements TbProductSkuService {
|
public class TbProductSkuServiceImpl implements TbProductSkuService {
|
||||||
|
|
@ -80,7 +82,9 @@ public class TbProductSkuServiceImpl implements TbProductSkuService {
|
||||||
public void update(TbProductSku resources) {
|
public void update(TbProductSku resources) {
|
||||||
TbProductSku tbProductSku = tbProductSkuRepository.findById(resources.getId()).orElseGet(TbProductSku::new);
|
TbProductSku tbProductSku = tbProductSkuRepository.findById(resources.getId()).orElseGet(TbProductSku::new);
|
||||||
ValidationUtil.isNull( tbProductSku.getId(),"TbProductSku","id",resources.getId());
|
ValidationUtil.isNull( tbProductSku.getId(),"TbProductSku","id",resources.getId());
|
||||||
|
log.info("入库前{}",tbProductSku);
|
||||||
tbProductSku.copy(resources);
|
tbProductSku.copy(resources);
|
||||||
|
log.info("入库后{}",tbProductSku);
|
||||||
tbProductSkuRepository.save(tbProductSku);
|
tbProductSkuRepository.save(tbProductSku);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue