publictodoitemvo [ ] todolist (todoparamparam ) ) icasdaonewdao=beanfactory.get bean (icas Dao ); string username=param.gethandlerjobnumber (; string status=param.getitem state (; String taskId=param.getITEMID (; //检测该用户的所有子帐户listlongallaccount=new Dao.query account (username )的int size=allAccount.size (; listtodoitemvo [ ] arr=newlinkedlisttodoitemvo [ ] (int temp=0; for(intI=0; isize; I ) ) /根据用户id获取当前用户的待办事项用户id=all account.get (I ); intsum=new Dao.querytodosum (userid ); todoitemvo [ ] todo=newtodoitemvo [ sum ]; todo=newDao.querytodo(userid,userName ); temp=temp todo.length,将每个帐户的待办事项循环保存在列表数组arr.add (待办事项)中; 将列表数组转换为todoitemvo [ ] todof=newtodoitemvo [ temp ]; int m=0; for(intI=0; iarr.size (; I ) for(intj=0; Jarr.get(I ).length; j ) {todof[m]=ARR.get(I ) ); m; } jsonarrayjson=JSON array.from object (todof ); String strJson=json.toString (; system.out.println(strJSON; 返回刀具; 使用jsonArray或JSONObject,用fromObject ()方法将数据转换为JSON格式