forked from rongchao/epmet-cloud-rizhao
1283 changed files with 79904 additions and 1191 deletions
@ -0,0 +1 @@ |
|||
select 0; |
|||
@ -0,0 +1,19 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class UpdateCachedRolesFormDTO { |
|||
|
|||
@NotBlank(message = "客户ID不能为空") |
|||
private String staffId; |
|||
|
|||
@NotBlank(message = "机关ID不能为空") |
|||
private String orgId; |
|||
|
|||
private List<String> roleIds; |
|||
|
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package com.epmet.commons.tools.dto.form; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import lombok.Data; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* desc: 钉钉文本消息参数 实体类 |
|||
* date: 2019/2/20 11:00 |
|||
* @author: jianjun liu |
|||
* email:liujianjun@yunzongnet.com |
|||
*/ |
|||
public class DingTalkTextMsg { |
|||
|
|||
/** |
|||
* 消息接收者 |
|||
*/ |
|||
private String receiver; |
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* at的群成员手机号 |
|||
*/ |
|||
private List<String> atMobiles; |
|||
|
|||
/** |
|||
* 是否at所有人 |
|||
*/ |
|||
private boolean isAtAll; |
|||
|
|||
public String getReceiver() { |
|||
return receiver; |
|||
} |
|||
|
|||
public void setReceiver(String receiver) { |
|||
this.receiver = receiver; |
|||
} |
|||
|
|||
public String getContent() { |
|||
return content; |
|||
} |
|||
|
|||
public void setContent(String content) { |
|||
this.content = content; |
|||
} |
|||
|
|||
public List<String> getAtMobiles() { |
|||
return atMobiles; |
|||
} |
|||
|
|||
public void setAtMobiles(List<String> atMobiles) { |
|||
this.atMobiles = atMobiles; |
|||
} |
|||
|
|||
public boolean isAtAll() { |
|||
return isAtAll; |
|||
} |
|||
|
|||
public void setAtAll(boolean atAll) { |
|||
isAtAll = atAll; |
|||
} |
|||
|
|||
public String getMsgContent() { |
|||
Map<String, Object> items = new HashMap<>(); |
|||
items.put("msgtype", "text"); |
|||
|
|||
Map<String, String> textContent = new HashMap<>(); |
|||
textContent.put("content", getContent()); |
|||
items.put("text", textContent); |
|||
|
|||
Map<String, Object> atItems = new HashMap<>(); |
|||
if (!CollectionUtils.isEmpty(atMobiles)) { |
|||
atItems.put("atMobiles", atMobiles); |
|||
} |
|||
if (isAtAll) { |
|||
atItems.put("isAtAll", isAtAll); |
|||
} |
|||
items.put("at", atItems); |
|||
return JSON.toJSONString(items); |
|||
} |
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
package com.epmet.commons.tools.filter; |
|||
|
|||
import ch.qos.logback.classic.Level; |
|||
import ch.qos.logback.classic.filter.LevelFilter; |
|||
import ch.qos.logback.classic.spi.ILoggingEvent; |
|||
import ch.qos.logback.classic.spi.IThrowableProxy; |
|||
import ch.qos.logback.classic.spi.StackTraceElementProxy; |
|||
import ch.qos.logback.core.spi.FilterReply; |
|||
import com.epmet.commons.tools.utils.HttpClientManager; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
|
|||
/** |
|||
* desc: 发送日志消息 |
|||
* |
|||
* @date: 2020/6/24 17:47 |
|||
* @author: jianjun liu |
|||
*/ |
|||
public class LogMsgSendFilter extends LevelFilter { |
|||
private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class); |
|||
@Override |
|||
public FilterReply decide(ILoggingEvent event) { |
|||
//如果日志级别等于设置的日志级别 则发送消息
|
|||
if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { |
|||
try { |
|||
StringBuilder stringBuilder = new StringBuilder(); |
|||
stringBuilder.append("【日志告警】\n"); |
|||
|
|||
stringBuilder.append("\n"); |
|||
|
|||
stringBuilder.append("告警级别:" + event.getLevel()); |
|||
stringBuilder.append("\n"); |
|||
stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); |
|||
stringBuilder.append("\n"); |
|||
stringBuilder.append("TraceId:" + Thread.currentThread().getName()); |
|||
stringBuilder.append("\n"); |
|||
stringBuilder.append("告警信息:" + event.getFormattedMessage()); |
|||
stringBuilder.append("\n"); |
|||
|
|||
IThrowableProxy throwableProxy = event.getThrowableProxy(); |
|||
//异常信息处理 暂时处理一级的5行数据
|
|||
apendStackInfo(stringBuilder, throwableProxy); |
|||
|
|||
Result<String> flag = HttpClientManager.getInstance().sendAlarmMsg(stringBuilder.toString()); |
|||
if (!flag.success()) { |
|||
logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString()); |
|||
} |
|||
} catch (Exception e) { |
|||
logger.warn("decide exception", e); |
|||
} |
|||
} |
|||
//交给其他filter继续向下处理
|
|||
return super.decide(event); |
|||
} |
|||
|
|||
private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) { |
|||
int defaultRowLine = 5; |
|||
if (throwableProxy != null) { |
|||
stringBuilder.append("异常信息:") |
|||
.append(throwableProxy.getClassName()) |
|||
.append(" : ") |
|||
.append(throwableProxy.getMessage()) |
|||
.append("\n"); |
|||
|
|||
StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray(); |
|||
StackTraceElementProxy stackTraceElementProxy = null; |
|||
|
|||
if (stackTraceElementProxyArray.length < defaultRowLine) { |
|||
defaultRowLine = stackTraceElementProxyArray.length; |
|||
} |
|||
for (int i = 0; i < defaultRowLine; i++) { |
|||
stackTraceElementProxy = stackTraceElementProxyArray[i]; |
|||
StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement(); |
|||
stringBuilder.append("\t\tat "); |
|||
stringBuilder.append(stackTraceElement.getClassName()); |
|||
stringBuilder.append("."); |
|||
stringBuilder.append(stackTraceElement.getMethodName()); |
|||
stringBuilder.append("("); |
|||
stringBuilder.append(stackTraceElement.getFileName()); |
|||
stringBuilder.append(":"); |
|||
stringBuilder.append(stackTraceElement.getLineNumber()); |
|||
stringBuilder.append(")"); |
|||
stringBuilder.append("\n"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
private String formatLongTime2Str(long timestamp) { |
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
|||
return dateFormat.format(timestamp); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.commons.tools.scan.param; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 审查参数 |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-06-04 21:57 |
|||
**/ |
|||
@Data |
|||
public class ImgScanParamDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -5982388188212400644L; |
|||
|
|||
/** |
|||
* 要检测的内容列表,必填 |
|||
* remark:一组任务列表中的taskId不能相同 |
|||
*/ |
|||
private List<ImgTaskDTO> tasks = new ArrayList<>(); |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.epmet.commons.tools.scan.param; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 任务参数 |
|||
* |
|||
* @author jianjun liu |
|||
* @email liujianjun@yunzongnet.com |
|||
* @date 2020-06-04 22:13 |
|||
**/ |
|||
@Data |
|||
public class ImgTaskDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -747206284930578105L; |
|||
/** |
|||
* 要检测的数据id 非必填 |
|||
* |
|||
* */ |
|||
private String dataId; |
|||
|
|||
/** |
|||
* 图片url 必填 |
|||
*/ |
|||
private String url; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.commons.tools.scan.param; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 文本审查参数 |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-06-05 11:17 |
|||
**/ |
|||
@Data |
|||
public class TextScanParamDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -6244354240835340471L; |
|||
|
|||
/** |
|||
* 要检测的内容列表,必填 |
|||
* remark:一组任务列表中的taskId不能相同 |
|||
*/ |
|||
private List<TextTaskDTO> tasks = new ArrayList<>(); |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.epmet.commons.tools.scan.param; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 任务参数 |
|||
* |
|||
* @author jianjun liu |
|||
* @email liujianjun@yunzongnet.com |
|||
* @date 2020-06-04 22:13 |
|||
**/ |
|||
@Data |
|||
public class TextTaskDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 6957195274696018630L; |
|||
/** |
|||
* 要检测的数据id 非必填 |
|||
* |
|||
* */ |
|||
private String dataId; |
|||
|
|||
/** |
|||
* 文本内容 必填 最多不能超过10000 |
|||
*/ |
|||
private String content; |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.epmet.commons.tools.scan.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 检测结果 |
|||
* |
|||
* @author jianjun liu |
|||
* @email liujianjun@yunzongnet.com |
|||
* @date 2020-06-05 10:52 |
|||
**/ |
|||
@Data |
|||
public class SyncScanResult implements Serializable { |
|||
/** |
|||
* 执行成功的任务Id集合 |
|||
*/ |
|||
private List<String> successDataIds = new ArrayList<>(); |
|||
/** |
|||
* 执行失败的任务Id集合 |
|||
*/ |
|||
private List<String> failDataIds = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 本地是否全部通过 |
|||
*/ |
|||
private boolean isAllPass; |
|||
|
|||
public boolean isAllPass() { |
|||
if (failDataIds.isEmpty() && !successDataIds.isEmpty()) { |
|||
return true; |
|||
} |
|||
return isAllPass; |
|||
} |
|||
|
|||
public void setAllPass(boolean allPass) { |
|||
isAllPass = allPass; |
|||
} |
|||
} |
|||
@ -0,0 +1,221 @@ |
|||
package com.epmet.commons.tools.utils; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.dto.form.DingTalkTextMsg; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|||
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.codec.binary.Base64; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.apache.http.HttpStatus; |
|||
import org.apache.http.NameValuePair; |
|||
import org.apache.http.client.config.RequestConfig; |
|||
import org.apache.http.client.entity.UrlEncodedFormEntity; |
|||
import org.apache.http.client.methods.CloseableHttpResponse; |
|||
import org.apache.http.client.methods.HttpGet; |
|||
import org.apache.http.client.methods.HttpPost; |
|||
import org.apache.http.client.methods.HttpRequestBase; |
|||
import org.apache.http.client.utils.URIBuilder; |
|||
import org.apache.http.entity.StringEntity; |
|||
import org.apache.http.impl.client.CloseableHttpClient; |
|||
import org.apache.http.impl.client.HttpClients; |
|||
import org.apache.http.message.BasicNameValuePair; |
|||
import org.apache.http.util.EntityUtils; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import javax.crypto.Mac; |
|||
import javax.crypto.spec.SecretKeySpec; |
|||
import java.io.IOException; |
|||
import java.net.URLEncoder; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Set; |
|||
|
|||
/** |
|||
* desc: http 工具类 |
|||
* date: 2020/6/4 22:27 |
|||
* |
|||
* @author: jianjun liu |
|||
*/ |
|||
@Slf4j |
|||
public class HttpClientManager { |
|||
private static int connectionTimeout = 3000;// 连接超时时间,毫秒
|
|||
private static int soTimeout = 10000;// 读取数据超时时间,毫秒
|
|||
/** |
|||
* HttpClient对象 |
|||
*/ |
|||
private static CloseableHttpClient httpclient = HttpClients.custom().disableAutomaticRetries().build(); |
|||
|
|||
/*** 超时设置 ****/ |
|||
private static RequestConfig requestConfig = RequestConfig.custom() |
|||
.setSocketTimeout(soTimeout) |
|||
.setConnectTimeout(connectionTimeout) |
|||
.build();//设置请求和传输超时时间
|
|||
|
|||
public static HttpClientManager getInstance() { |
|||
return SingleClass.instance; |
|||
} |
|||
|
|||
private static class SingleClass { |
|||
private final static HttpClientManager instance = new HttpClientManager(); |
|||
} |
|||
|
|||
/** |
|||
* desc: 发送json post 请求 |
|||
* param: url,jsonStrParam |
|||
* return: CallResult<String> |
|||
* date: 2019/2/21 9:12 |
|||
* |
|||
* @author: jianjun liu |
|||
*/ |
|||
public Result<String> sendPost(String url, Map<String, String> paramsMap) { |
|||
|
|||
try { |
|||
HttpPost httppost = new HttpPost(url); |
|||
httppost.setConfig(requestConfig); |
|||
httppost.addHeader("Content-Type", "application/x-www-form-urlencoded charset=utf-8"); |
|||
|
|||
List<NameValuePair> list = new ArrayList<NameValuePair>(); |
|||
for (String key : paramsMap.keySet()) { |
|||
list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key)))); |
|||
} |
|||
UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8"); |
|||
httppost.setEntity(urlEncodedFormEntity); |
|||
|
|||
return execute(httppost); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
log.error("send exception", e); |
|||
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|||
} |
|||
|
|||
} |
|||
|
|||
/** |
|||
* desc: 发送json post 请求 |
|||
* param: url,jsonStrParam |
|||
* return: Result<String> |
|||
* date: 2019/2/21 9:12 |
|||
* |
|||
* @author: jianjun liu |
|||
*/ |
|||
public Result<String> sendPostByJSON(String url, String jsonStrParam) { |
|||
|
|||
try { |
|||
HttpPost httppost = new HttpPost(url); |
|||
httppost.setConfig(requestConfig); |
|||
httppost.addHeader("Content-Type", "application/json; charset=utf-8"); |
|||
if (StringUtils.isNotEmpty(jsonStrParam)) { |
|||
StringEntity se = new StringEntity(jsonStrParam, "utf-8"); |
|||
httppost.setEntity(se); |
|||
} |
|||
return execute(httppost); |
|||
} catch (Exception e) { |
|||
log.error("send exception", e); |
|||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|||
} |
|||
|
|||
} |
|||
|
|||
/** |
|||
* desc: 发送钉钉群消息 简版 |
|||
* param: url,jsonStrParam |
|||
* return: Result<String> |
|||
* |
|||
* @author: jianjun liu |
|||
*/ |
|||
public Result<String> sendAlarmMsg(String content) { |
|||
Long timestamp = System.currentTimeMillis(); |
|||
String url = "https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c"; |
|||
String secret = "SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19"; |
|||
|
|||
try { |
|||
String stringToSign = timestamp + "\n" + secret; |
|||
Mac mac = Mac.getInstance("HmacSHA256"); |
|||
mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); |
|||
byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); |
|||
String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8"); |
|||
DingTalkTextMsg msg = new DingTalkTextMsg(); |
|||
msg.setContent(content); |
|||
url = url.concat("×tamp="+timestamp+"&sign="+sign); |
|||
String jsonStrParam = msg.getMsgContent(); |
|||
return sendPostByJSON(url, jsonStrParam); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return new Result<String>().error(); |
|||
} |
|||
|
|||
/** |
|||
* desc: 发送get请求 |
|||
* param:url, params |
|||
* return: CallResult<String> |
|||
* date: 2019/2/21 9:16 |
|||
* |
|||
* @author: jianjun liu |
|||
*/ |
|||
public Result<String> sendGet(String url, Map<String, Object> params) { |
|||
|
|||
try { |
|||
URIBuilder builder = new URIBuilder(url); |
|||
if (!CollectionUtils.isEmpty(params)) { |
|||
Set<String> set = params.keySet(); |
|||
for (String key : set) { |
|||
builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); |
|||
} |
|||
} |
|||
HttpGet httpGet = new HttpGet(builder.build()); |
|||
httpGet.setConfig(requestConfig); |
|||
return execute(httpGet); |
|||
} catch (Exception e) { |
|||
log.error("sendGet exception", e); |
|||
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|||
} |
|||
} |
|||
|
|||
private Result<String> execute(HttpRequestBase httpMethod) { |
|||
CloseableHttpResponse response = null; |
|||
try { |
|||
response = httpclient.execute(httpMethod); |
|||
log.debug("http send response:{}", JSON.toJSONString(response)); |
|||
if (response != null && response.getStatusLine() != null) { |
|||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { |
|||
String result = EntityUtils.toString(response.getEntity()); |
|||
return new Result<String>().ok(result); |
|||
} else { |
|||
log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("execute exception", e); |
|||
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); |
|||
} finally { |
|||
httpMethod.releaseConnection(); |
|||
try { |
|||
if (response != null) { |
|||
response.close(); |
|||
} |
|||
} catch (IOException e) { |
|||
} |
|||
} |
|||
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
String url = "http://localhost:8107/epmetscan/api/textSyncScan"; |
|||
TextTaskDTO p = new TextTaskDTO(); |
|||
p.setDataId("1"); |
|||
p.setContent("neirong1"); |
|||
List<TextTaskDTO> list = new ArrayList<>(); |
|||
list.add(p); |
|||
TextScanParamDTO param = new TextScanParamDTO(); |
|||
param.setTasks(list); |
|||
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|||
System.out.println(JSON.toJSONString(result)); |
|||
} |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,101 @@ |
|||
package com.epmet.commons.tools.utils; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.TypeReference; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|||
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|||
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|||
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 扫描内容工具类 |
|||
* |
|||
* @author jianjun liu |
|||
* @email liujianjun@yunzongnet.com |
|||
* @date 2020-06-08 8:28 |
|||
**/ |
|||
@Slf4j |
|||
public class ScanContentUtils { |
|||
/** |
|||
* desc:图片同步扫描 |
|||
* |
|||
* @return |
|||
*/ |
|||
public static Result<SyncScanResult> imgSyncScan(String url, ImgScanParamDTO param) { |
|||
log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); |
|||
if (StringUtils.isBlank(url) || param == null) { |
|||
throw new RenException("参数错误"); |
|||
} |
|||
try { |
|||
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|||
log.debug("imgSyncScan result:{}", JSON.toJSONString(param)); |
|||
if (result.success()) { |
|||
return JSON.parseObject(result.getData(),new TypeReference<Result<SyncScanResult>>(){}); |
|||
} |
|||
Result<SyncScanResult> resultResult = new Result<>(); |
|||
resultResult.error(result.getCode(),result.getMsg()); |
|||
resultResult.setInternalMsg(result.getInternalMsg()); |
|||
return resultResult; |
|||
} catch (Exception e) { |
|||
log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); |
|||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* desc:文字同步扫描 |
|||
* |
|||
* @return |
|||
*/ |
|||
public static Result<SyncScanResult> textSyncScan(String url, TextScanParamDTO param) { |
|||
log.debug("textSyncScan param:{}", JSON.toJSONString(param)); |
|||
if (StringUtils.isBlank(url) || param == null) { |
|||
throw new RenException("参数错误"); |
|||
} |
|||
try { |
|||
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|||
log.debug("textSyncScan result:{}", JSON.toJSONString(result)); |
|||
if (result.success()) { |
|||
//return JSON.parseObject(result.getData(),Result.class);
|
|||
return JSON.parseObject(result.getData(),new TypeReference<Result<SyncScanResult>>(){}); |
|||
} |
|||
Result<SyncScanResult> resultResult = new Result<>(); |
|||
resultResult.error(result.getCode(),result.getMsg()); |
|||
resultResult.setInternalMsg(result.getInternalMsg()); |
|||
return resultResult; |
|||
} catch (Exception e) { |
|||
log.error("textSyncScan exception:", e); |
|||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
String url = "http://localhost:8107/epmetscan/api/textSyncScan"; |
|||
TextTaskDTO p = new TextTaskDTO(); |
|||
p.setDataId("1"); |
|||
p.setContent("neirong1"); |
|||
List<TextTaskDTO> list = new ArrayList<>(); |
|||
list.add(p); |
|||
TextScanParamDTO param = new TextScanParamDTO(); |
|||
param.setTasks(list); |
|||
Result<SyncScanResult> imgSyncScanResult = ScanContentUtils.textSyncScan(url, param); |
|||
System.out.println(JSON.toJSONString(imgSyncScanResult)); |
|||
SyncScanResult result = new SyncScanResult(); |
|||
if (imgSyncScanResult != null){ |
|||
SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData(); |
|||
if (imgSyncScanResult.success()&&imgSyncScanResultData.isAllPass()) { |
|||
result.setAllPass(imgSyncScanResultData.isAllPass()); |
|||
result.getSuccessDataIds().addAll(imgSyncScanResultData.getSuccessDataIds()); |
|||
result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds()); |
|||
System.out.println("================"+JSON.toJSONString(result)); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,212 @@ |
|||
package com.epmet.commons.tools.validator; |
|||
|
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Calendar; |
|||
import java.util.GregorianCalendar; |
|||
import java.util.Hashtable; |
|||
import java.util.regex.Matcher; |
|||
import java.util.regex.Pattern; |
|||
|
|||
import static java.util.regex.Pattern.*; |
|||
|
|||
/** |
|||
* 身份证号校验 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/18 9:59 |
|||
*/ |
|||
public class IdCardNoValidatorUtils { |
|||
|
|||
private static Logger logger = LoggerFactory.getLogger(IdCardNoValidatorUtils.class); |
|||
|
|||
/** |
|||
* 身份证验证 |
|||
* |
|||
* @param idCardNo |
|||
* @return 校验信息,correct为成功,失败会返回对应的失败原因 |
|||
*/ |
|||
public static boolean checkIsIdCardNo(String idCardNo) { |
|||
String[] wf = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"}; |
|||
String[] checkCode = {"7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"}; |
|||
String iDCardNo = ""; |
|||
try { |
|||
//判断号码的长度 15位或18位
|
|||
if (idCardNo.length() != 15 && idCardNo.length() != 18) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); |
|||
return false; |
|||
} |
|||
if (idCardNo.length() == 18) { |
|||
String lastStr = idCardNo.substring(idCardNo.length() - 1); |
|||
if (!Character.isDigit(lastStr.charAt(0))) { |
|||
if (Character.isLowerCase(lastStr.charAt(0))) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); |
|||
return false; |
|||
} |
|||
} else { |
|||
logger.info(String.format("身份证号%s最后一位为数字",idCardNo)); |
|||
} |
|||
} |
|||
if (idCardNo.length() == 18) { |
|||
iDCardNo = idCardNo.substring(0, 17); |
|||
} else if (idCardNo.length() == 15) { |
|||
iDCardNo = idCardNo.substring(0, 6) + "19" + idCardNo.substring(6, 15); |
|||
} |
|||
if (isStrNum(iDCardNo) == false) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); |
|||
return false; |
|||
} |
|||
//判断出生年月
|
|||
String strYear = iDCardNo.substring(6, 10);// 年份
|
|||
String strMonth = iDCardNo.substring(10, 12);// 月份
|
|||
String strDay = iDCardNo.substring(12, 14);// 月份
|
|||
if (isStrDate(strYear + "-" + strMonth + "-" + strDay) == false) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); |
|||
return false; |
|||
} |
|||
GregorianCalendar gc = new GregorianCalendar(); |
|||
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); |
|||
if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); |
|||
return false; |
|||
} |
|||
if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); |
|||
return false; |
|||
} |
|||
if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); |
|||
return false; |
|||
} |
|||
//判断地区码
|
|||
Hashtable h = GetAreaCode(); |
|||
if (h.get(iDCardNo.substring(0, 2)) == null) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); |
|||
return false; |
|||
} |
|||
//判断最后一位
|
|||
int theLastOne = 0; |
|||
for (int i = 0; i < 17; i++) { |
|||
theLastOne = theLastOne + Integer.parseInt(String.valueOf(iDCardNo.charAt(i))) * Integer.parseInt(checkCode[i]); |
|||
} |
|||
int modValue = theLastOne % 11; |
|||
String strVerifyCode = wf[modValue]; |
|||
iDCardNo = iDCardNo + strVerifyCode; |
|||
|
|||
if (idCardNo.length() == 18 && !iDCardNo.equals(idCardNo)) { |
|||
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); |
|||
return false; |
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
logger.error(String.format("校验身份证号方法异常")); |
|||
e.printStackTrace(); |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 地区代码 |
|||
* |
|||
* @return Hashtable |
|||
*/ |
|||
private static Hashtable GetAreaCode() { |
|||
Hashtable<String, String> hashtable = new Hashtable<String, String>(); |
|||
hashtable.put("11", "北京"); |
|||
hashtable.put("12", "天津"); |
|||
hashtable.put("13", "河北"); |
|||
hashtable.put("14", "山西"); |
|||
hashtable.put("15", "内蒙古"); |
|||
hashtable.put("21", "辽宁"); |
|||
hashtable.put("22", "吉林"); |
|||
hashtable.put("23", "黑龙江"); |
|||
hashtable.put("31", "上海"); |
|||
hashtable.put("32", "江苏"); |
|||
hashtable.put("33", "浙江"); |
|||
hashtable.put("34", "安徽"); |
|||
hashtable.put("35", "福建"); |
|||
hashtable.put("36", "江西"); |
|||
hashtable.put("37", "山东"); |
|||
hashtable.put("41", "河南"); |
|||
hashtable.put("42", "湖北"); |
|||
hashtable.put("43", "湖南"); |
|||
hashtable.put("44", "广东"); |
|||
hashtable.put("45", "广西"); |
|||
hashtable.put("46", "海南"); |
|||
hashtable.put("50", "重庆"); |
|||
hashtable.put("51", "四川"); |
|||
hashtable.put("52", "贵州"); |
|||
hashtable.put("53", "云南"); |
|||
hashtable.put("54", "西藏"); |
|||
hashtable.put("61", "陕西"); |
|||
hashtable.put("62", "甘肃"); |
|||
hashtable.put("63", "青海"); |
|||
hashtable.put("64", "宁夏"); |
|||
hashtable.put("65", "新疆"); |
|||
hashtable.put("71", "台湾"); |
|||
hashtable.put("81", "香港"); |
|||
hashtable.put("82", "澳门"); |
|||
hashtable.put("91", "国外"); |
|||
return hashtable; |
|||
} |
|||
|
|||
/** |
|||
* 判断字符串是否为数字 |
|||
* |
|||
* @param str |
|||
* @return |
|||
*/ |
|||
private static boolean isStrNum(String str) { |
|||
Pattern pattern = compile("[0-9]*"); |
|||
Matcher isNum = pattern.matcher(str); |
|||
if (isNum.matches()) { |
|||
return true; |
|||
} else { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 判断字符串是否为日期格式 |
|||
* |
|||
* @param strDate |
|||
* @return |
|||
*/ |
|||
public static boolean isStrDate(String strDate) { |
|||
Pattern pattern = compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"); |
|||
Matcher m = pattern.matcher(strDate); |
|||
if (m.matches()) { |
|||
return true; |
|||
} else { |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
|
|||
//根据身份证号判断性别 1男2女0未知
|
|||
public static String getGender(String idCard) { |
|||
String gender = "0"; |
|||
if (!IdCardNoValidatorUtils.checkIsIdCardNo(idCard)) { |
|||
return gender; |
|||
} |
|||
if (idCard.length() == 18) { |
|||
if (Integer.parseInt(idCard.substring(16).substring(0, 1)) % 2 == 0) { |
|||
gender = "2"; |
|||
} else { |
|||
gender = "1"; |
|||
} |
|||
} else if (idCard.length() == 15) { |
|||
String usex = idCard.substring(14, 15); |
|||
if (Integer.parseInt(usex) % 2 == 0) { |
|||
gender = "2"; |
|||
} else { |
|||
gender = "1"; |
|||
} |
|||
} |
|||
return gender; |
|||
} |
|||
|
|||
} |
|||
|
|||
@ -1,83 +1,85 @@ |
|||
package com.epmet.filter; |
|||
|
|||
import com.epmet.commons.tools.constant.AppClientConstant; |
|||
import com.epmet.commons.tools.constant.Constant; |
|||
import com.epmet.commons.tools.security.dto.BaseTokenDto; |
|||
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
|||
import com.epmet.jwt.JwtTokenUtils; |
|||
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.cloud.gateway.filter.GlobalFilter; |
|||
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; |
|||
|
|||
/** |
|||
* Feign调用发送请求的Filter |
|||
* 目前用于封装用户相关信息到request,供上游微服务使用 |
|||
*/ |
|||
@Component |
|||
public class FeignRequestFilter implements GlobalFilter, UserTokenFilter { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private JwtTokenUtils jwtTokenUtils; |
|||
@Autowired |
|||
private CpUserDetailRedis cpUserDetailRedis; |
|||
|
|||
@Override |
|||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
|||
ServerHttpRequest request = exchange.getRequest(); |
|||
HttpHeaders headers = request.getHeaders(); |
|||
String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); |
|||
if (StringUtils.isBlank(token)) { |
|||
token = headers.getFirst(Constant.TOKEN_HEADER); |
|||
logger.info("token=" + token); |
|||
} else { |
|||
logger.info("authorization=" + token); |
|||
} |
|||
if (StringUtils.isBlank(token)) { |
|||
token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); |
|||
logger.info("params token:" + token); |
|||
} |
|||
|
|||
if (StringUtils.isBlank(token)) { |
|||
return chain.filter(exchange); |
|||
} |
|||
|
|||
BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); |
|||
|
|||
if (baseTokenDto != null) { |
|||
ServerHttpRequest build = exchange.getRequest().mutate() |
|||
.header(AppClientConstant.USER_ID, new String[]{baseTokenDto.getUserId()}) |
|||
.header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}) |
|||
.build(); |
|||
return chain.filter(exchange.mutate().request(build).build()); |
|||
} |
|||
|
|||
return chain.filter(exchange); |
|||
} |
|||
|
|||
/** |
|||
* 获取事务流水号 |
|||
* @return |
|||
*/ |
|||
public static String getTransactionSerial() { |
|||
String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n" |
|||
, "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; |
|||
|
|||
StringBuilder sb = new StringBuilder(); |
|||
for (int i = 0; i < 2; i++) { |
|||
sb.append(letterPool[(int) (Math.random() * 25)]); |
|||
} |
|||
|
|||
sb.append(System.currentTimeMillis()); |
|||
return sb.toString(); |
|||
} |
|||
} |
|||
//package com.epmet.filter;
|
|||
//
|
|||
//import com.epmet.commons.tools.constant.AppClientConstant;
|
|||
//import com.epmet.commons.tools.constant.Constant;
|
|||
//import com.epmet.commons.tools.security.dto.BaseTokenDto;
|
|||
//import com.epmet.commons.tools.utils.CpUserDetailRedis;
|
|||
//import com.epmet.jwt.JwtTokenUtils;
|
|||
//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.cloud.gateway.filter.GlobalFilter;
|
|||
//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;
|
|||
//
|
|||
///**
|
|||
// * Feign调用发送请求的Filter
|
|||
// * 目前用于封装用户相关信息到request,供上游微服务使用
|
|||
// * 已过时,功能移入CpAuthGatewayFilterFacotry
|
|||
// */
|
|||
//@Component
|
|||
//@Deprecated
|
|||
//public class FeignRequestFilter implements GlobalFilter, UserTokenFilter {
|
|||
//
|
|||
// private Logger logger = LoggerFactory.getLogger(getClass());
|
|||
//
|
|||
// @Autowired
|
|||
// private JwtTokenUtils jwtTokenUtils;
|
|||
// @Autowired
|
|||
// private CpUserDetailRedis cpUserDetailRedis;
|
|||
//
|
|||
// @Override
|
|||
// public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
|||
// ServerHttpRequest request = exchange.getRequest();
|
|||
// HttpHeaders headers = request.getHeaders();
|
|||
// String token = headers.getFirst(Constant.AUTHORIZATION_HEADER);
|
|||
// if (StringUtils.isBlank(token)) {
|
|||
// token = headers.getFirst(Constant.TOKEN_HEADER);
|
|||
// logger.info("token=" + token);
|
|||
// } else {
|
|||
// logger.info("authorization=" + token);
|
|||
// }
|
|||
// if (StringUtils.isBlank(token)) {
|
|||
// token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER);
|
|||
// logger.info("params token:" + token);
|
|||
// }
|
|||
//
|
|||
// if (StringUtils.isBlank(token)) {
|
|||
// return chain.filter(exchange);
|
|||
// }
|
|||
//
|
|||
// BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils);
|
|||
//
|
|||
// if (baseTokenDto != null) {
|
|||
// ServerHttpRequest build = exchange.getRequest().mutate()
|
|||
// .header(AppClientConstant.USER_ID, new String[]{baseTokenDto.getUserId()})
|
|||
// .header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()})
|
|||
// .build();
|
|||
// return chain.filter(exchange.mutate().request(build).build());
|
|||
// }
|
|||
//
|
|||
// return chain.filter(exchange);
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 获取事务流水号
|
|||
// * @return
|
|||
// */
|
|||
// public static String getTransactionSerial() {
|
|||
// String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"
|
|||
// , "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
|
|||
//
|
|||
// StringBuilder sb = new StringBuilder();
|
|||
// for (int i = 0; i < 2; i++) {
|
|||
// sb.append(letterPool[(int) (Math.random() * 25)]);
|
|||
// }
|
|||
//
|
|||
// sb.append(System.currentTimeMillis());
|
|||
// return sb.toString();
|
|||
// }
|
|||
//}
|
|||
|
|||
@ -0,0 +1,23 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<parent> |
|||
<artifactId>data-report</artifactId> |
|||
<groupId>com.epmet</groupId> |
|||
<version>2.0.0</version> |
|||
</parent> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<artifactId>data-report-client</artifactId> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.epmet</groupId> |
|||
<artifactId>epmet-commons-tools</artifactId> |
|||
<version>2.0.0</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
|
|||
</project> |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 16:35 |
|||
*/ |
|||
public interface UserAnalysisConstant { |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
String REG_FLAG="reg"; |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
String PARTI_FLAG="parti"; |
|||
|
|||
String QUERY_USER_AGENCY_FAILED="查询用户所属机关信息失败"; |
|||
|
|||
/** |
|||
* 普通居民(已注册) |
|||
*/ |
|||
String REGISTERED_RESI= "居民"; |
|||
|
|||
/** |
|||
* 热心居民 |
|||
*/ |
|||
String WARMHEARTED="热心居民"; |
|||
|
|||
/** |
|||
* 党员 |
|||
*/ |
|||
String PARTYMEMBER="党员"; |
|||
|
|||
String DAY_TYPE="day"; |
|||
String MONTH_TYPE="month"; |
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 机关维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
public class DimAgencyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组织IDAGENCY_ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 客户网格维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
public class DimGridDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* GRID_ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 按日、按月查询注册用户数(参与用户数)增量折线图 入参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:57 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendFormDTO implements Serializable { |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPatiFlag不能为空", groups = {AddUserInternalGroup.class}) |
|||
private String regOrPatiFlag; |
|||
|
|||
/** |
|||
* day:日维度 | month:月维度 | (周、季、年)… |
|||
*/ |
|||
@NotBlank(message = "type不能为空", groups = {AddUserInternalGroup.class}) |
|||
private String type; |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:47 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -4558978951554887536L; |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空",groups = {AddUserInternalGroup.class}) |
|||
private String regOrPartiFlag; |
|||
|
|||
@NotBlank(message = "查询日期不能为空",groups = {AddUserInternalGroup.class}) |
|||
private String dateId; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直属网格注册用户数 入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:52 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1815903503939673149L; |
|||
|
|||
public interface AddUserInternalGroup { |
|||
} |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空", groups = {AddUserInternalGroup.class}) |
|||
private String regOrPartiFlag; |
|||
|
|||
@NotBlank(message = "查询日期不能为空", groups = {AddUserInternalGroup.class}) |
|||
private String dateId; |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 用户汇总信息 入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:31 |
|||
*/ |
|||
@Data |
|||
public class UserSummaryInfoFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1802471335671321322L; |
|||
public interface AddUserInternalGroup { |
|||
} |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空",groups = {AddUserInternalGroup.class}) |
|||
private String regOrPartiFlag; |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/23 9:13 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendResDTO implements Serializable { |
|||
private static final long serialVersionUID = 290620373673325352L; |
|||
private Integer regIncr; |
|||
private Integer warmIncr; |
|||
private Integer partymemberIncr; |
|||
private String dateIdOrMonthId; |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 按日、按月查询注册用户数(参与用户数)增量折线图 返参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:17 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendResultDTO implements Serializable { |
|||
/** |
|||
* 日期如果按日查询返回yyyy/MM/dd,如果按月返回yyyy/MM |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 居民、党员、热心居民返回中文描述 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 增量值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
// yyyyMMdd yyyyMM
|
|||
@JsonIgnore |
|||
private String dateOrMonthId; |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 21:45 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyResDTO implements Serializable { |
|||
private static final long serialVersionUID = 5807572279154511198L; |
|||
/** |
|||
* 机关id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 截止到本日参与用户总数 |
|||
*/ |
|||
private Integer regTotal; |
|||
|
|||
/** |
|||
* 截止到本日(参与用户中)居民总数 |
|||
*/ |
|||
private Integer resiTotal; |
|||
|
|||
/** |
|||
* 截止到本日(参与用户中)热心居民总数 |
|||
*/ |
|||
private Integer warmHeartedTotal; |
|||
|
|||
/** |
|||
* 截止到本日(参与用户中)党员总数 |
|||
*/ |
|||
private Integer partymemberTotal; |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:49 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 3038896791082755087L; |
|||
/** |
|||
* 辽阳路街道 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 数值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型:居民、党员、热心居民 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
@JsonIgnore |
|||
private Integer total; |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直属网格注册用户数(参与用户、注册用户通用类) |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 23:57 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridResDTO implements Serializable { |
|||
private static final long serialVersionUID = 2203260762393704885L; |
|||
private String gridId; |
|||
private Integer regTotal; |
|||
private Integer resiTotal; |
|||
private Integer warmHeartedTotal; |
|||
private Integer partymemberTotal; |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 直属网格注册用户数 返参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:54 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -7432747804212305863L; |
|||
|
|||
/** |
|||
* 网格名称:eg:第一网格 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 数值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型:居民、党员、热心居民 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
@JsonIgnore |
|||
private Integer total; |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 用户汇总信息 返参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:34 |
|||
*/ |
|||
@Data |
|||
public class UserSummaryInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4270726421611289755L; |
|||
/** |
|||
* 数据更新至yyyy.MM.dd |
|||
*/ |
|||
private String currentDate; |
|||
private String dateId; |
|||
/** |
|||
* 注册居民数 |
|||
*/ |
|||
private Integer regTotal; |
|||
|
|||
/** |
|||
* 参与用户数 |
|||
*/ |
|||
private Integer partiTotal; |
|||
|
|||
/** |
|||
* 党员数 |
|||
*/ |
|||
private Integer partymemberTotal; |
|||
|
|||
/** |
|||
* 党员占比 |
|||
*/ |
|||
private String partymemberProportion; |
|||
/** |
|||
* 热心居民数 |
|||
*/ |
|||
private Integer warmHeartedTotal; |
|||
|
|||
/** |
|||
* 热心居民占比 |
|||
*/ |
|||
private String warmHeartedProportion; |
|||
|
|||
@JsonIgnore |
|||
private BigDecimal partymemberProportionValue; |
|||
|
|||
@JsonIgnore |
|||
private BigDecimal warmHeartedProportionValue; |
|||
|
|||
@JsonIgnore |
|||
private String id; |
|||
|
|||
public UserSummaryInfoResultDTO(){ |
|||
this.currentDate=""; |
|||
this.regTotal=0; |
|||
this.partiTotal=0; |
|||
this.partymemberTotal=0; |
|||
this.partymemberProportion="0%"; |
|||
this.warmHeartedTotal=0; |
|||
this.warmHeartedProportion="0%"; |
|||
this.id=""; |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
StringBuffer s=new StringBuffer("20190305").insert(4,".").insert(7,"."); |
|||
System.out.println(s); |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package com.epmet.group.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 15:24 |
|||
*/ |
|||
public interface GroupConstant { |
|||
|
|||
String MONTH = "month"; |
|||
String DATE = "day"; |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.group.dto.form; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NonNull; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 12:07 |
|||
*/ |
|||
@Data |
|||
public class GroupIncrTrendFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1788937450915240575L; |
|||
|
|||
public interface GroupJava {} |
|||
|
|||
/** |
|||
* 类型 month:月 date:日 |
|||
*/ |
|||
@NotBlank(message = "type不能为空", groups = {GroupJava.class}) |
|||
private String type; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 14:30 |
|||
*/ |
|||
@Data |
|||
public class GridInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5301902590768338888L; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 12:03 |
|||
*/ |
|||
@Data |
|||
public class GroupIncrTrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5132636251609157706L; |
|||
|
|||
/** |
|||
* 日期 |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 值 【小组数量】 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 【小组数量】 |
|||
*/ |
|||
private String type; |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 11:56 |
|||
* 网格小组——下级机关小组数柱状图 |
|||
*/ |
|||
@Data |
|||
public class GroupSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8562403482616167221L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 11:56 |
|||
* 网格小组——下级机关小组数柱状图 |
|||
*/ |
|||
@Data |
|||
public class GroupSubGridResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3260124064513560994L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 11:05 |
|||
*/ |
|||
@Data |
|||
public class GroupSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 网格总数量 |
|||
*/ |
|||
private Integer gridTotalCount; |
|||
|
|||
/** |
|||
* 小组总数量 |
|||
*/ |
|||
private Integer groupTotalCount; |
|||
|
|||
/** |
|||
* 小组平均人数 |
|||
*/ |
|||
private Integer groupPeopleAvg; |
|||
|
|||
/** |
|||
* 小组人数中位数 |
|||
*/ |
|||
private Integer groupPeopleMedian; |
|||
|
|||
/** |
|||
* 数据更新至 时间 |
|||
*/ |
|||
private String deadline; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 14:02 |
|||
*/ |
|||
@Data |
|||
public class SubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2276056225590553307L; |
|||
|
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String agencyName; |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.epmet.issue.constant; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 14:07 |
|||
*/ |
|||
public interface IssueConstant { |
|||
String MONTH = "month"; |
|||
String DATE = "day"; |
|||
String VOTING_NAME = "表决中"; |
|||
String SHIFT_NAME = "已转项目"; |
|||
String CLOSED_NAME = "已关闭"; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.epmet.issue.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:32 |
|||
*/ |
|||
@Data |
|||
public class IssueIncrtrendFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 4408419854627376175L; |
|||
/** |
|||
* 类型,按日date 按月month |
|||
*/ |
|||
private String type; |
|||
} |
|||
@ -0,0 +1,206 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 14:11 |
|||
*/ |
|||
@Data |
|||
public class IssueDataDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 9136989870868730175L; |
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 组织名 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格名 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 年度ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 年度名 |
|||
*/ |
|||
private String yearName; |
|||
|
|||
/** |
|||
* 季度ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 季度名 |
|||
*/ |
|||
private String quarterName; |
|||
|
|||
/** |
|||
* 月度ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 月度名 |
|||
*/ |
|||
private String monthName; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 日期名 |
|||
*/ |
|||
private String dateName; |
|||
|
|||
/** |
|||
* 当日议题增量 |
|||
*/ |
|||
private Integer issueIncr; |
|||
|
|||
/** |
|||
* 议题总数 |
|||
*/ |
|||
private Integer issueTotal; |
|||
|
|||
/** |
|||
* 当日已转项目的议题数增量 |
|||
*/ |
|||
private Integer shiftProjectIncr; |
|||
|
|||
/** |
|||
* 已转项目的议题总数 |
|||
*/ |
|||
private Integer shiftProjectTotal; |
|||
|
|||
/** |
|||
* 已转项目所占百分比 |
|||
*/ |
|||
private BigDecimal shiftProjectPercent; |
|||
|
|||
/** |
|||
* 当日表决中议题数增量 |
|||
*/ |
|||
private Integer votingIncr; |
|||
|
|||
/** |
|||
* 表决中议题总数 |
|||
*/ |
|||
private Integer votingTotal; |
|||
|
|||
/** |
|||
* 表决中议题所占百分比 |
|||
*/ |
|||
private BigDecimal votingPercent; |
|||
|
|||
/** |
|||
* 当日已关闭议题数增量 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当日已关闭议题中已解决数量 |
|||
*/ |
|||
private Integer closedResolvedIncr; |
|||
|
|||
/** |
|||
* 当日已关闭议题中无需解决数量 |
|||
*/ |
|||
private Integer closedUnresolvedIncr; |
|||
|
|||
/** |
|||
* 已关闭议题总数 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 已关闭议题中已解决总数 |
|||
*/ |
|||
private Integer closedResolvedTotal; |
|||
|
|||
/** |
|||
* 已关闭议题中未解决总数 |
|||
*/ |
|||
private Integer closedUnresolvedTotal; |
|||
|
|||
/** |
|||
* 已关闭议题所占百分比 |
|||
*/ |
|||
private BigDecimal closedPercent; |
|||
|
|||
/** |
|||
* 已关闭议题中已解决百分比 |
|||
*/ |
|||
private BigDecimal closedResolvedPercent; |
|||
|
|||
/** |
|||
* 已关闭议题中未解决百分比 |
|||
*/ |
|||
private BigDecimal closedUnresolvedPercent; |
|||
|
|||
/** |
|||
* 当日已结案议题数 |
|||
*/ |
|||
private Integer closedCaseIncr; |
|||
|
|||
/** |
|||
* 当日已结案议题中已解决数 |
|||
*/ |
|||
private Integer closedCaseResolvedIncr; |
|||
|
|||
/** |
|||
* 当日已结案议题中未解决数 |
|||
*/ |
|||
private Integer closedCaseUnresolvedIncr; |
|||
|
|||
/** |
|||
* 已结案议题总数 |
|||
*/ |
|||
private Integer closedCaseTotal; |
|||
|
|||
/** |
|||
* 已结案议题中已解决总数 |
|||
*/ |
|||
private Integer closedCaseResolvedTotal; |
|||
|
|||
/** |
|||
* 已结案议题中未解决总数 |
|||
*/ |
|||
private Integer closedCaseUnresolvedTotal; |
|||
|
|||
/** |
|||
* 已结案议题中已解决百分比 |
|||
*/ |
|||
private BigDecimal closedCaseResolvedPercent; |
|||
|
|||
/** |
|||
* 已结案议题中未解决百分比 |
|||
*/ |
|||
private BigDecimal closedCaseUnresolvedPercent; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:30 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueIncrtrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 7762529188251385355L; |
|||
/** |
|||
* 日期 |
|||
*/ |
|||
private String date; |
|||
/** |
|||
* 状态(表决中,已转项目,已关闭) |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer value; |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:24 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2640337888693960513L; |
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
/** |
|||
* 组织名 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 类型 表决中,已转项目,已关闭 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer value; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:27 |
|||
*/ |
|||
@Data |
|||
public class IssueSubGridResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -3318384216762207856L; |
|||
/** |
|||
* 网格名 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 类型 表决中,已转项目,已关闭 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer value; |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:17 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -7959140755148294338L; |
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String agencyId; |
|||
/** |
|||
* 议题总数 |
|||
*/ |
|||
private Integer issueTotal; |
|||
/** |
|||
* 表决中数量 |
|||
*/ |
|||
private Integer votingTotal; |
|||
/** |
|||
* 已转项目数量 |
|||
*/ |
|||
private Integer shiftProjectTotal; |
|||
/** |
|||
* 已关闭数量 |
|||
*/ |
|||
private Integer closedTotal; |
|||
/** |
|||
* 表决中占比 |
|||
*/ |
|||
private String votingRatio; |
|||
/** |
|||
* 已转项目占比 |
|||
*/ |
|||
private String shiftProjectRatio; |
|||
/** |
|||
* 已关闭占比 |
|||
*/ |
|||
private String closedRatio; |
|||
/** |
|||
* 更新至日期 |
|||
*/ |
|||
private String dateName; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:21 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueSummaryPieResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -971115426789868580L; |
|||
/** |
|||
* 名称 表决中,已转项目,已关闭 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
/** |
|||
* 百分比 |
|||
*/ |
|||
private String ratio; |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.epmet.project.constant; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目 |
|||
**/ |
|||
public interface ProjectConstant { |
|||
|
|||
String DAY = "day"; |
|||
String MONTH = "month"; |
|||
|
|||
/** |
|||
* 根据Token获取组织信息失败 |
|||
*/ |
|||
String GET_AGENCYID = "根据Token获取组织信息失败"; |
|||
/** |
|||
* 参数异常 |
|||
*/ |
|||
String TYPE_EXCEPTION = "必要参数为空或参数格式错误"; |
|||
|
|||
} |
|||
@ -0,0 +1,182 @@ |
|||
/** |
|||
* 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.project.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
public class FactAgencyProjectDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id 【dim_customer.id】 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机关Id 【dim_agency.id】 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织Id【dim_agency.pid】 |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 日维度Id 【dim_date.id】 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周维度Id 【dim_week.id】 |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月维度Id 【dim_month.id】 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年维度Id 【dim_year.id】 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 截止当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal pendingRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案项目数 【当前组织及下级已结案项目总数】 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal closedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 |
|||
*/ |
|||
private Integer resolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 |
|||
*/ |
|||
private Integer unresolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 |
|||
*/ |
|||
private BigDecimal unresolvedRatio; |
|||
|
|||
/** |
|||
* 当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectIncr; |
|||
|
|||
/** |
|||
* 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 |
|||
*/ |
|||
private Integer pendingIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 |
|||
*/ |
|||
private Integer resolvedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 |
|||
*/ |
|||
private Integer unresolvedIncr; |
|||
|
|||
/** |
|||
* 删除标识 【0.未删除 1.已删除】 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.project.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-日/月数据查询-接口入参 |
|||
*/ |
|||
@Data |
|||
public class ProjectIncrTrendFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -4929038359220814068L; |
|||
|
|||
public interface ProjectIncr { |
|||
} |
|||
|
|||
/** |
|||
* 类型 month:代表月 date:代表日 |
|||
*/ |
|||
@NotBlank(message = "month / date 类型不能为空", groups = {ProjectIncr.class}) |
|||
private String type; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectIncrTrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 日期(2020/1/1;2020/1/2...) |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 类型对应数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String type; |
|||
|
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 不同类型对应数据 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String type; |
|||
|
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSubGridResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 不同类型对应数据 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String type; |
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 类型对应数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型对应百分比(10% 10.1% 10.01%小数点后两位) |
|||
*/ |
|||
@JsonIgnore |
|||
private BigDecimal ratioInt; |
|||
private String ratio; |
|||
|
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-汇总数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSummaryResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 项目总数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 更新日期 |
|||
*/ |
|||
private String dateName; |
|||
|
|||
/** |
|||
* 处理中总数 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 处理中占比 |
|||
*/ |
|||
@JsonIgnore |
|||
private BigDecimal pendingRatioInt; |
|||
private String pendingRatio; |
|||
|
|||
/** |
|||
* 已结案总数 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 已结案占比 |
|||
*/ |
|||
@JsonIgnore |
|||
private BigDecimal closedRatioInt; |
|||
private String closedRatio; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.epmet.publicity.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author jyy |
|||
* @CreateTime 2020/6/22 12:07 |
|||
*/ |
|||
@Data |
|||
public class TagFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1788937450915240575L; |
|||
|
|||
public interface GroupJava {} |
|||
|
|||
/** |
|||
* 获取数据条数;默认为10 |
|||
*/ |
|||
private Integer pageSize; |
|||
|
|||
/** |
|||
* 时间查询维度;日:date;月:month;季:quarter;年:year |
|||
*/ |
|||
@NotBlank(message = "type不能为空", groups = {GroupJava.class}) |
|||
private String type; |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
/** |
|||
* 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.publicity.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 文章发表数量—下级机关统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Data |
|||
public class FactPublishedAgencyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 发文数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 固定值:文章数量 |
|||
*/ |
|||
private String type="文章数量"; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级机关Id |
|||
*/ |
|||
private String pid; |
|||
|
|||
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue