cleanup code

This commit is contained in:
ls
2025-07-09 23:32:49 +08:00
parent f8421681cc
commit 8750c279eb
31 changed files with 4754 additions and 4744 deletions

View File

@@ -50,6 +50,12 @@
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-common3</artifactId> <artifactId>jeecg-boot-common3</artifactId>
<version>3.7.0</version> <version>3.7.0</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>io.netty</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!--集成springmvc框架并实现自动配置 --> <!--集成springmvc框架并实现自动配置 -->
<dependency> <dependency>
@@ -67,14 +73,14 @@
<artifactId>spring-boot-starter-undertow</artifactId> <artifactId>spring-boot-starter-undertow</artifactId>
</dependency> </dependency>
<!-- websocket --> <!-- websocket -->
<dependency> <!-- <dependency>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-starter-websocket</artifactId> <!-- <artifactId>spring-boot-starter-websocket</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-starter-mail</artifactId> <!-- <artifactId>spring-boot-starter-mail</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
@@ -89,10 +95,10 @@
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<!--springboot2.6+解决metrics端点不显示jvm信息的问题--> <!--springboot2.6+解决metrics端点不显示jvm信息的问题-->
<dependency> <!-- <dependency>-->
<groupId>io.micrometer</groupId> <!-- <groupId>io.micrometer</groupId>-->
<artifactId>micrometer-registry-prometheus</artifactId> <!-- <artifactId>micrometer-registry-prometheus</artifactId>-->
</dependency> <!-- </dependency>-->
<!-- commons --> <!-- commons -->
<dependency> <dependency>
@@ -141,51 +147,51 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- sqlserver--> <!-- sqlserver-->
<dependency> <!-- <dependency>-->
<groupId>com.microsoft.sqlserver</groupId> <!-- <groupId>com.microsoft.sqlserver</groupId>-->
<artifactId>sqljdbc4</artifactId> <!-- <artifactId>sqljdbc4</artifactId>-->
<version>${sqljdbc4.version}</version> <!-- <version>${sqljdbc4.version}</version>-->
<scope>runtime</scope> <!-- <scope>runtime</scope>-->
</dependency> <!-- </dependency>-->
<!-- oracle驱动 --> <!-- oracle驱动 -->
<dependency> <!-- <dependency>-->
<groupId>com.oracle</groupId> <!-- <groupId>com.oracle</groupId>-->
<artifactId>ojdbc6</artifactId> <!-- <artifactId>ojdbc6</artifactId>-->
<version>${ojdbc6.version}</version> <!-- <version>${ojdbc6.version}</version>-->
<scope>runtime</scope> <!-- <scope>runtime</scope>-->
</dependency> <!-- </dependency>-->
<!-- postgresql驱动 --> <!-- postgresql驱动 -->
<dependency> <!-- <dependency>-->
<groupId>org.postgresql</groupId> <!-- <groupId>org.postgresql</groupId>-->
<artifactId>postgresql</artifactId> <!-- <artifactId>postgresql</artifactId>-->
<version>${postgresql.version}</version> <!-- <version>${postgresql.version}</version>-->
<scope>runtime</scope> <!-- <scope>runtime</scope>-->
</dependency> <!-- </dependency>-->
<!--人大金仓驱动 版本号V008R006C005B0013 --> <!--人大金仓驱动 版本号V008R006C005B0013 -->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework</groupId> <!-- <groupId>org.jeecgframework</groupId>-->
<artifactId>kingbase8</artifactId> <!-- <artifactId>kingbase8</artifactId>-->
<version>${kingbase8.version}</version> <!-- <version>${kingbase8.version}</version>-->
<scope>runtime</scope> <!-- <scope>runtime</scope>-->
</dependency> <!-- </dependency>-->
<!--达梦数据库驱动 版本号1-3-26-2023.07.26-197096-20046-ENT --> <!--达梦数据库驱动 版本号1-3-26-2023.07.26-197096-20046-ENT -->
<dependency> <!-- <dependency>-->
<groupId>com.dameng</groupId> <!-- <groupId>com.dameng</groupId>-->
<artifactId>Dm8JdbcDriver18</artifactId> <!-- <artifactId>Dm8JdbcDriver18</artifactId>-->
<version>${dm8.version}</version> <!-- <version>${dm8.version}</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.dameng</groupId> <!-- <groupId>com.dameng</groupId>-->
<artifactId>DmDialect-for-hibernate5.0</artifactId> <!-- <artifactId>DmDialect-for-hibernate5.0</artifactId>-->
<version>${dm8.version}</version> <!-- <version>${dm8.version}</version>-->
</dependency> <!-- </dependency>-->
<!-- Quartz定时任务 --> <!-- Quartz定时任务 -->
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>--> <!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-quartz</artifactId>--> <!-- <artifactId>spring-boot-starter-quartz</artifactId>-->
<!-- </dependency>--> <!-- </dependency>-->
<!--JWT--> <!--JWT-->
<dependency> <dependency>
@@ -280,19 +286,19 @@
<!-- 代码生成器 --> <!-- 代码生成器 -->
<!-- 如下载失败,请参考此文档 https://help.jeecg.com/java/setup/maven.html --> <!-- 如下载失败,请参考此文档 https://help.jeecg.com/java/setup/maven.html -->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot</groupId> <!-- <groupId>org.jeecgframework.boot</groupId>-->
<artifactId>codegenerate</artifactId> <!-- <artifactId>codegenerate</artifactId>-->
<version>${codegenerate.version}</version> <!-- <version>${codegenerate.version}</version>-->
</dependency> <!-- </dependency>-->
<!-- AutoPoi Excel工具类--> <!-- AutoPoi Excel工具类-->
<dependency> <dependency>
<groupId>org.jeecgframework.boot3</groupId> <groupId>org.jeecgframework.boot3</groupId>
<artifactId>autopoi-web</artifactId> <artifactId>autopoi-web</artifactId>
<version>${autopoi-web.version}</version> <version>${autopoi-web.version}</version>
<!-- <scope>system</scope>--> <!-- <scope>system</scope>-->
<!-- <systemPath>lib/autopoi-web-3.7.0.jar</systemPath>--> <!-- <systemPath>lib/autopoi-web-3.7.0.jar</systemPath>-->
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
@@ -318,32 +324,32 @@
</dependency> </dependency>
<!-- 阿里云短信 --> <!-- 阿里云短信 -->
<dependency> <!-- <dependency>-->
<groupId>com.aliyun</groupId> <!-- <groupId>com.aliyun</groupId>-->
<artifactId>aliyun-java-sdk-dysmsapi</artifactId> <!-- <artifactId>aliyun-java-sdk-dysmsapi</artifactId>-->
<version>${aliyun-java-sdk-dysmsapi.version}</version> <!-- <version>${aliyun-java-sdk-dysmsapi.version}</version>-->
</dependency> <!-- </dependency>-->
<!-- aliyun oss --> <!-- aliyun oss -->
<dependency> <!-- <dependency>-->
<groupId>com.aliyun.oss</groupId> <!-- <groupId>com.aliyun.oss</groupId>-->
<artifactId>aliyun-sdk-oss</artifactId> <!-- <artifactId>aliyun-sdk-oss</artifactId>-->
<version>${aliyun.oss.version}</version> <!-- <version>${aliyun.oss.version}</version>-->
</dependency> <!-- </dependency>-->
<!-- 第三方登录 --> <!-- 第三方登录 -->
<dependency> <!-- <dependency>-->
<groupId>com.xkcoding.justauth</groupId> <!-- <groupId>com.xkcoding.justauth</groupId>-->
<artifactId>justauth-spring-boot-starter</artifactId> <!-- <artifactId>justauth-spring-boot-starter</artifactId>-->
<exclusions> <!-- <exclusions>-->
<exclusion> <!-- <exclusion>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-autoconfigure</artifactId> <!-- <artifactId>spring-boot-autoconfigure</artifactId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-configuration-processor</artifactId> <!-- <artifactId>spring-boot-configuration-processor</artifactId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> <!-- </exclusions>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
@@ -370,8 +376,8 @@
<groupId>org.jeecgframework.boot3</groupId> <groupId>org.jeecgframework.boot3</groupId>
<artifactId>autopoi</artifactId> <artifactId>autopoi</artifactId>
<version>3.7.0</version> <version>3.7.0</version>
<!-- <scope>system</scope>--> <!-- <scope>system</scope>-->
<!-- <systemPath>lib/autopoi-3.7.0.jar</systemPath>--> <!-- <systemPath>lib/autopoi-3.7.0.jar</systemPath>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.deepoove</groupId> <groupId>com.deepoove</groupId>

View File

@@ -1,133 +1,133 @@
package org.jeecg.common.util; //package org.jeecg.common.util;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient; //import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient; //import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; //import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; //import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException; //import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile; //import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile; //import com.aliyuncs.profile.IClientProfile;
import org.jeecg.common.constant.enums.DySmsEnum; //import org.jeecg.common.constant.enums.DySmsEnum;
import org.jeecg.config.StaticConfig; //import org.jeecg.config.StaticConfig;
import org.slf4j.Logger; //import org.slf4j.Logger;
import org.slf4j.LoggerFactory; //import org.slf4j.LoggerFactory;
//
/** ///**
* Created on 17/6/7. // * Created on 17/6/7.
* 短信API产品的DEMO程序,工程中包含了一个SmsDemo类直接通过 // * 短信API产品的DEMO程序,工程中包含了一个SmsDemo类直接通过
* 执行main函数即可体验短信产品API功能(只需要将AK替换成开通了云通信-短信产品功能的AK即可) // * 执行main函数即可体验短信产品API功能(只需要将AK替换成开通了云通信-短信产品功能的AK即可)
* 工程依赖了2个jar包(存放在工程的libs目录下) // * 工程依赖了2个jar包(存放在工程的libs目录下)
* 1:aliyun-java-sdk-core.jar // * 1:aliyun-java-sdk-core.jar
* 2:aliyun-java-sdk-dysmsapi.jar // * 2:aliyun-java-sdk-dysmsapi.jar
* <p> // * <p>
* 备注:Demo工程编码采用UTF-8 // * 备注:Demo工程编码采用UTF-8
* 国际短信发送请勿参照此DEMO // * 国际短信发送请勿参照此DEMO
* // *
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
public class DySmsHelper { //public class DySmsHelper {
//
private final static Logger logger = LoggerFactory.getLogger(DySmsHelper.class); // private final static Logger logger = LoggerFactory.getLogger(DySmsHelper.class);
//
/** // /**
* 产品名称:云通信短信API产品,开发者无需替换 // * 产品名称:云通信短信API产品,开发者无需替换
*/ // */
static final String PRODUCT = "Dysmsapi"; // static final String PRODUCT = "Dysmsapi";
/** // /**
* 产品域名,开发者无需替换 // * 产品域名,开发者无需替换
*/ // */
static final String DOMAIN = "dysmsapi.aliyuncs.com"; // static final String DOMAIN = "dysmsapi.aliyuncs.com";
//
/** // /**
* TODO 此处需要替换成开发者自己的AK(在阿里云访问控制台寻找) // * TODO 此处需要替换成开发者自己的AK(在阿里云访问控制台寻找)
*/ // */
static String accessKeyId; // static String accessKeyId;
static String accessKeySecret; // static String accessKeySecret;
//
public static void setAccessKeyId(String accessKeyId) { // public static void setAccessKeyId(String accessKeyId) {
DySmsHelper.accessKeyId = accessKeyId; // DySmsHelper.accessKeyId = accessKeyId;
}
public static void setAccessKeySecret(String accessKeySecret) {
DySmsHelper.accessKeySecret = accessKeySecret;
}
public static String getAccessKeyId() {
return accessKeyId;
}
public static String getAccessKeySecret() {
return accessKeySecret;
}
public static boolean sendSms(String phone, JSONObject templateParamJson, DySmsEnum dySmsEnum) throws ClientException {
//可自助调整超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//update-begin-authortaoyan date:20200811 for:配置类数据获取
StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
//logger.info("阿里大鱼短信秘钥 accessKeyId" + staticConfig.getAccessKeyId());
//logger.info("阿里大鱼短信秘钥 accessKeySecret"+ staticConfig.getAccessKeySecret());
setAccessKeyId(staticConfig.getAccessKeyId());
setAccessKeySecret(staticConfig.getAccessKeySecret());
//update-end-authortaoyan date:20200811 for:配置类数据获取
//初始化acsClient,暂不支持region化
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret);
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", PRODUCT, DOMAIN);
IAcsClient acsClient = new DefaultAcsClient(profile);
//验证json参数
validateParam(templateParamJson, dySmsEnum);
//组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest request = new SendSmsRequest();
//必填:待发送手机号
request.setPhoneNumbers(phone);
//必填:短信签名-可在短信控制台中找到
request.setSignName(dySmsEnum.getSignName());
//必填:短信模板-可在短信控制台中找到
request.setTemplateCode(dySmsEnum.getTemplateCode());
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request.setTemplateParam(templateParamJson.toJSONString());
//选填-上行短信扩展码(无特殊需求用户请忽略此字段)
//request.setSmsUpExtendCode("90997");
//可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
//request.setOutId("yourOutId");
boolean result = false;
//hint 此处可能会抛出异常注意catch
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
logger.info("短信接口返回的数据----------------");
logger.info("{Code:" + sendSmsResponse.getCode() + ",Message:" + sendSmsResponse.getMessage() + ",RequestId:" + sendSmsResponse.getRequestId() + ",BizId:" + sendSmsResponse.getBizId() + "}");
String ok = "OK";
if (ok.equals(sendSmsResponse.getCode())) {
result = true;
}
return result;
}
private static void validateParam(JSONObject templateParamJson, DySmsEnum dySmsEnum) {
String keys = dySmsEnum.getKeys();
String[] keyArr = keys.split(",");
for (String item : keyArr) {
if (!templateParamJson.containsKey(item)) {
throw new RuntimeException("模板缺少参数:" + item);
}
}
}
// public static void main(String[] args) throws ClientException, InterruptedException {
// JSONObject obj = new JSONObject();
// obj.put("code", "1234");
// sendSms("13800138000", obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE);
// } // }
} //
// public static void setAccessKeySecret(String accessKeySecret) {
// DySmsHelper.accessKeySecret = accessKeySecret;
// }
//
// public static String getAccessKeyId() {
// return accessKeyId;
// }
//
// public static String getAccessKeySecret() {
// return accessKeySecret;
// }
//
//
// public static boolean sendSms(String phone, JSONObject templateParamJson, DySmsEnum dySmsEnum) throws ClientException {
// //可自助调整超时时间
// System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
// System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//
// //update-begin-authortaoyan date:20200811 for:配置类数据获取
// StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
// //logger.info("阿里大鱼短信秘钥 accessKeyId" + staticConfig.getAccessKeyId());
// //logger.info("阿里大鱼短信秘钥 accessKeySecret"+ staticConfig.getAccessKeySecret());
// setAccessKeyId(staticConfig.getAccessKeyId());
// setAccessKeySecret(staticConfig.getAccessKeySecret());
// //update-end-authortaoyan date:20200811 for:配置类数据获取
//
// //初始化acsClient,暂不支持region化
// IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret);
// DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", PRODUCT, DOMAIN);
// IAcsClient acsClient = new DefaultAcsClient(profile);
//
// //验证json参数
// validateParam(templateParamJson, dySmsEnum);
//
// //组装请求对象-具体描述见控制台-文档部分内容
// SendSmsRequest request = new SendSmsRequest();
// //必填:待发送手机号
// request.setPhoneNumbers(phone);
// //必填:短信签名-可在短信控制台中找到
// request.setSignName(dySmsEnum.getSignName());
// //必填:短信模板-可在短信控制台中找到
// request.setTemplateCode(dySmsEnum.getTemplateCode());
// //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
// request.setTemplateParam(templateParamJson.toJSONString());
//
// //选填-上行短信扩展码(无特殊需求用户请忽略此字段)
// //request.setSmsUpExtendCode("90997");
//
// //可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
// //request.setOutId("yourOutId");
//
// boolean result = false;
//
// //hint 此处可能会抛出异常注意catch
// SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
// logger.info("短信接口返回的数据----------------");
// logger.info("{Code:" + sendSmsResponse.getCode() + ",Message:" + sendSmsResponse.getMessage() + ",RequestId:" + sendSmsResponse.getRequestId() + ",BizId:" + sendSmsResponse.getBizId() + "}");
// String ok = "OK";
// if (ok.equals(sendSmsResponse.getCode())) {
// result = true;
// }
// return result;
//
// }
//
// private static void validateParam(JSONObject templateParamJson, DySmsEnum dySmsEnum) {
// String keys = dySmsEnum.getKeys();
// String[] keyArr = keys.split(",");
// for (String item : keyArr) {
// if (!templateParamJson.containsKey(item)) {
// throw new RuntimeException("模板缺少参数:" + item);
// }
// }
// }
//
//
//// public static void main(String[] args) throws ClientException, InterruptedException {
//// JSONObject obj = new JSONObject();
//// obj.put("code", "1234");
//// sendSms("13800138000", obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE);
//// }
//}

View File

@@ -1,6 +1,6 @@
package org.jeecg.common.util; package org.jeecg.common.util;
import io.netty.util.internal.StringUtil; import org.apache.commons.lang3.StringUtils;
/** /**
* 流水号生成规则(按默认规则递增数字从1-99开始递增数字到99递增字母;位数不够增加位数) * 流水号生成规则(按默认规则递增数字从1-99开始递增数字到99递增字母;位数不够增加位数)
@@ -158,7 +158,7 @@ public class YouBianCodeUtil {
} }
public static String[] cutYouBianCode(String code) { public static String[] cutYouBianCode(String code) {
if (code == null || StringUtil.isNullOrEmpty(code)) { if (code == null || StringUtils.isBlank(code)) {
return null; return null;
} else { } else {
//获取标准长度为numLength+1,截取的数量为code.length/numLength+1 //获取标准长度为numLength+1,截取的数量为code.length/numLength+1

View File

@@ -9,7 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.constant.DataBaseConstant; import org.jeecg.common.constant.DataBaseConstant;
import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.SymbolConstant;
import org.jeecgframework.codegenerate.generate.util.SimpleFormat; //import org.jeecgframework.codegenerate.generate.util.SimpleFormat;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.Map; import java.util.Map;
@@ -102,7 +102,7 @@ public class FreemarkerParseFactory {
if (paras.containsKey(MINI_DAO_FORMAT)) { if (paras.containsKey(MINI_DAO_FORMAT)) {
throw new RuntimeException("DaoFormat 是 minidao 保留关键字,不允许使用 ,请更改参数定义!"); throw new RuntimeException("DaoFormat 是 minidao 保留关键字,不允许使用 ,请更改参数定义!");
} }
paras.put(MINI_DAO_FORMAT, new SimpleFormat()); //paras.put(MINI_DAO_FORMAT, new SimpleFormat());
mytpl.process(paras, swriter); mytpl.process(paras, swriter);
String sql = getSqlText(swriter.toString()); String sql = getSqlText(swriter.toString());
paras.remove(MINI_DAO_FORMAT); paras.remove(MINI_DAO_FORMAT);
@@ -138,7 +138,7 @@ public class FreemarkerParseFactory {
if (paras.containsKey(MINI_DAO_FORMAT)) { if (paras.containsKey(MINI_DAO_FORMAT)) {
throw new RuntimeException("DaoFormat 是 minidao 保留关键字,不允许使用 ,请更改参数定义!"); throw new RuntimeException("DaoFormat 是 minidao 保留关键字,不允许使用 ,请更改参数定义!");
} }
paras.put(MINI_DAO_FORMAT, new SimpleFormat()); //paras.put(MINI_DAO_FORMAT, new SimpleFormat());
mytpl.process(paras, swriter); mytpl.process(paras, swriter);
String sql = getSqlText(swriter.toString(), keepSpace); String sql = getSqlText(swriter.toString(), keepSpace);
paras.remove(MINI_DAO_FORMAT); paras.remove(MINI_DAO_FORMAT);

View File

@@ -1,11 +1,11 @@
package org.jeecg.common.util.oss; package org.jeecg.common.util.oss;
import com.aliyun.oss.ClientConfiguration; //import com.aliyun.oss.ClientConfiguration;
import com.aliyun.oss.OSSClient; //import com.aliyun.oss.OSSClient;
import com.aliyun.oss.common.auth.DefaultCredentialProvider; //import com.aliyun.oss.common.auth.DefaultCredentialProvider;
import com.aliyun.oss.model.CannedAccessControlList; //import com.aliyun.oss.model.CannedAccessControlList;
import com.aliyun.oss.model.OSSObject; //import com.aliyun.oss.model.OSSObject;
import com.aliyun.oss.model.PutObjectResult; //import com.aliyun.oss.model.PutObjectResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItemStream; import org.apache.commons.fileupload.FileItemStream;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
@@ -77,14 +77,14 @@ public class OssBootUtil {
return bucketName; return bucketName;
} }
public static OSSClient getOssClient() { //public static OSSClient getOssClient() {
return ossClient; // return ossClient;
} //}
/** /**
* oss 工具客户端 * oss 工具客户端
*/ */
private static OSSClient ossClient = null; //private static OSSClient ossClient = null;
/** /**
* 上传文件至阿里云 OSS * 上传文件至阿里云 OSS
@@ -96,7 +96,7 @@ public class OssBootUtil {
* @return oss 中的相对文件路径 * @return oss 中的相对文件路径
*/ */
public static String upload(MultipartFile file, String fileDir, String customBucket) throws Exception { public static String upload(MultipartFile file, String fileDir, String customBucket) throws Exception {
//update-begin-author:liusq date:20210809 for: 过滤上传文件类型 /*//update-begin-author:liusq date:20210809 for: 过滤上传文件类型
SsrfFileTypeFilter.checkUploadFileType(file); SsrfFileTypeFilter.checkUploadFileType(file);
//update-end-author:liusq date:20210809 for: 过滤上传文件类型 //update-end-author:liusq date:20210809 for: 过滤上传文件类型
@@ -146,8 +146,8 @@ public class OssBootUtil {
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return null; return null;
} }*/
return filePath; return "";
} }
/** /**
@@ -186,7 +186,7 @@ public class OssBootUtil {
*/ */
public static String upload(FileItemStream file, String fileDir) { public static String upload(FileItemStream file, String fileDir) {
String filePath = null; String filePath = null;
initOss(endPoint, accessKeyId, accessKeySecret); /*initOss(endPoint, accessKeyId, accessKeySecret);
StringBuilder fileUrl = new StringBuilder(); StringBuilder fileUrl = new StringBuilder();
try { try {
String suffix = file.getName().substring(file.getName().lastIndexOf('.')); String suffix = file.getName().substring(file.getName().lastIndexOf('.'));
@@ -210,7 +210,7 @@ public class OssBootUtil {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
return null; return null;
} }*/
return filePath; return filePath;
} }
@@ -229,7 +229,7 @@ public class OssBootUtil {
* @param url * @param url
*/ */
public static void deleteUrl(String url, String bucket) { public static void deleteUrl(String url, String bucket) {
String newBucket = bucketName; /* String newBucket = bucketName;
if (oConvertUtils.isNotEmpty(bucket)) { if (oConvertUtils.isNotEmpty(bucket)) {
newBucket = bucket; newBucket = bucket;
} }
@@ -242,7 +242,7 @@ public class OssBootUtil {
//TODO 暂时不允许删除云存储的文件 //TODO 暂时不允许删除云存储的文件
//initOss(endPoint, accessKeyId, accessKeySecret); //initOss(endPoint, accessKeyId, accessKeySecret);
url = url.replace(bucketUrl, ""); url = url.replace(bucketUrl, "");
ossClient.deleteObject(newBucket, url); ossClient.deleteObject(newBucket, url);*/
} }
/** /**
@@ -251,7 +251,7 @@ public class OssBootUtil {
* @param fileName * @param fileName
*/ */
public static void delete(String fileName) { public static void delete(String fileName) {
ossClient.deleteObject(bucketName, fileName); //ossClient.deleteObject(bucketName, fileName);
} }
/** /**
@@ -263,7 +263,7 @@ public class OssBootUtil {
*/ */
public static InputStream getOssFile(String objectName, String bucket) { public static InputStream getOssFile(String objectName, String bucket) {
InputStream inputStream = null; InputStream inputStream = null;
try { /*try {
String newBucket = bucketName; String newBucket = bucketName;
if (oConvertUtils.isNotEmpty(bucket)) { if (oConvertUtils.isNotEmpty(bucket)) {
newBucket = bucket; newBucket = bucket;
@@ -276,7 +276,7 @@ public class OssBootUtil {
inputStream = new BufferedInputStream(ossObject.getObjectContent()); inputStream = new BufferedInputStream(ossObject.getObjectContent());
} catch (Exception e) { } catch (Exception e) {
log.info("文件获取失败" + e.getMessage()); log.info("文件获取失败" + e.getMessage());
} }*/
return inputStream; return inputStream;
} }
@@ -298,7 +298,7 @@ public class OssBootUtil {
* @return * @return
*/ */
public static String getObjectUrl(String bucketName, String objectName, Date expires) { public static String getObjectUrl(String bucketName, String objectName, Date expires) {
initOss(endPoint, accessKeyId, accessKeySecret); /* initOss(endPoint, accessKeyId, accessKeySecret);
try { try {
//update-begin---author:liusq Date:20220120 for替换objectName前缀防止key不一致导致获取不到文件---- //update-begin---author:liusq Date:20220120 for替换objectName前缀防止key不一致导致获取不到文件----
objectName = OssBootUtil.replacePrefix(objectName, bucketName); objectName = OssBootUtil.replacePrefix(objectName, bucketName);
@@ -312,7 +312,7 @@ public class OssBootUtil {
} }
} catch (Exception e) { } catch (Exception e) {
log.info("文件路径获取失败" + e.getMessage()); log.info("文件路径获取失败" + e.getMessage());
} }*/
return null; return null;
} }
@@ -321,14 +321,14 @@ public class OssBootUtil {
* *
* @return * @return
*/ */
private static OSSClient initOss(String endpoint, String accessKeyId, String accessKeySecret) { //private static OSSClient initOss(String endpoint, String accessKeyId, String accessKeySecret) {
if (ossClient == null) { // if (ossClient == null) {
ossClient = new OSSClient(endpoint, // ossClient = new OSSClient(endpoint,
new DefaultCredentialProvider(accessKeyId, accessKeySecret), // new DefaultCredentialProvider(accessKeyId, accessKeySecret),
new ClientConfiguration()); // new ClientConfiguration());
} // }
return ossClient; // return ossClient;
} //}
/** /**
@@ -340,7 +340,7 @@ public class OssBootUtil {
*/ */
public static String upload(InputStream stream, String relativePath) { public static String upload(InputStream stream, String relativePath) {
String filePath = null; String filePath = null;
String fileUrl = relativePath; /*String fileUrl = relativePath;
initOss(endPoint, accessKeyId, accessKeySecret); initOss(endPoint, accessKeyId, accessKeySecret);
if (oConvertUtils.isNotEmpty(staticDomain) && staticDomain.toLowerCase().startsWith(CommonConstant.STR_HTTP)) { if (oConvertUtils.isNotEmpty(staticDomain) && staticDomain.toLowerCase().startsWith(CommonConstant.STR_HTTP)) {
filePath = staticDomain + SymbolConstant.SINGLE_SLASH + relativePath; filePath = staticDomain + SymbolConstant.SINGLE_SLASH + relativePath;
@@ -352,7 +352,7 @@ public class OssBootUtil {
ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead); ossClient.setBucketAcl(bucketName, CannedAccessControlList.PublicRead);
if (result != null) { if (result != null) {
log.info("------OSS文件上传成功------" + fileUrl); log.info("------OSS文件上传成功------" + fileUrl);
} }*/
return filePath; return filePath;
} }

View File

@@ -10,7 +10,7 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import io.micrometer.prometheus.PrometheusMeterRegistry; //import io.micrometer.prometheus.PrometheusMeterRegistry;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.ObjectProvider;
@@ -54,8 +54,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
@Value("${spring.resource.static-locations:}") @Value("${spring.resource.static-locations:}")
private String staticLocations; private String staticLocations;
@Autowired(required = false) //@Autowired(required = false)
private PrometheusMeterRegistry prometheusMeterRegistry; //private PrometheusMeterRegistry prometheusMeterRegistry;
@Autowired @Autowired
private ObjectProvider<Jackson2ObjectMapperBuilder> builderProvider; private ObjectProvider<Jackson2ObjectMapperBuilder> builderProvider;
@@ -158,10 +158,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
/** /**
* 解决metrics端点不显示jvm信息的问题(zyf) * 解决metrics端点不显示jvm信息的问题(zyf)
*/ */
@Bean //@Bean
InitializingBean forcePrometheusPostProcessor(BeanPostProcessor meterRegistryPostProcessor) { //InitializingBean forcePrometheusPostProcessor(BeanPostProcessor meterRegistryPostProcessor) {
return () -> meterRegistryPostProcessor.postProcessAfterInitialization(prometheusMeterRegistry, ""); // return () -> meterRegistryPostProcessor.postProcessAfterInitialization(prometheusMeterRegistry, "");
} //}
// /** // /**
// * 注册拦截器【拦截器拦截参数,自动切换数据源——后期实现多租户切换数据源功能】 // * 注册拦截器【拦截器拦截参数,自动切换数据源——后期实现多租户切换数据源功能】

View File

@@ -1,38 +1,38 @@
package org.jeecg.config; //package org.jeecg.config;
//
import org.jeecg.config.filter.WebsocketFilter; //import org.jeecg.config.filter.WebsocketFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean; //import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter; //import org.springframework.web.socket.server.standard.ServerEndpointExporter;
//
/** ///**
* @Description: WebSocketConfig // * @Description: WebSocketConfig
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
@Configuration //@Configuration
public class WebSocketConfig { //public class WebSocketConfig {
/** // /**
* 注入ServerEndpointExporter // * 注入ServerEndpointExporter
* 这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint // * 这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint
*/ // */
@Bean // @Bean
public ServerEndpointExporter serverEndpointExporter() { // public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter(); // return new ServerEndpointExporter();
} // }
//
@Bean // @Bean
public WebsocketFilter websocketFilter() { // public WebsocketFilter websocketFilter() {
return new WebsocketFilter(); // return new WebsocketFilter();
} // }
//
@Bean // @Bean
public FilterRegistrationBean getFilterRegistrationBean() { // public FilterRegistrationBean getFilterRegistrationBean() {
FilterRegistrationBean bean = new FilterRegistrationBean(); // FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(websocketFilter()); // bean.setFilter(websocketFilter());
//TODO 临时注释掉测试下线上socket总断的问题 // //TODO 临时注释掉测试下线上socket总断的问题
bean.addUrlPatterns("/taskCountSocket/*", "/websocket/*", "/eoaSocket/*", "/eoaNewChatSocket/*", "/newsWebsocket/*", "/vxeSocket/*"); // bean.addUrlPatterns("/taskCountSocket/*", "/websocket/*", "/eoaSocket/*", "/eoaNewChatSocket/*", "/newsWebsocket/*", "/vxeSocket/*");
return bean; // return bean;
} // }
//
} //}

View File

@@ -14,6 +14,10 @@
<dependencies> <dependencies>
<!-- SYSTEM 系统管理模块 --> <!-- SYSTEM 系统管理模块 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
<artifactId>physical-system-biz</artifactId> <artifactId>physical-system-biz</artifactId>

View File

@@ -1,6 +1,6 @@
package org.jeecg; package org.jeecg;
import com.xkcoding.justauth.autoconfigure.JustAuthAutoConfiguration; //import com.xkcoding.justauth.autoconfigure.JustAuthAutoConfiguration;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
@@ -22,7 +22,7 @@ import java.net.UnknownHostException;
@Slf4j @Slf4j
@SpringBootApplication @SpringBootApplication
@EnableAsync @EnableAsync
@ImportAutoConfiguration(JustAuthAutoConfiguration.class) // spring boot 3.x justauth 兼容性处理 //@ImportAutoConfiguration(JustAuthAutoConfiguration.class) // spring boot 3.x justauth 兼容性处理
//@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class}) //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
public class PhysicalApplication extends SpringBootServletInitializer { public class PhysicalApplication extends SpringBootServletInitializer {

View File

@@ -1,142 +1,142 @@
package org.jeecg.modules.message.test; //package org.jeecg.modules.message.test;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException; //import com.aliyuncs.exceptions.ClientException;
import org.jeecg.PhysicalApplication; //import org.jeecg.PhysicalApplication;
import org.jeecg.common.api.dto.message.BusMessageDTO; //import org.jeecg.common.api.dto.message.BusMessageDTO;
import org.jeecg.common.api.dto.message.BusTemplateMessageDTO; //import org.jeecg.common.api.dto.message.BusTemplateMessageDTO;
import org.jeecg.common.api.dto.message.MessageDTO; //import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.api.dto.message.TemplateMessageDTO; //import org.jeecg.common.api.dto.message.TemplateMessageDTO;
import org.jeecg.common.constant.CommonConstant; //import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.enums.DySmsEnum; //import org.jeecg.common.constant.enums.DySmsEnum;
import org.jeecg.common.constant.enums.EmailTemplateEnum; //import org.jeecg.common.constant.enums.EmailTemplateEnum;
import org.jeecg.common.constant.enums.MessageTypeEnum; //import org.jeecg.common.constant.enums.MessageTypeEnum;
import org.jeecg.common.constant.enums.SysAnnmentTypeEnum; //import org.jeecg.common.constant.enums.SysAnnmentTypeEnum;
import org.jeecg.common.system.api.ISysBaseAPI; //import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.DySmsHelper; //import org.jeecg.common.util.DySmsHelper;
import org.junit.Test; //import org.junit.Test;
import org.junit.runner.RunWith; //import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; //import org.springframework.test.context.junit4.SpringRunner;
//
import java.util.HashMap; //import java.util.HashMap;
import java.util.Map; //import java.util.Map;
//
/** ///**
* @Description: 消息推送测试 // * @Description: 消息推送测试
* @Author: lsq // * @Author: lsq
*/ // */
@RunWith(SpringRunner.class) //@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = PhysicalApplication.class) //@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = PhysicalApplication.class)
public class SendMessageTest { //public class SendMessageTest {
//
@Autowired // @Autowired
ISysBaseAPI sysBaseAPI; // ISysBaseAPI sysBaseAPI;
//
/** // /**
* 发送系统消息 // * 发送系统消息
*/ // */
@Test // @Test
public void sendSysAnnouncement() { // public void sendSysAnnouncement() {
//发送人 // //发送人
String fromUser = "admin"; // String fromUser = "admin";
//接收人 // //接收人
String toUser = "jeecg"; // String toUser = "jeecg";
//标题 // //标题
String title = "系统消息"; // String title = "系统消息";
//内容 // //内容
String msgContent = "TEST:今日份日程计划已送达!"; // String msgContent = "TEST:今日份日程计划已送达!";
//发送系统消息 // //发送系统消息
sysBaseAPI.sendSysAnnouncement(new MessageDTO(fromUser, toUser, title, msgContent)); // sysBaseAPI.sendSysAnnouncement(new MessageDTO(fromUser, toUser, title, msgContent));
//消息类型 // //消息类型
String msgCategory = CommonConstant.MSG_CATEGORY_1; // String msgCategory = CommonConstant.MSG_CATEGORY_1;
//业务类型 // //业务类型
String busType = SysAnnmentTypeEnum.EMAIL.getType(); // String busType = SysAnnmentTypeEnum.EMAIL.getType();
//业务ID // //业务ID
String busId = "11111"; // String busId = "11111";
//发送带业务参数的系统消息 // //发送带业务参数的系统消息
BusMessageDTO busMessageDTO = new BusMessageDTO(fromUser, toUser, title, msgContent, msgCategory, busType, busId); // BusMessageDTO busMessageDTO = new BusMessageDTO(fromUser, toUser, title, msgContent, msgCategory, busType, busId);
sysBaseAPI.sendBusAnnouncement(busMessageDTO); // sysBaseAPI.sendBusAnnouncement(busMessageDTO);
} // }
//
/** // /**
* 发送模版消息 // * 发送模版消息
*/ // */
@Test // @Test
public void sendTemplateAnnouncement() { // public void sendTemplateAnnouncement() {
//发送人 // //发送人
String fromUser = "admin"; // String fromUser = "admin";
//接收人 // //接收人
String toUser = "jeecg"; // String toUser = "jeecg";
//标题 // //标题
String title = "通知公告"; // String title = "通知公告";
//模版编码 // //模版编码
String templateCode = "412358"; // String templateCode = "412358";
//模版参数 // //模版参数
Map templateParam = new HashMap<>(); // Map templateParam = new HashMap<>();
templateParam.put("realname", "JEECG用户"); // templateParam.put("realname", "JEECG用户");
sysBaseAPI.sendTemplateAnnouncement(new TemplateMessageDTO(fromUser, toUser, title, templateParam, templateCode)); // sysBaseAPI.sendTemplateAnnouncement(new TemplateMessageDTO(fromUser, toUser, title, templateParam, templateCode));
//业务类型 // //业务类型
String busType = SysAnnmentTypeEnum.EMAIL.getType(); // String busType = SysAnnmentTypeEnum.EMAIL.getType();
//业务ID // //业务ID
String busId = "11111"; // String busId = "11111";
//发送带业务参数的模版消息 // //发送带业务参数的模版消息
BusTemplateMessageDTO busMessageDTO = new BusTemplateMessageDTO(fromUser, toUser, title, templateParam, templateCode, busType, busId); // BusTemplateMessageDTO busMessageDTO = new BusTemplateMessageDTO(fromUser, toUser, title, templateParam, templateCode, busType, busId);
sysBaseAPI.sendBusTemplateAnnouncement(busMessageDTO); // sysBaseAPI.sendBusTemplateAnnouncement(busMessageDTO);
//新发送模版消息 // //新发送模版消息
MessageDTO messageDTO = new MessageDTO(); // MessageDTO messageDTO = new MessageDTO();
messageDTO.setType(MessageTypeEnum.XT.getType()); // messageDTO.setType(MessageTypeEnum.XT.getType());
messageDTO.setToAll(false); // messageDTO.setToAll(false);
messageDTO.setToUser(toUser); // messageDTO.setToUser(toUser);
messageDTO.setTitle("【流程错误】"); // messageDTO.setTitle("【流程错误】");
messageDTO.setFromUser("admin"); // messageDTO.setFromUser("admin");
HashMap data = new HashMap<>(); // HashMap data = new HashMap<>();
data.put(CommonConstant.NOTICE_MSG_BUS_TYPE, "msg_node"); // data.put(CommonConstant.NOTICE_MSG_BUS_TYPE, "msg_node");
messageDTO.setData(data); // messageDTO.setData(data);
messageDTO.setContent("TEST:流程执行失败!任务节点未找到"); // messageDTO.setContent("TEST:流程执行失败!任务节点未找到");
sysBaseAPI.sendTemplateMessage(messageDTO); // sysBaseAPI.sendTemplateMessage(messageDTO);
} // }
//
/** // /**
* 发送邮件 // * 发送邮件
*/ // */
@Test // @Test
public void sendEmailMsg() { // public void sendEmailMsg() {
String title = "【日程提醒】您的日程任务即将开始"; // String title = "【日程提醒】您的日程任务即将开始";
String content = "TEST:尊敬的王先生您购买的演唱会将于本周日1008分在国家大剧院如期举行届时请携带好您的门票和身份证到场"; // String content = "TEST:尊敬的王先生您购买的演唱会将于本周日1008分在国家大剧院如期举行届时请携带好您的门票和身份证到场";
String email = "250678106@qq.com"; // String email = "250678106@qq.com";
sysBaseAPI.sendEmailMsg(email, title, content); // sysBaseAPI.sendEmailMsg(email, title, content);
} // }
//
/** // /**
* 发送html模版邮件 // * 发送html模版邮件
*/ // */
@Test // @Test
public void sendTemplateEmailMsg() { // public void sendTemplateEmailMsg() {
String title = "收到一个催办"; // String title = "收到一个催办";
String email = "250678106@qq.com"; // String email = "250678106@qq.com";
JSONObject params = new JSONObject(); // JSONObject params = new JSONObject();
params.put("bpm_name", "高级设置"); // params.put("bpm_name", "高级设置");
params.put("bpm_task", "审批人"); // params.put("bpm_task", "审批人");
params.put("datetime", "2023-10-07 18:00:49"); // params.put("datetime", "2023-10-07 18:00:49");
params.put("url", "http://boot3.jeecg.com/message/template"); // params.put("url", "http://boot3.jeecg.com/message/template");
params.put("remark", "快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点"); // params.put("remark", "快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点");
sysBaseAPI.sendHtmlTemplateEmail(email, title, EmailTemplateEnum.BPM_CUIBAN_EMAIL, params); // sysBaseAPI.sendHtmlTemplateEmail(email, title, EmailTemplateEnum.BPM_CUIBAN_EMAIL, params);
} // }
//
/** // /**
* 发送短信 // * 发送短信
*/ // */
@Test // @Test
public void sendSms() throws ClientException { // public void sendSms() throws ClientException {
//手机号 // //手机号
String mobile = "159***"; // String mobile = "159***";
//消息模版 // //消息模版
DySmsEnum templateCode = DySmsEnum.LOGIN_TEMPLATE_CODE; // DySmsEnum templateCode = DySmsEnum.LOGIN_TEMPLATE_CODE;
//模版所需参数 // //模版所需参数
JSONObject obj = new JSONObject(); // JSONObject obj = new JSONObject();
obj.put("code", "4XDP"); // obj.put("code", "4XDP");
DySmsHelper.sendSms(mobile, obj, templateCode); // DySmsHelper.sendSms(mobile, obj, templateCode);
} // }
} //}

View File

@@ -26,10 +26,10 @@
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId> <artifactId>hibernate-core</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot3</groupId> <!-- <groupId>org.jeecgframework.boot3</groupId>-->
<artifactId>hibernate-re</artifactId> <!-- <artifactId>hibernate-re</artifactId>-->
</dependency> <!-- </dependency>-->
<!-- 引入分布式锁依赖 --> <!-- 引入分布式锁依赖 -->
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
@@ -37,20 +37,20 @@
<version>3.7.0</version> <version>3.7.0</version>
</dependency> </dependency>
<!-- 企业微信/钉钉 api --> <!-- 企业微信/钉钉 api -->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework</groupId> <!-- <groupId>org.jeecgframework</groupId>-->
<artifactId>jeewx-api</artifactId> <!-- <artifactId>jeewx-api</artifactId>-->
</dependency> <!-- </dependency>-->
<!-- 积木报表 --> <!-- 积木报表 -->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.jimureport</groupId> <!-- <groupId>org.jeecgframework.jimureport</groupId>-->
<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> <!-- <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.jimureport</groupId> <!-- <groupId>org.jeecgframework.jimureport</groupId>-->
<artifactId>drag-free-springboot3</artifactId> <!-- <artifactId>drag-free-springboot3</artifactId>-->
<version>1.1.2</version> <!-- <version>1.1.2</version>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId> <artifactId>hutool-core</artifactId>
@@ -60,17 +60,17 @@
<artifactId>hutool-http</artifactId> <artifactId>hutool-http</artifactId>
</dependency> </dependency>
<!-- chatgpt --> <!-- chatgpt -->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot</groupId> <!-- <groupId>org.jeecgframework.boot</groupId>-->
<artifactId>jeecg-boot-starter3-chatgpt</artifactId> <!-- <artifactId>jeecg-boot-starter3-chatgpt</artifactId>-->
<version>3.7.0</version> <!-- <version>3.7.0</version>-->
<exclusions> <!-- <exclusions>-->
<exclusion> <!-- <exclusion>-->
<groupId>cn.hutool</groupId> <!-- <groupId>cn.hutool</groupId>-->
<artifactId>hutool-all</artifactId> <!-- <artifactId>hutool-all</artifactId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> <!-- </exclusions>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<!-- jsoup HTML parser library @ https://jsoup.org/ --> <!-- jsoup HTML parser library @ https://jsoup.org/ -->
<groupId>org.jsoup</groupId> <groupId>org.jsoup</groupId>

View File

@@ -3,7 +3,7 @@ package org.jeecg.config.init;
import com.alibaba.druid.filter.config.ConfigTools; import com.alibaba.druid.filter.config.ConfigTools;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.codegenerate.database.CodegenDatasourceConfig; //import org.jeecgframework.codegenerate.database.CodegenDatasourceConfig;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@@ -46,7 +46,7 @@ public class CodeGenerateDbConfig {
log.error(" 代码生成器数据库连接,数据库密码解密失败!"); log.error(" 代码生成器数据库连接,数据库密码解密失败!");
} }
} }
CodegenDatasourceConfig.initDbConfig(driverClassName, url, username, password); //CodegenDatasourceConfig.initDbConfig(driverClassName, url, username, password);
log.info(" Init CodeGenerate Config [ Get Db Config From application.yml ] "); log.info(" Init CodeGenerate Config [ Get Db Config From application.yml ] ");
} }
return null; return null;

View File

@@ -1,105 +1,105 @@
package org.jeecg.config.jimureport; //package org.jeecg.config.jimureport;
//
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.dto.LogDTO; //import org.jeecg.common.api.dto.LogDTO;
import org.jeecg.common.system.api.ISysBaseAPI; //import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.vo.DictModel; //import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.oConvertUtils; //import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.base.service.BaseCommonService; //import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.drag.service.IOnlDragExternalService; //import org.jeecg.modules.drag.service.IOnlDragExternalService;
import org.jeecg.modules.drag.vo.DragDictModel; //import org.jeecg.modules.drag.vo.DragDictModel;
import org.jeecg.modules.drag.vo.DragLogDTO; //import org.jeecg.modules.drag.vo.DragLogDTO;
import org.springframework.beans.BeanUtils; //import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; //import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; //import org.springframework.stereotype.Service;
//
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.HashMap; //import java.util.HashMap;
import java.util.List; //import java.util.List;
import java.util.Map; //import java.util.Map;
//
/** ///**
* @Description: 字典处理 // * @Description: 字典处理
* @Author: lsq // * @Author: lsq
* @Date:2023-01-09 // * @Date:2023-01-09
* @Version:V1.0 // * @Version:V1.0
*/ // */
@Slf4j //@Slf4j
@Service("onlDragExternalServiceImpl") //@Service("onlDragExternalServiceImpl")
public class JimuDragExternalServiceImpl implements IOnlDragExternalService { //public class JimuDragExternalServiceImpl implements IOnlDragExternalService {
//
@Autowired // @Autowired
@Lazy // @Lazy
private BaseCommonService baseCommonService; // private BaseCommonService baseCommonService;
//
@Autowired // @Autowired
@Lazy // @Lazy
private ISysBaseAPI sysBaseApi; // private ISysBaseAPI sysBaseApi;
//
/** // /**
* 根据多个字典code查询多个字典项 // * 根据多个字典code查询多个字典项
* // *
* @param codeList // * @param codeList
* @return key = dictCode value=对应的字典项 // * @return key = dictCode value=对应的字典项
*/ // */
@Override // @Override
public Map<String, List<DragDictModel>> getManyDictItems(List<String> codeList) { // public Map<String, List<DragDictModel>> getManyDictItems(List<String> codeList) {
Map<String, List<DragDictModel>> manyDragDictItems = new HashMap<>(); // Map<String, List<DragDictModel>> manyDragDictItems = new HashMap<>();
Map<String, List<DictModel>> dictItemsMap = sysBaseApi.getManyDictItems(codeList); // Map<String, List<DictModel>> dictItemsMap = sysBaseApi.getManyDictItems(codeList);
dictItemsMap.forEach((k, v) -> { // dictItemsMap.forEach((k, v) -> {
List<DragDictModel> dictItems = new ArrayList<>(); // List<DragDictModel> dictItems = new ArrayList<>();
v.forEach(dictItem -> { // v.forEach(dictItem -> {
DragDictModel dictModel = new DragDictModel(); // DragDictModel dictModel = new DragDictModel();
BeanUtils.copyProperties(dictItem, dictModel); // BeanUtils.copyProperties(dictItem, dictModel);
dictItems.add(dictModel); // dictItems.add(dictModel);
}); // });
manyDragDictItems.put(k, dictItems); // manyDragDictItems.put(k, dictItems);
}); // });
return manyDragDictItems; // return manyDragDictItems;
} // }
//
/** // /**
* @param dictCode // * @param dictCode
* @return // * @return
*/ // */
@Override // @Override
public List<DragDictModel> getDictItems(String dictCode) { // public List<DragDictModel> getDictItems(String dictCode) {
List<DragDictModel> dictItems = new ArrayList<>(); // List<DragDictModel> dictItems = new ArrayList<>();
if (oConvertUtils.isNotEmpty(dictCode)) { // if (oConvertUtils.isNotEmpty(dictCode)) {
List<DictModel> dictItemsList = sysBaseApi.getDictItems(dictCode); // List<DictModel> dictItemsList = sysBaseApi.getDictItems(dictCode);
dictItemsList.forEach(dictItem -> { // dictItemsList.forEach(dictItem -> {
DragDictModel dictModel = new DragDictModel(); // DragDictModel dictModel = new DragDictModel();
BeanUtils.copyProperties(dictItem, dictModel); // BeanUtils.copyProperties(dictItem, dictModel);
dictItems.add(dictModel); // dictItems.add(dictModel);
}); // });
} // }
return dictItems; // return dictItems;
} // }
//
/** // /**
* 添加日志 // * 添加日志
* // *
* @param dragLogDTO // * @param dragLogDTO
*/ // */
@Override // @Override
public void addLog(DragLogDTO dragLogDTO) { // public void addLog(DragLogDTO dragLogDTO) {
if (oConvertUtils.isNotEmpty(dragLogDTO)) { // if (oConvertUtils.isNotEmpty(dragLogDTO)) {
LogDTO dto = new LogDTO(); // LogDTO dto = new LogDTO();
BeanUtils.copyProperties(dragLogDTO, dto); // BeanUtils.copyProperties(dragLogDTO, dto);
baseCommonService.addLog(dto); // baseCommonService.addLog(dto);
} // }
} // }
//
/** // /**
* 保存日志 // * 保存日志
* // *
* @param logMsg // * @param logMsg
* @param logType // * @param logType
* @param operateType // * @param operateType
*/ // */
@Override // @Override
public void addLog(String logMsg, int logType, int operateType) { // public void addLog(String logMsg, int logType, int operateType) {
baseCommonService.addLog(logMsg, logType, operateType); // baseCommonService.addLog(logMsg, logType, operateType);
} // }
} //}

View File

@@ -1,82 +1,82 @@
package org.jeecg.config.jimureport; //package org.jeecg.config.jimureport;
//
import jakarta.servlet.http.HttpServletRequest; //import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.util.JwtUtil; //import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.SysUserCacheInfo; //import org.jeecg.common.system.vo.SysUserCacheInfo;
import org.jeecg.common.util.RedisUtil; //import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.TokenUtils; //import org.jeecg.common.util.TokenUtils;
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI; ////import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl; //import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; //import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; //import org.springframework.util.CollectionUtils;
//
import java.util.HashMap; //import java.util.HashMap;
import java.util.Map; //import java.util.Map;
import java.util.Set; //import java.util.Set;
//
/** ///**
* 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制) // * 自定义积木报表鉴权(如果不进行自定义,则所有请求不做权限控制)
* * 1.自定义获取登录token // * * 1.自定义获取登录token
* * 2.自定义获取登录用户 // * * 2.自定义获取登录用户
* // *
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
//
//
@Slf4j //@Slf4j
@Component //@Component
public class JimuReportTokenService implements JmReportTokenServiceI { //public class JimuReportTokenService implements JmReportTokenServiceI {
@Autowired // @Autowired
private SysBaseApiImpl sysBaseApi; // private SysBaseApiImpl sysBaseApi;
@Autowired // @Autowired
@Lazy // @Lazy
private RedisUtil redisUtil; // private RedisUtil redisUtil;
//
@Override // @Override
public String getToken(HttpServletRequest request) { // public String getToken(HttpServletRequest request) {
return TokenUtils.getTokenByRequest(request); // return TokenUtils.getTokenByRequest(request);
} // }
//
@Override // @Override
public String getUsername(String token) { // public String getUsername(String token) {
return JwtUtil.getUsername(token); // return JwtUtil.getUsername(token);
} // }
//
@Override // @Override
public String[] getRoles(String token) { // public String[] getRoles(String token) {
String username = JwtUtil.getUsername(token); // String username = JwtUtil.getUsername(token);
Set roles = sysBaseApi.getUserRoleSet(username); // Set roles = sysBaseApi.getUserRoleSet(username);
if (CollectionUtils.isEmpty(roles)) { // if (CollectionUtils.isEmpty(roles)) {
return null; // return null;
} // }
return (String[]) roles.toArray(new String[roles.size()]); // return (String[]) roles.toArray(new String[roles.size()]);
} // }
//
@Override // @Override
public Boolean verifyToken(String token) { // public Boolean verifyToken(String token) {
return TokenUtils.verifyToken(token, sysBaseApi, redisUtil); // return TokenUtils.verifyToken(token, sysBaseApi, redisUtil);
} // }
//
@Override // @Override
public Map<String, Object> getUserInfo(String token) { // public Map<String, Object> getUserInfo(String token) {
Map<String, Object> map = new HashMap(5); // Map<String, Object> map = new HashMap(5);
String username = JwtUtil.getUsername(token); // String username = JwtUtil.getUsername(token);
//此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义 // //此处通过token只能拿到一个信息 用户账号 后面的就是根据账号获取其他信息 查询数据或是走redis 用户根据自身业务可自定义
SysUserCacheInfo userInfo = null; // SysUserCacheInfo userInfo = null;
try { // try {
userInfo = sysBaseApi.getCacheUser(username); // userInfo = sysBaseApi.getCacheUser(username);
} catch (Exception e) { // } catch (Exception e) {
log.error("获取用户信息异常:" + e.getMessage()); // log.error("获取用户信息异常:" + e.getMessage());
return map; // return map;
} // }
//设置账号名 // //设置账号名
map.put(SYS_USER_CODE, userInfo.getSysUserCode()); // map.put(SYS_USER_CODE, userInfo.getSysUserCode());
//设置部门编码 // //设置部门编码
map.put(SYS_ORG_CODE, userInfo.getSysOrgCode()); // map.put(SYS_ORG_CODE, userInfo.getSysOrgCode());
// 将所有信息存放至map 解析sql/api会根据map的键值解析 // // 将所有信息存放至map 解析sql/api会根据map的键值解析
return map; // return map;
} // }
} //}

View File

@@ -1,106 +1,106 @@
package org.jeecg.modules.cas.util; //package org.jeecg.modules.cas.util;
//
import org.apache.http.HttpResponse; //import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet; //import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.socket.LayeredConnectionSocketFactory; //import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; //import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient; //import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; //import org.apache.http.impl.client.HttpClients;
//
import javax.net.ssl.SSLContext; //import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager; //import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager; //import javax.net.ssl.X509TrustManager;
import java.io.BufferedReader; //import java.io.BufferedReader;
import java.io.IOException; //import java.io.IOException;
import java.io.InputStreamReader; //import java.io.InputStreamReader;
import java.security.cert.X509Certificate; //import java.security.cert.X509Certificate;
//
/** ///**
* @Description: CasServiceUtil // * @Description: CasServiceUtil
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
public class CasServiceUtil { //public class CasServiceUtil {
//
public static void main(String[] args) { // public static void main(String[] args) {
String serviceUrl = "https://cas.8f8.com.cn:8443/cas/p3/serviceValidate"; // String serviceUrl = "https://cas.8f8.com.cn:8443/cas/p3/serviceValidate";
String service = "http://localhost:3003/user/login"; // String service = "http://localhost:3003/user/login";
String ticket = "ST-5-1g-9cNES6KXNRwq-GuRET103sm0-DESKTOP-VKLS8B3"; // String ticket = "ST-5-1g-9cNES6KXNRwq-GuRET103sm0-DESKTOP-VKLS8B3";
String res = getStValidate(serviceUrl, ticket, service); // String res = getStValidate(serviceUrl, ticket, service);
//
System.out.println("---------res-----" + res); // System.out.println("---------res-----" + res);
} // }
//
//
/** // /**
* 验证ST // * 验证ST
*/ // */
public static String getStValidate(String url, String st, String service) { // public static String getStValidate(String url, String st, String service) {
try { // try {
url = url + "?service=" + service + "&ticket=" + st; // url = url + "?service=" + service + "&ticket=" + st;
CloseableHttpClient httpclient = createHttpClientWithNoSsl(); // CloseableHttpClient httpclient = createHttpClientWithNoSsl();
HttpGet httpget = new HttpGet(url); // HttpGet httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget); // HttpResponse response = httpclient.execute(httpget);
String res = readResponse(response); // String res = readResponse(response);
return res == null ? null : (res == "" ? null : res); // return res == null ? null : (res == "" ? null : res);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return ""; // return "";
} // }
//
//
/** // /**
* 读取 response body 内容为字符串 // * 读取 response body 内容为字符串
* // *
* @param response // * @param response
* @return // * @return
* @throws IOException // * @throws IOException
*/ // */
private static String readResponse(HttpResponse response) throws IOException { // private static String readResponse(HttpResponse response) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); // BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String result = new String(); // String result = new String();
String line; // String line;
while ((line = in.readLine()) != null) { // while ((line = in.readLine()) != null) {
result += line; // result += line;
} // }
return result; // return result;
} // }
//
//
/** // /**
* 创建模拟客户端(针对 https 客户端禁用 SSL 验证) // * 创建模拟客户端(针对 https 客户端禁用 SSL 验证)
* // *
* @param cookieStore 缓存的 Cookies 信息 // * @param cookieStore 缓存的 Cookies 信息
* @return // * @return
* @throws Exception // * @throws Exception
*/ // */
private static CloseableHttpClient createHttpClientWithNoSsl() throws Exception { // private static CloseableHttpClient createHttpClientWithNoSsl() throws Exception {
// Create a trust manager that does not validate certificate chains // // Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{ // TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() { // new X509TrustManager() {
@Override // @Override
public X509Certificate[] getAcceptedIssuers() { // public X509Certificate[] getAcceptedIssuers() {
return null; // return null;
} // }
//
@Override // @Override
public void checkClientTrusted(X509Certificate[] certs, String authType) { // public void checkClientTrusted(X509Certificate[] certs, String authType) {
// don't check // // don't check
} // }
//
@Override // @Override
public void checkServerTrusted(X509Certificate[] certs, String authType) { // public void checkServerTrusted(X509Certificate[] certs, String authType) {
// don't check // // don't check
} // }
} // }
}; // };
//
SSLContext ctx = SSLContext.getInstance("TLS"); // SSLContext ctx = SSLContext.getInstance("TLS");
ctx.init(null, trustAllCerts, null); // ctx.init(null, trustAllCerts, null);
LayeredConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(ctx); // LayeredConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(ctx);
return HttpClients.custom() // return HttpClients.custom()
.setSSLSocketFactory(sslSocketFactory) // .setSSLSocketFactory(sslSocketFactory)
.build(); // .build();
} // }
//
} //}

View File

@@ -1,37 +1,37 @@
package org.jeecg.modules.message.handle.impl; //package org.jeecg.modules.message.handle.impl;
//
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.dto.message.MessageDTO; //import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.modules.message.handle.ISendMsgHandle; //import org.jeecg.modules.message.handle.ISendMsgHandle;
import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl; //import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
/** ///**
* @Description: 发钉钉消息模板 // * @Description: 发钉钉消息模板
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
@Slf4j //@Slf4j
@Component("ddSendMsgHandle") //@Component("ddSendMsgHandle")
public class DdSendMsgHandle implements ISendMsgHandle { //public class DdSendMsgHandle implements ISendMsgHandle {
//
@Autowired // @Autowired
private ThirdAppDingtalkServiceImpl dingtalkService; // private ThirdAppDingtalkServiceImpl dingtalkService;
//
@Override // @Override
public void sendMsg(String esReceiver, String esTitle, String esContent) { // public void sendMsg(String esReceiver, String esTitle, String esContent) {
log.info("发微信消息模板"); // log.info("发微信消息模板");
MessageDTO messageDTO = new MessageDTO(); // MessageDTO messageDTO = new MessageDTO();
messageDTO.setToUser(esReceiver); // messageDTO.setToUser(esReceiver);
messageDTO.setTitle(esTitle); // messageDTO.setTitle(esTitle);
messageDTO.setContent(esContent); // messageDTO.setContent(esContent);
messageDTO.setToAll(false); // messageDTO.setToAll(false);
sendMessage(messageDTO); // sendMessage(messageDTO);
} // }
//
@Override // @Override
public void sendMessage(MessageDTO messageDTO) { // public void sendMessage(MessageDTO messageDTO) {
dingtalkService.sendMessage(messageDTO, true); // dingtalkService.sendMessage(messageDTO, true);
} // }
//
} //}

View File

@@ -1,219 +1,219 @@
package org.jeecg.modules.message.handle.impl; //package org.jeecg.modules.message.handle.impl;
//
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; //import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.mail.MessagingException; //import jakarta.mail.MessagingException;
import jakarta.mail.internet.MimeMessage; //import jakarta.mail.internet.MimeMessage;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; //import org.apache.commons.lang3.ObjectUtils;
import org.jeecg.common.api.dto.message.MessageDTO; //import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.constant.CommonConstant; //import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.util.JwtUtil; //import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.RedisUtil; //import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.SpringContextUtils; //import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.oConvertUtils; //import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.StaticConfig; //import org.jeecg.config.StaticConfig;
import org.jeecg.modules.message.handle.ISendMsgHandle; //import org.jeecg.modules.message.handle.ISendMsgHandle;
import org.jeecg.modules.system.entity.SysUser; //import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.mapper.SysUserMapper; //import org.jeecg.modules.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSender; //import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper; //import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
import java.io.UnsupportedEncodingException; //import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; //import java.net.URLEncoder;
import java.util.List; //import java.util.List;
import java.util.Set; //import java.util.Set;
//
/** ///**
* @Description: 邮箱发送信息 // * @Description: 邮箱发送信息
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
@Slf4j //@Slf4j
@Component("emailSendMsgHandle") //@Component("emailSendMsgHandle")
public class EmailSendMsgHandle implements ISendMsgHandle { //public class EmailSendMsgHandle implements ISendMsgHandle {
static String emailFrom; // static String emailFrom;
//
public static void setEmailFrom(String emailFrom) { // public static void setEmailFrom(String emailFrom) {
EmailSendMsgHandle.emailFrom = emailFrom; // EmailSendMsgHandle.emailFrom = emailFrom;
} // }
//
@Autowired // @Autowired
SysUserMapper sysUserMapper; // SysUserMapper sysUserMapper;
//
@Autowired // @Autowired
private RedisUtil redisUtil; // private RedisUtil redisUtil;
//
/** // /**
* 真实姓名变量 // * 真实姓名变量
*/ // */
private static final String realNameExp = "{REALNAME}"; // private static final String realNameExp = "{REALNAME}";
//
//
@Override // @Override
public void sendMsg(String esReceiver, String esTitle, String esContent) { // public void sendMsg(String esReceiver, String esTitle, String esContent) {
JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender"); // JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
MimeMessage message = mailSender.createMimeMessage(); // MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = null; // MimeMessageHelper helper = null;
//update-begin-authortaoyan date:20200811 for:配置类数据获取 // //update-begin-authortaoyan date:20200811 for:配置类数据获取
if (oConvertUtils.isEmpty(emailFrom)) { // if (oConvertUtils.isEmpty(emailFrom)) {
StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class); // StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
setEmailFrom(staticConfig.getEmailFrom()); // setEmailFrom(staticConfig.getEmailFrom());
} // }
//update-end-authortaoyan date:20200811 for:配置类数据获取 // //update-end-authortaoyan date:20200811 for:配置类数据获取
try { // try {
helper = new MimeMessageHelper(message, true); // helper = new MimeMessageHelper(message, true);
// 设置发送方邮箱地址 // // 设置发送方邮箱地址
helper.setFrom(emailFrom); // helper.setFrom(emailFrom);
helper.setTo(esReceiver); // helper.setTo(esReceiver);
helper.setSubject(esTitle); // helper.setSubject(esTitle);
helper.setText(esContent, true); // helper.setText(esContent, true);
mailSender.send(message); // mailSender.send(message);
} catch (MessagingException e) { // } catch (MessagingException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
//
} // }
//
@Override // @Override
public void sendMessage(MessageDTO messageDTO) { // public void sendMessage(MessageDTO messageDTO) {
String[] arr = messageDTO.getToUser().split(","); // String[] arr = messageDTO.getToUser().split(",");
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, arr); // LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, arr);
List<SysUser> list = sysUserMapper.selectList(query); // List<SysUser> list = sysUserMapper.selectList(query);
String content = messageDTO.getContent(); // String content = messageDTO.getContent();
String title = messageDTO.getTitle(); // String title = messageDTO.getTitle();
for (SysUser user : list) { // for (SysUser user : list) {
String email = user.getEmail(); // String email = user.getEmail();
if (ObjectUtils.isEmpty(email)) { // if (ObjectUtils.isEmpty(email)) {
continue; // continue;
} // }
content = replaceContent(user, content); // content = replaceContent(user, content);
log.info("邮件内容:" + content); // log.info("邮件内容:" + content);
sendMsg(email, title, content); // sendMsg(email, title, content);
} // }
//
//update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱 // //update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
Set<String> toEmailList = messageDTO.getToEmailList(); // Set<String> toEmailList = messageDTO.getToEmailList();
if (toEmailList != null && toEmailList.size() > 0) { // if (toEmailList != null && toEmailList.size() > 0) {
for (String email : toEmailList) { // for (String email : toEmailList) {
if (ObjectUtils.isEmpty(email)) { // if (ObjectUtils.isEmpty(email)) {
continue; // continue;
} // }
log.info("邮件内容:" + content); // log.info("邮件内容:" + content);
sendMsg(email, title, content); // sendMsg(email, title, content);
} // }
} // }
//update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱 // //update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
//
//发送给抄送人 // //发送给抄送人
sendMessageToCopyUser(messageDTO); // sendMessageToCopyUser(messageDTO);
} // }
//
/** // /**
* 发送邮件给抄送人 // * 发送邮件给抄送人
* // *
* @param messageDTO // * @param messageDTO
*/ // */
public void sendMessageToCopyUser(MessageDTO messageDTO) { // public void sendMessageToCopyUser(MessageDTO messageDTO) {
String copyToUser = messageDTO.getCopyToUser(); // String copyToUser = messageDTO.getCopyToUser();
if (ObjectUtils.isNotEmpty(copyToUser)) { // if (ObjectUtils.isNotEmpty(copyToUser)) {
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, copyToUser.split(",")); // LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>().in(SysUser::getUsername, copyToUser.split(","));
List<SysUser> list = sysUserMapper.selectList(query); // List<SysUser> list = sysUserMapper.selectList(query);
String content = messageDTO.getContent(); // String content = messageDTO.getContent();
String title = messageDTO.getTitle(); // String title = messageDTO.getTitle();
//
for (SysUser user : list) { // for (SysUser user : list) {
String email = user.getEmail(); // String email = user.getEmail();
if (ObjectUtils.isEmpty(email)) { // if (ObjectUtils.isEmpty(email)) {
continue; // continue;
} // }
content = replaceContent(user, content); // content = replaceContent(user, content);
log.info("邮件内容:" + content); // log.info("邮件内容:" + content);
//
//update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱 // //update-begin-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
sendEmail(email, content, title); // sendEmail(email, content, title);
} // }
//
Set<String> ccEmailList = messageDTO.getCcEmailList(); // Set<String> ccEmailList = messageDTO.getCcEmailList();
if (ccEmailList != null && ccEmailList.size() > 0) { // if (ccEmailList != null && ccEmailList.size() > 0) {
for (String email : ccEmailList) { // for (String email : ccEmailList) {
if (ObjectUtils.isEmpty(email)) { // if (ObjectUtils.isEmpty(email)) {
continue; // continue;
} // }
log.info("邮件内容:" + content); // log.info("邮件内容:" + content);
sendEmail(email, content, title); // sendEmail(email, content, title);
} // }
} // }
//
} // }
} // }
//
/** // /**
* 发送邮件给抄送人调用 // * 发送邮件给抄送人调用
* // *
* @param email // * @param email
* @param content // * @param content
* @param title // * @param title
*/ // */
private void sendEmail(String email, String content, String title) { // private void sendEmail(String email, String content, String title) {
JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender"); // JavaMailSender mailSender = (JavaMailSender) SpringContextUtils.getBean("mailSender");
MimeMessage message = mailSender.createMimeMessage(); // MimeMessage message = mailSender.createMimeMessage();
MimeMessageHelper helper = null; // MimeMessageHelper helper = null;
if (oConvertUtils.isEmpty(emailFrom)) { // if (oConvertUtils.isEmpty(emailFrom)) {
StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class); // StaticConfig staticConfig = SpringContextUtils.getBean(StaticConfig.class);
setEmailFrom(staticConfig.getEmailFrom()); // setEmailFrom(staticConfig.getEmailFrom());
} // }
try { // try {
helper = new MimeMessageHelper(message, true); // helper = new MimeMessageHelper(message, true);
// 设置发送方邮箱地址 // // 设置发送方邮箱地址
helper.setFrom(emailFrom); // helper.setFrom(emailFrom);
helper.setTo(email); // helper.setTo(email);
//设置抄送人 // //设置抄送人
helper.setCc(email); // helper.setCc(email);
helper.setSubject(title); // helper.setSubject(title);
helper.setText(content, true); // helper.setText(content, true);
mailSender.send(message); // mailSender.send(message);
} catch (MessagingException e) { // } catch (MessagingException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
//update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱 // //update-end-author:taoyan date:2023-6-20 for: QQYUN-5557【简流】通知节点 发送邮箱 表单上有一个邮箱字段,流程中,邮件发送节点,邮件接收人 不可选择邮箱
//
//
/** // /**
* 替换邮件内容变量 // * 替换邮件内容变量
* // *
* @param user // * @param user
* @param content // * @param content
* @return // * @return
*/ // */
private String replaceContent(SysUser user, String content) { // private String replaceContent(SysUser user, String content) {
if (content.indexOf(realNameExp) > 0) { // if (content.indexOf(realNameExp) > 0) {
content = content.replace("$" + realNameExp, user.getRealname()).replace(realNameExp, user.getRealname()); // content = content.replace("$" + realNameExp, user.getRealname()).replace(realNameExp, user.getRealname());
} // }
if (content.indexOf(CommonConstant.LOGIN_TOKEN) > 0) { // if (content.indexOf(CommonConstant.LOGIN_TOKEN) > 0) {
String token = getToken(user); // String token = getToken(user);
try { // try {
content = content.replace(CommonConstant.LOGIN_TOKEN, URLEncoder.encode(token, "UTF-8")); // content = content.replace(CommonConstant.LOGIN_TOKEN, URLEncoder.encode(token, "UTF-8"));
} catch (UnsupportedEncodingException e) { // } catch (UnsupportedEncodingException e) {
log.error("邮件消息token编码失败", e.getMessage()); // log.error("邮件消息token编码失败", e.getMessage());
} // }
} // }
return content; // return content;
} // }
//
/** // /**
* 获取token // * 获取token
* // *
* @param user // * @param user
* @return // * @return
*/ // */
private String getToken(SysUser user) { // private String getToken(SysUser user) {
// 生成token // // 生成token
String token = JwtUtil.sign(user.getUsername(), user.getPassword()); // String token = JwtUtil.sign(user.getUsername(), user.getPassword());
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token); // redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
// 设置超时时间 1个小时 // // 设置超时时间 1个小时
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 1 / 1000); // redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 1 / 1000);
return token; // return token;
} // }
} //}

View File

@@ -1,37 +1,37 @@
package org.jeecg.modules.message.handle.impl; //package org.jeecg.modules.message.handle.impl;
//
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.dto.message.MessageDTO; //import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.modules.message.handle.ISendMsgHandle; //import org.jeecg.modules.message.handle.ISendMsgHandle;
import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl; //import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
//
/** ///**
* @Description: 发企业微信消息模板 // * @Description: 发企业微信消息模板
* @author: jeecg-boot // * @author: jeecg-boot
*/ // */
@Slf4j //@Slf4j
@Component("qywxSendMsgHandle") //@Component("qywxSendMsgHandle")
public class QywxSendMsgHandle implements ISendMsgHandle { //public class QywxSendMsgHandle implements ISendMsgHandle {
//
@Autowired // @Autowired
private ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService; // private ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
//
@Override // @Override
public void sendMsg(String esReceiver, String esTitle, String esContent) { // public void sendMsg(String esReceiver, String esTitle, String esContent) {
log.info("发微信消息模板"); // log.info("发微信消息模板");
MessageDTO messageDTO = new MessageDTO(); // MessageDTO messageDTO = new MessageDTO();
messageDTO.setToUser(esReceiver); // messageDTO.setToUser(esReceiver);
messageDTO.setTitle(esTitle); // messageDTO.setTitle(esTitle);
messageDTO.setContent(esContent); // messageDTO.setContent(esContent);
messageDTO.setToAll(false); // messageDTO.setToAll(false);
sendMessage(messageDTO); // sendMessage(messageDTO);
} // }
//
@Override // @Override
public void sendMessage(MessageDTO messageDTO) { // public void sendMessage(MessageDTO messageDTO) {
wechatEnterpriseService.sendMessage(messageDTO, true); // wechatEnterpriseService.sendMessage(messageDTO, true);
} // }
//
} //}

View File

@@ -1,69 +1,69 @@
package org.jeecg.modules.system.cache; //package org.jeecg.modules.system.cache;
//
import jakarta.annotation.PostConstruct; //import jakarta.annotation.PostConstruct;
import me.zhyd.oauth.cache.AuthCacheConfig; //import me.zhyd.oauth.cache.AuthCacheConfig;
import me.zhyd.oauth.cache.AuthStateCache; //import me.zhyd.oauth.cache.AuthStateCache;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; //import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations; //import org.springframework.data.redis.core.ValueOperations;
//
import java.util.concurrent.TimeUnit; //import java.util.concurrent.TimeUnit;
//
//
public class AuthStateRedisCache implements AuthStateCache { //public class AuthStateRedisCache implements AuthStateCache {
//
@Autowired // @Autowired
private RedisTemplate<String, String> redisTemplate; // private RedisTemplate<String, String> redisTemplate;
//
private ValueOperations<String, String> valueOperations; // private ValueOperations<String, String> valueOperations;
//
@PostConstruct // @PostConstruct
public void init() { // public void init() {
valueOperations = redisTemplate.opsForValue(); // valueOperations = redisTemplate.opsForValue();
} // }
//
/** // /**
* 存入缓存默认3分钟 // * 存入缓存默认3分钟
* // *
* @param key 缓存key // * @param key 缓存key
* @param value 缓存内容 // * @param value 缓存内容
*/ // */
@Override // @Override
public void cache(String key, String value) { // public void cache(String key, String value) {
valueOperations.set(key, value, AuthCacheConfig.timeout, TimeUnit.MILLISECONDS); // valueOperations.set(key, value, AuthCacheConfig.timeout, TimeUnit.MILLISECONDS);
} // }
//
/** // /**
* 存入缓存 // * 存入缓存
* // *
* @param key 缓存key // * @param key 缓存key
* @param value 缓存内容 // * @param value 缓存内容
* @param timeout 指定缓存过期时间(毫秒) // * @param timeout 指定缓存过期时间(毫秒)
*/ // */
@Override // @Override
public void cache(String key, String value, long timeout) { // public void cache(String key, String value, long timeout) {
valueOperations.set(key, value, timeout, TimeUnit.MILLISECONDS); // valueOperations.set(key, value, timeout, TimeUnit.MILLISECONDS);
} // }
//
/** // /**
* 获取缓存内容 // * 获取缓存内容
* // *
* @param key 缓存key // * @param key 缓存key
* @return 缓存内容 // * @return 缓存内容
*/ // */
@Override // @Override
public String get(String key) { // public String get(String key) {
return valueOperations.get(key); // return valueOperations.get(key);
} // }
//
/** // /**
* 是否存在key如果对应key的value值已过期也返回false // * 是否存在key如果对应key的value值已过期也返回false
* // *
* @param key 缓存key // * @param key 缓存key
* @return true存在key并且value没过期falsekey不存在或者已过期 // * @return true存在key并且value没过期falsekey不存在或者已过期
*/ // */
@Override // @Override
public boolean containsKey(String key) { // public boolean containsKey(String key) {
return redisTemplate.hasKey(key); // return redisTemplate.hasKey(key);
} // }
} //}

View File

@@ -1,15 +1,15 @@
package org.jeecg.modules.system.config; //package org.jeecg.modules.system.config;
//
import me.zhyd.oauth.cache.AuthStateCache; //import me.zhyd.oauth.cache.AuthStateCache;
import org.jeecg.modules.system.cache.AuthStateRedisCache; //import org.jeecg.modules.system.cache.AuthStateRedisCache;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
//
@Configuration //@Configuration
public class AuthStateConfiguration { //public class AuthStateConfiguration {
//
@Bean // @Bean
public AuthStateCache authStateCache() { // public AuthStateCache authStateCache() {
return new AuthStateRedisCache(); // return new AuthStateRedisCache();
} // }
} //}

View File

@@ -2,7 +2,7 @@ package org.jeecg.modules.system.controller;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException; //import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@@ -294,101 +294,101 @@ public class LoginController {
@PostMapping(value = "/sms") @PostMapping(value = "/sms")
public Result<String> sms(@RequestBody JSONObject jsonObject, HttpServletRequest request) { public Result<String> sms(@RequestBody JSONObject jsonObject, HttpServletRequest request) {
Result<String> result = new Result<String>(); Result<String> result = new Result<String>();
String clientIp = IpUtils.getIpAddr(request); //String clientIp = IpUtils.getIpAddr(request);
String mobile = jsonObject.get("mobile").toString(); //String mobile = jsonObject.get("mobile").toString();
//手机号模式 登录模式: "2" 注册模式: "1" ////手机号模式 登录模式: "2" 注册模式: "1"
String smsmode = jsonObject.get("smsmode").toString(); //String smsmode = jsonObject.get("smsmode").toString();
log.info("-------- IP:{}, 手机号:{},获取绑定验证码", clientIp, mobile); //log.info("-------- IP:{}, 手机号:{},获取绑定验证码", clientIp, mobile);
//
if (oConvertUtils.isEmpty(mobile)) { //if (oConvertUtils.isEmpty(mobile)) {
result.setMessage("手机号不允许为空!"); // result.setMessage("手机号不允许为空!");
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} //}
//
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906 ////update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE + mobile; //String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE + mobile;
Object object = redisUtil.get(redisKey); //Object object = redisUtil.get(redisKey);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906 ////update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//
if (object != null) { //if (object != null) {
result.setMessage("验证码10分钟内仍然有效"); // result.setMessage("验证码10分钟内仍然有效");
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} //}
//
//------------------------------------------------------------------------------------- ////-------------------------------------------------------------------------------------
//增加 check防止恶意刷短信接口 ////增加 check防止恶意刷短信接口
if (!DySmsLimit.canSendSms(clientIp)) { //if (!DySmsLimit.canSendSms(clientIp)) {
log.warn("--------[警告] IP地址:{}, 短信接口请求太多-------", clientIp); // log.warn("--------[警告] IP地址:{}, 短信接口请求太多-------", clientIp);
result.setMessage("短信接口请求太多,请稍后再试!"); // result.setMessage("短信接口请求太多,请稍后再试!");
result.setCode(CommonConstant.PHONE_SMS_FAIL_CODE); // result.setCode(CommonConstant.PHONE_SMS_FAIL_CODE);
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} //}
//------------------------------------------------------------------------------------- ////-------------------------------------------------------------------------------------
//
//随机数 ////随机数
String captcha = RandomUtil.randomNumbers(6); //String captcha = RandomUtil.randomNumbers(6);
JSONObject obj = new JSONObject(); //JSONObject obj = new JSONObject();
obj.put("code", captcha); //obj.put("code", captcha);
try { //try {
boolean b = false; // boolean b = false;
//注册模板 // //注册模板
if (CommonConstant.SMS_TPL_TYPE_1.equals(smsmode)) { // if (CommonConstant.SMS_TPL_TYPE_1.equals(smsmode)) {
SysUser sysUser = sysUserService.getUserByPhone(mobile); // SysUser sysUser = sysUserService.getUserByPhone(mobile);
if (sysUser != null) { // if (sysUser != null) {
result.error500(" 手机号已经注册,请直接登录!"); // result.error500(" 手机号已经注册,请直接登录!");
baseCommonService.addLog("手机号已经注册,请直接登录!", CommonConstant.LOG_TYPE_1, null); // baseCommonService.addLog("手机号已经注册,请直接登录!", CommonConstant.LOG_TYPE_1, null);
return result; // return result;
} // }
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.REGISTER_TEMPLATE_CODE); // b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.REGISTER_TEMPLATE_CODE);
} else { // } else {
//登录模式,校验用户有效性 // //登录模式,校验用户有效性
SysUser sysUser = sysUserService.getUserByPhone(mobile); // SysUser sysUser = sysUserService.getUserByPhone(mobile);
result = sysUserService.checkUserIsEffective(sysUser); // result = sysUserService.checkUserIsEffective(sysUser);
if (!result.isSuccess()) { // if (!result.isSuccess()) {
String message = result.getMessage(); // String message = result.getMessage();
String userNotExist = "该用户不存在,请注册"; // String userNotExist = "该用户不存在,请注册";
if (userNotExist.equals(message)) { // if (userNotExist.equals(message)) {
result.error500("该用户不存在或未绑定手机号"); // result.error500("该用户不存在或未绑定手机号");
} // }
return result; // return result;
} // }
//
/** // /**
* smsmode 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板 // * smsmode 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板
*/ // */
if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) { // if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) {
//登录模板 // //登录模板
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.LOGIN_TEMPLATE_CODE); // b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.LOGIN_TEMPLATE_CODE);
} else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) { // } else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) {
//忘记密码模板 // //忘记密码模板
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE); // b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE);
} // }
} // }
//
if (b == false) { // if (b == false) {
result.setMessage("短信验证码发送失败,请稍后重试"); // result.setMessage("短信验证码发送失败,请稍后重试");
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} // }
//
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906 // //update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//验证码10分钟内有效 // //验证码10分钟内有效
redisUtil.set(redisKey, captcha, 600); // redisUtil.set(redisKey, captcha, 600);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906 // //update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
//
//update-begin--Author:scott Date:20190812 forissues#391 // //update-begin--Author:scott Date:20190812 forissues#391
//result.setResult(captcha); // //result.setResult(captcha);
//update-end--Author:scott Date:20190812 forissues#391 // //update-end--Author:scott Date:20190812 forissues#391
result.setSuccess(true); // result.setSuccess(true);
//
} catch (ClientException e) { //} catch (ClientException e) {
e.printStackTrace(); // e.printStackTrace();
result.error500(" 短信接口未配置,请联系管理员!"); // result.error500(" 短信接口未配置,请联系管理员!");
return result; // return result;
} //}
return result; return result;
} }
@@ -759,46 +759,46 @@ public class LoginController {
@PostMapping(value = "/sendChangePwdSms") @PostMapping(value = "/sendChangePwdSms")
public Result<String> sendSms(@RequestBody JSONObject jsonObject) { public Result<String> sendSms(@RequestBody JSONObject jsonObject) {
Result<String> result = new Result<>(); Result<String> result = new Result<>();
String mobile = jsonObject.get("mobile").toString(); //String mobile = jsonObject.get("mobile").toString();
if (oConvertUtils.isEmpty(mobile)) { //if (oConvertUtils.isEmpty(mobile)) {
result.setMessage("手机号不允许为空!"); // result.setMessage("手机号不允许为空!");
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} //}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); //LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String username = sysUser.getUsername(); //String username = sysUser.getUsername();
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>(); //LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<>();
query.eq(SysUser::getUsername, username).eq(SysUser::getPhone, mobile); //query.eq(SysUser::getUsername, username).eq(SysUser::getPhone, mobile);
SysUser user = sysUserService.getOne(query); //SysUser user = sysUserService.getOne(query);
if (null == user) { //if (null == user) {
return Result.error("当前登录用户和绑定的手机号不匹配,无法修改密码!"); // return Result.error("当前登录用户和绑定的手机号不匹配,无法修改密码!");
} //}
String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE + mobile; //String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE + mobile;
Object object = redisUtil.get(redisKey); //Object object = redisUtil.get(redisKey);
if (object != null) { //if (object != null) {
result.setMessage("验证码10分钟内仍然有效"); // result.setMessage("验证码10分钟内仍然有效");
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} //}
//随机数 ////随机数
String captcha = RandomUtil.randomNumbers(6); //String captcha = RandomUtil.randomNumbers(6);
JSONObject obj = new JSONObject(); //JSONObject obj = new JSONObject();
obj.put("code", captcha); //obj.put("code", captcha);
try { //try {
boolean b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.CHANGE_PASSWORD_TEMPLATE_CODE); // boolean b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.CHANGE_PASSWORD_TEMPLATE_CODE);
if (!b) { // if (!b) {
result.setMessage("短信验证码发送失败,请稍后重试"); // result.setMessage("短信验证码发送失败,请稍后重试");
result.setSuccess(false); // result.setSuccess(false);
return result; // return result;
} // }
//验证码5分钟内有效 // //验证码5分钟内有效
redisUtil.set(redisKey, captcha, 300); // redisUtil.set(redisKey, captcha, 300);
result.setSuccess(true); // result.setSuccess(true);
} catch (ClientException e) { //} catch (ClientException e) {
e.printStackTrace(); // e.printStackTrace();
result.error500(" 短信接口未配置,请联系管理员!"); // result.error500(" 短信接口未配置,请联系管理员!");
return result; // return result;
} //}
return result; return result;
} }

View File

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeecg.dingtalk.api.core.response.Response; //import com.jeecg.dingtalk.api.core.response.Response;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
@@ -29,8 +29,8 @@ import org.jeecg.modules.system.entity.SysAnnouncementSend;
import org.jeecg.modules.system.service.ISysAnnouncementSendService; import org.jeecg.modules.system.service.ISysAnnouncementSendService;
import org.jeecg.modules.system.service.ISysAnnouncementService; import org.jeecg.modules.system.service.ISysAnnouncementService;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl; import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl; //import org.jeecg.modules.system.service.impl.ThirdAppDingtalkServiceImpl;
import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl; //import org.jeecg.modules.system.service.impl.ThirdAppWechatEnterpriseServiceImpl;
import org.jeecg.modules.system.util.XssUtils; import org.jeecg.modules.system.util.XssUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -77,10 +77,10 @@ public class SysAnnouncementController {
private ISysAnnouncementSendService sysAnnouncementSendService; private ISysAnnouncementSendService sysAnnouncementSendService;
@Resource @Resource
private WebSocket webSocket; private WebSocket webSocket;
@Autowired //@Autowired
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService; //ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
@Autowired //@Autowired
ThirdAppDingtalkServiceImpl dingtalkService; //ThirdAppDingtalkServiceImpl dingtalkService;
@Autowired @Autowired
private SysBaseApiImpl sysBaseApi; private SysBaseApiImpl sysBaseApi;
@Autowired @Autowired
@@ -288,14 +288,14 @@ public class SysAnnouncementController {
} }
try { try {
// 同步企业微信、钉钉的消息通知 // 同步企业微信、钉钉的消息通知
Response<String> dtResponse = dingtalkService.sendActionCardMessage(sysAnnouncement, null, true); //Response<String> dtResponse = dingtalkService.sendActionCardMessage(sysAnnouncement, null, true);
wechatEnterpriseService.sendTextCardMessage(sysAnnouncement, true); //wechatEnterpriseService.sendTextCardMessage(sysAnnouncement, true);
//
if (dtResponse != null && dtResponse.isSuccess()) { //if (dtResponse != null && dtResponse.isSuccess()) {
String taskId = dtResponse.getResult(); // String taskId = dtResponse.getResult();
sysAnnouncement.setDtTaskId(taskId); // sysAnnouncement.setDtTaskId(taskId);
sysAnnouncementService.updateById(sysAnnouncement); // sysAnnouncementService.updateById(sysAnnouncement);
} //}
} catch (Exception e) { } catch (Exception e) {
log.error("同步发送第三方APP消息失败", e); log.error("同步发送第三方APP消息失败", e);
} }
@@ -326,7 +326,7 @@ public class SysAnnouncementController {
result.success("该系统通知撤销成功"); result.success("该系统通知撤销成功");
if (oConvertUtils.isNotEmpty(sysAnnouncement.getDtTaskId())) { if (oConvertUtils.isNotEmpty(sysAnnouncement.getDtTaskId())) {
try { try {
dingtalkService.recallMessage(sysAnnouncement.getDtTaskId()); //dingtalkService.recallMessage(sysAnnouncement.getDtTaskId());
} catch (Exception e) { } catch (Exception e) {
log.error("第三方APP撤回消息失败", e); log.error("第三方APP撤回消息失败", e);
} }

View File

@@ -41,9 +41,9 @@ import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler; import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig; import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.message.entity.SysMessageTemplate; import org.jeecg.modules.message.entity.SysMessageTemplate;
import org.jeecg.modules.message.handle.impl.DdSendMsgHandle; //import org.jeecg.modules.message.handle.impl.DdSendMsgHandle;
import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle; //import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle;
import org.jeecg.modules.message.handle.impl.QywxSendMsgHandle; //import org.jeecg.modules.message.handle.impl.QywxSendMsgHandle;
import org.jeecg.modules.message.handle.impl.SystemSendMsgHandle; import org.jeecg.modules.message.handle.impl.SystemSendMsgHandle;
import org.jeecg.modules.message.service.ISysMessageTemplateService; import org.jeecg.modules.message.service.ISysMessageTemplateService;
import org.jeecg.modules.message.websocket.WebSocket; import org.jeecg.modules.message.websocket.WebSocket;
@@ -115,10 +115,10 @@ public class SysBaseApiImpl implements ISysBaseAPI {
private SysPermissionMapper sysPermissionMapper; private SysPermissionMapper sysPermissionMapper;
@Autowired @Autowired
private ISysPermissionDataRuleService sysPermissionDataRuleService; private ISysPermissionDataRuleService sysPermissionDataRuleService;
@Autowired //@Autowired
private ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService; //private ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
@Autowired //@Autowired
private ThirdAppDingtalkServiceImpl dingtalkService; //private ThirdAppDingtalkServiceImpl dingtalkService;
@Autowired @Autowired
ISysCategoryService sysCategoryService; ISysCategoryService sysCategoryService;
@Autowired @Autowired
@@ -425,8 +425,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
message.getCategory()); message.getCategory());
try { try {
// 同步发送第三方APP消息 // 同步发送第三方APP消息
wechatEnterpriseService.sendMessage(message, true); //wechatEnterpriseService.sendMessage(message, true);
dingtalkService.sendMessage(message, true); //dingtalkService.sendMessage(message, true);
} catch (Exception e) { } catch (Exception e) {
log.error("同步发送第三方APP消息失败", e); log.error("同步发送第三方APP消息失败", e);
} }
@@ -443,8 +443,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
message.getBusId()); message.getBusId());
try { try {
// 同步发送第三方APP消息 // 同步发送第三方APP消息
wechatEnterpriseService.sendMessage(message, true); //wechatEnterpriseService.sendMessage(message, true);
dingtalkService.sendMessage(message, true); //dingtalkService.sendMessage(message, true);
} catch (Exception e) { } catch (Exception e) {
log.error("同步发送第三方APP消息失败", e); log.error("同步发送第三方APP消息失败", e);
} }
@@ -516,8 +516,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
} }
try { try {
// 同步企业微信、钉钉的消息通知 // 同步企业微信、钉钉的消息通知
dingtalkService.sendActionCardMessage(announcement, mobileOpenUrl, true); //dingtalkService.sendActionCardMessage(announcement, mobileOpenUrl, true);
wechatEnterpriseService.sendTextCardMessage(announcement, true); //wechatEnterpriseService.sendTextCardMessage(announcement, true);
} catch (Exception e) { } catch (Exception e) {
log.error("同步发送第三方APP消息失败", e); log.error("同步发送第三方APP消息失败", e);
} }
@@ -601,9 +601,9 @@ public class SysBaseApiImpl implements ISysBaseAPI {
} }
try { try {
// 钉钉的消息通知 // 钉钉的消息通知
dingtalkService.sendActionCardMessage(announcement, mobileOpenUrl, true); //dingtalkService.sendActionCardMessage(announcement, mobileOpenUrl, true);
// 企业微信通知 // 企业微信通知
wechatEnterpriseService.sendTextCardMessage(announcement, true); //wechatEnterpriseService.sendTextCardMessage(announcement, true);
} catch (Exception e) { } catch (Exception e) {
log.error("同步发送第三方APP消息失败", e); log.error("同步发送第三方APP消息失败", e);
} }
@@ -1388,8 +1388,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
*/ */
@Override @Override
public void sendEmailMsg(String email, String title, String content) { public void sendEmailMsg(String email, String title, String content) {
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(); //EmailSendMsgHandle emailHandle = new EmailSendMsgHandle();
emailHandle.sendMsg(email, title, content); //emailHandle.sendMsg(email, title, content);
} }
/** /**
@@ -1402,31 +1402,31 @@ public class SysBaseApiImpl implements ISysBaseAPI {
*/ */
@Override @Override
public void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params) { public void sendHtmlTemplateEmail(String email, String title, EmailTemplateEnum emailTemplateEnum, JSONObject params) {
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle(); //EmailSendMsgHandle emailHandle = new EmailSendMsgHandle();
String htmlText = ""; //String htmlText = "";
try { //try {
//获取模板实例 // //获取模板实例
Configuration configuration = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS); // Configuration configuration = new Configuration(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS);
//设置模板文件的目录 // //设置模板文件的目录
String url = emailTemplateEnum.getUrl(); // String url = emailTemplateEnum.getUrl();
configuration.setClassForTemplateLoading(this.getClass(), url.substring(0, url.lastIndexOf("/"))); // configuration.setClassForTemplateLoading(this.getClass(), url.substring(0, url.lastIndexOf("/")));
configuration.setDefaultEncoding("UTF-8"); // configuration.setDefaultEncoding("UTF-8");
//空值报错设置 // //空值报错设置
configuration.setClassicCompatible(true); // configuration.setClassicCompatible(true);
configuration.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER); // configuration.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
Template template = configuration.getTemplate(url.substring(url.lastIndexOf("/"))); // Template template = configuration.getTemplate(url.substring(url.lastIndexOf("/")));
//解析模板文件 // //解析模板文件
htmlText = FreeMarkerTemplateUtils.processTemplateIntoString(template, params); // htmlText = FreeMarkerTemplateUtils.processTemplateIntoString(template, params);
} catch (IOException e) { //} catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} catch (TemplateException e) { //} catch (TemplateException e) {
e.printStackTrace(); // e.printStackTrace();
} catch (Exception e) { //} catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} //}
//
log.info("Email Html Text{}", htmlText); //log.info("Email Html Text{}", htmlText);
emailHandle.sendMsg(email, title, htmlText); //emailHandle.sendMsg(email, title, htmlText);
} }
/** /**
@@ -1570,17 +1570,17 @@ public class SysBaseApiImpl implements ISysBaseAPI {
//update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------ //update-end---author:chenrui ---date:20231221 for[issues/#5643]解决分布式下表字典跨库无法查询问题------------
//-------------------------------------流程节点发送模板消息----------------------------------------------- //-------------------------------------流程节点发送模板消息-----------------------------------------------
@Autowired //@Autowired
private QywxSendMsgHandle qywxSendMsgHandle; //private QywxSendMsgHandle qywxSendMsgHandle;
@Autowired @Autowired
private SystemSendMsgHandle systemSendMsgHandle; private SystemSendMsgHandle systemSendMsgHandle;
@Autowired //@Autowired
private EmailSendMsgHandle emailSendMsgHandle; //private EmailSendMsgHandle emailSendMsgHandle;
@Autowired //@Autowired
private DdSendMsgHandle ddSendMsgHandle; //private DdSendMsgHandle ddSendMsgHandle;
@Override @Override
public void sendTemplateMessage(MessageDTO message) { public void sendTemplateMessage(MessageDTO message) {
@@ -1615,11 +1615,11 @@ public class SysBaseApiImpl implements ISysBaseAPI {
// 邮件消息要解析Markdown // 邮件消息要解析Markdown
message.setContent(HTMLUtils.parseMarkdown(message.getContent())); message.setContent(HTMLUtils.parseMarkdown(message.getContent()));
} }
emailSendMsgHandle.sendMessage(message); //emailSendMsgHandle.sendMessage(message);
} else if (MessageTypeEnum.DD.getType().equals(messageType)) { } else if (MessageTypeEnum.DD.getType().equals(messageType)) {
ddSendMsgHandle.sendMessage(message); //ddSendMsgHandle.sendMessage(message);
} else if (MessageTypeEnum.QYWX.getType().equals(messageType)) { } else if (MessageTypeEnum.QYWX.getType().equals(messageType)) {
qywxSendMsgHandle.sendMessage(message); //qywxSendMsgHandle.sendMessage(message);
} }
} }

View File

@@ -2,10 +2,10 @@ package org.jeecg.modules.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeecg.dingtalk.api.base.JdtBaseAPI; //import com.jeecg.dingtalk.api.base.JdtBaseAPI;
import com.jeecg.dingtalk.api.core.response.Response; //import com.jeecg.dingtalk.api.core.response.Response;
import com.jeecg.dingtalk.api.core.vo.AccessToken; //import com.jeecg.dingtalk.api.core.vo.AccessToken;
import com.jeecg.dingtalk.api.user.JdtUserAPI; //import com.jeecg.dingtalk.api.user.JdtUserAPI;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
@@ -169,13 +169,13 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe
//update-begin---author:wangshuai ---date:20230306 for判断如果是钉钉的情况下需要将第三方的用户id查询出来发送模板的时候有用------------ //update-begin---author:wangshuai ---date:20230306 for判断如果是钉钉的情况下需要将第三方的用户id查询出来发送模板的时候有用------------
//=============begin 判断如果是钉钉的情况下需要将第三方的用户id查询出来发送模板的时候有用========== //=============begin 判断如果是钉钉的情况下需要将第三方的用户id查询出来发送模板的时候有用==========
if (CommonConstant.DINGTALK.toLowerCase().equals(tlm.getSource())) { if (CommonConstant.DINGTALK.toLowerCase().equals(tlm.getSource())) {
AccessToken accessToken = JdtBaseAPI.getAccessToken(dingTalkClientId, dingTalkClientSecret); //AccessToken accessToken = JdtBaseAPI.getAccessToken(dingTalkClientId, dingTalkClientSecret);
Response<String> getUserIdRes = JdtUserAPI.getUseridByUnionid(tlm.getUuid(), accessToken.getAccessToken()); //Response<String> getUserIdRes = JdtUserAPI.getUseridByUnionid(tlm.getUuid(), accessToken.getAccessToken());
if (getUserIdRes.isSuccess()) { //if (getUserIdRes.isSuccess()) {
user.setThirdUserId(getUserIdRes.getResult()); // user.setThirdUserId(getUserIdRes.getResult());
} else { //} else {
user.setThirdUserId(tlm.getUuid()); // user.setThirdUserId(tlm.getUuid());
} //}
//=============end 判断如果是钉钉的情况下需要将第三方的用户id查询出来发送模板的时候有用========== //=============end 判断如果是钉钉的情况下需要将第三方的用户id查询出来发送模板的时候有用==========
} else { } else {
user.setThirdUserId(tlm.getUuid()); user.setThirdUserId(tlm.getUuid());

View File

@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException; //import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -102,10 +102,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private BaseCommonService baseCommonService; private BaseCommonService baseCommonService;
@Autowired @Autowired
private SysThirdAccountMapper sysThirdAccountMapper; private SysThirdAccountMapper sysThirdAccountMapper;
@Autowired //@Autowired
ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService; //ThirdAppWechatEnterpriseServiceImpl wechatEnterpriseService;
@Autowired //@Autowired
ThirdAppDingtalkServiceImpl dingtalkService; //ThirdAppDingtalkServiceImpl dingtalkService;
@Autowired @Autowired
ISysRoleIndexService sysRoleIndexService; ISysRoleIndexService sysRoleIndexService;
@Autowired @Autowired
@@ -710,8 +710,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
line += sysUserRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId, userIds)); line += sysUserRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getUserId, userIds));
//4.同步删除第三方App的用户 //4.同步删除第三方App的用户
try { try {
dingtalkService.removeThirdAppUser(userIds); //dingtalkService.removeThirdAppUser(userIds);
wechatEnterpriseService.removeThirdAppUser(userIds); //wechatEnterpriseService.removeThirdAppUser(userIds);
} catch (Exception e) { } catch (Exception e) {
log.error("同步删除第三方App的用户失败", e); log.error("同步删除第三方App的用户失败", e);
} }
@@ -2010,33 +2010,33 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @param phone * @param phone
*/ */
private void sendPhoneSms(String phone, String clientIp) { private void sendPhoneSms(String phone, String clientIp) {
String redisKey = CommonConstant.CHANGE_PHONE_REDIS_KEY_PRE + phone; //String redisKey = CommonConstant.CHANGE_PHONE_REDIS_KEY_PRE + phone;
Object object = redisUtil.get(redisKey); //Object object = redisUtil.get(redisKey);
//
if (object != null) { //if (object != null) {
throw new JeecgBootException("验证码10分钟内仍然有效"); // throw new JeecgBootException("验证码10分钟内仍然有效");
} //}
//
//增加 check防止恶意刷短信接口 ////增加 check防止恶意刷短信接口
if (!DySmsLimit.canSendSms(clientIp)) { //if (!DySmsLimit.canSendSms(clientIp)) {
log.warn("--------[警告] IP地址:{}, 短信接口请求太多-------", clientIp); // log.warn("--------[警告] IP地址:{}, 短信接口请求太多-------", clientIp);
throw new JeecgBootException("短信接口请求太多,请稍后再试!", CommonConstant.PHONE_SMS_FAIL_CODE); // throw new JeecgBootException("短信接口请求太多,请稍后再试!", CommonConstant.PHONE_SMS_FAIL_CODE);
} //}
//
//随机数 ////随机数
String captcha = RandomUtil.randomNumbers(6); //String captcha = RandomUtil.randomNumbers(6);
JSONObject obj = new JSONObject(); //JSONObject obj = new JSONObject();
obj.put("code", captcha); //obj.put("code", captcha);
try { //try {
boolean sendSmsSuccess = DySmsHelper.sendSms(phone, obj, DySmsEnum.LOGIN_TEMPLATE_CODE); // boolean sendSmsSuccess = DySmsHelper.sendSms(phone, obj, DySmsEnum.LOGIN_TEMPLATE_CODE);
if (!sendSmsSuccess) { // if (!sendSmsSuccess) {
throw new JeecgBootException("短信验证码发送失败,请稍后重试!"); // throw new JeecgBootException("短信验证码发送失败,请稍后重试!");
} // }
//验证码10分钟内有效 // //验证码10分钟内有效
redisUtil.set(redisKey, captcha, 600); // redisUtil.set(redisKey, captcha, 600);
} catch (ClientException e) { //} catch (ClientException e) {
log.error(e.getMessage(), e); // log.error(e.getMessage(), e);
throw new JeecgBootException("短信接口未配置,请联系管理员!"); // throw new JeecgBootException("短信接口未配置,请联系管理员!");
} //}
} }
} }

View File

@@ -1,89 +1,89 @@
package org.jeecg.modules.system.vo.thirdapp; //package org.jeecg.modules.system.vo.thirdapp;
//
import com.jeecg.dingtalk.api.department.vo.Department; //import com.jeecg.dingtalk.api.department.vo.Department;
import org.springframework.beans.BeanUtils; //import org.springframework.beans.BeanUtils;
//
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.List; //import java.util.List;
import java.util.Optional; //import java.util.Optional;
//
/** ///**
* 钉钉树结构的部门 // * 钉钉树结构的部门
* // *
* @author sunjianlei // * @author sunjianlei
*/ // */
public class JdtDepartmentTreeVo extends Department { //public class JdtDepartmentTreeVo extends Department {
//
private List<JdtDepartmentTreeVo> children; // private List<JdtDepartmentTreeVo> children;
//
public List<JdtDepartmentTreeVo> getChildren() { // public List<JdtDepartmentTreeVo> getChildren() {
return children; // return children;
} // }
//
public JdtDepartmentTreeVo setChildren(List<JdtDepartmentTreeVo> children) { // public JdtDepartmentTreeVo setChildren(List<JdtDepartmentTreeVo> children) {
this.children = children; // this.children = children;
return this; // return this;
} // }
//
public JdtDepartmentTreeVo(Department department) { // public JdtDepartmentTreeVo(Department department) {
BeanUtils.copyProperties(department, this); // BeanUtils.copyProperties(department, this);
} // }
//
/** // /**
* 是否有子项 // * 是否有子项
*/ // */
public boolean hasChildren() { // public boolean hasChildren() {
return children != null && children.size() > 0; // return children != null && children.size() > 0;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return "JwDepartmentTree{" + // return "JwDepartmentTree{" +
"children=" + children + // "children=" + children +
"} " + super.toString(); // "} " + super.toString();
} // }
//
/** // /**
* 静态辅助方法将list转为tree结构 // * 静态辅助方法将list转为tree结构
*/ // */
public static List<JdtDepartmentTreeVo> listToTree(List<Department> allDepartment) { // public static List<JdtDepartmentTreeVo> listToTree(List<Department> allDepartment) {
// 先找出所有的父级 // // 先找出所有的父级
List<JdtDepartmentTreeVo> treeList = getByParentId(1, allDepartment); // List<JdtDepartmentTreeVo> treeList = getByParentId(1, allDepartment);
Optional<Department> departmentOptional = allDepartment.stream().filter(item -> item.getParent_id() == null).findAny(); // Optional<Department> departmentOptional = allDepartment.stream().filter(item -> item.getParent_id() == null).findAny();
Department department = new Department(); // Department department = new Department();
//判断是否找到数据 // //判断是否找到数据
if (departmentOptional.isPresent()) { // if (departmentOptional.isPresent()) {
department = departmentOptional.get(); // department = departmentOptional.get();
} // }
getChildrenRecursion(treeList, allDepartment); // getChildrenRecursion(treeList, allDepartment);
//update-begin---author:wangshuai---date:2024-04-10---for:【issues/6017】钉钉同步部门时没有最顶层的部门名同步用户时用户没有部门信息--- // //update-begin---author:wangshuai---date:2024-04-10---for:【issues/6017】钉钉同步部门时没有最顶层的部门名同步用户时用户没有部门信息---
JdtDepartmentTreeVo treeVo = new JdtDepartmentTreeVo(department); // JdtDepartmentTreeVo treeVo = new JdtDepartmentTreeVo(department);
treeVo.setChildren(treeList); // treeVo.setChildren(treeList);
List<JdtDepartmentTreeVo> list = new ArrayList<>(); // List<JdtDepartmentTreeVo> list = new ArrayList<>();
list.add(treeVo); // list.add(treeVo);
return list; // return list;
//update-end---author:wangshuai---date:2024-04-10---for:【issues/6017】钉钉同步部门时没有最顶层的部门名同步用户时用户没有部门信息--- // //update-end---author:wangshuai---date:2024-04-10---for:【issues/6017】钉钉同步部门时没有最顶层的部门名同步用户时用户没有部门信息---
} // }
//
private static List<JdtDepartmentTreeVo> getByParentId(Integer parentId, List<Department> allDepartment) { // private static List<JdtDepartmentTreeVo> getByParentId(Integer parentId, List<Department> allDepartment) {
List<JdtDepartmentTreeVo> list = new ArrayList<>(); // List<JdtDepartmentTreeVo> list = new ArrayList<>();
for (Department department : allDepartment) { // for (Department department : allDepartment) {
if (parentId.equals(department.getParent_id())) { // if (parentId.equals(department.getParent_id())) {
list.add(new JdtDepartmentTreeVo(department)); // list.add(new JdtDepartmentTreeVo(department));
} // }
} // }
return list; // return list;
} // }
//
private static void getChildrenRecursion(List<JdtDepartmentTreeVo> treeList, List<Department> allDepartment) { // private static void getChildrenRecursion(List<JdtDepartmentTreeVo> treeList, List<Department> allDepartment) {
for (JdtDepartmentTreeVo departmentTree : treeList) { // for (JdtDepartmentTreeVo departmentTree : treeList) {
// 递归寻找子级 // // 递归寻找子级
List<JdtDepartmentTreeVo> children = getByParentId(departmentTree.getDept_id(), allDepartment); // List<JdtDepartmentTreeVo> children = getByParentId(departmentTree.getDept_id(), allDepartment);
if (children.size() > 0) { // if (children.size() > 0) {
departmentTree.setChildren(children); // departmentTree.setChildren(children);
getChildrenRecursion(children, allDepartment); // getChildrenRecursion(children, allDepartment);
} // }
} // }
} // }
//
} //}

View File

@@ -1,89 +1,89 @@
package org.jeecg.modules.system.vo.thirdapp; //package org.jeecg.modules.system.vo.thirdapp;
//
import com.jeecg.qywx.api.department.vo.Department; //import com.jeecg.qywx.api.department.vo.Department;
import org.springframework.beans.BeanUtils; //import org.springframework.beans.BeanUtils;
//
import java.util.ArrayList; //import java.util.ArrayList;
import java.util.List; //import java.util.List;
import java.util.Optional; //import java.util.Optional;
//
/** ///**
* 企业微信树结构的部门 // * 企业微信树结构的部门
* // *
* @author sunjianlei // * @author sunjianlei
*/ // */
public class JwDepartmentTreeVo extends Department { //public class JwDepartmentTreeVo extends Department {
//
private List<JwDepartmentTreeVo> children; // private List<JwDepartmentTreeVo> children;
//
public List<JwDepartmentTreeVo> getChildren() { // public List<JwDepartmentTreeVo> getChildren() {
return children; // return children;
} // }
//
public JwDepartmentTreeVo setChildren(List<JwDepartmentTreeVo> children) { // public JwDepartmentTreeVo setChildren(List<JwDepartmentTreeVo> children) {
this.children = children; // this.children = children;
return this; // return this;
} // }
//
public JwDepartmentTreeVo(Department department) { // public JwDepartmentTreeVo(Department department) {
BeanUtils.copyProperties(department, this); // BeanUtils.copyProperties(department, this);
} // }
//
/** // /**
* 是否有子项 // * 是否有子项
*/ // */
public boolean hasChildren() { // public boolean hasChildren() {
return children != null && children.size() > 0; // return children != null && children.size() > 0;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return "JwDepartmentTree{" + // return "JwDepartmentTree{" +
"children=" + children + // "children=" + children +
"} " + super.toString(); // "} " + super.toString();
} // }
//
/** // /**
* 静态辅助方法将list转为tree结构 // * 静态辅助方法将list转为tree结构
*/ // */
public static List<JwDepartmentTreeVo> listToTree(List<Department> allDepartment) { // public static List<JwDepartmentTreeVo> listToTree(List<Department> allDepartment) {
// 先找出所有的父级 // // 先找出所有的父级
List<JwDepartmentTreeVo> treeList = getByParentId("1", allDepartment); // List<JwDepartmentTreeVo> treeList = getByParentId("1", allDepartment);
Optional<Department> departmentOptional = allDepartment.stream().filter(item -> "0".equals(item.getParentid())).findAny(); // Optional<Department> departmentOptional = allDepartment.stream().filter(item -> "0".equals(item.getParentid())).findAny();
Department department = new Department(); // Department department = new Department();
//判断是否找到数据 // //判断是否找到数据
if (departmentOptional.isPresent()) { // if (departmentOptional.isPresent()) {
department = departmentOptional.get(); // department = departmentOptional.get();
} // }
getChildrenRecursion(treeList, allDepartment); // getChildrenRecursion(treeList, allDepartment);
//update-begin---author:wangshuai---date:2024-04-10---for:【issues/6017】企业微信同步部门时没有最顶层的部门名同步用户时用户没有部门信息--- // //update-begin---author:wangshuai---date:2024-04-10---for:【issues/6017】企业微信同步部门时没有最顶层的部门名同步用户时用户没有部门信息---
JwDepartmentTreeVo treeVo = new JwDepartmentTreeVo(department); // JwDepartmentTreeVo treeVo = new JwDepartmentTreeVo(department);
treeVo.setChildren(treeList); // treeVo.setChildren(treeList);
List<JwDepartmentTreeVo> list = new ArrayList<>(); // List<JwDepartmentTreeVo> list = new ArrayList<>();
list.add(treeVo); // list.add(treeVo);
return list; // return list;
//update-begin---author:wangshuai---date:2024-04-10---for:【issues/6017】企业微信部门时没有最顶层的部门名同步用户时用户没有部门信息--- // //update-begin---author:wangshuai---date:2024-04-10---for:【issues/6017】企业微信部门时没有最顶层的部门名同步用户时用户没有部门信息---
} // }
//
private static List<JwDepartmentTreeVo> getByParentId(String parentId, List<Department> allDepartment) { // private static List<JwDepartmentTreeVo> getByParentId(String parentId, List<Department> allDepartment) {
List<JwDepartmentTreeVo> list = new ArrayList<>(); // List<JwDepartmentTreeVo> list = new ArrayList<>();
for (Department department : allDepartment) { // for (Department department : allDepartment) {
if (parentId.equals(department.getParentid())) { // if (parentId.equals(department.getParentid())) {
list.add(new JwDepartmentTreeVo(department)); // list.add(new JwDepartmentTreeVo(department));
} // }
} // }
return list; // return list;
} // }
//
private static void getChildrenRecursion(List<JwDepartmentTreeVo> treeList, List<Department> allDepartment) { // private static void getChildrenRecursion(List<JwDepartmentTreeVo> treeList, List<Department> allDepartment) {
for (JwDepartmentTreeVo departmentTree : treeList) { // for (JwDepartmentTreeVo departmentTree : treeList) {
// 递归寻找子级 // // 递归寻找子级
List<JwDepartmentTreeVo> children = getByParentId(departmentTree.getId(), allDepartment); // List<JwDepartmentTreeVo> children = getByParentId(departmentTree.getId(), allDepartment);
if (children.size() > 0) { // if (children.size() > 0) {
departmentTree.setChildren(children); // departmentTree.setChildren(children);
getChildrenRecursion(children, allDepartment); // getChildrenRecursion(children, allDepartment);
} // }
} // }
} // }
//
} //}

236
pom.xml
View File

@@ -215,17 +215,17 @@
<version>${jeecgboot.version}</version> <version>${jeecgboot.version}</version>
</dependency> </dependency>
<!--rabbitmq消息队列--> <!--rabbitmq消息队列-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot</groupId> <!-- <groupId>org.jeecgframework.boot</groupId>-->
<artifactId>physical-boot-starter3-rabbitmq</artifactId> <!-- <artifactId>physical-boot-starter3-rabbitmq</artifactId>-->
<version>${jeecgboot.version}</version> <!-- <version>${jeecgboot.version}</version>-->
</dependency> <!-- </dependency>-->
<!--rocketmq--> <!-- &lt;!&ndash;rocketmq&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot</groupId> <!-- <groupId>org.jeecgframework.boot</groupId>-->
<artifactId>physical-boot-starter3-rocketmq</artifactId> <!-- <artifactId>physical-boot-starter3-rocketmq</artifactId>-->
<version>${jeecgboot.version}</version> <!-- <version>${jeecgboot.version}</version>-->
</dependency> <!-- </dependency>-->
<!--分库分表shardingsphere--> <!--分库分表shardingsphere-->
<dependency> <dependency>
<groupId>org.jeecgframework.boot</groupId> <groupId>org.jeecgframework.boot</groupId>
@@ -243,11 +243,11 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot3</groupId> <!-- <groupId>org.jeecgframework.boot3</groupId>-->
<artifactId>hibernate-re</artifactId> <!-- <artifactId>hibernate-re</artifactId>-->
<version>3.7.0</version> <!-- <version>3.7.0</version>-->
</dependency> <!-- </dependency>-->
<!-- update-begin-author:chenrui -date:20240104 for[issue/5723]指定jaxb-runtime版本 --> <!-- update-begin-author:chenrui -date:20240104 for[issue/5723]指定jaxb-runtime版本 -->
<dependency> <dependency>
<groupId>org.glassfish.jaxb</groupId> <groupId>org.glassfish.jaxb</groupId>
@@ -256,42 +256,42 @@
</dependency> </dependency>
<!-- update-end-author:chenrui -date:20240104 for[issue/5723]指定jaxb-runtime版本 --> <!-- update-end-author:chenrui -date:20240104 for[issue/5723]指定jaxb-runtime版本 -->
<!--mongon db--> <!-- &lt;!&ndash;mongon db&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.boot</groupId> <!-- <groupId>org.jeecgframework.boot</groupId>-->
<artifactId>physical-boot-starter3-mongon</artifactId> <!-- <artifactId>physical-boot-starter3-mongon</artifactId>-->
<version>${jeecgboot.version}</version> <!-- <version>${jeecgboot.version}</version>-->
</dependency> <!-- </dependency>-->
<!--人大金仓驱动 版本号V008R006C005B0013 --> <!-- &lt;!&ndash;人大金仓驱动 版本号V008R006C005B0013 &ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework</groupId> <!-- <groupId>org.jeecgframework</groupId>-->
<artifactId>kingbase8</artifactId> <!-- <artifactId>kingbase8</artifactId>-->
<version>9.0.0</version> <!-- <version>9.0.0</version>-->
<scope>runtime</scope> <!-- <scope>runtime</scope>-->
</dependency> <!-- </dependency>-->
<!--达梦8数据库最新驱动 版本号1-3-26-2023.07.26-197096-20046-ENT --> <!-- &lt;!&ndash;达梦8数据库最新驱动 版本号1-3-26-2023.07.26-197096-20046-ENT &ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>com.dameng</groupId> <!-- <groupId>com.dameng</groupId>-->
<artifactId>Dm8JdbcDriver18</artifactId> <!-- <artifactId>Dm8JdbcDriver18</artifactId>-->
<version>8.1.1.49</version> <!-- <version>8.1.1.49</version>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.dameng</groupId> <!-- <groupId>com.dameng</groupId>-->
<artifactId>DmDialect-for-hibernate5.0</artifactId> <!-- <artifactId>DmDialect-for-hibernate5.0</artifactId>-->
<version>8.1.1.49</version> <!-- <version>8.1.1.49</version>-->
</dependency> <!-- </dependency>-->
<!-- 七牛云SDK --> <!-- 七牛云SDK -->
<dependency> <!-- <dependency>-->
<groupId>com.qiniu</groupId> <!-- <groupId>com.qiniu</groupId>-->
<artifactId>qiniu-java-sdk</artifactId> <!-- <artifactId>qiniu-java-sdk</artifactId>-->
<version>${qiniu-java-sdk.version}</version> <!-- <version>${qiniu-java-sdk.version}</version>-->
<exclusions> <!-- <exclusions>-->
<exclusion> <!-- <exclusion>-->
<artifactId>okhttp</artifactId> <!-- <artifactId>okhttp</artifactId>-->
<groupId>com.squareup.okhttp3</groupId> <!-- <groupId>com.squareup.okhttp3</groupId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> <!-- </exclusions>-->
</dependency> <!-- </dependency>-->
<!-- dom4j --> <!-- dom4j -->
<dependency> <dependency>
<groupId>dom4j</groupId> <groupId>dom4j</groupId>
@@ -312,21 +312,21 @@
</dependency> </dependency>
<!-- justauth第三方登录 --> <!-- justauth第三方登录 -->
<dependency> <!-- <dependency>-->
<groupId>com.xkcoding.justauth</groupId> <!-- <groupId>com.xkcoding.justauth</groupId>-->
<artifactId>justauth-spring-boot-starter</artifactId> <!-- <artifactId>justauth-spring-boot-starter</artifactId>-->
<version>${justauth-spring-boot-starter.version}</version> <!-- <version>${justauth-spring-boot-starter.version}</version>-->
<exclusions> <!-- <exclusions>-->
<exclusion> <!-- <exclusion>-->
<artifactId>hutool-core</artifactId> <!-- <artifactId>hutool-core</artifactId>-->
<groupId>cn.hutool</groupId> <!-- <groupId>cn.hutool</groupId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<artifactId>fastjson</artifactId> <!-- <artifactId>fastjson</artifactId>-->
<groupId>com.alibaba</groupId> <!-- <groupId>com.alibaba</groupId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> <!-- </exclusions>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
@@ -365,62 +365,62 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- 企业微信和钉钉 api --> <!-- 企业微信和钉钉 api -->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework</groupId> <!-- <groupId>org.jeecgframework</groupId>-->
<artifactId>jeewx-api</artifactId> <!-- <artifactId>jeewx-api</artifactId>-->
<version>1.5.2</version> <!-- <version>1.5.2</version>-->
<exclusions> <!-- <exclusions>-->
<exclusion> <!-- <exclusion>-->
<artifactId>commons-beanutils</artifactId> <!-- <artifactId>commons-beanutils</artifactId>-->
<groupId>commons-beanutils</groupId> <!-- <groupId>commons-beanutils</groupId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<artifactId>commons-lang</artifactId> <!-- <artifactId>commons-lang</artifactId>-->
<groupId>commons-lang</groupId> <!-- <groupId>commons-lang</groupId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<artifactId>commons-collections</artifactId> <!-- <artifactId>commons-collections</artifactId>-->
<groupId>commons-collections</groupId> <!-- <groupId>commons-collections</groupId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<artifactId>commons-logging</artifactId> <!-- <artifactId>commons-logging</artifactId>-->
<groupId>commons-logging</groupId> <!-- <groupId>commons-logging</groupId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<artifactId>commons-io</artifactId> <!-- <artifactId>commons-io</artifactId>-->
<groupId>commons-io</groupId> <!-- <groupId>commons-io</groupId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> <!-- </exclusions>-->
</dependency> <!-- </dependency>-->
<!-- 积木报表--> <!-- 积木报表-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.jimureport</groupId> <!-- <groupId>org.jeecgframework.jimureport</groupId>-->
<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> <!-- <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>-->
<version>${jimureport-spring-boot-starter.version}</version> <!-- <version>${jimureport-spring-boot-starter.version}</version>-->
<exclusions> <!-- <exclusions>-->
<exclusion> <!-- <exclusion>-->
<artifactId>autopoi-web</artifactId> <!-- <artifactId>autopoi-web</artifactId>-->
<groupId>org.jeecgframework</groupId> <!-- <groupId>org.jeecgframework</groupId>-->
</exclusion> <!-- </exclusion>-->
<exclusion> <!-- <exclusion>-->
<artifactId>druid</artifactId> <!-- <artifactId>druid</artifactId>-->
<groupId>com.alibaba</groupId> <!-- <groupId>com.alibaba</groupId>-->
</exclusion> <!-- </exclusion>-->
</exclusions> <!-- </exclusions>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>org.jeecgframework.jimureport</groupId> <!-- <groupId>org.jeecgframework.jimureport</groupId>-->
<artifactId>jimureport-nosql-starter</artifactId> <!-- <artifactId>jimureport-nosql-starter</artifactId>-->
<version>1.6.0</version> <!-- <version>1.6.0</version>-->
</dependency> <!-- </dependency>-->
<!--flyway 支持 mysql5.7+、MariaDB10.3.16--> <!--flyway 支持 mysql5.7+、MariaDB10.3.16-->
<!--mysql5.6需要把版本号改成5.2.1--> <!--mysql5.6需要把版本号改成5.2.1-->
<dependency> <!-- <dependency>-->
<groupId>org.flywaydb</groupId> <!-- <groupId>org.flywaydb</groupId>-->
<artifactId>flyway-core</artifactId> <!-- <artifactId>flyway-core</artifactId>-->
<version>7.15.0</version> <!-- <version>7.15.0</version>-->
</dependency> <!-- </dependency>-->
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>