Browse Source

数据改版部分接口

master
sunyuchao 5 years ago
parent
commit
da15e9662a
  1. 16
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java
  2. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java
  3. 16
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java
  4. 19
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java
  5. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java
  6. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java
  7. 14
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java
  8. 8
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java
  9. 8
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java
  10. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java
  11. 29
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  12. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  13. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  14. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  15. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  16. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java
  17. 338
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  18. 41
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  19. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  20. 41
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  21. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  22. 61
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml
  23. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  24. 10
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

16
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityIndexFormDTO.java

@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
@ -15,19 +14,24 @@ import java.io.Serializable;
public class AblityIndexFormDTO implements Serializable { public class AblityIndexFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
/** /**
* 查询月份的前12个月对应的monthId * 组织或网格Id
*/ */
private String startMonthId; @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/** /**
* 组织Id * 组织Id
*/ */
@NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String customerId; private String customerId;
/** /**
* 组织Id * 组织或网格类型
*/ */
@NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId; private String orgType;
/**
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
/** /**
* 月份Id格式202009 * 月份Id格式202009
*/ */

15
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AblityListFormDTO.java

@ -14,15 +14,21 @@ import java.io.Serializable;
public class AblityListFormDTO implements Serializable { public class AblityListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
/** /**
* 组织Id * 客户Id
*/ */
@NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class})
private String customerId; private String customerId;
/** /**
* 组织Id * 组织或网格Id
*/ */
@NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId; private String orgId;
/**
* 组织或网格类型
*/
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/** /**
* 月份Id格式202009 * 月份Id格式202009
*/ */
@ -37,6 +43,5 @@ public class AblityListFormDTO implements Serializable {
* 所有有权重的指标code拼接的字符串 冒号隔开 * 所有有权重的指标code拼接的字符串 冒号隔开
*/ */
private String allParentIndexCode; private String allParentIndexCode;
public interface AddUserInternalGroup {}
} }

16
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthAblityListFormDTO.java

@ -14,15 +14,21 @@ import java.io.Serializable;
public class MonthAblityListFormDTO implements Serializable { public class MonthAblityListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
/** /**
* 组织Id * 客户Id
*/ */
@NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class})
private String customerId; private String customerId;
/** /**
* 组织Id * 组织或网格Id
*/ */
@NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId; private String orgId;
/**
* 组织或网格类型
*/
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/** /**
* 月份Id格式202009 * 月份Id格式202009
*/ */
@ -37,7 +43,5 @@ public class MonthAblityListFormDTO implements Serializable {
* 查询月份的前12个月对应的monthId * 查询月份的前12个月对应的monthId
*/ */
private String startMonthId; private String startMonthId;
public interface AddUserInternalGroup {}
} }

19
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthScoreListFormDTO.java

@ -13,21 +13,34 @@ import java.io.Serializable;
@Data @Data
public class MonthScoreListFormDTO implements Serializable { public class MonthScoreListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织或网格Id
*/
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/** /**
* 组织Id * 组织Id
*/ */
@NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String customerId; private String customerId;
/** /**
* 组织Id * 组织或网格类型
*/ */
@NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId; private String orgType;
/**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/
private String indexCode;
/** /**
* 月份Id格式202009 * 月份Id格式202009
*/ */
@NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class})
private String monthId; private String monthId;
/**
* 查询月份的前12个月对应的monthId
*/
private String startMonthId;
public interface AddUserInternalGroup {} public interface AddUserInternalGroup {}
} }

15
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java

@ -15,15 +15,21 @@ import java.io.Serializable;
public class PeerComparisonFormDTO implements Serializable { public class PeerComparisonFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
/** /**
* 组织Id * 客户Id
*/ */
@NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class})
private String customerId; private String customerId;
/** /**
* 组织Id * 组织或网格Id
*/ */
@NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId; private String orgId;
/**
* 组织或网格类型
*/
@NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgType;
public interface AddUserInternalGroup {}
/** /**
* 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli * 类型党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli
*/ */
@ -34,6 +40,5 @@ public class PeerComparisonFormDTO implements Serializable {
*/ */
@Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class }) @Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class })
private Integer pageSize; private Integer pageSize;
public interface AddUserInternalGroup {}
} }

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java

@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
@ -14,12 +13,12 @@ import java.io.Serializable;
@Data @Data
public class RootAgencyFormDTO implements Serializable { public class RootAgencyFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
public interface AddUserInternalGroup {}
/** /**
* 组织Id * 组织Id
*/ */
@NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class})
private String agencyId; private String agencyId;
public interface AddUserInternalGroup {}
} }

14
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScoreListFormDTO.java

@ -13,16 +13,22 @@ import java.io.Serializable;
@Data @Data
public class ScoreListFormDTO implements Serializable { public class ScoreListFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L; private static final long serialVersionUID = -2880432640584616651L;
/**
* 组织或网格Id
*/
@NotBlank(message = "组织或网格ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String orgId;
/** /**
* 组织Id * 组织Id
*/ */
@NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class})
private String customerId; private String customerId;
/** /**
* 组织Id * 组织或网格类型
*/ */
@NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "组织或网格类型不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class})
private String agencyId; private String orgType;
public interface AddUserInternalGroup {}
/** /**
* 月份Id格式202009 * 月份Id格式202009
*/ */
@ -33,6 +39,4 @@ public class ScoreListFormDTO implements Serializable {
*/ */
private String indexCode; private String indexCode;
public interface AddUserInternalGroup {}
} }

8
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityIndexResultDTO.java

@ -29,14 +29,6 @@ public class AblityIndexResultDTO implements Serializable {
* 能力总分 * 能力总分
*/ */
private Double indexTotal; private Double indexTotal;
/**
* 本级能力分
*/
private Double agencyScore;
/**
* 下级能力分
*/
private Double subAgencyScore;
/** /**
* 横坐标202009 * 横坐标202009
*/ */

8
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java

@ -14,13 +14,13 @@ public class PeerComparisonResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L; private static final long serialVersionUID = 3860268744336541373L;
/** /**
* 组织Id * 组织或网格Id
*/ */
private String agencyId; private String orgId;
/** /**
* 组织名称 * 组织或网格名称
*/ */
private String agencyName; private String orgName;
/** /**
* 能力分值(保留一位小数) * 能力分值(保留一位小数)
*/ */

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java

@ -5,6 +5,14 @@ package com.epmet.datareport.constant;
* @dscription 数据 * @dscription 数据
*/ */
public interface FactConstant { public interface FactConstant {
/**
* 组织类型
*/
String AGENCY = "agency";
/**
* 网格类型
*/
String GRID = "grid";
/** /**
* 能力指标 * 能力指标
*/ */
@ -33,4 +41,8 @@ public interface FactConstant {
* 社区相关 * 社区相关
*/ */
String SHE_QU_XIANG_GUAN = "shequxiangguan"; String SHE_QU_XIANG_GUAN = "shequxiangguan";
/**
* 网格相关
*/
String WANG_GE_XIANG_GUAN = "wanggexiangguan";
} }

29
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java

@ -17,6 +17,7 @@ import java.util.List;
/** /**
* 数据改版api * 数据改版api
*
* @author sun * @author sun
*/ */
@RestController @RestController
@ -28,77 +29,77 @@ public class FactIndexController {
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 能力指数 * @Description 能力指数
* @author sun * @author sun
*/ */
@PostMapping("index/ablityindex") @PostMapping("index/ablityindex")
public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){ public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class);
return new Result<List<AblityIndexResultDTO>>().ok(factIndexService.ablityIndex(formDTO)); return new Result<List<AblityIndexResultDTO>>().ok(factIndexService.ablityIndex(formDTO));
} }
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 按月份查询各项能力分数 * @Description 按月份查询各项能力分数
* @author sun * @author sun
*/ */
@PostMapping("index/scorelist") @PostMapping("index/scorelist")
public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){ public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class);
return new Result<List<ScoreListResultDTO>>().ok(factIndexService.scoreList(formDTO)); return new Result<List<ScoreListResultDTO>>().ok(factIndexService.scoreList(formDTO));
} }
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 按月份查询各项能力最近12个月得分 * @Description 按月份查询各项能力最近12个月得分
* @author sun * @author sun
*/ */
@PostMapping("index/monthscorelist") @PostMapping("index/monthscorelist")
public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){ public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class);
return new Result<List<MonthScoreListResultDTO>>().ok(factIndexService.monthScoreList(formDTO)); return new Result<List<MonthScoreListResultDTO>>().ok(factIndexService.monthScoreList(formDTO));
} }
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 按月查询各项指标数据 * @Description 按月查询各项指标数据
* @author sun * @author sun
*/ */
@PostMapping("index/ablitylist") @PostMapping("index/ablitylist")
public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){ public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class);
return new Result<List<AblityListResultDTO>>().ok(factIndexService.ablityList(formDTO)); return new Result<List<AblityListResultDTO>>().ok(factIndexService.ablityList(formDTO));
} }
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 按月查询各项指标最近12个月数据 * @Description 按月查询各项指标最近12个月数据
* @author sun * @author sun
*/ */
@PostMapping("index/monthablitylist") @PostMapping("index/monthablitylist")
public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){ public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class);
return new Result<List<MonthAblityListResultDTO>>().ok(factIndexService.monthAblityList(formDTO)); return new Result<List<MonthAblityListResultDTO>>().ok(factIndexService.monthAblityList(formDTO));
} }
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 同级对比各项数据查询 * @Description 同级对比各项数据查询
* @author sun * @author sun
*/ */
@PostMapping("index/peercomparison") @PostMapping("index/peercomparison")
public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){ public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class);
return new Result<List<PeerComparisonResultDTO>>().ok(factIndexService.peerComparison(formDTO)); return new Result<List<PeerComparisonResultDTO>>().ok(factIndexService.peerComparison(formDTO));
} }
/** /**
* @param tokenDTO * @param tokenDTO
* @Description 是否根组织 * @Description 是否根组织
* @author sun * @author sun
*/ */
@PostMapping("index/rootagency") @PostMapping("index/rootagency")
public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){ public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class);
return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO)); return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO));
} }

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

@ -80,7 +80,7 @@ public interface ScreenIndexDataMonthlyDao{
/** /**
* @param formDTO * @param formDTO
* @Description 同级对比--根据组织Id的上级组织Id查询同级组织对应类型的得分排名查询最近一个月数据 * @Description 同级对比--根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名查询最近一个月数据
* @author sun * @author sun
*/ */
List<PeerComparisonResultDTO> selectScoreList(PeerComparisonFormDTO formDTO); List<PeerComparisonResultDTO> selectScoreList(PeerComparisonFormDTO formDTO);

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java

@ -18,8 +18,10 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -34,17 +36,24 @@ import java.util.LinkedList;
@Mapper @Mapper
public interface FactIndexAgencyScoreDao { public interface FactIndexAgencyScoreDao {
/**
* @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO);
/** /**
* @param formDTO * @param formDTO
* @Description 分别查询当前组织某一月份党建能力治理能力服务能力对应的总分本级分下级分 * @Description 分别查询当前组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun * @author sun
*/ */
ScoreListResultDTO selectScore(ScoreListFormDTO formDTO); ScoreListResultDTO selectScoreList(ScoreListFormDTO formDTO);
/** /**
* @param formDTO * @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据 * @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun * @author sun
*/ */
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO); LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectMonthScoreList(MonthScoreListFormDTO formDTO);
} }

18
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java

@ -18,7 +18,11 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList; import java.util.LinkedList;
@ -38,4 +42,18 @@ public interface FactIndexCommunityScoreDao {
* @author sun * @author sun
*/ */
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityIndex(AblityIndexFormDTO formDTO); LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询社区级组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
ScoreListResultDTO selectCommunityScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询社区过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO);
} }

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java

@ -17,8 +17,16 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
/** /**
* 网格相关分值记录表 * 网格相关分值记录表
* *
@ -28,4 +36,24 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface FactIndexGridScoreDao { public interface FactIndexGridScoreDao {
/**
* @param formDTO
* @Description 分别查网格过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectGridAblityIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查网格某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
ScoreListResultDTO selectGridScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查网格过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthScoreList(MonthScoreListFormDTO formDTO);
} }

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java

@ -17,8 +17,15 @@
package com.epmet.datareport.dao.fact; package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.LinkedList;
import java.util.List;
/** /**
* 网格相关分值记录表 * 网格相关分值记录表
* *
@ -28,4 +35,17 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface FactIndexGridSubScoreDao { public interface FactIndexGridSubScoreDao {
/**
* @param formDTO
* @Description 查询网格某月份某项能力对应的各项指标
* @author sun
*/
List<AblityListResultDTO> selectGridAblityList(AblityListFormDTO formDTO);
/**
* @param formDTO
* @Description 查询网格层级某项能力对应的一项指标过去12个月份数据
* @author sun
*/
LinkedList<MonthAblityListResultDTO> selectGridMonthAblityList(MonthAblityListFormDTO formDTO);
} }

338
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -7,16 +7,14 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao; import com.epmet.datareport.dao.fact.*;
import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao;
import com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao;
import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao;
import com.epmet.datareport.service.fact.FactIndexService; import com.epmet.datareport.service.fact.FactIndexService;
import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*; import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -45,6 +43,10 @@ public class FactIndexServiceImpl implements FactIndexService {
private FactIndexCommunityScoreDao factIndexCommunityScoreDao; private FactIndexCommunityScoreDao factIndexCommunityScoreDao;
@Autowired @Autowired
private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao;
@Autowired
private FactIndexGridScoreDao factIndexGridScoreDao;
@Autowired
private FactIndexGridSubScoreDao factIndexGridSubScoreDao;
/** /**
* @param formDTO * @param formDTO
@ -53,76 +55,91 @@ public class FactIndexServiceImpl implements FactIndexService {
*/ */
@Override @Override
public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) { public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) {
LinkedList<AblityIndexResultDTO> resultDTO = new LinkedList<>(); LinkedList<AblityIndexResultDTO> resultList = new LinkedList<>();
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null; LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null;
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null; LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null;
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null; LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null;
//分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序
//1.计算所查月份前12个月的monthId //1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据组织Id查询组织信息 //2.根据类型判断是查询组织数据还是网格数据
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); //组织层级数据
if (null == agency) { if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); //3.根据组织Id查询组织信息
} CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
//1.根据组织级别判断查询哪类数据表 if (null == agency) {
//区县级、乡镇街道级 throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { }
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union) //4.根据组织级别判断查询哪类数据表
formDTO.setIndexCode(FactConstant.DJNL); //区县级、乡镇街道级
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
formDTO.setIndexCode(FactConstant.ZLNL); formDTO.setIndexCode(FactConstant.DJNL);
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 //4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL); formDTO.setIndexCode(FactConstant.ZLNL);
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
//社区级 //社区级
} else if ("community".equals(agency.getLevel())) { } else if ("community".equals(agency.getLevel())) {
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据 //4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询过去12个月网格层级各项能力对应的各项得分数据
//5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
formDTO.setIndexCode(FactConstant.DJNL); formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); djList = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据 //5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL); formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); zlList = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据 //5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL); formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); fwList = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
} else { } else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
} }
//3.遍历计算每个月能力指数 //6.遍历计算每个月能力指数
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>(); LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>();
for (int i = 0; i < djList.size(); i++) { for (int i = 0; i < djList.size(); i++) {
AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO();
nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal()); double num1 = new BigDecimal((djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal())).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore()); nldto.setIndexTotal(num1);
nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore());
nldto.setMonthId(djList.get(i).getMonthId()); nldto.setMonthId(djList.get(i).getMonthId());
nlList.add(nldto); nlList.add(nldto);
} }
//5.封装数据并返回 //5.封装数据并返回
AblityIndexResultDTO nl = new AblityIndexResultDTO(); AblityIndexResultDTO nl = new AblityIndexResultDTO();
nl.setIndexCode(FactConstant.NLZB); nl.setIndexCode(FactConstant.NLZB);
nl.setScoreList(djList); nl.setScoreList(nlList);
resultDTO.add(nl); if(null != nlList){resultList.add(nl);}
AblityIndexResultDTO dj = new AblityIndexResultDTO(); AblityIndexResultDTO dj = new AblityIndexResultDTO();
dj.setIndexCode(FactConstant.DJNL); dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList); dj.setScoreList(djList);
resultDTO.add(dj); if(null != djList){resultList.add(dj);}
AblityIndexResultDTO zl = new AblityIndexResultDTO(); AblityIndexResultDTO zl = new AblityIndexResultDTO();
zl.setIndexCode(FactConstant.ZLNL); zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(djList); zl.setScoreList(zlList);
resultDTO.add(zl); if(null != zlList){resultList.add(zl);}
AblityIndexResultDTO fw = new AblityIndexResultDTO(); AblityIndexResultDTO fw = new AblityIndexResultDTO();
fw.setIndexCode(FactConstant.FWNL); fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(djList); fw.setScoreList(fwList);
resultDTO.add(fw); if(null != fwList){resultList.add(fw);}
return resultDTO; return resultList;
} }
/** /**
@ -132,13 +149,65 @@ public class FactIndexServiceImpl implements FactIndexService {
*/ */
@Override @Override
public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) { public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) {
//1.查询当前组织某一月份党建能力对应的总分、本级分、下级分 LinkedList<ScoreListResultDTO> resultList = new LinkedList<>();
formDTO.setIndexCode(FactConstant.DJNL); ScoreListResultDTO dj = new ScoreListResultDTO();
ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO); ScoreListResultDTO zl = new ScoreListResultDTO();
//2.查询当前组织某一月份治理能力对应的总分、本级分、下级分 ScoreListResultDTO fw = new ScoreListResultDTO();
//3.查询当前组织某一月份服务能力对应的总分、本级分、下级分 //1.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
}
//3.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
dj = factIndexAgencyScoreDao.selectScoreList(formDTO);
//3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.ZLNL);
zl = factIndexAgencyScoreDao.selectScoreList(formDTO);
//3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.FWNL);
fw = factIndexAgencyScoreDao.selectScoreList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//3-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
dj = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
//3-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.ZLNL);
zl = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
//3-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.FWNL);
fw = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
return null; //4.网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//4-1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.DJNL);
dj = factIndexGridScoreDao.selectGridScoreList(formDTO);
//4-2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.ZLNL);
zl = factIndexGridScoreDao.selectGridScoreList(formDTO);
//4-3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
formDTO.setIndexCode(FactConstant.FWNL);
fw = factIndexGridScoreDao.selectGridScoreList(formDTO);
} else {
throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//5.封装数据并返回
if(null != dj){resultList.add(dj);}
if(null != zl){resultList.add(zl);}
if(null != fw){resultList.add(fw);}
return resultList;
} }
/** /**
@ -148,7 +217,78 @@ public class FactIndexServiceImpl implements FactIndexService {
*/ */
@Override @Override
public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) { public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) {
return null; LinkedList<MonthScoreListResultDTO> resultList = new LinkedList<>();
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> djList = new LinkedList<>();
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> zlList = new LinkedList<>();
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> fwList = new LinkedList<>();
//1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据类型判断是查询组织数据还是网格数据
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
}
//4.根据组织级别判断查询哪类数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
//4-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
//4-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询过去12个月网格层级各项能力对应的各项得分数据
//5-1.查询网格过去12个月党建能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.DJNL);
djList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
//5-2.查询网格过去12个月治理能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.ZLNL);
zlList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
//5-3.查询网格过去12个月服务能力每月总分、本级得分、下级得分数据
formDTO.setIndexCode(FactConstant.FWNL);
fwList = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
} else {
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
//5.封装数据并返回
MonthScoreListResultDTO dj = new MonthScoreListResultDTO();
dj.setIndexCode(FactConstant.DJNL);
dj.setScoreList(djList);
if(null != djList){resultList.add(dj);}
MonthScoreListResultDTO zl = new MonthScoreListResultDTO();
zl.setIndexCode(FactConstant.ZLNL);
zl.setScoreList(zlList);
if(null != zlList){resultList.add(zl);}
MonthScoreListResultDTO fw = new MonthScoreListResultDTO();
fw.setIndexCode(FactConstant.FWNL);
fw.setScoreList(fwList);
if(null != fwList){resultList.add(fw);}
return resultList;
} }
/** /**
@ -159,30 +299,41 @@ public class FactIndexServiceImpl implements FactIndexService {
@Override @Override
public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) { public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) {
List<AblityListResultDTO> resultList = new ArrayList<>(); List<AblityListResultDTO> resultList = new ArrayList<>();
//按月份查询当前组织各项指标数据 fact_index_agency_sub_score //1.根据类型判断是查询组织数据还是网格数据
//1.根据组织Id查询组织信息 //组织层级数据
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
if (null == agency) { //2.根据组织Id查询组织信息
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
} if (null == agency) {
//2.根据组织级别拼接查询条件,判断查询不同数据表 throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
if ("district".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
} else {
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode());
} }
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); //3.根据组织级别拼接查询条件,判断查询不同数据表
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
if ("district".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
} else {
formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode());
}
resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO);
//社区级 //社区级
} else if ("community".equals(agency.getLevel())) { } else if ("community".equals(agency.getLevel())) {
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode());
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//4.查询网格层级各项能力对应指标数据
formDTO.setAllParentIndexCode(FactConstant.WANG_GE_XIANG_GUAN + ":" + formDTO.getIndexCode());
resultList = factIndexGridSubScoreDao.selectGridAblityList(formDTO);
} else { } else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); throw new RenException(String.format("按月查询各项指标数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
} }
//3.调用方法判断各项指标是数字指标还是百分比指标 //TODO
//4.调用方法判断各项指标是数字指标还是百分比指标 //TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
return resultList; return resultList;
} }
@ -196,24 +347,33 @@ public class FactIndexServiceImpl implements FactIndexService {
LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>(); LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>();
//1.计算所查月份前12个月的monthId //1.计算所查月份前12个月的monthId
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); formDTO.setStartMonthId(getDate(formDTO.getMonthId()));
//2.根据组织Id查询组织信息 //2.根据类型判断是查询组织数据还是网格数据
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); //组织层级数据
if (null == agency) { if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId())); //3.根据组织Id查询组织信息
} CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
if (null == agency) {
//3.根据组织级别拼接查询条件,判断查询不同数据表 throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getOrgId()));
//区县级、乡镇街道级 }
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { //4.根据组织级别拼接查询条件,判断查询不同数据表
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); //区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//社区级 resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO);
} else if ("community".equals(agency.getLevel())) { //社区级
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); } else if ("community".equals(agency.getLevel())) {
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO);
} else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
}
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询网格层级某项能力对应的一项指标过去12个月份数据
resultList = factIndexGridSubScoreDao.selectGridMonthAblityList(formDTO);
} else { } else {
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); throw new RenException(String.format("按月查询各项指标最近12个月数据,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
} }
//3.调用方法判断各项指标是数字指标还是百分比指标//TODO
//6.调用方法判断各项指标是数字指标还是百分比指标//TODO 记得value值保留一位小数 是数的保留零位小数 是百分比的保留一位小数
return resultList; return resultList;
} }
@ -243,7 +403,7 @@ public class FactIndexServiceImpl implements FactIndexService {
*/ */
@Override @Override
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) { public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) {
//1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据) //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(查询最近一个月数据)
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO);
return resultList; return resultList;
} }

41
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml

@ -3,14 +3,47 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao"> <mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao">
<select id="selectScore" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO"> <select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal"
FROM
fact_index_agency_score fact
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
<select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
#{indexCode} AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM
fact_index_agency_score fact
INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id = #{monthId}
AND fact.index_code = #{indexCode}
</select> </select>
<select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO"> <select id="selectMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT SELECT
fact.month_id AS "monthId", fact.month_id AS "monthId",
ROUND(fact.score * fact.weight, 1) AS "indexTotal", ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore", ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM FROM
@ -22,7 +55,7 @@
fact.del_flag = '0' fact.del_flag = '0'
AND self.del_flag = '0' AND self.del_flag = '0'
AND fact.customer_id = #{customerId} AND fact.customer_id = #{customerId}
AND fact.agency_id = #{agencyId} AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId} AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId} AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode} AND fact.index_code = #{indexCode}

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO"> <select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT SELECT
fact.index_code AS "key", fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
dict.index_name AS "name" dict.index_name AS "name"
FROM FROM
fact_index_agency_sub_score fact fact_index_agency_sub_score fact
@ -16,14 +16,14 @@
AND dict.del_flag = '0' AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode} AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId} AND customer_id = #{customerId}
AND agency_id = #{agencyId} AND agency_id = #{orgId}
AND month_id = #{monthId} AND month_id = #{monthId}
</select> </select>
<select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO"> <select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT SELECT
fact.month_id AS "monthId", fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity" IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
FROM FROM
fact_index_agency_sub_score fact fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
@ -31,7 +31,7 @@
fact.del_flag = '0' fact.del_flag = '0'
AND dict.del_flag = '0' AND dict.del_flag = '0'
AND customer_id = #{customerId} AND customer_id = #{customerId}
AND agency_id = #{agencyId} AND agency_id = #{orgId}
AND month_id &lt;= #{monthId} AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId} AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key} AND fact.index_code = #{key}

41
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml

@ -6,7 +6,44 @@
<select id="selectCommunityAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO"> <select id="selectCommunityAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT SELECT
fact.month_id AS "monthId", fact.month_id AS "monthId",
ROUND(fact.score * fact.weight, 1) AS "indexTotal", ROUND(fact.score, 1) AS "indexTotal"
FROM
fact_index_community_score fact
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
<select id="selectCommunityScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
#{indexCode} AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM
fact_index_community_score fact
INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.agency_id = #{orgId}
AND fact.month_id = #{monthId}
AND fact.index_code = #{indexCode}
</select>
<select id="selectCommunityMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore", ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore" ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM FROM
@ -18,7 +55,7 @@
fact.del_flag = '0' fact.del_flag = '0'
AND self.del_flag = '0' AND self.del_flag = '0'
AND fact.customer_id = #{customerId} AND fact.customer_id = #{customerId}
AND fact.agency_id = #{agencyId} AND fact.agency_id = #{orgId}
AND fact.month_id &gt; #{startMonthId} AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId} AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode} AND fact.index_code = #{indexCode}

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -6,7 +6,7 @@
<select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO"> <select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT SELECT
fact.index_code AS "key", fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
dict.index_name AS "name" dict.index_name AS "name"
FROM FROM
fact_index_community_sub_score fact fact_index_community_sub_score fact
@ -16,14 +16,14 @@
AND dict.del_flag = '0' AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode} AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId} AND customer_id = #{customerId}
AND agency_id = #{agencyId} AND agency_id = #{orgId}
AND month_id = #{monthId} AND month_id = #{monthId}
</select> </select>
<select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO"> <select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT SELECT
fact.month_id AS "monthId", fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity" IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
FROM FROM
fact_index_community_sub_score fact fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
@ -31,7 +31,7 @@
fact.del_flag = '0' fact.del_flag = '0'
AND dict.del_flag = '0' AND dict.del_flag = '0'
AND customer_id = #{customerId} AND customer_id = #{customerId}
AND agency_id = #{agencyId} AND agency_id = #{orgId}
AND month_id &lt;= #{monthId} AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId} AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key} AND fact.index_code = #{key}

61
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

@ -3,5 +3,66 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridScoreDao"> <mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridScoreDao">
<select id="selectGridAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal"
FROM
fact_index_grid_score fact
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
<select id="selectGridScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
#{indexCode} AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM
fact_index_grid_score fact
INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id
AND fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id = #{monthId}
AND fact.index_code = #{indexCode}
</select>
<select id="selectGridMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score * self.self_weight,1) AS "agencyScore",
ROUND(self.sub_score * self.sub_weight,1) AS "subAgencyScore"
FROM
fact_index_grid_score fact
INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id
AND fact.agency_id = self.agency_id
AND fact.month_id = self.month_id
AND fact.index_code = self.parent_index_code
WHERE
fact.del_flag = '0'
AND self.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id &gt; #{startMonthId}
AND fact.month_id &lt;= #{monthId}
AND fact.index_code = #{indexCode}
ORDER BY
fact.month_id ASC
</select>
</mapper> </mapper>

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -3,5 +3,40 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao"> <mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao">
<select id="selectGridAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO">
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "value",
dict.index_name AS "name"
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND fact.all_parent_index_code = #{allParentIndexCode}
AND customer_id = #{customerId}
AND grid_id = #{orgId}
AND month_id = #{monthId}
</select>
<select id="selectGridMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO">
SELECT
fact.month_id AS "monthId",
IF(fact.origin_value='',0,IFNULL(ROUND(fact.origin_value,1),0)) AS "ablity"
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code
WHERE
fact.del_flag = '0'
AND dict.del_flag = '0'
AND customer_id = #{customerId}
AND grid_id = #{orgId}
AND month_id &lt;= #{monthId}
AND month_id &gt; #{startMonthId}
AND fact.index_code = #{key}
ORDER BY
fact.month_id ASC
</select>
</mapper> </mapper>

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

@ -110,8 +110,8 @@
<select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO"> <select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO">
SELECT SELECT
org_id AS "agencyId", org_id AS "orgId",
org_name AS "agencyName", org_name AS "orgName",
<if test="indexCode != null and indexCode != '' and indexCode == 'dangjiannengli'"> <if test="indexCode != null and indexCode != '' and indexCode == 'dangjiannengli'">
round((party_dev_ablity * party_dev_weight),1) AS "score" round((party_dev_ablity * party_dev_weight),1) AS "score"
</if> </if>
@ -125,7 +125,7 @@
screen_index_data_monthly screen_index_data_monthly
WHERE WHERE
del_flag = '0' del_flag = '0'
AND org_type = 'agency' AND org_type = #{orgType}
AND customer_id = #{customerId} AND customer_id = #{customerId}
AND parent_id = ( AND parent_id = (
select select
@ -134,9 +134,9 @@
screen_index_data_monthly screen_index_data_monthly
where where
del_flag = '0' del_flag = '0'
and org_type = 'agency' and org_type = #{orgType}
and customer_id = #{customerId} and customer_id = #{customerId}
and org_id = #{agencyId} and org_id = #{orgId}
order by order by
created_time desc created_time desc
limit 1 limit 1

Loading…
Cancel
Save