|
@@ -1780,21 +1780,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(goodsDto.get("actualPaymentAmount") instanceof Double){
|
|
|
- goodsEntity.setStoreRetailPrice(new BigDecimal((Double)goodsDto.get("actualPaymentAmount")));
|
|
|
-
|
|
|
- }else if(goodsDto.get("actualPaymentAmount") instanceof Integer){
|
|
|
- goodsEntity.setStoreRetailPrice(new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }else if(goodsDto.get("actualPaymentAmount") instanceof Float){
|
|
|
- goodsEntity.setStoreRetailPrice(new BigDecimal((Float)goodsDto.get("actualPaymentAmount")));
|
|
|
-
|
|
|
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
if(goodsDto.get("retailPrice") instanceof Double){
|
|
|
goodsEntity.setRetailPrice(new BigDecimal((Double)goodsDto.get("retailPrice"))); // 单价
|
|
|
|
|
@@ -1819,14 +1806,25 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(goodsDto.get("goodstaxes") instanceof Double){
|
|
|
- totalTax = totalTax.add(new BigDecimal((Double)goodsDto.get("goodstaxes"))); // 实际支付价格
|
|
|
- }else if(goodsDto.get("goodstaxes") instanceof Integer){
|
|
|
- totalTax = totalTax.add(new BigDecimal((Integer)goodsDto.get("goodstaxes")));
|
|
|
- }else if(goodsDto.get("goodstaxes") instanceof Float){
|
|
|
- totalTax = totalTax.add(new BigDecimal((Float)goodsDto.get("goodstaxes")));
|
|
|
- }else if(goodsDto.get("goodstaxes") instanceof String){
|
|
|
- totalTax = totalTax.add(new BigDecimal((String) goodsDto.get("goodstaxes")));
|
|
|
+ Object taxObject = goodsDto.get("goodstaxes");
|
|
|
+ BigDecimal tax = new BigDecimal(0);
|
|
|
+ if(taxObject instanceof Double){
|
|
|
+ tax = new BigDecimal((Double) taxObject);
|
|
|
+ }else if(taxObject instanceof Integer){
|
|
|
+ tax = new BigDecimal((Integer) taxObject);
|
|
|
+ }else if(taxObject instanceof Float){
|
|
|
+ tax = new BigDecimal((Float) taxObject);
|
|
|
+ }else if(taxObject instanceof String){
|
|
|
+ tax = new BigDecimal((String) taxObject) ;
|
|
|
+ }
|
|
|
+ totalTax = totalTax.add(tax); // 计算总的税额
|
|
|
+
|
|
|
+ if(goodsDto.get("actualPaymentAmount") instanceof Double){
|
|
|
+ goodsEntity.setStoreRetailPrice(new BigDecimal((Double)goodsDto.get("actualPaymentAmount")));
|
|
|
+ }else if(goodsDto.get("actualPaymentAmount") instanceof Integer){
|
|
|
+ goodsEntity.setStoreRetailPrice(new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
|
|
|
+ }else if(goodsDto.get("actualPaymentAmount") instanceof Float){
|
|
|
+ goodsEntity.setStoreRetailPrice(new BigDecimal((Float)goodsDto.get("actualPaymentAmount")));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2420,8 +2418,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
fullCutCouponDec = fullCutCouponDec.add(couponPrice).setScale(2,RoundingMode.HALF_UP);
|
|
|
|
|
|
// 加上税额
|
|
|
- goodsTotalPrice = goodsTotalPrice.add(totalTax).setScale(2,RoundingMode.HALF_UP);
|
|
|
- orderTotalPrice = orderTotalPrice.add(totalTax).setScale(2,RoundingMode.HALF_UP);
|
|
|
+ goodsTotalPrice = goodsTotalPrice.subtract(totalTax).setScale(2,RoundingMode.HALF_UP);
|
|
|
|
|
|
|
|
|
|
|
@@ -2459,9 +2456,9 @@ public class OrderServiceImpl implements OrderService {
|
|
|
//留言
|
|
|
orderInfo.setPostscript("无");
|
|
|
orderInfo.setAdd_time(new Date());
|
|
|
- orderInfo.setGoods_price(goodsTotalPrice);
|
|
|
+ orderInfo.setGoods_price(goodsTotalPrice); // 商品总价
|
|
|
orderInfo.setOrder_price(orderTotalPrice);
|
|
|
- orderInfo.setActual_price(actualPrice);
|
|
|
+ orderInfo.setActual_price(actualPrice); // 实际支付金额
|
|
|
orderInfo.setOrder_type("1");
|
|
|
orderInfo.setOrder_status(0);
|
|
|
orderInfo.setShipping_status(0);
|
|
@@ -2514,7 +2511,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
BigDecimal goodsTotal = goodsDto.getStoreRetailPrice().multiply(number);//单商品总价
|
|
|
BigDecimal rate = goodsTotal.divide(orderInfo.getGoods_price(),2, BigDecimal.ROUND_HALF_UP);//当前商品总价/订单总价(不含运费、不含优惠券)
|
|
|
BigDecimal freightPrice = BigDecimal.valueOf(orderInfo.getFreight_price());
|
|
|
- BigDecimal settlePrice = Constant.ZERO;
|
|
|
+ BigDecimal settlePrice = Constant.ZERO; // ccnet 取的这个而价格
|
|
|
if(orderInfo.getFreight_price() != 0 && !"0".equalsIgnoreCase(orderInfo.getCoupon_price()+"")){
|
|
|
//运费-优惠券
|
|
|
BigDecimal rateTotal = freightPrice.subtract(orderInfo.getCoupon_price());
|