diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java index 673a53b0..68f73794 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java @@ -286,6 +286,7 @@ public class XhpcPileOrderController extends BaseController { totalPower =totalPower+cacheOrderData.getT4PowerQuantity(); powerPrice=powerPrice.add(multiply); } + powerPrice =powerPrice.setScale(2,BigDecimal.ROUND_DOWN); //总服务费 BigDecimal servicePrice = money.subtract(powerPrice); //剩余的电费 @@ -600,17 +601,17 @@ public class XhpcPileOrderController extends BaseController { xhpcHistoryOrder.setSortingStatus(0); xhpcHistoryOrder.setType(1); //订单总价---运维服务费抽成 - xhpcHistoryOrder.setTotalPrice(money.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setPromotionDiscount(promotionDiscount.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setActPrice(actPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setActPowerPrice(surplusPowerPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setActServicePrice(surplusServicePrice.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setInternetCommission(internetCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setInternetSvcCommission(internetSvcCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setPlatformCommission(platformCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setPlatformSvcCommisssion(platformSvcCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setOperationCommission(operationCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setOperationSvcCommission(operationSvcCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); + xhpcHistoryOrder.setTotalPrice(money.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setPromotionDiscount(promotionDiscount.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setActPrice(actPrice.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setActPowerPrice(surplusPowerPrice.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setActServicePrice(surplusServicePrice.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setInternetCommission(internetCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setInternetSvcCommission(internetSvcCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setPlatformCommission(platformCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setPlatformSvcCommisssion(platformSvcCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setOperationCommission(operationCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setOperationSvcCommission(operationSvcCommission.setScale(2, BigDecimal.ROUND_DOWN)); xhpcHistoryOrder.setStartSoc(xhpcChargeOrder.getStartSoc()); xhpcHistoryOrder.setEndSoc(xhpcChargeOrder.getEndSoc()); xhpcHistoryOrder.setReconciliationStatus(0); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index 14696707..910d0446 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -341,17 +341,17 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { xhpcHistoryOrder.setSortingStatus(0); xhpcHistoryOrder.setType(1); //订单总价---运维服务费抽成 - xhpcHistoryOrder.setTotalPrice(money.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setPromotionDiscount(promotionDiscount.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setActPrice(actPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setActPowerPrice(surplusPowerPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setActServicePrice(surplusServicePrice.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setInternetCommission(internetCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setInternetSvcCommission(internetSvcCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setPlatformCommission(platformCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setPlatformSvcCommisssion(platformSvcCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setOperationCommission(operationCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); - xhpcHistoryOrder.setOperationSvcCommission(operationSvcCommission.setScale(2, BigDecimal.ROUND_HALF_UP)); + xhpcHistoryOrder.setTotalPrice(money.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setPromotionDiscount(promotionDiscount.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setActPrice(actPrice.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setActPowerPrice(surplusPowerPrice.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setActServicePrice(surplusServicePrice.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setInternetCommission(internetCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setInternetSvcCommission(internetSvcCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setPlatformCommission(platformCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setPlatformSvcCommisssion(platformSvcCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setOperationCommission(operationCommission.setScale(2, BigDecimal.ROUND_DOWN)); + xhpcHistoryOrder.setOperationSvcCommission(operationSvcCommission.setScale(2, BigDecimal.ROUND_DOWN)); xhpcHistoryOrder.setStartSoc(xhpcChargeOrder.getStartSoc()); xhpcHistoryOrder.setEndSoc(xhpcChargeOrder.getEndSoc()); xhpcHistoryOrder.setReconciliationStatus(0); @@ -376,21 +376,21 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { xhpcHistoryOrderService.insert(xhpcHistoryOrder); //添加流水 - xhpcChargeOrderService.addUserAccountStatement(userId, actPrice.negate(), subtract, xhpcChargeOrder.getChargeOrderId(), 3, date); + //xhpcChargeOrderService.addUserAccountStatement(userId, actPrice.negate(), subtract, xhpcChargeOrder.getChargeOrderId(), 3, date); try{ - Map xhpcChargingPile = xhpcChargeOrderService.getXhpcChargingPile(xhpcChargeOrder.getTerminalId()); - if(xhpcChargingPile !=null){ - //发送短信 - if(user.get("phone") !=null){ - if("1".equals(xhpcChargingPile.get("type").toString())){ - String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。"; - smsService.sendNotice(user.get("phone").toString(),content); - }else{ - String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。"; - smsService.sendNotice(user.get("phone").toString(),content); - } - } - } +// Map xhpcChargingPile = xhpcChargeOrderService.getXhpcChargingPile(xhpcChargeOrder.getTerminalId()); +// if(xhpcChargingPile !=null){ +// //发送短信 +// if(user.get("phone") !=null){ +// if("1".equals(xhpcChargingPile.get("type").toString())){ +// String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。"; +// smsService.sendNotice(user.get("phone").toString(),content); +// }else{ +// String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。"; +// smsService.sendNotice(user.get("phone").toString(),content); +// } +// } +// } }catch (Exception e){ logger.info("<<<<<<<<<<<<<<<<发送短信失败>>>>>>>>>>>>>>>>>"); } @@ -398,7 +398,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { executorService.execute(new Runnable() { @Override public void run() { - addPileEndOrder(xhpcHistoryOrder, xhpcChargeOrder, xhpcChargeOrder.getSerialNumber(),1); + // addPileEndOrder(xhpcHistoryOrder, xhpcChargeOrder, xhpcChargeOrder.getSerialNumber(),1); } }); } @@ -412,7 +412,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService { double time = (updateTime2.getTime()-startTime2.getTime())/60000; BigDecimal decimal = new BigDecimal(time).setScale(2); //每分钟多少度 - BigDecimal degree =chargingDegree.divide(decimal,2,BigDecimal.ROUND_HALF_UP); + BigDecimal degree =chargingDegree.divide(decimal,2,BigDecimal.ROUND_DOWN); //获取费率时间段 String startTime = DateUtil.formatTime(startTime2); String endTime = DateUtil.formatTime(updateTime2);