119 changed files with 3509 additions and 324 deletions
@ -0,0 +1,32 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 http://www.renren.io
|
||||
|
* <p> |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
||||
|
* use this file except in compliance with the License. You may obtain a copy of |
||||
|
* the License at |
||||
|
* <p> |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* <p> |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
||||
|
* License for the specific language governing permissions and limitations under |
||||
|
* the License. |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.commons.extappauth.annotation; |
||||
|
|
||||
|
import java.lang.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* 需要认证的内部请求 |
||||
|
* @Author wxz |
||||
|
* @Description |
||||
|
* @Date 2020/4/23 16:17 |
||||
|
**/ |
||||
|
@Target(ElementType.METHOD) |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
@Documented |
||||
|
public @interface InternalAppRequestAuth { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.commons.extappauth.jwt; |
||||
|
|
||||
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
/** |
||||
|
* Jwt |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
@ConfigurationProperties(prefix = "jwt.token") |
||||
|
public class JwtTokenProperties { |
||||
|
private String secret; |
||||
|
private int expire; |
||||
|
|
||||
|
public String getSecret() { |
||||
|
return secret; |
||||
|
} |
||||
|
|
||||
|
public void setSecret(String secret) { |
||||
|
this.secret = secret; |
||||
|
} |
||||
|
|
||||
|
public int getExpire() { |
||||
|
return expire; |
||||
|
} |
||||
|
|
||||
|
public void setExpire(int expire) { |
||||
|
this.expire = expire; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,130 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.commons.extappauth.jwt; |
||||
|
|
||||
|
import io.jsonwebtoken.Claims; |
||||
|
import io.jsonwebtoken.Jwts; |
||||
|
import io.jsonwebtoken.SignatureAlgorithm; |
||||
|
import org.joda.time.DateTime; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* Jwt工具类 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class JwtTokenUtils { |
||||
|
private static final Logger logger = LoggerFactory.getLogger(JwtTokenUtils.class); |
||||
|
|
||||
|
@Autowired |
||||
|
private JwtTokenProperties jwtProperties; |
||||
|
|
||||
|
/** |
||||
|
* 生成jwt token 弃用 |
||||
|
*/ |
||||
|
@Deprecated |
||||
|
public String generateToken(String userId) { |
||||
|
return Jwts.builder() |
||||
|
.setHeaderParam("typ", "JWT") |
||||
|
.setSubject(userId) |
||||
|
.setIssuedAt(new Date()) |
||||
|
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) |
||||
|
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) |
||||
|
.compact(); |
||||
|
} |
||||
|
|
||||
|
public Claims getClaimByToken(String token) { |
||||
|
try { |
||||
|
return Jwts.parser() |
||||
|
.setSigningKey(jwtProperties.getSecret()) |
||||
|
.parseClaimsJws(token) |
||||
|
.getBody(); |
||||
|
} catch (Exception e) { |
||||
|
logger.debug("validate is token error, token = " + token, e); |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @return java.util.Date |
||||
|
* @param token |
||||
|
* @Author yinzuomei |
||||
|
* @Description 获取token的有效期截止时间 |
||||
|
* @Date 2020/3/18 22:17 |
||||
|
**/ |
||||
|
public Date getExpiration(String token){ |
||||
|
try { |
||||
|
return Jwts.parser() |
||||
|
.setSigningKey(jwtProperties.getSecret()) |
||||
|
.parseClaimsJws(token) |
||||
|
.getBody().getExpiration(); |
||||
|
} catch (Exception e) { |
||||
|
logger.debug("validate is token error, token = " + token, e); |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param map |
||||
|
* @return java.lang.String |
||||
|
* @Author yinzuomei |
||||
|
* @Description 根据app+client+userId生成token |
||||
|
* @Date 2020/3/18 22:29 |
||||
|
**/ |
||||
|
public String createToken(Map<String, Object> map) { |
||||
|
return Jwts.builder() |
||||
|
.setHeaderParam("typ", "JWT") |
||||
|
.setClaims(map) |
||||
|
.setIssuedAt(new Date()) |
||||
|
.setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) |
||||
|
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) |
||||
|
.compact(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* token是否过期 |
||||
|
* |
||||
|
* @return true:过期 |
||||
|
*/ |
||||
|
public boolean isTokenExpired(Date expiration) { |
||||
|
return expiration.before(new Date()); |
||||
|
} |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
Map<String, Object> map=new HashMap<>(); |
||||
|
map.put("app","gov"); |
||||
|
map.put("client","wxmp"); |
||||
|
map.put("userId","100526ABC"); |
||||
|
String tokenStr=Jwts.builder() |
||||
|
.setHeaderParam("typ", "JWT") |
||||
|
.setClaims(map) |
||||
|
.setIssuedAt(new Date()) |
||||
|
.setExpiration(DateTime.now().plusSeconds(604800).toDate()) |
||||
|
.signWith(SignatureAlgorithm.HS512, "7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]") |
||||
|
.compact(); |
||||
|
System.out.println(tokenStr); |
||||
|
Claims claims= Jwts.parser() |
||||
|
.setSigningKey("7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet]") |
||||
|
.parseClaimsJws(tokenStr) |
||||
|
.getBody(); |
||||
|
System.out.println("app="+ claims.get("app")); |
||||
|
System.out.println("client="+ claims.get("client")); |
||||
|
System.out.println("userId="+ claims.get("userId")); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 能力指数--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AblityIndexFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 查询月份的前12个月对应的monthId |
||||
|
*/ |
||||
|
private String startMonthId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 月份Id(格式:202009) |
||||
|
*/ |
||||
|
@NotBlank(message = "月份ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) |
||||
|
private String monthId; |
||||
|
/** |
||||
|
* 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) |
||||
|
*/ |
||||
|
private String indexCode; |
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 按月查询各项指标数据--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AblityListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 月份Id(格式:202009) |
||||
|
*/ |
||||
|
@NotBlank(message = "月份ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String monthId; |
||||
|
/** |
||||
|
* 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) |
||||
|
*/ |
||||
|
@NotBlank(message = "类型不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String indexCode; |
||||
|
/** |
||||
|
* 所有有权重的指标code拼接的字符串 冒号隔开 |
||||
|
*/ |
||||
|
private String allParentIndexCode; |
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 按月查询各项指标最近12个月数据--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MonthAblityListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 月份Id(格式:202009) |
||||
|
*/ |
||||
|
@NotBlank(message = "月份ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String monthId; |
||||
|
/** |
||||
|
* 月份Id(格式:202009) |
||||
|
*/ |
||||
|
@NotBlank(message = "类型key不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String key; |
||||
|
/** |
||||
|
* 查询月份的前12个月对应的monthId |
||||
|
*/ |
||||
|
private String startMonthId; |
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 能力指数--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MonthScoreListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 月份Id(格式:202009) |
||||
|
*/ |
||||
|
@NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String monthId; |
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 同级对比各项数据查询--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PeerComparisonFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) |
||||
|
*/ |
||||
|
@NotBlank(message = "数据类型不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) |
||||
|
private String indexCode; |
||||
|
/** |
||||
|
* 查询条数 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class }) |
||||
|
private Integer pageSize; |
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 是否根组织--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RootAgencyFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
|
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.form; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 按月份查询各项能力分数--接口入参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ScoreListFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -2880432640584616651L; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
@NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 月份Id(格式:202009) |
||||
|
*/ |
||||
|
@NotBlank(message = "月份ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) |
||||
|
private String monthId; |
||||
|
/** |
||||
|
* 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) |
||||
|
*/ |
||||
|
private String indexCode; |
||||
|
|
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 能力指数--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AblityIndexResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli |
||||
|
*/ |
||||
|
private String indexCode; |
||||
|
/** |
||||
|
* 每项能力最近12月各项分数对象 |
||||
|
*/ |
||||
|
private List<AblityIndexResultDTO.ScoreListResultDTO> scoreList; |
||||
|
|
||||
|
@Data |
||||
|
public static class ScoreListResultDTO implements Serializable { |
||||
|
/** |
||||
|
* 能力总分 |
||||
|
*/ |
||||
|
private Double indexTotal; |
||||
|
/** |
||||
|
* 本级能力分 |
||||
|
*/ |
||||
|
private Double agencyScore; |
||||
|
/** |
||||
|
* 下级能力分 |
||||
|
*/ |
||||
|
private Double subAgencyScore; |
||||
|
/** |
||||
|
* 横坐标(202009) |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 按月查询各项指标数据--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AblityListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 各项指标名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 指标对应值(数值或百分比) |
||||
|
*/ |
||||
|
private String value = "0"; |
||||
|
/** |
||||
|
* 各项指标对应key值(index_dict字典表) |
||||
|
*/ |
||||
|
private String key; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 按月查询各项指标最近12个月数据--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MonthAblityListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 横坐标(202009) |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
/** |
||||
|
* 指标对应值(数值或百分比) |
||||
|
*/ |
||||
|
private String ablity; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 按月份查询各项能力最近12个月得分--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class MonthScoreListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli |
||||
|
*/ |
||||
|
private String indexCode; |
||||
|
/** |
||||
|
* 每项能力最近12月各项分数对象 |
||||
|
*/ |
||||
|
private List<MonthScoreListResultDTO.ScoreListResultDTO> scoreList; |
||||
|
|
||||
|
@Data |
||||
|
public static class ScoreListResultDTO implements Serializable { |
||||
|
/** |
||||
|
* 能力总分 |
||||
|
*/ |
||||
|
private Double indexTotal; |
||||
|
/** |
||||
|
* 本级能力分 |
||||
|
*/ |
||||
|
private Double agencyScore; |
||||
|
/** |
||||
|
* 下级能力分 |
||||
|
*/ |
||||
|
private Double subAgencyScore; |
||||
|
/** |
||||
|
* 横坐标(202009) |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 同级对比各项数据查询--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PeerComparisonResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
/** |
||||
|
* 能力分值(保留一位小数) |
||||
|
*/ |
||||
|
private Double score; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 是否根组织--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RootAgencyResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 是否根组织(是:true 否:false) |
||||
|
*/ |
||||
|
private Boolean isRoot = true; |
||||
|
|
||||
|
/** |
||||
|
* 数据更新至(上月月末时间) |
||||
|
*/ |
||||
|
private String date; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.evaluationindex.screen.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 按月份查询各项能力分数--接口返参 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ScoreListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 3860268744336541373L; |
||||
|
|
||||
|
/** |
||||
|
* 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) |
||||
|
*/ |
||||
|
private String indexCode; |
||||
|
/** |
||||
|
* 总分(保留一位小数) |
||||
|
*/ |
||||
|
private Double indexTotal; |
||||
|
/** |
||||
|
* 本级分数(保留一位小数) |
||||
|
*/ |
||||
|
private Double agencyScore; |
||||
|
/** |
||||
|
* 下级分数(保留一位小数) |
||||
|
*/ |
||||
|
private Double subAgencyScore; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.datareport.constant; |
||||
|
|
||||
|
/** |
||||
|
* @author sun |
||||
|
* @dscription 数据 |
||||
|
*/ |
||||
|
public interface FactConstant { |
||||
|
/** |
||||
|
* 能力指标 |
||||
|
*/ |
||||
|
String NLZB = "nenglizhibiao"; |
||||
|
/** |
||||
|
* 党建能力 |
||||
|
*/ |
||||
|
String DJNL = "dangjiannengli"; |
||||
|
/** |
||||
|
* 治理能力 |
||||
|
*/ |
||||
|
String ZLNL = "zhilinengli"; |
||||
|
/** |
||||
|
* 服务能力 |
||||
|
*/ |
||||
|
String FWNL = "fuwunengli"; |
||||
|
/** |
||||
|
* 全区相关 |
||||
|
*/ |
||||
|
String QUAN_QU_XIANG_GUAN = "quanquxiangguan"; |
||||
|
/** |
||||
|
* 街道相关 |
||||
|
*/ |
||||
|
String JIE_DAO_XIANG_GUAN = "jiedaoxiangguan"; |
||||
|
/** |
||||
|
* 社区相关 |
||||
|
*/ |
||||
|
String SHE_QU_XIANG_GUAN = "shequxiangguan"; |
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.epmet.datareport.controller.fact; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.datareport.service.fact.FactIndexService; |
||||
|
import com.epmet.evaluationindex.screen.dto.form.*; |
||||
|
import com.epmet.evaluationindex.screen.dto.result.*; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 数据改版api |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("fact") |
||||
|
public class FactIndexController { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactIndexService factIndexService; |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 能力指数 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/ablityindex") |
||||
|
public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<AblityIndexResultDTO>>().ok(factIndexService.ablityIndex(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 按月份查询各项能力分数 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/scorelist") |
||||
|
public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<ScoreListResultDTO>>().ok(factIndexService.scoreList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 按月份查询各项能力最近12个月得分 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/monthscorelist") |
||||
|
public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<MonthScoreListResultDTO>>().ok(factIndexService.monthScoreList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 按月查询各项指标数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/ablitylist") |
||||
|
public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<AblityListResultDTO>>().ok(factIndexService.ablityList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 按月查询各项指标最近12个月数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/monthablitylist") |
||||
|
public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<MonthAblityListResultDTO>>().ok(factIndexService.monthAblityList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 同级对比各项数据查询 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/peercomparison") |
||||
|
public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<List<PeerComparisonResultDTO>>().ok(factIndexService.peerComparison(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDTO |
||||
|
* @Description 是否根组织 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@PostMapping("index/rootagency") |
||||
|
public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); |
||||
|
return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.datareport.dao.fact; |
||||
|
|
||||
|
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; |
||||
|
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; |
||||
|
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; |
||||
|
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.LinkedList; |
||||
|
|
||||
|
/** |
||||
|
* 区/街道相关分数表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-02 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactIndexAgencyScoreDao { |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 分别查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
ScoreListResultDTO selectScore(ScoreListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO); |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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 java.util.LinkedList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 区/街道相关分数表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-02 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactIndexAgencySubScoreDao { |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 查询区县级、乡镇街道级组织某月份某项能力对应的各项指标 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<AblityListResultDTO> selectAblityList(AblityListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 查询区县级、乡镇街道级组织某项能力对应的一项指标过去12个月份数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
LinkedList<MonthAblityListResultDTO> selectMonthAblityList(MonthAblityListFormDTO formDTO); |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.datareport.dao.fact; |
||||
|
|
||||
|
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO; |
||||
|
import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.LinkedList; |
||||
|
|
||||
|
/** |
||||
|
* 社区相关分数表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-02 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactIndexCommunityScoreDao { |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityIndex(AblityIndexFormDTO formDTO); |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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 java.util.LinkedList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 区/街道相关分数表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-02 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactIndexCommunitySubScoreDao { |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 查询社区级组织某一月份某项能力对应的各项指标 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<AblityListResultDTO> selectCommunityAblityList(AblityListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 查询社区级组织某项能力对应的一项指标过去12个月份数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
LinkedList<MonthAblityListResultDTO> selectCommunityMonthAblityList(MonthAblityListFormDTO formDTO); |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.datareport.dao.fact; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 网格相关分值记录表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-02 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactIndexGridSubScoreDao { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,63 @@ |
|||||
|
package com.epmet.datareport.service.fact; |
||||
|
|
||||
|
import com.epmet.evaluationindex.screen.dto.form.*; |
||||
|
import com.epmet.evaluationindex.screen.dto.result.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 数据改版api |
||||
|
* @author sun |
||||
|
*/ |
||||
|
public interface FactIndexService { |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 能力指数 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月份查询各项能力分数 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月份查询各项能力最近12个月得分 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月查询各项指标数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月查询各项指标最近12个月数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<MonthAblityListResultDTO> monthAblityList(MonthAblityListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 同级对比各项数据查询 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 是否根组织 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,277 @@ |
|||||
|
package com.epmet.datareport.service.fact.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.datareport.constant.FactConstant; |
||||
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; |
||||
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; |
||||
|
import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao; |
||||
|
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.evaluationindex.screen.dto.form.*; |
||||
|
import com.epmet.evaluationindex.screen.dto.result.*; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.text.ParseException; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Calendar; |
||||
|
import java.util.LinkedList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 数据改版api |
||||
|
* |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class FactIndexServiceImpl implements FactIndexService { |
||||
|
|
||||
|
@Autowired |
||||
|
private ScreenCustomerAgencyDao screenCustomerAgencyDao; |
||||
|
@Autowired |
||||
|
private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; |
||||
|
@Autowired |
||||
|
private FactIndexAgencyScoreDao factIndexAgencyScoreDao; |
||||
|
@Autowired |
||||
|
private FactIndexAgencySubScoreDao factIndexAgencySubScoreDao; |
||||
|
@Autowired |
||||
|
private FactIndexCommunityScoreDao factIndexCommunityScoreDao; |
||||
|
@Autowired |
||||
|
private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 能力指数 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) { |
||||
|
LinkedList<AblityIndexResultDTO> resultDTO = new LinkedList<>(); |
||||
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null; |
||||
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null; |
||||
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null; |
||||
|
//分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值 fact_index_agency_score 按月份升序
|
||||
|
//1.计算所查月份前12个月的monthId
|
||||
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
||||
|
//2.根据组织Id查询组织信息
|
||||
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); |
||||
|
if (null == agency) { |
||||
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); |
||||
|
} |
||||
|
//1.根据组织级别判断查询哪类数据表
|
||||
|
//区县级、乡镇街道级
|
||||
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
||||
|
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据(不想写union)
|
||||
|
formDTO.setIndexCode(FactConstant.DJNL); |
||||
|
djList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
||||
|
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
||||
|
formDTO.setIndexCode(FactConstant.ZLNL); |
||||
|
zlList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
||||
|
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
||||
|
formDTO.setIndexCode(FactConstant.FWNL); |
||||
|
fwList = factIndexAgencyScoreDao.selectAblityIndex(formDTO); |
||||
|
|
||||
|
//社区级
|
||||
|
} else if ("community".equals(agency.getLevel())) { |
||||
|
//2-1.查询过去12个月党建能力每月总分、本级得分、下级得分数据
|
||||
|
formDTO.setIndexCode(FactConstant.DJNL); |
||||
|
djList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
||||
|
//2-2.查询过去12个月治理能力每月总分、本级得分、下级得分数据
|
||||
|
formDTO.setIndexCode(FactConstant.ZLNL); |
||||
|
zlList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
||||
|
//2-3.查询过去12个月服务能力每月总分、本级得分、下级得分数据
|
||||
|
formDTO.setIndexCode(FactConstant.FWNL); |
||||
|
fwList = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); |
||||
|
|
||||
|
} else { |
||||
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); |
||||
|
} |
||||
|
|
||||
|
//3.遍历计算每个月能力指数
|
||||
|
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>(); |
||||
|
for (int i = 0; i < djList.size(); i++) { |
||||
|
AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); |
||||
|
nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal()); |
||||
|
nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore()); |
||||
|
nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore()); |
||||
|
nldto.setMonthId(djList.get(i).getMonthId()); |
||||
|
nlList.add(nldto); |
||||
|
} |
||||
|
//5.封装数据并返回
|
||||
|
AblityIndexResultDTO nl = new AblityIndexResultDTO(); |
||||
|
nl.setIndexCode(FactConstant.NLZB); |
||||
|
nl.setScoreList(djList); |
||||
|
resultDTO.add(nl); |
||||
|
AblityIndexResultDTO dj = new AblityIndexResultDTO(); |
||||
|
dj.setIndexCode(FactConstant.DJNL); |
||||
|
dj.setScoreList(djList); |
||||
|
resultDTO.add(dj); |
||||
|
AblityIndexResultDTO zl = new AblityIndexResultDTO(); |
||||
|
zl.setIndexCode(FactConstant.ZLNL); |
||||
|
zl.setScoreList(djList); |
||||
|
resultDTO.add(zl); |
||||
|
AblityIndexResultDTO fw = new AblityIndexResultDTO(); |
||||
|
fw.setIndexCode(FactConstant.FWNL); |
||||
|
fw.setScoreList(djList); |
||||
|
resultDTO.add(fw); |
||||
|
|
||||
|
return resultDTO; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月份查询各项能力分数 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) { |
||||
|
//1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
|
||||
|
formDTO.setIndexCode(FactConstant.DJNL); |
||||
|
ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO); |
||||
|
//2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
|
||||
|
//3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
|
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月份查询各项能力最近12个月得分 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月查询各项指标数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) { |
||||
|
List<AblityListResultDTO> resultList = new ArrayList<>(); |
||||
|
//按月份查询当前组织各项指标数据 fact_index_agency_sub_score
|
||||
|
//1.根据组织Id查询组织信息
|
||||
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); |
||||
|
if (null == agency) { |
||||
|
throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); |
||||
|
} |
||||
|
//2.根据组织级别拼接查询条件,判断查询不同数据表
|
||||
|
//区县级、乡镇街道级
|
||||
|
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())) { |
||||
|
formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); |
||||
|
resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); |
||||
|
} else { |
||||
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); |
||||
|
} |
||||
|
//3.调用方法判断各项指标是数字指标还是百分比指标 //TODO
|
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 按月查询各项指标最近12个月数据 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<MonthAblityListResultDTO> monthAblityList(MonthAblityListFormDTO formDTO) { |
||||
|
LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>(); |
||||
|
//1.计算所查月份前12个月的monthId
|
||||
|
formDTO.setStartMonthId(getDate(formDTO.getMonthId())); |
||||
|
//2.根据组织Id查询组织信息
|
||||
|
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); |
||||
|
if (null == agency) { |
||||
|
throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId())); |
||||
|
} |
||||
|
|
||||
|
//3.根据组织级别拼接查询条件,判断查询不同数据表
|
||||
|
//区县级、乡镇街道级
|
||||
|
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { |
||||
|
resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); |
||||
|
|
||||
|
//社区级
|
||||
|
} else if ("community".equals(agency.getLevel())) { |
||||
|
resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); |
||||
|
} else { |
||||
|
throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); |
||||
|
} |
||||
|
//3.调用方法判断各项指标是数字指标还是百分比指标//TODO
|
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param newDate |
||||
|
* @Description 计算monthId对应一年前的monthId |
||||
|
* @author sun |
||||
|
*/ |
||||
|
public String getDate(String newDate) { |
||||
|
String date = ""; |
||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyymm"); |
||||
|
try { |
||||
|
Calendar ds = Calendar.getInstance(); |
||||
|
ds.setTime(sdf.parse(newDate)); |
||||
|
ds.add(Calendar.YEAR, -1); |
||||
|
date = sdf.format(ds.getTime()); |
||||
|
} catch (RenException | ParseException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return date; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 同级对比各项数据查询 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) { |
||||
|
//1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据)
|
||||
|
List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); |
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param formDTO |
||||
|
* @Description 是否根组织 |
||||
|
* @author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { |
||||
|
RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); |
||||
|
//1.根据agencyId查询是否为根级组织
|
||||
|
int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId()); |
||||
|
if (num < NumConstant.ONE) { |
||||
|
resultDTO.setIsRoot(false); |
||||
|
} |
||||
|
//2.计算统计数据更新时间
|
||||
|
SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
Calendar calendar = Calendar.getInstance(); |
||||
|
//获取当前月第一天日期
|
||||
|
calendar.add(Calendar.MONTH, 0); |
||||
|
calendar.set(Calendar.DAY_OF_MONTH, 1); |
||||
|
//获取上月最后一天日期
|
||||
|
calendar.set(Calendar.HOUR, -24); |
||||
|
resultDTO.setDate(d.format(calendar.getTime())); |
||||
|
|
||||
|
return resultDTO; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao"> |
||||
|
|
||||
|
<select id="selectScore" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO"> |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
<select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO"> |
||||
|
SELECT |
||||
|
fact.month_id AS "monthId", |
||||
|
ROUND(fact.score * fact.weight, 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 = #{agencyId} |
||||
|
AND fact.month_id > #{startMonthId} |
||||
|
AND fact.month_id <= #{monthId} |
||||
|
AND fact.index_code = #{indexCode} |
||||
|
ORDER BY |
||||
|
fact.month_id ASC |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,42 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao"> |
||||
|
|
||||
|
<select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO"> |
||||
|
SELECT |
||||
|
fact.index_code AS "key", |
||||
|
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", |
||||
|
dict.index_name AS "name" |
||||
|
FROM |
||||
|
fact_index_agency_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 agency_id = #{agencyId} |
||||
|
AND month_id = #{monthId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO"> |
||||
|
SELECT |
||||
|
fact.month_id AS "monthId", |
||||
|
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity" |
||||
|
FROM |
||||
|
fact_index_agency_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 agency_id = #{agencyId} |
||||
|
AND month_id <= #{monthId} |
||||
|
AND month_id > #{startMonthId} |
||||
|
AND fact.index_code = #{key} |
||||
|
ORDER BY |
||||
|
fact.month_id ASC |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,29 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao"> |
||||
|
|
||||
|
<select id="selectCommunityAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO"> |
||||
|
SELECT |
||||
|
fact.month_id AS "monthId", |
||||
|
ROUND(fact.score * fact.weight, 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 = #{agencyId} |
||||
|
AND fact.month_id > #{startMonthId} |
||||
|
AND fact.month_id <= #{monthId} |
||||
|
AND fact.index_code = #{indexCode} |
||||
|
ORDER BY |
||||
|
fact.month_id ASC |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,42 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao"> |
||||
|
|
||||
|
<select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO"> |
||||
|
SELECT |
||||
|
fact.index_code AS "key", |
||||
|
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", |
||||
|
dict.index_name AS "name" |
||||
|
FROM |
||||
|
fact_index_community_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 agency_id = #{agencyId} |
||||
|
AND month_id = #{monthId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO"> |
||||
|
SELECT |
||||
|
fact.month_id AS "monthId", |
||||
|
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity" |
||||
|
FROM |
||||
|
fact_index_community_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 agency_id = #{agencyId} |
||||
|
AND month_id <= #{monthId} |
||||
|
AND month_id > #{startMonthId} |
||||
|
AND fact.index_code = #{key} |
||||
|
ORDER BY |
||||
|
fact.month_id ASC |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,7 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridScoreDao"> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,7 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao"> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,132 @@ |
|||||
|
package com.epmet.dto.extract.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/22 3:19 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PartyBaseInfoFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1685776533893300943L; |
||||
|
|
||||
|
/** |
||||
|
* ID 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织类别 agency:组织;部门:department;网格:grid |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id 可以为网格,机关id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 上级组织Id |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
|
||||
|
/** |
||||
|
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) |
||||
|
*/ |
||||
|
private String dataEndTime; |
||||
|
|
||||
|
/** |
||||
|
* 注册用户数 |
||||
|
*/ |
||||
|
private Integer registerUserCount; |
||||
|
|
||||
|
/** |
||||
|
* 群众用户数 |
||||
|
*/ |
||||
|
private Integer resiTotal; |
||||
|
|
||||
|
/** |
||||
|
* 注册党员数 |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 小于20岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel1; |
||||
|
|
||||
|
/** |
||||
|
* 20-30岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel2; |
||||
|
|
||||
|
/** |
||||
|
* 31-40岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel3; |
||||
|
|
||||
|
/** |
||||
|
* 41-50岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel4; |
||||
|
|
||||
|
/** |
||||
|
* 51-60岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel5; |
||||
|
|
||||
|
/** |
||||
|
* 60+岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel6; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除;1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
public PartyBaseInfoFormDTO() { |
||||
|
this.registerUserCount = NumConstant.ZERO; |
||||
|
this.resiTotal = NumConstant.ZERO; |
||||
|
this.partyMemberCount = NumConstant.ZERO; |
||||
|
this.ageLevel1 = NumConstant.ZERO; |
||||
|
this.ageLevel2 = NumConstant.ZERO; |
||||
|
this.ageLevel3 = NumConstant.ZERO; |
||||
|
this.ageLevel4 = NumConstant.ZERO; |
||||
|
this.ageLevel5 = NumConstant.ZERO; |
||||
|
this.ageLevel6 = NumConstant.ZERO; |
||||
|
this.delFlag = NumConstant.ZERO_STR; |
||||
|
this.revision = NumConstant.ZERO; |
||||
|
this.createdBy = "APP_USER"; |
||||
|
this.updatedBy = "APP_USER"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/22 4:21 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerAgencyInfoResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -584952326059903779L; |
||||
|
|
||||
|
/** |
||||
|
* 机关ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 机关名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 机关父级ID |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 机关级别 |
||||
|
*/ |
||||
|
private String level; |
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/23 1:58 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PartyInfoResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -5275089831499409888L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织类别 agency:组织;部门:department;网格:grid |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id 可以为网格,机关id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 上级组织Id |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
|
||||
|
/** |
||||
|
* 注册用户数 |
||||
|
*/ |
||||
|
private Integer registerUserCount; |
||||
|
|
||||
|
/** |
||||
|
* 群众用户数 |
||||
|
*/ |
||||
|
private Integer resiTotal; |
||||
|
|
||||
|
/** |
||||
|
* 注册党员数 |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 小于20岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel1; |
||||
|
|
||||
|
/** |
||||
|
* 20-30岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel2; |
||||
|
|
||||
|
/** |
||||
|
* 31-40岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel3; |
||||
|
|
||||
|
/** |
||||
|
* 41-50岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel4; |
||||
|
|
||||
|
/** |
||||
|
* 51-60岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel5; |
||||
|
|
||||
|
/** |
||||
|
* 60+岁的党员总人数 |
||||
|
*/ |
||||
|
private Integer ageLevel6; |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/22 5:23 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PartyMemberInfoResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 6591845785373556485L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 机关ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 父级ID |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 生日 |
||||
|
*/ |
||||
|
private Date birthday; |
||||
|
|
||||
|
/** |
||||
|
* 年龄 |
||||
|
*/ |
||||
|
private Integer age; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 机关名称 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/23 9:54 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -6349371693110337172L; |
||||
|
|
||||
|
/** |
||||
|
* 群众用户数 |
||||
|
*/ |
||||
|
private Integer resiTotal; |
||||
|
|
||||
|
/** |
||||
|
* 注册用户数 |
||||
|
*/ |
||||
|
private Integer registerUserCount; |
||||
|
|
||||
|
/** |
||||
|
* 注册党员数 |
||||
|
*/ |
||||
|
private Integer partyMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID / 机关ID |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao.evaluationindex.indexcal; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 网格相关自身/下级分值记录表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-21 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GridSelfSubScoreDao extends BaseDao<GridSelfSubScoreEntity> { |
||||
|
|
||||
|
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); |
||||
|
|
||||
|
int insertBatch(@Param("list") List<GridSelfSubScoreEntity> list); |
||||
|
} |
||||
@ -1,100 +0,0 @@ |
|||||
/** |
|
||||
* Copyright 2018 人人开源 https://www.renren.io
|
|
||||
* <p> |
|
||||
* This program is free software: you can redistribute it and/or modify |
|
||||
* it under the terms of the GNU General Public License as published by |
|
||||
* the Free Software Foundation, either version 3 of the License, or |
|
||||
* (at your option) any later version. |
|
||||
* <p> |
|
||||
* This program is distributed in the hope that it will be useful, |
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
* GNU General Public License for more details. |
|
||||
* <p> |
|
||||
* You should have received a copy of the GNU General Public License |
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||
*/ |
|
||||
|
|
||||
package com.epmet.entity.evaluationindex.indexcal; |
|
||||
|
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
|
|
||||
import java.math.BigDecimal; |
|
||||
|
|
||||
/** |
|
||||
* 网格相关自身/下级分值记录表 |
|
||||
* |
|
||||
* @author generator generator@elink-cn.com |
|
||||
* @since v1.0.0 2020-09-21 |
|
||||
*/ |
|
||||
@Data |
|
||||
@EqualsAndHashCode(callSuper = false) |
|
||||
@TableName("fact_index_grid_self_sub_score") |
|
||||
public class FactIndexGridSelfSubScoreEntity extends BaseEpmetEntity { |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** |
|
||||
* 客户Id |
|
||||
*/ |
|
||||
private String customerId; |
|
||||
|
|
||||
/** |
|
||||
* 网格Id |
|
||||
*/ |
|
||||
private String gridId; |
|
||||
|
|
||||
/** |
|
||||
* 网格所属的机关Id |
|
||||
*/ |
|
||||
private String agencyId; |
|
||||
|
|
||||
/** |
|
||||
* 所有上级ID,用英文逗号分开 |
|
||||
*/ |
|
||||
private String allParentIds; |
|
||||
|
|
||||
/** |
|
||||
* 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 |
|
||||
*/ |
|
||||
private String quarterId; |
|
||||
|
|
||||
/** |
|
||||
* 年度ID: yyyy |
|
||||
*/ |
|
||||
private String yearId; |
|
||||
|
|
||||
/** |
|
||||
* 月维度Id: yyyyMM |
|
||||
*/ |
|
||||
private String monthId; |
|
||||
|
|
||||
/** |
|
||||
* 分数类型,self:自身得分;sub:下级得分 |
|
||||
*/ |
|
||||
private String scoreType; |
|
||||
|
|
||||
/** |
|
||||
* 分值 |
|
||||
*/ |
|
||||
private BigDecimal score; |
|
||||
|
|
||||
/** |
|
||||
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan |
|
||||
*/ |
|
||||
private String indexCode; |
|
||||
|
|
||||
/** |
|
||||
* 所有指标code拼接的字符串 冒号隔开 |
|
||||
*/ |
|
||||
private String allParentIndexCode; |
|
||||
|
|
||||
/** |
|
||||
* 权重 |
|
||||
*/ |
|
||||
private BigDecimal weight; |
|
||||
|
|
||||
} |
|
||||
@ -0,0 +1,105 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity.evaluationindex.indexcal; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 网格相关自身/下级分值记录表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@TableName("fact_index_grid_self_sub_score") |
||||
|
public class GridSelfSubScoreEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格所属的机关Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级ID,用英文逗号分开 |
||||
|
*/ |
||||
|
private String allParentIds; |
||||
|
|
||||
|
/** |
||||
|
* 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年度ID: yyyy |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 月维度Id: yyyyMM |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 自身指标得分 |
||||
|
*/ |
||||
|
private BigDecimal selfScore; |
||||
|
|
||||
|
/** |
||||
|
* 下级指标得分 |
||||
|
*/ |
||||
|
private BigDecimal subScore; |
||||
|
|
||||
|
/** |
||||
|
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; |
||||
|
*/ |
||||
|
private String parentIndexCode; |
||||
|
|
||||
|
/** |
||||
|
* 所有指标code拼接的字符串 冒号隔开 |
||||
|
*/ |
||||
|
private String allParentIndexCode; |
||||
|
|
||||
|
/** |
||||
|
* 自身指标权重 |
||||
|
*/ |
||||
|
private BigDecimal selfWeight; |
||||
|
|
||||
|
/** |
||||
|
* 下级指标权重 |
||||
|
*/ |
||||
|
private BigDecimal subWeight; |
||||
|
|
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue