From 5e699f1ce6a66d27272c9ae727d94b2e8c945875 Mon Sep 17 00:00:00 2001 From: yuyang Date: Fri, 17 Jun 2022 09:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=B4=BB=E5=8A=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XhpcChargingStationServiceImpl.java | 20 ++++++++++++++++++- .../service/XhpcTerminalServiceImpl.java | 6 ++++++ .../controller/XhpcRefundAuditController.java | 7 ++++--- .../mapper/XhpcRefundOrderMapper.xml | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index ba30f64d..49e783c7 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -782,13 +782,19 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc //判断是否享受活动 Map objectMap = activityDiscountTime(loginUser.getUserid(), new Date(), loginUser.getUserType(), Long.valueOf(map.get("chargingStationId").toString()), loginUser.getTenantId()); if("1".equals(objectMap.get("state").toString())){ - if("1".equals(objectMap.get("totalDiscountType").toString())||"3".equals(objectMap.get("totalDiscountType").toString())){ + if("1".equals(objectMap.get("totalDiscountType").toString())){ BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP)); powerFee = powerFee.subtract(powerFee.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP)); map.put("activityServiceFee", serviceFee); map.put("activityPowerFee", powerFee); map.put("activityMoney", serviceFee.add(powerFee)); + }else if ("3".equals(objectMap.get("totalDiscountType").toString())){ + BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); + serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).divide(new BigDecimal(2),2,BigDecimal.ROUND_HALF_UP)); + map.put("activityServiceFee", serviceFee); + map.put("activityPowerFee", powerFee); + map.put("activityMoney", serviceFee.add(powerFee)); }else{ BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP)); @@ -874,6 +880,12 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc map.put("activityServiceFee", serviceFee); map.put("activityPowerFee", powerFee); map.put("activityMoney", serviceFee.add(powerFee)); + }else if ("3".equals(objectMap.get("totalDiscountType").toString())){ + BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); + serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).divide(new BigDecimal(2),2,BigDecimal.ROUND_HALF_UP)); + map.put("activityServiceFee", serviceFee); + map.put("activityPowerFee", powerFee); + map.put("activityMoney", serviceFee.add(powerFee)); }else{ BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP)); @@ -917,6 +929,12 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc map.put("activityServiceFee", serviceFee); map.put("activityPowerFee", powerFee); map.put("activityMoney", serviceFee.add(powerFee)); + }else if ("3".equals(objectMap.get("totalDiscountType").toString())){ + BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); + serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).divide(new BigDecimal(2),2,BigDecimal.ROUND_HALF_UP)); + map.put("activityServiceFee", serviceFee); + map.put("activityPowerFee", powerFee); + map.put("activityMoney", serviceFee.add(powerFee)); }else{ BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP)); diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java index 8f43ac98..61610feb 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java @@ -145,6 +145,12 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina map.put("activityServiceFee", serviceFee); map.put("activityPowerFee", powerFee); map.put("activityMoney", serviceFee.add(powerFee)); + }else if ("3".equals(objectMap.get("totalDiscountType").toString())){ + BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); + serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).divide(new BigDecimal(2),2,BigDecimal.ROUND_HALF_UP)); + map.put("activityServiceFee", serviceFee); + map.put("activityPowerFee", powerFee); + map.put("activityMoney", serviceFee.add(powerFee)); }else{ BigDecimal discountRate = new BigDecimal(objectMap.get("totalDiscountRate").toString()).divide(new BigDecimal(100),2, BigDecimal.ROUND_HALF_UP); serviceFee = serviceFee.subtract(serviceFee.multiply(discountRate).setScale(2,BigDecimal.ROUND_HALF_UP)); diff --git a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java index e6622767..b3b10c15 100644 --- a/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java +++ b/xhpc-modules/xhpc-payment/src/main/java/com/xhpc/payment/controller/XhpcRefundAuditController.java @@ -728,6 +728,7 @@ public class XhpcRefundAuditController extends BaseController { logger.info("++++++++++++每20秒,扫描一次,退款订单金额小于100,自动审核通过++++++++++++++++"); try { List list = iXhpcRefundOrderService.moneyPage(1); + logger.info("++++++++++++有自动退款订单+++++list+++++++++++"+list.size()); if(list !=null && list.size()>0){ for (int i = 0; i list = iXhpcRefundOrderService.moneyPage(2); if(list !=null && list.size()>0){ @@ -759,7 +760,7 @@ public class XhpcRefundAuditController extends BaseController { } } }catch (Exception e){ - logger.info("++++++++++++每1分钟,扫描一次,退款订单金额大于100,自动生成工单异常++++++++++++++++"); + logger.info("++++++++++++每10分钟,扫描一次,退款订单金额大于100,自动生成工单异常++++++++++++++++"); e.printStackTrace(); //后期可以增加短信通知 } diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml index 2fdececc..c7e8215a 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRefundOrderMapper.xml @@ -350,7 +350,7 @@ and amount <=100 - + and amount >100