当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";
}
当findById(Integer id)变成String类型的更多相关文章
- Redis 中 String 类型的内存开销比较大
使用 String 类型内存开销大 1.简单动态字符串 2.RedisObject 3.全局哈希表 使用 Hash 来存储 总结 参考 使用 String 类型内存开销大 如果我们有大量的数据需要来保 ...
- String类型函数传递问题
String类型函数传递问题 问题 以前没有注意过的一个问题, 最近在使用String类型作为函数入参的时候, 发现函数内对于String类型的改变并不会影响到外层调用对象本身; 结论 (先说结论) ...
- ArrayList list = new ArrayList()在这个泛型为Integer的ArrayList中存放一个String类型的对象
java面试要点---ArrayList list = new ArrayList(); 在这个泛型为Integer的ArrayList中存放一个String类型的对象. ArrayList list ...
- 通过反射 往泛型Integer的集合里添加String 类型的数据 Day25
package com.sxt.method1; import java.lang.reflect.Method; /* * 需求:通过反射 往泛型Integer的集合里添加String 类型的数据 ...
- 如果不空null并且不是空字符串才去修改这个值,但这样写只能针对字符串(String)类型,如果是Integer类型的话就会有问题了。 int i = 0; i!=''。 mybatis中会返回tr
mybatis 参数为Integer型数据并赋值0时,有这样一个问题: mybatis.xml中有if判断条件判断参数不为空时,赋值为0的Integer参数被mybatis判断为空,因此不执行< ...
- List<Integer>里有可能存String类型元素吗?
这其实是我遇到的一个线上bug,在这里分享给大家. 如果是用反射,那就很简单了,毕竟泛型只是在编译期进行约束,对运行期是无能为力的. 想想看,如果不使用反射,有没有办法做到呢? 问题起因 在我们公司的 ...
- ElasticSearch 5学习(9)——映射和分析(string类型废弃)
在ElasticSearch中,存入文档的内容类似于传统数据每个字段一样,都会有一个指定的属性,为了能够把日期字段处理成日期,把数字字段处理成数字,把字符串字段处理成字符串值,Elasticsearc ...
- 总结:String类型与Int类型的转换【实现插入操作主键自增】
1.String类型(此类型是数字格式的字符串类型)转换成Int类型 String str = "10000"; 转换成Int类型: int num = Integer.parse ...
- Java 类类型之 String 类型
类类型 引用数据类型存的都是地址,通过地址指向对象: 基本数据类型存的都是具体值: 字符串 (String) 类型 特点: 1.字符创都是对象: 2.一旦初始化,不能被更改,字符串缓冲区支持可变的字符 ...
随机推荐
- 程序流程的控制之条件分支(Delphi)
if语句主要来检测一个条件,并根据这个条件是True或者False来执行一段代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 var I: Integer ...
- 2795: [Poi2012]A Horrible Poem
2795: [Poi2012]A Horrible Poem Time Limit: 50 Sec Memory Limit: 128 MBSubmit: 484 Solved: 235[Subm ...
- Java 集合系列03之 ArrayList详细介绍(源码解析)和使用示例
概要 上一章,我们学习了Collection的架构.这一章开始,我们对Collection的具体实现类进行讲解:首先,讲解List,而List中ArrayList又最为常用.因此,本章我们讲解Arra ...
- Web API删除JSON格式的文件记录
Insus.NET的系列Web Api学习文章,这篇算是计划中最后一篇了,删除JSON格式的文件记录.前一篇<Web Api其中的PUT功能演示>http://www.cnblogs.co ...
- 基于VirtualBox安装Ubuntu图文教程
基于VirtualBox虚拟机安装Ubuntu图文教程 一. 下载安装VirtualBox 官网下载VirtualBox,目前版本:VirtualBox 5.1.8 for Windows hosts ...
- PRML读书会第十一章 Sampling Methods(MCMC, Markov Chain Monte Carlo,细致平稳条件,Metropolis-Hastings,Gibbs Sampling,Slice Sampling,Hamiltonian MCMC)
主讲人 网络上的尼采 (新浪微博: @Nietzsche_复杂网络机器学习) 网络上的尼采(813394698) 9:05:00 今天的主要内容:Markov Chain Monte Carlo,M ...
- 这些javascript面试题,你做对了几道?
1.---------------------------------------------------- var fun = function(){ this.name = 'peter'; re ...
- SQL基础之GROUPING
1.grouping sets 记得前几天第一次接触grouping sets时,笔者的感觉是一脸懵逼. 后来一不小心看到msdn上对grouping sets的说明,顿时豁然开朗,其实groupin ...
- linux上课
1. service --status-all 2. service sshd restart 3. service --status-all | grep ssh 4. chkconfig --l ...
- asp.net程序员初涉node.js
之前一直听说node.js在处理网站大规模并发上十分有用,所以有一定规模的公司都在使用node.我在工作中只用过jquery,属于那种边做功能边学习的那一种.甚至连原生的js都不太会写,只是知道语法差 ...