use of com.itrus.portal.db.CertificationCharging 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.CertificationCharging 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.CertificationCharging in project portal by ixinportal.
the class CertificationChargingServiceImpl method getAllAppId.
/**
* 获取计费下所有的应用id
* @return
*/
public Set<Long> getAllAppId() {
Set<Long> set = new TreeSet<Long>();
List<Long> list = new ArrayList<Long>();
List<CertificationCharging> ccList = selectByExample(null);
if (null != ccList && ccList.size() > 0) {
for (CertificationCharging certificationCharging : ccList) {
set.add(certificationCharging.getApp());
}
}
return set;
}
use of com.itrus.portal.db.CertificationCharging in project portal by ixinportal.
the class CertificationChargingServiceImpl method saveOrUpdateCertificationCharging.
/**
* 新增或修改实名认证计费:CertificationCharging
*
* @param certificationCharging
* @return
* @throws Exception
*/
public Map<String, Object> saveOrUpdateCertificationCharging(CertificationCharging certificationCharging) throws Exception {
Map<String, Object> retMap = new HashMap<String, Object>();
retMap.put("flag", false);
// 参数检查,参数不能为null,且结束时间大于起始时间
boolean check = (null != certificationCharging && null != certificationCharging.getApp() && null != certificationCharging.getAccountingStrategy() && null != certificationCharging.getUserGe() && (1 == certificationCharging.getEndTime().compareTo(certificationCharging.getStartTime())));
if (!check) {
retMap.put("retMsg", "实名认证计费表参数不合法,请检查修改后重新提交");
return retMap;
}
CertificationCharging oldCertificationCharging = new CertificationCharging();
// 新增
if (null == certificationCharging.getId()) {
certificationCharging.setCreateTime(new Date());
certificationCharging.setModifyTime(new Date());
certificationCharging = save(certificationCharging);
} else {
// 修改
oldCertificationCharging = getCertificationChargingById(certificationCharging.getId());
// 将前台没有返回的属性值设置后再做对比
certificationCharging = setOldValueInto(certificationCharging, oldCertificationCharging);
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
list = CompareTwoObjectUtils.compareTwoClass(oldCertificationCharging, certificationCharging);
if (list.size() > 0) {
LogUtil.adminlog(sqlSession, "修改实名认证计费规则", "实名认证计费主表中,id为:" + certificationCharging.getId() + ",进行了修改,修改内容为:" + list.toString());
}
Date date = new Date();
certificationCharging.setModifyTime(date);
oldCertificationCharging.setModifyTime(date);
certificationCharging = update(certificationCharging);
}
retMap.put("certificationCharging", certificationCharging);
retMap.put("oldCertificationCharging", oldCertificationCharging);
retMap.put("flag", true);
return retMap;
}
use of com.itrus.portal.db.CertificationCharging 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;
}
Aggregations