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

    }

  • 相关阅读:
    自定义Spark Partitioner提升es-hadoop Bulk效率
    golang channel本质——共享内存
    STM 软件事务内存——本质是为提高并发,通过事务来管理内存的读写访问以避免锁的使用
    elasticsearch 自定义_id
    JS弄ASP.NET(C#)在页GridView信息选择行
    pdf转换为word小工具,挺好
    Cocos2d-x场景功能描述的生命周期
    数据收集程序一般建筑(C++ ACE达到)
    IOS上传文件开发
    thinkphp达到UploadFile.class.php图片上传功能
  • 原文地址:https://www.cnblogs.com/wangzn/p/6687674.html
Copyright © 2011-2022 走看看