|
|
@ -28,9 +28,9 @@ import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 组织能力用户相关接口 |
|
|
@ -169,10 +169,23 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { |
|
|
|
logger.error(String.format("各机关注册用户数缺少记录:date_id=%s,agencyId=%s",formDTO.getDateId(),dimInitResultDto.getAgencyId())); |
|
|
|
} |
|
|
|
} |
|
|
|
logger.info("排序前"); |
|
|
|
for(UserSubAgencyResultDTO m:dimList){ |
|
|
|
logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); |
|
|
|
} |
|
|
|
//返回集合按照total降序排序
|
|
|
|
List<UserSubAgencyResultDTO> returnList = dimList.stream().sorted(Comparator.comparing(UserSubAgencyResultDTO::getTotal)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return returnList; |
|
|
|
Collections.sort(dimList, new Comparator<UserSubAgencyResultDTO>() { |
|
|
|
@Override |
|
|
|
public int compare(UserSubAgencyResultDTO o1, UserSubAgencyResultDTO o2) { |
|
|
|
int i=o2.getTotal()-o1.getTotal();//降序
|
|
|
|
return i; |
|
|
|
} |
|
|
|
}); |
|
|
|
logger.info("排序后"); |
|
|
|
for(UserSubAgencyResultDTO m:dimList){ |
|
|
|
logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); |
|
|
|
} |
|
|
|
return dimList; |
|
|
|
} |
|
|
|
|
|
|
|
private List<UserSubAgencyResultDTO> initUserSubAgencyResultDTO(String myAgencyId) { |
|
|
@ -273,10 +286,23 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { |
|
|
|
logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); |
|
|
|
} |
|
|
|
} |
|
|
|
logger.info("排序前"); |
|
|
|
for(UserSubGridResultDTO m:dimList){ |
|
|
|
logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); |
|
|
|
} |
|
|
|
//返回集合按照total降序排序
|
|
|
|
List<UserSubGridResultDTO> returnList = dimList.stream().sorted(Comparator.comparing(UserSubGridResultDTO::getTotal)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return returnList; |
|
|
|
Collections.sort(dimList, new Comparator<UserSubGridResultDTO>() { |
|
|
|
@Override |
|
|
|
public int compare(UserSubGridResultDTO o1, UserSubGridResultDTO o2) { |
|
|
|
int i=o2.getTotal()-o1.getTotal();//降序
|
|
|
|
return i; |
|
|
|
} |
|
|
|
}); |
|
|
|
logger.info("排序后"); |
|
|
|
for(UserSubGridResultDTO m:dimList){ |
|
|
|
logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); |
|
|
|
} |
|
|
|
return dimList; |
|
|
|
} |
|
|
|
|
|
|
|
private List<UserSubGridResultDTO> initUserSubGridResultDTO(String myAgencyId) { |
|
|
@ -399,7 +425,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { |
|
|
|
for(UserIncrTrendResDTO userIncrTrendResDTO:list){ |
|
|
|
String date=""; |
|
|
|
if(UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())){ |
|
|
|
date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"."); |
|
|
|
date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"/"); |
|
|
|
}else if(UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())){ |
|
|
|
date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"/"); |
|
|
|
} |
|
|
|