5
回答
怎么对 list 里面的数据根据某个项进行排序???
终于搞明白,存储TCO原来是这样算的>>>   
List<TchClsEntity> list = result.getResult();
      List<JSONObject> mapList = new ArrayList<>(list.size());
      for (TchClsEntity one : list) {
        ServiceResult<DepartEntity> classResult = departService.searchDataById(one.getcId());
        ServiceResult<DepartEntity> gradeResult = departService.searchDataById(one.getgId());
        DepartEntity classEntity = classResult.getResult();
        Integer id = classEntity.getWxDid();
        String cName = classEntity.getDepartName();
        String gName = gradeResult.getResult().getDepartName();
        JSONObject map = new JSONObject();
        map.put("id", id);
        map.put("cName", cName);
        map.put("gName", gName);
        map.put("order", classEntity.getOrders());
        mapList.add(map);
      }



想让mapList里面的map根据每个map的order进行排序,order是排序号。
<无标签>
举报
染了个发
发帖于12个月前 5回/861阅
顶部