springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java
@@ -19,22 +19,22 @@ private Long currentNum; @ApiModelProperty("已处理随手拍") private List<EasyPhotoPointVO> deal; private List<EastPhotoTypeVO> deal; @ApiModelProperty("已公示随手拍") private List<EasyPhotoPointVO> pub; private List<EastPhotoTypeVO> pub; @ApiModelProperty("已审核随手拍") private List<EasyPhotoPointVO> approved; private List<EastPhotoTypeVO> approved; @ApiModelProperty("未处理") private Long noneDeal; @ApiModelProperty("公示比例") private Long pubPoint; private Integer pubPoint; @ApiModelProperty("平均耗时") private Long dealTime; private Integer dealTime; @ApiModelProperty("随手拍线形列表") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/EastPhotoTypeVO.java
New file @@ -0,0 +1,23 @@ package com.panzhihua.common.model.vos.screen; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; /** * @author xyh * @date 2021/6/16 14:45 */ @Data @ApiModel("随手拍类型饼图") public class EastPhotoTypeVO implements Serializable { @ApiModelProperty("类型名称") private String name; @ApiModelProperty("数量") private Long num; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -619,10 +619,15 @@ public static Date getDateM(Date start, int min) { Calendar date1 = Calendar.getInstance(); date1.setTime(start); date1.add(12, min); date1.add(Calendar.MONTH, min); return date1.getTime(); } public static int getMonth(Date date){ Calendar instance = Calendar.getInstance(); instance.setTime(date); return instance.get(Calendar.MONTH); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenWorkApi.java
@@ -56,7 +56,7 @@ * @param communityId * @return */ @ApiOperation(value = "社区活动@xyh",response = ComActNeighborCircleScreenVO.class) @ApiOperation(value = "社区活动@xyh",response = ComActActivityScreenVO.class) @GetMapping("/activity") public R activity(@RequestParam("communityId") Long communityId){ @@ -104,7 +104,7 @@ * @param communityId * @return */ @ApiOperation(value = "工作情况@xyh",response = ComActEasyPhotoScreenVO.class) @ApiOperation(value = "工作情况@xyh",response = ComActWorkScreenVO.class) @GetMapping("/workCount") public R workCount(@RequestParam("communityId") Long communityId){ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java
@@ -85,6 +85,7 @@ * @param communityId * @return */ @GetMapping("/workCount") R workCount(@RequestParam("communityId")Long communityId){ return screenWorkService.workCount(communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -268,7 +268,10 @@ " FROM com_act_activity where community_id=#{communityId} AND (status = 3 OR status = 4 OR status = 5)") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); @Select("SELECT activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName FROM com_act_activity " + @Select("SELECT id,activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName FROM com_act_activity " + "WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) ORDER BY create_at DESC LIMIT #{pageSize}") List<CarouselInfoVO> screenActivity(@Param("communityId")Long communityId, @Param("pageSize")Integer pageSize); @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId}") List<String> listImg(@Param("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -218,6 +218,6 @@ " FROM com_act_discuss") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId, @Param("date")String date); @Select(" SELECT discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") @Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}") List<CarouselInfoVO> screenDiscuss(@Param("communityId") Long communityId, @Param("pageSize")Integer pageSize); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; import com.panzhihua.common.model.vos.community.TodoEventsVO; import com.panzhihua.common.model.vos.screen.EastPhotoTypeVO; import com.panzhihua.common.model.vos.screen.EastPhotoVO; import com.panzhihua.common.model.vos.screen.EasyPhotoDataVO; import com.panzhihua.common.model.vos.screen.PbWorkVO; @@ -240,28 +241,31 @@ ) IPage<ComActEasyPhotoVO> pageEasyPhotoApplets(Page page, @Param("comActEasyPhotoVO")ComActEasyPhotoVO comActEasyPhotoVO); @Select("SELECT t.name,COUNT(p.id) FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.handle_status = 1 AND p.community_id = #{communityId} " + "GROUP BY t.name ") Map<String, Long> countDeal(@Param("communityId")Long communityId); List<EastPhotoTypeVO> countDeal(@Param("communityId")Long communityId); @Select("SELECT t.name,COUNT(p.id) FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.is_publicity = 1 AND p.community_id = #{communityId} " + "GROUP BY t.name ") Map<String, Long> countPub(@Param("communityId")Long communityId); List<EastPhotoTypeVO> countPub(@Param("communityId")Long communityId); @Select("SELECT t.name,COUNT(p.id) FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.status = 4 AND p.community_id = #{communityId} " + @Select("SELECT t.name,COUNT(p.id) as num FROM com_act_easy_photo_type t LEFT JOIN com_act_easy_photo_type_relation r ON t.id = r.easy_type_id " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.status = 4 where p.community_id = #{communityId} " + "GROUP BY t.name ") Map<String, Long> countApproved(@Param("communityId")Long communityId); List<EastPhotoTypeVO> countApproved(@Param("communityId")Long communityId); @Select("SELECT COUNT(id) AS noneDeal," + "(" + "SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = 2 AND create_at LIKE concat(#{nowDate},'%') " + ") AS currentNum," + "(" + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND STATUS = 4 AND handle_status = 2)*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND handle_status = 2) " + ") AS pubPoint," + "(SELECT AVG(TIMESTAMPDIFF(HOUR,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and handle_status = 2 ) AS dealTime " + "FROM com_act_easy_photo and community_id = #{communityId}") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId); "FROM com_act_easy_photo where community_id = #{communityId}") Map<String, Object> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate") String nowDate); @Select("SELECT COUNT(id) AS total, " + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ) AS adds, " + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -118,10 +118,10 @@ " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND(status = 2 OR status =3)") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) group by community_id ") Map<String, Long> sumScreenNum(Long communityId); @Select("SELECT SUM(comment_num) as commentNum,SUM(fabulous_num) as fabulousNum,SUM(forward_num) as forwardNum FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) ") Map<String, Object> sumScreenNum(@Param("communityId")Long communityId); @Select("SELECT release_images FROM com_act_neighbor_circle_comment WHERE community_id = #{communityId} and (status = 2 OR status =3) order by create_at desc limit #{pageSize}") @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and (status = 2 OR status =3) order by create_at desc limit #{pageSize}") List<String> screenNeighborCircleImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComPbDynDAO.java
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);