@RequestMapping({"/addItermInfo"})
public void addItermInfo(HttpServletRequest request, HttpServletResponse response){
//用map接收form的所有值
Map<String,String[]> maps = request.getParameterMap();
Map< String, Object> map= new HashMap<String, Object>();
for(Object keyObj : maps.keySet().toArray()){
String[] strs = maps.get(keyObj);
for(String value : strs){
if(value.equals("")||value.length()<=0){
map.put(keyObj.toString(), "0");
}else{
map.put(keyObj.toString(), value);
}
}
}
//测试打印
Set<String> keys = map.keySet();
for(String key :keys){
System.out.println(key+" "+map.get(key));
}
//添加序列 id
String IID=UUID.randomUUID().toString().replace("-", "");
map.put("IID", IID);
String JOSN="";
try {
JOSN=ItremsInfoService.addItermInfo(map);
} catch (Exception e) {
e.printStackTrace();
}
ReqUtils.backing_out_jsonObj(JOSN, response);
}
|
|