Browse Source

社区办结项目数,社区项目响应度,社区办结项目率

master
wangchao 5 years ago
parent
commit
207af6eeda
  1. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java
  2. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java
  3. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  5. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java
  8. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java
  9. 93
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
  10. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java
  11. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java
  12. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java
  13. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  14. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java
  15. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  16. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  17. 50
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  18. 64
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  19. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 各机关响应时间
* @ClassName OrgResponseTimeResultDTO
* @Auth wangc
* @Date 2020-09-21 02:03
*/
@Data
public class OrgResponseTimeResultDTO implements Serializable {
private static final long serialVersionUID = 6017440139236985959L;
private String agencyId;
private BigDecimal responseTime;
private BigDecimal projectTotal;
private BigDecimal distinctProjectTotal;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 参与过项目的agencyDTO
* @ClassName ProjectParticipatedAgencyResultDTO
* @Auth wangc
* @Date 2020-09-20 23:40
*/
@Data
public class ProjectParticipatedAgencyResultDTO implements Serializable {
private static final long serialVersionUID = 1071619125612033138L;
private String projectId;
private String agencyId;
private String level;
private int score;
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -27,6 +27,7 @@ import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService;
@ -39,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@ -83,6 +85,8 @@ public class DemoController {
private DimCustomerDao dimCustomerDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -553,4 +557,19 @@ public class DemoController {
String monthId = "202008";
calGridIndexService.calGridIndexGovernAbility(customerId,monthId);
}
@PostMapping("handlemap")
public Result<Map<String,Integer>> handleMap(){
return new Result<Map<String,Integer>>().ok(
factOriginProjectLogDailyService.getProjectHandledAgency("3ef7e4bb195eb9e622d68b52509aa940","202006","month"));
}
@PostMapping("responseration")
public Result<Map<String,BigDecimal>> responseRatio(){
return new Result<Map<String,BigDecimal>>().ok(
factOriginProjectLogDailyService.getAgencyResponseRatio("3ef7e4bb195eb9e622d68b52509aa940","202006","month")
);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -76,12 +76,12 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
/**
* @Description 按照组Id清除组和组员数据
* @param list
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 12:16
**/
void deleteBatchByGroupId(@Param("list") List<String> list);
void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List<String> list);
/**
* @Description 更新群主的党员信息
@ -90,7 +90,7 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* @author wangc
* @date 2020.09.20 12:44
**/
int updatePartyFlag(@Param("list") List<String> list);
int updatePartyFlag(@Param("list") List<String> list,@Param("customerId")String customerId);
/**
* @Description 更新群主的热心居民信息
@ -99,7 +99,7 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* @author wangc
* @date 2020.09.20 12:44
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list);
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list,@Param("customerId")String customerId);
/**
* @Description 批量插入组主表

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -18,10 +18,7 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.AutoNoMyResultDTO;
import com.epmet.dto.extract.result.NotReturnProjectResultDTO;
import com.epmet.dto.extract.result.ProjectEvaluateResultDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -96,4 +93,14 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
*/
List<OrgStatisticsResultDTO> selectSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* @Description 查询各项目经受了多少机关
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
List<ProjectParticipatedAgencyResultDTO> selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId,
@Param("dateType")String dateType);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -18,10 +18,12 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgResponseTimeResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -76,4 +78,22 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @date 2020.09.18 17:11
**/
void insertBatch(@Param("list") List<FactOriginProjectOrgPeriodDailyEntity> list);
/**
* @Description 查找网格部门对项目的响应系数
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* @Description 查找机关对项目的响应系数
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java

@ -78,5 +78,5 @@ public interface DimGridDao extends BaseDao<DimGridEntity> {
* @author wangc
* @date 2020.09.20 13:01
**/
List<GridAttributesResultDTO> selectGridAttributes(@Param("gridIds") List<String> gridIds);
List<GridAttributesResultDTO> selectGridAttributes(@Param("customerId") String customerId,@Param("gridIds") List<String> gridIds);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java

@ -26,6 +26,7 @@ import com.epmet.dto.extract.result.NotReturnProjectResultDTO;
import com.epmet.dto.extract.result.ProjectEvaluateResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -155,4 +156,23 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSatisfaction(String customerId, String monthId, String level);
/**
* @Description 查询各机关办结了多少项目
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
Map<String,Integer> getProjectHandledAgency(String customerId, String dimId,String dateType);
/**
* @Description 计算机关响应度
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
Map<String, BigDecimal> getAgencyResponseRatio(String customerId, String dimId,String dateType);
}

93
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java

@ -21,23 +21,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.AutoNoMyResultDTO;
import com.epmet.dto.extract.result.NotReturnProjectResultDTO;
import com.epmet.dto.extract.result.ProjectEvaluateResultDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* 项目明细_日统计
@ -48,6 +50,8 @@ import java.util.Map;
@Service
public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOriginProjectLogDailyDao, FactOriginProjectLogDailyEntity> implements FactOriginProjectLogDailyService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao projectOrgPeriodDailyDao;
@Override
public PageData<FactOriginProjectLogDailyDTO> page(Map<String, Object> params) {
@ -152,4 +156,79 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectSatisfaction(customerId, monthId, level);
}
/**
* @Description 查询各项目经受了多少机关
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 23:46
**/
@Override
public Map<String, Integer> getProjectHandledAgency(String customerId, String dimId, String dateType) {
Map<String, Integer> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgency = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType);
if(!CollectionUtils.isEmpty(projectAgency)){
Map<String,List<ProjectParticipatedAgencyResultDTO>> map
= projectAgency.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId));
map.forEach((key ,agencies) ->{
if(!CollectionUtils.isEmpty(agencies)) {
String highest = agencies.get(NumConstant.ZERO).getLevel();
for (int i = NumConstant.ZERO; i < agencies.size(); i++) {
if(StringUtils.equals(agencies.get(i).getLevel(),highest)){
if(null != result.get(agencies.get(i).getAgencyId())){
result.put(key,result.get(agencies.get(i).getAgencyId()) + NumConstant.ONE);
}else{
result.put(key,NumConstant.ONE);
}
}else break;
}
}
});
}
return result;
}
/**
* @Description 计算机关响应度
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
@Override
public Map<String, BigDecimal> getAgencyResponseRatio(String customerId, String dimId, String dateType) {
List<OrgResponseTimeResultDTO> gridDeptResponse = projectOrgPeriodDailyDao.selectSubOrgResponseCoefficient(customerId, dimId, dateType);
List<OrgResponseTimeResultDTO> agencyResponse = projectOrgPeriodDailyDao.selectAgencyResponseCoefficient(customerId, dimId, dateType);
Map<String,BigDecimal> consumingMap = new HashMap<>();
Map<String,BigDecimal> timeMap = new HashMap<>();
if(!CollectionUtils.isEmpty(agencyResponse)){
agencyResponse.forEach(response -> {
consumingMap.put(response.getAgencyId(),response.getResponseTime());
//注意,这里取的是去重后的项目次数,例如一个部门被项目流转了多次,项目数只算一次
//如果需要改成不去重,只需response.getProjectTotal()
timeMap.put(response.getAgencyId(),response.getDistinctProjectTotal());
});
}
if(!CollectionUtils.isEmpty(gridDeptResponse)){
gridDeptResponse.forEach(response -> {
if(null != consumingMap.get(response.getAgencyId())){
consumingMap.put(response.getAgencyId(),consumingMap.get(response.getAgencyId()).add(response.getResponseTime()));
timeMap.put(response.getAgencyId(),timeMap.get(response.getAgencyId()).add(response.getDistinctProjectTotal()));
}else{
consumingMap.put(response.getAgencyId(),response.getResponseTime());
timeMap.put(response.getAgencyId(),response.getDistinctProjectTotal());
}
});
}
Map<String,BigDecimal> ratioMap = new HashMap<>();
if(!CollectionUtils.isEmpty(consumingMap)) {
consumingMap.keySet().forEach(agencyId -> {
ratioMap.put(agencyId, consumingMap.get(agencyId).divide(timeMap.get(agencyId), NumConstant.SIX, RoundingMode.HALF_UP));
});
}
return ratioMap;
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java

@ -90,7 +90,7 @@ public class GroupExtractServiceImpl implements GroupExtractService {
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
if (!CollectionUtils.isEmpty(originGroupData)) {
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(gridList)) {
Map<String, GridAttributesResultDTO> gridMap =
@ -130,12 +130,11 @@ public class GroupExtractServiceImpl implements GroupExtractService {
if (count <= NumConstant.ZERO) {
//isFirst
factOriginGroupMainDailyDao.deleteBatchByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.deleteBatchMemberByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.insertBatchMain(originGroupData);
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
} else {
factOriginGroupMainDailyDao.deleteBatchByGroupId(originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
factOriginGroupMainDailyDao.deleteBatchByGroupId(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
}
@ -145,8 +144,8 @@ public class GroupExtractServiceImpl implements GroupExtractService {
List<String> partyIds = userService.getPartymembersByCustomerId(param.getCustomerId());
List<GridHeartedFormDTO> heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.updatePartyFlag(partyIds);
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds);
factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId());
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId());
}
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java

@ -344,4 +344,6 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
return result;
}
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java

@ -15,6 +15,7 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthl
import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.util.DimIdGenerator;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -23,6 +24,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -63,9 +65,12 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.STREET);
entity.setTransferedCount(NumConstant.ZERO);
//办结项目数
entity.setClosedProjectCount(NumConstant.ZERO);
//项目响应度
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO));
//办结项目率
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
@ -105,6 +110,20 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
}
}));
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = entity.getClosedProjectRatio();
//办结率
entity.setClosedProjectRatio(
element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP)
);
//响应度
entity.setRespProjectRatio(responseMap.get(entity.getAgencyId()));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -181,4 +181,6 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
element.setPeriodTillReplyFirstly(ifResponsed ? staffResponseTraceUnit.get(index).getCreatedTime() :element.getHandledDate());
}
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java

@ -147,5 +147,5 @@ public interface DimGridService extends BaseService<DimGridEntity> {
* @author wangc
* @date 2020.09.20 13:01
**/
List<GridAttributesResultDTO> getGridAttributes(List<String> gridIds);
List<GridAttributesResultDTO> getGridAttributes(String customerId,List<String> gridIds);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -185,8 +185,8 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
* @date 2020.09.20 13:01
**/
@Override
public List<GridAttributesResultDTO> getGridAttributes(List<String> gridIds) {
public List<GridAttributesResultDTO> getGridAttributes(String customerId,List<String> gridIds) {
if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST;
return baseDao.selectGridAttributes(gridIds);
return baseDao.selectGridAttributes(customerId,gridIds);
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -48,7 +48,8 @@
DELETE FROM
fact_origin_group_main_daily
<where>
<foreach collection="list" item="groupId" separator=" OR " close=" ;">
CUSTOMER_ID = #{customerId}
<foreach collection="list" item="groupId" open="AND (" separator=" OR " close=" )" >
ID = #{groupId}
</foreach>
</where>
@ -59,6 +60,7 @@
SET IS_OWNER_PARTY = 1
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="ownerId" open="( " separator=" OR " close=" ) ">
GROUP_OWNER_ID = #{ownerId}
@ -71,6 +73,7 @@
SET IS_OWNER_HEARTED = 1
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="item" open="( " separator=" OR " close=" ) ">
(GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId})

50
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -116,4 +116,54 @@
GROUP BY AGENCY_ID
</select>
<select id="selectProjectParticipatedAgency" resultType="com.epmet.dto.extract.result.ProjectParticipatedAgencyResultDTO">
SELECT
DISTINCT
project.ID AS projectId,
log.AGENCY_ID,
agency.LEVEL,
CASE agency.LEVEL WHEN 'community' THEN 1 WHEN 'street' THEN 2 WHEN 'district' THEN 3
WHEN 'city' THEN 4 WHEN 'province' THEN 5 END AS score
FROM
fact_origin_project_main_daily project
LEFT JOIN
fact_origin_project_log_daily log
ON log.PROJECT_ID = project.ID AND log.DEL_FLAG = '0'
LEFT JOIN
dim_object_status dimStatus
ON project.PROJECT_STATUS = dimStatus.STATUS_CODE AND dimStatus.DEL_FLAG = '0' AND dimStatus.STATUS_TYPE = 'project'
LEFT JOIN
dim_object_action dimAction
ON log.ACTION_CODE = dimAction.ACTION_CODE AND dimAction.DEL_FLAG = '0' AND dimAction.ACTION_TYPE = 'project'
LEFT JOIN
dim_agency agency
ON log.AGENCY_ID = agency.ID AND agency.DEL_FLAG = '0' AND agency.CUSTOMER_ID = #{customerId}
WHERE
project.DEL_FLAG = '0'
AND
dimStatus.STATUS_CODE = 'closed'
AND
dimAction.ACTION_CODE != 'return'
AND
project.CUSTOMER_ID = #{customerId}
<if test='null != dimId and "" != dimId'>
<choose>
<when test='"month" == dateType'>
AND log.MONTH_ID = #{dimId}
</when>
<otherwise>
AND log.DATE_ID = #{dimId}
</otherwise>
</choose>
</if>
ORDER BY project.ID,score DESC
</select>
</mapper>

64
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -115,4 +115,68 @@
)
</foreach>
</insert>
<!-- 查找网格、部门对项目的响应系数 -->
<select id="selectSubOrgResponseCoefficient" resultType="com.epmet.dto.extract.result.OrgResponseTimeResultDTO">
SELECT
PID AS agencyId,
SUM(timestampdiff(MINUTE , INFORMED_DATE ,IFNULL(PERIOD_TILL_REPLY_FIRSTLY,NOW()))) AS responseTime,
COUNT(ID) projectTotal,
COUNT(DISTINCT PROJECT_ID) distinctProjectTotal
FROM
fact_origin_project_org_period_daily
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
AND
(ORG_TYPE = 'grid' OR ORG_TYPE = 'dept')
AND
IS_RESOLVED = 'resolved'
<if test='null != dimId and "" != dimId'>
<choose>
<when test='"month" == dateType'>
AND DATE_FORMAT(IFNULL(PERIOD_TILL_REPLY_FIRSTLY,NOW()),'%Y%m') = #{dimId}
</when>
<otherwise>
AND DATE_FORMAT(IFNULL(PERIOD_TILL_REPLY_FIRSTLY,NOW()),'%Y%m%d') = #{dimId}
</otherwise>
</choose>
</if>
GROUP BY PID
</select>
<!-- 查找机关对项目的响应系数 -->
<select id="selectAgencyResponseCoefficient" resultType="com.epmet.dto.extract.result.OrgResponseTimeResultDTO">
SELECT
ORG_ID AS agencyId,
SUM(timestampdiff(MINUTE , INFORMED_DATE ,IFNULL(PERIOD_TILL_REPLY_FIRSTLY,NOW()))) AS responseTime,
COUNT(ID) projectTotal,
COUNT(PROJECT_ID) distinctProjectTotal
FROM
fact_origin_project_org_period_daily
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
AND
ORG_TYPE = 'agency'
AND
IS_RESOLVED = 'resolved'
<if test='null != dimId and "" != dimId'>
<choose>
<when test='"month" == dateType'>
AND DATE_FORMAT(IFNULL(PERIOD_TILL_REPLY_FIRSTLY,NOW()),'%Y%m') = #{dimId}
</when>
<otherwise>
AND DATE_FORMAT(IFNULL(PERIOD_TILL_REPLY_FIRSTLY,NOW()),'%Y%m%d') = #{dimId}
</otherwise>
</choose>
</if>
GROUP BY ORG_ID
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -101,6 +101,7 @@
WHERE
dg.DEL_FLAG = '0'
AND da.DEL_FLAG = '0'
AND da.CUSTOMER_ID = #{customerId}
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">

Loading…
Cancel
Save