Merge branch 'master' into secondStage
This commit is contained in:
+98
-14
@@ -1,5 +1,6 @@
|
|||||||
package com.jero.common.es;
|
package com.jero.common.es;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -32,6 +33,11 @@ public class JeroElasticsearchTemplate {
|
|||||||
// ElasticSearch 最大可返回条目数
|
// ElasticSearch 最大可返回条目数
|
||||||
public static final int ES_MAX_SIZE = 10000;
|
public static final int ES_MAX_SIZE = 10000;
|
||||||
|
|
||||||
|
@Value("${jero.elasticsearch.username}")
|
||||||
|
private String username;
|
||||||
|
@Value("${jero.elasticsearch.password}")
|
||||||
|
private String password;
|
||||||
|
|
||||||
public JeroElasticsearchTemplate(@Value("${jero.elasticsearch.cluster-nodes}") String baseUrl, @Value("${jero.elasticsearch.check-enabled}") boolean checkEnabled) {
|
public JeroElasticsearchTemplate(@Value("${jero.elasticsearch.cluster-nodes}") String baseUrl, @Value("${jero.elasticsearch.check-enabled}") boolean checkEnabled) {
|
||||||
log.debug("JeroElasticsearchTemplate BaseURL:" + baseUrl);
|
log.debug("JeroElasticsearchTemplate BaseURL:" + baseUrl);
|
||||||
if (StringUtils.isNotEmpty(baseUrl)) {
|
if (StringUtils.isNotEmpty(baseUrl)) {
|
||||||
@@ -40,7 +46,11 @@ public class JeroElasticsearchTemplate {
|
|||||||
if (checkEnabled) {
|
if (checkEnabled) {
|
||||||
try {
|
try {
|
||||||
this.getElasticsearchVersion();
|
this.getElasticsearchVersion();
|
||||||
RestUtil.get(this.getBaseUrl().toString());
|
String basicAuth = this.getBasicAuth();
|
||||||
|
HttpRequest.get(this.getBaseUrl().toString())
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
log.info("ElasticSearch 服务连接成功");
|
log.info("ElasticSearch 服务连接成功");
|
||||||
log.info("ElasticSearch version: " + this.version);
|
log.info("ElasticSearch version: " + this.version);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -56,8 +66,12 @@ public class JeroElasticsearchTemplate {
|
|||||||
*/
|
*/
|
||||||
private void getElasticsearchVersion() {
|
private void getElasticsearchVersion() {
|
||||||
if (this.version == null) {
|
if (this.version == null) {
|
||||||
String url = this.getBaseUrl().toString();
|
String basicAuth = this.getBasicAuth();
|
||||||
JSONObject result = RestUtil.get(url);
|
String response = HttpRequest.get(this.getBaseUrl().toString())
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject result = JSONObject.parseObject(response);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
JSONObject v = result.getJSONObject("version");
|
JSONObject v = result.getJSONObject("version");
|
||||||
this.version = v.getString("number");
|
this.version = v.getString("number");
|
||||||
@@ -65,6 +79,13 @@ public class JeroElasticsearchTemplate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBasicAuth(){
|
||||||
|
String authString = username + ":" + password;
|
||||||
|
String encode = Base64.getEncoder().encodeToString(authString.getBytes());
|
||||||
|
String authHeader = "Basic " + encode;
|
||||||
|
return authHeader;
|
||||||
|
}
|
||||||
|
|
||||||
public StringBuilder getBaseUrl(String indexName, String typeName) {
|
public StringBuilder getBaseUrl(String indexName, String typeName) {
|
||||||
typeName = typeName.trim().toLowerCase();
|
typeName = typeName.trim().toLowerCase();
|
||||||
return this.getBaseUrl(indexName).append("/").append(typeName);
|
return this.getBaseUrl(indexName).append("/").append(typeName);
|
||||||
@@ -79,6 +100,59 @@ public class JeroElasticsearchTemplate {
|
|||||||
return new StringBuilder("http://").append(this.baseUrl);
|
return new StringBuilder("http://").append(this.baseUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cat 查询ElasticSearch系统数据,返回json
|
||||||
|
*/
|
||||||
|
public JSONArray _cat(String urlAfter) {
|
||||||
|
String url = this.getBaseUrl().append("/_cat").append(urlAfter).append("?").append(FORMAT_JSON).toString();
|
||||||
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.get(url)
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONArray jsonArray = JSONArray.parseArray(response);
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject put(String url){
|
||||||
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.put(url)
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
public JSONObject put(String url, String params){
|
||||||
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.put(url)
|
||||||
|
.body(params)
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
public JSONObject post(String url, JSONObject params){
|
||||||
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.post(url)
|
||||||
|
.body(params.toJSONString())
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
public JSONObject delete(String url){
|
||||||
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.delete(url)
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(response);
|
||||||
|
return jsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cat 查询ElasticSearch系统数据,返回json
|
* cat 查询ElasticSearch系统数据,返回json
|
||||||
*/
|
*/
|
||||||
@@ -107,7 +181,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
if (!StringUtils.isEmpty(indexName)) {
|
if (!StringUtils.isEmpty(indexName)) {
|
||||||
urlAfter.append("/").append(indexName.trim().toLowerCase());
|
urlAfter.append("/").append(indexName.trim().toLowerCase());
|
||||||
}
|
}
|
||||||
return _cat(urlAfter.toString(), JSONArray.class).getBody();
|
return _cat(urlAfter.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,7 +213,12 @@ public class JeroElasticsearchTemplate {
|
|||||||
public JSONObject getDataById(String indexName, String typeName, String dataId) {
|
public JSONObject getDataById(String indexName, String typeName, String dataId) {
|
||||||
String url = this.getBaseUrl(indexName, typeName).append("/").append(dataId).toString();
|
String url = this.getBaseUrl(indexName, typeName).append("/").append(dataId).toString();
|
||||||
log.info("url:" + url);
|
log.info("url:" + url);
|
||||||
JSONObject result = RestUtil.get(url);
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.get(this.getBaseUrl().toString())
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject result = JSONObject.parseObject(response);
|
||||||
boolean found = result.getBoolean("found");
|
boolean found = result.getBoolean("found");
|
||||||
if (found) {
|
if (found) {
|
||||||
return result.getJSONObject("_source");
|
return result.getJSONObject("_source");
|
||||||
@@ -157,7 +236,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
String url = this.getBaseUrl(indexName).toString();
|
String url = this.getBaseUrl(indexName).toString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return RestUtil.put(url).getBoolean("acknowledged");
|
return this.put(url).getBoolean("acknowledged");
|
||||||
} catch (org.springframework.web.client.HttpClientErrorException ex) {
|
} catch (org.springframework.web.client.HttpClientErrorException ex) {
|
||||||
if (HttpStatus.BAD_REQUEST == ex.getStatusCode()) {
|
if (HttpStatus.BAD_REQUEST == ex.getStatusCode()) {
|
||||||
log.warn("索引创建失败:" + indexName + " 已存在,无需再创建");
|
log.warn("索引创建失败:" + indexName + " 已存在,无需再创建");
|
||||||
@@ -176,7 +255,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
public boolean removeIndex(String indexName) {
|
public boolean removeIndex(String indexName) {
|
||||||
String url = this.getBaseUrl(indexName).toString();
|
String url = this.getBaseUrl(indexName).toString();
|
||||||
try {
|
try {
|
||||||
return RestUtil.delete(url).getBoolean("acknowledged");
|
return this.delete(url).getBoolean("acknowledged");
|
||||||
} catch (org.springframework.web.client.HttpClientErrorException ex) {
|
} catch (org.springframework.web.client.HttpClientErrorException ex) {
|
||||||
if (HttpStatus.NOT_FOUND == ex.getStatusCode()) {
|
if (HttpStatus.NOT_FOUND == ex.getStatusCode()) {
|
||||||
log.warn("索引删除失败:" + indexName + " 不存在,无需删除");
|
log.warn("索引删除失败:" + indexName + " 不存在,无需删除");
|
||||||
@@ -204,7 +283,13 @@ public class JeroElasticsearchTemplate {
|
|||||||
}
|
}
|
||||||
log.info("getIndexMapping-url:" + url);
|
log.info("getIndexMapping-url:" + url);
|
||||||
try {
|
try {
|
||||||
return RestUtil.get(url);
|
String basicAuth = this.getBasicAuth();
|
||||||
|
String response = HttpRequest.get(this.getBaseUrl().toString())
|
||||||
|
.header("Authorization", basicAuth)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
JSONObject result = JSONObject.parseObject(response);
|
||||||
|
return result;
|
||||||
} catch (org.springframework.web.client.HttpClientErrorException e) {
|
} catch (org.springframework.web.client.HttpClientErrorException e) {
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
if (message != null && message.contains("404 Not Found")) {
|
if (message != null && message.contains("404 Not Found")) {
|
||||||
@@ -291,7 +376,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String result = RestUtil.put(url, data).getString("result");
|
String result = this.put(url, data.toJSONString()).getString("result");
|
||||||
return "created".equals(result) || "updated".equals(result);
|
return "created".equals(result) || "updated".equals(result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage() + "\n-- url: " + url + "\n-- data: " + data.toJSONString());
|
log.error(e.getMessage() + "\n-- url: " + url + "\n-- data: " + data.toJSONString());
|
||||||
@@ -327,8 +412,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
bodySB.append(data.toJSONString()).append("\n");
|
bodySB.append(data.toJSONString()).append("\n");
|
||||||
}
|
}
|
||||||
log.info("+-+-+-: bodySB.toString(): " + bodySB.toString());
|
log.info("+-+-+-: bodySB.toString(): " + bodySB.toString());
|
||||||
HttpHeaders headers = RestUtil.getHeaderApplicationJson();
|
this.put(url,bodySB.toString());
|
||||||
RestUtil.request(url, HttpMethod.PUT, headers, null, bodySB, JSONObject.class);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +424,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
public boolean delete(String indexName, String typeName, String dataId) {
|
public boolean delete(String indexName, String typeName, String dataId) {
|
||||||
String url = this.getBaseUrl(indexName, typeName).append("/").append(dataId).toString();
|
String url = this.getBaseUrl(indexName, typeName).append("/").append(dataId).toString();
|
||||||
try {
|
try {
|
||||||
return "deleted".equals(RestUtil.delete(url).getString("result"));
|
return "deleted".equals(this.delete(url).getString("result"));
|
||||||
} catch (org.springframework.web.client.HttpClientErrorException ex) {
|
} catch (org.springframework.web.client.HttpClientErrorException ex) {
|
||||||
if (HttpStatus.NOT_FOUND == ex.getStatusCode()) {
|
if (HttpStatus.NOT_FOUND == ex.getStatusCode()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -362,7 +446,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
String url = this.getBaseUrl(indexName, typeName).append("/_search").toString();
|
String url = this.getBaseUrl(indexName, typeName).append("/_search").toString();
|
||||||
|
|
||||||
log.info("url:" + url + " ,search: " + queryObject.toJSONString());
|
log.info("url:" + url + " ,search: " + queryObject.toJSONString());
|
||||||
JSONObject res = RestUtil.post(url, queryObject);
|
JSONObject res = this.post(url, queryObject);
|
||||||
log.info("url:" + url + " ,return res: \n" + res.toJSONString());
|
log.info("url:" + url + " ,return res: \n" + res.toJSONString());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -486,7 +570,7 @@ public class JeroElasticsearchTemplate {
|
|||||||
String url = this.getBaseUrl(indexName, typeName).append("/_delete_by_query").toString();
|
String url = this.getBaseUrl(indexName, typeName).append("/_delete_by_query").toString();
|
||||||
|
|
||||||
log.info("url:" + url + " ,delete: " + queryObject.toJSONString());
|
log.info("url:" + url + " ,delete: " + queryObject.toJSONString());
|
||||||
JSONObject res = RestUtil.post(url, queryObject);
|
JSONObject res = this.post(url, queryObject);
|
||||||
log.info("url:" + url + " ,return res: \n" + res.toJSONString());
|
log.info("url:" + url + " ,return res: \n" + res.toJSONString());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-24
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.system.service.impl;
|
package com.jero.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.crypto.asymmetric.RSA;
|
import cn.hutool.crypto.asymmetric.RSA;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aliyuncs.exceptions.ClientException;
|
import com.aliyuncs.exceptions.ClientException;
|
||||||
@@ -94,22 +95,22 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
String rsaPublicKey = sysLoginModel.getRsaPublicKey();
|
String rsaPublicKey = sysLoginModel.getRsaPublicKey();
|
||||||
String rsaPrivateKey = redisUtil.get(rsaPublicKey) != null ? String.valueOf(redisUtil.get(rsaPublicKey)) : null;
|
String rsaPrivateKey = redisUtil.get(rsaPublicKey) != null ? String.valueOf(redisUtil.get(rsaPublicKey)) : null;
|
||||||
|
|
||||||
//if(StrUtil.isEmpty(rsaPrivateKey)){
|
if(StrUtil.isEmpty(rsaPrivateKey)){
|
||||||
// return Result.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
return Result.error(CommonConstant.SC_RSA_TIMEOUT_600, "页面过期,将刷新页面");
|
||||||
//}
|
}
|
||||||
|
|
||||||
//String captcha = sysLoginModel.getCaptcha();
|
String captcha = sysLoginModel.getCaptcha();
|
||||||
//if(captcha==null){
|
if(captcha==null){
|
||||||
// return Result.error("验证码无效");
|
return Result.error("验证码无效");
|
||||||
//}
|
}
|
||||||
//String lowerCaseCaptcha = captcha.toLowerCase();
|
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||||
//String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha + sysLoginModel.getCheckKey(), UTF_8);
|
||||||
//Object checkCode = redisUtil.get(realKey);
|
Object checkCode = redisUtil.get(realKey);
|
||||||
//// 验证码前后端比较
|
// 验证码前后端比较
|
||||||
//if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
if(checkCode == null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||||
// return Result.error("验证码错误");
|
return Result.error("验证码错误");
|
||||||
//}
|
}
|
||||||
//redisUtil.del(realKey);
|
redisUtil.del(realKey);
|
||||||
try {
|
try {
|
||||||
//解密获取密码和用户名
|
//解密获取密码和用户名
|
||||||
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
||||||
@@ -138,15 +139,15 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
return Result.error("密码错误次数过多,请15分钟后重试");
|
return Result.error("密码错误次数过多,请15分钟后重试");
|
||||||
}
|
}
|
||||||
//2. 校验用户名或密码是否正确
|
//2. 校验用户名或密码是否正确
|
||||||
//String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||||
//String syspassword = sysUser.getPassword();
|
String syspassword = sysUser.getPassword();
|
||||||
//if (!syspassword.equals(userpassword)) {
|
if (!syspassword.equals(userpassword)) {
|
||||||
// // 重试登录次数加一
|
// 重试登录次数加一
|
||||||
// retryCount++;
|
retryCount++;
|
||||||
// this.setRetryInfoToRedis(username, retryCount);
|
this.setRetryInfoToRedis(username, retryCount);
|
||||||
// String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
||||||
// return Result.error(msg);
|
return Result.error(msg);
|
||||||
//}
|
}
|
||||||
//登录成功,清除错误登录次数
|
//登录成功,清除错误登录次数
|
||||||
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
||||||
if (checkSysPermission(username)) {
|
if (checkSysPermission(username)) {
|
||||||
|
|||||||
+15
-2
@@ -112,12 +112,14 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
|
|||||||
@Override
|
@Override
|
||||||
public void saveTreeNodeData(LawsTreeNode lawsTreeNode) {
|
public void saveTreeNodeData(LawsTreeNode lawsTreeNode) {
|
||||||
if (lawsTreeNode != null) {
|
if (lawsTreeNode != null) {
|
||||||
if (lawsTreeNode.getParentId() == null) {
|
String parentId = lawsTreeNode.getParentId();
|
||||||
|
if (parentId == null) {
|
||||||
lawsTreeNode.setParentId("");
|
lawsTreeNode.setParentId("");
|
||||||
}
|
}
|
||||||
// 对名称判重
|
// 对名称判重
|
||||||
LambdaQueryWrapper<LawsTreeNode> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsTreeNode> query = new LambdaQueryWrapper<>();
|
||||||
query.eq(LawsTreeNode::getNodeName, lawsTreeNode.getNodeName());
|
query.eq(LawsTreeNode::getNodeName, lawsTreeNode.getNodeName());
|
||||||
|
query.eq(LawsTreeNode::getParentId, parentId);
|
||||||
query.eq(LawsTreeNode::getModuleCode, lawsTreeNode.getModuleCode());
|
query.eq(LawsTreeNode::getModuleCode, lawsTreeNode.getModuleCode());
|
||||||
query.eq(LawsTreeNode::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
query.eq(LawsTreeNode::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||||
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
||||||
@@ -129,7 +131,6 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
|
|||||||
lawsTreeNode.setId(s);
|
lawsTreeNode.setId(s);
|
||||||
// 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级
|
// 先判断该对象有无父级ID,有则意味着不是最高级,否则意味着是最高级
|
||||||
// 获取父级ID
|
// 获取父级ID
|
||||||
String parentId = lawsTreeNode.getParentId();
|
|
||||||
String moduleCode = lawsTreeNode.getModuleCode();
|
String moduleCode = lawsTreeNode.getModuleCode();
|
||||||
//update-begin--Author:baihailong Date:20191209 for:部门编码规则生成器做成公用配置
|
//update-begin--Author:baihailong Date:20191209 for:部门编码规则生成器做成公用配置
|
||||||
JSONObject formData = new JSONObject();
|
JSONObject formData = new JSONObject();
|
||||||
@@ -149,6 +150,18 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateTreeNodeDataById(LawsTreeNode lawsTreeNode) {
|
public boolean updateTreeNodeDataById(LawsTreeNode lawsTreeNode) {
|
||||||
if (lawsTreeNode != null) {
|
if (lawsTreeNode != null) {
|
||||||
|
String parentId = lawsTreeNode.getParentId();
|
||||||
|
LambdaQueryWrapper<LawsTreeNode> query = new LambdaQueryWrapper<>();
|
||||||
|
query.eq(LawsTreeNode::getNodeName, lawsTreeNode.getNodeName());
|
||||||
|
query.eq(LawsTreeNode::getParentId, parentId);
|
||||||
|
query.eq(LawsTreeNode::getModuleCode, lawsTreeNode.getModuleCode());
|
||||||
|
query.eq(LawsTreeNode::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||||
|
query.ne(LawsTreeNode::getId,lawsTreeNode.getId());
|
||||||
|
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
||||||
|
if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) {
|
||||||
|
//TODO 翻译
|
||||||
|
throw new JeroBootException("已存在名为" + lawsTreeNode.getNodeName() + "的节点");
|
||||||
|
}
|
||||||
this.updateById(lawsTreeNode);
|
this.updateById(lawsTreeNode);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -259,6 +259,8 @@ jero:
|
|||||||
staticDomain: jerodev
|
staticDomain: jerodev
|
||||||
# ElasticSearch 6设置
|
# ElasticSearch 6设置
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
username: grp
|
||||||
|
password: Grp2023.08
|
||||||
cluster-name: jero-ES
|
cluster-name: jero-ES
|
||||||
cluster-nodes: 10.10.10.45:7900
|
cluster-nodes: 10.10.10.45:7900
|
||||||
check-enabled: false
|
check-enabled: false
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
port: 8080
|
port: 8184
|
||||||
tomcat:
|
tomcat:
|
||||||
max-swallow-size: -1
|
max-swallow-size: -1
|
||||||
error:
|
error:
|
||||||
@@ -230,8 +230,10 @@ jero:
|
|||||||
staticDomain: jerodev
|
staticDomain: jerodev
|
||||||
# ElasticSearch 6设置
|
# ElasticSearch 6设置
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
username: grp
|
||||||
|
password: Grp2023.08
|
||||||
cluster-name: jero-ES
|
cluster-name: jero-ES
|
||||||
cluster-nodes: 127.0.0.1:9200
|
cluster-nodes: 10.186.43.11:9200
|
||||||
check-enabled: false
|
check-enabled: false
|
||||||
# 表单设计器配置
|
# 表单设计器配置
|
||||||
desform:
|
desform:
|
||||||
@@ -360,18 +362,20 @@ iam:
|
|||||||
# bimRemoteUser: bbcadmin
|
# bimRemoteUser: bbcadmin
|
||||||
# bimRemotePwd: P@ssw0rd
|
# bimRemotePwd: P@ssw0rd
|
||||||
bpmcAppkey: test
|
bpmcAppkey: test
|
||||||
|
# 创建用户默认角色
|
||||||
|
defaultRoleIds: 817f7f818bb3506e018bb3506ef70000
|
||||||
|
|
||||||
# Hiwork集成
|
# Hiwork集成
|
||||||
hiwork:
|
hiwork:
|
||||||
ip: http://task-test.sinotruk.com/
|
ip: http://task-test.sinotruk.com/
|
||||||
# 异构系统标识
|
# 异构系统标识
|
||||||
sysCode: test
|
sysCode: SRMS
|
||||||
# 统一待办集成
|
# 统一待办集成
|
||||||
todoUrl: taskapi/task.basedata/integrationCall/workflowIntegration
|
todoUrl: taskapi/task.basedata/integrationCall/workflowIntegration
|
||||||
# 统一消息集成
|
# 统一消息集成
|
||||||
messageUrl: taskapi/task.basedata/notice/noticeCalls/send
|
messageUrl: taskapi/task.basedata/notice/noticeCalls/send
|
||||||
# 是否发送消息
|
# 是否发送消息
|
||||||
isSend: false
|
isSend: true
|
||||||
|
|
||||||
# 汽车标准数字化平台ASMS
|
# 汽车标准数字化平台ASMS
|
||||||
asms:
|
asms:
|
||||||
@@ -383,6 +387,7 @@ asms:
|
|||||||
# token过期时间(单位:小时)
|
# token过期时间(单位:小时)
|
||||||
expire: 48
|
expire: 48
|
||||||
|
|
||||||
|
# 单点登录配置(所有配置信息需要协调注册,现在都为假)
|
||||||
# 单点登录配置(所有配置信息需要协调注册,现在都为假)
|
# 单点登录配置(所有配置信息需要协调注册,现在都为假)
|
||||||
oauth:
|
oauth:
|
||||||
# 客户端应用注册ID--客户申请的:SRMS
|
# 客户端应用注册ID--客户申请的:SRMS
|
||||||
@@ -391,12 +396,37 @@ oauth:
|
|||||||
clientSecret: 58a1001438de462193bec307826463c2
|
clientSecret: 58a1001438de462193bec307826463c2
|
||||||
# 授权码验证
|
# 授权码验证
|
||||||
grantType: authorization_code
|
grantType: authorization_code
|
||||||
# 通过授权码获取accessToken请求地址
|
# 通过授权码获取accessToken请求地址 https://iam-uat.sinotruk.com:7011 --> https://iam-uat-new.sinotruk.com
|
||||||
accessTokenUrl: https://iam-uat.sinotruk.com:7011/idp/oauth2/getToken
|
accessTokenUrl: https://iam-uat.sinotruk.com:7011/idp/oauth2/getToken
|
||||||
# 通过accessToken获取账号信息请求地址
|
# 通过accessToken获取账号信息请求地址 https://iam-uat.sinotruk.com:7011 --> https://iam-uat-new.sinotruk.com
|
||||||
userInfoUrl: https://iam-uat.sinotruk.com:7011/idp/oauth2/getUserInfo
|
userInfoUrl: https://iam-uat.sinotruk.com:7011/idp/oauth2/getUserInfo
|
||||||
# 防止跨站请求伪造(CSRF)标识(暂时不用)
|
# 防止跨站请求伪造(CSRF)标识(暂时不用)
|
||||||
state: zhongQi
|
state: zhongQi
|
||||||
|
|
||||||
# 起草部门部门名称
|
# 起草部门部门名称
|
||||||
draftDepartName: 流程与标准化
|
draftDepartName: 流程与标准化
|
||||||
|
# 管理员权限roleCode,多填用英文逗号拼接
|
||||||
|
adminRoleCode: admin
|
||||||
|
|
||||||
|
# 文件下载加解密
|
||||||
|
download:
|
||||||
|
enable: false
|
||||||
|
# 文件下载、预览拦截路径,多个以逗号分隔
|
||||||
|
download_url: /sys/common/download/
|
||||||
|
view_url: /sys/common/view/
|
||||||
|
# 管理员角色
|
||||||
|
admin_role_code: admin,BZGLY
|
||||||
|
# 加密参数
|
||||||
|
encrypt:
|
||||||
|
url: http://10.2.159.90/intekey/encrypteFile
|
||||||
|
app_code: SRMS
|
||||||
|
secret_key: SRMS1234..
|
||||||
|
# 解密参数
|
||||||
|
decrypt:
|
||||||
|
url: http://10.2.159.90/intekey/file
|
||||||
|
app_code: SRMS
|
||||||
|
secret_key: SRMS1234..
|
||||||
|
# 研发域
|
||||||
|
scope_dev: 51
|
||||||
|
# 办公域
|
||||||
|
scope_work: 52
|
||||||
Reference in New Issue
Block a user