Commit 58af7a1d by 宋珺琪

云搜数据分析

parent bc9172df
package com.founder.commonutils.model.newPublicEntity.hnkshrwEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zyc
* @since 2021-09-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ksh_st_rygx_rw")
@ApiModel(value="可视化任务对象", description="")
public class HnTbStRygxRw implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "任务名称")
@TableField("RWMC")
private String rwmc;
@TableField("RWID")
@TableId(value = "RWID", type = IdType.UUID)
@ApiModelProperty(value = "任务id")
private String rwid;
@ApiModelProperty(value = "excel名称")
@TableField("EXCEL_NAME")
private String excelName;
@ApiModelProperty(value = "excelId")
@TableField("EXCEL_ID")
private String excelId;
@ApiModelProperty(value = "excel名称")
@TableField("CREATE_NAME")
private String createName;
@ApiModelProperty(value = "excel创建时间")
@TableField("EXCEL_CREATE_TIME")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date excelCreateTime;
@ApiModelProperty(value = "数据量")
@TableField("DATA_COUNT")
private String dataCount;
@ApiModelProperty(value = "excel后缀")
@TableField("EXCEL_POSTFIX")
private String excelPostfix;
@ApiModelProperty(value = "创建时间")
@TableField("TASK_CREATE_TIME")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date taskCreateTime;
@ApiModelProperty(value = "父id")
@TableField("PARENT_ID")
private String parentId;
@ApiModelProperty(value = "子数据")
@TableField(exist = false)
private List<HnTbStRygxRw> children;
}
package com.founder.commonutils.model.newPublicEntity.hnkshrwEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author zyc
* @since 2021-09-08
*/
@Data
@ApiModel(value="HnTbStRygxRwDTO", description="")
public class HnTbStRygxRwDTO {
@ApiModelProperty(value = "任务id")
private String rwid;
@ApiModelProperty(value = "子集")
private List<RygxExcelDTO> child;
@ApiModelProperty(value = "任务名称")
private String rwmc;
@ApiModelProperty(value = "创建人名字")
private String createName;
@ApiModelProperty(value = "时间")
private Date taskCreateTime;
}
package com.founder.commonutils.model.newPublicEntity.hnkshrwEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@ApiModel(value="RygxExcelDTO", description="")
public class RygxExcelDTO {
@ApiModelProperty(value = "excel名字")
private String excelName;
@ApiModelProperty(value = "excelid")
private String excelId;
@ApiModelProperty(value = "excel创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date excelCreateTime;
@ApiModelProperty(value = "数据量")
private String dataCount;
}
package com.founder.commonutils.model.vo;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@Data
public class TokenInfo {
@SerializedName("access_token")
private String accessToken;
@SerializedName("refresh_token")
private String refreshToken;
@SerializedName("token_type")
private String tokenType;
@SerializedName("scope")
private String scope;
/**
* 过期时间
*/
@SerializedName("expires_in")
private int expiresIn;
}
package com.founder.commonutils.util;
import cn.hutool.core.exceptions.ExceptionUtil;
import com.founder.commonutils.model.vo.TokenInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.client.config.RequestConfig;
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.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import java.io.IOException;
import java.util.Map;
@Slf4j
public class HttpUtils {
private static RequestConfig requestConfig = null;
private static String tokenPath="";
static{
// 设置请求和传输超时时间
//setConnectTimeout:设置连接超时时间,单位毫秒。
//setSocketTimeout:请求获取数据的超时时间,单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。
//setConnectionRequestTimeout:设置从connect Manager获取Connection 超时时间,单位毫秒
requestConfig = RequestConfig.custom().setSocketTimeout(120000).setConnectTimeout(120000).build();
}
/**
* 静态属性注册配置文件中的值
* @param tokenPath
*/
@Value("${tokenPath}")
void setTokenPath(String tokenPath){
HttpUtils.tokenPath=tokenPath;
}
private static PoolingHttpClientConnectionManager cm =
new PoolingHttpClientConnectionManager();
public static String ytkdUrl;
@Value("${ytkdUrl}")
public void setYtkdUrl(String ytkdUrl) {
HttpUtils.ytkdUrl = ytkdUrl;
}
public static String doGet(String url) {
// 不是每次创建新的HttpClient对象,而是从连接池中获取HttpClient对象
CloseableHttpClient httpClient = HttpClients.custom()
.setConnectionManager(cm).build();
HttpGet httpget = new HttpGet(url);
String entityStr = "";
CloseableHttpResponse response = null;
try {
response = httpClient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null) {
entityStr = EntityUtils.toString(entity,"UTF-8");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (response != null) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
log.error(ExceptionUtil.getMessage(e));
}
}
return entityStr;
}
public static String doPost(String url){
// 不是每次创建新的HttpClient对象,而是从连接池中获取HttpClient对象
CloseableHttpClient httpClient = HttpClients.custom()
.setConnectionManager(cm).build();
HttpPost httpPost = new HttpPost(url);
String entityStr = "";
CloseableHttpResponse response = null;
try {
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
if (entity != null) {
entityStr = EntityUtils.toString(entity,"UTF-8");
}
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtil.getMessage(e));
} finally {
try {
if (response != null) {
response.close();
}
} catch (IOException e) {
e.printStackTrace();
log.error(ExceptionUtil.getMessage(e));
}
}
return entityStr;
}
/**
* 获取省厅接口token
* @return
*/
public static String getStToken(){
String result_token = "";
try{
//1 先比较已有token是否过期
long nowtime = System.currentTimeMillis();
//获取绝对路径下的token属性文件
String token= PropertieUtil.readTokenValue("st_token",tokenPath);
String expiration = PropertieUtil.readTokenValue("st_expiresIn",tokenPath);
//token值不存在
if(StringUtils.isEmpty(token) || StringUtils.isEmpty(expiration)){
result_token=readeWriteStToken(nowtime);
}else{
//token值已过期
if(nowtime > Long.valueOf(expiration)){
result_token=readeWriteStToken(nowtime);
}else{
result_token = token;
}
}
}catch (Exception e){
e.printStackTrace();
log.error(ExceptionUtil.getMessage(e));
}
return result_token;
}
/**
* 读写省厅的token值
* @param nowtime
* @return
*/
public static String readeWriteStToken(long nowtime){
String result_token="";
String appKey = PropertieUtil.readTokenValue("appKey",tokenPath);
String secretKey = PropertieUtil.readTokenValue("secretKey",tokenPath);
try {
TokenInfo tokenInfo = StInterfaceUtil.getToken(appKey, secretKey);
// 获取access_token
result_token = tokenInfo.getAccessToken();
log.info("The accessToken is:" + result_token);
//获取过期时间
String expires_in = String.valueOf(tokenInfo.getExpiresIn());
String result_expiration = nowtime+Integer.parseInt(expires_in)*1000+"";
//写入新的token值和本次token的过期时间
PropertieUtil.writeTokenProperties(tokenPath, "st_token", result_token);
PropertieUtil.writeTokenProperties(tokenPath, "st_expiresIn", result_expiration);
} catch (Exception e) {
e.printStackTrace();
log.error(ExceptionUtil.getMessage(e));
}
return result_token;
}
/**
* 请求的参数类型为json
* @param url
* @param json
* @return {username:"",pass:""}
*/
public static String doPostJson(String url, Map<String, String> headers, String json) {
// post请求返回结果
CloseableHttpClient httpClient = HttpClients.custom()
.setConnectionManager(cm).build();
String jsonResult = null;
HttpPost httpPost = new HttpPost(url);
// 设置请求和传输超时时间
httpPost.setConfig(requestConfig);
if(headers != null) {
for (String key : headers.keySet()) {
httpPost.setHeader(key, headers.get(key));
}
}
try{
//设置参数解决中文乱码
if (null != json){
StringEntity entity = new StringEntity(json,"utf-8");
entity.setContentEncoding("UTF-8");
entity.setContentType("application/json");
httpPost.setEntity(entity);
}
//发送请求
CloseableHttpResponse result = httpClient.execute(httpPost);
if (result.getStatusLine().getStatusCode() == HttpStatus.SC_OK){
// 读取服务器返回的json数据(然后解析)
jsonResult = EntityUtils.toString(result.getEntity(), "utf-8");
}else{
throw new Exception();
}
}catch (Exception e){
e.printStackTrace();
log.error(ExceptionUtil.getMessage(e));
}finally{
httpPost.releaseConnection();
}
return jsonResult;
}
/* public static String ytgsRequest(Map<String,Object> map) {
String resultStr=null;
//"b130a9b9137ae64d"; // 必须16位
String sKey = map.get("sKey").toString();
// 用户的token
//"28613b7819bb483a807bd652dfb36ddb";
String token = map.get("token").toString();
// OpenAPI的服务器IP
DopApiV1 sdk = new DopApiV1(sKey);
sdk.setServerName(ytkdUrl);
// 指定OpenApi Cgi名字
// "/rest/A-441900000000-ZKC-00004-00012-ES-002";
String scriptName =map.get("scriptName").toString();
// 填充URL请求参数
Map<String, String> params = new HashMap<>();
params.put("token", token);
List<Map<String,String>> paramList=(List<Map<String,String>>)map.get("param");
List<Map<String, String>> criterions11=new ArrayList<Map<String, String>>();
if(null!=paramList&&paramList.size()>0){
for(Map<String,String> paramMap:paramList){
String property=paramMap.get("property");
String operator=paramMap.get("operator");
String dataType=paramMap.get("dataType");
String value=paramMap.get("value");
Map<String, String> param = new HashMap<>();
param.put("property", property);
param.put("operator", operator);
param.put("dataType", dataType);
param.put("value", value);
criterions11.add(param);
}
}
List<Map<String, Object>> criterions=new ArrayList<Map<String, Object>>();
Map<String, Object> criterion1 = new HashMap<String, Object>();
criterion1.put("junction", "and");
criterion1.put("criterions", criterions11);
criterions.add(criterion1);
Map<String, Object> requestData = new HashMap<String, Object>();
requestData.put("$dataType", "Criteria");
requestData.put("criterions", criterions);
params.put("requestDataSql", JSON.toJSONString(requestData));
//封装seqId和时间戳
try {
params = sdk.getSignParams(params);
resultStr=sdk.decryptApi(scriptName, params, "POST", false);
} catch (DopApiException e) {
e.printStackTrace();
log.error("Request Failed. code:%d, msg:%s"+ExceptionUtil.getMessage(e));
}
return resultStr;
}*/
}
package com.founder.commonutils.util;
import com.founder.commonutils.model.vo.TokenInfo;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.net.URISyntaxException;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
public class StInterfaceUtil
{
// APIG 业务面浮动IP (需要根据实际情况修改)
private static final String APIG_MICROGW_FLOAT_IP = "68.26.19.197";
// API获取AppToken的URI
private static final String ACCESS_TOKEN_URI = "/v1/apigw/oauth2/token";
private static final String DATA_FORMAT = "yyyy-MM-dd HH:mm:ss";
/**
* 获取Token信息
*
* @param appKey 用户凭证中的 AppKey
* @param secretKey 用户凭证中的 SecretKey
* @return TokenInfo Token信息
*/
public static TokenInfo getToken(String appKey, String secretKey) throws HttpException
{
// 添加请求体内容
List<NameValuePair> pairs = new ArrayList<NameValuePair>();
pairs.add(new BasicNameValuePair("grant_type", "client_credentials"));
pairs.add(new BasicNameValuePair("client_id", appKey));
pairs.add(new BasicNameValuePair("client_secret", secretKey));
return request(pairs);
}
public static TokenInfo request(List<NameValuePair> data) throws HttpException
{
TokenInfo tokenInfoInfo = new TokenInfo();
SSLContext sslContext;
CloseableHttpClient client;
try
{
// 创建Http客户端,设置信任自签名证书
sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustSelfSignedStrategy()).useTLS().build();
SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(sslContext,
new AllowAllHostnameVerifier());
client = HttpClients.custom().setSSLSocketFactory(sslSocketFactory).build();
// 创建POST请求,添加URL
URIBuilder uriBuilder = new URIBuilder("https://" + APIG_MICROGW_FLOAT_IP + ":8343" + ACCESS_TOKEN_URI);
HttpPost httpPost = new HttpPost(uriBuilder.build());
httpPost.setEntity(new UrlEncodedFormEntity(data, "UTF-8"));
// 添加请求头
httpPost.setHeader(HTTP.CONTENT_TYPE, "application/x-www-form-urlencoded");
// 发送请求
HttpResponse response = client.execute(httpPost);
// 解析响应内容
if (response.getStatusLine().getStatusCode() == 200)
{
String tokenStr = EntityUtils.toString((response).getEntity());
tokenInfoInfo = toObject(tokenStr, TokenInfo.class);
}
else
{
throw new HttpException(response.getStatusLine() + EntityUtils.toString((response).getEntity()));
}
}
catch (NoSuchAlgorithmException e)
{
e.printStackTrace();
}
catch (KeyManagementException e)
{
e.printStackTrace();
}
catch (KeyStoreException e)
{
e.printStackTrace();
}
catch (URISyntaxException e)
{
e.printStackTrace();
}
catch (ClientProtocolException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
return tokenInfoInfo;
}
private static <T> T toObject(String json, Class<T> valueType)
{
Gson gson = new GsonBuilder().setDateFormat(DATA_FORMAT).serializeNulls().create();
return gson.fromJson(json, valueType);
}
}
package com.founder.publicapi.controller.YunSouController;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.URLUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.founder.commonutils.model.newPublicEntity.MapRestResult;
import com.founder.commonutils.model.newPublicEntity.hnkshEntity.*;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.HnTbStRygxRw;
import com.founder.commonutils.model.newPublicEntity.result.ApiException;
import com.founder.commonutils.model.newPublicEntity.result.Result;
import com.founder.commonutils.util.ExcelUtil;
import com.founder.publicapi.service.HnTbStRygxRwService;
import com.founder.publicapi.service.HnTbStRygxService;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* <p>
* 前端控制器
* </p>
*
* @author zyc
* @since 2021-09-08
*/
@RestController
@RequestMapping("/hnksh")
@Api(tags = "湖南可视化接口管理")
public class HnTbStRygxController {
@Autowired
HnTbStRygxService hnKshService;
@Autowired
HnTbStRygxRwService hnKshRwService;
@Autowired
RedisTemplate redisTemplate;
public static final String TEAM_KEY = "teamNum:"; //创建人+任务id+团伙数量
public static final String IMG_TASK_KEY = "imgKey";
@Value("${hnkshFilePath}")
private String HNKSH_FILE_PATH;
@Value("${hnkshDownloadFilePath}")
private String HNKSH_DOWNLOAD_FILE_PATH;
@Value("${hnkshDownloadExcelTemplatePath}")
private String HNKSH_DOWNLOAD_EXCEL_TEMPLATE_PATH;
/**
* 获取并分析团伙间的关系
*
* @param teamNum 共同联系人数量
* @param taskId 任务ID
* @param username 用户名
* @param currentPage 当前页
* @param pageSize 每页显示的数量
* @param lxrxm 联系人姓名
* @param lxrsfz 联系人身份证
* @param blxrxm 被联系人姓名
* @param blxrsfz 被联系人身份证
* @param rygx 人员关系
* @return resultList:团伙的具体信息
* children: 该团伙与其共同的联系人之间的关系
* name: 该团伙的人(bq有谁)
* thrTotal:该团伙的总人数(团伙人+共同联系人)
* total:团伙的个数
*/
@PostMapping("/getRythInfo")
@ApiOperation(value = "数据分析_获取团伙间的关系")
@OperLog(message = "数据分析_获取团伙间的关系", operation = OperationType.QUERY)
public Result getRythInfo(@RequestParam(name = "teamNum") Integer teamNum,
@RequestParam(name = "taskId") String taskId,
@RequestParam(name = "username") String username,
@RequestParam(name = "currentPage", defaultValue = "1") Integer currentPage,
@RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(name = "lxrxm", required = false) String lxrxm,
@RequestParam(name = "lxrsfz", required = false) String lxrsfz,
@RequestParam(name = "blxrxm", required = false) String blxrxm,
@RequestParam(name = "blxrsfz", required = false) String blxrsfz,
@RequestParam(name = "rygx", required = false) String rygx) {
//计算分页
int start = PageUtil.getStart(currentPage - 1, pageSize);
int end = PageUtil.getEnd(currentPage - 1, pageSize);
if (teamNum<2){
teamNum=2;
}
List<Map<String, Object>> rythInfoList;
Object o = redisTemplate.opsForValue().get(username + ":" + taskId + ":" + TEAM_KEY + teamNum);
if (o != null) {
rythInfoList = (List<Map<String, Object>>) o;
} else {
//分析团伙信息
rythInfoList = hnKshService.getRythInfo(teamNum, taskId);
if (rythInfoList == null) {
return Result.ok();
}
//保存到redis中
//KEY = 创建人 + 任务id + 团伙数量
redisTemplate.opsForValue().set(username + ":" + taskId + ":" + TEAM_KEY + teamNum, rythInfoList);
}
//条件查询
if (StringUtils.isNotBlank(lxrxm) || StringUtils.isNotBlank(lxrsfz) || StringUtils.isNotBlank(blxrxm) || StringUtils.isNotBlank(blxrsfz) || StringUtils.isNotBlank(rygx)) {
List<Map<String, Object>> conditionSearch = conditionSearch(lxrxm, lxrsfz, blxrxm, blxrsfz, start, end, rythInfoList, rygx);
removeChildren(conditionSearch);
return Result.ok().data("rows", conditionSearch).data("total", conditionSearch.size());
}
removeChildren(rythInfoList);
List<Map<String, Object>> resultList = CollUtil.sub(rythInfoList, start, end);
return Result.ok().data("rows", resultList).data("total", rythInfoList.size());
}
/**
* 移除Map中的children
* 返回json中的children值会出现太大情况无法格式化,为了方便移除
*
* @param info
*/
private void removeChildren(List<Map<String, Object>> info) {
for (Map<String, Object> map : info) {
map.remove("children");
}
}
/**
* 按条件查询团伙
*
* @param lxrxm 姓名
* @param lxrsfz 身份证
* @param blxrxm 联系人姓名
* @param blxrsfz 联系人身份证
* @param start 第几页
* @param end 每页显示的数量
* @param rythInfoList 所有团伙的集合
* @param rygx 人员关系
* @return
*/
public List<Map<String, Object>> conditionSearch(String lxrxm, String lxrsfz, String blxrxm, String blxrsfz, int start, int end, List<Map<String, Object>> rythInfoList, String rygx) {
List<Map<String, Object>> conditionSearchFromRythInfoList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
boolean flag = false;
boolean flag1 = false;
//联系人在children
if (StringUtils.isNotBlank(lxrxm) || StringUtils.isNotBlank(lxrsfz)) {
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) map.get("children");
for (HnTbStRygx item : lxrList) {
if (StringUtils.isNotBlank(lxrxm) && StringUtils.isNotBlank(lxrsfz)) {
if (lxrxm.equals(item.getDescription()) && lxrsfz.equals(item.getName())) {
flag1 = true;
break;
}
} else if (StringUtils.isNotBlank(lxrsfz)) {
if (lxrsfz.equals(item.getName())) {
flag1 = true;
break;
}
} else if (StringUtils.isNotBlank(lxrxm)) {
if (lxrxm.equals(item.getDescription())) {
flag1 = true;
break;
}
}
}
} else {
flag1 = true;
}
//被联系人在name中
if (StringUtils.isNotBlank(blxrxm) || StringUtils.isNotBlank(blxrsfz)) {
Set<Map<String, Object>> thrList = (Set<Map<String, Object>>) map.get("name");
for (Map<String, Object> th : thrList) {
if (StringUtils.isNotBlank(blxrxm) && StringUtils.isNotBlank(blxrsfz)) {
if (blxrxm.equals(th.get("xm")) && blxrsfz.equals(th.get("sfzh"))) {
flag = true;
break;
}
} else if (StringUtils.isNotBlank(blxrxm)) {
if (blxrxm.equals(th.get("xm"))) {
flag = true;
}
} else if (StringUtils.isNotBlank(blxrsfz)) {
if (blxrsfz.equals(th.get("sfzh"))) {
flag = true;
}
}
}
} else {
flag = true;
}
if (flag && flag1) {
conditionSearchFromRythInfoList.add(map);
}
}
//筛选出指定人员关系的children
if (StringUtils.isNotBlank(rygx)) {
for (int i = 0; i < conditionSearchFromRythInfoList.size(); i++) {
Map<String, Object> conditionMap = conditionSearchFromRythInfoList.get(i);
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) conditionMap.get("children");
Set<HnTbStRygx> childSet = new HashSet<>();
for (HnTbStRygx item : lxrList) {
if (strMatch(item.getValue(), rygx)) {
childSet.add(item);
}
}
if (childSet.isEmpty()) {
conditionSearchFromRythInfoList.remove(i);
i--;
} else {
conditionMap.put("children", childSet);
}
}
//更新团伙人数
getThPeopleCount(conditionSearchFromRythInfoList);
}
/* List nameset = new ArrayList<>();
for (int i = 0; i < conditionSearchFromRythInfoList.size(); i++) {
Map<String, Object> conditionMap = conditionSearchFromRythInfoList.get(i);
Set<HnTbStRygx> childSet = (Set<HnTbStRygx>) conditionMap.get("children");
for (HnTbStRygx name : childSet) {
HashMap<String, String> map = new HashMap<>();
map.put("sfzh",name.getSfzh());
map.put("xm",name.getXm());
nameset.add(map);
}
conditionMap.put("name",nameset);
}*/
List<Map<String, Object>> resultList = CollUtil.sub(conditionSearchFromRythInfoList, start, end);
return resultList;
}
/**
* 判断字符串中是否包含指定字符串
*
* @param value 字符串 【A,B,C,D】
* @param rygx 需要匹配的值 【A,D】
* @return
*/
public boolean strMatch(String value, String rygx) {
String[] strArr = rygx.split(",");
boolean[] flag = new boolean[strArr.length];
for (int i = 0; i < strArr.length; i++) {
flag[i] = value.contains(strArr[i]);
}
return BooleanUtil.and(flag);
}
/**
* 获取团伙人数
*
* @param conditionSearchFromRythInfoList
*/
private void getThPeopleCount(List<Map<String, Object>> conditionSearchFromRythInfoList) {
for (Map<String, Object> map : conditionSearchFromRythInfoList) {
Set<HnTbStRygx> childrenList = (Set<HnTbStRygx>) map.get("children");
Set<String> idSet = new HashSet<>();
for (HnTbStRygx hnTbStRygx : childrenList) {
String name = hnTbStRygx.getName();
String sfzh = hnTbStRygx.getSfzh();
idSet.add(name);
idSet.add(sfzh);
}
map.put("thrTotal", idSet.size());
}
}
/**
* 根据团伙ID返回可视化展示的格式
*
* @param id 团伙ID
* @param username 用户名
* @param taskId 任务ID
* @param rygx 人员关系
* @param lxrXm 联系人姓名
* @param lxrSfz 联系人身份证
* @param bLxrXm 被联系人姓名
* @param bLxrSfz 被联系人身份证
* @return
*/
@PostMapping("getRythInfoById")
@ApiOperation(value = "数据分析_可视化数据")
@OperLog(message = "数据分析_可视化数据", operation = OperationType.QUERY)
public MapRestResult getRythInfoById(@RequestParam("id") String id,
@RequestParam("teamNum")Integer teamNum,
@RequestParam("username") String username,
@RequestParam("taskId") String taskId,
@RequestParam(name = "rygx", required = false) String rygx,
@RequestParam(name = "lxrXm", required = false) String lxrXm,
@RequestParam(name = "lxrSfz", required = false) String lxrSfz,
@RequestParam(name = "bLxrXm", required = false) String bLxrXm,
@RequestParam(name = "bLxrSfz", required = false) String bLxrSfz) {
if (teamNum<2){
teamNum=2;
}
//团伙信息集合
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(username + ":" + taskId + ":" + TEAM_KEY + teamNum);
if (rythInfoList.size()==0){
return new MapRestResult(200,"暂无数据",null);
}
//指定团伙集合
List<Map<String, Object>> rythInfoByIdList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
rythInfoByIdList.add(map);
break;
}
}
//根据人员关系过滤children的值
if (StringUtils.isNotBlank(rygx)) {
Map<String, Object> conditionMap = rythInfoByIdList.get(0);
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) conditionMap.get("children");
Set<HnTbStRygx> childSet = new HashSet<>();
for (HnTbStRygx item : lxrList) {
if (strMatch(item.getValue(), rygx)) {
childSet.add(item);
}
}
conditionMap.put("children", childSet);
}
//根据人员关系过滤name的值
Set nameset = new HashSet();
Map<String, Object> conditionMap = rythInfoByIdList.get(0);
Set<HnTbStRygx> child = (Set<HnTbStRygx>) conditionMap.get("children");
for (HnTbStRygx name : child) {
HashMap<String, String> map = new HashMap<>();
map.put("sfzh",name.getSfzh());
map.put("xm",name.getXm());
nameset.add(map);
}
conditionMap.put("name",nameset);
//查询出所有联系人的name
List<HnTbStRygx> nameLists = hnKshService.getGroupNameByRwid(taskId);
Map<String, List<HnTbStRygx>> map = nameLists.stream().collect(Collectors.groupingBy(HnTbStRygx::getName));
List<List<HnTbStRygx>> nameList = map.values().stream()
.collect(Collectors.toList());
kshdata hnTbStRygxDTOS = packingData(rythInfoByIdList, nameList);
ArrayList<Object> re = new ArrayList<>();
re.add(hnTbStRygxDTOS);
return new MapRestResult(200,"ok",re.size(),hnTbStRygxDTOS);
}
/**
* 按照可视化的格式返回
*
* @param data 团伙的信息
* @param nameList 联系人的身份证集合
* @return
*/
public kshdata packingData(List<Map<String, Object>> data, List<List<HnTbStRygx>> nameList) {
// ThKshresult thKshresult = new ThKshresult();
// Hnkshresult hnkshresult = new Hnkshresult();
kshdata kshdata = new kshdata();
List<HnTbStRygxDTO> resultList = new ArrayList<>();
// dataSumup dataSumup = new dataSumup();
// List<String> sumup = new ArrayList<>();
//
for (Map<String, Object> team : data) {
//h获取指定团伙里的xm 和sfzh
Set<Map<String, String>> nameSet = (Set<Map<String, String>>) team.get("name");
//拿出children
Set<HnTbStRygx> childrenList = (Set<HnTbStRygx>) team.get("children");
for (int i = 0; i < nameList.size(); i++) {
HnTbStRygxDTO mergeDTOgjd = new HnTbStRygxDTO();
String name = nameList.get(i).get(i).getName();
String description = nameList.get(i).get(i).getDescription();
mergeDTOgjd.setId(name);
mergeDTOgjd.setLabel(description+"\n"+name);
Kshpropertice kshpropertice = new Kshpropertice();
kshpropertice.setId(name);
kshpropertice.setLabel(description+"\n"+name);
kshpropertice.setImgType("idcard");
kshpropertice.setBoderColor("#ff0000");
mergeDTOgjd.setProperties(kshpropertice);
resultList.add(mergeDTOgjd);
// sumup.add(name);
}
List<kshlinks> re =new ArrayList<>();
for (Map<String, String> stringMap : nameSet) {
String sfzh = stringMap.get("sfzh");
String xm = stringMap.get("xm");
//去children找出被联系人所有的联系人
for (HnTbStRygx rygx : childrenList) {
if (sfzh.equals(rygx.getSfzh())) {
kshlinks ks= new kshlinks();
String name = rygx.getName();
String value = rygx.getValue();
//links
kshlinks kshlink = new kshlinks();
kshlink.setSource(name);
kshlink.setTarget(sfzh);
kshlink.setLabel(value);
Linkspropertice linkspropertice = new Linkspropertice();
linkspropertice.setTime("2022-09-16 09:59:11");
linkspropertice.setSource(name);
linkspropertice.setTarget(sfzh);
linkspropertice.setLabel(value);
kshlink.setProperties(linkspropertice);
re.add(kshlink);
}
}
//组装 nodes
HnTbStRygxDTO mergeDTO = new HnTbStRygxDTO();
mergeDTO.setId(sfzh);
mergeDTO.setLabel(xm+"\n"+sfzh);
Kshpropertice kshpropertice = new Kshpropertice();
kshpropertice.setId(sfzh);
kshpropertice.setLabel(xm+"\n"+sfzh);
kshpropertice.setImgType("idcard");
kshpropertice.setBoderColor(null);
mergeDTO.setProperties(kshpropertice);
resultList.add(mergeDTO);
//添加到kshadata
kshdata.setNodes(resultList);
kshdata.setLinks(re);
// sumup.add(sfzh);
// dataSumup.setList(sumup);
// dataSumup.setName("根据团伙ID返回可视化展示的格式");
// thKshresult.setKshdata(kshdata);
// hnkshresult.setDataSumup(dataSumup);
}
}
return kshdata;
}
/**
* 下载文件
*
* @param response
* @param excelId Excel的ID
* @throws IOException
*/
@GetMapping("downloadFile")
@ApiOperation(value = "数据分析_下载文件")
@OperLog(message = "数据分析_下载文件", operation = OperationType.QUERY)
public void downloadFile(HttpServletResponse response, String excelId) throws IOException {
HnTbStRygxRw excelInfo = hnKshRwService.getOne(new QueryWrapper<HnTbStRygxRw>().eq("excel_id", excelId));
if (excelInfo == null) {
return;
}
String rwid = excelInfo.getParentId();
String createName = excelInfo.getCreateName();
String excelName = excelInfo.getExcelName();
String postfix = excelInfo.getExcelPostfix();
System.out.println(createName);
//下载的路径
String path = HNKSH_DOWNLOAD_FILE_PATH + createName + "/" + rwid + "/" + excelId + "." + postfix;
//防止url中出现中文
String encode = URLUtil.encode(path);
//从URL中获取流
InputStream inputStream = URLUtil.getStream(new URL(encode));
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-Disposition", "attachment;filename=" + URLEncoder.encode(excelName, "utf-8"));
response.setHeader("Access-Control-Expose-Headers", "content-Disposition");
OutputStream outputStream = response.getOutputStream();
Workbook workbook = null;
if (postfix.equals("xls")) {
workbook = new HSSFWorkbook(inputStream);
} else {
workbook = new XSSFWorkbook(inputStream);
}
workbook.write(outputStream);
outputStream.flush();
outputStream.close();
}
/**
* 下载Excel模板
*
* @param response
* @throws Exception
*/
@ApiOperation(value = "下载Excel模板")
@OperLog(message = "下载Excel模板", operation = OperationType.QUERY)
@GetMapping("downloadExcelTemplate")
public void downloadExcelTemplate(HttpServletResponse response) throws Exception {
//下载的路径
//防止url中出现中文
String path = URLUtil.encode(HNKSH_DOWNLOAD_EXCEL_TEMPLATE_PATH);
//从URL中获取流
InputStream inputStream = URLUtil.getStream(new URL(path));
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-Disposition", "attachment;filename=" + URLEncoder.encode("上传文件模板.xls", "utf-8"));
response.setHeader("Access-Control-Expose-Headers", "content-Disposition");
OutputStream outputStream = response.getOutputStream();
HSSFWorkbook workbook = new HSSFWorkbook(inputStream);
// XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
workbook.write(outputStream);
outputStream.flush();
outputStream.close();
}
/**
* 根据ExcelID删除文件(单个)
*
* @param excelId
* @return
*/
@ApiOperation(value = "数据分析_删除文件")
@OperLog(message = "数据分析_删除文件", operation = OperationType.DELETE)
@GetMapping("delFileByExcelId")
@Transactional
public Result delFileByExcelId(String excelId) {
HnTbStRygxRw excelInfo = hnKshRwService.getOne(new QueryWrapper<HnTbStRygxRw>().eq("excel_id", excelId));
if (excelInfo == null) {
return Result.ok().message("不存在该文件");
}
String taskId = excelInfo.getParentId();
String createName = excelInfo.getCreateName();
String postfix = excelInfo.getExcelPostfix();
//删除 ksh_st_rygx_rw表的Excel信息
hnKshRwService.remove(new QueryWrapper<HnTbStRygxRw>().eq("EXCEL_ID", excelId));
//删除ksh_st_rygx的数据
hnKshService.remove(new QueryWrapper<HnTbStRygx>().eq("EXCEL_ID", excelId));
//删除redis上该任务编号的数据
deleteByPrexInRedis(createName + ":" + taskId + "*");
//删除服务器上的文件
FileUtil.del(HNKSH_FILE_PATH + createName + "/" + taskId + "/" + excelId + "." + postfix);
return Result.ok().message("删除成功");
}
/**
* 根据任务ID删除任务
*
* @param taskId
* @return
*/
@ApiOperation(value = "数据分析_删除任务")
@OperLog(message = "数据分析_删除任务", operation = OperationType.DELETE)
@PostMapping("delFileByTaskId")
@Transactional
public Result delFileByTaskId(String taskId) {
List<HnTbStRygxRw> rwList = hnKshRwService.list(new QueryWrapper<HnTbStRygxRw>().eq("RWID", taskId));
if (rwList.isEmpty()) {
return Result.ok().message("不存在该任务");
}
//删除 ksh_st_rygx_rw表的Excel信息
//1.删除任务
hnKshRwService.remove(new QueryWrapper<HnTbStRygxRw>().eq("RWID", taskId));
//2.删除该任务下的Excel
hnKshRwService.remove(new QueryWrapper<HnTbStRygxRw>().eq("PARENT_ID", taskId));
//3.删除ksh_st_rygx的数据
hnKshService.remove(new QueryWrapper<HnTbStRygx>().eq("RWID", taskId));
//删除服务器上的文件
String createName = rwList.get(0).getCreateName();
FileUtil.del(HNKSH_FILE_PATH + createName + "/" + taskId);
//删除redis上该任务编号的数据
deleteByPrexInRedis(createName + ":" + taskId + "*");
return Result.ok().message("删除成功");
}
/**
* 导入Excel表中数据到数据库中
*
* @param files 文件
* @param username 用户名
* @param taskId 任务ID
* @return
* @throws IOException
*/
@ApiOperation(value = "数据分析_上传文件")
@OperLog(message = "数据分析_上传文件", operation = OperationType.ADD)
@PostMapping("uploadFile")
@Transactional
public Result uploadFile(@RequestParam(name = "files") MultipartFile[] files,
@RequestParam(name = "username") String username,
@RequestParam(name = "taskId") String taskId) {
HnTbStRygxRw rwid = hnKshRwService.getOne(new QueryWrapper<HnTbStRygxRw>().eq("RWID", taskId));
if (rwid == null) {
return Result.error().message("不存在该任务编号");
}
for (MultipartFile file : files) {
//生成Excel表的ID
String fileName = IdUtil.simpleUUID();
//将Excel保存到服务器上
saveInResources(file, taskId, username, fileName);
//将Excel的基本信息保存到 ksh_st_rygx_rw表中
List data = readAndSaveExcel(file, username, taskId, fileName);
//将Excel的数据保存保存ksh_st_rygx表中
saveDataInDB(data, taskId, fileName);
}
//重置Redis上的数据
deleteByPrexInRedis(username + ":" + taskId + "*");
return Result.ok().data("taskId", taskId);
}
/**
* 将Excel数据保存到数据库
*
* @param data
* @param taskId
* @param excelId
*/
public void saveDataInDB(List<HnTbStRygx> data, String taskId, String excelId) {
for (HnTbStRygx rygx : data) {
rygx.setRwid(taskId);
rygx.setExcelId(excelId);
}
hnKshService.saveBatch(data);
}
/**
* 将Excel信息保存到数据库
*
* @param filename Excel文件名
* @param taskId 任务ID
* @param excelId ExcelID
* @param username 用户名
* @param totalRowNums Excel的行数
* @param postfix Excel文件的后缀
*/
public void saveExcelInfoInDB(String filename, String taskId, String excelId, String username, int totalRowNums, String postfix) {
HnTbStRygxRw rygxRw = new HnTbStRygxRw();
rygxRw.setExcelId(excelId);
rygxRw.setExcelName(filename);
rygxRw.setExcelPostfix(postfix);
rygxRw.setCreateName(username);
rygxRw.setDataCount(String.valueOf(totalRowNums - 1));
rygxRw.setExcelCreateTime(new Date());
rygxRw.setParentId(taskId);
hnKshRwService.save(rygxRw);
}
/**
* 将Excel保存到resources文件夹下
* 文件夹命名:用户名 + 任务Id
*
* @param file Excel
* @param taskId 任务Id
* @param username 用户名
* @param fileName Excel文件名
*/
public void saveInResources(MultipartFile file, String taskId, String username, String fileName) {
//判断文件类型
String originalName = file.getOriginalFilename().toLowerCase(Locale.ROOT);
if (!originalName.endsWith("xls") && !originalName.endsWith("xlsx")) {
throw new ApiException(201, "上传失败,请选择xls或xlsx文件");
}
String postfix = originalName.substring(originalName.lastIndexOf("."));
String path = HNKSH_FILE_PATH + username + "/" + taskId + "/" + fileName + postfix;
try {
FileUtil.writeBytes(file.getBytes(), path);
// FtpUtil.uploadFile(fileName,file.getInputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 读取Excel表数据并保存
*
* @param file
* @param username
* @param taskId
* @param excelId
* @return
*/
public List readAndSaveExcel(MultipartFile file, String username, String taskId, String excelId) {
List resultList = null;
int totalRowNums;
int abandonFields = 7;
try {
String filename = file.getOriginalFilename();
String postfix = filename.substring(filename.lastIndexOf(".") + 1);
//根据Excel文件后缀读取数据
if (postfix.equals("xls")) {
Map xlsExcelMap = ExcelUtil.readXLSExcel(file.getInputStream(), HnTbStRygx.class, abandonFields);
resultList = (List) xlsExcelMap.get("dataList");
totalRowNums = (int) xlsExcelMap.get("totalRowNums");
} else {
Map xlsxExcelMap = ExcelUtil.readXLSXExcel(file.getInputStream(), HnTbStRygx.class, abandonFields);
resultList = (List) xlsxExcelMap.get("dataList");
totalRowNums = (int) xlsxExcelMap.get("totalRowNums");
}
//保存Excel信息数据
saveExcelInfoInDB(filename, taskId, excelId, username, totalRowNums, postfix);
} catch (Exception e) {
e.printStackTrace();
}
return resultList;
}
/**
* 导出Excel
*
* @param response
* @param id
* @param teamNum
* @param username
* @param taskId
* @param rygx
* @throws IOException
*/
@ApiOperation(value = "数据分析_导出")
@OperLog(message = "数据分析_导出", operation = OperationType.QUERY)
@PostMapping("export")
public void export(HttpServletResponse response,
@RequestParam("id") String id,
@RequestParam("teamNum") Integer teamNum,
@RequestParam("username") String username,
@RequestParam("taskId") String taskId,
@RequestParam(name = "rygx", required = false) String rygx) throws IOException {
if (teamNum<2){
teamNum=2;
}
System.out.println(teamNum);
//redis中取出数据
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(username + ":" + taskId + ":" + TEAM_KEY + teamNum);
//根据条件进行过滤
Map<String, Object> exportMap = new HashMap<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
exportMap.put("data", map.get("children"));
break;
}
}
if (StringUtils.isNotBlank(rygx)) {
Set<HnTbStRygx> lxrList = (Set<HnTbStRygx>) exportMap.get("data");
Set<HnTbStRygx> childSet = new HashSet<>();
for (HnTbStRygx item : lxrList) {
if (strMatch(item.getValue(), rygx)) {
childSet.add(item);
}
}
exportMap.put("data", childSet);
}
//导出Excel
Set<HnTbStRygx> children = (Set<HnTbStRygx>) exportMap.get("data");
List<HnRygxExport> exportList = new ArrayList();
for (HnTbStRygx hnTbStRygx : children) {
HnRygxExport export = new HnRygxExport();
export.setDescription(hnTbStRygx.getDescription());
export.setName(hnTbStRygx.getName());
export.setXm(hnTbStRygx.getXm());
export.setXb(hnTbStRygx.getXb());
export.setMz(hnTbStRygx.getMz());
export.setSfzh(hnTbStRygx.getSfzh());
export.setBj(hnTbStRygx.getBj());
export.setZhpf(hnTbStRygx.getZhpf());
/*export.setTzz(hnTbStRygx.getTzz());
export.setThh(hnTbStRygx.getThh());
export.setHy(hnTbStRygx.getHy());
export.setLj(hnTbStRygx.getLj());
export.setTjg(hnTbStRygx.getTjg());
export.setTltcc(hnTbStRygx.getTltcc());
export.setTzj(hnTbStRygx.getTzj());
export.setTcrj(hnTbStRygx.getTcrj());
export.setTcwz(hnTbStRygx.getTcwz());
export.setTary(hnTbStRygx.getTary());
export.setTzj(hnTbStRygx.getTzj());
export.setZttary(hnTbStRygx.getZttary());
export.setZttcx(hnTbStRygx.getZttcx());*/
export.setValue(hnTbStRygx.getValue());
exportList.add(export);
}
HSSFWorkbook workbook = ExcelUtil.exportData(exportList);
String fileName = IdUtil.simpleUUID() + ".xls";
response.setContentType("application/vnd.ms-excel");
response.setHeader("content-Disposition", "attachment;filename=" + fileName);
response.setHeader("Access-Control-Expose-Headers", "content-Disposition");
OutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
outputStream.flush();
outputStream.close();
}
/**
* 删除redis上的key
*
* @param prex
*/
private void deleteByPrexInRedis(String prex) {
Set keys = redisTemplate.keys(prex);
if (CollUtil.isNotEmpty(keys)) {
redisTemplate.delete(keys);
}
}
/**
* 根据指定团伙获取并保存人员图片到数据库
*
* @param id
* @param teamNum
* @param taskId
* @param username
* @return
*/
@OperLog(message = "根据指定团伙获取并保存人员图片到数据库", operation = OperationType.ADD)
@ApiOperation(value = "根据指定团伙获取并保存人员图片到数据库")
@GetMapping("getAndSaveImg")
public Result getAndSaveImg(@RequestParam(name = "id") String id,
@RequestParam(name = "teamNum") Integer teamNum,
@RequestParam(name = "taskId") String taskId,
@RequestParam(name = "username") String username) {
//图片key
String imgKey = IMG_TASK_KEY + ":" + username + ":" + taskId + ":" + id;
//团伙信息key
String infoKey = username + ":" + taskId + ":" + TEAM_KEY + teamNum;
//判断任务是否在执行中
//执行中
if (redisTemplate.hasKey(imgKey)) {
throw new ApiException(207, "图片正在导入中,请勿重复操作");
}
//获取团伙信息集合
List<Map<String, Object>> rythInfoList = (List<Map<String, Object>>) redisTemplate.opsForValue().get(infoKey);
if (rythInfoList.isEmpty()) {
return Result.error().message("无团伙信息,获取照片失败");
}
//查询出指定团伙集合
List<Map<String, Object>> rythInfoByIdList = new ArrayList<>();
for (Map<String, Object> map : rythInfoList) {
if (id.equals(map.get("id").toString())) {
rythInfoByIdList.add(map);
break;
}
}
try {
//创建任务
redisTemplate.opsForValue().set(imgKey, "1", 1, TimeUnit.DAYS);
//保存
hnKshService.getAndSaveImg(rythInfoByIdList, taskId, teamNum);
} catch (Exception e) {
//出现异常时删除redis上的任务
deleteByPrexInRedis(imgKey);
}
//获取保存后的数据
List<Map<String, Object>> rythInfo = hnKshService.getRythInfo(teamNum, taskId);
if (rythInfo == null) {
throw new ApiException(210, "重新获取数据失败,请检查");
}
for (int i = 0; i < rythInfo.size(); i++) {
//替换children数据
rythInfoList.get(i).put("children", rythInfo.get(i).get("children"));
}
//更新redis上的数据
redisTemplate.opsForValue().set(infoKey, rythInfoList);
//删除任务
deleteByPrexInRedis(imgKey);
return Result.ok();
}
}
package com.founder.publicapi.controller.YunSouController;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.HnTbStRygxRw;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.HnTbStRygxRwDTO;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.RygxExcelDTO;
import com.founder.commonutils.model.newPublicEntity.result.Result;
import com.founder.commonutils.util.StringUtil;
import com.founder.publicapi.service.HnTbStRygxRwService;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zyc
* @since 2021-09-08
*/
@RestController
@RequestMapping("/hnkshrw")
@Api(tags = "湖南可视化任务接口管理")
public class HnTbStRygxRwController {
@Autowired
HnTbStRygxRwService hnKshRwService;
/**
* 创建任务
* @param taskName 任务名称
* @param username 用户名
* @return
*/
@PostMapping("createTask")
@ApiOperation(value = "数据分析_创建任务")
@OperLog(message = "数据分析_创建任务", operation = OperationType.ADD)
public Result createTask(@RequestParam("taskName") String taskName, @RequestParam("username") String username) {
HnTbStRygxRw hnTbStRygxRw = new HnTbStRygxRw();
String rwid = IdUtil.simpleUUID();
hnTbStRygxRw.setRwid(rwid);
hnTbStRygxRw.setCreateName(username);
hnTbStRygxRw.setRwmc(taskName);
hnTbStRygxRw.setTaskCreateTime(new Date());
hnKshRwService.save(hnTbStRygxRw);
return Result.ok().data("taskId", rwid);
}
/**
* 获取任务列表
* @param taskName
* @param startTime
* @param endTime
* @param currentPage
* @param pageSize
* @param username
* @return
*/
@PostMapping("getTaskInfo")
@ApiOperation(value = "数据分析_获取任务列表")
@OperLog(message = "数据分析_获取任务列表", operation = OperationType.QUERY)
public Result getTaskInfo(@RequestParam(name = "taskName", required = false) String taskName,
@RequestParam(name = "startTime", required = false)@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime startTime,
@RequestParam(name = "endTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")LocalDateTime endTime,
@RequestParam(name = "currentPage", defaultValue = "1") Integer currentPage,
@RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize,
@RequestParam(name = "username",required = false) String username) {
QueryWrapper<HnTbStRygxRw> wrapper = new QueryWrapper<>();
if (StringUtils.isNotBlank(taskName)) {
wrapper.like("RWMC", taskName);
}
if (ObjectUtil.isNotNull( startTime) && ObjectUtil.isNotNull(endTime)) {
wrapper.apply("TASK_CREATE_TIME between'" + startTime.toString() + "' and '" + endTime.toString() +"'" );
} else if (ObjectUtil.isNotNull( startTime)) {
wrapper.apply("TASK_CREATE_TIME >= '" + startTime.toString() +"'" );
} else if (ObjectUtil.isNotNull(endTime)) {
wrapper.apply("TASK_CREATE_TIME <= '" + endTime.toString() +"'" );
}
wrapper.eq(!StringUtil.isEmpty(username),"CREATE_NAME", username);
wrapper.eq("PARENT_ID","0");
wrapper.orderByDesc("TASK_CREATE_TIME");
Page page = new Page(currentPage,pageSize);
IPage<HnTbStRygxRw> iPage = hnKshRwService.page(page, wrapper);
List<HnTbStRygxRw> records = iPage.getRecords();
List<HnTbStRygxRwDTO> resultList = new ArrayList<>();
for (HnTbStRygxRw record : records) {
String rwid = record.getRwid();
List<RygxExcelDTO> list = hnKshRwService.queryTaskChildren(rwid, ObjectUtil.isNull(startTime)? null:startTime.toString(),ObjectUtil.isNull(endTime)? null:endTime.toString());
HnTbStRygxRwDTO dto = new HnTbStRygxRwDTO();
dto.setRwid(rwid);
dto.setRwmc(record.getRwmc());
dto.setCreateName(record.getCreateName());
dto.setChild(list);
dto.setTaskCreateTime(record.getTaskCreateTime());
resultList.add(dto);
}
return Result.ok().data("data",resultList).data("total",iPage.getTotal());
}
}
package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zyc
* @since 2021-09-08
*/
public interface HnTbStRygxMapper extends BaseMapper<HnTbStRygx> {
List<HnTbStRygx> getSfzhList(@Param("teamNum") Integer teamNum, @Param("taskId") String taskId);
List<Map<String, Object>> getXmAndSfzhBySfzh(@Param("sfzh") String sfzh, @Param("taskId") String taskId);
List<HnTbStRygx> getInfoBySfzh(@Param("sfzh") String sfzh, @Param("nameList") List<String> nameList, @Param("taskId") String taskId);
List<HnTbStRygx> getAllSfzhList();
List<HnTbStRygx> getGroupNameByRwid(@Param("taskId") String taskId);
List<String> getBimgIsNullByTaskId(@Param("taskId")String taskId);
List<String> getImgIsNullByTaskId(@Param("taskId")String taskId);
}
package com.founder.publicapi.mapper.mysqlMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.HnTbStRygxRw;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.RygxExcelDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zyc
* @since 2021-09-08
*/
public interface HnTbStRygxRwMapper extends BaseMapper<HnTbStRygxRw> {
List<RygxExcelDTO> queryTaskChildren(@Param("rwid") String rwid, @Param("startTime")String startTime, @Param("endTime")String endTime);
}
<?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.founder.publicapi.mapper.mysqlMapper.HnTbStRygxMapper">
<!-- select xmlagg(xmlparse(content name or ',' wellformed) order by name).getclobval() as name, sfzh-->
<select id="getSfzhList" resultType="com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx">
select concat(group_concat(name order by name),',')name,sfzh
from ksh_st_rygx
where rwid = #{taskId}
and sfzh in (select sfzh
from ksh_st_rygx
where rwid = #{taskId}
group by sfzh
having count(*) >= #{teamNum})
group by sfzh
</select>
<select id="getXmAndSfzhBySfzh" resultType="java.util.Map">
select xm as "xm", sfzh as "sfzh"
from ksh_st_rygx
where sfzh = #{sfzh}
and rwid = #{taskId}
group by xm, sfzh
</select>
<select id="getInfoBySfzh" resultType="com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx">
select
name,description,xm,xb,mz,sfzh,bj,zhpf,
trim( TRAILING ',' FROM RTRIM( CONCAT (
case when tzz != '0' then '同住址,' else '' end ,
case when thh != '0' then '同户号,' else ''end ,
case when hy != '0' then '婚姻,' else '' end ,
case when lj != '0' then '邻居,' else '' end ,
case when tjg != '0' then '同机构,' else '' end ,
case when tltcc != '0' then '铁路同乘车,' else '' end ,
case when tzj != '0' then '同值机,' else '' end ,
case when tcrj != '0' then '同出入境,' else ''end ,
case when tcwz != '0' then '同车违章,' else ''end ,
case when tary != '0' then '同案人员,' else ''end ,
case when tzs != '0' then '同住宿,' else ''end ,
case when zttary != '0' then '在逃同案人员' when zttcx != '0' then '在逃同撤销' else ''end
))) as value
from ksh_st_rygx where rwid = #{taskId} and sfzh = #{sfzh} and name in
<foreach collection="nameList" open="(" close=")" separator="," item="item">
#{item}
</foreach>
</select>
<!-- <select id="getAllSfzhList" resultType="java.lang.String">
SELECT DISTINCT sfzh
from ksh_st_rygx
where sfzh in (select sfzh from ksh_st_rygx GROUP BY sfzh having count(*) > 1)
</select>-->
<select id="getAllSfzhList" resultType="com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx">
select name,
xmlagg(xmlparse(content sfzh || ',' wellformed) order by sfzh).getclobval() sfzh
from ksh_st_rygx
group by name
</select>
<select id="getGroupNameByRwid" resultType="com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx">
select name,description from ksh_st_rygx where rwid = #{taskId}
</select>
<select id="getBimgIsNullByTaskId" resultType="java.lang.String">
select sfzh from ksh_st_rygx where rwid = #{taskId} and bimg is null group by sfzh
</select>
<select id="getImgIsNullByTaskId" resultType="java.lang.String">
select name from ksh_st_rygx where rwid = #{taskId} and img is null group by name
</select>
</mapper>
<?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.founder.publicapi.mapper.mysqlMapper.HnTbStRygxRwMapper">
<select id="queryTaskChildren" resultType="com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.RygxExcelDTO">
SELECT
EXCEL_NAME,
EXCEL_ID,
EXCEL_CREATE_TIME,
DATA_COUNT
FROM ksh_st_rygx_rw
WHERE 1=1
<if test="rwid != null and rwid != ''">
and PARENT_ID = #{rwid , jdbcType=VARCHAR}
</if>
ORDER BY EXCEL_CREATE_TIME DESC
</select>
</mapper>
package com.founder.publicapi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.HnTbStRygxRw;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.RygxExcelDTO;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author zyc
* @since 2021-09-08
*/
public interface HnTbStRygxRwService extends IService<HnTbStRygxRw> {
List<RygxExcelDTO> queryTaskChildren(String rwid, String startTime, String endTime);
}
package com.founder.publicapi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author zyc
* @since 2021-09-08
*/
public interface HnTbStRygxService extends IService<HnTbStRygx> {
List<Map<String, Object>> getRythInfo(Integer teamNum,String taskId);
void getAndSaveImg(List<Map<String, Object>> rythInfoList, String taskId, Integer teamNum) throws Exception;
List<HnTbStRygx> getGroupNameByRwid(String taskId);
}
package com.founder.publicapi.service.serviceimpl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.HnTbStRygxRw;
import com.founder.commonutils.model.newPublicEntity.hnkshrwEntity.RygxExcelDTO;
import com.founder.publicapi.mapper.mysqlMapper.HnTbStRygxRwMapper;
import com.founder.publicapi.service.HnTbStRygxRwService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author zyc
* @since 2021-09-08
*/
@Service
public class HnTbStRygxRwServiceImpl extends ServiceImpl<HnTbStRygxRwMapper, HnTbStRygxRw> implements HnTbStRygxRwService {
@Override
public List<RygxExcelDTO> queryTaskChildren(String rwid, String startTime, String endTime) {
return baseMapper.queryTaskChildren(rwid,startTime,endTime);
}
}
package com.founder.publicapi.service.serviceimpl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.founder.commonutils.model.newPublicEntity.hnkshEntity.HnTbStRygx;
import com.founder.commonutils.util.HttpUtils;
import com.founder.publicapi.mapper.mysqlMapper.HnTbStRygxMapper;
import com.founder.publicapi.service.HnTbStRygxService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.*;
/**
* <p>
* 服务实现类
* </p>
*
* @author zyc
* @since 2021-09-08
*/
@Service
public class HnTbStRygxServiceImpl extends ServiceImpl<HnTbStRygxMapper, HnTbStRygx> implements HnTbStRygxService {
@Autowired
HnTbStRygxMapper hnKshMapper;
@Override
public List<Map<String, Object>> getRythInfo(Integer teamNum, String taskId) {
if (teamNum < 2) {
teamNum = 2;
}
return searchMoreTeamList(teamNum, taskId);
}
@Override
public void getAndSaveImg(List<Map<String, Object>> rythInfoList, String taskId, Integer teamNum) throws Exception {
Map<String, Object> team = rythInfoList.get(0);
//1.获取图片并更新数据库
ExecutorService executorPool = new ThreadPoolExecutor(5, 10, 3, TimeUnit.SECONDS, new LinkedBlockingDeque<>(10000), Executors.defaultThreadFactory(), new ThreadPoolExecutor.DiscardOldestPolicy());
CompletableFuture<Void> sfzhFuture = CompletableFuture.runAsync(() -> {
//name是被联系人 拿sfzh
Set<String> downloadNameSet = new HashSet<>();
Set<Map<String, String>> nameSet = (Set<Map<String, String>>) team.get("name");
for (Map<String, String> nameMap : nameSet) {
String sfzh = nameMap.get("sfzh");
downloadNameSet.add(sfzh);
}
//取数据库中查看bimg为空的的sfzh
List<String> nullOfSfzhList = baseMapper.getBimgIsNullByTaskId(taskId);
List<String> sfzh_intersection = (List<String>) CollUtil.intersection(downloadNameSet, nullOfSfzhList);
if (sfzh_intersection.size() > 0) {
for (String sfzh : sfzh_intersection) {
String json = "{\"sfzh\": \"" + sfzh + "\"}";
String result = HttpUtils.doPostJson("http://68.174.25.99:8051/ryxxQg", null, json);
JSONObject jsonObject = JSONObject.parseObject(result);
try {
String data = jsonObject.get("data").toString();
if (StringUtils.isNotBlank(data)) {
String base64ForImg = (String) JSONObject.parseObject(data).get("img");
if (StringUtils.isNotBlank(base64ForImg)) {
HnTbStRygx hnTbStRygx = new HnTbStRygx();
hnTbStRygx.setBimg(base64ForImg);
baseMapper.update(hnTbStRygx, new UpdateWrapper<HnTbStRygx>().eq("sfzh", sfzh).eq("RWID", taskId));
}
}
} catch (Exception e) {
}
}
}
}, executorPool);
CompletableFuture<Void> nameFuture = CompletableFuture.runAsync(() -> {
//children是联系人 拿name
Set<String> downloadSfzhSet = new HashSet<>();
Set<HnTbStRygx> childrenList = (Set<HnTbStRygx>) team.get("children");
for (HnTbStRygx hnTbStRygx : childrenList) {
String name = hnTbStRygx.getName();
downloadSfzhSet.add(name);
}
List<String> nullOfNameList = baseMapper.getImgIsNullByTaskId(taskId);
List<String> name_intersection = (List<String>) CollUtil.intersection(downloadSfzhSet, nullOfNameList);
if (name_intersection.size() > 0) {
for (String name : name_intersection) {
String json = "{\"sfzh\": \"" + name + "\"}";
String result = HttpUtils.doPostJson("http://68.174.25.99:8051/ryxxQg", null, json);
JSONObject jsonObject = JSONObject.parseObject(result);
try {
String data = jsonObject.get("data").toString();
if (StringUtils.isNotBlank(data)) {
String base64ForImg = (String) JSONObject.parseObject(data).get("img");
if (StringUtils.isNotBlank(base64ForImg)) {
HnTbStRygx hnTbStRygx = new HnTbStRygx();
hnTbStRygx.setImg(base64ForImg);
baseMapper.update(hnTbStRygx, new UpdateWrapper<HnTbStRygx>().eq("name", name).eq("RWID", taskId));
}
}
} catch (Exception e) {
}
}
}
}, executorPool);
//等待执行完毕
CompletableFuture.allOf(nameFuture,sfzhFuture).get();
//2.关闭线程池
executorPool.shutdown();
}
@Override
public List<HnTbStRygx> getGroupNameByRwid(String taskId) {
return baseMapper.getGroupNameByRwid(taskId);
}
/**
* 查询teamNum个或teamNum个以上的共同联系人的团伙
*
* @param teamNum
* @return
*/
public List<Map<String, Object>> searchMoreTeamList(Integer teamNum, String taskId) {
// 共同联系人
List<HnTbStRygx> teamList = findTeam(teamNum, taskId);
if (teamList == null) {
return null;
}
List<Map<String, Object>> resultList = new ArrayList<>();
for (HnTbStRygx ry : teamList) {
String name = ry.getName();
List<String> nameList = Arrays.asList(name.split(","));
String sfzh = ry.getSfzh();
List<String> sfzhList = Arrays.asList(sfzh.split(","));
Set map_childrenSet = new HashSet();
Set map_nameSet = new HashSet();
Map<String, Object> resultMap = new HashMap();
for (String n : sfzhList) {
// nameSet根据sfz和rwid查xm和sfz
List<Map<String, Object>> maps = baseMapper.getXmAndSfzhBySfzh(n, taskId);
map_nameSet.addAll(maps);
// childrenSet 根据sfz namelist rwid 查出所有信息+value
List<HnTbStRygx> list = baseMapper.getInfoBySfzh(n, nameList, taskId);
map_childrenSet.addAll(list);
}
//每个团伙的共同联系人有谁(联系人与被联系人的关系)
resultMap.put("children", map_childrenSet);
resultMap.put("name", map_nameSet);
//每个团伙的共同联系人有多少人
// resultMap.put("lxrTotal", ryList.size());
resultMap.put("id", RandomUtil.randomString(17));
resultMap.put("type", "person");
resultMap.put("teamNum", teamNum);
resultMap.put("taskId", taskId);
//每个团伙总共有多少人 (团伙的人 + 共同联系人)
resultMap.put("thrTotal", countTotal(map_childrenSet, map_nameSet));
resultList.add(resultMap);
}
return resultList;
}
/**
* 分析人员之间的关系
* @param teamNum
* @param taskId
* @return
*/
public List<HnTbStRygx> findTeam(Integer teamNum, String taskId) {
//所有,每一个人和他的联系人 key ---》 value
List<HnTbStRygx> teamList = hnKshMapper.getSfzhList(teamNum, taskId);
if (teamList.isEmpty()) {
return null;
}
for (int i = 0; i < teamList.size() - 1; i++) {
for (int j = i + 1; j < teamList.size(); j++) {
//获取第一列
String nameArr = teamList.get(i).getName();
boolean b = nameArr.endsWith(",");
if (b) {
int endIndex = nameArr.lastIndexOf(",");
nameArr = nameArr.substring(0, endIndex == -1 ? nameArr.length() : endIndex);
}
List<String> nameList = Arrays.asList(nameArr.split(","));
String sfzh = teamList.get(i).getSfzh();
//获取下一列
String next_nameArr = teamList.get(j).getName();
int next_endIndex = next_nameArr.lastIndexOf(",");
next_nameArr = next_nameArr.substring(0, next_endIndex == -1 ? next_nameArr.length() : next_endIndex);
List<String> next_nameList = Arrays.asList(next_nameArr.split(","));
String next_sfzh = teamList.get(j).getSfzh();
//nameList相比比较
List<String> intersection = (List<String>) CollUtil.intersection(nameList, next_nameList);
if (intersection.size() > 1) {
StringBuilder newSfzh = new StringBuilder(sfzh);
newSfzh.append(",");
newSfzh.append(next_sfzh);
List<String> intersection1 = (List<String>) CollUtil.union(nameList, next_nameList);
String newName = intersection1.toString().replace("[", "").replace("]", "").replace(" ", "").trim();
teamList.get(i).setName(newName);
teamList.get(i).setSfzh(newSfzh.toString());
teamList.remove(j);
j = i;
}
}
}
return teamList;
}
private int countTotal(Set<HnTbStRygx> childrenList, Set<Map<String, Object>> nameSet) {
Set<String> sfzhSet = new HashSet<>();
for (Map<String, Object> stringMap : nameSet) {
//拿到联系人的身份证
String sfzh = (String) stringMap.get("sfzh");
sfzhSet.add(sfzh);
//去children找出联系人的所有被联系人
for (HnTbStRygx rygx : childrenList) {
if (sfzh.equals(rygx.getSfzh())) {
String name = rygx.getName();
sfzhSet.add(name);
}
}
}
return sfzhSet.size();
}
}
...@@ -22,6 +22,14 @@ spring.datasource.qgdb.username=ENC(e7qsvm7EnrdHG04YnaTMsw==) ...@@ -22,6 +22,14 @@ spring.datasource.qgdb.username=ENC(e7qsvm7EnrdHG04YnaTMsw==)
spring.datasource.qgdb.password=ENC(XPnOn0zoWMgOG8gIws+Bh7JITC3mMqSn) spring.datasource.qgdb.password=ENC(XPnOn0zoWMgOG8gIws+Bh7JITC3mMqSn)
spring.datasource.qgdb.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.qgdb.type=com.alibaba.druid.pool.DruidDataSource
#\u6570\u636E\u5206\u6790\u4E0A\u4F20\u7684\u8DEF\u5F84
hnkshFilePath=/data/excel/kshExcel/
#\u6570\u636E\u5206\u6790\u4E0B\u8F7D\u7684\u8DEF\u5F84
hnkshDownloadFilePath = http://47.92.48.137:1009/excel/kshExcel/
#\u6570\u636E\u5206\u6790\u4E0B\u8F7D\u6A21\u677F\u7684\u8DEF\u5F84
hnkshDownloadExcelTemplatePath = http://47.92.48.137:1009/excel/kshExcel/ExcelTemplate.xls
#\u5377\u5B97\u4E0A\u4F20\u7684\u8DEF\u5F84 #\u5377\u5B97\u4E0A\u4F20\u7684\u8DEF\u5F84
approvalFilePath = /data/excel/approvalWord/ approvalFilePath = /data/excel/approvalWord/
#\u65B0\u589E\u5377\u5B97\u5927\u6570\u636E\u6A21\u578B\u4E0B\u8F7D\u8DEF\u5F84 #\u65B0\u589E\u5377\u5B97\u5927\u6570\u636E\u6A21\u578B\u4E0B\u8F7D\u8DEF\u5F84
...@@ -57,15 +65,15 @@ logging.level.org.springframework.data.mongodb.core=DEBUG ...@@ -57,15 +65,15 @@ logging.level.org.springframework.data.mongodb.core=DEBUG
spring.data.mongodb.second.uri=mongodb://localhost:27017/whale spring.data.mongodb.second.uri=mongodb://localhost:27017/whale
#poi\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7 #poi\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7
addressPoiUrl=http://220.26.6.1:8088/PGIS_S_Address/fullSearch addressPoiUrl=http://220.26.6.1:8088/PGIS_S_Address/fullSearch
#记录日志的线下地址 #\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00B5\uFFFD\u05B7
logUrl=http://39.99.155.173:8764/yhczrz/savaYhczrz logUrl=http://39.99.155.173:8764/yhczrz/savaYhczrz
#记录日志的token #\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\u05BE\uFFFD\uFFFDtoken
logtoken=Basic 9b6c45cfcf3a4a629e3ed90fa3e5d058 logtoken=Basic 9b6c45cfcf3a4a629e3ed90fa3e5d058
#xzxtlog=true /false ture 表示开启日志,false表示关闭日志,默认是ture #xzxtlog=true /false ture \uFFFD\uFFFD\u02BE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFDfalse\uFFFD\uFFFD\u02BE\uFFFD\u0631\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\u012C\uFFFD\uFFFD\uFFFD\uFFFDture
xzxtlog =false xzxtlog =false
#全国常口地址 #\u022B\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u06B5\uFFFD\u05B7
ckUrl=http://xzxtzhyyreport:20010/qgck/getRyxxByQgck ckUrl=http://xzxtzhyyreport:20010/qgck/getRyxxByQgck
# Es地址 # Es\uFFFD\uFFFD\u05B7
spring.elasticsearch.jest.uris=http://155.1.11.17:24100 spring.elasticsearch.jest.uris=http://155.1.11.17:24100
trainpath=xz_pk_gakx.train1 trainpath=xz_pk_gakx.train1
mhxxessyb=xz_pk_gakx.flight2 mhxxessyb=xz_pk_gakx.flight2
......
...@@ -22,6 +22,14 @@ spring.datasource.qgdb.username=ENC(AcwX02W3j68cs+8BTDI9Sw==) ...@@ -22,6 +22,14 @@ spring.datasource.qgdb.username=ENC(AcwX02W3j68cs+8BTDI9Sw==)
spring.datasource.qgdb.password=ENC(kB78UiJzT7X+gn2hy9HnYO8JZJhfBnVQ) spring.datasource.qgdb.password=ENC(kB78UiJzT7X+gn2hy9HnYO8JZJhfBnVQ)
spring.datasource.qgdb.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.qgdb.type=com.alibaba.druid.pool.DruidDataSource
#\u6570\u636E\u5206\u6790\u4E0A\u4F20\u7684\u8DEF\u5F84
hnkshFilePath=/data/excel/kshExcel/
#\u6570\u636E\u5206\u6790\u4E0B\u8F7D\u7684\u8DEF\u5F84
hnkshDownloadFilePath = http://47.92.48.137:1009/excel/kshExcel/
#\u6570\u636E\u5206\u6790\u4E0B\u8F7D\u6A21\u677F\u7684\u8DEF\u5F84
hnkshDownloadExcelTemplatePath = http://47.92.48.137:1009/excel/kshExcel/ExcelTemplate.xls
#\u5377\u5B97\u4E0A\u4F20\u7684\u8DEF\u5F84 #\u5377\u5B97\u4E0A\u4F20\u7684\u8DEF\u5F84
approvalFilePath = /data/excel/approvalWord/ approvalFilePath = /data/excel/approvalWord/
#\u65B0\u589E\u5377\u5B97\u5927\u6570\u636E\u6A21\u578B\u4E0B\u8F7D\u8DEF\u5F84 #\u65B0\u589E\u5377\u5B97\u5927\u6570\u636E\u6A21\u578B\u4E0B\u8F7D\u8DEF\u5F84
...@@ -56,15 +64,15 @@ spring.data.mongodb.second.uri=mongodb://fz:wc%40thailand@155.1.11.213:28001/wha ...@@ -56,15 +64,15 @@ spring.data.mongodb.second.uri=mongodb://fz:wc%40thailand@155.1.11.213:28001/wha
logging.level.org.springframework.data.mongodb.core=DEBUG logging.level.org.springframework.data.mongodb.core=DEBUG
#poi\u68C0\u7D22\u5730\u5740 #poi\u68C0\u7D22\u5730\u5740
addressPoiUrl=http://220.26.6.1:8088/PGIS_S_Address/fullSearch addressPoiUrl=http://220.26.6.1:8088/PGIS_S_Address/fullSearch
#记录日志的线上地址 #\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03F5\uFFFD\u05B7
logUrl=http://10.142.16.177:9026/yhczrz/savaYhczrz logUrl=http://10.142.16.177:9026/yhczrz/savaYhczrz
#记录日志的token #\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\u05BE\uFFFD\uFFFDtoken
logtoken=Basic 9b6c45cfcf3a4a629e3ed90fa3e5d058 logtoken=Basic 9b6c45cfcf3a4a629e3ed90fa3e5d058
#xzxtlog=true /false ture 表示开启日志,false表示关闭日志,默认是ture #xzxtlog=true /false ture \uFFFD\uFFFD\u02BE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFDfalse\uFFFD\uFFFD\u02BE\uFFFD\u0631\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\u012C\uFFFD\uFFFD\uFFFD\uFFFDture
xzxtlog =false xzxtlog =false
#全国常口地址 #\u022B\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u06B5\uFFFD\u05B7
ckUrl=http://xzxtzhyyreport:20010/qgck/getRyxxByQgck ckUrl=http://xzxtzhyyreport:20010/qgck/getRyxxByQgck
# Es地址 # Es\uFFFD\uFFFD\u05B7
spring.elasticsearch.jest.uris=http://155.1.11.17:24100 spring.elasticsearch.jest.uris=http://155.1.11.17:24100
trainpath=xz_pk_gakx.train1 trainpath=xz_pk_gakx.train1
mhxxessyb=xz_pk_gakx.flight2 mhxxessyb=xz_pk_gakx.flight2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment