v3.8.2 版本后端代码

This commit is contained in:
JEECG 2025-07-30 18:25:46 +08:00
parent c44b66128e
commit e6edde963a
60 changed files with 1701 additions and 324 deletions

File diff suppressed because one or more lines are too long

View File

@ -91,6 +91,12 @@ public class MessageDTO implements Serializable {
private Boolean isTimeJob = false;
//---邮件相关参数-------------------------------------------------------------
/**
* 枚举org.jeecg.common.constant.enums.NoticeTypeEnum
* 通知类型(system:系统消息file:知识库flow:流程plan:日程计划meeting:会议)
*/
private String noticeType;
public MessageDTO(){
}

View File

@ -303,6 +303,11 @@ public interface CommonConstant {
*/
String SYS_USER_ID_MAPPING_CACHE = "sys:cache:user:id_mapping";
/**
* 系统角色管理员编码
*/
String SYS_ROLE_ADMIN = "admin";
/**
* 考勤补卡业务状态 1同意 2不同意
*/
@ -428,6 +433,11 @@ public interface CommonConstant {
*/
String NOTICE_MSG_BUS_TYPE = "NOTICE_MSG_BUS_TYPE";
/**
* 通知类型用于区分来源 file 知识 flow 流程 plan 日程 system 系统消息
*/
String NOTICE_TYPE = "noticeType";
/**
* 邮箱消息中地址登录时地址后携带的token,需要替换成真实的token值
*/
@ -629,4 +639,24 @@ public interface CommonConstant {
* 修改手机号验证码请求次数超出
*/
Integer PHONE_SMS_FAIL_CODE = 40002;
/**
* 自定义首页关联关系(ROLE:表示角色 USER:表示用户)
*
*/
String HOME_RELATION_ROLE = "ROLE";
String HOME_RELATION_USER = "USER";
/**
* 是否置顶(0否 1是)
*/
Integer IZ_TOP_1 = 1;
Integer IZ_TOP_0 = 0;
//关注流程缓存前缀
String FLOW_FOCUS_NOTICE_PREFIX = "flow:runtimeData:focus:notice:";
//任务缓办时间缓存前缀
String FLOW_TASK_DELAY_PREFIX = "flow:runtimeData:task:delay:";
}

View File

@ -4,6 +4,20 @@ package org.jeecg.common.constant;
* @author: jeecg-boot
*/
public interface DataBaseConstant {
/**
* 内置的系统变量键列表
*/
public static final String[] SYSTEM_KEYS = {
DataBaseConstant.SYS_ORG_CODE, DataBaseConstant.SYS_ORG_CODE_TABLE, DataBaseConstant.SYS_MULTI_ORG_CODE,
DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE, DataBaseConstant.SYS_ORG_ID, DataBaseConstant.SYS_ORG_ID_TABLE,
DataBaseConstant.SYS_ROLE_CODE, DataBaseConstant.SYS_ROLE_CODE_TABLE, DataBaseConstant.SYS_USER_CODE,
DataBaseConstant.SYS_USER_CODE_TABLE, DataBaseConstant.SYS_USER_ID, DataBaseConstant.SYS_USER_ID_TABLE,
DataBaseConstant.SYS_USER_NAME, DataBaseConstant.SYS_USER_NAME_TABLE, DataBaseConstant.SYS_DATE,
DataBaseConstant.SYS_DATE_TABLE, DataBaseConstant.SYS_TIME, DataBaseConstant.SYS_TIME_TABLE,
DataBaseConstant.SYS_BASE_PATH
};
//*********数据库类型****************************************
/**MYSQL数据库*/

View File

@ -13,6 +13,10 @@ public enum EmailTemplateEnum {
* 流程催办
*/
BPM_CUIBAN_EMAIL("bpm_cuiban_email", "/templates/email/bpm_cuiban_email.ftl"),
/**
* 流程抄送
*/
BPM_CC_EMAIL("bpm_cc_email", "/templates/email/bpm_cc_email.ftl"),
/**
* 流程新任务
*/

View File

@ -0,0 +1,75 @@
package org.jeecg.common.constant.enums;
/**
* @Description: 文件类型枚举类
*
* @author: wangshuai
* @date: 2025/6/26 17:29
*/
public enum NoticeTypeEnum {
//VUE3专用
NOTICE_TYPE_FILE("知识库消息","file"),
NOTICE_TYPE_FLOW("工作流消息","flow"),
NOTICE_TYPE_PLAN("日程消息","plan"),
//暂时没用到
NOTICE_TYPE_MEETING("会议消息","meeting"),
NOTICE_TYPE_SYSTEM("系统消息","system");
/**
* 文件类型名称
*/
private String name;
/**
* 文件类型值
*/
private String value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
NoticeTypeEnum(String name, String value) {
this.name = name;
this.value = value;
}
/**
* 获取聊天通知类型
*
* @param value
* @return
*/
public static String getChatNoticeType(String value){
return value + "Notice";
}
/**
* 获取通知名称
*
* @param value
* @return
*/
public static String getNoticeNameByValue(String value){
value = value.replace("Notice","");
for (NoticeTypeEnum e : NoticeTypeEnum.values()) {
if (e.getValue().equals(value)) {
return e.getName();
}
}
return "系统消息";
}
}

View File

@ -68,6 +68,12 @@ public class LoginUser {
@SensitiveField
private String avatar;
/**
* 工号
*/
@SensitiveField
private String workNo;
/**
* 生日
*/

View File

@ -34,6 +34,7 @@ public class SsrfFileTypeFilter {
FILE_TYPE_WHITE_LIST.add("bmp");
FILE_TYPE_WHITE_LIST.add("svg");
FILE_TYPE_WHITE_LIST.add("ico");
FILE_TYPE_WHITE_LIST.add("heic");
//文本文件
FILE_TYPE_WHITE_LIST.add("txt");

View File

@ -70,7 +70,12 @@ public class JeecgBaseConfig {
/**
* 百度开放API配置
*/
private BaiduApi baiduApi;
private BaiduApi baiduApi;
/**
* 高德开放API配置
*/
private GaoDeApi gaoDeApi;
public String getCustomResourcePrefixPath() {
return customResourcePrefixPath;
@ -168,4 +173,11 @@ public class JeecgBaseConfig {
this.baiduApi = baiduApi;
}
public GaoDeApi getGaoDeApi() {
return gaoDeApi;
}
public void setGaoDeApi(GaoDeApi gaoDeApi) {
this.gaoDeApi = gaoDeApi;
}
}

View File

@ -68,17 +68,15 @@ public class Swagger3Config implements WebMvcConfigurer {
openApi.getPaths().forEach((path, pathItem) -> {
//log.debug("path: {}", path);
// 检查当前路径是否在排除列表中
boolean isExcluded = excludedPaths.stream().anyMatch(excludedPath ->
excludedPath.equals(path) ||
(excludedPath.endsWith("**") && path.startsWith(excludedPath.substring(0, excludedPath.length() - 2)))
boolean isExcluded = excludedPaths.stream().anyMatch(
excludedPath -> excludedPath.equals(path) || (excludedPath.endsWith("**") && path.startsWith(excludedPath.substring(0, excludedPath.length() - 2)))
);
if (!isExcluded) {
// 接口添加鉴权参数
pathItem.readOperations()
.forEach(operation ->
operation.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
);
pathItem.readOperations().forEach(operation ->
operation.addSecurityItem(new SecurityRequirement().addList(CommonConstant.X_ACCESS_TOKEN))
);
}
});
}

View File

@ -109,7 +109,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
filterChainDefinitionMap.put("/openapi/call/**", "anon"); // 开放平台接口排除
//update-begin--Author:scott Date:20221116 for排除静态资源后缀
filterChainDefinitionMap.put("/", "anon");
@ -153,7 +153,11 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/drag/share/view/**", "anon");
filterChainDefinitionMap.put("/drag/onlDragDatasetHead/getAllChartData", "anon");
filterChainDefinitionMap.put("/drag/onlDragDatasetHead/getTotalData", "anon");
filterChainDefinitionMap.put("/drag/onlDragDatasetHead/getMapDataByCode", "anon");
filterChainDefinitionMap.put("/drag/onlDragDatasetHead/getTotalDataByCompId", "anon");
filterChainDefinitionMap.put("/drag/mock/json/**", "anon");
filterChainDefinitionMap.put("/drag/onlDragDatasetHead/getDictByCodes", "anon");
filterChainDefinitionMap.put("/jimubi/view", "anon");
filterChainDefinitionMap.put("/jimubi/share/view/**", "anon");
@ -169,7 +173,11 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/websocket/**", "anon");//系统通知和公告
filterChainDefinitionMap.put("/newsWebsocket/**", "anon");//CMS模块
filterChainDefinitionMap.put("/vxeSocket/**", "anon");//JVxeTable无痕刷新示例
//App vue3版本查询版本接口
filterChainDefinitionMap.put("/sys/version/app3version", "anon");
//仪表盘按钮通信
filterChainDefinitionMap.put("/dragChannelSocket/**","anon");
//性能监控安全隐患泄露TOEKNdurid连接池也有
//filterChainDefinitionMap.put("/actuator/**", "anon");
//测试模块排除

View File

@ -0,0 +1,17 @@
package org.jeecg.config.vo;
import lombok.Data;
/**
* @Description: 高德开放api配置
*
* @author: wangshuai
* @date: 2025/7/17 20:32
*/
@Data
public class GaoDeApi {
/**应用key*/
private String apiKey;
/**应用秘钥*/
private String secretKey;
}

View File

@ -0,0 +1,104 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<div class="box-content">
<div class="info-top">
<img src="https://www.jeecg.com/images/logo.png" style="float: left; margin: 0 10px 0 0; width: 32px;height:32px" /><div style="color:#fff"><strong>重要流程抄送的通知</strong></div>
</div>
<div class="info-wrap">
<div class="tips" style="padding:15px;">
<p style="margin: 10px 0;">
您好您有一个新的流程抄送任务亟待查看任务内容如下
</p>
<table style="width: 400px; border-spacing: 0px; border-collapse: collapse; border: none; margin-top: 20px;"><tbody>
<tr style="height: 45px;">
<td style="width: 150px; height: 40px; background: #F6F6F6;border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
流程名称
</td>
<td style="width: 250px;height: 40px; border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
${bpm_name}<a style="color: #006eff;" href="${url}" target="_blank" rel="noopener">[立刻查看]</a>
</td>
</tr>
<tr style="height: 45px;">
<td style="width: 150px;height: 40px; background: #F6F6F6;border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
抄送任务
</td>
<td style="width: 250px;height: 40px; border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
${bpm_task}
</td>
</tr>
<tr style="height: 45px;">
<td style="width: 150px; height: 40px; background: #F6F6F6;border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
抄送时间
</td>
<td style="width: 250px;height: 40px; border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
${datetime}
</td>
</tr>
<tr style="height: 45px;">
<td style="width: 150px; height: 40px; background: #F6F6F6;border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
抄送内容
</td>
<td style="width: 250px;height: 40px; border: 1px solid #DBDBDB; font-size: 14px; font-weight: normal; text-align: left; padding-left: 14px;">
${remark}
</td>
</tr>
</tbody>
</table>
</div>
<div class="footer">北京国炬平台</div>
</div>
<div style="margin-top: 60px;margin-bottom: 10px;">
<span style="font-size: 13px; font-weight: bold; color: #666;">温馨提醒</span>
<div style="line-height: 24px; margin-top: 10px;">
<div style="font-size: 13px; color: #666;">使用过程中如有任何问题请联系系统管理员</div>
</div>
</div>
<div style="width: 600px; margin: 0 auto; margin-top: 50px; font-size: 12px; -webkit-font-smoothing: subpixel-antialiased; text-size-adjust: 100%;">
<p style="text-align: center; line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px !important; color: #7e8890 !important;">
<span class="appleLinks">Copyright © 2023-2024 北京国炬信息技术有限公司. 保留所有权利。</span>
</p>
<p style="text-align: center;line-height: 20.4px; text-size-adjust: 100%; font-family: 'Microsoft YaHei'!important; padding: 0px !important; margin: 0px; color: #7e8890 !important; margin-top: 10px;">
<span class="appleLinks">邮件由系统自动发送,请勿直接回复本邮件!</span>
</p>
</div>
</div>
</body>
<style>
.box-content{
width: 80%;
margin: 20px auto;
max-width: 800px;
min-width: 600px;
}
.info-top{
padding: 15px 25px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
background: #4ea3f2;
color: #fff;
overflow: hidden;
line-height: 32px;
}
.info-wrap{
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
border:1px solid #ddd;
overflow: hidden;
padding: 15px 15px 20px;
}
.footer{
text-align: right;
color: #999;
padding: 0 15px 15px;
}
</style>
</html>

View File

@ -836,7 +836,7 @@ public class AiragChatServiceImpl implements IAiragChatService {
closeSSE(emitter, eventData);
//update-end---author:chenrui ---date:20250425 for[QQYUN-12203]AI 聊天超时或者服务器报错给个友好提示------------
} else {
errMsg = "调用大模型接口失败:" + errMsg;
errMsg = "调用大模型接口失败,详情请查看后台日志。";
EventData eventData = new EventData(requestId, null, EventData.EVENT_FLOW_ERROR, chatConversation.getId(), topicId);
eventData.setData(EventFlowData.builder().success(false).message(errMsg).build());
closeSSE(emitter, eventData);

View File

@ -1,82 +1,82 @@
package org.jeecg.modules.airag.test;
import dev.langchain4j.data.document.Document;
import lombok.extern.slf4j.Slf4j;
import org.apache.tika.parser.AutoDetectParser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.airag.llm.document.TikaDocumentParser;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import org.wildfly.common.Assert;
import java.io.File;
import java.io.IOException;
/**
* @Description: 文件解析测试
* @Author: chenrui
* @Date: 2025/2/11 16:11
*/
@Slf4j
public class TestFileParse {
@Test
public void testParseTxt() {
readFile("test.txt");
}
@Test
public void testParsePdf() {
readFile("test.pdf");
}
@Test
public void testParseMd() {
readFile("test.md");
}
@Test
public void testParseDoc() {
readFile("test.docx");
}
@Test
public void testParseDoc2003() {
readFile("test.doc");
}
@Test
public void testParseExcel() {
readFile("test.xlsx");
}
@Test
public void testParseExcel2003() {
readFile("test.xls");
}
@Test
public void testParsePPT() {
readFile("test.pptx");
}
@Test
public void testParsePPT2003() {
readFile("test.ppt");
}
private static void readFile(String filePath) {
try {
ClassPathResource resource = new ClassPathResource(filePath);
File file = resource.getFile();
TikaDocumentParser parser = new TikaDocumentParser(AutoDetectParser::new, null, null, null);
Document document = parser.parse(file);
Assert.assertNotNull(document);
System.out.println(filePath + "----" + document.text());
Assert.assertTrue(oConvertUtils.isNotEmpty(document));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
//package org.jeecg.modules.airag.test;
//
//import dev.langchain4j.data.document.Document;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.tika.parser.AutoDetectParser;
//import org.jeecg.common.util.oConvertUtils;
//import org.jeecg.modules.airag.llm.document.TikaDocumentParser;
//import org.junit.jupiter.api.Test;
//import org.springframework.core.io.ClassPathResource;
//import org.wildfly.common.Assert;
//
//import java.io.File;
//import java.io.IOException;
//
///**
// * @Description: 文件解析测试
// * @Author: chenrui
// * @Date: 2025/2/11 16:11
// */
//@Slf4j
//public class TestFileParse {
//
// @Test
// public void testParseTxt() {
// readFile("test.txt");
// }
//
// @Test
// public void testParsePdf() {
// readFile("test.pdf");
// }
//
// @Test
// public void testParseMd() {
// readFile("test.md");
// }
//
// @Test
// public void testParseDoc() {
// readFile("test.docx");
// }
//
// @Test
// public void testParseDoc2003() {
// readFile("test.doc");
// }
//
// @Test
// public void testParseExcel() {
// readFile("test.xlsx");
// }
//
// @Test
// public void testParseExcel2003() {
// readFile("test.xls");
// }
//
// @Test
// public void testParsePPT() {
// readFile("test.pptx");
// }
// @Test
// public void testParsePPT2003() {
// readFile("test.ppt");
// }
//
// private static void readFile(String filePath) {
// try {
// ClassPathResource resource = new ClassPathResource(filePath);
// File file = resource.getFile();
// TikaDocumentParser parser = new TikaDocumentParser(AutoDetectParser::new, null, null, null);
// Document document = parser.parse(file);
// Assert.assertNotNull(document);
// System.out.println(filePath + "----" + document.text());
// Assert.assertTrue(oConvertUtils.isNotEmpty(document));
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// }
//
//
//}

View File

@ -1,54 +1,54 @@
package org.jeecg.modules.airag.test;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.junit.jupiter.api.Test;
import java.io.IOException;
/**
* @Description: 流程测试
* @Author: chenrui
* @Date: 2025/2/11 16:11
*/
@Slf4j
public class TestFlows {
@Test
public void testRunFlow(){
String id = "1889499701976358913";
// String id = "1889571074002247682"; //switch
// String id = "1889608218175463425"; //脚本
String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3Mzk1NDY0NDIsInVzZXJuYW1lIjoiamVlY2cifQ.CFIV79PUYmOAiqBKT3yjwihHWwf954DvS-4oKERmJVU";
String request = request(id,token);
System.out.println(request);
}
private String request(String id,String token) {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("http://localhost:7008/airag/airagFlow/flow/run/" + id + "?field1=%25E5%2593%2588%25E5%2593%2588&field2=%25E4%25B8%25AD%25E5%259B%25BD")
.get()
.addHeader("X-Access-Token", token)
.addHeader("Accept", "*/*")
.addHeader("Accept-Encoding", "gzip, deflate, br")
.addHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0")
.addHeader("Connection", "keep-alive")
.addHeader("Cookie", "JSESSIONID=442C48D3D1D0B2878A597AB6EBF2A07E")
.build();
try {
Response response = client.newCall(request).execute();
return response.body().string();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
// TODO author: chenrui for:完善用例,使用java方式调用 date:2025/2/14
}
//package org.jeecg.modules.airag.test;
//
//import lombok.extern.slf4j.Slf4j;
//import okhttp3.OkHttpClient;
//import okhttp3.Request;
//import okhttp3.Response;
//import org.junit.jupiter.api.Test;
//
//import java.io.IOException;
//
///**
// * @Description: 流程测试
// * @Author: chenrui
// * @Date: 2025/2/11 16:11
// */
//@Slf4j
//public class TestFlows {
//
// @Test
// public void testRunFlow(){
// String id = "1889499701976358913";
//// String id = "1889571074002247682"; //switch
//// String id = "1889608218175463425"; //脚本
// String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3Mzk1NDY0NDIsInVzZXJuYW1lIjoiamVlY2cifQ.CFIV79PUYmOAiqBKT3yjwihHWwf954DvS-4oKERmJVU";
// String request = request(id,token);
// System.out.println(request);
// }
//
// private String request(String id,String token) {
//
// OkHttpClient client = new OkHttpClient();
//
// Request request = new Request.Builder()
// .url("http://localhost:7008/airag/airagFlow/flow/run/" + id + "?field1=%25E5%2593%2588%25E5%2593%2588&field2=%25E4%25B8%25AD%25E5%259B%25BD")
// .get()
// .addHeader("X-Access-Token", token)
// .addHeader("Accept", "*/*")
// .addHeader("Accept-Encoding", "gzip, deflate, br")
// .addHeader("User-Agent", "PostmanRuntime-ApipostRuntime/1.1.0")
// .addHeader("Connection", "keep-alive")
// .addHeader("Cookie", "JSESSIONID=442C48D3D1D0B2878A597AB6EBF2A07E")
// .build();
//
// try {
// Response response = client.newCall(request).execute();
// return response.body().string();
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// }
//
// // TODO author: chenrui for:完善用例,使用java方式调用 date:2025/2/14
//
//}

View File

@ -6,6 +6,7 @@ import org.jeecg.common.api.dto.DataLogDTO;
import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.constant.ServiceNameConstants;
import org.jeecg.common.constant.enums.DySmsEnum;
import org.jeecg.common.constant.enums.EmailTemplateEnum;
import org.jeecg.common.desensitization.annotation.SensitiveDecode;
import org.jeecg.common.system.api.factory.SysBaseAPIFallbackFactory;
@ -523,6 +524,16 @@ public interface ISysBaseAPI extends CommonAPI {
*/
@GetMapping("/sys/api/sendHtmlTemplateEmail")
void sendHtmlTemplateEmail(@RequestParam("email") String email, @RequestParam("title") String title, @RequestParam("emailEnum") EmailTemplateEnum emailTemplateEnum, @RequestParam("params") JSONObject params);
/**
/**
* 发送短信消息
*
* @param phone 手机号码
* @param params 模版参数
* @param dySmsEnum 短信模版枚举
*/
@GetMapping("/sys/api/sendSmsMsg")
void sendSmsMsg(@RequestParam("phone") String phone, @RequestParam("params") JSONObject params,@RequestParam("dySmsEnum") DySmsEnum dySmsEnum);
/**
* 41 获取公司下级部门和公司下所有用户id
* @param orgCode 部门编号
@ -791,5 +802,17 @@ public interface ISysBaseAPI extends CommonAPI {
@RequestParam("tableOrDictCode") String tableOrDictCode,
@RequestParam(value = "fields", required = false) String... fields
);
/**
* 自动发布通告
*
* @param dataId 通告ID
* @param currentUserName 发送人
* @return
*/
@GetMapping("/sys/api/announcementAutoRelease")
void announcementAutoRelease(
@RequestParam("dataId") String dataId,
@RequestParam(value = "currentUserName") String currentUserName
);
}

View File

@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.dto.DataLogDTO;
import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.constant.enums.DySmsEnum;
import org.jeecg.common.constant.enums.EmailTemplateEnum;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.vo.*;
@ -341,6 +342,11 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
}
@Override
public void sendSmsMsg(String phone, JSONObject params, DySmsEnum dySmsEnum) {
}
@Override
public List<Map> getDeptUserByOrgCode(String orgCode) {
return null;
@ -464,4 +470,9 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
return false;
}
@Override
public void announcementAutoRelease(String dataId, String currentUserName) {
}
}

View File

@ -5,6 +5,7 @@ import org.jeecg.common.api.CommonAPI;
import org.jeecg.common.api.dto.DataLogDTO;
import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.constant.enums.DySmsEnum;
import org.jeecg.common.constant.enums.EmailTemplateEnum;
import org.jeecg.common.system.vo.*;
@ -398,7 +399,13 @@ public interface ISysBaseAPI extends CommonAPI {
* @return List<Map>
*/
List<Map> getDeptUserByOrgCode(String orgCode);
/**
* 42 发送短信消息
* @param phone 手机号
* @param param 模版参数
* @param dySmsEnum 短信模版
*/
void sendSmsMsg(String phone, JSONObject param, DySmsEnum dySmsEnum);
/**
* 查询分类字典翻译
* @param ids 多个分类字典id
@ -544,4 +551,10 @@ public interface ISysBaseAPI extends CommonAPI {
*/
boolean dictTableWhiteListCheckByDict(String tableOrDictCode, String... fields);
/**
* 消息自动发布
* @param dataId
* @param currentUserName
*/
void announcementAutoRelease(String dataId, String currentUserName);
}

View File

@ -57,7 +57,7 @@ public class CodeTemplateInitListener implements ApplicationListener<Application
// 非jar模式不生成模板
// 不生成目录只生成具体模板文件
if (!filepath.contains(".jar!/BOOT-INF/lib/") || !createFilePath.contains(".")) {
if ((!filepath.contains(".jar!/BOOT-INF/lib/") && !filepath.contains(".jar/!BOOT-INF/lib/")) || !createFilePath.contains(".")) {
continue;
}
if (!FileUtil.exist(createFilePath)) {

View File

@ -6,6 +6,8 @@ import org.jeecg.common.api.dto.DataLogDTO;
import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.enums.DySmsEnum;
import org.jeecg.common.constant.enums.EmailTemplateEnum;
import org.jeecg.common.desensitization.util.SensitiveInfoUtil;
import org.jeecg.common.system.vo.*;
import org.jeecg.modules.system.service.ISysUserService;
@ -578,6 +580,27 @@ public class SystemApiController {
public void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content){
this.sysBaseApi.sendEmailMsg(email,title,content);
};
/**
* 发送html模版邮件消息
* @param email
* @param title
* @param emailTemplateEnum 邮件模版枚举
* @param params 模版参数
*/
@GetMapping("/sendHtmlTemplateEmail")
public void sendHtmlTemplateEmail(@RequestParam("email")String email, @RequestParam("title")String title, @RequestParam("emailEnum") EmailTemplateEnum emailTemplateEnum, @RequestParam("params") JSONObject params){
this.sysBaseApi.sendHtmlTemplateEmail(email,title,emailTemplateEnum,params);
};
/**
* 发送短信消息
* @param phone 手机号码
* @param params 模版参数
* @param dySmsEnum 短信模版枚举
*/
@GetMapping("/sendSmsMsg")
public void sendSmsMsg(@RequestParam("phone")String phone, @RequestParam("params") JSONObject params, @RequestParam("dySmsEnum") DySmsEnum dySmsEnum){
this.sysBaseApi.sendSmsMsg(phone,params,dySmsEnum);
};
/**
* 41 获取公司下级部门和公司下所有用户信息
* @param orgCode
@ -976,5 +999,19 @@ public class SystemApiController {
) {
return sysBaseApi.dictTableWhiteListCheckByDict(tableOrDictCode, fields);
}
/**
* 自动发布通告
*
* @param dataId 通告ID
* @param currentUserName 发送人
* @return
*/
@GetMapping("/announcementAutoRelease")
public void announcementAutoRelease(
@RequestParam("dataId") String dataId,
@RequestParam(value = "currentUserName", required = false) String currentUserName
) {
sysBaseApi.announcementAutoRelease(dataId, currentUserName);
}
}

View File

@ -35,6 +35,9 @@ public class SysMessageTemplate extends JeecgEntity{
/**模板类型*/
@Excel(name = "模板类型", width = 15)
private java.lang.String templateType;
/**模板分类*/
@Excel(name = "模板类型(notice通知公告 other其他)", width = 15)
private java.lang.String templateCategory;
/**已经应用/未应用 1是0否*/
@Excel(name = "应用状态", width = 15)

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.WebsocketConst;
import org.jeecg.common.constant.enums.NoticeTypeEnum;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.SpringContextUtils;
@ -74,11 +75,13 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
Map<String,Object> data = messageDTO.getData();
String[] arr = messageDTO.getToUser().split(",");
for(String username: arr){
doSend(title, content, fromUser, username, data);
//update-begin---author:wangshuai---date:2025-06-26---for:QQYUN-12162OA项目改造系统重消息拆分目前消息都在一起 需按分类进行拆分---
doSend(title, content, fromUser, username, data, messageDTO.getNoticeType());
//update-end---author:wangshuai---date:2025-06-26---for:QQYUN-12162OA项目改造系统重消息拆分目前消息都在一起 需按分类进行拆分---
}
}
private void doSend(String title, String msgContent, String fromUser, String toUser, Map<String, Object> data){
private void doSend(String title, String msgContent, String fromUser, String toUser, Map<String, Object> data, String noticeType){
SysAnnouncement announcement = new SysAnnouncement();
if(data!=null){
//摘要信息
@ -91,12 +94,14 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
if(taskId!=null){
announcement.setBusId(taskId.toString());
announcement.setBusType(Vue3MessageHrefEnum.BPM_TASK.getBusType());
noticeType = NoticeTypeEnum.NOTICE_TYPE_FLOW.getValue();
}
// 流程内消息节点 发消息会传一个busType
Object busType = data.get(CommonConstant.NOTICE_MSG_BUS_TYPE);
if(busType!=null){
announcement.setBusType(busType.toString());
noticeType = NoticeTypeEnum.NOTICE_TYPE_FLOW.getValue();
}
}
announcement.setTitile(title);
@ -109,6 +114,11 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
//系统消息
announcement.setMsgCategory("2");
announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
if(oConvertUtils.isEmpty(noticeType)){
noticeType = NoticeTypeEnum.NOTICE_TYPE_SYSTEM.getValue();
}
announcement.setNoticeType(noticeType);
announcement.setIzTop(CommonConstant.IZ_TOP_0);
sysAnnouncementMapper.insert(announcement);
// 2.插入用户通告阅读标记表记录
String userId = toUser;
@ -130,6 +140,7 @@ public class SystemSendMsgHandle implements ISendMsgHandle {
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
obj.put(WebsocketConst.MSG_ID, announcement.getId());
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
obj.put(CommonConstant.NOTICE_TYPE,noticeType);
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
}
}

View File

@ -1,7 +1,5 @@
package org.jeecg.modules.openapi.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

View File

@ -1,7 +1,5 @@
package org.jeecg.modules.openapi.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

View File

@ -2,7 +2,6 @@ package org.jeecg.modules.openapi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.openapi.entity.OpenApi;
import org.jeecg.modules.openapi.entity.OpenApiPermission;
import java.util.List;

View File

@ -2,7 +2,6 @@ package org.jeecg.modules.openapi.swagger;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**

View File

@ -14,6 +14,16 @@ public interface DefIndexConst {
* 默认首页的缓存key
*/
String CACHE_KEY = "sys:cache:def_index";
/**
* 缓存默认首页的类型前缀
*/
String CACHE_TYPE = "sys:cache:home_type::";
/**
* 默认首页类型
*/
String HOME_TYPE_SYSTEM = "system";
String HOME_TYPE_PERSONAL = "personal";
String HOME_TYPE_MENU = "menuHome";
/**
* 默认首页的初始值

View File

@ -370,7 +370,16 @@ public class LoginController {
} else if(CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) {
//忘记密码模板
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE);
}
//update-begin---author:wangshuai---date:2025-07-15---for:issues/8567严重修改密码存在水平越权问题---
if(b){
String username = sysUser.getUsername();
obj.put("username",username);
redisUtil.set(redisKey, obj.toJSONString(), 600);
result.setSuccess(true);
return result;
}
//update-end---author:wangshuai---date:2025-07-15---for:issues/8567严重修改密码存在水平越权问题---
}
}
if (b == false) {
@ -438,7 +447,7 @@ public class LoginController {
userInfo(sysUser, result, request);
//添加日志
baseCommonService.addLog("用户名: " + sysUser.getUsername() + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
redisUtil.removeAll(redisKey);
return result;
}
@ -793,7 +802,10 @@ public class LoginController {
return result;
}
//验证码5分钟内有效
redisUtil.set(redisKey, captcha, 300);
//update-begin---author:wangshuai---date:2025-07-15---for:issues/8567严重修改密码存在水平越权问题---
obj.put("username",username);
redisUtil.set(redisKey, obj.toJSONString(), 300);
//update-end---author:wangshuai---date:2025-07-15---for:issues/8567严重修改密码存在水平越权问题---
result.setSuccess(true);
} catch (ClientException e) {
e.printStackTrace();

View File

@ -14,6 +14,7 @@ import org.jeecg.common.config.TenantContext;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.CommonSendStatus;
import org.jeecg.common.constant.WebsocketConst;
import org.jeecg.common.constant.enums.NoticeTypeEnum;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.LoginUser;
@ -88,7 +89,14 @@ public class SysAnnouncementController {
private RedisUtil redisUtil;
@Autowired
public RedisTemplate redisTemplate;
//常规报错定义
private static final String SPECIAL_CHAR_ERROR = "保存失败:消息内容包含数据库不支持的特殊字符,请检查并修改内容!";
private static final String CONTENT_TOO_LONG_ERROR = "保存失败:消息内容超过最大长度限制,请缩减内容长度!";
private static final String DEFAULT_ERROR = "操作失败,请稍后重试或联系管理员!";
/**
* 通告缓存
*/
String ANNO_CACHE_KEY = "sys:cache:announcement";
/**
* QQYUN-5072性能优化线上通知消息打开有点慢
*/
@ -140,11 +148,14 @@ public class SysAnnouncementController {
sysAnnouncement.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
//未发布
sysAnnouncement.setSendStatus(CommonSendStatus.UNPUBLISHED_STATUS_0);
//流程状态
sysAnnouncement.setBpmStatus("1");
sysAnnouncement.setNoticeType(NoticeTypeEnum.NOTICE_TYPE_SYSTEM.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
result.error500(determineErrorMessage(e));
}
return result;
}
@ -156,22 +167,46 @@ public class SysAnnouncementController {
*/
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<SysAnnouncement> eidt(@RequestBody SysAnnouncement sysAnnouncement) {
Result<SysAnnouncement> result = new Result<SysAnnouncement>();
SysAnnouncement sysAnnouncementEntity = sysAnnouncementService.getById(sysAnnouncement.getId());
try{
if(sysAnnouncementEntity==null) {
result.error500("未找到对应实体");
}else {
// update-begin-author:liusq date:20210804 for:标题处理xss攻击的问题
String title = XssUtils.scriptXss(sysAnnouncement.getTitile());
sysAnnouncement.setTitile(title);
// update-end-author:liusq date:20210804 for:标题处理xss攻击的问题
sysAnnouncement.setNoticeType(NoticeTypeEnum.NOTICE_TYPE_SYSTEM.getValue());
boolean ok = sysAnnouncementService.upDateAnnouncement(sysAnnouncement);
//TODO 返回false说明什么
if(ok) {
result.success("修改成功!");
}
}
} catch (Exception e) {
result.error500(determineErrorMessage(e));
}
return result;
}
/**
* 简单编辑
* @param sysAnnouncement
* @return
*/
@RequestMapping(value = "/editIzTop", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<SysAnnouncement> editIzTop(@RequestBody SysAnnouncement sysAnnouncement) {
Result<SysAnnouncement> result = new Result<SysAnnouncement>();
SysAnnouncement sysAnnouncementEntity = sysAnnouncementService.getById(sysAnnouncement.getId());
if(sysAnnouncementEntity==null) {
result.error500("未找到对应实体");
}else {
// update-begin-author:liusq date:20210804 for:标题处理xss攻击的问题
String title = XssUtils.scriptXss(sysAnnouncement.getTitile());
sysAnnouncement.setTitile(title);
// update-end-author:liusq date:20210804 for:标题处理xss攻击的问题
boolean ok = sysAnnouncementService.upDateAnnouncement(sysAnnouncement);
//TODO 返回false说明什么
if(ok) {
result.success("修改成功!");
}
Integer izTop = sysAnnouncement.getIzTop();
sysAnnouncementEntity.setIzTop(oConvertUtils.getInt(izTop,CommonConstant.IZ_TOP_0));
sysAnnouncementService.updateById(sysAnnouncementEntity);
result.success("修改成功!");
}
return result;
}
@ -255,6 +290,9 @@ public class SysAnnouncementController {
String currentUserName = JwtUtil.getUserNameByToken(request);
sysAnnouncement.setSender(currentUserName);
boolean ok = sysAnnouncementService.updateById(sysAnnouncement);
if(oConvertUtils.isEmpty(sysAnnouncement.getNoticeType())){
sysAnnouncement.setNoticeType(NoticeTypeEnum.NOTICE_TYPE_SYSTEM.getValue());
}
if(ok) {
result.success("系统通知推送成功");
if(sysAnnouncement.getMsgType().equals(CommonConstant.MSG_TYPE_ALL)) {
@ -266,6 +304,7 @@ public class SysAnnouncementController {
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
obj.put(CommonConstant.NOTICE_TYPE, sysAnnouncement.getNoticeType());
webSocket.sendMessage(obj.toJSONString());
}else {
// 2.插入用户通告阅读标记表记录
@ -277,6 +316,7 @@ public class SysAnnouncementController {
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
obj.put(CommonConstant.NOTICE_TYPE, sysAnnouncement.getNoticeType());
webSocket.sendMessage(userIds, obj.toJSONString());
}
try {
@ -382,15 +422,31 @@ public class SysAnnouncementController {
* @return
*/
@RequestMapping(value = "/getUnreadMessageCount", method = RequestMethod.GET)
public Result<Integer> getUnreadMessageCount(@RequestParam(required = false, defaultValue = "5") Integer pageSize, HttpServletRequest request) {
public Result<Map<String, Integer>> getUnreadMessageCount(@RequestParam(required = false, defaultValue = "5") Integer pageSize, HttpServletRequest request) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
// 获取上个月的第一天只查近两个月的通知
Date lastMonthStartDay = DateRangeUtils.getLastMonthStartDay();
log.info(" ------查询近两个月收到的未读通知消息数量------近2月的第一天{}", lastMonthStartDay);
Integer unreadMessageCount = sysAnnouncementService.getUnreadMessageCountByUserId(userId, lastMonthStartDay);
return Result.ok(unreadMessageCount);
//update-begin---author:wangshuai---date:2025-06-26---for:QQYUN-12162OA项目改造系统重消息拆分目前消息都在一起 需按分类进行拆分---
Map<String,Integer> unreadMessageCount = new HashMap<>();
//系统消息数量
Integer systemCount = sysAnnouncementService.getUnreadMessageCountByUserId(userId, lastMonthStartDay, NoticeTypeEnum.NOTICE_TYPE_SYSTEM.getValue());
unreadMessageCount.put("systemCount",systemCount);
//流程数量
Integer flowCount = sysAnnouncementService.getUnreadMessageCountByUserId(userId, lastMonthStartDay, NoticeTypeEnum.NOTICE_TYPE_FLOW.getValue());
unreadMessageCount.put("flowCount",flowCount);
//文件数量
Integer fileCount = sysAnnouncementService.getUnreadMessageCountByUserId(userId, lastMonthStartDay, NoticeTypeEnum.NOTICE_TYPE_FILE.getValue());
unreadMessageCount.put("fileCount",fileCount);
//日程计划数量
Integer planCount = sysAnnouncementService.getUnreadMessageCountByUserId(userId, lastMonthStartDay, NoticeTypeEnum.NOTICE_TYPE_PLAN.getValue());
unreadMessageCount.put("planCount",planCount);
Integer count = systemCount + flowCount + fileCount + planCount;
unreadMessageCount.put("count",count);
//update-end---author:wangshuai---date:2025-06-26---for:QQYUN-12162OA项目改造系统重消息拆分目前消息都在一起 需按分类进行拆分---
return Result.ok(unreadMessageCount);
}
@ -440,6 +496,9 @@ public class SysAnnouncementController {
if(sysAnnouncementExcel.getDelFlag()==null){
sysAnnouncementExcel.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
}
if(oConvertUtils.isEmpty(sysAnnouncementExcel.getIzTop())){
sysAnnouncementExcel.setIzTop(CommonConstant.IZ_TOP_0);
}
sysAnnouncementService.save(sysAnnouncementExcel);
}
return Result.ok("文件导入成功!数据行数:" + listSysAnnouncements.size());
@ -526,6 +585,9 @@ public class SysAnnouncementController {
/**
* vue3用 消息列表查询
* @param fromUser
* @param busType
* @param starFlag
* @param msgCategory
* @param beginDate
* @param endDate
* @param pageNo
@ -536,11 +598,13 @@ public class SysAnnouncementController {
public Result<List<SysAnnouncement>> vue3List(@RequestParam(name="fromUser", required = false) String fromUser,
@RequestParam(name="busType", required = false) String busType,
@RequestParam(name="starFlag", required = false) String starFlag,
@RequestParam(name="msgCategory", required = false) String msgCategory,
@RequestParam(name="rangeDateKey", required = false) String rangeDateKey,
@RequestParam(name="beginDate", required = false) String beginDate,
@RequestParam(name="endDate", required = false) String endDate,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@RequestParam(name= "noticeType", required = false) String noticeType) {
long calStartTime = System.currentTimeMillis(); // 记录开始时间
// 1获取日期查询条件开始时间和结束时间
@ -563,7 +627,7 @@ public class SysAnnouncementController {
}
// 2根据条件查询用户的通知消息
List<SysAnnouncement> ls = this.sysAnnouncementService.querySysMessageList(pageSize, pageNo, fromUser, starFlag,busType, beginTime, endTime);
List<SysAnnouncement> ls = this.sysAnnouncementService.querySysMessageList(pageSize, pageNo, fromUser, starFlag,busType, msgCategory, beginTime, endTime, noticeType);
// 3设置当前页的消息为已读
if (!CollectionUtils.isEmpty(ls)) {
@ -585,7 +649,7 @@ public class SysAnnouncementController {
// 4性能统计耗时
long calEndTime = System.currentTimeMillis(); // 记录结束时间
long duration = calEndTime - calStartTime; // 计算耗时
System.out.println("耗时:" + duration + " 毫秒");
log.info("耗时:" + duration + " 毫秒");
return Result.ok(ls);
}
@ -597,11 +661,11 @@ public class SysAnnouncementController {
* @return
*/
@GetMapping("/getLastAnnountTime")
public Result<Page<SysAnnouncementSend>> getLastAnnountTime(@RequestParam(name = "userId") String userId){
public Result<Page<SysAnnouncementSend>> getLastAnnountTime(@RequestParam(name = "userId") String userId,@RequestParam(name="noticeType",required = false) String noticeType){
Result<Page<SysAnnouncementSend>> result = new Result<>();
//----------------------------------------------------------------------------------------
// step.1 此接口过慢可以采用缓存一小时方案
String keyString = String.format(CommonConstant.CACHE_KEY_USER_LAST_ANNOUNT_TIME_1HOUR, userId);
String keyString = String.format(CommonConstant.CACHE_KEY_USER_LAST_ANNOUNT_TIME_1HOUR + "_" + noticeType, userId);
if (redisTemplate.hasKey(keyString)) {
log.info("[SysAnnouncementSend Redis] 通过Redis缓存查询用户最后一次收到系统通知时间userId={}", userId);
Page<SysAnnouncementSend> pageList = (Page<SysAnnouncementSend>) redisTemplate.opsForValue().get(keyString);
@ -641,4 +705,54 @@ public class SysAnnouncementController {
sysAnnouncementService.clearAllUnReadMessage();
return Result.ok("清除未读消息成功");
}
/**
* 添加访问次数
* @param id
* @return
*/
@RequestMapping(value = "/addVisitsNumber", method = RequestMethod.GET)
public Result<?> addVisitsNumber(@RequestParam(name="id",required=true) String id) {
int count = oConvertUtils.getInt(redisUtil.get(ANNO_CACHE_KEY+id),0) + 1;
redisUtil.set(ANNO_CACHE_KEY+id, count);
if (count % 5 == 0) {
cachedThreadPool.execute(() -> {
sysAnnouncementService.updateVisitsNum(id, count);
});
// 重置访问次数
redisUtil.del(ANNO_CACHE_KEY+id);
}
return Result.ok("公告消息访问次数+1次");
}
/**
* 根据异常信息确定友好的错误提示
*/
private String determineErrorMessage(Exception e) {
String errorMsg = e.getMessage();
if (isSpecialCharacterError(errorMsg)) {
return SPECIAL_CHAR_ERROR;
} else if (isContentTooLongError(errorMsg)) {
return CONTENT_TOO_LONG_ERROR;
} else {
return DEFAULT_ERROR;
}
}
/**
* 判断是否为特殊字符错误
*/
private boolean isSpecialCharacterError(String errorMsg) {
return errorMsg != null
&& errorMsg.contains("Incorrect string value")
&& errorMsg.contains("column 'msg_content'");
}
/**
* 判断是否为内容过长错误
*/
private boolean isContentTooLongError(String errorMsg) {
return errorMsg != null
&& errorMsg.contains("Data too long for column 'msg_content'");
}
}

View File

@ -0,0 +1,68 @@
package org.jeecg.modules.system.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.system.entity.SysAppVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Description: app系统配置
* @Author: jeecg-boot
* @Date: 2025-07-05
* @Version: V1.0
*/
@Tag(name="app系统配置")
@RestController
@RequestMapping("/sys/version")
@Slf4j
public class SysAppVersionController{
@Autowired
private RedisUtil redisUtil;
/**
* APP缓存前缀
*/
private String APP3_VERSION = "app3:version";
/**
* app3版本信息
* @return
*/
@Operation(summary="app版本")
@GetMapping(value = "/app3version")
public Result<SysAppVersion> app3Version(@RequestParam(name="key", required = false)String appKey) throws Exception {
Object appConfig = redisUtil.get(APP3_VERSION + appKey);
if (oConvertUtils.isNotEmpty(appConfig)) {
try {
SysAppVersion sysAppVersion = (SysAppVersion)appConfig;
return Result.OK(sysAppVersion);
} catch (Exception e) {
log.error(e.toString(),e);
return Result.error("app版本信息获取失败" + e.getMessage());
}
}
return Result.OK();
}
/**
* 保存APP3
*
* @param sysAppVersion
* @return
*/
@RequiresRoles({"admin"})
@Operation(summary="app系统配置-保存")
@PostMapping(value = "/saveVersion")
public Result<?> saveVersion(@RequestBody SysAppVersion sysAppVersion) {
String id = sysAppVersion.getId();
redisUtil.set(APP3_VERSION + id,sysAppVersion);
return Result.OK();
}
}

View File

@ -265,6 +265,9 @@ public class SysCategoryController {
params.setNeedSave(true);
try {
List<SysCategory> listSysCategorys = ExcelImportUtil.importExcel(file.getInputStream(), SysCategory.class, params);
//update-begin---author:chenrui ---date:20250721 for[issues/8612]分类字典导入bug #8612 ------------
Set<String> parentCategoryIds = new HashSet<>();
//update-end---author:chenrui ---date:20250721 for[issues/8612]分类字典导入bug #8612 ------------
//按照编码长度排序
Collections.sort(listSysCategorys);
log.info("排序后的list====>",listSysCategorys);
@ -278,6 +281,9 @@ public class SysCategoryController {
log.info("pId====>",pId);
if(StringUtils.isNotBlank(pId)){
sysCategoryExcel.setPid(pId);
//update-begin---author:chenrui ---date:20250721 for[issues/8612]分类字典导入bug #8612 ------------
parentCategoryIds.add(pId);
//update-end---author:chenrui ---date:20250721 for[issues/8612]分类字典导入bug #8612 ------------
}
}else{
sysCategoryExcel.setPid("0");
@ -298,6 +304,17 @@ public class SysCategoryController {
}
}
}
//update-begin---author:chenrui ---date:20250721 for[issues/8612]分类字典导入bug #8612 ------------
if(oConvertUtils.isObjectNotEmpty(parentCategoryIds)){
for (String parentCategoryId : parentCategoryIds) {
SysCategory parentCategory = sysCategoryService.getById(parentCategoryId);
if(oConvertUtils.isObjectNotEmpty(parentCategory)){
parentCategory.setHasChild(CommonConstant.STATUS_1);
sysCategoryService.updateById(parentCategory);
}
}
}
//update-end---author:chenrui ---date:20250721 for[issues/8612]分类字典导入bug #8612 ------------
} catch (Exception e) {
errorMessage.add("发生异常:" + e.getMessage());
log.error(e.getMessage(), e);

View File

@ -270,7 +270,7 @@ public class SysPermissionController {
indexMenu = new SysPermission();
indexMenu.setUrl(defIndexCfg.getUrl());
indexMenu.setComponent(defIndexCfg.getComponent());
indexMenu.setRoute(defIndexCfg.isRoute());
indexMenu.setRoute(defIndexCfg.getRoute());
indexMenu.setName(DefIndexConst.DEF_INDEX_NAME);
indexMenu.setMenuType(0);
}

View File

@ -10,10 +10,18 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.base.service.BaseCommonService;
import org.jeecg.modules.system.constant.DefIndexConst;
import org.jeecg.modules.system.entity.SysRoleIndex;
import org.jeecg.modules.system.service.ISysRoleIndexService;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -36,6 +44,14 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
@Autowired
private ISysRoleIndexService sysRoleIndexService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private RedisUtil redisUtil;
@Autowired
private BaseCommonService baseCommonService;
/**
* 分页列表查询
*
@ -70,7 +86,12 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
@PostMapping(value = "/add")
//@DynamicTable(value = DynamicTableConstant.SYS_ROLE_INDEX)
public Result<?> add(@RequestBody SysRoleIndex sysRoleIndex,HttpServletRequest request) {
String relationType = sysRoleIndex.getRelationType();
if(oConvertUtils.isEmpty(relationType)){
sysRoleIndex.setRelationType(CommonConstant.HOME_RELATION_ROLE);
}
sysRoleIndexService.save(sysRoleIndex);
sysRoleIndexService.cleanDefaultIndexCache();
return Result.OK("添加成功!");
}
@ -86,7 +107,12 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
//@DynamicTable(value = DynamicTableConstant.SYS_ROLE_INDEX)
public Result<?> edit(@RequestBody SysRoleIndex sysRoleIndex,HttpServletRequest request) {
String relationType = sysRoleIndex.getRelationType();
if(oConvertUtils.isEmpty(relationType)){
sysRoleIndex.setRelationType(CommonConstant.HOME_RELATION_ROLE);
}
sysRoleIndexService.updateById(sysRoleIndex);
sysRoleIndexService.cleanDefaultIndexCache();
return Result.OK("编辑成功!");
}
@ -98,6 +124,7 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
*/
@AutoLog(value = "角色首页配置-通过id删除")
@Operation(summary = "角色首页配置-通过id删除")
@RequiresPermissions("system:roleindex:delete")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
sysRoleIndexService.removeById(id);
@ -112,8 +139,10 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
*/
@AutoLog(value = "角色首页配置-批量删除")
@Operation(summary = "角色首页配置-批量删除")
@RequiresPermissions("system:roleindex:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
baseCommonService.addLog("批量删除用户, ids " +ids ,CommonConstant.LOG_TYPE_2, 3);
this.sysRoleIndexService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@ -196,5 +225,53 @@ public class SysRoleIndexController extends JeecgController<SysRoleIndex, ISysRo
return Result.error("设置失败");
}
}
/**
* 切换默认门户
*
* @param sysRoleIndex
* @return
*/
@PostMapping(value = "/changeDefHome")
public Result<?> changeDefHome(@RequestBody SysRoleIndex sysRoleIndex,HttpServletRequest request) {
String username = JwtUtil.getUserNameByToken(request);
sysRoleIndex.setRoleCode(username);
sysRoleIndexService.changeDefHome(sysRoleIndex);
//update-begin-author:liusq---date:2025-07-03--for: 切换完成后的homePath获取
String version = request.getHeader(CommonConstant.VERSION);
String homePath = null;
SysRoleIndex defIndexCfg = sysUserService.getDynamicIndexByUserRole(username, version);
if (defIndexCfg == null) {
defIndexCfg = sysRoleIndexService.initDefaultIndex();
}
if (oConvertUtils.isNotEmpty(version) && defIndexCfg != null && oConvertUtils.isNotEmpty(defIndexCfg.getUrl())) {
homePath = defIndexCfg.getUrl();
if (!homePath.startsWith(SymbolConstant.SINGLE_SLASH)) {
homePath = SymbolConstant.SINGLE_SLASH + homePath;
}
}
//update-end-author:liusq---date:2025-07-03--for:切换完成后的homePath获取
return Result.OK(homePath);
}
/**
* 获取门户类型
*
* @return
*/
@GetMapping(value = "/getCurrentHome")
public Result<?> getCurrentHome(HttpServletRequest request) {
String username = JwtUtil.getUserNameByToken(request);
Object homeType = redisUtil.get(DefIndexConst.CACHE_TYPE + username);
return Result.OK(oConvertUtils.getString(homeType,DefIndexConst.HOME_TYPE_SYSTEM));
}
/**
* 清除缓存
*
* @return
*/
@RequestMapping(value = "/cleanDefaultIndexCache")
public Result<?> cleanDefaultIndexCache(HttpServletRequest request) {
sysRoleIndexService.cleanDefaultIndexCache();
return Result.OK();
}
}

View File

@ -1092,13 +1092,26 @@ public class SysUserController {
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE+phone;
Object code = redisUtil.get(redisKey);
if (!smscode.equals(code)) {
//update-begin---author:wangshuai---date:2025-07-15---for:issues/8567严重修改密码存在水平越权问题---
if (null == code) {
result.setMessage("短信验证码失效!");
result.setSuccess(false);
return result;
}
String smsCode = "";
if (code.toString().contains("code")) {
smsCode = JSONObject.parseObject(code.toString()).getString("code");
} else {
smsCode = code.toString();
}
if (!smscode.equals(smsCode)) {
//update-end---author:wangshuai---date:2025-07-15---for:issues/8567严重修改密码存在水平越权问题---
result.setMessage("手机验证码错误");
result.setSuccess(false);
return result;
}
//设置有效时间
redisUtil.set(redisKey, smscode,600);
redisUtil.set(redisKey, code,600);
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 漏洞发现新漏洞待处理20220906
//新增查询用户名
@ -1144,6 +1157,22 @@ public class SysUserController {
result.setSuccess(false);
return result;
}
//update-begin---author:wangshuai---date:2025-07-14---for:issues/8567严重修改密码存在水平越权问题---
String redisUsername = "";
if(object.toString().contains("code")){
JSONObject jsonObject = JSONObject.parseObject(object.toString());
object = jsonObject.getString("code");
redisUsername = jsonObject.getString("username");
}
//验证是否为当前用户的
if(oConvertUtils.isNotEmpty(redisUsername) && !username.equals(redisUsername)){
result.setMessage("此验证码不是当前用户的!");
result.setSuccess(false);
return result;
}
//update-end---author:wangshuai---date:2025-07-14---for:issues/8567严重修改密码存在水平越权问题---
if(!smscode.equals(object.toString())) {
result.setMessage("短信验证码不匹配!");
result.setSuccess(false);
@ -1151,7 +1180,7 @@ public class SysUserController {
}
sysUser = this.sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername,username).eq(SysUser::getPhone,phone));
if (sysUser == null) {
result.setMessage("当前登录用户和绑定的手机号不匹配,无法修改密码!");
result.setMessage("当前用户和绑定的手机号不匹配,无法修改密码!");
result.setSuccess(false);
return result;
} else {

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jeecg.dingtalk.api.core.response.Response;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.dto.message.MessageDTO;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.config.TenantContext;
@ -422,6 +423,31 @@ public class ThirdAppController {
return result;
}
/**
* 根据id删除第三方配置表
* @param id
* @return
*/
@DeleteMapping(value = "/deleteThirdAppConfig")
@RequiresPermissions("system:third:config:delete")
public Result<String> deleteThirdAppConfig(@RequestParam(name="id",required=true) String id) {
Result<String> result = new Result<>();
SysThirdAppConfig config = appConfigService.getById(id);
if (null == config) {
result.error500("数据不存在");
return result;
}
try {
appConfigService.removeById(id);
result.success("解绑成功!");
} catch (Exception e) {
log.error(e.getMessage(), e);
result.error500("操作失败");
}
return result;
}
/**
* 根据租户id和第三方类型获取第三方app配置信息
*

View File

@ -171,4 +171,22 @@ public class SysAnnouncement implements Serializable {
/**租户ID*/
private java.lang.Integer tenantId;
/**
* 枚举org.jeecg.common.constant.enums.NoticeTypeEnum
* 通知类型(system:系统消息file:知识库flow:流程plan:日程计划meeting:会议)
*/
private String noticeType;
/**附件字段*/
private java.lang.String files;
/**访问次数*/
private java.lang.Integer visitsNum;
/**是否置顶0否 1是*/
private java.lang.Integer izTop;
/**是否审批0否 1是*/
private java.lang.String izApproval;
/**流程状态*/
private java.lang.String bpmStatus;
/**消息归类*/
private java.lang.String msgClassify;
}

View File

@ -0,0 +1,85 @@
package org.jeecg.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: app系统配置
* @Author: jeecg-boot
* @Date: 2021-07-07
* @Version: V1.0
*
* e3e3NcxzbUiGa53YYVXxWc8ADo5ISgQGx/gaZwERF91oAryDlivjqBv3wqRArgChupi+Y/Gg/swwGEyL0PuVFg==
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="app系统配置")
public class SysAppVersion implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**创建人*/
@Schema(description = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private String sysOrgCode;
/**标题*/
@Excel(name = "标题", width = 15)
@Schema(description = "标题")
private String appTitle;
/**logo*/
@Excel(name = "logo", width = 15)
@Schema(description = "logo")
private String appLogo;
/**首页轮播图*/
@Excel(name = "首页轮播图", width = 15)
@Schema(description = "首页轮播图")
private String carouselImgJson;
/**首页菜单图*/
@Excel(name = "首页菜单图", width = 15)
@Schema(description = "首页菜单图")
private String routeImgJson;
/**app版本*/
@Schema(description = "版本")
private String appVersion;
/**版本编码*/
@Schema(description = "版本编码")
private Integer versionNum;
/**app下载路径*/
@Schema(description = "app下载路径")
private String downloadUrl;
/**热更新路径*/
@Schema(description = "热更新路径")
private String wgtUrl;
/**更新内容*/
@Schema(description = "更新内容")
private String updateNote;
}

View File

@ -12,6 +12,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
@ -50,7 +51,7 @@ public class SysRoleIndex {
@Excel(name = "是否路由菜单", width = 15)
@Schema(description = "是否路由菜单")
@TableField(value="is_route")
private boolean route;
private Boolean route;
/**优先级*/
@Excel(name = "优先级", width = 15)
@Schema(description = "优先级")
@ -84,6 +85,12 @@ public class SysRoleIndex {
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**关联类型(ROLE:角色 USER:表示用户)*/
@Schema(description = "关联类型")
@Excel(name = "关联类型", width = 15, dicCode = "relation_type")
@Dict(dicCode = "relation_type")
private java.lang.String relationType;
public SysRoleIndex() {

View File

@ -33,9 +33,10 @@ public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
* 获取用户未读消息数量
*
* @param userId 用户id
* @param noticeType
* @return
*/
Integer getUnreadMessageCountByUserId(@Param("userId") String userId, @Param("beginDate") Date beginDate);
Integer getUnreadMessageCountByUserId(@Param("userId") String userId, @Param("beginDate") Date beginDate, @Param("noticeType") String noticeType);
/**
* 分页查询全部消息列表
@ -44,9 +45,10 @@ public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
* @param fromUser
* @param beginDate
* @param endDate
* @param noticeType
* @return
*/
List<SysAnnouncement> queryAllMessageList(Page<SysAnnouncement> page, @Param("userId")String userId, @Param("fromUser")String fromUser, @Param("starFlag")String starFlag, @Param("busType")String busType, @Param("beginDate")Date beginDate, @Param("endDate")Date endDate);
List<SysAnnouncement> queryAllMessageList(Page<SysAnnouncement> page, @Param("userId")String userId, @Param("fromUser")String fromUser, @Param("starFlag")String starFlag, @Param("busType")String busType, @Param("msgCategory")String msgCategory, @Param("beginDate")Date beginDate, @Param("endDate")Date endDate, @Param("noticeType") String noticeType);
/**
* 查询用户未阅读的通知公告

View File

@ -25,6 +25,9 @@
<result column="bus_id" property="busId" jdbcType="VARCHAR"/>
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
<result column="files" property="files" jdbcType="VARCHAR"/>
<result column="visits_num" property="visitsNum" jdbcType="INTEGER"/>
<result column="iz_top" property="izTop" jdbcType="INTEGER"/>
<result column="read_flag" property="readFlag" jdbcType="INTEGER"/>
<result column="star_flag" property="starFlag" jdbcType="VARCHAR"/>
@ -51,6 +54,9 @@
select count(1) from sys_announcement_send sas
right join sys_announcement sa on sas.annt_id = sa.id and sa.send_status = '1'
where sas.user_id = #{userId} and sas.read_flag = 0 and sas.create_time &gt;= #{beginDate}
<if test="noticeType != null and noticeType != ''">
and sa.notice_type = #{noticeType}
</if>
</select>
<!-- 查询消息记录 -->
@ -71,7 +77,10 @@
a.open_page,
a.msg_abstract,
a.dt_task_id,
b.read_flag,
a.files,
a.visits_num,
a.iz_top,
b.read_flag,
b.star_flag,
b.id as send_id
from sys_announcement a
@ -94,8 +103,14 @@
</if>
<if test="busType!=null and busType!=''">
and a.bus_type = #{busType}
</if>
<if test="noticeType!=null and noticeType!=''">
and a.notice_type = #{noticeType}
</if>
order by b.read_flag ASC, a.create_time DESC
<if test="msgCategory!=null and msgCategory!=''">
and a.msg_category = #{msgCategory}
</if>
order by a.iz_top DESC, b.read_flag ASC, a.create_time DESC
</select>
<!-- 查询用户未阅读的通知公告 -->

View File

@ -16,6 +16,9 @@
<result column="bus_type" property="busType" jdbcType="VARCHAR"/>
<result column="open_type" property="openType" jdbcType="VARCHAR"/>
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
<result column="files" property="files" jdbcType="VARCHAR"/>
<result column="visits_num" property="visitsNum" jdbcType="INTEGER"/>
<result column="iz_top" property="izTop" jdbcType="INTEGER"/>
</resultMap>
<select id="getMyAnnouncementSendList" parameterType="Object" resultMap="AnnouncementSendModel">
@ -34,7 +37,10 @@
sa.bus_type as bus_type,
sa.open_type as open_type,
sa.open_page as open_page,
sa.msg_abstract
sa.msg_abstract,
sa.files,
sa.visits_num,
sa.iz_top
from sys_announcement_send sas
left join sys_announcement sa ON sas.annt_id = sa.id
where sa.send_status = '1'
@ -62,7 +68,7 @@
and announcementSendModel.sendTimeEnd != '' and announcementSendModel.sendTimeEnd != ''">
and sa.send_time between #{announcementSendModel.sendTimeBegin} and #{announcementSendModel.sendTimeEnd}
</if>
order by sas.read_flag,sa.send_time desc
order by sa.iz_top DESC, sas.read_flag,sa.send_time desc
</select>

View File

@ -83,4 +83,16 @@ public class AnnouncementSendModel implements Serializable {
* 发布结束日期
*/
private java.lang.String sendTimeEnd;
/**
* 附件
*/
private java.lang.String files;
/**
* 访问量
*/
private java.lang.Integer visitsNum;
/**
* 是否置顶0否 1是
*/
private java.lang.Integer izTop;
}

View File

@ -1,6 +1,5 @@
package org.jeecg.modules.system.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.system.entity.SysAnnouncement;
@ -48,10 +47,11 @@ public interface ISysAnnouncementService extends IService<SysAnnouncement> {
/**
* 获取用户未读消息数量
*
* @param userId 用户id
* @param userId 用户id
* @param noticeType 通知类型
* @return
*/
public Integer getUnreadMessageCountByUserId(String userId, Date beginDate);
public Integer getUnreadMessageCountByUserId(String userId, Date beginDate, String noticeType);
/**
@ -72,7 +72,7 @@ public interface ISysAnnouncementService extends IService<SysAnnouncement> {
/**
* 分页查询当前登录用户的消息 并且标记哪些是未读消息
*/
List<SysAnnouncement> querySysMessageList(int pageSize, int pageNo, String fromUser, String starFlag, String busType, Date beginDate, Date endDate);
List<SysAnnouncement> querySysMessageList(int pageSize, int pageNo, String fromUser, String starFlag, String busType, String msgCategory, Date beginDate, Date endDate, String noticeType);
/**
* 修改为已读消息
@ -91,4 +91,11 @@ public interface ISysAnnouncementService extends IService<SysAnnouncement> {
* @return
*/
public List<String> getNotSendedAnnouncementlist(String userId);
/**
* 添加访问次数
* @param id
* @param count
*/
void updateVisitsNum(String id, int count);
}

View File

@ -40,4 +40,9 @@ public interface ISysRoleIndexService extends IService<SysRoleIndex> {
*/
void cleanDefaultIndexCache();
/**
* 切换默认门户
* @param sysRoleIndex
*/
void changeDefHome(SysRoleIndex sysRoleIndex);
}

View File

@ -8,7 +8,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateRangeUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.system.entity.SysAnnouncement;
@ -149,8 +148,8 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
}
@Override
public Integer getUnreadMessageCountByUserId(String userId, Date beginDate) {
return sysAnnouncementMapper.getUnreadMessageCountByUserId(userId, beginDate);
public Integer getUnreadMessageCountByUserId(String userId, Date beginDate, String noticeType) {
return sysAnnouncementMapper.getUnreadMessageCountByUserId(userId, beginDate, noticeType);
}
@Override
@ -199,7 +198,7 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
}
@Override
public List<SysAnnouncement> querySysMessageList(int pageSize, int pageNo, String fromUser, String starFlag, String busType, Date beginDate, Date endDate) {
public List<SysAnnouncement> querySysMessageList(int pageSize, int pageNo, String fromUser, String starFlag, String busType, String msgCategory, Date beginDate, Date endDate, String noticeType) {
// //1. 补全send表的数据
// completeNoteThreadPool.execute(()->{
// completeAnnouncementSendInfo();
@ -208,7 +207,7 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
log.info(" 获取登录人 LoginUser id: {}", sysUser.getId());
Page<SysAnnouncement> page = new Page<SysAnnouncement>(pageNo,pageSize);
List<SysAnnouncement> list = baseMapper.queryAllMessageList(page, sysUser.getId(), fromUser, starFlag, busType, beginDate, endDate);
List<SysAnnouncement> list = baseMapper.queryAllMessageList(page, sysUser.getId(), fromUser, starFlag, busType, msgCategory,beginDate, endDate, noticeType);
return list;
}
@ -235,4 +234,21 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
return sysAnnouncementMapper.getNotSendedAnnouncementlist(new Date(), userId);
}
/**
* 更新访问量
* @param id
* @param increaseCount
*/
@Override
public void updateVisitsNum(String id, int increaseCount) {
SysAnnouncement sysAnnouncement = sysAnnouncementMapper.selectById(id);
if (oConvertUtils.isNotEmpty(sysAnnouncement)) {
int visits = oConvertUtils.getInt(sysAnnouncement.getVisitsNum(), 0);
int totalValue = increaseCount + visits;
sysAnnouncement.setVisitsNum(totalValue);
sysAnnouncementMapper.updateById(sysAnnouncement);
log.info("通知公告:{} 访问次数+1总访问数量{}", sysAnnouncement.getTitile(), sysAnnouncement.getVisitsNum());
}
}
}

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.system.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@ -10,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner;
import com.jeecg.dingtalk.api.core.response.Response;
import freemarker.core.TemplateClassResolver;
import freemarker.template.Configuration;
import freemarker.template.Template;
@ -23,20 +25,17 @@ import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.aspect.UrlMatchEnum;
import org.jeecg.common.constant.*;
import org.jeecg.common.constant.enums.EmailTemplateEnum;
import org.jeecg.common.constant.enums.MessageTypeEnum;
import org.jeecg.common.constant.enums.SysAnnmentTypeEnum;
import org.jeecg.common.constant.enums.*;
import org.jeecg.common.desensitization.util.SensitiveInfoUtil;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.query.QueryCondition;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.*;
import org.jeecg.common.util.HTMLUtils;
import org.jeecg.common.util.YouBianCodeUtil;
import org.jeecg.common.util.*;
import org.jeecg.common.util.dynamic.db.FreemarkerParseFactory;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler;
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
import org.jeecg.modules.message.entity.SysMessageTemplate;
@ -137,6 +136,9 @@ public class SysBaseApiImpl implements ISysBaseAPI {
@Autowired
private IDictTableWhiteListHandler dictTableWhiteListHandler;
@Autowired
private ISysAnnouncementService sysAnnouncementService;
@Override
//@SensitiveDecode
public LoginUser getUserByName(String username) {
@ -420,7 +422,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
message.getToUser(),
message.getTitle(),
message.getContent(),
message.getCategory());
message.getCategory(),
message.getNoticeType());
try {
// 同步发送第三方APP消息
wechatEnterpriseService.sendMessage(message, true);
@ -488,7 +491,10 @@ public class SysBaseApiImpl implements ISysBaseAPI {
announcement.setSendTime(new Date());
announcement.setMsgCategory(CommonConstant.MSG_CATEGORY_2);
announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
sysAnnouncementMapper.insert(announcement);
//update-begin-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
announcement.setIzTop(CommonConstant.IZ_TOP_0);
//update-end-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
sysAnnouncementMapper.insert(announcement);
// 2.插入用户通告阅读标记表记录
String userId = toUser;
String[] userIds = userId.split(",");
@ -558,7 +564,9 @@ public class SysBaseApiImpl implements ISysBaseAPI {
announcement.setMsgType(CommonConstant.MSG_TYPE_UESR);
announcement.setSendStatus(CommonConstant.HAS_SEND);
announcement.setSendTime(new Date());
//update-begin-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
announcement.setIzTop(CommonConstant.IZ_TOP_0);
//update-end-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
if(tmplateParam!=null && oConvertUtils.isNotEmpty(tmplateParam.get(CommonSendStatus.MSG_ABSTRACT_JSON))){
announcement.setMsgAbstract(tmplateParam.get(CommonSendStatus.MSG_ABSTRACT_JSON));
}
@ -1285,14 +1293,16 @@ public class SysBaseApiImpl implements ISysBaseAPI {
}
/**
* 发消息
* @param fromUser
* @param toUser
* @param title
* @param msgContent
* @param setMsgCategory
*/
private void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory) {
* 发消息
*
* @param fromUser
* @param toUser
* @param title
* @param msgContent
* @param setMsgCategory
* @param noticeType
*/
private void sendSysAnnouncement(String fromUser, String toUser, String title, String msgContent, String setMsgCategory, String noticeType) {
SysAnnouncement announcement = new SysAnnouncement();
announcement.setTitile(title);
announcement.setMsgContent(msgContent);
@ -1303,6 +1313,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
announcement.setSendTime(new Date());
announcement.setMsgCategory(setMsgCategory);
announcement.setDelFlag(String.valueOf(CommonConstant.DEL_FLAG_0));
//update-begin-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
announcement.setIzTop(CommonConstant.IZ_TOP_0);
//update-end-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
if(oConvertUtils.isEmpty(noticeType)){
noticeType = NoticeTypeEnum.NOTICE_TYPE_SYSTEM.getValue();
}
announcement.setNoticeType(noticeType);
sysAnnouncementMapper.insert(announcement);
// 2.插入用户通告阅读标记表记录
String userId = toUser;
@ -1324,6 +1341,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
obj.put(WebsocketConst.MSG_ID, announcement.getId());
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
obj.put(CommonConstant.NOTICE_TYPE, noticeType);
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
}
}
@ -1355,6 +1373,10 @@ public class SysBaseApiImpl implements ISysBaseAPI {
announcement.setBusType(busType);
announcement.setOpenType(SysAnnmentTypeEnum.getByType(busType).getOpenType());
announcement.setOpenPage(SysAnnmentTypeEnum.getByType(busType).getOpenPage());
announcement.setNoticeType(NoticeTypeEnum.NOTICE_TYPE_FLOW.getValue());
//update-begin-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
announcement.setIzTop(CommonConstant.IZ_TOP_0);
//update-end-author:liusq---date:2025-07-01--for: [QQYUN-12999]系统通知系统通知时间更新但是排到下面了
sysAnnouncementMapper.insert(announcement);
// 2.插入用户通告阅读标记表记录
String userId = toUser;
@ -1376,6 +1398,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
obj.put(WebsocketConst.MSG_ID, announcement.getId());
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
obj.put(CommonConstant.NOTICE_TYPE, NoticeTypeEnum.NOTICE_TYPE_FLOW.getValue());
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
}
}
@ -1392,7 +1415,23 @@ public class SysBaseApiImpl implements ISysBaseAPI {
EmailSendMsgHandle emailHandle=new EmailSendMsgHandle();
emailHandle.sendMsg(email, title, content);
}
/**
* 发送短信消息
* @param phone 手机号
* @param param 模版参数
* @param dySmsEnum 短信模版
*/
@Override
public void sendSmsMsg(String phone, JSONObject param,DySmsEnum dySmsEnum) {
try {
log.info(" 发送短信消息 phone = {}", phone);
log.info(" 发送短信消息 param = {}", param);
DySmsHelper.sendSms(phone, param,dySmsEnum);
} catch (ClientException e) {
e.printStackTrace();
}
}
/**
* 发送html模版邮件消息
* @param email
@ -1842,4 +1881,56 @@ public class SysBaseApiImpl implements ISysBaseAPI {
}
}
/**
* 自动发布流程
* @param dataId
* @param currentUserName
*/
@Override
public void announcementAutoRelease(String dataId, String currentUserName) {
//根据ID查询通知公告
SysAnnouncement sysAnnouncement = sysAnnouncementService.getById(dataId);
//流程通过后自动发布通告
sysAnnouncement.setSendStatus(CommonSendStatus.PUBLISHED_STATUS_1);
sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setSender(currentUserName);
boolean ok = sysAnnouncementService.updateById(sysAnnouncement);
//推送通知消息
if(ok) {
if(sysAnnouncement.getMsgType().equals(CommonConstant.MSG_TYPE_ALL)) {
// 补全公告和用户之前的关系
sysAnnouncementService.batchInsertSysAnnouncementSend(sysAnnouncement.getId(), sysAnnouncement.getTenantId());
// 推送websocket通知
JSONObject obj = new JSONObject();
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
webSocket.sendMessage(obj.toJSONString());
}else {
// 2.插入用户通告阅读标记表记录
String userId = sysAnnouncement.getUserIds();
String[] userIds = userId.substring(0, (userId.length()-1)).split(",");
JSONObject obj = new JSONObject();
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
webSocket.sendMessage(userIds, obj.toJSONString());
}
try {
// 同步企业微信钉钉的消息通知
Response<String> dtResponse = dingtalkService.sendActionCardMessage(sysAnnouncement, null, true);
wechatEnterpriseService.sendTextCardMessage(sysAnnouncement, true);
if (dtResponse != null && dtResponse.isSuccess()) {
String taskId = dtResponse.getResult();
sysAnnouncement.setDtTaskId(taskId);
sysAnnouncementService.updateById(sysAnnouncement);
}
} catch (Exception e) {
log.error("同步发送第三方APP消息失败", e);
}
}
}
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.system.constant.DefIndexConst;
import org.jeecg.modules.system.entity.SysRoleIndex;
import org.jeecg.modules.system.mapper.SysRoleIndexMapper;
@ -11,7 +12,9 @@ import org.jeecg.modules.system.service.ISysRoleIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* @Description: 角色首页配置
* @Author: jeecg-boot
@ -53,6 +56,7 @@ public class SysRoleIndexServiceImpl extends ServiceImpl<SysRoleIndexMapper, Sys
entity.setUrl(url);
entity.setComponent(component);
entity.setRoute(isRoute);
entity.setRelationType(CommonConstant.HOME_RELATION_ROLE);
success = super.updateById(entity);
}
// 4. 清理缓存
@ -80,6 +84,7 @@ public class SysRoleIndexServiceImpl extends ServiceImpl<SysRoleIndexMapper, Sys
entity.setComponent(indexComponent);
entity.setRoute(isRoute);
entity.setStatus(CommonConstant.STATUS_1);
entity.setRelationType(CommonConstant.HOME_RELATION_ROLE);
return entity;
}
@ -88,4 +93,61 @@ public class SysRoleIndexServiceImpl extends ServiceImpl<SysRoleIndexMapper, Sys
redisUtil.del(DefIndexConst.CACHE_KEY + "::" + DefIndexConst.DEF_INDEX_ALL);
}
/**
* 切换默认门户
* @param sysRoleIndex
*/
@Override
public void changeDefHome(SysRoleIndex sysRoleIndex) {
// 1. 先查询出配置信息
String username = sysRoleIndex.getRoleCode();
//当前状态(1:工作台/门户 0菜单默认)
String status = sysRoleIndex.getStatus();
LambdaQueryWrapper<SysRoleIndex> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysRoleIndex::getRoleCode, username);
queryWrapper.eq(SysRoleIndex::getRelationType,CommonConstant.HOME_RELATION_USER);
queryWrapper.orderByAsc(SysRoleIndex::getPriority);
List<SysRoleIndex> list = super.list(queryWrapper);
boolean success = false;
if(CommonConstant.STATUS_1.equalsIgnoreCase(status)){
// 2. 如果存在则编辑
if (!CollectionUtils.isEmpty(list)) {
sysRoleIndex.setId(list.get(0).getId());
sysRoleIndex.setStatus(CommonConstant.STATUS_1);
sysRoleIndex.setRoute(true);
success = super.updateById(sysRoleIndex);
} else {
// 3. 如果不存在则新增
sysRoleIndex.setRelationType(CommonConstant.HOME_RELATION_USER);
sysRoleIndex.setStatus(CommonConstant.STATUS_1);
sysRoleIndex.setRoute(true);
success = super.save(sysRoleIndex);
}
}else {
// 0菜单默认则是菜单默认首页
if (!CollectionUtils.isEmpty(list)) {
//将用户级别的首页配置状态设置成0
for (int i = 0; i < list.size(); i++) {
SysRoleIndex roleIndex = list.get(i);
roleIndex.setStatus(CommonConstant.STATUS_0);
success = super.updateById(roleIndex);
}
}
}
// 4. 清理缓存
if (success) {
this.cleanDefaultIndexCache();
redisUtil.del(DefIndexConst.CACHE_TYPE + username);
}
// 5. 缓存类型
//当前地址
String url = sysRoleIndex.getUrl();
//首页类型(默认首页)
String type = DefIndexConst.HOME_TYPE_MENU;
if(oConvertUtils.isNotEmpty(url) && CommonConstant.STATUS_1.equalsIgnoreCase(status)){
type = url.contains(DefIndexConst.HOME_TYPE_SYSTEM) ? DefIndexConst.HOME_TYPE_SYSTEM : DefIndexConst.HOME_TYPE_PERSONAL;
}
redisUtil.set(DefIndexConst.CACHE_TYPE + username,type);
}
}

View File

@ -353,23 +353,49 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
*/
@Override
public SysRoleIndex getDynamicIndexByUserRole(String username, String version) {
List<String> roles = sysUserRoleMapper.getRoleByUserName(username);
String componentUrl = RoleIndexConfigEnum.getIndexByRoles(roles);
SysRoleIndex roleIndex = new SysRoleIndex(componentUrl);
boolean isV3 = CommonConstant.VERSION_V3.equals(version);
SysRoleIndex roleIndex = new SysRoleIndex();
//只有 X-Version=v3 的时候才读取sys_role_index表获取角色首页配置
if (isV3 && CollectionUtils.isNotEmpty(roles)) {
LambdaQueryWrapper<SysRoleIndex> routeIndexQuery = new LambdaQueryWrapper<>();
//用户所有角色
routeIndexQuery.in(SysRoleIndex::getRoleCode, roles);
//角色首页状态0未开启 1开启
routeIndexQuery.eq(SysRoleIndex::getStatus, CommonConstant.STATUS_1);
//优先级正序排序
routeIndexQuery.orderByAsc(SysRoleIndex::getPriority);
List<SysRoleIndex> list = sysRoleIndexService.list(routeIndexQuery);
if (CollectionUtils.isNotEmpty(list)) {
roleIndex = list.get(0);
boolean isV3 = CommonConstant.VERSION_V3.equals(version);
if (isV3) {
//update-begin-author:liusq---date:2025-07-01--for: [QQYUN-12980] 首页配置首页自定义配置功能页面
//1.先查询 用户USER级别 的所有首页配置
if(oConvertUtils.isNotEmpty(username)){
LambdaQueryWrapper<SysRoleIndex> routeIndexUserQuery = new LambdaQueryWrapper<>();
//角色首页状态0未开启 1开启
routeIndexUserQuery.eq(SysRoleIndex::getStatus, CommonConstant.STATUS_1);
routeIndexUserQuery.eq(SysRoleIndex::getRelationType, CommonConstant.HOME_RELATION_USER);
routeIndexUserQuery.eq(SysRoleIndex::getRoleCode, username);
//优先级正序排序
routeIndexUserQuery.orderByAsc(SysRoleIndex::getPriority);
List<SysRoleIndex> list = sysRoleIndexService.list(routeIndexUserQuery);
if (CollectionUtils.isNotEmpty(list)) {
roleIndex = list.get(0);
}else{
//2.用户没有配置再查询 角色ROLE级别 的所有首页配置
LambdaQueryWrapper<SysRoleIndex> routeIndexQuery = new LambdaQueryWrapper<>();
//角色首页状态0未开启 1开启
routeIndexQuery.eq(SysRoleIndex::getStatus, CommonConstant.STATUS_1);
//角色所有首页配置
routeIndexQuery.eq(SysRoleIndex::getRelationType, CommonConstant.HOME_RELATION_ROLE);
//当前用户角色
List<String> roles = sysUserRoleMapper.getRoleByUserName(username);
String componentUrl = RoleIndexConfigEnum.getIndexByRoles(roles);
roleIndex = new SysRoleIndex(componentUrl);
//用户所有角色
//update-begin-author:liusq---date:2025-07-21--for: [QQYUN-13187]新用户登录报错没有添加角色时 报错
if(CollectionUtil.isNotEmpty(roles)){
routeIndexQuery.in(SysRoleIndex::getRoleCode, roles);
}
//update-end-author:liusq---date:2025-07-21--for: [QQYUN-13187]新用户登录报错没有添加角色时 报错
//优先级正序排序
routeIndexQuery.orderByAsc(SysRoleIndex::getPriority);
list = sysRoleIndexService.list(routeIndexQuery);
if (CollectionUtils.isNotEmpty(list)) {
roleIndex = list.get(0);
}
}
}
//update-end-author:liusq---date:2025-07-01--for: [QQYUN-12980] 首页配置首页自定义配置功能页面
}
if (oConvertUtils.isEmpty(roleIndex.getComponent())) {

View File

@ -134,6 +134,11 @@
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
<#-- ** 高级查询生成(Vue3 * -->
<#function superQueryFieldListForVue3(po,order)>
<#-- 高级查询日期格式化 -->
<#assign picker=''>
<#if po.extendParams?exists && po.extendParams.picker?exists>
<#assign picker='fieldExtendJson:"{\\"picker\\":\\"${po.extendParams.picker}\\"}",'>
</#if>
<#-- 字段展示/DB类型 -->
<#assign baseAttrs="view: '${po.classType}', type: 'string',">
<#if po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
@ -189,7 +194,7 @@
<#assign extAttrs="code: '${po.dictTable?default('')}', orgFields: '${orgField}', destFields: '${po.fieldName}', popupMulti: false,">
</#if>
<#return "${po.fieldName}: {title: '${po.filedComment}',order: ${order},${baseAttrs}${extAttrs}}" >
<#return "${po.fieldName}: {title: '${po.filedComment}',order: ${order},${baseAttrs}${extAttrs}${picker}}" >
</#function>
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->

View File

@ -117,6 +117,8 @@
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'${entityPackage}:${tableName}:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'${entityPackage}:${tableName}:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'${entityPackage}:${tableName}:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<#if buttonList?size gt 0>
<#list buttonList?sort_by('orderNum') as btn>
<#if btn.buttonStyle == 'button'>

View File

@ -126,6 +126,9 @@
<#if data.sendTime??>
<span class="rich_media_meta text">${data.sendTime?string('yyyy年MM月dd日')}</span>
</#if>
<#if data.visitsNum??>
<span class="rich_media_meta text">访问量:${data.visitsNum}</span>
</#if>
</div>
</div>
<div id="content"></div>
@ -154,6 +157,15 @@
iframe.src = iframe.getAttribute('src');
});
//update-end-author:liusq---date:2023-10-30--for: QQYUN-6802查看公告详情此段端渲染有问题
// 监听父窗口发来的消息
window.addEventListener('message', (event) => {
// 1. 验证消息结构
let { type,printSessionId } = event.data
if(type == "action:print" && printSessionId ){
window.print();
}
});
</script>
</body>
</html>

View File

@ -15,7 +15,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* 单体启动类
* 单体启动类采用此类启动为单体模式
*/
@Slf4j
@SpringBootApplication

View File

@ -50,7 +50,8 @@ spring:
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: embedded
jdbc:
initialize-schema: embedded
#定时任务启动开关true-开 false-关
auto-startup: true
#延迟1秒启动定时任务

View File

@ -22,13 +22,12 @@ management:
endpoints:
web:
exposure:
include: metrics,httptrace-new
include: metrics,jeecghttptrace
spring:
flyway:
# 是否启用flyway
enabled: false
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
clean-disabled: true
servlet:
multipart:
@ -44,7 +43,8 @@ spring:
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: never
jdbc:
initialize-schema: never
#定时任务启动开关true-开 false-关
auto-startup: true
#延迟1秒启动定时任务
@ -152,8 +152,8 @@ mybatis-plus:
# 默认数据库表下划线命名
table-underline: true
configuration:
# 这个配置会将执行的sql打印出来在开发或测试的时候可以用
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# # 这个配置会将执行的sql打印出来在开发或测试的时候可以用
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true
#jeecg专用配置

View File

@ -22,7 +22,7 @@ management:
endpoints:
web:
exposure:
include: metrics,httptrace-new
include: metrics,jeecghttptrace
spring:
flyway:
@ -44,7 +44,8 @@ spring:
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: never
jdbc:
initialize-schema: never
#定时任务启动开关true-开 false-关
auto-startup: true
#延迟1秒启动定时任务

View File

@ -45,7 +45,8 @@ spring:
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: embedded
jdbc:
initialize-schema: embedded
#定时任务开关true-开 false-关
auto-startup: true
#延迟1秒启动定时任务

View File

@ -49,7 +49,8 @@ spring:
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: embedded
jdbc:
initialize-schema: embedded
#定时任务启动开关true-开 false-关
auto-startup: true
#延迟1秒启动定时任务

View File

@ -0,0 +1,87 @@
-- 租户初始套餐添加时 提示违反唯一约束
ALTER TABLE sys_tenant_pack
ADD INDEX idx__stp_tenant_id_pack_code(tenant_id, pack_code) USING BTREE;
-- 添加通知消息大分类
ALTER TABLE sys_announcement
ADD COLUMN notice_type varchar(10) NULL COMMENT '通知类型(system:系统消息file:知识库flow:流程plan:日程计划meeting:会议)' AFTER tenant_id;
-- 更新通知消息字段旧数据默认为系统消息
update sys_announcement set notice_type = 'flow' where bus_type in('bpm','bpm_cc','bpm_task');
update sys_announcement set notice_type = 'system' where bus_type ='email';
update sys_announcement set notice_type = 'system' where notice_type is null;
-- 系统公告新增字段修改
ALTER TABLE `sys_announcement`
ADD COLUMN `files` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '附件' AFTER `tenant_id`,
ADD COLUMN `visits_num` int(11) NULL DEFAULT NULL COMMENT '访问次数' AFTER `files`,
ADD COLUMN `iz_top` int(10) NULL DEFAULT NULL COMMENT '是否置顶0:; 1:' AFTER `visits_num`,
ADD COLUMN `iz_approval` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否审批0否 1是' AFTER `iz_top`,
ADD COLUMN `bpm_status` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程状态' AFTER `iz_approval`,
ADD COLUMN `msg_classify` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息归类' AFTER `bpm_status`;
-- 系统公告--新增字典
INSERT INTO `sys_dict`(`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `tenant_id`, `low_app_id`) VALUES ('1934846825077878786', '公告分类', 'notice_type', NULL, 0, 'admin', '2025-06-17 13:33:25', NULL, NULL, 0, 0, NULL);
INSERT INTO `sys_dict`(`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `tenant_id`, `low_app_id`) VALUES ('1937393911539384322', '模版分类', 'msgCategory', NULL, 0, 'admin', '2025-06-24 14:14:38', NULL, NULL, 0, 0, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934846897383485441', '1934846825077878786', '发布性通知', '1', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:33:43', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934846933030875138', '1934846825077878786', '转发性通知', '2', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:33:51', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934846963749957633', '1934846825077878786', '指示性通知', '3', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:33:59', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934846993449824257', '1934846825077878786', '任免性通知', '4', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:34:06', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934847047262744577', '1934846825077878786', '事务性周知通知', '5', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:34:18', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934847082905939969', '1934846825077878786', '会议通知', '6', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:34:27', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1934847117039185921', '1934846825077878786', '其他通知', '7', NULL, NULL, 1, 1, 'admin', '2025-06-17 13:34:35', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1937394006326460418', '1937393911539384322', '通知公告', 'notice', NULL, NULL, 1, 1, 'admin', '2025-06-24 14:15:01', NULL, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1937394038412886018', '1937393911539384322', '其他', 'other', NULL, NULL, 1, 1, 'admin', '2025-06-24 14:15:08', NULL, NULL);
-- 消息模版增加 模版分类 字段
ALTER TABLE `sys_sms_template`
ADD COLUMN `template_category` varchar(10) NULL COMMENT '模版分类notice通知公告 other其他' AFTER `template_type`;
-- 修改表iz_top的默认值
ALTER TABLE `sys_announcement`
MODIFY COLUMN `iz_top` int(10) NULL DEFAULT 0 COMMENT '是否置顶0:; 1:' AFTER `visits_num`;
-- 补充旧数据iz_top的默认值
UPDATE sys_announcement SET iz_top = 0 WHERE iz_top IS NULL OR iz_top = '';
-- 新增首页配置菜单
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1939572818833301506', 'd7d6e2e4e2934f2c9385a623fd98c6f3', '首页配置', '/system/homeConfig', 'system/homeConfig/index', 1, '', NULL, 1, NULL, '0', 1.00, 0, 'ant-design:appstore-outlined', 1, 0, 0, 0, NULL, 'admin', '2025-06-30 14:32:50', 'admin', '2025-07-01 20:13:22', 0, 0, NULL, 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1941349550087168001', '1939572818833301506', '首页配置-批量删除', NULL, NULL, 0, NULL, NULL, 2, 'system:roleindex:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-05 12:12:56', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1941349462887587842', '1939572818833301506', '首页配置-删除', NULL, NULL, 0, NULL, NULL, 2, 'system:roleindex:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-05 12:12:35', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1941349335431077889', '1939572818833301506', '首页配置-编辑', NULL, NULL, 0, NULL, NULL, 2, 'system:roleindex:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-05 12:12:05', NULL, NULL, 0, 0, '1', 0);
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1941349246536998913', '1939572818833301506', '首页配置-添加', NULL, NULL, 0, NULL, NULL, 2, 'system:roleindex:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-05 12:11:44', NULL, NULL, 0, 0, '1', 0);
-- 首页字典
INSERT INTO `sys_dict`(`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `tenant_id`, `low_app_id`) VALUES ('1939572486447292418', '首页关联', 'relation_type', NULL, 0, 'admin', '2025-06-30 14:31:31', NULL, NULL, 0, 0, NULL);
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1939572554533429250', '1939572486447292418', '角色', 'ROLE', NULL, NULL, 1, 1, 'admin', '2025-06-30 14:31:47', 'admin', '2025-06-30 15:04:18');
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `item_color`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1939572602289774594', '1939572486447292418', '用户', 'USER', NULL, NULL, 2, 1, 'admin', '2025-06-30 14:31:59', 'admin', '2025-06-30 15:04:21');
-- 角色首页表新增 relation_type 字段
ALTER TABLE `sys_role_index`
ADD COLUMN `relation_type` varchar(20) NULL COMMENT '关联关系(ROLE:角色 USER:用户)' AFTER `sys_org_code`;
-- 首页角色补充默认值
UPDATE sys_role_index SET relation_type = 'ROLE' WHERE relation_type IS NULL OR relation_type = '';
-- app3支持版本管理
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1930152938891608066', '1455100420297859074', 'APP版本管理', '/app/version', 'system/appVersion/SysAppVersion', 1, '', NULL, 1, NULL, '0', 1.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-06-04 14:41:36', 'admin', '2025-07-03 10:09:46', 0, 0, NULL, 0);
-- 首页配置菜单
UPDATE `sys_permission` SET `is_leaf` = 0 WHERE `id` = '1939572818833301506';
-- APP版本管理配置菜单
UPDATE `sys_permission` SET `is_leaf` = 0 WHERE `id` = '1930152938891608066';
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `hide_tab`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1942160438629109761', '1930152938891608066', 'APP版本编辑', NULL, NULL, 0, NULL, NULL, 2, 'app:edit:version', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-07 17:55:07', NULL, NULL, 0, 0, '1', 0);
-- 删除第三方配置添加权限
INSERT INTO sys_permission (id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) VALUES ('1947833384695164929', '1629109281748291586', '第三方配置删除', NULL, NULL, 0, NULL, NULL, 2, 'system:third:config:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-23 09:37:23', NULL, NULL, 0, 0, '1', 0);
-- 人员代理表添加process_ids字段
ALTER TABLE `sys_user_agent`
ADD COLUMN `process_ids` varchar(255) NULL COMMENT '代理流程ID' AFTER `end_time`;

View File

@ -73,7 +73,7 @@
<shiro-redis.version>3.2.3</shiro-redis.version>
<java-jwt.version>4.5.0</java-jwt.version>
<codegenerate.version>1.4.9</codegenerate.version>
<autopoi-web.version>1.4.11</autopoi-web.version>
<autopoi-web.version>1.4.13</autopoi-web.version>
<minio.version>8.0.3</minio.version>
<justauth-spring-boot-starter.version>1.4.0</justauth-spring-boot-starter.version>
<dom4j.version>1.6.1</dom4j.version>