This commit is contained in:
jack ning
2025-05-13 12:17:10 +08:00
parent 4a117ef04f
commit 6f7f593fdf
27 changed files with 270 additions and 23 deletions

View File

@@ -104,7 +104,7 @@ services:
# bytedesk config
BYTEDESK_DEBUG: true
BYTEDESK_EDITION: ENTERPRISE
BYTEDESK_VERSION: 0.7.7
BYTEDESK_VERSION: 0.7.8
BYTEDESK_APPKEY: ZjoyMDI1LTA2LTExOkNPTU1VTklUWTo6
# enable custom config: name, logo, description
BYTEDESK_CUSTOM_ENABLED: false

View File

@@ -84,7 +84,7 @@ services:
# bytedesk config
BYTEDESK_DEBUG: true
BYTEDESK_EDITION: ENTERPRISE
BYTEDESK_VERSION: 0.7.7
BYTEDESK_VERSION: 0.7.8
BYTEDESK_APPKEY: ZjoyMDI1LTA2LTExOkNPTU1VTklUWTo6
# enable custom config: name, logo, description
BYTEDESK_CUSTOM_ENABLED: false

View File

@@ -3,7 +3,7 @@
# ===============================
bytedesk.debug=true
bytedesk.edition=COMMUNITY
bytedesk.version=0.7.7
bytedesk.version=0.7.8
# enable custom config: name, logo, description
bytedesk.custom.enabled=false

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-07-30 22:19:46
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-05-12 17:57:25
* @LastEditTime: 2025-05-13 11:55:49
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
@@ -31,6 +31,7 @@ public enum UploadTypeEnum {
CHAT, // 聊天对话
TICKET, // 工单
BPMN, // 流程图
WORKFLOW, // 工作流
ATTACHMENT; // 附件
// 根据字符串查找对应的枚举常量

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-05-11 18:14:28
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-05-13 10:48:40
* @LastEditTime: 2025-05-13 11:52:42
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.

View File

@@ -0,0 +1,51 @@
/*
* @Author: jackning 270580156@qq.com
* @Date: 2025-02-25 09:52:34
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-05-13 11:53:25
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
* contact: 270580156@qq.com
*
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.core.workflow;
import org.springframework.stereotype.Component;
import org.springframework.util.SerializationUtils;
import com.bytedesk.core.config.BytedeskEventPublisher;
import com.bytedesk.core.workflow.event.WorkflowCreateEvent;
import com.bytedesk.core.workflow.event.WorkflowUpdateEvent;
import com.bytedesk.core.utils.ApplicationContextHolder;
import jakarta.persistence.PostPersist;
import jakarta.persistence.PostUpdate;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Component
public class WorkflowEntityListener {
@PostPersist
public void onPostPersist(WorkflowEntity workflow) {
log.info("onPostPersist: {}", workflow);
WorkflowEntity cloneWorkflow = SerializationUtils.clone(workflow);
//
BytedeskEventPublisher bytedeskEventPublisher = ApplicationContextHolder.getBean(BytedeskEventPublisher.class);
bytedeskEventPublisher.publishEvent(new WorkflowCreateEvent(cloneWorkflow));
}
@PostUpdate
public void onPostUpdate(WorkflowEntity workflow) {
log.info("onPostUpdate: {}", workflow);
WorkflowEntity cloneWorkflow = SerializationUtils.clone(workflow);
//
BytedeskEventPublisher bytedeskEventPublisher = ApplicationContextHolder.getBean(BytedeskEventPublisher.class);
bytedeskEventPublisher.publishEvent(new WorkflowUpdateEvent(cloneWorkflow));
}
}

View File

@@ -0,0 +1,41 @@
/*
* @Author: jackning 270580156@qq.com
* @Date: 2025-02-25 09:44:18
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-05-13 12:14:55
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
* contact: 270580156@qq.com
*
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.core.workflow;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import com.bytedesk.core.upload.UploadEntity;
import com.bytedesk.core.upload.UploadTypeEnum;
import com.bytedesk.core.upload.event.UploadCreateEvent;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Component
@AllArgsConstructor
public class WorkflowEventListener {
// 监听上传工作流
@EventListener
public void onUploadCreateEvent(UploadCreateEvent event) {
UploadEntity upload = event.getUpload();
if (UploadTypeEnum.WORKFLOW.name().equalsIgnoreCase(upload.getType())) {
log.info("WorkflowEventListener.onUploadCreateEvent, upload: {}", upload.getFileName());
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* @Author: jackning 270580156@qq.com
* @Date: 2024-11-06 21:43:58
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-03-20 13:28:11
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
* contact: 270580156@qq.com
* 联系270580156@qq.com
* Copyright (c) 2024 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.core.workflow;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.stereotype.Component;
import lombok.AllArgsConstructor;
@Component
@AllArgsConstructor
public class WorkflowInitializer implements SmartInitializingSingleton {
// private final AuthorityRestService authorityService;
@Override
public void afterSingletonsInstantiated() {
initPermissions();
}
private void initPermissions() {
// for (PermissionEnum permission : PermissionEnum.values()) {
// String permissionValue = WorkflowPermissions.ARTICLE_PREFIX + permission.name();
// authorityService.createForPlatform(permissionValue);
// }
}
}

View File

@@ -0,0 +1,36 @@
/*
* @Author: jackning 270580156@qq.com
* @Date: 2025-02-25 09:59:29
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-02-25 10:00:34
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
* contact: 270580156@qq.com
*
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.core.workflow.event;
import org.springframework.context.ApplicationEvent;
import com.bytedesk.core.workflow.WorkflowEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class WorkflowCreateEvent extends ApplicationEvent {
private static final long serialVersionUID = 1L;
private WorkflowEntity workflow;
public WorkflowCreateEvent(WorkflowEntity workflow) {
super(workflow);
this.workflow = workflow;
}
}

View File

@@ -0,0 +1,35 @@
/*
* @Author: jackning 270580156@qq.com
* @Date: 2025-02-25 12:31:16
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-02-25 12:31:19
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
* contact: 270580156@qq.com
*
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.core.workflow.event;
import org.springframework.context.ApplicationEvent;
import com.bytedesk.core.workflow.WorkflowEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class WorkflowDeleteEvent extends ApplicationEvent {
private static final long serialVersionUID = 1L;
private WorkflowEntity workflow;
public WorkflowDeleteEvent(WorkflowEntity workflow) {
super(workflow);
this.workflow = workflow;
}
}

View File

@@ -0,0 +1,36 @@
/*
* @Author: jackning 270580156@qq.com
* @Date: 2025-02-25 09:59:29
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-02-25 10:01:00
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
* contact: 270580156@qq.com
*
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.core.workflow.event;
import org.springframework.context.ApplicationEvent;
import com.bytedesk.core.workflow.WorkflowEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class WorkflowUpdateEvent extends ApplicationEvent {
private static final long serialVersionUID = 1L;
private WorkflowEntity workflow;
public WorkflowUpdateEvent(WorkflowEntity workflow) {
super(workflow);
this.workflow = workflow;
}
}

View File

@@ -0,0 +1,8 @@
/**
* ByteDesk 标签管理包
* 提供标签的CRUD、搜索等功能
*/
@NonNullApi
package com.bytedesk.core.workflow;
import org.springframework.lang.NonNullApi;

View File

@@ -45,7 +45,7 @@ public class AutoReplyFixedEventListener {
if (resource.exists()) {
String filePath = resource.getFile().getAbsolutePath();
log.info("UploadEventListener loadAsResource: {}", filePath);
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.AUTOREPLY_FIXED.name())) {
if (UploadTypeEnum.AUTOREPLY_FIXED.name().equalsIgnoreCase(upload.getType())) {
// 导入自动回复
// 这里 需要指定读用哪个class去读然后读取第一个sheet 文件流会自动关闭
// https://easyexcel.opensource.alibaba.com/docs/current/quickstart/read

View File

@@ -45,7 +45,7 @@ public class AutoReplyKeywordEventListener {
if (resource.exists()) {
String filePath = resource.getFile().getAbsolutePath();
log.info("UploadEventListener loadAsResource: {}", filePath);
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.AUTOREPLY_KEYWORD.name())) {
if (UploadTypeEnum.AUTOREPLY_KEYWORD.name().equalsIgnoreCase(upload.getType())) {
// 导入自动回复
// 这里 需要指定读用哪个class去读然后读取第一个sheet 文件流会自动关闭
// https://easyexcel.opensource.alibaba.com/docs/current/quickstart/read

View File

@@ -46,7 +46,7 @@ public class FaqEventListener {
public void onUploadCreateEvent(UploadCreateEvent event) {
UploadEntity upload = event.getUpload();
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.FAQ.name())) {
if (UploadTypeEnum.FAQ.name().equalsIgnoreCase(upload.getType())) {
// 检查文件类型是否为Excel
String fileName = upload.getFileName();
if (!BdFileUtils.isExcelFile(fileName)) {

View File

@@ -37,7 +37,7 @@ public class FileEventListener {
public void onUploadCreateEvent(UploadCreateEvent event) throws IOException {
UploadEntity upload = event.getUpload();
// 专门存储大模型上传文件记录
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.LLM_FILE.name())) {
if (UploadTypeEnum.LLM_FILE.name().equalsIgnoreCase(upload.getType())) {
log.info("UploadEventListener LLM_FILE: {}", upload.getFileName());
//
UserProtobuf userProtobuf = UserProtobuf.fromJson(upload.getUser());

View File

@@ -41,7 +41,7 @@ public class TextEventListener {
public void onUploadCreateEvent(UploadCreateEvent event) {
UploadEntity upload = event.getUpload();
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.LLM_TEXT.name())) {
if (UploadTypeEnum.LLM_TEXT.name().equalsIgnoreCase(upload.getType())) {
// 检查文件类型是否为Excel
String fileName = upload.getFileName();
if (!BdFileUtils.isExcelFile(fileName)) {

View File

@@ -58,7 +58,7 @@ public class QuickReplyEventListener {
public void onUploadCreateEvent(UploadCreateEvent event) {
UploadEntity upload = event.getUpload();
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.QUICKREPLY.name())) {
if (UploadTypeEnum.QUICKREPLY.name().equalsIgnoreCase(upload.getType())) {
// 检查文件类型是否为Excel
String fileName = upload.getFileName();
if (!BdFileUtils.isExcelFile(fileName)) {

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2024-06-03 14:06:20
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-05-12 10:24:16
* @LastEditTime: 2025-05-13 12:15:30
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
@@ -134,7 +134,7 @@ public class MemberEventListener {
public void onUploadCreateEvent(UploadCreateEvent event) throws IOException {
UploadEntity upload = event.getUpload();
//
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.MEMBER.name())) {
if (UploadTypeEnum.MEMBER.name().equalsIgnoreCase(upload.getType())) {
// 检查文件类型是否为Excel
String fileName = upload.getFileName();
if (!BdFileUtils.isExcelFile(fileName)) {

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2025-02-18 17:06:01
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-02-18 17:51:40
* @LastEditTime: 2025-05-13 12:16:35
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
@@ -15,10 +15,10 @@ package com.bytedesk.ticket.message;
import com.bytedesk.core.base.BaseEntity;
import groovy.transform.EqualsAndHashCode;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Entity

View File

@@ -2,7 +2,7 @@
* @Author: jackning 270580156@qq.com
* @Date: 2025-01-23 14:52:45
* @LastEditors: jackning 270580156@qq.com
* @LastEditTime: 2025-04-24 16:26:30
* @LastEditTime: 2025-05-13 12:15:49
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
* Please be aware of the BSL license restrictions before installing Bytedesk IM
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
@@ -175,7 +175,7 @@ public class TicketEventListener {
public void onUploadCreateEvent(UploadCreateEvent event) {
UploadEntity upload = event.getUpload();
// 上传BPMN流程图
if (upload.getType().equalsIgnoreCase(UploadTypeEnum.BPMN.name())) {
if (UploadTypeEnum.BPMN.name().equalsIgnoreCase(upload.getType())) {
// 启动流程
// ProcessInstance processInstance =
// runtimeService.startProcessInstanceByKey(upload.getFileName());

View File

@@ -1,4 +1,4 @@
package com.bytedesk.ticket.flow;
package com.bytedesk.ticket.ticketflow;
import java.util.List;
import java.util.Map;

View File

@@ -11,7 +11,7 @@
*
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
*/
package com.bytedesk.ticket.flow;
package com.bytedesk.ticket.ticketflow;
import com.bytedesk.core.base.BaseEntity;

View File

@@ -1,4 +1,4 @@
package com.bytedesk.ticket.flow;
package com.bytedesk.ticket.ticketflow;
import java.util.Date;
import java.util.HashMap;

View File

@@ -42,7 +42,7 @@
<jackson.version>2.18.2</jackson.version>
<flowable.version>7.1.0</flowable.version>
<springdoc.version>2.8.6</springdoc.version>
<revision>0.7.7</revision>
<revision>0.7.8</revision>
</properties>
<dependencies>

View File

@@ -6,7 +6,7 @@ bytedesk.debug=true
# ENTERPRISE, // 企业版-单租户,不限人,付费,功能不限
# PLATFORM // 平台版-多租户,不限人数,付费,功能不限
bytedesk.edition=ENTERPRISE
bytedesk.version=0.7.7
bytedesk.version=0.7.8
# 授权 key
bytedesk.appkey=ZjoyMDI1LTA2LTExOkNPTU1VTklUWTo6

View File

@@ -5,7 +5,7 @@
# ===============================
spring.application.name=bytedesk
application.title=https://www.weiyuai.cn
application.version=0.7.7
application.version=0.7.8
server.port=9003
# ===============================