springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -173,13 +173,13 @@ String relation = dictMap.get(ra); if(StringUtils.isEmpty(relation)){ vo.setRelationStr(ra); // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); // importErrorVO.setErrorPosition("第" + index + "行,第6列"); // importErrorVO.setErrorMsg("您填写的与户主关系有误"); // populationImportErrorVOList.add(importErrorVO); // index++; // continue; // vo.setRelationStr(ra); ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); importErrorVO.setErrorPosition("第" + index + "行,第6列"); importErrorVO.setErrorMsg("您填写的与户主关系有误"); populationImportErrorVOList.add(importErrorVO); index++; continue; }else{ vo.setRelation(Integer.valueOf(relation)); } @@ -286,13 +286,13 @@ String ma = convertMarriage(oneData.get(19)); Integer isOk = PopulMarriageEnum.getCodeByName(ma); if(isOk.equals(-1)){ vo.setMarriageStr(ma); // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); // importErrorVO.setErrorPosition("第" + index + "行,第20列"); // importErrorVO.setErrorMsg("您填写的婚姻状况有误"); // populationImportErrorVOList.add(importErrorVO); // index++; // continue; // vo.setMarriageStr(ma); ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); importErrorVO.setErrorPosition("第" + index + "行,第20列"); importErrorVO.setErrorMsg("您填写的婚姻状况有误"); populationImportErrorVOList.add(importErrorVO); index++; continue; }else{ vo.setMarriage(isOk); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java
@@ -18,13 +18,13 @@ @ApiModelProperty("本月新增") private Long currentNum; @ApiModelProperty("已处理随手拍") @ApiModelProperty("已处理") private List<EastPhotoTypeVO> deal; @ApiModelProperty("已公示随手拍") @ApiModelProperty("已公示") private List<EastPhotoTypeVO> pub; @ApiModelProperty("已审核随手拍") @ApiModelProperty("已驳回") private List<EastPhotoTypeVO> approved; @ApiModelProperty("未处理") @@ -36,6 +36,8 @@ @ApiModelProperty("平均耗时") private Integer dealTime; @ApiModelProperty("线形图统计时间段") private String listTimes; @ApiModelProperty("随手拍线形列表") private List<EastPhotoVO> list; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -697,6 +697,15 @@ return instance.get(Calendar.MONTH); } public static boolean before(Date start, Date end){ Calendar date1 = Calendar.getInstance(); date1.setTime(start); Calendar date2 = Calendar.getInstance(); date2.setTime(end); return date1.before(date2); } public static void main(String[]args)throws Exception{ springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java
@@ -97,6 +97,26 @@ return R.ok(); } @ApiOperation(value = "excel导入实有人口notoken") @PostMapping(value = "/serve/import/noToken", consumes = "multipart/*", headers = "content-type=multipart/form-date") public R downloadPopulationTemplateno(@RequestParam MultipartFile file, HttpServletRequest request) { //获取文件名 String fileName = file.getOriginalFilename(); log.info("传入文件名字【{}】", fileName); InputStream inputStream = null; try { Long communityId = Long.valueOf(request.getParameter("communityId")); inputStream = file.getInputStream(); ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, communityId); EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); } catch (IOException e) { log.error("导入模板失败【{}】", e.getMessage()); e.printStackTrace(); } return R.ok(); } @ApiOperation(value = "编辑实有人口") @PostMapping(value = "/edit") public R editPopulationInfo(@RequestBody ComMngPopulationEditDTO populationEditDTO){ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ScreenWorkApi.java
@@ -21,7 +21,10 @@ private ScreenWorkService screenWorkService; /** * * 大屏统计邻里圈 * 状态-显示(2) * 本月新增-显示(2) * @param communityId * @return */ @@ -31,7 +34,10 @@ } /** * 大屏统计心愿单 * 大屏统计心愿单, * 累计实现-已完成(6) * 等待实现-非已完成(1、2、3、4、5) * 本月新增-所有状态(1、2、3、4、5、6) * @param communityId * @return */ @@ -42,6 +48,10 @@ /** * 大屏统计社区活动 * 状态:报名中(3)、进行中(4)、已结束(5) * 本月新增:报名中(3)、进行中(4)、已结束(5) * 志愿者活动-参与者人数上限为0 * 居民活动-参与者人数上限>0 * @param communityId * @return */ @@ -52,6 +62,7 @@ /** * 大屏统计一起议 * 参与人数-点赞、评论、评论点赞 * @param communityId * @return */ @@ -62,6 +73,8 @@ /** * 大屏统计党建工作 * 党员活动:报名中(3)、进行中(4)、已结束(5) * 党员宣传(党员动态): * @param communityId * @return */ @@ -72,6 +85,16 @@ /** * 大屏统计随手拍 * 新增的-所有状态 * 已处理-3已驳回 4已完成 * 已公示-4已完成 * 未公示-3已驳回 * 未处理-1待审核 * 公示比例-已公示/(已公示+已驳回) * 平均耗时-创建时间至反馈时间(已完成状态) * 线形图-随手拍数量-累计 * 线形图-新增随手拍-时间段新增 * 线形图-处理随手拍-时间段(已驳回和已完成) * @param communityId * @return */ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -259,19 +259,18 @@ "\t\tAND a.community_id =#{communityId}") CommunityActivitiesVO selectCommunityActivitiesVO(@Param("communityId") Long communityId, @Param("date")Date date); @Select("SELECT COUNT(id) AS totalNum," + "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%'))AS currentNum," + "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND volunteer_max = 0)AS commonNum," + "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.volunteer_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + @Select("SELECT COUNT(id) AS currentNum," + "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max > 0)AS commonNum," + "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.participant_max > 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND a.community_id=#{communityId})AS commonPeopleNum," + "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max = 0)AS volunteerNum," + "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.community_id=#{communityId} AND a.participant_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5))AS volunteerPeopleNum" + " FROM com_act_activity where community_id=#{communityId} AND (status = 3 OR status = 4 OR status = 5)") " FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%') ") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate); @Select("SELECT id,activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName FROM com_act_activity " + @Select("SELECT id,activity_name as content,IF(participant_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}") @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId} and AND (status = 3 OR status = 4 OR status = 5)") List<String> listImg(@Param("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -190,9 +190,8 @@ "GROUP BY d.id") ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId")Long loginUserId); @Select(" SELECT COUNT(id) AS totalNum," + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%'))AS currentNum," + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND TYPE = 1)AS imgNum," + @Select(" SELECT COUNT(id) AS currentNum," + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND type = 1)AS imgNum," + "(" + "SELECT COUNT(DISTINCT(user_id)) FROM (" + " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + @@ -203,7 +202,8 @@ " UNION ALL " + " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 1 " + ")d " + ")AS commonPeopleNum," + ")AS imgPeopleNum," + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = 2 AND type = 2)AS voteNum," + "(" + "SELECT COUNT(DISTINCT(user_id)) FROM (" + " SELECT c.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_comment c ON d.id = c.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + @@ -214,8 +214,8 @@ " UNION ALL " + " SELECT u.user_id FROM com_act_discuss d INNER JOIN com_act_discuss_user u ON d.id = u.discuss_id WHERE d.community_id = 2 AND d.type = 2 " + ")d " + ")AS volunteerPeopleNum " + " FROM com_act_discuss") ")AS votePeopleNum " + " FROM com_act_discuss WHERE community_id = 2 AND create_at LIKE CONCAT('','%')") Map<String, Long> countByCommunityId(@Param("communityId")Long communityId, @Param("date")String date); @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}") springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -242,17 +242,17 @@ IPage<ComActEasyPhotoVO> pageEasyPhotoApplets(Page page, @Param("comActEasyPhotoVO")ComActEasyPhotoVO comActEasyPhotoVO); @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} " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.community_id = #{communityId} AND p.status = 1 " + "GROUP BY t.name ") List<EastPhotoTypeVO> countDeal(@Param("communityId")Long 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.is_publicity = 1 AND p.community_id = #{communityId} " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id AND p.community_id = #{communityId} AND p.status = 4 " + "GROUP BY t.name ") List<EastPhotoTypeVO> countPub(@Param("communityId")Long 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 and p.community_id = #{communityId} " + "LEFT JOIN com_act_easy_photo p ON r.easy_id = p.id and p.community_id = #{communityId} AND p.status = 3 " + "GROUP BY t.name ") List<EastPhotoTypeVO> countApproved(@Param("communityId")Long communityId); @@ -261,15 +261,15 @@ "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) " + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} AND status = 4 )*100/(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id = #{communityId} and (status = 3 or status = 4)) " + ") 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 where community_id = #{communityId}") "(SELECT AVG(TIMESTAMPDIFF(HOUR,create_at,feedback_at)) FROM com_act_easy_photo WHERE community_id = #{communityId} and status = 4 ) AS dealTime " + "FROM com_act_easy_photo where community_id = #{communityId} and status = 1 ") 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, " + "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND handle_status = 2 AND #{start} < create_at and create_at < #{end}) AS deal " + "FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ") "(SELECT COUNT(id) FROM com_act_easy_photo WHERE community_id =#{communityId} AND (status = 3 or status = 4) AND #{start} < create_at and create_at < #{end}) AS deal " + "FROM com_act_easy_photo WHERE community_id = #{communityId} AND create_at < #{end} ") EastPhotoVO countByTime(@Param("start")String start, @Param("end")String end, @Param("nowDate")String nowDate, @Param("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
@@ -163,8 +163,8 @@ int updateStatusAutoConfirm(); @Select("SELECT COUNT(id) AS completedNum," + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 4 OR status = 5)) AS willNum ," + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + "FROM com_act_micro_wish WHERE community_id = #{communityId} AND status = 6 ") Map<String, Long> countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate") String nowDate); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -110,18 +110,18 @@ " where reply.comment_id = #{commentId} and reply.status = 1") IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and(status = 2 or status = 3) ORDER BY create_at DESC limit #{pageSize}") @Select("SELECT id,release_content as content FROM com_act_neighbor_circle WHERE community_id =#{communityId} and status = 2 ORDER BY create_at DESC limit #{pageSize}") List<CarouselInfoVO> screenNeighborCircle(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); @Select(" SELECT COUNT(id) AS totalNum," + " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND (status = 2 OR status = 3) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND(status = 2 OR status =3)") " (SELECT COUNT(id) FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2 AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + " FROM com_act_neighbor_circle WHERE community_id = #{communityId} AND status = 2") 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) ") @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 ") Map<String, Object> sumScreenNum(@Param("communityId")Long communityId); @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}") @Select("SELECT release_images FROM com_act_neighbor_circle WHERE community_id = #{communityId} and status = 2 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/service/impl/ScreenWorkServiceImpl.java
@@ -43,7 +43,14 @@ @Resource private ComActEasyPhotoDAO comActEasyPhotoDAO; /** * 项目开始时间,超过的不统计 */ private final String initMonth = "2020-12"; private final String moth_format_str = "yyyy-MM"; private final String moth_format_ch = "yyyy年MM月"; private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"}; @@ -108,12 +115,12 @@ //统计本月新增、居民活动,志愿者活动 String date = DateUtils.getDateFormatString(new Date(),moth_format_str); Map<String,Long> countMap = actActivityDAO.countByCommunityId(communityId,date); comActActivityScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); comActActivityScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); comActActivityScreenVO.setCommonNum(countMap.get("commonNum") == null ? 0L : countMap.get("commonNum")); comActActivityScreenVO.setCommonPeopleNum(countMap.get("commonPeopleNum") == null ? 0L : countMap.get("commonPeopleNum")); comActActivityScreenVO.setVolunteerNum(countMap.get("volunteerNum") == null ? 0L : countMap.get("volunteerNum")); comActActivityScreenVO.setVolunteerPeopleNum(countMap.get("volunteerPeopleNum") == null ? 0L : countMap.get("volunteerPeopleNum")); comActActivityScreenVO.setTotalNum(comActActivityScreenVO.getCommonNum()+comActActivityScreenVO.getVolunteerNum()); //最近活动 comActActivityScreenVO.setList(actActivityDAO.screenActivity(communityId,pageSize)); return R.ok(comActActivityScreenVO); @@ -126,11 +133,11 @@ String date = DateUtils.getDateFormatString(new Date(),moth_format_str); Map<String,Long> countMap = comActDiscussDAO.countByCommunityId(communityId,date); discussScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); discussScreenVO.setTotalNum(countMap.get("totalNum") == null ? 0L : countMap.get("totalNum")); discussScreenVO.setImgNum(countMap.get("imgNum") == null ? 0L : countMap.get("imgNum")); discussScreenVO.setImgPeopleNum(countMap.get("imgPeopleNum") == null ? 0L : countMap.get("imgPeopleNum")); discussScreenVO.setVoteNum(discussScreenVO.getTotalNum() - discussScreenVO.getImgNum()); discussScreenVO.setVoteNum(countMap.get("voteNum") == null ? 0L : countMap.get("voteNum")); discussScreenVO.setVotePeopleNum(countMap.get("votePeopleNum") == null ? 0L : countMap.get("votePeopleNum")); discussScreenVO.setTotalNum(discussScreenVO.getImgNum()+discussScreenVO.getVoteNum()); discussScreenVO.setList(comActDiscussDAO.screenDiscuss(communityId,pageSize)); return R.ok(discussScreenVO); } @@ -145,10 +152,11 @@ pbWorkScreenVO.setTotalNum(pbWorkScreenVO.getActivityNum() + pbWorkScreenVO.getDynNum()); pbWorkScreenVO.setCurrentNum(countMap.get("currentNum") == null ? 0L : countMap.get("currentNum")); //统计近半年数据 int n = 6; List<PbWorkVO> list = new ArrayList<>(); for(PbWorkVO workVO: listHalfYear()){ PbWorkVO result = comPbDynDAO.countByTime(workVO.getStart(),workVO.getEnd(),communityId); result.setMonth(workVO.getMonth()); for(Map<String,String> map : listHalfYear(n)){ PbWorkVO result = comPbDynDAO.countByTime(map.get("start"),map.get("end"),communityId); result.setMonth(map.get("name")); list.add(result); } pbWorkScreenVO.setList(list); @@ -156,10 +164,10 @@ } private List<PbWorkVO> listHalfYear() { List<PbWorkVO> dateList = new ArrayList<>(); private List<Map<String,String>> listHalfYear(int num) { List<Map<String,String>> dateList = new ArrayList<>(); Date now = new Date(); for(int i= 6;i>=1;i--){ for(int i= num;i>=1;i--){ Date date = DateUtils.getDateM(now,-i); DateTime endDay = DateUtil.endOfMonth(date); @@ -167,16 +175,19 @@ int day = DateUtil.dayOfMonth(endDay); int half = day/2; String month = DateUtil.format(date,moth_format_str); PbWorkVO pbWorkVO = new PbWorkVO(); 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(monthStr[m]+"月下旬"); pbWorkVO2.setStart(month+ "-"+half+" 23:59:58"); pbWorkVO2.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); dateList.add(pbWorkVO2); if(Objects.equals(month,initMonth)){ continue; } Map<String,String> startMap = new HashMap<>(); startMap.put("name",monthStr[m]+"月上旬"); startMap.put("start",month+ "-01 00:00:00"); startMap.put("end",month+ "-"+half+" 23:59:58"); dateList.add(startMap); Map<String,String> endMap = new HashMap<>(); endMap.put("name",monthStr[m]+"月下旬"); endMap.put("start",month+ "-"+half+" 23:59:58"); endMap.put("end",DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); dateList.add(endMap); } return dateList; @@ -195,36 +206,36 @@ 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); EastPhotoVO result = comActEasyPhotoDAO.countByTime(workVO.getStart(),workVO.getEnd(),nowDate,communityId); result.setMonth(workVO.getMonth()); //统计半年数据 int n = 6; for(Map<String,String> map : listHalfYear(n)){ String nowDate = DateUtils.getDateFormatString(DateUtil.parseDate(map.get("start")),moth_format_str); EastPhotoVO result = comActEasyPhotoDAO.countByTime(map.get("start"),map.get("end"),nowDate,communityId); result.setMonth(map.get("name")); 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)){ start = initTime; } comActEasyPhotoScreenVO.setListTimes(DateUtil.format(start,moth_format_ch)+"-"+DateUtil.format(DateUtils.getDateM(new Date(),-1),moth_format_ch)); return R.ok(comActEasyPhotoScreenVO); } private List<EasyPhotoPointVO> getList(Map<String, Long> dealMap) { Set<Map.Entry<String,Long>> entrySet = dealMap.entrySet(); List<EasyPhotoPointVO> list = new ArrayList<>(); for(Map.Entry<String,Long> en:entrySet){ EasyPhotoPointVO easyPhotoPointVO = new EasyPhotoPointVO(); easyPhotoPointVO.setTypeName(en.getKey()); easyPhotoPointVO.setPoint(en.getValue().intValue()); list.add(easyPhotoPointVO); } return list; } @Override public R workCount(Long communityId) { ComActWorkScreenVO comActWorkScreenVO = new ComActWorkScreenVO(); //已完成 // Map<String,Long> countMap = comActNeighborCircleDAO.countAllWorkBy(communityId); comActWorkScreenVO.setAvgTime("1小时"); comActWorkScreenVO.setTotalCompletedPoint(70); comActWorkScreenVO.setEveryDayNum("0.3");