Browse Source

Merge remote-tracking branch 'origin/dev'

dev_shibei_match
yinzuomei 4 years ago
parent
commit
1133d52c09
  1. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  2. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  3. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  4. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  5. 51
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

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");

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

@ -352,47 +352,46 @@
<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
on(sca.AGENCY_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId}
)
left join screen_index_data_monthly sy
on(sca.AGENCY_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.MONTH_ID=#{monthId}
)
WHERE
sca.del_flag = '0'
AND sca.PARENT_AREA_CODE=#{areaCode}
and sy.CUSTOMER_ID=#{customerId}
sca.del_flag = '0'
AND sca.PARENT_AREA_CODE=#{areaCode}
and sy.CUSTOMER_ID=#{customerId}
ORDER BY (sy.govern_ablity+sy.party_dev_ablity+sy.service_ablity) DESC
LIMIT #{topNum}
LIMIT #{topNum}
</select>
<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
on(scg.GRID_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId}
)
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.MONTH_ID=#{monthId}
)
WHERE
scg.del_flag = '0'
AND scg.AREA_CODE like CONCAT(#{areaCode},'%')
and sy.CUSTOMER_ID=#{customerId}
scg.del_flag = '0'
AND scg.AREA_CODE like CONCAT(#{areaCode},'%')
and sy.CUSTOMER_ID=#{customerId}
ORDER BY (sy.govern_ablity+sy.party_dev_ablity+sy.service_ablity) DESC
LIMIT #{topNum}
LIMIT #{topNum}
</select>
<select id="selectKczSubAgencyOrGridIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"

Loading…
Cancel
Save