|
@@ -292,12 +292,22 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
|
|
p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
|
|
}*/
|
|
}*/
|
|
// 付采美总金额
|
|
// 付采美总金额
|
|
- allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(p.getNum(), p.getCmCostPrice())).doubleValue();
|
|
|
|
|
|
+ allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(MathUtil.sub(p.getNum(),p.getReturnedNum()), p.getCmCostPrice())).doubleValue();
|
|
// 子订单利润
|
|
// 子订单利润
|
|
- if (p.getProductType() == 0) {
|
|
|
|
- brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(), p.getNum())).doubleValue();
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (p.getReturnedNum().equals(p.getNum())) {
|
|
brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
|
|
+ } else if (p.getReturnedNum() < p.getNum()) {
|
|
|
|
+ if (p.getProductType() == 0) {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(), MathUtil.sub(p.getNum(), p.getReturnedNum()))).doubleValue();
|
|
|
|
+ } else {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (p.getProductType() == 0) {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(), p.getNum())).doubleValue();
|
|
|
|
+ } else {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
so.setBrokerage(brokerage);
|
|
so.setBrokerage(brokerage);
|
|
@@ -451,11 +461,22 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
|
|
p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
|
|
p.setDiscountPrice(MathUtil.div(p.getDiscountPrice(), MathUtil.div(MathUtil.add(p.getTaxRate(), 100), 100)).doubleValue());
|
|
}*/
|
|
}*/
|
|
// 付采美总金额
|
|
// 付采美总金额
|
|
- allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(p.getNum(), p.getCmCostPrice())).doubleValue();
|
|
|
|
- if (p.getProductType() == 0) {
|
|
|
|
- brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(), p.getNum())).doubleValue();
|
|
|
|
- } else {
|
|
|
|
|
|
+ allServeAmount = MathUtil.add(allServeAmount, MathUtil.mul(MathUtil.sub(p.getNum(),p.getReturnedNum()), p.getCmCostPrice())).doubleValue();
|
|
|
|
+ // 子订单利润
|
|
|
|
+ if (p.getReturnedNum().equals(p.getNum())) {
|
|
brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
|
|
+ } else if (p.getReturnedNum() < p.getNum()) {
|
|
|
|
+ if (p.getProductType() == 0) {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(), MathUtil.sub(p.getNum(), p.getReturnedNum()))).doubleValue();
|
|
|
|
+ } else {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (p.getProductType() == 0) {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, MathUtil.mul(p.getBrokerage(), p.getNum())).doubleValue();
|
|
|
|
+ } else {
|
|
|
|
+ brokerage = MathUtil.add(brokerage, 0).doubleValue();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
so.setBrokerage(brokerage);
|
|
so.setBrokerage(brokerage);
|