Commit 1517e55f by 李东升

优化计费规则实现以及添加首时段计费

parent 769482ef
package com.huaching.parking.local.parking_local_general.command;
import com.huaching.parking.local.parking_local_general.domain.local.bo.ThsRequestChargeAbstract;
import com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.ThsRequestChargeAbstract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
......
package com.huaching.parking.local.parking_local_general.domain.local.bo;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.enums.local.RequestChargeTypeEnums;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
/**
* @program: parking_local_general
* @description: 按照时间间隔计算费用
* @author: lidongsheng
* @createData: 2020-04-26 10:31
* @updateAuthor: lidongsheng
* @updateData: 2020-04-26 10:31
* @updateContent: 按照时间间隔计算费用
* @Version: 1.0.0
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
@Component
public class ThsIntervalPayableMoney implements ThsRequestChargeAbstract {
private static final Logger logger = LoggerFactory.getLogger(ThsIntervalPayableMoney.class);
@Override
public Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime) {
String chargeDetails = thsChargingRulesPO.getChargeDetails();
return intervalPayableMoney(JSON.parseObject(chargeDetails, IntervalChargeDetail.class), inTime, thsChargingRulesPO.getFreeTime()
, thsChargingRulesPO.getMaxOneTimeMoney());
}
@Override
public Integer getType() {
return RequestChargeTypeEnums.INTERVAL.getCode();
}
/**
* 按照间隔收费
*
* @param detail
* @param inTime 计费开始时间
* @param freeTime 免费时长(分钟)
* @param maxOneTimeMoney 一次停车的最高费用(单位分)
* @return
*/
public Integer intervalPayableMoney(IntervalChargeDetail detail, Date inTime,
Integer freeTime, Integer maxOneTimeMoney) {
inTime = DateUtils.getNextMinute(inTime, freeTime);
long sumMoney = 0;
switch (detail.frameType) {
//按照分钟收费
case 0:
long minute = DateUtils.subDate(inTime, new Date(), 2);
sumMoney = (minute / detail.intervalTime) * detail.money;
break;
//按照小时收费
case 1:
long hour = DateUtils.subDate(inTime, new Date(), 3);
sumMoney = (hour / detail.intervalTime) * detail.money;
break;
//按照固定收费
default:
sumMoney = (DateUtils.subDate(inTime, new Date(), 2) / detail.intervalTime) * detail.money;
break;
}
sumMoney = sumMoney > maxOneTimeMoney ? maxOneTimeMoney : sumMoney;
return (int) sumMoney;
}
/**
* 按照间隔收费
* "frameType": 0 按分钟收费
* "frameType": 1 按小时收费
*/
static class IntervalChargeDetail {
private Integer money;
private Integer frameType;
//间隔时长
private Integer intervalTime;
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
public Integer getFrameType() {
return frameType;
}
public void setFrameType(Integer frameType) {
this.frameType = frameType;
}
public Integer getIntervalTime() {
return intervalTime;
}
public void setIntervalTime(Integer intervalTime) {
this.intervalTime = intervalTime;
}
}
}
package com.huaching.parking.local.parking_local_general.domain.local.dto.response;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.local.bo.ThsRequestChargeBO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.BaseDTO;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsParkingRecordsPO;
import com.huaching.parking.local.parking_local_general.service.local.PaymentChargesServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.UUID;
/**
* @program: parking_local_general
......
package com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 首时段收费
* @author: lidongsheng
* @createData: 2020-05-27 10:39
* @updateAuthor: lidongsheng
* @updateData: 2020-05-27 10:39
* @updateContent:
* @Version: 1.0.0
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class BaseChargeDetailPOJO<T> {
//首时段的时间
private Integer fastTime;
//首时段类型 0 按分钟 1按小时
private Integer fastFrameType;
//首时段金额
private Integer fastMoney;
private T data;
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public Integer getFastTime() {
return fastTime;
}
public void setFastTime(Integer fastTime) {
this.fastTime = fastTime;
}
public Integer getFastFrameType() {
return fastFrameType;
}
public void setFastFrameType(Integer fastFrameType) {
this.fastFrameType = fastFrameType;
}
public Integer getFastMoney() {
return fastMoney;
}
public void setFastMoney(Integer fastMoney) {
this.fastMoney = fastMoney;
}
/**
* 验证是否还在首时段内
*
* @param detail
* @param inTime
* @param endTime
* @return
*/
public boolean validateFirstTime(BaseChargeDetailPOJO detail, Date inTime, Date endTime) {
Date temp = inTime;
if (detail.getFastFrameType()== null) {
detail.setFastFrameType(0);
}
int dateNum = Math.toIntExact(DateUtils.subDate(inTime, endTime, detail.getFastFrameType() + 2));
return dateNum <= detail.getFastTime();
}
}
package com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator;
/**
* @program: parking_local_general
* @description: 按照间隔收费
* @author: lidongsheng
* @createData: 2020-05-27 10:47
* @updateAuthor: lidongsheng
* @updateData: 2020-05-27 10:47
* @updateContent: 按照间隔收费
* @Version: 1.0.0
* @email: lidongshenglife@163.com
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
/*
首时段:2小时10元
后续:每间隔10分钟收费10元
{
"fastTime": 2,
"frameType": 1,
"fastMoney": 100,
"data": {
//金额
"money": 100,
//时间类型
"frameType": 0,
//间隔时长
"intervalTime": 10
}
}
*/
public class IntervalChargeDetailPOJO {
private Integer money;
private Integer frameType;
//间隔时长
private Integer intervalTime;
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
public Integer getFrameType() {
return frameType;
}
public void setFrameType(Integer frameType) {
this.frameType = frameType;
}
public Integer getIntervalTime() {
return intervalTime;
}
public void setIntervalTime(Integer intervalTime) {
this.intervalTime = intervalTime;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator;
/**
* @program: parking_local_general
* @description: 一次收费
* @author: lidongsheng
* @createData: 2020-05-27 11:03
* @updateAuthor: lidongsheng
* @updateData: 2020-05-27 11:03
* @updateContent: 一次收费
* @Version: 1.0.0
* @email: lidongshenglife@163.com
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
public class OneTimeChargeDetailPOJO {
private Integer money;
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
}
package com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator;
import java.util.List;
/**
* @program: parking_local_general
* @description: 按照时段收费
* @author: lidongsheng
* @createData: 2020-05-27 10:53
* @updateAuthor: lidongsheng
* @updateData: 2020-05-27 10:53
* @updateContent: 按照时段收费
* @Version: 1.0.0
* @email: lidongshenglife@163.com
* @blog: www.b0c0.com
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
/*
TimeFrameChargeDetail:
首时段:30分钟 收费5元
后续:
00:00-07:00时间端内每分钟收费2元
07:00-20:30时间端内每小时钟收费4元
20:30-00:00时间端内一共收费3元
//json数组
{
"fastTime": 30,
"frameType": 0,
"fastMoney": 50,
"data": [
{
//"frameType": 0 按分钟收费
"frameType": 0,
"beginTime": "00:00",
"endTime": "07:00",
//表示在00:00-07:00时间端内每分钟收费2元
"money": 200
},
{
//"frameType": 1 按小时收费
"frameType": 1,
"beginTime": "07:00",
"endTime": "20:30",
//表示在07:00-20:30时间端内每小时钟收费4元
"money": 400
},
{
//"frameType": 2 按固定收费
"frameType": 2,
"beginTime": "20:30",
"endTime": "00:00",
//表示在20:30-00:00时间端内一共收费3元
"money": 300
}
]
}
*/
public class TimeFrameChargeDetailPOJO {
private String beginTime;
private String endTime;
private Integer money;
private Integer frameType;
public Integer getFrameType() {
return frameType;
}
public void setFrameType(Integer frameType) {
this.frameType = frameType;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
}
package com.huaching.parking.local.parking_local_general.service.local;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.local.bo.ThsRequestChargeBO;
import com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.ThsRequestChargeService;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ManualCarOutDTO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ThsCarInDTO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ThsCarOutDTO;
......@@ -10,9 +9,7 @@ import com.huaching.parking.local.parking_local_general.domain.local.dto.request
import com.huaching.parking.local.parking_local_general.domain.local.dto.response.ThsRequestChargeDTO;
import com.huaching.parking.local.parking_local_general.domain.local.po.*;
import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEnums;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.base.*;
import com.huaching.parking.local.parking_local_general.service.zhaf.RemoteRequestService;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -59,7 +56,7 @@ public class LocalCarInAndOutServiceImpl implements LocalCarInAndOutService {
private PaymentChargesService paymentChargesService;
@Autowired
private ThsRequestChargeBO thsRequestChargeBO;
private ThsRequestChargeService thsRequestChargeService;
@Autowired
private PayOrderRecordsService payOrderRecordsService;
......@@ -273,7 +270,7 @@ public class LocalCarInAndOutServiceImpl implements LocalCarInAndOutService {
logger.error("未查询到 parkCode -> {} 配置收费规则", parkCode);
return null;
}
return thsRequestChargeBO.getPayableMoney(thsChargingRulesPO, carNo, thsParkingRecordsPO.getInTime());
return thsRequestChargeService.getPayableMoney(thsChargingRulesPO, carNo, thsParkingRecordsPO.getInTime());
} catch (Exception ex) {
logger.error("出场请求费用出错, parkCode -> {} ,carNo -> {}", parkCode, carNo);
return null;
......
package com.huaching.parking.local.parking_local_general.service.local;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.domain.ResponseResult;
import com.huaching.parking.local.parking_local_general.domain.local.bo.ThsRequestChargeBO;
import com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.ThsRequestChargeService;
import com.huaching.parking.local.parking_local_general.domain.local.dto.request.ThsPaySyncDTO;
import com.huaching.parking.local.parking_local_general.domain.local.dto.response.ThsRequestChargeDTO;
import com.huaching.parking.local.parking_local_general.domain.local.po.*;
......@@ -10,8 +9,7 @@ import com.huaching.parking.local.parking_local_general.enums.local.ReasonCodeEn
import com.huaching.parking.local.parking_local_general.factory.ThreadPoolFactory;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.base.*;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import com.huaching.parking.local.parking_local_general.util.local.chargeCalculator.ChargeCalculatorUtil;
import com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old.ChargeCalculatorUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -55,7 +53,7 @@ public class PaymentChargesServiceImpl implements PaymentChargesService {
private LocalCarInAndOutService localCarInAndOutService;
@Autowired
private ThsRequestChargeBO thsRequestChargeBO;
private ThsRequestChargeService thsRequestChargeService;
@Autowired
private ChargeCalculatorUtil chargeCalculatorUtil;
......@@ -84,7 +82,7 @@ public class PaymentChargesServiceImpl implements PaymentChargesService {
return ThsRequestChargeDTO.errorMsg("该车场未配置收费规则");
}
thsParkingRecordsId = thsParkingRecordsPO.getId();
payableMoney = thsRequestChargeBO.getPayableMoney(thsChargingRulesPO, carNo, thsParkingRecordsPO.getInTime());
payableMoney = thsRequestChargeService.getPayableMoney(thsChargingRulesPO, carNo, thsParkingRecordsPO.getInTime());
totalMoney = payableMoney < 0 ? 0 : payableMoney;
payableMoney -= thsParkingRecordsPO.getPayedMoney();
payableMoney = payableMoney < 0 ? 0 : payableMoney;
......@@ -106,6 +104,7 @@ public class PaymentChargesServiceImpl implements PaymentChargesService {
}
@Override
@GeneralPrintLogAOP(value = "场内付请求费用 old", jsonSubs = {-1})
public ThsRequestChargeDTO requestChargeOld(String parkCode, String carNo) {
Integer thsParkingRecordsId;
String orderNo;
......
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator.BaseChargeDetailPOJO;
import com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator.IntervalChargeDetailPOJO;
import com.huaching.parking.local.parking_local_general.enums.local.RequestChargeTypeEnums;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.Calendar;
import java.util.Date;
/**
* @program: parking_local_general
* @description: 按照时间间隔计算费用
* @author: lidongsheng
* @createData: 2020-04-26 10:31
* @updateAuthor: lidongsheng
* @updateData: 2020-04-26 10:31
* @updateContent: 按照时间间隔计算费用
* @Version: 1.0.0
* ************************************************
* Copyright @ 李东升 2020. All rights reserved
* ************************************************
*/
/*
//表示每2分钟收费10元
IntervalChargeDetail:
"data":{
//金额
"money": 100,
// 0 分钟 1 小时
"frameType": 0,
// 时间
"intervalTime": 2
}
*/
@Component
public class ThsIntervalPayableMoney implements ThsRequestChargeAbstract {
private static final Logger logger = LoggerFactory.getLogger(ThsIntervalPayableMoney.class);
@Override
public Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime,Date endTime) {
String chargeDetails = thsChargingRulesPO.getChargeDetails();
BaseChargeDetailPOJO<IntervalChargeDetailPOJO> baseChargeDetailPOJO =
JSON.parseObject(chargeDetails, new TypeReference<BaseChargeDetailPOJO<IntervalChargeDetailPOJO>>() {
});
return intervalPayableMoney(baseChargeDetailPOJO, inTime, endTime, thsChargingRulesPO.getFreeTime()
, thsChargingRulesPO.getMaxOneTimeMoney());
}
@Override
public Integer getType() {
return RequestChargeTypeEnums.INTERVAL.getCode();
}
/**
* 按照间隔收费
*
* @param detail
* @param inTime 计费开始时间
* @param freeTime 免费时长(分钟)
* @param maxOneTimeMoney 一次停车的最高费用(单位分)
* @return
*/
public Integer intervalPayableMoney(BaseChargeDetailPOJO<IntervalChargeDetailPOJO> detail, Date inTime, Date endTime,
Integer freeTime, Integer maxOneTimeMoney) {
inTime = DateUtils.getNextMinute(inTime, freeTime);
//1. 判断是否在免费时长内
if (inTime.after(endTime)) {
return 0;
}
long sumMoney = detail.getFastMoney();
//2. 判断是否在首时段内
if (detail.validateFirstTime(detail, inTime, endTime)) {
return Math.toIntExact(sumMoney);
}
//3. 加上首时段的时间
int[] dateType = {Calendar.MINUTE, Calendar.HOUR_OF_DAY};
inTime = DateUtils.calAddDate(inTime, detail.getFastTime(), dateType[detail.getFastFrameType()]);
//4. 计算费用
int dateNum = Math.toIntExact(DateUtils.subDate(inTime, endTime, detail.getData().getFrameType() + 2));
sumMoney += (dateNum / detail.getData().getIntervalTime()) * detail.getData().getMoney();
sumMoney = sumMoney > maxOneTimeMoney ? maxOneTimeMoney : sumMoney;
return Math.toIntExact(sumMoney);
}
public static void main(String[] args) {
ThsChargingRulesPO thsChargingRulesPO = new ThsChargingRulesPO();
thsChargingRulesPO.setFreeTime(10);
thsChargingRulesPO.setChargeType(RequestChargeTypeEnums.INTERVAL.getCode());
thsChargingRulesPO.setMaxOneTimeMoney(20000000);
thsChargingRulesPO.setChargeDetails("{\n" +
" \"fastTime\": 0,\n" +
" \"frameType\": 0,\n" +
" \"fastMoney\": 0,\n" +
" \"data\": {\n" +
" \"money\": 100,\n" +
" \"frameType\": 0,\n" +
" \"intervalTime\": 2\n" +
" }\n" +
"}");
ThsIntervalPayableMoney payableMoney = new ThsIntervalPayableMoney();
Integer money = payableMoney.getPayableMoney(thsChargingRulesPO,
DateUtils.stringConvertDate("2020-05-27 06:25:20", 3),
DateUtils.stringConvertDate("2020-05-27 15:24:20", 3));
System.out.println(money);
}
}
package com.huaching.parking.local.parking_local_general.domain.local.bo;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator.BaseChargeDetailPOJO;
import com.huaching.parking.local.parking_local_general.domain.local.pojo.chargeCalculator.OneTimeChargeDetailPOJO;
import com.huaching.parking.local.parking_local_general.enums.local.RequestChargeTypeEnums;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
......@@ -29,13 +33,46 @@ public class ThsOneTimePayableMoney implements ThsRequestChargeAbstract {
private static final Logger logger = LoggerFactory.getLogger(ThsOneTimePayableMoney.class);
@Override
public Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime) {
public Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime, Date endTime) {
String chargeDetails = thsChargingRulesPO.getChargeDetails();
return (Integer) JSON.parseObject(chargeDetails).get("oneTimeMoney");
BaseChargeDetailPOJO<OneTimeChargeDetailPOJO> detail =
JSON.parseObject(chargeDetails, new TypeReference<BaseChargeDetailPOJO<OneTimeChargeDetailPOJO>>() {
});
inTime = DateUtils.getNextMinute(inTime, thsChargingRulesPO.getFreeTime());
//1. 判断是否在免费时长内
if (inTime.after(endTime)) {
return 0;
}
long sumMoney = detail.getFastMoney();
//2. 判断是否在首时段内
if (detail.validateFirstTime(detail, inTime, endTime)) {
return Math.toIntExact(sumMoney);
}
return detail.getData().getMoney();
}
@Override
public Integer getType() {
return RequestChargeTypeEnums.ONE_TIME.getCode();
}
public static void main(String[] args) {
ThsChargingRulesPO thsChargingRulesPO = new ThsChargingRulesPO();
thsChargingRulesPO.setFreeTime(10);
thsChargingRulesPO.setChargeType(RequestChargeTypeEnums.ONE_TIME.getCode());
thsChargingRulesPO.setMaxOneTimeMoney(20000000);
thsChargingRulesPO.setChargeDetails("{\n" +
" \"fastTime\": 0,\n" +
" \"frameType\": 0,\n" +
" \"fastMoney\": 0,\n" +
" \"data\": {\n" +
" \"money\": 100\n" +
" }\n" +
"}");
ThsOneTimePayableMoney payableMoney = new ThsOneTimePayableMoney();
Integer money = payableMoney.getPayableMoney(thsChargingRulesPO
, DateUtils.stringConvertDate("2020-05-27 06:25:20", 3)
, DateUtils.stringConvertDate("2020-05-27 15:20:20", 3));
System.out.println(money);
}
}
package com.huaching.parking.local.parking_local_general.domain.local.bo;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
......@@ -21,7 +21,7 @@ import java.util.Date;
public interface ThsRequestChargeAbstract {
Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime);
Integer getPayableMoney(ThsChargingRulesPO thsChargingRulesPO, Date inTime,Date endTime);
Integer getType();
}
package com.huaching.parking.local.parking_local_general.domain.local.bo;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator;
import com.alibaba.fastjson.JSON;
import com.huaching.parking.local.parking_local_general.command.RequestChargeCommand;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesPO;
import com.huaching.parking.local.parking_local_general.intercept.local.GeneralPrintLogAOP;
import com.huaching.parking.local.parking_local_general.service.local.MemberCarHelperService;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* @program: parking_local_general
......@@ -31,9 +25,9 @@ import java.util.UUID;
* ************************************************
*/
@Component
public class ThsRequestChargeBO {
public class ThsRequestChargeService {
private static final Logger logger = LoggerFactory.getLogger(ThsRequestChargeBO.class);
private static final Logger logger = LoggerFactory.getLogger(ThsRequestChargeService.class);
@Autowired
private MemberCarHelperService memberCarHelperService;
......@@ -53,7 +47,7 @@ public class ThsRequestChargeBO {
if (memberCarHelperService.vaildMember(thsChargingRulesPO.getParkCode(), carNo) != null) {
return 0;
}
return requestChargeCommand.getProcessor(thsChargingRulesPO.getChargeType()).getPayableMoney(thsChargingRulesPO, inTime);
return requestChargeCommand.getProcessor(thsChargingRulesPO.getChargeType()).getPayableMoney(thsChargingRulesPO, inTime, new Date());
}
}
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
import java.util.Date;
......
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRules24OldPO;
import com.huaching.parking.local.parking_local_general.service.local.base.ChargingRulesOldService;
import com.huaching.parking.local.parking_local_general.service.local.base.impl.ChargingRulesOldServiceImpl;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesFeeOldPO;
import com.huaching.parking.local.parking_local_general.service.local.base.ChargingRulesOldService;
import com.huaching.parking.local.parking_local_general.service.local.base.impl.ChargingRulesOldServiceImpl;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
import org.springframework.stereotype.Service;
......
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesOldPO;
import com.huaching.parking.local.parking_local_general.service.local.base.ChargingRulesOldService;
import com.huaching.parking.local.parking_local_general.service.local.base.impl.ChargingRulesOldServiceImpl;
import com.huaching.parking.local.parking_local_general.util.local.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRules24OldPO;
import com.huaching.parking.local.parking_local_general.domain.local.po.ThsChargingRulesOldPO;
......
package com.huaching.parking.local.parking_local_general.util.local.chargeCalculator;
package com.huaching.parking.local.parking_local_general.service.local.base.chargeCalculator.old;
/**
* Created by sunke on 2018/3/5.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment