List<String> 2List <Long>
public static List<Integer> CollStringToIntegerLst(List<String> inList){ List<Integer> iList =new ArrayList<Integer>(inList.size()); CollectionUtils.collect(inList, new Transformer(){ public java.lang.Object transform(java.lang.Object input){ return new Integer((String)input); } } ,iList ); return iList; }
/**
* 分页按条件查询权限列表
*
* @param keywords
* @return
*/
@RequestMapping(value = "/getByCondition2", method = { RequestMethod.GET,
RequestMethod.POST })
public @ResponseBody String getByCondition2(String beginTime,
String endTime,String privilegePersonsList,int startRow,int pageSize) {
List<Integer> privilegePersonLongs= new ArrayList<Integer>();
String[] split = privilegePersonsList.split(",");
List<String> privilegePersons= Arrays.asList(split);
if (privilegePersonLongs!=null) {
List<DataPrivilege> list =service.selectByCondition(beginTime,endTime, ListUtil.fromStringToLongList(privilegePersons),startRow,pageSize);
Page<DataPrivilege> page = new Page<DataPrivilege>(service.countByConditions());
if (list.size() != 0) {
ResultVO<DataPrivilege> result = new ResultVO<DataPrivilege>();
result.setLists(list);
result.setPage(page);
return result.toString();
}
}
return "";
}
public static List<Integer> CollStringToIntegerLst(List<String> inList){
List<Integer> iList =new ArrayList<Integer>(inList.size());
CollectionUtils.collect(inList,
new Transformer(){
public java.lang.Object transform(java.lang.Object input){
return new Integer((String)input);
}
} ,iList );
return iList;
}