Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev

dev_shibei_match
wxz 4 years ago
parent
commit
30553c4cde
  1. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml
  3. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  4. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  5. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  6. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  7. 21
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -100,13 +100,14 @@ public class EpmetUserController {
@RequirePermission(requirePermission = RequirePermissionEnum.MORE_PATROL_RECORD_LIST)
public Result<List<StaffListResultDTO>> staffPatrolList(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class);
if (!"patrolTotal".equals(formDTO.getSortCode()) && !"latestPatrolledTime".equals(formDTO.getSortCode())
//程序稳定 部分安全校验可省略
/*if (!"patrolTotal".equals(formDTO.getSortCode()) && !"latestPatrolledTime".equals(formDTO.getSortCode())
&& !"reportProjectCount".equals(formDTO.getSortCode()) && !"totalTime".equals(formDTO.getSortCode())) {
throw new RenException("参数错误,排序条件值错误");
}
if (formDTO.getTime() != 1 && formDTO.getTime() != 3) {
}*/
/*if (formDTO.getTime() != 1 && formDTO.getTime() != 3) {
throw new RenException("参数错误,最近时间值不正确");
}
}*/
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<StaffListResultDTO>>().ok(epmetUserService.staffPatrolList(formDTO));
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml

@ -76,8 +76,8 @@
AND cs.real_name = #{staffName}
</if>
<if test="gridIds != null and gridIds.size() > 0">
<foreach collection="gridIds" item="gridId" open="AND (" separator=" OR " close=" )" >
ssp.grid_id = #{gridId}
<foreach collection="gridIds" item="gridId" open="AND ssp.grid_id IN (" separator="," close=")">
#{gridId}
</foreach>
</if>
GROUP BY ssp.grid_id, ssp.staff_id

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -84,7 +84,7 @@ public class IndexController {
/**
* 5下级部门指数排行安宁数据段用
*
* 工作端小程序下级组织指数排行也调用的此接口
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO>>
* @Author zhangyong
@ -154,7 +154,7 @@ public class IndexController {
/**
* @param formDTO
* @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行
* @description 8平阴大屏-下级街道or网格指数排行 默认查询上个月
* @Date 2021/2/28 14:33
**/
@PostMapping("subagencyindexrank-py")

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -107,24 +107,24 @@ public interface ScreenIndexDataMonthlyDao{
List<PeerComparisonResultDTO> getSingleIndexRank(SubSingleIndexRankFormDTO formDTO);
/**
* @param yearId
* @param monthId
* @param areaCode
* @Description 根据areaCode查询下级指数
* @author yinzuomei
*/
List<SubAgencyIndexRankResultDTO> selectSubStreetByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
/**
* @param yearId
* @param monthId
* @param areaCode
* @Description 根据areaCode查询网格指数
* @author yinzuomei
*/
List<SubAgencyIndexRankResultDTO> selectSubGridByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java

@ -90,7 +90,7 @@ public interface IndexService {
/**
* @param formDTO
* @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行
* @description 8平阴大屏-下级街道or网格指数排行 默认查询上个月
* @Date 2021/2/28 14:33
**/
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO);

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -426,7 +426,8 @@ public class IndexServiceImpl implements IndexService {
/**
* @param formDTO
* @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行
* @description 8平阴大屏-下级街道or网格指数排行 默认查询上个月
* 改为默认查询上个月
* @Date 2021/2/28 14:33
**/
@Override
@ -435,10 +436,10 @@ public class IndexServiceImpl implements IndexService {
if (!"street".equals(formDTO.getType()) && !"grid".equals(formDTO.getType())) {
throw new RenException("type传参错误,街道:street;网格:grid");
}
LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE);
String yearId = String.valueOf(now.getYear());
String monthId=DateUtils.getBeforeNMonth(1);
if("street".equals(formDTO.getType())){
List<SubAgencyIndexRankResultDTO> streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum());
// 默认查询8个街道,平阴大屏,不会跟随中央区变化
List<SubAgencyIndexRankResultDTO> streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),monthId,formDTO.getAreaCode(),formDTO.getTopNum());
// 小数四舍五入
streetList.forEach(indexRank -> {
indexRank.setOrgType("street");
@ -449,7 +450,8 @@ public class IndexServiceImpl implements IndexService {
});
return streetList;
}
List<SubAgencyIndexRankResultDTO> gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum());
// 网格会根据中央区选择具体某个街道,变化
List<SubAgencyIndexRankResultDTO> gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),monthId,formDTO.getAreaCode(),formDTO.getTopNum());
// 小数四舍五入
gridList.forEach(indexRank -> {
indexRank.setOrgType("grid");

21
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -352,17 +352,16 @@
<select id="selectSubStreetByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
sca.AGENCY_NAME AS NAME,
sy.govern_ablity AS governAbility,
sy.party_dev_ablity AS partyDevAbility,
sy.service_ablity AS serviceAbility,
sy.govern_ablity * sy.GOVERN_ABLITY_WEIGHT AS governAbility,
sy.party_dev_ablity * sy.PARTY_DEV_WEIGHT AS partyDevAbility,
sy.service_ablity * sy.SERVICE_ABLITY_WEIGHT AS serviceAbility,
sy.ORG_ID as orgId,
sca.area_code as areaCode
FROM screen_customer_agency sca
left join screen_index_data_yearly sy
left join screen_index_data_monthly sy
on(sca.AGENCY_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId}
and sy.MONTH_ID=#{monthId}
)
WHERE
sca.del_flag = '0'
@ -375,17 +374,17 @@
<select id="selectSubGridByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
scg.GRID_NAME AS NAME,
sy.govern_ablity AS governAbility,
sy.party_dev_ablity AS partyDevAbility,
sy.service_ablity AS serviceAbility,
sy.govern_ablity * sy.GOVERN_ABLITY_WEIGHT AS governAbility,
sy.party_dev_ablity * sy.PARTY_DEV_WEIGHT AS partyDevAbility,
sy.service_ablity * sy.SERVICE_ABLITY_WEIGHT AS serviceAbility,
sy.ORG_ID as orgId,
scg.area_code as areaCode
FROM screen_customer_grid scg
left join screen_index_data_yearly sy
left join screen_index_data_monthly sy
on(scg.GRID_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId}
and sy.MONTH_ID=#{monthId}
)
WHERE
scg.del_flag = '0'

Loading…
Cancel
Save