|
@@ -507,7 +507,8 @@ public class PayOrderController {
|
|
|
discountAmt = oilLiters.multiply(new BigDecimal(customerGradeInfo.get(0).get("gasoilDiscountLitre").toString()));
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -522,7 +523,8 @@ public class PayOrderController {
|
|
|
discountAmt = oilLiters.multiply(new BigDecimal(customerGradeList.get(0).get("gasoilDiscountLitre").toString()));
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -553,13 +555,14 @@ public class PayOrderController {
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt); //实收金额
|
|
|
oilLiters = receivableAmt_b.divide(new BigDecimal(oilPrice),2, BigDecimal.ROUND_HALF_UP); //加油升数
|
|
|
- discountPrice = amt.divide(oilLiters,2,BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters,2,BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
switch (vipDiscountyPlus){
|
|
|
case "1":
|
|
|
Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
|
|
|
discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
|
|
|
amt = amt.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -578,7 +581,8 @@ public class PayOrderController {
|
|
|
Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
|
|
|
discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
|
|
|
amt = amt.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -615,13 +619,15 @@ public class PayOrderController {
|
|
|
discountAmt = gasoilDiscountAmt_b; //优惠金额
|
|
|
amt = receivableAmt_b.subtract(gasoilDiscountAmt_b); //实收金额
|
|
|
oilLiters = receivableAmt_b.divide(new BigDecimal(oilPrice), 2, BigDecimal.ROUND_HALF_UP); //加油升数
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
switch (vipDiscountyPlus){
|
|
|
case "1":
|
|
|
Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
|
|
|
discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
|
|
|
amt = amt.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -641,7 +647,8 @@ public class PayOrderController {
|
|
|
Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
|
|
|
discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
|
|
|
amt = amt.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -681,14 +688,16 @@ public class PayOrderController {
|
|
|
discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
//是否共享会员优惠叠加
|
|
|
String vipDiscountyPlus_3 = m.get("vipDiscountyPlus").toString();
|
|
|
if(vipDiscountyPlus_3.equals("1")){
|
|
|
Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
|
|
|
discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
|
|
|
amt = amt.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
@@ -702,14 +711,16 @@ public class PayOrderController {
|
|
|
discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
+ discountPrice = oilLiters !=new BigDecimal("0.00") ? amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP) : new BigDecimal(oilPrice);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP); //优惠价格
|
|
|
//是否共享会员优惠叠加
|
|
|
String vipDiscountyPlus_3 = m.get("vipDiscountyPlus").toString();
|
|
|
if(vipDiscountyPlus_3.equals("1")){
|
|
|
Map<String, Object> map = this.calcuteDengJiZhiJiang(params);
|
|
|
discountAmt = discountAmt.add(new BigDecimal(map.get("discountAmt").toString()));
|
|
|
amt = amt.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
@@ -759,7 +770,8 @@ public class PayOrderController {
|
|
|
discountAmt = oilLiters.multiply(new BigDecimal(customerGradeInfo.get(0).get("gasoilDiscountLitre").toString()));
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|
|
@@ -774,7 +786,8 @@ public class PayOrderController {
|
|
|
discountAmt = oilLiters.multiply(new BigDecimal(customerGradeList.get(0).get("gasoilDiscountLitre").toString()));
|
|
|
discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
amt = receivableAmt_b.subtract(discountAmt);
|
|
|
- discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? new BigDecimal(oilPrice) : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ //discountPrice = amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
resultMap.put("discountAmt", discountAmt.doubleValue());
|
|
|
resultMap.put("amt", amt.doubleValue());
|
|
|
resultMap.put("oilLiters", oilLiters.doubleValue());
|