Examples of TDistributor


Examples of com.iteye.tianshi.web.model.base.TDistributor

      sql.append("and floors>").append(floors);
    }
    List<Map<String, Object>> templist = this.distributorDao.getJdbcTemplate().queryForList(sql.toString());
    List<TDistributor> list = new ArrayList<TDistributor>(templist.size());
    for(Map<String,Object> map : templist){
      TDistributor tDistributor = new TDistributor();
      tDistributor.setId(Long.valueOf(map.get("res_id").toString()));
      tDistributor.setShopId(Long.valueOf(map.get("shop_id").toString()));
      tDistributor.setRankId(Long.valueOf(map.get("rank_id").toString()));
      tDistributor.setDistributorCode(map.get("distributor_code").toString());
      tDistributor.setDistributorName(map.get("distributor_name").toString());
      tDistributor.setSponsorId(Long.valueOf(map.get("sponsor_id").toString()));
      tDistributor.setCreateTime((Date)map.get("create_time"));
      tDistributor.setAddress(map.get("address").toString());
      tDistributor.setTelephone(map.get("telephone").toString());
      tDistributor.setSponsorCode(map.get("sponsor_code").toString());
      tDistributor.setFloors(Integer.valueOf(map.get("floors").toString()));
      list.add(tDistributor);
      map = null;
      tDistributor = null;
    }
    templist = null;
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

    }
    List<Map<String, Object>> templist = this.distributorDao.getJdbcTemplate().queryForList(sql.toString());
    sql = null;
    List<TDistributor> list = new ArrayList<TDistributor>(templist.size());
    for(Map<String,Object> map : templist){
      TDistributor tDistributor = new TDistributor();
      tDistributor.setId(Long.valueOf(map.get("res_id").toString()));
      tDistributor.setShopId(Long.valueOf(map.get("shop_id").toString()));
      tDistributor.setRankId(Long.valueOf(map.get("rank_id").toString()));
      tDistributor.setDistributorCode(map.get("distributor_code").toString());
      tDistributor.setDistributorName(map.get("distributor_name").toString());
      tDistributor.setSponsorId(Long.valueOf(map.get("sponsor_id").toString()));
      tDistributor.setCreateTime((Date)map.get("create_time"));
      tDistributor.setAddress(map.get("address").toString());
      tDistributor.setTelephone(map.get("telephone").toString());
      tDistributor.setSponsorCode(map.get("sponsor_code").toString());
      tDistributor.setFloors(Integer.valueOf(map.get("floors").toString()));
      list.add(tDistributor);
      map = null;
      tDistributor = null;
    }
    templist = null;
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

    double leadership = 0D;
    double cellGrade = dist.getCellAchieve(); /**小组业绩*/
    if(rank == ConstantUtil._lev_5 && cellGrade> 600D){/**五星,小组业绩大于600,领取1%的奖金*/
      double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_5).getW1()/100; /**一代领导奖*/
      for(TDistributor lch : dirchildList){/**遍历支臂*/
        TDistributor find = getChildGradeCellHighest(lch,rank); /**find中有可能会返回lch*/
        if(find!=null){
          int floors = find.getFloors();/**定点的层级*/
          Long id = find.getId();
          /**获取第一代*/
          List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
          for(String code:child_Lv1_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
            code = null;
          }
          child_Lv1_List = null;
        }
        find = null;
        lch = null;
      }
    }else if(rank == ConstantUtil._lev_6 && cellGrade> 1000D){/**六星*/
      double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_6).getW1()/100; /**一代领导奖*/
      double gap_bonus_2 = bonusCfgMap.get(ConstantUtil._lev_6).getW2()/100; /**二代领导奖*/
      double gap_bonus_3 = bonusCfgMap.get(ConstantUtil._lev_6).getW3()/100; /**三代领导奖*/
      for(TDistributor lch : dirchildList){/**遍历支臂*/
        TDistributor find = getChildGradeCellHighest(lch,rank);
        if(find!=null){
          int floors = find.getFloors();/**定点的层级*/
          Long id = find.getId();
          /**获取第一代*/
          List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
          for(String code:child_Lv1_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
            code = null;
          }
          child_Lv1_List = null;
          /**获取第二代*/
          List<String> child_Lv2_List=findChildListByFloors (floors+2,id);/**第一代层级*/
          for(String code:child_Lv2_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_2;
            code = null;
          }
          child_Lv2_List = null;
          /**获取第三代*/
          List<String> child_Lv3_List=findChildListByFloors (floors+3,id);/**第一代层级*/
          for(String code:child_Lv3_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_3;
            code = null;
          }
          child_Lv3_List = null;
        }
        find = null;
        lch = null;
      }
     
    }else if(rank == ConstantUtil._lev_7 && cellGrade> 2000D){/**七星*/
      double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_7).getW1()/100; /**一代领导奖*/
      double gap_bonus_2 = bonusCfgMap.get(ConstantUtil._lev_7).getW2()/100; /**二代领导奖*/
      double gap_bonus_3 = bonusCfgMap.get(ConstantUtil._lev_7).getW3()/100; /**三代领导奖*/
      double gap_bonus_4 = bonusCfgMap.get(ConstantUtil._lev_7).getW4()/100; /**一代领导奖*/
      double gap_bonus_5 = bonusCfgMap.get(ConstantUtil._lev_7).getW5()/100; /**二代领导奖*/
      for(TDistributor lch : dirchildList){/**遍历支臂*/
        TDistributor find = getChildGradeCellHighest(lch,rank);
        if(find!=null){
          int floors = find.getFloors();/**定点的层级*/
          Long id = find.getId();
          /**获取第一代*/
          List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
          for(String code:child_Lv1_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
            code = null;
          }
          child_Lv1_List = null;
          /**获取第二代*/
          List<String> child_Lv2_List=findChildListByFloors (floors+2,id);/**第一代层级*/
          for(String code:child_Lv2_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_2;
            code = null;
          }
          child_Lv2_List = null;
          /**获取第三代*/
          List<String> child_Lv3_List=findChildListByFloors (floors+3,id);/**第一代层级*/
          for(String code:child_Lv3_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_3;
            code = null;
          }
          child_Lv3_List = null;
          /**获取第四代*/
          List<String> child_Lv4_List=findChildListByFloors (floors+4,id);/**第一代层级*/
          for(String code:child_Lv4_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_4;
            code = null;
          }
          child_Lv4_List = null;
          /**获取第五代*/
          List<String> child_Lv5_List=findChildListByFloors (floors+5,id);/**第一代层级*/
          for(String code:child_Lv5_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_5;
            code = null;
          }
          child_Lv5_List = null;
        }
        find = null;
        lch = null;
      }
     
    }else if(rank >ConstantUtil._lev_7 && cellGrade> 3000D){/**八星/金狮/银狮/铜师*/
      double gap_bonus_1 = bonusCfgMap.get(ConstantUtil._lev_8).getW1()/100; /**一代领导奖*/
      double gap_bonus_2 = bonusCfgMap.get(ConstantUtil._lev_8).getW2()/100; /**二代领导奖*/
      double gap_bonus_3 = bonusCfgMap.get(ConstantUtil._lev_8).getW3()/100; /**三代领导奖*/
      double gap_bonus_4 = bonusCfgMap.get(ConstantUtil._lev_8).getW4()/100; /**四代领导奖*/
      double gap_bonus_5 = bonusCfgMap.get(ConstantUtil._lev_8).getW5()/100; /**五代领导奖*/
      double gap_bonus_6 = bonusCfgMap.get(ConstantUtil._lev_8).getW6()/100; /**六代领导奖*/
      double gap_bonus_7 = bonusCfgMap.get(ConstantUtil._lev_8).getW7()/100; /**七代领导奖*/
      double gap_bonus_8 = bonusCfgMap.get(ConstantUtil._lev_8).getW8()/100; /**八代领导奖*/
      for(TDistributor lch : dirchildList){/**遍历支臂*/
        TDistributor find = getChildGradeCellHighest(lch,rank);
        if(find!=null){
          int floors = find.getFloors();/**定点的层级*/
          Long id = find.getId();
          /**获取第一代*/
          List<String> child_Lv1_List=findChildListByFloors (floors+1,id);/**第一代层级*/
          for(String code:child_Lv1_List){
            leadership+=tgMap.get(code).getCellAchieve().doubleValue()*gap_bonus_1;
            code = null;
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

    if(lch.getRankId()>=rank){
      return lch;
    }else{
      List<TDistributor> find = tDistributorService.findByProperty("sponsorCode", lch.getDistributorCode());
      for(TDistributor c:find){
        TDistributor ok =  getChildGradeCellHighest(c,rank);
        find = null;
        return ok;
      }
    }
    return null;
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

   * @return TDistributor
   */
  @RequestMapping(value = "/loadDistributor", method = RequestMethod.POST)
  @ResponseBody
  public TDistributor loadDistributor(Long id) {
    TDistributor tDistributor = tDistributorService.findEntity(id);
    return tDistributor;
  }
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

  @RequestMapping(value = "/insertTProductOrder", method = RequestMethod.POST)
  @ResponseBody
  public ResponseData insertTProductOrder(TProductDetail tDetail){
    //总额
    tDetail.setSumPrice(tDetail.getProductPrice()*tDetail.getSaleNumber());
    TDistributor dist = tDistributorService.findByProperty("distributorCode", tDetail.getDistributorCode()).get(0);
    //经销商ID
    tDetail.setDistributorId(dist.getId());
    //层级
    tDetail.setFloors(dist.getFloors());
    tDetail.setCreateTime(new Date());
    tDetailService.insertEntity(tDetail);
    return ResponseData.SUCCESS_NO_DATA;
  }
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

  @RequestMapping(value = "/updateTProductOrder", method = RequestMethod.POST)
  @ResponseBody
  public  ResponseData updateTProductOrder(TProductDetail tDetail){
    //总额
    tDetail.setSumPrice(tDetail.getProductPrice()*tDetail.getSaleNumber());
    TDistributor dist = tDistributorService.findByProperty("distributorCode", tDetail.getDistributorCode()).get(0);
    //经销商ID
    tDetail.setDistributorId(dist.getId());
    //层级
    tDetail.setFloors(dist.getFloors());
    tDetailService.updateEntity(tDetail);
    return ResponseData.SUCCESS_NO_DATA;
  }
View Full Code Here

Examples of com.iteye.tianshi.web.model.base.TDistributor

  @RequestMapping(value = "/loadTProductOrder", method = RequestMethod.POST)
  @ResponseBody
  public TProductDetail loadTProductOrder(Long id){
    TProductDetail order =  tDetailService.findEntity(id);
   
    TDistributor dist = tDistributorService.findByProperty("distributorCode", order.getDistributorCode()).get(0);
    order.setDistributorName(dist.getDistributorName());
    Long shopId = dist.getShopId();
    dist = null;
   
    TShopInfo shop = tShopInfoService.findEntity(shopId);
    order.setShopCode(shop.getShopCode());
    order.setShopName(shop.getShopName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.