/**
  * @param accountInfo 分公司财务账号信息
  * @return Message
  */
 @RequestMapping(value = "addOrUpdate")
 public @ResponseBody Message addOrUpdateAccountInfo(AccountInfo accountInfo) {
   Message message = new Message();
   boolean flag;
   if (accountInfo.getAccountInfoId() == null || "".equals(accountInfo.getAccountInfoId())) {
     flag = accountInfoService.addAccountInfo(accountInfo);
   } else {
     flag = accountInfoService.updateAccountInfo(accountInfo);
   }
   message.setSuccess(flag);
   return message;
 }
 /**
  * @param accountInfo 分公司财务账号信息
  * @return Message
  */
 @RequestMapping(value = "addAccountInfo")
 public @ResponseBody Message addAccountInfo(AccountInfo accountInfo) {
   Message message = new Message();
   boolean flag = accountInfoService.addAccountInfo(accountInfo);
   message.setSuccess(flag);
   return message;
 }
  /**
   * @param accountInfo 分公司财务账号信息
   * @param fuzzyValue 模糊查询条件
   * @param page 第几页
   * @param rows 每页显示行数
   * @param accountType 类型
   * @return 带分页的列表
   */
  @RequestMapping(value = "selectByPage")
  public @ResponseBody Pagination selectAccountInfos(
      AccountInfo accountInfo, String page, String rows, String fuzzyValue, String accountType) {

    Pagination pagination = new Pagination();
    if (!StringUtils.isBlank(rows)) {
      pagination.setPageSize(Integer.valueOf(rows));
    }
    if (!StringUtils.isBlank(page)) {
      pagination.setPage(Integer.valueOf(page));
    }
    if (fuzzyValue != null) {
      return accountInfoService.selectFuzzy(fuzzyValue, pagination, accountType);
    } else {
      return accountInfoService.selectAccountInfos(accountInfo, pagination, accountType);
    }
  }
 /** 以下为修改银行卡新增方法 * */
 @RequestMapping(value = "selectByCrediApplicationId")
 public @ResponseBody AccountInfo selectByCrediApplicationId(Long creditapplicationId) {
   System.out.println(creditapplicationId);
   System.out.println(creditapplicationId);
   System.out.println(creditapplicationId);
   System.out.println(creditapplicationId);
   System.out.println(creditapplicationId);
   System.out.println(creditapplicationId);
   return accountInfoService.selectByCrediApplicationId(creditapplicationId);
 }
  /** 以下为修改银行卡新增方法 * */
  @RequestMapping(value = "returnBankCardJSP")
  public ModelAndView returnBankCardJSP(Long creditapplicationId) {
    System.out.println(creditapplicationId);
    AccountInfo accountInfo = accountInfoService.selectByCrediApplicationId(creditapplicationId);
    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("/jsp/rc/basicInfo/bankCardNew.jsp");
    modelAndView.addObject("creditapplicationId", creditapplicationId);

    Map map = new HashMap();
    DESPlus desPlus;
    try {
      desPlus = new DESPlus();
      map.put("clientid", desPlus.encrypt(creditapplicationId + "AccountCard"));
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String clientid = (String) map.get("clientid");

    System.out.println(clientid);
    System.out.println(clientid);
    System.out.println(clientid);
    System.out.println(clientid);
    System.out.println(clientid);

    long nowTime = System.currentTimeMillis();
    String sMillis[] = new String[2];
    try {
      Properties properties = PropertiesUtil.loadProperties("spring/cm/cm.properties");
      DESPlus desPlus2 = new DESPlus();
      sMillis[0] = desPlus2.encrypt(nowTime + "");
      String cmIp = properties.getProperty("cm.hostip");
      String DESIp = desPlus2.encrypt(cmIp);
      sMillis[1] = DESIp;
    } catch (Exception e) {
      e.printStackTrace();
    }

    String signTime = sMillis[0];
    String signIp = sMillis[1];

    modelAndView.addObject("clientid", clientid);
    modelAndView.addObject("signTime", signTime);
    modelAndView.addObject("signIp", signIp);
    modelAndView.addObject("accountInfo", accountInfo);
    return modelAndView;
  }
 /**
  * @param accountInfo 分公司财务账号信息
  * @return AccountInfo
  */
 @RequestMapping(value = "addOrUpdateReturn")
 public @ResponseBody AccountInfo addOrUpdate(AccountInfo accountInfo) {
   return accountInfoService.addOrUpdate(accountInfo);
 }
 /**
  * 查询分公司账户
  *
  * @param creditapplicationId id
  * @return list
  */
 @RequestMapping(value = "selectCompanyAccounts")
 public @ResponseBody List<AccountInfo> selectCompanyAccounts(Integer creditapplicationId) {
   List<AccountInfo> accountInfoList =
       accountInfoService.selectCompanyAccounts(creditapplicationId);
   return accountInfoList;
 };
 /**
  * 按照 id 查找
  *
  * @param accountInfoId 账户ID
  * @return 账户对象
  */
 @RequestMapping(value = "selectById")
 public @ResponseBody AccountInfo selectById(Integer accountInfoId) {
   return accountInfoService.selectByAccountID(accountInfoId);
 }