Browse Source

加上网格限制

master
zxc 4 years ago
parent
commit
af133e2168
  1. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  2. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  3. 21
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  4. 3
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -195,4 +195,6 @@ public interface ProjectConstant {
String SORT_ASC = "asc";
String SORT_DESC = "desc";
String ORG_TYPE_GRID = "grid";
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java

@ -219,12 +219,14 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<ProjectEntity> selectByOriginId(String originId);
/**
* @Description 根据日期查询项目分类
* @Description 根据日期查询项目分类
* @param date
* @param orgId
* @param codeLength 1级分类编码长度
* @param originGrid 是否来源网格
* @author zxc
* @date 2021/12/7 2:43 下午
* @date 2021/12/8 1:37 下午
*/
List<ProjectCategoryByDateDTO> selectProjectCategoryByDate(@Param("date")String date,@Param("orgId")String orgId,@Param("codeLength")Integer codeLength);
List<ProjectCategoryByDateDTO> selectProjectCategoryByDate(@Param("date")String date,@Param("orgId")String orgId,@Param("codeLength")Integer codeLength,@Param("originGrid")Boolean originGrid);
}

21
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -2812,7 +2812,12 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
if (!listResult.success()){
throw new EpmetException("查询1级分类列表失败...");
}
List<ProjectCategoryByDateDTO> projectCategoryByDateDTOS = baseDao.selectProjectCategoryByDate(formDTO.getDate(), staffInfo.getAgencyId(), listResult.getData().get(NumConstant.ZERO).getCodeLength());
List<ProjectCategoryByDateDTO> projectCategoryByDateDTOS = new ArrayList<>();
if (formDTO.getOrgType().equals(ProjectConstant.ORG_TYPE_GRID)){
projectCategoryByDateDTOS = baseDao.selectProjectCategoryByDate(formDTO.getDate(), staffInfo.getAgencyId(), listResult.getData().get(NumConstant.ZERO).getCodeLength(),true);
}else {
projectCategoryByDateDTOS = baseDao.selectProjectCategoryByDate(formDTO.getDate(), staffInfo.getAgencyId(), listResult.getData().get(NumConstant.ZERO).getCodeLength(),false);
}
if (CollectionUtils.isEmpty(projectCategoryByDateDTOS)){
return new ArrayList<>();
}
@ -2821,6 +2826,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
/**
* @Description 社区治理项目分布分析-右边
* 因项目数是随时间和组织变化很难设定一个固定的数值段因此根据分段规则将数据分成三段
* 分段规则
* 组织内所有网格项目数网格内最低项目数向下十位取整数网格内最高项目数向上取整数获得取值范围
*
* 根据
* 最小取值+最大取值-最小取值/3
* 最小取值+最大取值-最小取值*2/3
* 获得两个数值用两个数值确定三个取值范围
*
* 代码公式
* 左区间=(最少项目个数/10)*10
* 右区间=(最多项目个数/10+1)*10
* 比如阜新路街道内共10个网格最低项目数的是124个项目十位向下取整数最高项目数的是241个项目十位向上取整数那就取值120~250区间120到250分成3段数值一120+250-120/3163.3 , 数值二120+250-120*2/3206.6 ,
* 所以热力图三个数值应该是160以下十位向下取整数160-210十位向上取整数210以上
* @param formDTO
* @param tokenDto
* @author zxc

3
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -409,6 +409,9 @@
WHERE p.DEL_FLAG = 0
AND p.ORG_ID_PATH LIKE CONCAT('%',#{orgId})
AND DATE_FORMAT(p.CREATED_TIME,'%Y-%m-%d') = #{date}
<if test="originGrid == true">
p.ORIGIN = 'issue'
</if>
ORDER BY projectId
</select>
</mapper>
Loading…
Cancel
Save