Exemple #1
0
  /**
   * 分组
   *
   * @param cond
   * @return
   * @throws RuntimeException
   */
  @Override
  public List<Map> findCustomerGroup(CustomerCond cond) throws RuntimeException {
    // 追加权限限制

    logger.info("cond.getDate1()" + cond.getDate1());
    cond.addPermissionChartProjectIds();
    return customerMapper.findCustomerGroup(cond);
  }
Exemple #2
0
  @Override
  public List<Customer> findCustomerForMobile(CustomerCond cond) throws RuntimeException {

    /** 当ids的size为0,表示没有符合条件的记录,用于跟进日期,2011.11.19,dtc */
    if (cond.getIds() != null && cond.getIds().size() == 0) {

      return null;
    }

    return customerMapper.findCustomerSearch(cond);
  }
Exemple #3
0
  @Override
  public int findCustomerCount(CustomerCond cond) throws RuntimeException {

    /** 当ids的size为0,表示没有符合条件的记录,用于跟进日期,2011.11.19,dtc */
    if (cond.getIds() != null && cond.getIds().size() == 0) {

      return 0;
    }

    return customerMapper.findCustomerCount(cond);
  }
Exemple #4
0
 /** 下载 */
 @Override
 public List<Customer> findCustomerForDownload(CustomerCond cond) throws Exception {
   List<Integer> projectIds =
       PermissionUtils.getUserProjectIdList(EnumPrivCode.REPORT_PRECUSTOMER_DOWNLOAD);
   if (projectIds != null && projectIds.size() > 0) {
     // 表示为有多个项目的人员,增加能跟进不能修改的客户的判断(管理员是可以忽略的)
     cond.setProjectIds(projectIds);
   } else {
     int sessionUserId = SessionUser.getUserId();
     cond.setUserId(sessionUserId + "");
   }
   return customerMapper.findCustomerForDownload(cond);
 }
Exemple #5
0
  @Override
  public List<Customer> findCustomerSearchDeleted(CustomerCond cond) {

    CustomerPermission.doCheckFind(cond);

    /** 当ids的size为0,表示没有符合条件的记录,用于跟进日期,2011.11.8 */
    if (cond.getIds() != null && cond.getIds().size() == 0) {

      return null;
    }

    int recordCount = customerMapper.findCustomerCountDeleted(cond);

    cond.recordCount = recordCount;
    return customerMapper.findCustomerSearchDeleted(cond);
  }
Exemple #6
0
  /**
   * 根据查询条件分页查找customer
   *
   * @param cond
   * @return
   * @throws RuntimeException
   */
  public List<Customer> findCustomerPage(CustomerCond cond) throws RuntimeException {
    int recordCount = customerMapper.findCustomerCount(cond);

    cond.recordCount = recordCount;

    return customerMapper.findCustomerPage(cond);
  }
Exemple #7
0
 @Override
 public List<Map> findAllFiledInputCount(CustomerCond cond) {
   // 追加权限限制
   cond.addPermissionCompanyProjectIds(
       PermissionUtils.getUserProjectIdList(EnumPrivCode.REPORT_PRECUSTOMER_DOWNLOAD));
   return customerMapper.findAllFiledInputCount(cond);
 }
Exemple #8
0
  @SuppressWarnings("deprecation")
  @Test
  public void setUpCustomerPhoneFrom() throws Exception {

    int pageSize = 50;

    CustomerCond cond = new CustomerCond();
    cond.pageSize = pageSize;

    final ICustomerServices customerServices =
        (ICustomerServices) factory.getBean("customerServices");

    int size = customerServices.tmpCount();
    int count = size / pageSize;

    for (int i = 0; i <= count; i++) {

      int startLine = i * pageSize;
      cond.startLine = startLine;

      List<Customer> allCustomer = customerServices.tmpList(cond);
      allCustomer = PhoneUtils.postPhoneForcha14(allCustomer);

      final List<Customer> tracList = allCustomer;

      new MyTransationTemplate() {

        @Override
        protected void doExecuteCallback() throws Exception {

          Map<String, String> map = new HashMap<String, String>();
          for (Customer cus : tracList) {

            map.put("id", cus.getId() + "");
            map.put("phoneFrom", cus.getPhoneFrom());
            // System.out.println(cus.getId() + "\t" + cus.getPhoneComeFrom());

            customerServices.updateCustomerPhoneFrom(map);
          }
        }
      }.execute();
    }
  }
Exemple #9
0
  /**
   * 查找全部Customer
   *
   * @param cond 查询条件
   * @return Customer列表
   */
  @Override
  public List<Customer> findCustomerSearch(CustomerCond cond) throws RuntimeException {
    // System.out.println("findCustomerSearch");
    // System.out.println("结果:"+PermissionUtils.findUserPriv(164));

    CustomerPermission.doCheckFind(cond);

    /*
    List<Customer> list;

    Cache cache= CacheUtils.getCacheByName(cacheKeyList);

    if(cache.get(cond.getCacheKey())==null){
    	int recordCount = customerMapper.findCustomerCount(cond);

    	cond.recordCount = recordCount;

    	list = customerMapper.findCustomerSearch(cond);
    	cache.put(new Element(cond.getCacheKey(), list));
    	cache.put(new Element(cond.getCacheKeyListCount(), recordCount));
    }
    else{
    	list = (List<Customer>)cache.get(cond.getCacheKey()).getValue();
    	cond.recordCount = (Integer)(cache.get(cond.getCacheKeyListCount()).getValue() );
    }

    return list;
    */

    /** 当ids的size为0,表示没有符合条件的记录,用于跟进日期,2011.11.8 */
    if (cond.getIds() != null && cond.getIds().size() == 0) {

      return null;
    }

    int recordCount = customerMapper.findCustomerCount(cond);

    cond.recordCount = recordCount;

    return customerMapper.findCustomerSearch(cond);
  }
Exemple #10
0
 @Override
 public int findCustomerProductAndConfirmInfoCount(CustomerCond customerCond) {
   customerCond.addPermissionCompanyProjectIds(
       PermissionUtils.getUserProjectIdList(EnumPrivCode.REPORT_PRECUSTOMER_DOWNLOAD));
   return customerMapper.findCustomerProductAndConfirmInfoCount(customerCond);
 }
Exemple #11
0
 @Override
 public List<Map<String, Object>> findCustomerCountGroupByVisitDate(CustomerCond customerCond) {
   customerCond.addPermissionCompanyProjectIds(
       PermissionUtils.getUserProjectIdList(EnumPrivCode.REPORT_PRECUSTOMER_DOWNLOAD));
   return customerMapper.findCustomerCountGroupByVisitDate(customerCond);
 }
Exemple #12
0
 @Override
 public List<Map> findCustomerPageReport(CustomerCond customerCond) {
   int recordCount = customerMapper.findCustomerCount(customerCond);
   customerCond.recordCount = recordCount;
   return customerMapper.findCustomerPageReport(customerCond);
 }
Exemple #13
0
 @Override
 public List<Map> findCustomerGroupQuestionTopic(CustomerCond cond) throws RuntimeException {
   // 追加权限限制
   cond.addPermissionChartProjectIds();
   return customerMapper.findCustomerGroupQuestionTopic(cond);
 }