Browse Source
# Conflicts: # epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java # epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xmldev_shibei_match
597 changed files with 34469 additions and 1571 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,21 @@ |
|||
package com.epmet.commons.tools.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/15 5:41 下午 |
|||
*/ |
|||
@Data |
|||
public class TimeListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1482639109300981626L; |
|||
|
|||
private String dateId; |
|||
private String weekId; |
|||
private String monthId; |
|||
private String quarterId; |
|||
private String yearId; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.epmet.auth; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
|||
import org.springframework.core.io.buffer.DataBuffer; |
|||
import org.springframework.http.HttpStatus; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.server.ServerWebExchange; |
|||
import reactor.core.publisher.Flux; |
|||
import reactor.core.publisher.Mono; |
|||
|
|||
import java.nio.charset.StandardCharsets; |
|||
|
|||
public abstract class AuthProcessor { |
|||
|
|||
abstract Mono<Void> auth(ServerWebExchange exchange, GatewayFilterChain chain); |
|||
|
|||
protected Mono<Void> response(ServerWebExchange exchange, Object object) { |
|||
String json = JSON.toJSONString(object); |
|||
DataBuffer buffer = exchange.getResponse().bufferFactory().wrap(json.getBytes(StandardCharsets.UTF_8)); |
|||
exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON_UTF8); |
|||
exchange.getResponse().setStatusCode(HttpStatus.OK); |
|||
return exchange.getResponse().writeWith(Flux.just(buffer)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.auth; |
|||
|
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.web.server.ServerWebExchange; |
|||
|
|||
|
|||
/** |
|||
* 外部应用认证处理器父类 |
|||
*/ |
|||
public abstract class ExtAppAuthProcessor { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
private int diffMillins = 1000 * 60 * 5; |
|||
|
|||
public abstract void auth(String appId, String token, Long ts, ServerWebExchange exchange); |
|||
|
|||
/** |
|||
* 时间戳校验 |
|||
* @param timestamp |
|||
* @return |
|||
*/ |
|||
protected boolean validTimeStamp(Long timestamp) { |
|||
long now = System.currentTimeMillis(); |
|||
if (Math.abs(now - timestamp) > diffMillins) { |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,92 @@ |
|||
package com.epmet.auth; |
|||
|
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.redis.RedisKeys; |
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|||
import com.epmet.jwt.JwtTokenUtils; |
|||
import io.jsonwebtoken.Claims; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.server.ServerWebExchange; |
|||
|
|||
/** |
|||
* jwt 认证处理器 |
|||
*/ |
|||
@Component |
|||
public class ExtAppJwtAuthProcessor extends ExtAppAuthProcessor { |
|||
|
|||
private static Logger logger = LoggerFactory.getLogger(ExtAppJwtAuthProcessor.class); |
|||
|
|||
@Autowired |
|||
private JwtTokenUtils jwtTokenUtils; |
|||
|
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
@Override |
|||
public void auth(String appId, String token, Long ts, ServerWebExchange exchange) { |
|||
String secret; |
|||
if (StringUtils.isBlank(secret = getTokenFromCache(appId))) { |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), String.format("根据AppId:【%s】没有找到对应的秘钥", appId)); |
|||
} |
|||
|
|||
Claims claim; |
|||
try { |
|||
claim = jwtTokenUtils.getClaimByToken(token, secret); |
|||
} catch (Exception e) { |
|||
String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); |
|||
logger.error("解析token失败:{}", errorStackTrace); |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "解析token失败"); |
|||
} |
|||
|
|||
String appIdIn = (String)claim.get("appId"); |
|||
String customerId = (String)claim.get("customerId"); |
|||
Long timestamp = (Long)claim.get("ts"); |
|||
|
|||
//校验时间戳,允许5分钟误差
|
|||
if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) { |
|||
logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp); |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken不完整"); |
|||
} |
|||
|
|||
if (!validTimeStamp(timestamp)) { |
|||
logger.error("extapp token已经超时,请求被拒绝"); |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken已经超时"); |
|||
} |
|||
|
|||
if (!appId.equals(appIdIn)) { |
|||
logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AppId不匹配"); |
|||
} |
|||
|
|||
// 添加客户ID等到请求头
|
|||
exchange.getRequest().mutate().header("CustomerId", customerId); |
|||
} |
|||
|
|||
/** |
|||
* 通过APP ID查询对应的秘钥 |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public String getTokenFromCache(String appId) { |
|||
String secret = (String)redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); |
|||
if (StringUtils.isBlank(secret)) { |
|||
EpmetCommonServiceOpenFeignClient commonService = SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class); |
|||
Result<String> result = commonService.getSecret(appId); |
|||
if (!result.success()) { |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), result.getInternalMsg()); |
|||
} |
|||
secret = result.getData(); |
|||
redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); |
|||
} |
|||
return secret; |
|||
} |
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.epmet.auth; |
|||
|
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.redis.RedisKeys; |
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import com.epmet.commons.tools.utils.Md5Util; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.server.ServerWebExchange; |
|||
|
|||
/** |
|||
* md5 认证处理器 |
|||
*/ |
|||
@Component |
|||
public class ExtAppMD5AuthProcessor extends ExtAppAuthProcessor { |
|||
|
|||
private static Logger logger = LoggerFactory.getLogger(ExtAppMD5AuthProcessor.class); |
|||
|
|||
//@Autowired
|
|||
//private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
|
|||
|
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
@Override |
|||
public void auth(String appId, String token, Long ts, ServerWebExchange exchange) { |
|||
if (ts == null) { |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "需要传入时间戳参数"); |
|||
} |
|||
String secret; |
|||
if (StringUtils.isBlank(secret = getTokenFromCache(appId))) { |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), String.format("根据AppId:%s没有找到对应的秘钥", appId)); |
|||
} |
|||
|
|||
String localDigest = Md5Util.md5(secret.concat(":") + ts); |
|||
if (!localDigest.equals(token)) { |
|||
// 调用方生成的摘要跟本地生成的摘要不匹配
|
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "签名不匹配,认证失败"); |
|||
} |
|||
|
|||
if (!validTimeStamp(ts)) { |
|||
logger.error("AccessToken已经超时,请求被拒绝"); |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "AccessToken已经超时,请求被拒绝"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 通过APP ID查询对应的秘钥 |
|||
* |
|||
* @param appId |
|||
* @return |
|||
*/ |
|||
public String getTokenFromCache(String appId) { |
|||
String secret = (String) redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); |
|||
if (StringUtils.isBlank(secret)) { |
|||
EpmetCommonServiceOpenFeignClient commonService = SpringContextUtils.getBean(EpmetCommonServiceOpenFeignClient.class); |
|||
Result<String> result = commonService.getSecret(appId); |
|||
if (!result.success()) { |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), result.getInternalMsg()); |
|||
} |
|||
|
|||
secret = result.getData(); |
|||
redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); |
|||
} |
|||
return secret; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.epmet.auth; |
|||
|
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
|||
import org.springframework.http.HttpHeaders; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.server.ServerWebExchange; |
|||
import reactor.core.publisher.Mono; |
|||
|
|||
/** |
|||
* 外部应用认证 |
|||
*/ |
|||
@Component |
|||
public class ExternalAuthProcessor extends AuthProcessor { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
// 头s
|
|||
public static final String AUTHORIZATION_TOKEN_HEADER_KEY = "Authorization"; |
|||
public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; |
|||
public static final String APP_ID_HEADER_KEY = "appId"; |
|||
public static final String APP_ID_TIMESTAMP_KEY = "ts"; |
|||
public static final String APP_ID_CUSTOMER_ID_KEY = "CustomerId"; |
|||
public static final String APP_ID_AUTY_TYPE_KEY = "AuthType"; |
|||
|
|||
// 认证方式
|
|||
public static final String APP_AUTH_TYPE_JWT = "jwt"; |
|||
public static final String APP_AUTH_TYPE_MD5 = "md5"; |
|||
|
|||
|
|||
@Autowired |
|||
private ExtAppJwtAuthProcessor jwtAuthProcessor; |
|||
|
|||
@Autowired |
|||
private ExtAppMD5AuthProcessor md5AuthProcessor; |
|||
|
|||
@Override |
|||
public Mono<Void> auth(ServerWebExchange exchange, GatewayFilterChain chain) { |
|||
HttpHeaders headers = exchange.getRequest().getHeaders(); |
|||
|
|||
String token = headers.getFirst(ACCESS_TOKEN_HEADER_KEY); |
|||
String appId = headers.getFirst(APP_ID_HEADER_KEY); |
|||
String ts = headers.getFirst(APP_ID_TIMESTAMP_KEY); |
|||
String customerId = headers.getFirst(APP_ID_CUSTOMER_ID_KEY); |
|||
String authType = headers.getFirst(APP_ID_AUTY_TYPE_KEY); |
|||
|
|||
if (StringUtils.isAnyBlank(token, appId)) { |
|||
throw new RenException("请求头中的AccessToken和AppId不能为空"); |
|||
} |
|||
|
|||
logger.info("外部应用请求认证拦截Aspect执行,appId:{}, token:{}, ts:{}, customerId:{}, authType:{}", |
|||
appId, token, ts, customerId, authType); |
|||
|
|||
// 没传authType或者传的jwt都用jwtprocessor处理
|
|||
try { |
|||
if (StringUtils.isBlank(authType) || APP_AUTH_TYPE_JWT.equals(authType)) { |
|||
jwtAuthProcessor.auth(appId, token, StringUtils.isNotBlank(ts) ? new Long(ts) : null, exchange); |
|||
} else if (APP_AUTH_TYPE_MD5.equals(authType)) { |
|||
md5AuthProcessor.auth(appId, token, StringUtils.isNotBlank(ts) ? new Long(ts) : null, exchange); |
|||
} else { |
|||
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), "未知的认证类型"); |
|||
} |
|||
} catch (RenException e) { |
|||
return response(exchange, new Result<>().error(e.getCode(), e.getMsg())); |
|||
} catch (Exception e) { |
|||
logger.error("外部应用请求认证发生未知错误:" + ExceptionUtils.getErrorStackTrace(e)); |
|||
return response(exchange, new Result<>().error("外部应用请求认证发生未知错误")); |
|||
} |
|||
|
|||
return chain.filter(exchange); |
|||
} |
|||
} |
@ -0,0 +1,175 @@ |
|||
package com.epmet.auth; |
|||
|
|||
import com.epmet.commons.tools.constant.AppClientConstant; |
|||
import com.epmet.commons.tools.constant.Constant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.security.dto.BaseTokenDto; |
|||
import com.epmet.commons.tools.security.dto.GovTokenDto; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.jwt.JwtTokenUtils; |
|||
import io.jsonwebtoken.Claims; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
|||
import org.springframework.http.HttpHeaders; |
|||
import org.springframework.http.server.reactive.ServerHttpRequest; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.server.ServerWebExchange; |
|||
import reactor.core.publisher.Mono; |
|||
|
|||
/** |
|||
* 内部认证处理器 |
|||
*/ |
|||
@Component |
|||
public class InternalAuthProcessor extends AuthProcessor { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private JwtTokenUtils jwtTokenUtils; |
|||
|
|||
@Autowired |
|||
private CpUserDetailRedis cpUserDetailRedis; |
|||
|
|||
@Override |
|||
public Mono<Void> auth(ServerWebExchange exchange, GatewayFilterChain chain) { |
|||
ServerHttpRequest request = exchange.getRequest(); |
|||
String requestUri = request.getPath().pathWithinApplication().value(); |
|||
|
|||
logger.info("CpAuthGatewayFilterFactory当前requestUri=[" + requestUri + "]CpAuthGatewayFilterFactory拦截成功"); |
|||
String token = getTokenFromRequest(request); |
|||
//BaseTokenDto baseTokenDto = StringUtils.isNotBlank(token) ? getBaseTokenDto(token, jwtTokenUtils) : null;
|
|||
BaseTokenDto baseTokenDto; |
|||
if(StringUtils.isNotBlank(token)){ |
|||
try{ |
|||
baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); |
|||
}catch(RenException e){ |
|||
return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); |
|||
} |
|||
}else{ |
|||
baseTokenDto = null; |
|||
} |
|||
|
|||
String customerId = ""; |
|||
|
|||
if (baseTokenDto != null) { |
|||
if (AppClientConstant.APP_RESI.equals(baseTokenDto.getApp())) { |
|||
// 居民端
|
|||
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, TokenDto.class); |
|||
if (resiTokenDto != null) { |
|||
customerId = resiTokenDto.getCustomerId(); |
|||
baseTokenDto = resiTokenDto; |
|||
} |
|||
} else if (AppClientConstant.APP_GOV.equals(baseTokenDto.getApp())) { |
|||
// 政府端
|
|||
GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, GovTokenDto.class); |
|||
if (govTokenDto != null) { |
|||
customerId = govTokenDto.getCustomerId(); |
|||
baseTokenDto = govTokenDto; |
|||
} |
|||
} else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){ |
|||
//运营端
|
|||
TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, TokenDto.class); |
|||
if (resiTokenDto != null) { |
|||
customerId = resiTokenDto.getCustomerId(); |
|||
baseTokenDto = resiTokenDto; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 校验token
|
|||
if (StringUtils.isBlank(token)) { |
|||
return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg())); |
|||
} |
|||
try { |
|||
validateTokenDto(baseTokenDto, token); |
|||
} catch (RenException e) { |
|||
return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); |
|||
} |
|||
|
|||
// 添加header
|
|||
if (baseTokenDto != null) { |
|||
String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId(); |
|||
logger.info("redisKey=" + redisKey); |
|||
exchange.getRequest().mutate() |
|||
.header(Constant.APP_USER_KEY, redisKey) |
|||
.header(AppClientConstant.APP,baseTokenDto.getApp()) |
|||
.header(AppClientConstant.CLIENT,baseTokenDto.getClient()) |
|||
.header(AppClientConstant.USER_ID,baseTokenDto.getUserId()); |
|||
|
|||
if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端
|
|||
if(StringUtils.isNotBlank(customerId)){ |
|||
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); |
|||
} |
|||
} else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端
|
|||
exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); |
|||
} |
|||
ServerHttpRequest build = exchange.getRequest().mutate().build(); |
|||
return chain.filter(exchange.mutate().request(build).build()); |
|||
} |
|||
|
|||
return chain.filter(exchange); |
|||
} |
|||
|
|||
/** |
|||
* 从请求中获取token |
|||
* @param request |
|||
* @return |
|||
*/ |
|||
private String getTokenFromRequest(ServerHttpRequest request) { |
|||
HttpHeaders headers = request.getHeaders(); |
|||
String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); |
|||
if (StringUtils.isBlank(token)) { |
|||
token = headers.getFirst(Constant.TOKEN_HEADER); |
|||
} |
|||
if (StringUtils.isBlank(token)) { |
|||
token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); |
|||
} |
|||
return token; |
|||
} |
|||
|
|||
private BaseTokenDto getBaseTokenDto(String token, JwtTokenUtils jwtTokenUtils) { |
|||
//是否过期
|
|||
Claims claims = jwtTokenUtils.getClaimByToken(token); |
|||
if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) { |
|||
return null; |
|||
} |
|||
//获取用户ID
|
|||
String app = (String) claims.get("app"); |
|||
String client = (String) claims.get("client"); |
|||
String userId = (String) claims.get("userId"); |
|||
return new BaseTokenDto(app, client, userId, token); |
|||
} |
|||
|
|||
private <T> T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, Class<T> clz) { |
|||
BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); |
|||
//查询Redis
|
|||
return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz); |
|||
} |
|||
|
|||
/** |
|||
* 校验Token是否异常 |
|||
* @param tokenDto |
|||
* @param tokenStr |
|||
*/ |
|||
private void validateTokenDto(BaseTokenDto tokenDto, String tokenStr) { |
|||
if (null == tokenDto) { |
|||
//说明登录状态时效(超时)
|
|||
throw new RenException(EpmetErrorCode.ERR10006.getCode()); |
|||
}else{ |
|||
//Redis中存在数据,取出token,进行比对
|
|||
if(StringUtils.equals(tokenDto.getToken(),tokenStr)){ |
|||
//用户携带token与Redis中一致
|
|||
|
|||
}else{ |
|||
//用户携带token与Redis中不一致,说明当前用户此次会话失效,提示重新登陆
|
|||
throw new RenException(EpmetErrorCode.ERR10007.getCode()); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,35 +0,0 @@ |
|||
package com.epmet.filter; |
|||
|
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.security.dto.BaseTokenDto; |
|||
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
|||
import com.epmet.jwt.JwtTokenUtils; |
|||
import io.jsonwebtoken.Claims; |
|||
|
|||
/** |
|||
* 用户token的过滤器接口,提供通用的默认方法 |
|||
*/ |
|||
public interface UserTokenFilter { |
|||
|
|||
default BaseTokenDto getBaseTokenDto(String token, JwtTokenUtils jwtTokenUtils) { |
|||
//是否过期
|
|||
Claims claims = jwtTokenUtils.getClaimByToken(token); |
|||
if (claims == null || jwtTokenUtils.isTokenExpired(claims.getExpiration())) { |
|||
// throw new RenException(EpmetErrorCode.ERR401.getCode());
|
|||
return null; |
|||
} |
|||
//获取用户ID
|
|||
String app = (String) claims.get("app"); |
|||
String client = (String) claims.get("client"); |
|||
String userId = (String) claims.get("userId"); |
|||
return new BaseTokenDto(app, client, userId, token); |
|||
} |
|||
|
|||
default <T> T getLoginUserInfoByToken(String token, JwtTokenUtils jwtTokenUtils, CpUserDetailRedis cpUserDetailRedis, Class<T> clz) { |
|||
BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); |
|||
//查询Redis
|
|||
return cpUserDetailRedis.get(baseTokenDto.getApp(), baseTokenDto.getClient(), baseTokenDto.getUserId(), clz); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
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 AdvancedBranchRankFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -8674763412362557239L; |
|||
/** |
|||
* 机关Id |
|||
* */ |
|||
@NotBlank(message = "机关Id不能为空" , groups = AdvancedBranchRankFormDTO.AddUserInternalGroup.class) |
|||
private String agencyId; |
|||
/** |
|||
* 显示多少条 |
|||
* */ |
|||
@Min(value = 1, message = "查询条数必须大于0", groups = {AdvancedBranchRankFormDTO.AddUserInternalGroup.class }) |
|||
private Integer topNum; |
|||
/** |
|||
* 月份Id |
|||
* */ |
|||
private String monthId; |
|||
public interface AddUserInternalGroup {} |
|||
} |
@ -0,0 +1,36 @@ |
|||
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 IndexScoreFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -2880432640584616651L; |
|||
/** |
|||
* 组织或网格Id |
|||
*/ |
|||
@NotBlank(message = "组织或网格ID不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class}) |
|||
private String orgId; |
|||
/** |
|||
* 类型(组织:agency 网格:grid) |
|||
* 大屏接口此字段值为空 |
|||
*/ |
|||
//@NotBlank(message = "数据类型不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class})
|
|||
private String orgType; |
|||
/** |
|||
* 月份Id eg:202009 |
|||
* 大屏接口此字段值为空 |
|||
*/ |
|||
//@NotBlank(message = "月份Id不能为空",groups = {IndexScoreFormDTO.AddUserInternalGroup.class})
|
|||
private String monthId; |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
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 PartIndexScroeRankFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -2880432640584616651L; |
|||
/** |
|||
* 组织或网格Id |
|||
*/ |
|||
@NotBlank(message = "组织或网格ID不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) |
|||
private String orgId; |
|||
/** |
|||
* 类型(组织:agency 网格:grid) |
|||
*/ |
|||
@NotBlank(message = "数据类型不能为空",groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class}) |
|||
private String orgType; |
|||
/** |
|||
* 默认显示前5名 |
|||
*/ |
|||
@Min(value = 1, message = "查询条数必须大于0", groups = {PartIndexScroeRankFormDTO.AddUserInternalGroup.class }) |
|||
private Integer topNum; |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
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 UserPointRankFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -2880432640584616651L; |
|||
/** |
|||
* 组织或网格Id |
|||
*/ |
|||
@NotBlank(message = "组织或网格ID不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) |
|||
private String orgId; |
|||
/** |
|||
* 类型(组织:agency 网格:grid) |
|||
*/ |
|||
@NotBlank(message = "数据类型不能为空",groups = {UserPointRankFormDTO.AddUserInternalGroup.class}) |
|||
private String orgType; |
|||
/** |
|||
* 默认显示前5名 |
|||
*/ |
|||
@Min(value = 1, message = "查询条数必须大于0", groups = {UserPointRankFormDTO.AddUserInternalGroup.class }) |
|||
private Integer topNum; |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.epmet.evaluationindex.screen.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 先进排行-先进支部排行--接口返参 |
|||
* |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IndexAdvanceBranchRankResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 330099297596334388L; |
|||
|
|||
/** |
|||
* 名称 XXXX社区党委 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 指标得分 |
|||
*/ |
|||
@JsonIgnore |
|||
private String totalScore; |
|||
private BigDecimal scroe; |
|||
/** |
|||
* 党员数 |
|||
*/ |
|||
private Integer partyMemberNum; |
|||
|
|||
/** |
|||
* 议题数 |
|||
*/ |
|||
private Integer issueNum; |
|||
|
|||
/** |
|||
* 项目数 |
|||
*/ |
|||
private Integer projectNum; |
|||
|
|||
/** |
|||
* 满意度 90.64% 返回字符串,前端直接显示 |
|||
*/ |
|||
private String satisfactionRatio; |
|||
|
|||
/** |
|||
* 结案率 94.3% 返回字符串,前端直接显示 |
|||
*/ |
|||
private String closedProjectRatio; |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.evaluationindex.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 评价指标字典表数据--接口返参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IndexDictResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3860268744336541373L; |
|||
|
|||
/** |
|||
* 指标名 |
|||
*/ |
|||
private String indexName; |
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
/** |
|||
* 指标值类型 百分比:percent |
|||
*/ |
|||
private String valueType; |
|||
|
|||
} |
@ -0,0 +1,55 @@ |
|||
package com.epmet.evaluationindex.screen.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 组织月度指数得分--接口返参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IndexScoreResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3860268744336541373L; |
|||
|
|||
/** |
|||
* 年度平均指数(保留一位小数) |
|||
*/ |
|||
@JsonIgnore |
|||
private String total; |
|||
private BigDecimal totalScore; |
|||
/** |
|||
* 党建能力(保留一位小数) |
|||
*/ |
|||
@JsonIgnore |
|||
private String party; |
|||
private BigDecimal partyDevAbility; |
|||
/** |
|||
* 党建能力权重(保留一位小数) |
|||
*/ |
|||
private String partyDevAbilityWeight; |
|||
/** |
|||
* 治理能力(保留一位小数) |
|||
*/ |
|||
@JsonIgnore |
|||
private String govern; |
|||
private BigDecimal governAbility; |
|||
/** |
|||
* 治理能力权重(保留一位小数) |
|||
*/ |
|||
private String governAbilityWeight; |
|||
/** |
|||
* 服务能力(保留一位小数) |
|||
*/ |
|||
@JsonIgnore |
|||
private String service; |
|||
private BigDecimal serviceAbility; |
|||
/** |
|||
* 服务能力权重(保留一位小数) |
|||
*/ |
|||
private String serviceAbilityWeight; |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.epmet.evaluationindex.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 党员(指标得分)排行--接口返参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class PartIndexScroeRankResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3860268744336541373L; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName; |
|||
/** |
|||
* 用户Id |
|||
*/ |
|||
private String userId; |
|||
/** |
|||
* 用户名称 |
|||
*/ |
|||
private String userName; |
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
/** |
|||
* 党员指标得分 |
|||
*/ |
|||
private Double indexScore; |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.epmet.evaluationindex.screen.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 热心市民积分排行列表--接口返参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class UserPointRankListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3860268744336541373L; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName; |
|||
/** |
|||
* 用户Id |
|||
*/ |
|||
private String userId; |
|||
/** |
|||
* 用户名称 |
|||
*/ |
|||
private String userName; |
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
/** |
|||
* 用户积分 |
|||
*/ |
|||
private Integer pointTotal; |
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
package com.epmet.datareport.controller.screen; |
|||
|
|||
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.evaluationindex.screen.ScreenUserService; |
|||
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; |
|||
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("/screen/user") |
|||
public class ScreenUserController { |
|||
|
|||
@Autowired |
|||
private ScreenUserService screenUserService; |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 热心市民积分排行列表 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("userpointrank") |
|||
public Result<List<UserPointRankListResultDTO>> userPointRank(@RequestBody UserPointRankFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); |
|||
return new Result<List<UserPointRankListResultDTO>>().ok(screenUserService.userPointRank(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 党员(指标得分)排行 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("partindexscroerank") |
|||
public Result<List<PartIndexScroeRankResultDTO>> partIndexScroeRank(@RequestBody PartIndexScroeRankFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); |
|||
return new Result<List<PartIndexScroeRankResultDTO>>().ok(screenUserService.partIndexScroeRank(formDTO)); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,60 @@ |
|||
/** |
|||
* 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.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 java.util.LinkedList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 社区相关分数表 |
|||
* |
|||
* @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); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 查询社区级组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 |
|||
* @author sun |
|||
*/ |
|||
List<ScoreListResultDTO> selectCommunityScoreList(ScoreListFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 |
|||
* @author sun |
|||
*/ |
|||
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO); |
|||
} |
@ -0,0 +1,60 @@ |
|||
/** |
|||
* 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.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 java.util.LinkedList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 网格相关分值记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface FactIndexGridScoreDao { |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 |
|||
* @author sun |
|||
*/ |
|||
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectGridAblityIndex(AblityIndexFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 分别查网格某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 |
|||
* @author sun |
|||
*/ |
|||
List<ScoreListResultDTO> selectGridScoreList(ScoreListFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 |
|||
* @author sun |
|||
*/ |
|||
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthScoreList(MonthScoreListFormDTO 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 FactIndexGridSubScoreDao { |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 查询网格某月份某项能力对应的各项指标 |
|||
* @author sun |
|||
*/ |
|||
List<AblityListResultDTO> selectGridAblityList(AblityListFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 查询网格层级某项能力对应的一项指标过去12个月份数据 |
|||
* @author sun |
|||
*/ |
|||
LinkedList<MonthAblityListResultDTO> selectGridMonthAblityList(MonthAblityListFormDTO formDTO); |
|||
} |
@ -0,0 +1,49 @@ |
|||
/** |
|||
* 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.result.IndexDictResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 评价指标字典 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface IndexDictDao { |
|||
|
|||
/** |
|||
* @param |
|||
* @Description 查询指标字典表是百分比类型的数据 |
|||
* @author sun |
|||
*/ |
|||
List<IndexDictResultDTO> selectList(); |
|||
|
|||
/** |
|||
* @param |
|||
* @Description 根据indexCode查询指标字典表具体数据 |
|||
* @author sun |
|||
*/ |
|||
IndexDictResultDTO selectIndexDict(@Param("indexCode") String indexCode); |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.datareport.service.evaluationindex.screen; |
|||
|
|||
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 数据改版 |
|||
* |
|||
* @author sun |
|||
*/ |
|||
public interface ScreenUserService { |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 热心市民积分排行列表 |
|||
* @author sun |
|||
*/ |
|||
List<UserPointRankListResultDTO> userPointRank(UserPointRankFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 党员(指标得分)排行 |
|||
* @author sun |
|||
*/ |
|||
List<PartIndexScroeRankResultDTO> partIndexScroeRank(PartIndexScroeRankFormDTO formDTO); |
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.epmet.datareport.service.evaluationindex.screen.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
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.ScreenPartyUserRankDataDao; |
|||
import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; |
|||
import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; |
|||
import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 数据改版 |
|||
* |
|||
* @author sun |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public class ScreenUserServiceImpl implements ScreenUserService { |
|||
|
|||
@Autowired |
|||
private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 热心市民积分排行列表 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|||
public List<UserPointRankListResultDTO> userPointRank(UserPointRankFormDTO formDTO) { |
|||
//1.参数校验
|
|||
if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { |
|||
throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); |
|||
} |
|||
//2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data
|
|||
return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @Description 党员(指标得分)排行 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|||
public List<PartIndexScroeRankResultDTO> partIndexScroeRank(PartIndexScroeRankFormDTO formDTO) { |
|||
//1.参数校验
|
|||
if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { |
|||
throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); |
|||
} |
|||
//2.查询组织下党员的积分排行 screen_party_user_rank_data
|
|||
return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,68 @@ |
|||
<?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, 1) AS "indexTotal", |
|||
fact.index_code AS "indexCode" |
|||
FROM |
|||
fact_index_community_score fact |
|||
WHERE |
|||
fact.del_flag = '0' |
|||
AND fact.is_total = '0' <!-- 表示只查询三大能力的数据 --> |
|||
AND fact.customer_id = #{customerId} |
|||
AND fact.agency_id = #{orgId} |
|||
AND fact.month_id > #{startMonthId} |
|||
AND fact.month_id <= #{monthId} |
|||
ORDER BY |
|||
fact.month_id ASC |
|||
</select> |
|||
|
|||
<select id="selectCommunityScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO"> |
|||
SELECT |
|||
fact.index_code AS "indexCode", |
|||
ROUND(fact.score, 1) AS "indexTotal", |
|||
ROUND(self.self_score, 1) AS "agencyScore", |
|||
ROUND(self.sub_score, 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.is_total = '0' <!-- 表示只查询三大能力的数据 --> |
|||
AND fact.customer_id = #{customerId} |
|||
AND fact.agency_id = #{orgId} |
|||
AND fact.month_id = #{monthId} |
|||
</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, 1) AS "agencyScore", |
|||
ROUND(self.sub_score, 1) AS "subAgencyScore", |
|||
fact.index_code AS "indexCode" |
|||
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.is_total = '0' <!-- 表示只查询三大能力的数据 --> |
|||
AND fact.customer_id = #{customerId} |
|||
AND fact.agency_id = #{orgId} |
|||
AND fact.month_id > #{startMonthId} |
|||
AND fact.month_id <= #{monthId} |
|||
ORDER BY |
|||
fact.month_id ASC |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,70 @@ |
|||
<?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"> |
|||
|
|||
<select id="selectGridAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO"> |
|||
SELECT |
|||
fact.month_id AS "monthId", |
|||
ROUND(fact.score, 1) AS "indexTotal", |
|||
fact.index_code AS "indexCode" |
|||
FROM |
|||
fact_index_grid_score fact |
|||
WHERE |
|||
fact.del_flag = '0' |
|||
AND fact.is_total = '0' <!-- 表示只查询三大能力的数据 --> |
|||
AND fact.customer_id = #{customerId} |
|||
AND fact.grid_id = #{orgId} |
|||
AND fact.month_id > #{startMonthId} |
|||
AND fact.month_id <= #{monthId} |
|||
ORDER BY |
|||
fact.month_id ASC |
|||
</select> |
|||
|
|||
<select id="selectGridScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO"> |
|||
SELECT |
|||
fact.index_code AS "indexCode", |
|||
ROUND(fact.score, 1) AS "indexTotal", |
|||
ROUND(self.self_score, 1) AS "agencyScore", |
|||
ROUND(self.sub_score, 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.is_total = '0' <!-- 表示只查询三大能力的数据 --> |
|||
AND fact.customer_id = #{customerId} |
|||
AND fact.grid_id = #{orgId} |
|||
AND fact.month_id = #{monthId} |
|||
</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, 1) AS "agencyScore", |
|||
ROUND(self.sub_score, 1) AS "subAgencyScore", |
|||
fact.index_code AS "indexCode" |
|||
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.is_total = '0' <!-- 表示只查询三大能力的数据 --> |
|||
AND fact.customer_id = #{customerId} |
|||
AND fact.grid_id = #{orgId} |
|||
AND fact.month_id > #{startMonthId} |
|||
AND fact.month_id <= #{monthId} |
|||
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.FactIndexGridSubScoreDao"> |
|||
|
|||
<select id="selectGridAblityList" 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_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(fact.origin_value,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 <= #{monthId} |
|||
AND month_id > #{startMonthId} |
|||
AND fact.index_code = #{key} |
|||
ORDER BY |
|||
fact.month_id ASC |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,30 @@ |
|||
<?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.IndexDictDao"> |
|||
|
|||
<select id="selectList" resultType="com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO"> |
|||
SELECT |
|||
index_name AS "indexName", |
|||
index_code AS "indexCode", |
|||
value_type AS "valueType" |
|||
FROM |
|||
index_dict |
|||
WHERE |
|||
del_flag = '0' |
|||
</select> |
|||
|
|||
<select id="selectIndexDict" resultType="com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO"> |
|||
SELECT |
|||
index_name AS "indexName", |
|||
index_code AS "indexCode", |
|||
value_type AS "valueType" |
|||
FROM |
|||
index_dict |
|||
WHERE |
|||
del_flag = '0' |
|||
AND index_code = #{indexCode} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,39 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/16 3:56 下午 |
|||
*/ |
|||
public interface ExtractConstant { |
|||
|
|||
String PARTY = "党员"; |
|||
|
|||
String STRANGER = "陌生人"; |
|||
|
|||
String ISSUE_INFO = "查询议题信息为空"; |
|||
|
|||
String CREATED_TOPIC_USER_IDENTITY = "查询创建话题用户身份信息为空"; |
|||
|
|||
String PARENT_AGENCY_ID_LIST = "查询组织上级ID集合为空......"; |
|||
|
|||
String ISSUE_PROCESS = "查询查询议题process集合为空"; |
|||
|
|||
String SHIFT_PROJECT = "shift_project"; |
|||
|
|||
String CLOSE = "close"; |
|||
|
|||
String CLOSED = "closed"; |
|||
|
|||
String GRID_ORG_TYPE = "grid"; |
|||
|
|||
String RETURN_ACTION_CODE = "return"; |
|||
|
|||
String EVALUATE_BAD = "bad"; |
|||
|
|||
String EVALUATE_GOOD = "good"; |
|||
|
|||
String EVALUATE_PERFECT = "perfect"; |
|||
|
|||
String CUSTOMER_INFO_NULL = "客户【%s】未查出网格信息"; |
|||
|
|||
} |
@ -0,0 +1,11 @@ |
|||
package com.epmet.constant; |
|||
|
|||
public interface OrgSourceTypeConstant { |
|||
|
|||
// 外部
|
|||
String EXTERNAL = "external"; |
|||
|
|||
// 内部
|
|||
String INTERNAL = "internal"; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.epmet.constant; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/18 3:49 下午 |
|||
*/ |
|||
public interface ProjectEvaluateConstant { |
|||
|
|||
// BigDecimal BAD = new BigDecimal(NumConstant.SIXTY);
|
|||
// BigDecimal GOOD = new BigDecimal(NumConstant.EIGHTY);
|
|||
// BigDecimal PERFECT = new BigDecimal(NumConstant.ONE_HUNDRED);
|
|||
|
|||
Integer BAD = NumConstant.SIXTY; |
|||
Integer GOOD = NumConstant.EIGHTY; |
|||
Integer PERFECT = NumConstant.ONE_HUNDRED; |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/22 2:19 下午 |
|||
*/ |
|||
public interface ScreenConstant { |
|||
|
|||
String COMMUNITY = "community"; |
|||
|
|||
String STREET = "street"; |
|||
|
|||
String DISTRICT = "district"; |
|||
|
|||
String CITY = "city"; |
|||
|
|||
String PROVINCE = "province"; |
|||
|
|||
String LEVEL = "level"; |
|||
|
|||
String STR_NULL = ""; |
|||
|
|||
String ENGLISH_COMMA = ","; |
|||
|
|||
String GRID = "grid"; |
|||
|
|||
String AGENCY = "agency"; |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/9/17 2:56 下午 |
|||
*/ |
|||
public interface StatsConstant { |
|||
|
|||
String PARTY_INFO_LIST = "客户【%s】查询党员信息集合为空......"; |
|||
|
|||
String CUSTOMER_INFO_NULL = "查询所有客户ID为空"; |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
/** |
|||
* 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.dto.extract; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 对象行为动作维度表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-15 |
|||
*/ |
|||
@Data |
|||
public class DimObjectActionDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 行为code |
|||
*/ |
|||
private String actionCode; |
|||
|
|||
/** |
|||
* 行为描述 |
|||
*/ |
|||
private String actionDesc; |
|||
|
|||
/** |
|||
* 行为类型 topic,issue,project,article,group |
|||
*/ |
|||
private String actionType; |
|||
|
|||
/** |
|||
* 父级ID(本表id) |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 删除标识 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue