101captain
2022-01-04 f372e6282a957dbbc529c432f3e19a4028d7aee8
1.4   折线图时间处理
8个文件已修改
45 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenActivityLine.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenStaticsReserveMonth.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveRecordMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComPbMemberDAO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPbMemberMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenActivityLine.java
@@ -16,4 +16,6 @@
    private Integer y;
    @ApiModelProperty("累计数")
    private Integer countY;
    private String year;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenStaticsReserveMonth.java
@@ -22,4 +22,6 @@
    private Integer homeCount;
    @ApiModelProperty("总量")
    private Integer count;
    private String year;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveRecordMapper.java
@@ -121,5 +121,5 @@
     * @param date
     * @return
     */
    BigScreenStaticsReserveMonth biggestScreenMonth(@Param("communityId")Long communityId,@Param("date")String date);
    BigScreenStaticsReserveMonth biggestScreenMonth(@Param("communityId")Long communityId,@Param("date")String date,@Param("year")String year);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComPbMemberDAO.java
@@ -37,7 +37,7 @@
     * @param date
     * @return
     */
    BigScreenActivityLine selectActivityCountMonth(@Param("communityId")Long communityId, @Param("date")String date);
    BigScreenActivityLine selectActivityCountMonth(@Param("communityId")Long communityId, @Param("date")String date,@Param("year")String year);
    /**
     * 查询党员积分前3
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenServiceImpl.java
@@ -1,10 +1,12 @@
package com.panzhihua.service_community.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.SensitiveUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComPbMemberDAO;
@@ -116,9 +118,9 @@
    @Override
    public R partyActivityLine(Long communityId) {
        List<BigScreenActivityLine> bigScreenActivityLines=this.getPoints();
        List<BigScreenActivityLine> bigScreenActivityLines=this.getPastMonth();
        bigScreenActivityLines.forEach(bigScreenActivityLine -> {
           BigScreenActivityLine bigScreenActivityLine1=comPbMemberDAO.selectActivityCountMonth(communityId,bigScreenActivityLine.getX());
           BigScreenActivityLine bigScreenActivityLine1=comPbMemberDAO.selectActivityCountMonth(communityId,bigScreenActivityLine.getX(),bigScreenActivityLine.getYear());
           bigScreenActivityLine.setY(bigScreenActivityLine1.getY());
           bigScreenActivityLine.setCountY(bigScreenActivityLine1.getCountY());
        });
@@ -157,4 +159,17 @@
        return bigScreenActivityLines;
    }
    public List<BigScreenActivityLine> getPastMonth(){
        List<BigScreenActivityLine> bigScreenActivityLines=new ArrayList<>();
        for(int i=11;i>=0;i--){
            BigScreenActivityLine bigScreenActivityLine=new BigScreenActivityLine();
            String date=DateUtils.getDateFormatString(DateUtils.addMonth(new Date(),-i),"MM");
            String year=DateUtils.getDateFormatString(DateUtils.addMonth(new Date(),-i),"yyyy");
            bigScreenActivityLine.setX(date);
            bigScreenActivityLine.setYear(year);
            bigScreenActivityLines.add(bigScreenActivityLine);
        }
        return bigScreenActivityLines;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java
@@ -293,7 +293,7 @@
        bigScreenStaticsReserve.setGasPercent(BigDecimal.valueOf(bigScreenStaticsReserve.getGasCount()*100d/ bigScreenStaticsReserve.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP));
        List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonthList=this.getPoints();
        bigScreenStaticsReserveMonthList.forEach(bigScreenStaticsReserveMonth -> {
            BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX());
            BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX(), bigScreenStaticsReserveMonth.getYear());
            bigScreenStaticsReserveMonth.setCount(bigScreenStaticsReserveMonth1.getCount());
            bigScreenStaticsReserveMonth.setReserveCount(bigScreenStaticsReserveMonth1.getReserveCount());
            bigScreenStaticsReserveMonth.setFireCount(bigScreenStaticsReserveMonth1.getFireCount());
@@ -334,6 +334,7 @@
                    aDate=i+"";
                }
                BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth();
                bigScreenStaticsReserveMonth.setYear("2021");
                bigScreenStaticsReserveMonth.setX(aDate);
                bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth);
            }
@@ -352,6 +353,7 @@
                }
                BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth();
                bigScreenStaticsReserveMonth.setX(aDate);
                bigScreenStaticsReserveMonth.setYear(nowYear);
                bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth);
            }
        }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml
@@ -329,10 +329,10 @@
    </select>
    <select id="biggestScreenMonth" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserveMonth">
        select   (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' or t1.title like '%燃气%' or t1.title like '%防火%') and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at ) count,
                 (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%燃气%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) gasCount,
                 (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%防火%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) fireCount,
                 (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) homeCount,
                 (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) reserveCount
        select   (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' or t1.title like '%燃气%' or t1.title like '%防火%') and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at ) count,
                 (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%燃气%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) gasCount,
            (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%防火%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) fireCount,
            (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) homeCount,
            (select count(*)  from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT(  CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) reserveCount
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPbMemberMapper.xml
@@ -7,8 +7,8 @@
    </select>
    <select id="selectActivityCountMonth" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityLine">
        select  ( select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and release_time >= DATE_FORMAT(  CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) y,
            (select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) countY
        select  ( select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and release_time >= DATE_FORMAT(  CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and  DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) y,
            (select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) countY
    </select>
    <select id="selectActivityTop" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityTop">