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);
        }

    }

  • 相关阅读:
    Django---分页器
    Django——模板层(template)(模板语法、自定义模板过滤器及标签、模板继承)
    python 常用模块 time random os模块 sys模块 json & pickle shelve模块 xml模块 configparser hashlib subprocess logging re正则
    python web框架简介Bottle Flask Tornado
    [C#] 谈谈异步编程async await
    MYSQL分库分表总结
    win10 IIS 10.0 无法安装 URL Rewrite Module 重写模块
    Quartz.NET文档 入门教程
    SignalR web实时同步 消息推送 广播
    C#模拟http 发送post或get请求
  • 原文地址:https://www.cnblogs.com/wangzn/p/6687674.html
Copyright © 2011-2022 走看看