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) @RequirePermission(requirePermission = RequirePermissionEnum.MORE_PATROL_RECORD_LIST)
public Result<List<StaffListResultDTO>> staffPatrolList(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO) { public Result<List<StaffListResultDTO>> staffPatrolList(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class); 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())) { && !"reportProjectCount".equals(formDTO.getSortCode()) && !"totalTime".equals(formDTO.getSortCode())) {
throw new RenException("参数错误,排序条件值错误"); throw new RenException("参数错误,排序条件值错误");
} }*/
if (formDTO.getTime() != 1 && formDTO.getTime() != 3) { /*if (formDTO.getTime() != 1 && formDTO.getTime() != 3) {
throw new RenException("参数错误,最近时间值不正确"); throw new RenException("参数错误,最近时间值不正确");
} }*/
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
return new Result<List<StaffListResultDTO>>().ok(epmetUserService.staffPatrolList(formDTO)); 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} AND cs.real_name = #{staffName}
</if> </if>
<if test="gridIds != null and gridIds.size() > 0"> <if test="gridIds != null and gridIds.size() > 0">
<foreach collection="gridIds" item="gridId" open="AND (" separator=" OR " close=" )" > <foreach collection="gridIds" item="gridId" open="AND ssp.grid_id IN (" separator="," close=")">
ssp.grid_id = #{gridId} #{gridId}
</foreach> </foreach>
</if> </if>
GROUP BY ssp.grid_id, ssp.staff_id 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下级部门指数排行安宁数据段用 * 5下级部门指数排行安宁数据段用
* * 工作端小程序下级组织指数排行也调用的此接口
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO>> * @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO>>
* @Author zhangyong * @Author zhangyong
@ -154,7 +154,7 @@ public class IndexController {
/** /**
* @param formDTO * @param formDTO
* @author yinzuomei * @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行 * @description 8平阴大屏-下级街道or网格指数排行 默认查询上个月
* @Date 2021/2/28 14:33 * @Date 2021/2/28 14:33
**/ **/
@PostMapping("subagencyindexrank-py") @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); List<PeerComparisonResultDTO> getSingleIndexRank(SubSingleIndexRankFormDTO formDTO);
/** /**
* @param yearId * @param monthId
* @param areaCode * @param areaCode
* @Description 根据areaCode查询下级指数 * @Description 根据areaCode查询下级指数
* @author yinzuomei * @author yinzuomei
*/ */
List<SubAgencyIndexRankResultDTO> selectSubStreetByAreaCode(@Param("customerId") String customerId, List<SubAgencyIndexRankResultDTO> selectSubStreetByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId,
@Param("areaCode") String areaCode, @Param("areaCode") String areaCode,
@Param("topNum") int topNum); @Param("topNum") int topNum);
/** /**
* @param yearId * @param monthId
* @param areaCode * @param areaCode
* @Description 根据areaCode查询网格指数 * @Description 根据areaCode查询网格指数
* @author yinzuomei * @author yinzuomei
*/ */
List<SubAgencyIndexRankResultDTO> selectSubGridByAreaCode(@Param("customerId") String customerId, List<SubAgencyIndexRankResultDTO> selectSubGridByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("monthId") String monthId,
@Param("areaCode") String areaCode, @Param("areaCode") String areaCode,
@Param("topNum") int topNum); @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 * @param formDTO
* @author yinzuomei * @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行 * @description 8平阴大屏-下级街道or网格指数排行 默认查询上个月
* @Date 2021/2/28 14:33 * @Date 2021/2/28 14:33
**/ **/
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO); 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 * @param formDTO
* @author yinzuomei * @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行 * @description 8平阴大屏-下级街道or网格指数排行 默认查询上个月
* 改为默认查询上个月
* @Date 2021/2/28 14:33 * @Date 2021/2/28 14:33
**/ **/
@Override @Override
@ -435,10 +436,10 @@ public class IndexServiceImpl implements IndexService {
if (!"street".equals(formDTO.getType()) && !"grid".equals(formDTO.getType())) { if (!"street".equals(formDTO.getType()) && !"grid".equals(formDTO.getType())) {
throw new RenException("type传参错误,街道:street;网格:grid"); throw new RenException("type传参错误,街道:street;网格:grid");
} }
LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); String monthId=DateUtils.getBeforeNMonth(1);
String yearId = String.valueOf(now.getYear());
if("street".equals(formDTO.getType())){ 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 -> { streetList.forEach(indexRank -> {
indexRank.setOrgType("street"); indexRank.setOrgType("street");
@ -449,7 +450,8 @@ public class IndexServiceImpl implements IndexService {
}); });
return streetList; 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 -> { gridList.forEach(indexRank -> {
indexRank.setOrgType("grid"); 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 id="selectSubStreetByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT SELECT
sca.AGENCY_NAME AS NAME, sca.AGENCY_NAME AS NAME,
sy.govern_ablity AS governAbility, sy.govern_ablity * sy.GOVERN_ABLITY_WEIGHT AS governAbility,
sy.party_dev_ablity AS partyDevAbility, sy.party_dev_ablity * sy.PARTY_DEV_WEIGHT AS partyDevAbility,
sy.service_ablity AS serviceAbility, sy.service_ablity * sy.SERVICE_ABLITY_WEIGHT AS serviceAbility,
sy.ORG_ID as orgId, sy.ORG_ID as orgId,
sca.area_code as areaCode sca.area_code as areaCode
FROM screen_customer_agency sca 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 on(sca.AGENCY_ID=sy.ORG_ID
and sy.DEL_FLAG='0' and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department' and sy.MONTH_ID=#{monthId}
and sy.YEAR_ID=#{yearId}
) )
WHERE WHERE
sca.del_flag = '0' sca.del_flag = '0'
@ -375,17 +374,17 @@
<select id="selectSubGridByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO"> <select id="selectSubGridByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT SELECT
scg.GRID_NAME AS NAME, scg.GRID_NAME AS NAME,
sy.govern_ablity AS governAbility, sy.govern_ablity * sy.GOVERN_ABLITY_WEIGHT AS governAbility,
sy.party_dev_ablity AS partyDevAbility, sy.party_dev_ablity * sy.PARTY_DEV_WEIGHT AS partyDevAbility,
sy.service_ablity AS serviceAbility, sy.service_ablity * sy.SERVICE_ABLITY_WEIGHT AS serviceAbility,
sy.ORG_ID as orgId, sy.ORG_ID as orgId,
scg.area_code as areaCode scg.area_code as areaCode
FROM screen_customer_grid scg 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 on(scg.GRID_ID=sy.ORG_ID
and sy.DEL_FLAG='0' and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department' and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId} and sy.MONTH_ID=#{monthId}
) )
WHERE WHERE
scg.del_flag = '0' scg.del_flag = '0'

Loading…
Cancel
Save