zoukankan      html  css  js  c++  java
  • 等级显示和直辖市的处理

    @Service
    @Transactional(readOnly=true)
    public class HunterShowServiceImpl implements HunterShowService {

        @Autowired
        private HunterShowDao hunterShowDao;

        @Override
        public Result getHunterShowList(Long id,Long member_id) {
            if(id==null){
                return ResultUtils.returnError("没有对应的猎头ID,请查看数据!");
            }
            List<Map> showList = hunterShowDao.getHunterShowList(id);
            for (Map<String,Object> map : showList) {
                Integer valueOf = Integer.valueOf(map.get("level").toString());
                if(valueOf==0){
                    map.put("level", "大众猎头");
                }
                if(valueOf==1){
                    map.put("level", "高级猎头");
                }
                if(valueOf==2){
                    map.put("level", "专家猎头");
                }
                if(valueOf==3){
                    map.put("level", "顶级猎头");
                }
            }
            for(Map<String,Object> hunter : showList){
                String pro=hunter.get("provincename")==null?"":hunter.get("provincename").toString();
                String city=hunter.get("cityname")==null?"":hunter.get("cityname").toString();
                String country=hunter.get("countyname")==null?"":hunter.get("countyname").toString();
                if("北京市".equals(pro)||"天津市".equals(pro)||"上海市".equals(pro)||"重庆市".equals(pro)){
                    hunter.put("position", pro+country);//服务的区域
                }else{
                    hunter.put("position",pro+city);
                }
            }
            //List<Map> imgList = hunterShowDao.getImgList();
            List<Map> roleList = hunterShowDao.getRoleList(id);
            List<Map> productList = hunterShowDao.getproductList(id);
            Integer collectionType=0;
            if(member_id!=null){
                Map<String,Object> params =new HashMap<String,Object>();
                params.put("id", id);
                params.put("member_id", member_id);
                collectionType = hunterShowDao.getcollectionType(params);
            }
            
            Map<String,Object> map=new HashMap<String,Object>();
            
            map.put("showList", showList);
            //map.put("imgList", imgList);
            map.put("roleList", roleList);
            map.put("productList", productList);
            //判断0是收藏 1是未收藏
            map.put("collectionType", collectionType==null?1:collectionType);
            return ResultUtils.returnSuccess("详情页+介绍", map);
        }

    }

  • 相关阅读:
    提交代码报错不同方式
    pow log 与 (int)
    优先队列的创建
    积性函数
    静态主席树,动态主席树(一种可持久化线段树)
    codeblocks 输入、输出文件的位置
    后缀自动机
    BellmanFord 最短路
    struct
    hdu1501 动态规划
  • 原文地址:https://www.cnblogs.com/wangzn/p/6687674.html
Copyright © 2011-2022 走看看