Browse Source

Merge remote-tracking branch 'origin/master'

Administrator 1 year ago
parent
commit
79052a03a4

+ 34 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -8,6 +8,7 @@ import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
+import java.util.Calendar;
 import java.util.Date;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
@@ -53,6 +54,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return dateTimeNow(YYYY_MM_DD);
     }
 
+    /**
+     * 获取当前日期, 默认格式为yyyy-MM
+     *
+     * @return String
+     */
+    public static String getMonth()
+    {
+        return dateTimeNow(YYYY_MM);
+    }
+
     public static final String getTime()
     {
         return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
@@ -188,4 +199,27 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
         return Date.from(zdt.toInstant());
     }
+
+    /***
+     * 获取当前月份的前后N月份的时间
+     * @param dateStr 当前月份
+     * @param addMonth n,负数为以前
+     *
+     * @return
+     */
+    public static String lastMouth(String dateStr, int addMonth) throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+        Date sourceDate = sdf.parse(dateStr);
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(sourceDate);
+        cal.add(Calendar.MONTH, addMonth);
+        // 上个月的年和月
+        int month = cal.get(Calendar.MONTH) + 1;
+        int year = cal.get(Calendar.YEAR);
+        // 月第一天和最后一天
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        System.out.println(year+"-"+month);
+        return year+"-"+month+" 00:00:00";
+    }
+
 }

+ 46 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ProposalInfoServiceImpl.java

@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.domain.ProposalUnitReply;
 import com.ruoyi.system.domain.ProposalUser;
 import com.ruoyi.system.domain.ZxFj;
@@ -107,8 +108,11 @@ public class ProposalInfoServiceImpl implements IProposalInfoService
         Map<String,Object> map = new HashMap<>();
         List<ProposalInfo> proposalInfos = proposalInfoMapper.selectProposalInfoList(proposalInfo);
         int totle = proposalInfos.size();
+        //待审查
         int dsc = 0;
+        //以立案
         int yla = 0;
+        //不予立案
         int byla = 0;
         for (ProposalInfo info : proposalInfos) {
             if("1".equals(info.getProposalProgress())){
@@ -119,11 +123,53 @@ public class ProposalInfoServiceImpl implements IProposalInfoService
                 yla++;
             }
         }
+        //办理中
+        int blz = 0;
+        //不满意
+        int bmy = 0;
+        //已办结
+        int ybj = 0;
+        //未办结
+        int wbj = 0;
+        //待交办
+        int djb = 0;
+        //以交办
+        int yjb = 0;
+
+        for (ProposalInfo info : proposalInfos) {
+            if(!"1".equals(info.getProposalProgress()) && !"3".equals(info.getProposalProgress()) && !"8".equals(info.getProposalProgress())){
+                blz++;
+            }
+            if(StringUtils.isNotEmpty(info.getSatisfaction()) && "0".equals(info.getSatisfaction())){
+                bmy++;
+            }
+            if("8".equals(info.getProposalProgress())) {
+                ybj++;
+            }
+            if(!"8".equals(info.getProposalProgress())) {
+                wbj++;
+            }
+            if(Integer.parseInt(info.getSatisfaction())>4){
+                yjb++;
+            }
+            if(Integer.parseInt(info.getSatisfaction())<=4){
+                djb++;
+            }
+        }
+
+
         map.put("totle",totle);
         map.put("dsc",dsc);
         map.put("yla",yla);
         map.put("byla",byla);
 
+        map.put("blz",blz);
+        map.put("bmy",bmy);
+        map.put("ybj",ybj);
+        map.put("wbj",wbj);
+        map.put("yjb",yjb);
+        map.put("djb",djb);
+
         return AjaxResult.success(map);
     }
 

+ 29 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SqmyInfoServiceImpl.java

@@ -97,7 +97,9 @@ public class SqmyInfoServiceImpl implements ISqmyInfoService
         Map<String,Object> map = new HashMap<>();
         List<SqmyInfo> sqmyInfos = sqmyInfoMapper.selectSqmyInfoList(sqmyInfo);
         int totle = sqmyInfos.size();
+        //待审核
         int dsh = 0;
+        //已审核
         int ysh = 0;
         for (SqmyInfo info : sqmyInfos) {
             if("1".equals(info.getSqmyProgress())){
@@ -106,10 +108,37 @@ public class SqmyInfoServiceImpl implements ISqmyInfoService
                 ysh++;
             }
         }
+        //待交办
+        int djb = 0;
+        //以交办
+        int yjb = 0;
+        //已办结
+        int ybj = 0;
+        //未办结
+        int wbj = 0;
+        for (SqmyInfo info : sqmyInfos) {
+            if(Integer.parseInt(info.getSatisfaction())>4){
+                yjb++;
+            }
+            if(Integer.parseInt(info.getSatisfaction())<=4){
+                djb++;
+            }
+            if("8".equals(info.getSqmyProgress())) {
+                ybj++;
+            }
+            if(!"8".equals(info.getSqmyProgress())) {
+                wbj++;
+            }
+        }
         map.put("totle",totle);
         map.put("dsh",dsh);
         map.put("ysh",ysh);
 
+        map.put("djb",djb);
+        map.put("djb",djb);
+        map.put("ybj",ybj);
+        map.put("wbj",wbj);
+
         return AjaxResult.success(map);
     }