/**
  * 保存
  *
  * @param customerInfor
  * @param riskAttribute
  * @return
  */
 public void saveOnlineRiskCustomer(CustomerInfor customerInfor, RiskAttribute riskAttribute) {
   RiskCustomerFilter filter = new RiskCustomerFilter();
   filter.setCustomerId(customerInfor.getId());
   filter.setRiskAttribute(riskAttribute.getRiskAttribute());
   // 判断是否在风险名单中
   if (!riskCustomerService.isInBlacklist(filter)) {
     RiskCustomer riskCustomer = new RiskCustomer();
     riskCustomer.setCustomerId(customerInfor.getId());
     riskCustomer.setRiskLevel(riskAttribute.getRiskLevel());
     riskCustomer.setRefuseReason(riskAttribute.getRiskDes());
     // 风险类型
     riskCustomer.setRiskCreateType(RiskCreateTypeEnum.system.toString());
     riskCustomer.setStatus(RiskCustomerStatusEnum.CONFIRMED_CARDCENTER.toString());
     riskCustomer.setRiskAttribute(riskAttribute.getRiskAttribute());
     riskCustomer.setReportedIdManager(customerInfor.getUserId());
     // 保存
     riskCustomerService.insertRiskCustomer(riskCustomer);
   }
 }
 /**
  * 处理客户信息
  *
  * @param customerInfor
  * @param riskAttribute
  * @return
  */
 public void processRisk(CustomerInfor customerInfor, RiskAttribute riskAttribute) {
   String customerId = customerInfor.getId();
   // 检查多次申请
   if (RiskAttributeEnum.REPEATEDLY.toString().equals(riskAttribute.getRiskAttribute())) {
     CustomerApplicationInfoFilter filter = new CustomerApplicationInfoFilter();
     filter.setCustomerId(customerId);
     // 查询客户申请的卡数
     int count = customerApplicationInfoDao.findCountByFilter(filter);
     // 检查并保存
     checkAndsaveOnlineRiskCustomer(count, customerInfor, riskAttribute);
     // 多张卡
   } else if (RiskAttributeEnum.MANYCARD.toString().equals(riskAttribute.getRiskAttribute())) {
     CardInformationFilter filter = new CardInformationFilter();
     filter.setCustomerId(customerId);
     //
     int count = cardInformationDao.findCountByFilter(filter);
     // 检查并保存
     checkAndsaveOnlineRiskCustomer(count, customerInfor, riskAttribute);
     // 多次逾期
   } else if (RiskAttributeEnum.MANYTIMESEXPIRY
       .toString()
       .equals(riskAttribute.getRiskAttribute())) {
     CustomerOverdueFilter filter = new CustomerOverdueFilter();
     filter.setCustomerId(customerId);
     //
     int count = customerOverdueDao.findCountByFilter(filter);
     // 检查并保存
     checkAndsaveOnlineRiskCustomer(count, customerInfor, riskAttribute);
   }
 }
 /*
  * 是否超过指定的数值
  * @param filter
  * @return boolean
  */
 public boolean isMoreThanNumber(int count, RiskAttribute riskAttribute) {
   boolean flag = false;
   try {
     flag = (count > Integer.valueOf(riskAttribute.getValue())) ? true : false;
   } catch (Exception e) {
     e.printStackTrace();
   }
   return flag;
 }