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

当findById(Integer id)变成String类型的更多相关文章

  1. Redis 中 String 类型的内存开销比较大

    使用 String 类型内存开销大 1.简单动态字符串 2.RedisObject 3.全局哈希表 使用 Hash 来存储 总结 参考 使用 String 类型内存开销大 如果我们有大量的数据需要来保 ...

  2. String类型函数传递问题

    String类型函数传递问题 问题 以前没有注意过的一个问题, 最近在使用String类型作为函数入参的时候, 发现函数内对于String类型的改变并不会影响到外层调用对象本身; 结论 (先说结论) ...

  3. ArrayList list = new ArrayList()在这个泛型为Integer的ArrayList中存放一个String类型的对象

    java面试要点---ArrayList list = new ArrayList(); 在这个泛型为Integer的ArrayList中存放一个String类型的对象. ArrayList list ...

  4. 通过反射 往泛型Integer的集合里添加String 类型的数据 Day25

    package com.sxt.method1; import java.lang.reflect.Method; /* * 需求:通过反射 往泛型Integer的集合里添加String 类型的数据 ...

  5. 如果不空null并且不是空字符串才去修改这个值,但这样写只能针对字符串(String)类型,如果是Integer类型的话就会有问题了。 int i = 0; i!=''。 mybatis中会返回tr

    mybatis 参数为Integer型数据并赋值0时,有这样一个问题: mybatis.xml中有if判断条件判断参数不为空时,赋值为0的Integer参数被mybatis判断为空,因此不执行< ...

  6. List<Integer>里有可能存String类型元素吗?

    这其实是我遇到的一个线上bug,在这里分享给大家. 如果是用反射,那就很简单了,毕竟泛型只是在编译期进行约束,对运行期是无能为力的. 想想看,如果不使用反射,有没有办法做到呢? 问题起因 在我们公司的 ...

  7. ElasticSearch 5学习(9)——映射和分析(string类型废弃)

    在ElasticSearch中,存入文档的内容类似于传统数据每个字段一样,都会有一个指定的属性,为了能够把日期字段处理成日期,把数字字段处理成数字,把字符串字段处理成字符串值,Elasticsearc ...

  8. 总结:String类型与Int类型的转换【实现插入操作主键自增】

    1.String类型(此类型是数字格式的字符串类型)转换成Int类型 String str = "10000"; 转换成Int类型: int num = Integer.parse ...

  9. Java 类类型之 String 类型

    类类型 引用数据类型存的都是地址,通过地址指向对象: 基本数据类型存的都是具体值: 字符串 (String) 类型 特点: 1.字符创都是对象: 2.一旦初始化,不能被更改,字符串缓冲区支持可变的字符 ...

随机推荐

  1. 集合中Set接口与Collection接口,常用子类TreeSet,HashSet.

    Set接口与List接口的不同之处在于: 不允许有重复的数据. 定义如下: public interface Set<E>extends Collection<E> 主要方法与 ...

  2. rownum和sum一起使用经验

    因为sum的使用需要group by的,所以,对于sum出来的东西想要排序,使用rownum的话,不能直接放在SQL里面的. 可以这样. select rownum,R.* ( select sum( ...

  3. 判断一个变量的类型Object.prototype.toString.call

    var num = 1;alert(Object.prototype.toString.call(num)); // [object Number]var str = 'hudidit.com';al ...

  4. 在VS2015中用C++创建DLL并用C#调用且同时实现对DLL的调试

    from:http://m.blog.csdn.net/article/details?id=51075023 在VS2015中先创建C#项目,然后再创建要编写的动态库DLL项目,这样做的好处是整个解 ...

  5. 漫谈python中的搜索/排序

    在数据结构那一块,搜索有顺序查找/二分查找/hash查找,而排序有冒泡排序/选择排序/插入排序/归并排序/快速排序.如果遇到数据量和数组排列方式不同,基于时间复杂度的考虑,可能需要用到混合算法.如果用 ...

  6. zlog学习笔记(zc_hashtable)

    zc_hashtable.h /** * hashtable */ #ifndef __zc_hashtable_h #define __zc_hashtable_h typedef struct z ...

  7. Notes: Principles of fMRI 1 (Coursera)

    course link: https://class.coursera.org/fmri1-001 Part 1  ❤ Three fundmental goals in fMRI: localiza ...

  8. react拷贝index.html很恶心之解决办法

    https://www.npmjs.com/package/html-webpack-plugin

  9. c++ typeid获取类型名-rtti

    typeid操作符的作用就是获取一个表达式的类型.返回结果是const type_info&.不同编译器实现的type_info class各不相同.但c++标准保证它会实现一个name()方 ...

  10. “Word自动更改后的内容保存到通用文档模板上。是否加载该模板?“的解决办法

    在win7系统下,Word2010出现了不能正常关闭.打开一个已有word文档,点击右上角关闭按钮后,先提示"word已停止工作,windows正在检查该问题的解决方案",随后提示 ...