集合map 对集合map进行取值 遍历循环

来源:互联网 发布:android蓝牙接收数据 编辑:程序博客网 时间:2024/06/06 00:46
@RequestMapping(value="/lsdbsd", method = { RequestMethod.GET,
RequestMethod.POST }, produces = "application/json; charset=utf-8")
public String getLcsyDistributionsd(@RequestParam(value = "thedate", required = true)String thedate) throws Exception
{
if(StringUtils.isNullorEmpty(thedate))
{
//错误信息提示
return JsonUtil.errorMessages(1);
}else
{
String [] par=new String[] {thedate};
Map<String, Object> map=Putawayutils.findProc1("sp_hyfx_SoldOutDistributiones",par);
List mapjimi=new ArrayList<>();
for (String key : map.keySet()) {
  System.out.println("key= "+ key + " and value= " + map.get(key));
  //取出{buyID=123}的value值
 mapjimi= (List) map.get(key);
 }

int lcsycount =mapjimi.size();
return lcsycount!=0?JSON.toJSONString(map):JsonUtil.errorMessages(8);
}
}