/**
  * 保存
  *
  * @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);
   }
 }
 /**
  * 同步人行征信报告
  *
  * @return
  */
 public void synPbccrcReport() {
   CustomerInforFilter filter = new CustomerInforFilter();
   // 设置每次最大查询记录数
   filter.setLimit(50);
   // 查询页码
   filter.setPage(0);
   // 查询客户信息
   QueryResult<CustomerInfor> qs = customerInforService.findCustomerInforByFilter(filter);
   try {
     PbccrcReport pbccrcReport = new PbccrcReport();
     while (qs.getItems().size() != 0) {
       for (CustomerInfor customerInfor : qs.getItems()) {
         // 查询人行征信信息
         pbccrcReport.manuProcessPbocCreditInfo(
             customerInfor.getChineseName(),
             customerInfor.getCardType(),
             customerInfor.getCardId(),
             "",
             "",
             "",
             "",
             "");
       }
       // 设置查询的页码
       filter.setPage(filter.getPage() + 1);
       qs = customerInforService.findCustomerInforByFilter(filter);
     }
   } catch (Exception e) {
     throw new RuntimeException(e.getMessage());
   }
 }
 /**
  * 处理客户信息
  *
  * @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);
   }
 }