| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public AppStatisticsVO getAppStatistics(AppStatisticsVO appStatisticsVO) { |
| | | |
| | | Integer appUserNum = baseMapper.getAppUserNum(); |
| | | Integer sysUserNum = userClient.getAllUserList().getData().size(); |
| | | String adCode = ""; |
| | | if (StringUtil.isNotBlank(appStatisticsVO.getAdCode())){ |
| | | String paramAd = appStatisticsVO.getAdCode(); |
| | | |
| | | if (paramAd.substring(0,4).indexOf("00") > -1) { |
| | | //前四位包含00说明是湖北省 4200/00000000 |
| | | adCode =StringUtil.format("%{}%",paramAd.substring(0,2)); |
| | | } else if (paramAd.substring(0,6).indexOf("00") > -1) { |
| | | //前六位包含00说明是市级 420100/000000 |
| | | // adCode = paramAd.substring(0,4); |
| | | adCode =StringUtil.format("%{}%",paramAd.substring(0,4)); |
| | | }else if (paramAd.substring(0,8).indexOf("00") > -1){ |
| | | //前8位包含00 说明是区级 42011700/0000 |
| | | // adCode = paramAd.substring(0,6); |
| | | adCode =StringUtil.format("%{}%",paramAd.substring(0,6)); |
| | | } |
| | | } |
| | | |
| | | int appUserNum = baseMapper.getAppUserNum(adCode); |
| | | int sysUserNum =userClient.getSysUserNum(appStatisticsVO.getAdCode()); |
| | | |
| | | appStatisticsVO.setSysUserNum(sysUserNum); |
| | | appStatisticsVO.setAppUserNum(appUserNum); |
| | | |
| | | List<AppStatistics> appStatistics = baseMapper.getAppStatistics(appStatisticsVO); |
| | | appStatisticsVO.setList(appStatistics); |
| | | // List<AppStatistics> appStatistics = baseMapper.getAppStatistics(appStatisticsVO); |
| | | // appStatisticsVO.setList(appStatistics); |
| | | return appStatisticsVO; |
| | | } |
| | | |