use of com.itrus.portal.db.CertificationChargingExample in project portal by ixinportal.
the class CertificationChargingServiceImpl method initCertificationCharging.
/**
* 初始实名认证化计费规则 取出当前有效的计费规则.并存入系统缓存中
*/
public ConcurrentHashMap<String, List<ChargingPrice>> initCertificationCharging() {
ConcurrentHashMap<String, List<ChargingPrice>> chargeRuleMap = new ConcurrentHashMap<String, List<ChargingPrice>>();
CertificationChargingExample cce = new CertificationChargingExample();
CertificationChargingExample.Criteria criteria = cce.or();
Date nowDate = new Date();
criteria.andEndTimeGreaterThan(nowDate);
cce.setOrderByClause("start_time asc");
// 将入以下条件之后,只会加载当前时间处于计费起始终止时间内的计费规则,起始时间比当前时间还晚的就不加载
// 加载一个小时以后也有效的计费规则,避免定时任务的空白期出现无可用计费的规则的情况
Date laterDate = getHourLaterDate(nowDate);
criteria.andStartTimeLessThanOrEqualTo(laterDate);
criteria.andChargingTypeEqualTo(ComNames.CHARGING_TYPE_SMRZ_1);
List<CertificationCharging> certificationChargings = new ArrayList<CertificationCharging>();
certificationChargings = sqlSession.selectList("com.itrus.portal.db.CertificationChargingMapper.selectByExample", cce);
if (null == certificationChargings) {
return chargeRuleMap;
}
for (int i = 0; i < certificationChargings.size(); i++) {
List<ServiceName> serviceNames = serviceNameService.selectListByCertificationChargingId(certificationChargings.get(i).getId());
if (null != serviceNames && serviceNames.size() > 0) {
for (int j = 0; j < serviceNames.size(); j++) {
List<ChargingPrice> chargingPrices = new ArrayList<ChargingPrice>();
chargingPrices = chargingPriceService.selectListByServiceName(serviceNames.get(j));
String key = certificationChargings.get(i).getApp() + "," + serviceNames.get(j).getCertificationServiceId();
chargeRuleMap.put(key, chargingPrices);
}
}
}
return chargeRuleMap;
}
use of com.itrus.portal.db.CertificationChargingExample in project portal by ixinportal.
the class CertificationChargingServiceImpl method selectListByAppId.
/**
* 根据输入的信息,查找对实名认证计费的List
*
* @param appId
* @param isValidity
* @param userGe
* @return
*/
public List<CertificationCharging> selectListByAppId(Long appId, Long userGe) {
List<CertificationCharging> list = new ArrayList<CertificationCharging>();
CertificationChargingExample cce = new CertificationChargingExample();
CertificationChargingExample.Criteria criteria = cce.or();
if (null != appId) {
criteria.andAppEqualTo(appId);
}
// criteria.andIsValidityEqualTo(isValidity);
if (null != userGe) {
criteria.andUserGeEqualTo(userGe);
}
list = sqlSession.selectList("com.itrus.portal.db.CertificationChargingMapper.selectByExample", cce);
return list;
}
use of com.itrus.portal.db.CertificationChargingExample in project portal by ixinportal.
the class CertificationChargingServiceImpl method initCertificationChargingMap.
/**
* 初始化CertificationChargingMap
*/
public ConcurrentHashMap<Long, CertificationCharging> initCertificationChargingMap() {
ConcurrentHashMap<Long, CertificationCharging> certificationChargingMap = new ConcurrentHashMap<Long, CertificationCharging>();
CertificationChargingExample cce = new CertificationChargingExample();
CertificationChargingExample.Criteria criteria = cce.or();
Date nowDate = new Date();
criteria.andEndTimeGreaterThan(nowDate);
cce.setOrderByClause("start_time asc");
// 将入以下条件之后,只会加载当前时间处于计费起始终止时间内的计费规则,起始时间比当前时间还晚的就不加载
// 加载一个小时以后也有效的计费规则,避免定时任务的空白期出现无可用计费的规则的情况
Date laterDate = getHourLaterDate(nowDate);
criteria.andStartTimeLessThanOrEqualTo(laterDate);
List<CertificationCharging> certificationChargings = new ArrayList<CertificationCharging>();
certificationChargings = sqlSession.selectList("com.itrus.portal.db.CertificationChargingMapper.selectByExample", cce);
if (null != certificationChargings && !certificationChargings.isEmpty()) {
for (CertificationCharging certificationCharging : certificationChargings) {
certificationChargingMap.put(certificationCharging.getId(), certificationCharging);
}
}
return certificationChargingMap;
}
use of com.itrus.portal.db.CertificationChargingExample in project portal by ixinportal.
the class CertificationChargingServiceImpl method selectList.
public List<CertificationCharging> selectList(Long appId, Long chargingType) {
List<CertificationCharging> list = new ArrayList<CertificationCharging>();
CertificationChargingExample cce = new CertificationChargingExample();
CertificationChargingExample.Criteria criteria = cce.or();
if (null != appId) {
criteria.andAppEqualTo(appId);
}
if (null != chargingType) {
criteria.andChargingTypeEqualTo(chargingType);
}
list = sqlSession.selectList("com.itrus.portal.db.CertificationChargingMapper.selectByExample", cce);
return list;
}
use of com.itrus.portal.db.CertificationChargingExample in project portal by ixinportal.
the class StoreServiceNameServiceImpl method initServiceNameMap.
/**
* 初始化当前时间内有效的serviceName
* @return
*/
public ConcurrentHashMap<Long, ServiceName> initServiceNameMap() {
ConcurrentHashMap<Long, ServiceName> serviceNameMap = new ConcurrentHashMap<>();
ConcurrentHashMap<String, List<ChargingPrice>> chargeRuleMap = new ConcurrentHashMap<String, List<ChargingPrice>>();
CertificationChargingExample cce = new CertificationChargingExample();
CertificationChargingExample.Criteria criteria = cce.or();
Date nowDate = new Date();
criteria.andEndTimeGreaterThan(nowDate);
cce.setOrderByClause("start_time asc");
// 将入以下条件之后,只会加载当前时间处于计费起始终止时间内的计费规则,起始时间比当前时间还晚的就不加载
// 加载一个小时以后也有效的计费规则,避免定时任务的空白期出现无可用计费的规则的情况
Date laterDate = storeChargingService.getHourLaterDate(nowDate);
criteria.andStartTimeLessThanOrEqualTo(laterDate);
List<CertificationCharging> certificationChargings = new ArrayList<CertificationCharging>();
certificationChargings = sqlSession.selectList("com.itrus.portal.db.CertificationChargingMapper.selectByExample", cce);
if (null == certificationChargings) {
return serviceNameMap;
}
for (int i = 0; i < certificationChargings.size(); i++) {
List<ServiceName> serviceNames = selectListByCertificationChargingId(certificationChargings.get(i).getId());
if (null != serviceNames && !serviceNames.isEmpty()) {
for (ServiceName serviceName : serviceNames) {
serviceNameMap.put(serviceName.getId(), serviceName);
}
}
}
return serviceNameMap;
}
Aggregations