From 5433e33d3079a047ddda17af7302e742aa0363dd Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 16 六月 2021 20:25:12 +0800
Subject: [PATCH] 合并大屏工作模块代码

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java |   51 +++++++++++++++++++++++++++++----------------------
 1 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
index 236d874..4addef6 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
@@ -45,18 +45,20 @@
 
     private final String moth_format_str = "yyyy-MM";
 
+    private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"};
+
     @Override
     public R statisticNeighborCircle(Long communityId) {
 
         ComActNeighborCircleScreenVO comActNeighborCircleScreenVO = new ComActNeighborCircleScreenVO();
         String date = DateUtils.getDateFormatString(new Date(),moth_format_str);
         Map<String,Long> countMap = comActNeighborCircleDAO.countByCommunityId(communityId,date);
-        comActNeighborCircleScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum"));
-        comActNeighborCircleScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum"));
-        Map<String,Long> sumMap = comActNeighborCircleDAO.sumScreenNum(communityId);
-        comActNeighborCircleScreenVO.setFabulousNum(sumMap.get("fabulousNum") == null ? 0L : sumMap.get("fabulousNum"));
-        comActNeighborCircleScreenVO.setCommentNum(sumMap.get("commentNum") == null ? 0L : sumMap.get("commentNum"));
-        comActNeighborCircleScreenVO.setSharedNum(sumMap.get("forwardNum") == null ? 0L : sumMap.get("forwardNum"));
+        comActNeighborCircleScreenVO.setCurrentNum(countMap.get("currentNum"));
+        comActNeighborCircleScreenVO.setTotalNum(countMap.get("totalNum"));
+        Map<String,Object> sumMap = comActNeighborCircleDAO.sumScreenNum(communityId);
+        comActNeighborCircleScreenVO.setFabulousNum(sumMap.get("fabulousNum") == null?0L:Long.valueOf(sumMap.get("fabulousNum").toString()));
+        comActNeighborCircleScreenVO.setCommentNum(sumMap.get("commentNum") == null?0L:Long.valueOf(sumMap.get("commentNum").toString()));
+        comActNeighborCircleScreenVO.setSharedNum(sumMap.get("forwardNum") == null?0L:Long.valueOf(sumMap.get("forwardNum").toString()));
         //查询最近发布的邻里圈
         comActNeighborCircleScreenVO.setList(comActNeighborCircleDAO.screenNeighborCircle(communityId,pageSize));
         //查询最近发布的邻里圈图片
@@ -101,6 +103,8 @@
     @Override
     public R activity(Long communityId) {
         ComActActivityScreenVO comActActivityScreenVO = new ComActActivityScreenVO();
+
+        comActActivityScreenVO.setImgs(convertStringList(actActivityDAO.listImg(communityId)));
         //统计本月新增、居民活动,志愿者活动
         String date = DateUtils.getDateFormatString(new Date(),moth_format_str);
         Map<String,Long> countMap = actActivityDAO.countByCommunityId(communityId,date);
@@ -156,19 +160,24 @@
         List<PbWorkVO> dateList = new ArrayList<>();
         Date now  = new Date();
         for(int i= 6;i>=1;i--){
-            Date date = DateUtils.getDateM(now,i);
+            Date date = DateUtils.getDateM(now,-i);
             DateTime endDay = DateUtil.endOfMonth(date);
-            int m = endDay.month();//月份
-            int day = DateUtil.dayOfMonth(date);
+
+            int m = DateUtil.month(endDay);
+            if(m == 0){
+                m = 12;
+            }
+            m--;
+            int day = DateUtil.dayOfMonth(endDay);
             int half = day/2;
             String month = DateUtil.format(date,moth_format_str);
             PbWorkVO pbWorkVO = new PbWorkVO();
-            pbWorkVO.setMonth(m+"月上旬");
+            pbWorkVO.setMonth(monthStr[m]+"月上旬");
             pbWorkVO.setStart(month+ "-01 00:00:00");
             pbWorkVO.setEnd(month+ "-"+half+" 23:59:58");
             dateList.add(pbWorkVO);
             PbWorkVO pbWorkVO2 = new PbWorkVO();
-            pbWorkVO2.setMonth(m+"月下旬");
+            pbWorkVO2.setMonth(monthStr[m]+"月下旬");
             pbWorkVO2.setStart(month+ "-"+half+" 23:59:58");
             pbWorkVO2.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss"));
             dateList.add(pbWorkVO2);
@@ -180,17 +189,15 @@
     @Override
     public R easyPhoto(Long communityId) {
         ComActEasyPhotoScreenVO comActEasyPhotoScreenVO = new ComActEasyPhotoScreenVO();
-        Map<String,Long> dealMap = comActEasyPhotoDAO.countDeal(communityId);
-        comActEasyPhotoScreenVO.setDeal(getList(dealMap));
-        Map<String,Long> pubMap = comActEasyPhotoDAO.countPub(communityId);
-        comActEasyPhotoScreenVO.setPub(getList(pubMap));
-        Map<String,Long> approvedMap = comActEasyPhotoDAO.countApproved(communityId);
-        comActEasyPhotoScreenVO.setApproved(getList(approvedMap));
-
-        Map<String,Long> countMap = comActEasyPhotoDAO.countByCommunityId(communityId);
-        comActEasyPhotoScreenVO.setNoneDeal(countMap.get("noneDeal") == null ? 0L : countMap.get("noneDeal"));
-        comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0L : countMap.get("pubPoint"));
-        comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0L : countMap.get("dealTime"));
+        comActEasyPhotoScreenVO.setDeal(comActEasyPhotoDAO.countDeal(communityId));
+        comActEasyPhotoScreenVO.setPub(comActEasyPhotoDAO.countPub(communityId));
+        comActEasyPhotoScreenVO.setApproved(comActEasyPhotoDAO.countApproved(communityId));
+        String date = DateUtils.getDateFormatString(new Date(),moth_format_str);
+        Map<String,Object> countMap = comActEasyPhotoDAO.countByCommunityId(communityId,date);
+        comActEasyPhotoScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : Long.valueOf(countMap.get("currentNum").toString()));
+        comActEasyPhotoScreenVO.setNoneDeal(countMap.get("noneDeal") == null ? 0L : Long.valueOf(countMap.get("noneDeal").toString()));
+        comActEasyPhotoScreenVO.setPubPoint(countMap.get("pubPoint") == null ? 0 : Integer.valueOf(countMap.get("pubPoint").toString()));
+        comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0 : Double.valueOf(countMap.get("dealTime").toString()).intValue());
         List<EastPhotoVO> list = new ArrayList<>();
         for(PbWorkVO workVO: listHalfYear()){
             String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(workVO.getStart()),moth_format_str);

--
Gitblit v1.7.1