|
|
@@ -16,7 +16,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
- * 全渠道统一入站网关:客户消息 / 业务事件 -> 工作流实例
|
|
|
+ * 鍏ㄦ笭閬撶粺涓€鍏ョ珯缃戝叧锛氬�鎴锋秷鎭� / 涓氬姟浜嬩欢 -> 宸ヤ綔娴佸疄渚�
|
|
|
*/
|
|
|
@Service
|
|
|
public class LobsterInboundService {
|
|
|
@@ -36,18 +36,18 @@ public class LobsterInboundService {
|
|
|
private WorkflowTriggerScheduler workflowTriggerScheduler;
|
|
|
|
|
|
/**
|
|
|
- * 处理入站客户消息
|
|
|
+ * 澶勭悊鍏ョ珯瀹㈡埛娑堟伅
|
|
|
*/
|
|
|
public AjaxResult handleInboundMessage(Long companyId, Long contactId, String channelType,
|
|
|
String message, Long workflowId, Map<String, Object> extra) {
|
|
|
if (workflowExecutor == null) {
|
|
|
- return AjaxResult.error("工作流执行器不可用");
|
|
|
+ return AjaxResult.error("宸ヤ綔娴佹墽琛屽櫒涓嶅彲鐢�");
|
|
|
}
|
|
|
if (companyId == null || contactId == null) {
|
|
|
- return AjaxResult.error("companyId/contactId 不能为空");
|
|
|
+ return AjaxResult.error("companyId/contactId 涓嶈兘涓虹┖");
|
|
|
}
|
|
|
if (message == null || message.isBlank()) {
|
|
|
- return AjaxResult.error("消息内容不能为空");
|
|
|
+ return AjaxResult.error("娑堟伅鍐呭�涓嶈兘涓虹┖");
|
|
|
}
|
|
|
channelType = channelType != null ? channelType : "QW";
|
|
|
|
|
|
@@ -55,7 +55,7 @@ public class LobsterInboundService {
|
|
|
if (instance == null) {
|
|
|
Long wfId = workflowId != null ? workflowId : resolveDefaultWorkflowId(companyId, channelType);
|
|
|
if (wfId == null) {
|
|
|
- return AjaxResult.error("未找到可启动的工作流模板");
|
|
|
+ return AjaxResult.error("鏈�壘鍒板彲鍚�姩鐨勫伐浣滄祦妯℃澘");
|
|
|
}
|
|
|
Map<String, Object> init = extra != null ? new HashMap<>(extra) : new HashMap<>();
|
|
|
init.put("channelType", channelType);
|
|
|
@@ -74,7 +74,7 @@ public class LobsterInboundService {
|
|
|
}
|
|
|
|
|
|
if (instance == null) {
|
|
|
- return AjaxResult.error("无法创建或定位工作流实例");
|
|
|
+ return AjaxResult.error("鏃犳硶鍒涘缓鎴栧畾浣嶅伐浣滄祦瀹炰緥");
|
|
|
}
|
|
|
|
|
|
log.info("[Inbound] company={} contact={} channel={} instance={} msgLen={}",
|
|
|
@@ -83,14 +83,14 @@ public class LobsterInboundService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 处理业务事件(加粉/成单/打标签等)
|
|
|
+ * 澶勭悊涓氬姟浜嬩欢锛堝姞绮�/鎴愬崟/鎵撴爣绛剧瓑锛�
|
|
|
*/
|
|
|
public AjaxResult handleBusinessEvent(Long companyId, String eventType, Map<String, Object> payload) {
|
|
|
if (workflowTriggerScheduler == null) {
|
|
|
- return AjaxResult.error("事件调度器不可用");
|
|
|
+ return AjaxResult.error("浜嬩欢璋冨害鍣ㄤ笉鍙�敤");
|
|
|
}
|
|
|
workflowTriggerScheduler.fireByEvent(eventType, companyId, payload);
|
|
|
- return AjaxResult.success("事件已投递", Map.of("eventType", eventType, "companyId", companyId));
|
|
|
+ return AjaxResult.success("浜嬩欢宸叉姇閫�", Map.of("eventType", eventType, "companyId", companyId));
|
|
|
}
|
|
|
|
|
|
private LobsterWorkflowInstance findActiveInstance(Long companyId, Long contactId, Long workflowId) {
|