当findById(Integer id)变成String类型
2024-09-23 21:04:44
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";
}
最新文章
- python3&#160; threading初体验
- React Native props &; state
- 【BZOJ】3434: [Wc2014]时空穿梭
- 使用Eclipse构建Maven项目 (step-by-step)
- LeetCode(43. Multiply Strings)
- [leetcode]_Remove Duplicates from Sorted Array II
- pdo 连接数据库 报错 could not find driver 解决方法
- asp.net web api 开发时应当注意的事项
- MyEclipse-java读取jxl的时候报错OutOfMemoryError
- sublime text snippet代码片断
- iOS 数据库第三方FMDB的简单使用
- 使用SSIS对Dynamics CRM 系统进行数据迁移
- char与unsigned char 差别
- HDU 2040 亲和数
- “百度杯”CTF比赛 十月场EXEC
- JS快速排序 希尔排序 归并排序 选择排序
- struts标签怎么判断request里的属性是否为空 <;s:if test=";${list==null}";>; <;/s:if>;
- mysql 查看字段是否添加了索引
- MTALAB——神经网络mae()、mse()、sse()
- python 历险记(三)— python 的常用文件操作
热门文章
- BZOJ 1257: [CQOI2007]余数之和sum
- 你所未知的3种 Node.js 代码优化方式
- 定时取数据库的schema,并推送到git服务器
- Centos5.8 iptables管理
- Windows 8.1 应用开发 – 触控操作
- [资料]自动化e2e测试 -- WebDriverJS,Jasmine和Protractor
- C#:DataTable映射成Model
- 前端见微知著工具篇:Grunt实现自动化
- Fragment生命周期
- (转)RSA算法原理(二)