zoukankan      html  css  js  c++  java
  • 当findById(Integer id)变成String类型

    1、原Action

    // 添加跳转
        @RequiresPermissions("pdaManager:v_add")
        @RequestMapping("/pdaManager/v_add.do")
        public String add(HttpServletRequest request, ModelMap model) {
            List<BeanDataDictionary> sbztList = dataMng.findByPid(128);
            List<BeanEquipmentModel> list = equipMng.getList();
            List<BeanEquipmentModel> zdxhList = new ArrayList<BeanEquipmentModel>();
            for(BeanEquipmentModel equip : list){
                 BeanFacturer facture = facMng.findById(equip.getFacturerId());
                 BeanEquipmentModel bean = new BeanEquipmentModel();
                 bean.setModel_code(equip.getModel_code()+"("+facture.getFacturer_short()+")");
                 bean.setId(equip.getId());
                 zdxhList.add(bean);            
            }
            
            model.addAttribute("zdxhList", zdxhList);
            model.addAttribute("sbztList", sbztList);
            return "pdaManager/add";
        }

    2、新action

    // 添加跳转
        @RequiresPermissions("pdaManager:v_add")
        @RequestMapping("/pdaManager/v_add.do")
        public String add(HttpServletRequest request, ModelMap model) {
            List<BeanDataDictionary> sbztList = dataMng.findByPid(128);
            List<BeanEquipmentModel> list = equipMng.getList();
            List<BeanEquipmentModel> zdxhList = new ArrayList<BeanEquipmentModel>();
            for(BeanEquipmentModel equip : list){
                String ids = equip.getFacturerId();
                String id[] =  ids.split(",");
                for (int i = 0; i < id.length; i++) {
                 BeanFacturer facture = facMng.findById(Integer.parseInt(id[i]));
                 BeanEquipmentModel bean = new BeanEquipmentModel();
                 bean.setModel_code(equip.getModel_code()+"("+facture.getFacturer_short()+")");
                 bean.setId(equip.getId());
                 zdxhList.add(bean);            
            }
            }
            model.addAttribute("zdxhList", zdxhList);
            model.addAttribute("sbztList", sbztList);
            return "pdaManager/add";
        }
  • 相关阅读:
    netty ByteToMessageDecoder 分析
    netty 编/解码处理
    MAC 入门
    netty 学习
    php ioc and web rest design
    spring 启动流程
    淘宝美衣人
    ecslipe cdt lib link
    阿里巴巴中间件团队招人了!
    架构师速成-架构目标之伸缩性安全性
  • 原文地址:https://www.cnblogs.com/xinxin1994/p/6038566.html
Copyright © 2011-2022 走看看