退款修改,小程序活动修改

This commit is contained in:
yuyang 2022-06-17 09:57:34 +08:00
parent 712b79d0fa
commit 5e699f1ce6
4 changed files with 30 additions and 5 deletions

View File

@ -782,13 +782,19 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc
//判断是否享受活动
Map<String, Object> 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));

View File

@ -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));

View File

@ -728,6 +728,7 @@ public class XhpcRefundAuditController extends BaseController {
logger.info("++++++++++++每20秒扫描一次退款订单金额小于100自动审核通过++++++++++++++++");
try {
List<Long> list = iXhpcRefundOrderService.moneyPage(1);
logger.info("++++++++++++有自动退款订单+++++list+++++++++++"+list.size());
if(list !=null && list.size()>0){
for (int i = 0; i <list.size() ; i++) {
Long aLong = list.get(i);
@ -744,10 +745,10 @@ public class XhpcRefundAuditController extends BaseController {
//后期可以增加短信通知
}
}
@Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0/10 * * * ?")
@GetMapping("/moneyPageTime")
public void moneyPageTime(){
logger.info("++++++++++++每1分钟扫描一次退款订单金额大于100自动生成工单++++++++++++++++");
logger.info("++++++++++++每10分钟扫描一次退款订单金额大于100自动生成工单++++++++++++++++");
try {
List<Long> 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();
//后期可以增加短信通知
}

View File

@ -350,7 +350,7 @@
<if test="type==1">
and amount &lt;=100
</if>
<if test="type=2">
<if test="type==2">
and amount &gt;100
</if>
</select>