use of com.itrus.portal.db.MobileAppserviceCharging in project portal by ixinportal.
the class MobileAppserviceChargingService method getAllAppId.
/**
* 获取计费下所有的应用id
* @return
*/
public Set<Long> getAllAppId() {
Set<Long> set = new TreeSet<Long>();
List<Long> list = new ArrayList<Long>();
List<MobileAppserviceCharging> acList = selectByExample(null);
if (null != acList && acList.size() > 0) {
for (MobileAppserviceCharging appserviceCharging : acList) {
set.add(appserviceCharging.getApp());
}
}
return set;
}
use of com.itrus.portal.db.MobileAppserviceCharging in project portal by ixinportal.
the class MobileAppserviceChargingService method checkTransInfo.
/**
* 根据输入的appid,查看是否有有效的计费规则,能计费则返回true,不能则返回false,请注意,要保证输入的参数都不能为null,且应用存在
*
* @param appId
* ,应用appid
* @param applicationInfo
* ,应用appid对应的applicationInfo对象
* @return
*/
public boolean checkTransInfo(String appId, /*String appServiceId,*/
ApplicationInfo applicationInfo) /*, AppService appService*/
{
// String key = applicationInfo.getId() + ",";/* + appService.getId();*/
ConcurrentHashMap<Long, List<MobileChargingPrice>> chargeRuleMap = CacheCustomer.getMOBILE_CHARGERULE_MAP();
List<MobileChargingPrice> chargingPrices = chargeRuleMap.get(applicationInfo.getId());
ConcurrentHashMap<Long, MobileAppserviceName> serviceNameMap = CacheCustomer.getAPPSERVICENAMEMAP();
if (null != chargingPrices && !chargingPrices.isEmpty()) {
for (MobileChargingPrice chargingPrice : chargingPrices) {
// 校验计费规则对应的时间,是否处于当前时间内,如果不是,则进行下一个计费规则
// getCertificationCharging()
MobileAppserviceCharging certificationCharging = CacheCustomer.getMOBILE_CERTIFICATIONCHARGING_MAP().get(chargingPrice.getAppserviceCharging());
boolean dateFlag = compareDate(new Date(), certificationCharging.getStartTime(), certificationCharging.getEndTime());
if (dateFlag) {
continue;
}
MobileAppserviceName serviceName = serviceNameMap.get(chargingPrice.getAppserviceName());
if (null != serviceName && serviceName.getTotalNumber() < chargingPrice.getMaximumNumber()) {
return true;
}
}
}
return false;
}
Aggregations