java 分批次读取java.util.List 数据

java 功能源代码:

 @RequestMapping({"/batchupdate"})
  @ResponseBody
  public String batchUpdate(){
	  String result = "";
	  try{
	  List list = accountService.batchUpdate();
	  List batch = new ArrayList();
	  
	 
	  //密码修改
	  if(list !=null && list.size()>0){
		  for(int i=0;i a = new ArrayList();
           if (i == batchnum - 1) {  
               int size = (i + 1) * init;  
               for (int j = size - init; j < nums; j++) {  
            	   if (batch.get(j) == null) {  
                       break;  
                   } 
            	   a.add(batch.get(j));  
               }  
              
           } else {  
               int size = (i + 1) * init;  
               for (int j = size - init; j < size; j++) { 
            	   if (batch.get(j) == null) {  
                       break;  
                   }  
            	   a.add(batch.get(j));  
               }  
             
           }  
           accountService.updateBatch(a);
          
       }  
	  
	 
	
	  
	  }catch(Exception e){
		  System.out.println(e.getMessage());
		  return "false";
	  }
	  result = "true";
	  return result;
	  
  }

业务流程分解:

待补充

你可能感兴趣的:(Java(功能篇))