From 718213fca4962070df0b7ab167d78cf2f85c4647 Mon Sep 17 00:00:00 2001
From: xyh <18782104331@139.com>
Date: 星期四, 17 六月 2021 14:38:16 +0800
Subject: [PATCH] 修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 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 3c521f9..f01e54a 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
@@ -1,5 +1,6 @@
 package com.panzhihua.service_community.service.impl;
 
+import cn.hutool.core.date.DatePattern;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.panzhihua.common.model.dtos.partybuilding.ComPbActivityDTO;
@@ -12,6 +13,7 @@
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -185,7 +187,7 @@
             dateList.add(startMap);
             Map<String,String> endMap = new HashMap<>();
             endMap.put("name",monthStr[m]+"月下旬");
-            endMap.put("start",month+ "-"+half+" 23:59:58");
+            endMap.put("start",month+ "-"+half+" 23:59:59");
             endMap.put("end",DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss"));
             dateList.add(endMap);
         }
@@ -203,7 +205,7 @@
         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.setPubPoint(countMap.get("pubPoint") == null ? 0 : Double.valueOf(countMap.get("pubPoint").toString()).intValue());
         comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0 : Double.valueOf(countMap.get("dealTime").toString()).intValue());
         List<EastPhotoVO> list = new ArrayList<>();
         //统计半年数据
@@ -215,10 +217,10 @@
             list.add(result);
         }
         comActEasyPhotoScreenVO.setList(list);
-
-        Date start = DateUtil.parseTime(DateUtil.format(DateUtils.getDateM(new Date(),-n),moth_format_str)+" 00:00:00");
-        Date initTime = DateUtil.parseTime(initMonth +" 00:00:00");
-        if(DateUtils.before(start,initTime)){
+        String fmt = "yyyy-MM-01 00:00:00";
+        Date start = DateUtil.parse(DateUtil.format(DateUtils.getDateM(new Date(),-n),new SimpleDateFormat(fmt)));
+        Date initTime = DateUtil.parse(initMonth +"-01 00:00:00", DatePattern.NORM_DATETIME_FORMAT);
+        if(!DateUtils.before(initTime,start)){
             start = initTime;
         }
         comActEasyPhotoScreenVO.setListTimes(DateUtil.format(start,moth_format_ch)+"-"+DateUtil.format(DateUtils.getDateM(new Date(),-1),moth_format_ch));

--
Gitblit v1.7.1