|
@@ -441,20 +441,6 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (null != product.getProductCategory() && 2 == product.getProductCategory()) {
|
|
|
secondHandOrderFlag = true;
|
|
|
}
|
|
|
- // 成本价
|
|
|
- Double costPrice = null;
|
|
|
- // 判断是否选中固定成本价
|
|
|
- if (null != product.getCostPrice() && 1 == product.getCostCheckFlag() && product.getCostPrice() >= 0d) {
|
|
|
- costPrice = product.getCostPrice();
|
|
|
- }
|
|
|
- // 判断是否选中比例成本价
|
|
|
- if (null != product.getCostProportional() && 2 == product.getCostCheckFlag() && product.getCostProportional() > 0d) {
|
|
|
- // 通过售价*比例得到成本价
|
|
|
- costPrice = MathUtil.div(MathUtil.mul(product.getPrice(), product.getCostProportional()), 100).doubleValue();
|
|
|
- }
|
|
|
- if (null == costPrice) {
|
|
|
- return ResponseJson.error("订单商品成本异常!", null);
|
|
|
- }
|
|
|
// 是否添加税费,不含税商品 开票需添加税费
|
|
|
boolean taxFlag = (Integer.valueOf(0).equals(product.getIncludedTax()) && (Integer.valueOf(1).equals(product.getInvoiceType()) || Integer.valueOf(2).equals(product.getInvoiceType())));
|
|
|
Double shopTax = 0d;
|
|
@@ -462,7 +448,6 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
String image = ImageUtil.getImageUrl("product", product.getImage(), domain);
|
|
|
product.setImage(image);
|
|
|
product.setShopName(shopName);
|
|
|
- product.setCostPrice(costPrice);
|
|
|
product.setNum(productNum);
|
|
|
product.setPresentNum(presentNum);
|
|
|
product.setProductType(productType);
|
|
@@ -618,6 +603,21 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
salesObject.put("productCount", product.getNum());
|
|
|
salesInfo.add(salesObject);
|
|
|
}
|
|
|
+ // 成本价
|
|
|
+ Double costPrice = null;
|
|
|
+ // 判断是否选中固定成本价
|
|
|
+ if (null != product.getCostPrice() && 1 == product.getCostCheckFlag() && product.getCostPrice() >= 0d) {
|
|
|
+ costPrice = product.getCostPrice();
|
|
|
+ }
|
|
|
+ // 判断是否选中比例成本价
|
|
|
+ if (null != product.getCostProportional() && 2 == product.getCostCheckFlag() && product.getCostProportional() > 0d) {
|
|
|
+ // 通过售价*比例得到成本价
|
|
|
+ costPrice = MathUtil.div(MathUtil.mul(product.getPrice(), product.getCostProportional()), 100).doubleValue();
|
|
|
+ }
|
|
|
+ if (null == costPrice) {
|
|
|
+ return ResponseJson.error("订单商品成本异常!", null);
|
|
|
+ }
|
|
|
+ product.setCostPrice(costPrice);
|
|
|
// 付供应商税费
|
|
|
if (null == product.getShopTaxRate() || product.getShopTaxRate() <= 0) {
|
|
|
product.setShopTaxRate(product.getTaxRate());
|