|
@@ -7,8 +7,10 @@ import com.itextpdf.text.PageSize;
|
|
|
import com.itextpdf.text.Paragraph;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.PDFUtil;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.system.domain.ProposalInfo;
|
|
|
import com.ruoyi.system.domain.member.MemberInfo;
|
|
@@ -177,7 +179,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
proposalInfo.setEndTime(endTime);
|
|
|
List<ProposalInfo> proposalInfos = proposalInfoMapper.selectProposalInfoList(proposalInfo);
|
|
|
Map<String, Object> threeTaMap = new HashMap<>();
|
|
|
- threeTaMap.put("time", strTime.split(" ")[0] + "-" + endTime.split(" ")[0]);
|
|
|
+ threeTaMap.put("time", strTime.split(" ")[0] + "/" + endTime.split(" ")[0]);
|
|
|
threeTaMap.put("threeTa", 0);
|
|
|
if (proposalInfos != null) {
|
|
|
threeTaMap.put("threeTa", proposalInfos.size());
|
|
@@ -191,7 +193,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
sqmyInfo.setEndTime(endTime);
|
|
|
List<SqmyInfo> sqmyInfos = sqmyInfoMapper.selectSqmyInfoList(sqmyInfo);
|
|
|
Map<String, Object> threeSqmyMap = new HashMap<>();
|
|
|
- threeSqmyMap.put("time", strTime.split(" ")[0] + "-" + endTime.split(" ")[0]);
|
|
|
+ threeSqmyMap.put("time", strTime.split(" ")[0] + "/" + endTime.split(" ")[0]);
|
|
|
threeSqmyMap.put("threesqmy", 0);
|
|
|
if (sqmyInfos != null) {
|
|
|
threeSqmyMap.put("threesqmy", sqmyInfos.size());
|
|
@@ -231,13 +233,17 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
BigDecimal num2 = new BigDecimal(week);
|
|
|
BigDecimal subNum1 = num2.subtract(num1);
|
|
|
//subNum1/num1
|
|
|
- double result = Double.parseDouble(((subNum1.divide(num1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
- if (result < 0) {
|
|
|
- result = result * -1;
|
|
|
- }
|
|
|
+ taMap.put("percent", "0%");
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0%"); // 创建DecimalFormat对象并设置格式化模式为"0%"
|
|
|
- String percentage = decimalFormat.format((result)); // 使用DecimalFormat对象进行格式化操作
|
|
|
- taMap.put("percent", percentage);
|
|
|
+ if(lastWeek!=0){
|
|
|
+ double result = Double.parseDouble(((subNum1.divide(num1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
+ if (result < 0) {
|
|
|
+ result = result * -1;
|
|
|
+ }
|
|
|
+ String percentage = decimalFormat.format((result)); // 使用DecimalFormat对象进行格式化操作
|
|
|
+ taMap.put("percent", percentage);
|
|
|
+ }
|
|
|
+
|
|
|
map.put("taMap", taMap);
|
|
|
|
|
|
//较上月上报社情民意
|
|
@@ -269,11 +275,15 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
BigDecimal monthNum2 = new BigDecimal(month);
|
|
|
BigDecimal monthsubNum1 = monthNum2.subtract(monthNum1);
|
|
|
//subNum1/num1
|
|
|
- double resultMonth = Double.parseDouble(((monthsubNum1.divide(monthNum1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
- if (resultMonth < 0) {
|
|
|
- resultMonth = resultMonth * -1;
|
|
|
+ taMap.put("percent", "0%");
|
|
|
+ if(lastMonth != 0){
|
|
|
+ double resultMonth = Double.parseDouble(((monthsubNum1.divide(monthNum1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
+ if (resultMonth < 0) {
|
|
|
+ resultMonth = resultMonth * -1;
|
|
|
+ }
|
|
|
+ taMap.put("percent", decimalFormat.format((resultMonth)));
|
|
|
}
|
|
|
- taMap.put("percent", decimalFormat.format((resultMonth)));
|
|
|
+
|
|
|
map.put("sqmyMap", sqmyMap);
|
|
|
return AjaxResult.success(map);
|
|
|
}
|
|
@@ -414,19 +424,19 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
//已办结
|
|
|
BigDecimal num4 = new BigDecimal(ybj);
|
|
|
//num2/num1
|
|
|
- double ybjResult = Double.parseDouble(((num3.divide(num4, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
+ double ybjResult = Double.parseDouble(((num4.divide(num1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
ybjMap.put("percent", decimalFormat.format((ybjResult)));
|
|
|
|
|
|
//未办结
|
|
|
BigDecimal num5 = new BigDecimal(wbj);
|
|
|
//num2/num1
|
|
|
- double wbjResult = Double.parseDouble(((num3.divide(num5, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
+ double wbjResult = Double.parseDouble(((num5.divide(num1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
wbjMap.put("percent", decimalFormat.format((wbjResult)));
|
|
|
|
|
|
//待办理
|
|
|
BigDecimal num6 = new BigDecimal(dbl);
|
|
|
//num2/num1
|
|
|
- double dblResult = Double.parseDouble(((num3.divide(num6, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
+ double dblResult = Double.parseDouble(((num6.divide(num1, 2, BigDecimal.ROUND_HALF_UP))).toString());
|
|
|
dblMap.put("percent", decimalFormat.format((dblResult)));
|
|
|
}
|
|
|
map.put("ylaMap",ylaMap);
|
|
@@ -436,4 +446,63 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
map.put("dblMap",dblMap);
|
|
|
return AjaxResult.success(map);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult personageData() {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
+ ProposalInfo proposalInfo = new ProposalInfo();
|
|
|
+ proposalInfo.setProposalUserId(user.getUserId());
|
|
|
+ List<ProposalInfo> proposalInfos = proposalInfoMapper.selectProposalInfoList(proposalInfo);
|
|
|
+ Map<String, Object> taMap = new HashMap<>();
|
|
|
+ //总提案数
|
|
|
+ int zta = 0;
|
|
|
+ //提案立案
|
|
|
+ int tala = 0;
|
|
|
+ //提案不予立案
|
|
|
+ int tabyla = 0;
|
|
|
+ if (proposalInfos!=null && proposalInfos.size()>0) {
|
|
|
+ zta = proposalInfos.size();
|
|
|
+ for (ProposalInfo info : proposalInfos) {
|
|
|
+ if (Integer.parseInt(info.getProposalProgress()) >= 2 && !"3".equals(info.getProposalProgress())) {
|
|
|
+ tala++;
|
|
|
+ }
|
|
|
+ if ("3".equals(info.getProposalProgress())) {
|
|
|
+ tabyla++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ taMap.put("zta",zta);
|
|
|
+ taMap.put("tala",tala);
|
|
|
+ taMap.put("tabyla",tabyla);
|
|
|
+ map.put("taMap",taMap);
|
|
|
+
|
|
|
+ SqmyInfo sqmyInfo = new SqmyInfo();
|
|
|
+ sqmyInfo.setSqmyUserId(user.getUserId());
|
|
|
+ List<SqmyInfo> sqmyInfos = sqmyInfoMapper.selectSqmyInfoList(sqmyInfo);
|
|
|
+ Map<String, Object> sqmyMap = new HashMap<>();
|
|
|
+ //总社情民意数
|
|
|
+ int zsqmy = 0;
|
|
|
+ //社情民意立案
|
|
|
+ int sqmyla = 0;
|
|
|
+ //社情民意不予立案
|
|
|
+ int sqmybyla = 0;
|
|
|
+ if (sqmyInfos!=null && sqmyInfos.size()>0) {
|
|
|
+ zta = sqmyInfos.size();
|
|
|
+ for (SqmyInfo info : sqmyInfos) {
|
|
|
+ if (Integer.parseInt(info.getSqmyProgress()) >= 2 && !"3".equals(info.getSqmyProgress())) {
|
|
|
+ sqmyla++;
|
|
|
+ }
|
|
|
+ if ("3".equals(info.getSqmyProgress())) {
|
|
|
+ sqmybyla++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqmyMap.put("zsqmy",zsqmy);
|
|
|
+ sqmyMap.put("sqmyla",sqmyla);
|
|
|
+ sqmyMap.put("sqmybyla",sqmybyla);
|
|
|
+ map.put("sqmyMap",sqmyMap);
|
|
|
+
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
}
|