|
|
@ -581,10 +581,19 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
if (busSalesOrderDiscountDetailsVoList.size() != 0) { |
|
|
|
vo.setBusSalesOrderDiscountList(busSalesOrderDiscountDetailsVoList); |
|
|
|
} |
|
|
|
List<AppOrderDiscountListVo> discountList = busSalesOrderDiscountService.selectDiscount(sid); |
|
|
|
discountList.removeAll(Collections.singleton(null)); |
|
|
|
if (!discountList.isEmpty()) { |
|
|
|
BigDecimal bigDecimalAll = new BigDecimal("0"); |
|
|
|
for (AppOrderDiscountListVo v : discountList) { |
|
|
|
bigDecimalAll = bigDecimalAll.add(new BigDecimal(v.getTotal())); |
|
|
|
} |
|
|
|
vo.setTotaldiscount(bigDecimalAll.toString()); |
|
|
|
} |
|
|
|
/*************************************************价格信息*****************************************************/ |
|
|
|
BusSalesOrderPriceDetailsVo busSalesOrderPriceDetailsVo = busSalesOrderPriceService.details(entity.getSid()); |
|
|
|
//计算单台折让
|
|
|
|
BigDecimal bigDecimalSing = new BigDecimal("0"); |
|
|
|
/* BigDecimal bigDecimalSing = new BigDecimal("0"); |
|
|
|
if (busSalesOrderPriceDetailsVo != null) { |
|
|
|
//销售指导价-成交价+单车优惠包成本+单车返利):***元(单车优惠包成本是总优惠包价值除以台数)
|
|
|
|
if (StringUtils.isNotBlank(busSalesOrderPriceDetailsVo.getSingleGuildPrice())) { |
|
|
@ -622,7 +631,26 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
if (busSalesOrderPriceDetailsVo != null) { |
|
|
|
busSalesOrderPriceDetailsVo.setBigDecimalSing(bigDecimalSing.toString()); |
|
|
|
}*/ |
|
|
|
BusSalesOrderSubmit busSalesOrderSubmit = busSalesOrderSubmitService.selectBySaleOrderSid(sid); |
|
|
|
//价格折让 = 销售合同价(整体成交价)-销售指导价(整体指导价)
|
|
|
|
//销售合同价-销售指导价
|
|
|
|
BigDecimal all = BigDecimal.ZERO; |
|
|
|
if (StringUtils.isNotBlank(busSalesOrderPriceDetailsVo.getSingleFinalPrice())) { |
|
|
|
all = new BigDecimal(busSalesOrderPriceDetailsVo.getSingleFinalPrice()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(busSalesOrderPriceDetailsVo.getSingleGuildPrice())) { |
|
|
|
all = all.subtract(new BigDecimal(busSalesOrderPriceDetailsVo.getSingleGuildPrice())); |
|
|
|
} |
|
|
|
String priceAll = ""; |
|
|
|
if (all.compareTo(BigDecimal.ZERO) < 0) { |
|
|
|
//如果价格折让小于0,乘以-1
|
|
|
|
all = all.multiply(new BigDecimal(-1)); |
|
|
|
priceAll = "-¥" + all.toString(); |
|
|
|
} else { |
|
|
|
priceAll = "¥" + all.toString(); |
|
|
|
} |
|
|
|
busSalesOrderPriceDetailsVo.setBigDecimalSing(priceAll); |
|
|
|
vo.setBusSalesOrderPrice(busSalesOrderPriceDetailsVo); |
|
|
|
/***************************保险信息***************************************/ |
|
|
|
BusSalesOrderInsuranceDetailsVo busSalesOrderInsurance = busSalesOrderInsuranceService.details(sid); |
|
|
|