springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/screen/ComActEasyPhotoScreenVO.java
@@ -34,7 +34,7 @@ private Integer pubPoint; @ApiModelProperty("平均耗时") private Integer dealTime; private String dealTime; @ApiModelProperty("线形图统计时间段") private String listTimes; springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -260,7 +260,7 @@ "(" + "(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 status = 4 ) AS dealTime " + "(SELECT AVG(TIMESTAMPDIFF(MINUTE,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); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -152,8 +152,8 @@ List<PieElementVO> countAllNoneCompletedWorkByCommunityId(@Param("communityId")Long communityId); @Select(" SELECT AVG(b.t)AS avgTime " + " FROM (SELECT TIMESTAMPDIFF(HOUR,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + " UNION ALL SELECT TIMESTAMPDIFF(HOUR,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + " )AS b ") Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
@@ -211,7 +211,7 @@ 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 : Double.valueOf(countMap.get("pubPoint").toString()).intValue()); comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? 0 : Double.valueOf(countMap.get("dealTime").toString()).intValue()); comActEasyPhotoScreenVO.setDealTime(countMap.get("dealTime") == null ? "0h" : convertTimeStr(Double.valueOf(countMap.get("dealTime").toString()).intValue())); List<EastPhotoVO> list = new ArrayList<>(); //统计半年数据 int n = 6; @@ -227,7 +227,18 @@ return R.ok(comActEasyPhotoScreenVO); } private String convertTimeStr(int minute) { int hour = minute/60; int min = minute%60; StringBuilder timestr = new StringBuilder(); if(hour > 0){ timestr.append(hour).append("h"); } if(min > 0){ timestr.append(min).append("min"); } return timestr.toString(); } @Override @@ -243,7 +254,8 @@ //统计平均耗时、平均每天完成个数 Map<String,Object> avgMap = comActNeighborCircleDAO.countAvgByCommunityId(communityId); comActWorkScreenVO.setAvgTime(avgMap.get("avgTime")==null?"0":Double.valueOf(avgMap.get("avgTime").toString()).intValue()+""); comActWorkScreenVO.setAvgTime(avgMap.get("avgTime") == null?"0h":convertTimeStr(Double.valueOf(avgMap.get("avgTime").toString()).intValue())); ComActDO comActDO = comActDAO.selectById(communityId); BigDecimal days = new BigDecimal(DateUtil.betweenDay(comActDO.getCreateAt(),new Date(),false)); BigDecimal num = new BigDecimal(comActWorkScreenVO.getTotalCompleted());