use of com.itrus.portal.db.MobileAppserviceName 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