商品映射市场价更改
This commit is contained in:
parent
dd78c70ddd
commit
ebab4a6105
@ -56,6 +56,10 @@ public class ShopProductSpecItem implements Serializable {
|
|||||||
@TableField(exist=false)
|
@TableField(exist=false)
|
||||||
private BigDecimal itemPrice;
|
private BigDecimal itemPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "市场价")
|
||||||
|
@TableField(exist=false)
|
||||||
|
private BigDecimal marketPrice;
|
||||||
|
|
||||||
@ApiModelProperty(value = "切割后的库存")
|
@ApiModelProperty(value = "切割后的库存")
|
||||||
@TableField(exist=false)
|
@TableField(exist=false)
|
||||||
private BigDecimal itemQuantity;
|
private BigDecimal itemQuantity;
|
||||||
|
|||||||
@ -251,9 +251,10 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
}
|
}
|
||||||
shopProductItems.get(i).setItem_is_default(1);
|
shopProductItems.get(i).setItem_is_default(1);
|
||||||
if(shopProductSpecItem.isUpdate()){
|
if(shopProductSpecItem.isUpdate()){
|
||||||
shopProductBaseList.get(i).setProduct_unit_price(shopProductSpecItem.getItemPrice());
|
|
||||||
updateShopProductSpecItemList.add(shopProductSpecItem);
|
updateShopProductSpecItemList.add(shopProductSpecItem);
|
||||||
}
|
}
|
||||||
|
shopProductBaseList.get(i).setProduct_unit_price(shopProductSpecItem.getItemPrice());
|
||||||
|
shopProductBaseList.get(i).setProduct_market_price(shopProductSpecItem.getMarketPrice());
|
||||||
// else {
|
// else {
|
||||||
// shopProductBaseList.get(i).setProduct_unit_price(shopProductSpecItem.getItemPrice());
|
// shopProductBaseList.get(i).setProduct_unit_price(shopProductSpecItem.getItemPrice());
|
||||||
// shopProductBaseList.get(i).setProduct_market_price(shopProductSpecItem.getItemPrice());
|
// shopProductBaseList.get(i).setProduct_market_price(shopProductSpecItem.getItemPrice());
|
||||||
@ -421,11 +422,13 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
ProductMapping productMapping= (ProductMapping) productMappingMap.get(productNumber);
|
ProductMapping productMapping= (ProductMapping) productMappingMap.get(productNumber);
|
||||||
//String Spec_item_name=productMapping.getProductName()+ BigDecimalFormatter.formatWithoutTrailingZeros(productMapping.getSpecValue())+productMapping.getSpecUnit();
|
//String Spec_item_name=productMapping.getProductName()+ BigDecimalFormatter.formatWithoutTrailingZeros(productMapping.getSpecValue())+productMapping.getSpecUnit();
|
||||||
String Spec_item_name=BigDecimalFormatter.formatWithoutTrailingZeros(productMapping.getSpecValue())+productMapping.getSpecUnit();
|
String Spec_item_name=BigDecimalFormatter.formatWithoutTrailingZeros(productMapping.getSpecValue())+productMapping.getSpecUnit();
|
||||||
BigDecimal premiumRate= new BigDecimal("100").add(productMapping.getPremiumRate()).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP);
|
|
||||||
BigDecimal unitPrice=base.getUnit_price().multiply(premiumRate).setScale(2, RoundingMode.HALF_UP);
|
|
||||||
//计算价格
|
//计算价格
|
||||||
BigDecimal[] bigDecimals= ProductPriceCalculator.calculatePriceAndQuantity(unitPrice,base.getShop_weight(),productMapping.getSpecValue(),productMapping.getSpecUnit());
|
BigDecimal premiumRate= new BigDecimal("100").add(productMapping.getPremiumRate()).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP);
|
||||||
addShopProductSpecItem.setItemPrice(bigDecimals[0]);
|
BigDecimal[] bigDecimals= ProductPriceCalculator.calculatePriceAndQuantity(base.getUnit_price(),base.getShop_weight(),productMapping.getSpecValue(),productMapping.getSpecUnit());
|
||||||
|
BigDecimal itemPrice=bigDecimals[0].multiply(premiumRate).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
addShopProductSpecItem.setItemPrice(itemPrice);
|
||||||
|
addShopProductSpecItem.setMarketPrice(bigDecimals[0]);
|
||||||
addShopProductSpecItem.setItemQuantity(bigDecimals[1]);
|
addShopProductSpecItem.setItemQuantity(bigDecimals[1]);
|
||||||
Integer Spec_item_id = null;
|
Integer Spec_item_id = null;
|
||||||
addShopProductSpecItem.setUpdate(true);
|
addShopProductSpecItem.setUpdate(true);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user