huanghongfa
2021-06-17 ce4b6a8e4c11a869f5707eef053488c62fb97eed
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));