예제 #1
0
  public String getProjectByCompanyId() throws Exception {
    String content = "<option value=\"\">" + CommonUtils.ALL + "</option>"; // 默认值

    String companyId = request.getParameter("companyId");
    try {

      LinkedHashMap<String, String> projectMap =
          HengDaUtils.getProjectsByCompanyId(Integer.parseInt(companyId));

      StringBuffer sb = new StringBuffer();

      if (projectMap.keySet().size() > 1) {
        Set<String> keys = projectMap.keySet();
        for (String key : keys) {
          String value = projectMap.get(key);
          sb.append("<option value=\"").append(key).append("\">").append(value).append("</option>");
        }
      }

      String getContent = sb.toString();
      if (!CustomerUtils.isStrEmpty(getContent)) {
        content = getContent;
      }

    } catch (Exception e) {

    }

    CustomerUtils.writeResponse(response, content);

    return null;
  }
예제 #2
0
  public String myGetCheckFeeDateList() throws Exception {

    JSONArray jsonArray = new JSONArray();

    confirmCond = new ConfirmCond();
    confirmCond.setPropertyId(request.getParameter("propertyId"));

    List<Map<String, Object>> checkFeeDateList = confirmServices.checkFeeDateList(confirmCond);

    for (int i = 0; i < checkFeeDateList.size(); i++) {

      Map<String, Object> mapobject = checkFeeDateList.get(i);

      String checkfee_date =
          mapobject.get("checkfee_date") == null ? "" : mapobject.get("checkfee_date").toString();

      if (!CommonUtils.isStrEmpty(checkfee_date)) {

        Map<String, Object> json = new HashMap<String, Object>();
        json.put(
            "checkFeeDate",
            CommonUtils.getDateString(CommonUtils.getDateFromString(checkfee_date)));

        jsonArray.add(json);
      }
    }

    CustomerUtils.writeResponse(response, jsonArray.toString());

    return null;
  }
예제 #3
0
  /**
   * 根据StlLaiDianBean返回Customer
   *
   * @param bean
   * @return
   */
  private Customer beanToCustomer(StlLaiDianBean bean) {

    Customer customer = new Customer();

    customer.setCustomerNo(CustomerUtils.getTmpCustomerNo());

    customer.setCustomerName(bean.getCustomerName());
    customer.setVisitDate(bean.getVisitDate());
    customer.setPhone(bean.getPhone());

    customer.setHomeProvince(17); // 居住省
    customer.setHomeCity(169); // 居住市
    customer.setHomeContent(bean.getHomeContent());

    customer.setAreaNum(bean.getAreaNum()); // 意向面积
    customer.setRemark1(bean.getRemark1()); // 备注

    customer.setCompanyId(29);
    customer.setProjectId(190);

    customer.setTeamId(0);
    customer.setUserId(2400);

    customer.setManagerId(2400);
    customer.setCustomerSource("1"); // 客户来源

    customer.setIsDeleted(CommonUtils.NORMAL);
    customer.setCreatedId(2400);
    customer.setCreatedTime(new Date());
    customer.setModId(2400);
    customer.setModTime(new Date());

    return customer;
  }
예제 #4
0
  public String download() throws Exception {

    String[] thx =
        new String[] {
          "选项", "楼层", "总套数", "总面积", "总金额(定价)", "均价", "总套数", "总面积", "总金额(定价)", "均价", "总套数", "总面积",
          "总金额(定价)", "均价", "余货比例", "成交套数", "成交面积", "成交金额", "均价", "签约套数", "签约面积", "签约金额", "均价",
          "签约率", "未签约套数", "未签约面积", "未签约金额", "均价", "总量", "面积", "金额", "均价", "剩余率"
        };
    final StringBuffer sb = new StringBuffer();

    sb.append(ContTable.TABLE_START).append(ContTable.TR_START);
    sb.append(
        "<th>产品类型</th><th></th>"
            + "<th colspan='4'>总货量</th>"
            + "<th colspan='4'>推出货量</th>"
            + "<th colspan='5'>总剩余货量</th>"
            + "<th colspan='4'>认购情况</th>"
            + "<th colspan='5'>已签约情况</th>"
            + "<th colspan='4'>未签约情况</th>"
            + "<th colspan='5'>推出剩余货量</th>");

    sb.append(ContTable.TR_END).append(ContTable.TR_START);
    for (String th : thx) {
      sb.append(ContTable.TH_START).append(th).append(ContTable.TH_END);
    }
    sb.append(ContTable.TR_END);
    sb.append((String) request.getSession().getAttribute("showTrs"));
    sb.append(ContTable.TALBE_END);
    String fileName = "download-" + CustomerUtils.getNowForString() + "-.xls";
    ReportUtils.downLoadReport(sb.toString(), fileName, response);

    return SUCCESS;
  }
예제 #5
0
  private void initSelProject(boolean isGet) {
    selProject = new LinkedHashMap<String, String>();
    selProject.put("", CommonUtils.ALL);

    if (isGet) {
      String getCompanyId = saleWeekCond.getCompanyId();
      if (!CustomerUtils.isStrEmpty(getCompanyId) && !"0".equals(getCompanyId)) {
        selProject = HengDaUtils.getProjectsByCompanyId(Integer.parseInt(getCompanyId));
      }
    }
  }
예제 #6
0
  /**
   * 下载
   *
   * @return
   * @throws Exception
   */
  public String download() throws Exception {
    List<Map<String, String>> dataList =
        (List<Map<String, String>>)
            request
                .getSession()
                .getAttribute(
                    ContSessionAttribute.XSGJQK_KUGJLB + ContSessionAttribute.DOWNLOAD_DATA);
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("dataList", dataList);

    ReportUtils.downLoadReport(
        map,
        "customer-user-follow-customer-msg.xls",
        "download-客户跟进详细列表-销售-" + CustomerUtils.getNowForString() + "-.xls",
        response);

    return null;
  }
예제 #7
0
  @SuppressWarnings("unchecked")
  public String downLoadWeek() throws Exception {

    try {
      HttpSession session = request.getSession();

      Object getObject = session.getAttribute("saleTypeList");
      List<SaleMonitor> getList = new ArrayList<SaleMonitor>();
      if (getObject != null) {
        getList = (List<SaleMonitor>) getObject;
      }

      HengDaUtils.downLoadTemplate(
          "saleTypeList",
          getList,
          "saleType.xls",
          "download-" + CustomerUtils.getNowForString() + "-.xls",
          response);

    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
예제 #8
0
  public String searchWeek() throws Exception {
    HttpSession session = request.getSession();

    if (saleWeekCond == null) {
      saleWeekCond = new SaleMonitorCond();
    }
    if (CustomerUtils.isStrEmpty(saleWeekCond.getDate1())) {
      saleWeekCond.setDate1(CommonUtils.getWeekFirstForString());
    }
    if (CustomerUtils.isStrEmpty(saleWeekCond.getDate2())) {
      saleWeekCond.setDate2(CommonUtils.getWeekEndForString());
    }

    List<Integer> projectIds = new ArrayList<Integer>();

    String from = request.getParameter("from");
    if ("left".equals(from)) {
      // 此时总是为该登陆用户的projectId

      projectIds = HengDaUtils.getUserProjects();
    } else {
      String getCompanyId = saleWeekCond.getCompanyId();
      int getProjectId = saleWeekCond.getProjectId();

      projectIds = HengDaUtils.getUserProjects();

      if (!CustomerUtils.isStrEmpty(getCompanyId)) {

        if (getProjectId != 0) {
          // 选了单个项目

          projectIds.clear();
          projectIds.add(getProjectId);
        } else {
          // 单个公司下的所有项目

          projectIds =
              HengDaUtils.getUserProjectsByCompanyId(Integer.parseInt(getCompanyId), projectIds);
        }
      }
    }

    initSelCompany();
    initSelProject(true);

    saleWeekCond.setProjectIds(projectIds);
    if (!projectIds.isEmpty()) {
      // 为空时表示该用户在该查询组合下没有符合的记录,不用再去查数据库
      saleTypeList = saleMonitorServices.findSaleMonitorList(saleWeekCond);
    }

    amount = initSaleMonitorWeekAmount(amount, saleTypeList);

    session.setAttribute("saleTypeList", saleTypeList); // 下载使用 ,没有分页不用利用saleWeekCond再查询一次
    session.setAttribute("companyId", saleWeekCond.getCompanyId());
    session.setAttribute("projectId", saleWeekCond.getProjectId());

    // 判断是否公司及项目都是一个,如果都是一个,那么就让公司项目处于选择状态
    LinkedHashMap<String, String> getSelPro = HengDaUtils.setSessionIfCompanyAndProjectOne(request);
    if (getSelPro != null) {
      selProject = getSelPro;
    }

    return "searchWeek";
  }