コード例 #1
0
  @RequestMapping(value = "list", method = RequestMethod.GET)
  public @ResponseBody Object list() {
    HttpServletRequest request = WebUtils.getRequestByContext();
    CsContractInfo csContractInfo = new CsContractInfo();

    // 接受查询参数
    String paramsArea = request.getParameter("paramsArea");
    String paramsCustomerName = request.getParameter("paramsCustomerName");
    String paramsCustomerType = request.getParameter("paramsCustomerType");
    String paramsContractType = request.getParameter("paramsContractType");

    if (null != paramsArea) {
      byte b[];
      try {
        b = paramsArea.getBytes("GBK");
        paramsArea = new String(b);

        b = paramsCustomerName.getBytes("GBK");
        paramsCustomerName = new String(b);

        b = paramsCustomerType.getBytes("GBK");
        paramsCustomerType = new String(b);

        b = paramsContractType.getBytes("GBK");
        paramsContractType = new String(b);
      } catch (UnsupportedEncodingException e) {
        paramsArea = null;
        paramsContractType = null;
        paramsCustomerName = null;
        paramsCustomerType = null;
      }
      if (null != paramsArea) {
        csContractInfo.setArea(paramsArea);
        csContractInfo.setContractType(paramsContractType);
        csContractInfo.setCustomerName(paramsCustomerName);
        csContractInfo.setCustomerType(paramsCustomerType);
      }
    }

    return ResponseUtils.sendPagination(csContractInfoService.list(csContractInfo));
  }
コード例 #2
0
  @RequestMapping(method = RequestMethod.GET)
  public @ResponseBody Object list() throws Exception {
    HttpServletRequest request = WebUtils.getRequestByContext();
    String acctno = request.getParameter("acctno");
    String newcustomid = request.getParameter("newcustomid");
    //		String user_id=request.getParameter("userid");
    String update = request.getParameter("update");
    List<AssoCustomVo> list = new ArrayList<AssoCustomVo>();
    List<CredentialsVo> cre_list = new ArrayList<CredentialsVo>();
    StringBuffer errorinfo = new StringBuffer("");

    if (StringUtils.isNotBlank(update)) {
      if (update.equals("search_acctno")) {
        cre_list = creService.list();
        list = assoCustomService.list(acctno, errorinfo);
        int subsys_index = errorinfo.toString().indexOf("subsystem:");
        if (subsys_index != -1) {
          subsys_index = errorinfo.toString().indexOf(":");
          int length = errorinfo.toString().length();
          curr_custom.setSubsys(errorinfo.toString().substring(subsys_index + 1, length));
          errorinfo.setLength(0);
        }
        if (list.size() != 0) {
          // 默认一个账号对应一个customid
          curr_custom.setCustomid(list.get(0).getCustomid());
          for (AssoCustomVo temp : list) {
            for (CredentialsVo cre : cre_list) {
              if (cre.getIdtype().equals(temp.getIdtype())) {
                temp.setIdname(cre.getIdname());
                break;
              }
            }
          }
        }
      } else if (update.equals("search_customid")) {
        curr_custom.setAcctno(acctno);
        curr_custom.setNewcustomid(newcustomid);

        cre_list = creService.list();

        AssoCustomVo new_custom = assoCustomService.getcustominfo(newcustomid, errorinfo);
        if (new_custom.getCustomid() != null) {
          for (CredentialsVo cre : cre_list) {
            if (cre.getIdtype().equals(new_custom.getIdtype())) {
              new_custom.setIdname(cre.getIdname());
              break;
            }
          }
          list.add(new_custom);
          errorinfo.setLength(0);
        }
      } else if (update.equals("update")) {
        // 关联新客户号码
        list = assoCustomService.update(curr_custom, errorinfo);

        // 关联成功后,记录更改信息
        if (StringUtils.isBlank(errorinfo.toString())) {
          String actDesc = "客户号码关联";

          for (AssoCustomVo temp : list) {
            if (temp.getCount() != 0) {
              Updatelog ulog = new Updatelog();
              ulog.setAction(actDesc);
              ulog.setTable_name(temp.getTablename_en());
              ulog.setKeys("acctno");
              ulog.setKey_value(curr_custom.getAcctno());
              ulog.setColumns("customid");
              ulog.setOld_value(curr_custom.getCustomid());
              ulog.setNew_value(curr_custom.getNewcustomid());

              updatelogService.saveUlog(ulog);
            }
          }

          // 记录用户操作信息
          actionlogService.saveAlog("", actDesc, true, "");
        }
      }
    }

    return ResponseUtils.sendPagination(list, errorinfo.toString());
  }