西格玛许 3 дней назад
Родитель
Сommit
75f331806d

+ 1 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -238,6 +238,7 @@ xss:
   # 排除链接
   excludeUrls:
     - /system/notice
+    - /miniapp/auth/edit
 
 --- # 分布式锁 lock4j 全局配置
 lock4j:

+ 1 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/MainStudentEducation.java

@@ -18,6 +18,7 @@ public class MainStudentEducation extends BaseEntity {
     private Long studentId;
     private String school;
     private String education;
+    private String educationType;
     private String startTime;
     private String endTime;
     private String major;

+ 2 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/MainStudentExperience.java

@@ -25,6 +25,8 @@ public class MainStudentExperience extends BaseEntity {
     private String department;
     private String workContent;
 
+    private Integer isHidden;
+
     private String lastSalary;
     private String checkResult;
     private String checkRemark;

+ 1 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/bo/MainStudentEducationBo.java

@@ -13,6 +13,7 @@ public class MainStudentEducationBo {
     private Long studentId;
     private String school;
     private String education;
+    private String educationType;
     private String major;
     private String startTime;
     private String endTime;

+ 6 - 2
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/bo/MainStudentExperienceBo.java

@@ -13,8 +13,12 @@ public class MainStudentExperienceBo extends BaseEntity {
     private Long id;
     private Long studentId;
     private String company;
-    private String positionName;
+    private String industry;
     private String startTime;
     private String endTime;
-    private String description;
+    private Integer isInternship;
+    private String jobTitle;
+    private String department;
+    private String workContent;
+    private Integer isHidden;
 }

+ 1 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/vo/MainStudentEducationVo.java

@@ -13,6 +13,7 @@ public class MainStudentEducationVo implements Serializable {
     private Long studentId;
     private String school;
     private String education;
+    private String educationType;
     private String startTime;
     private String endTime;
     private String major;

+ 1 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/domain/vo/MainStudentExperienceVo.java

@@ -19,4 +19,5 @@ public class MainStudentExperienceVo implements Serializable {
     private String jobTitle;
     private String department;
     private String workContent;
+    private Integer isHidden;
 }

+ 2 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/service/IMainStudentDislikeService.java

@@ -9,4 +9,6 @@ public interface IMainStudentDislikeService {
     java.util.List<Long> getDislikedPositionIds(Long studentId);
     /** 获取学员屏蔽的租户ID列表 */
     java.util.List<String> getDislikedTenantIds(Long studentId);
+    /** 取消屏蔽公司 */
+    boolean cancelDislikeCompany(Long studentId, String tenantId);
 }

+ 65 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/service/impl/CsSessionServiceImpl.java

@@ -90,6 +90,10 @@ public class CsSessionServiceImpl implements ICsSessionService {
         assignSeatAndWaiter(newSession);
 
         baseMapper.insert(newSession);
+
+        // 创建新会话时,自动插入初始欢迎消息
+        sendWelcomeMessages(newSession);
+
         return enrichSessionVo(converter.convert(newSession, CsSessionVo.class));
     }
 
@@ -187,6 +191,67 @@ public class CsSessionServiceImpl implements ICsSessionService {
         return String.format("CS%s%s", sessionType, IdUtil.getSnowflakeNextIdStr());
     }
 
+    /**
+     * 新会话创建后,根据聊天类型自动插入初始欢迎消息到 cs_message 表
+     * sourceId 格式: assessment_xxx / job_xxx / training_xxx
+     */
+    private void sendWelcomeMessages(CsSession session) {
+        Long sessionId = session.getId();
+        String sourceId = session.getSourceId();
+        LocalDateTime now = LocalDateTime.now();
+
+        // 根据 sourceId 判断聊天类型
+        if (StringUtils.isNotBlank(sourceId) && sourceId.startsWith("assessment_")) {
+            // 测评咨询:发送三条初始消息
+            insertSystemMessage(sessionId, "text",
+                "您好!我是您的专属客服,很高兴为您服务", now);
+            insertSystemMessage(sessionId, "text",
+                "您正在咨询的是测评服务,客服将为您详细介绍测评内容、流程及费用", now.plusSeconds(1));
+            insertSystemMessage(sessionId, "text",
+                "如需了解详情,请直接提问,我们会尽快回复您", now.plusSeconds(2));
+        } else if (StringUtils.isNotBlank(sourceId) && sourceId.startsWith("training_")) {
+            // 培训报名
+            insertSystemMessage(sessionId, "text",
+                "您好!我是您的专属客服,很高兴为您服务", now);
+            insertSystemMessage(sessionId, "text",
+                "您正在咨询的是培训报名服务,客服将为您介绍培训详情", now.plusSeconds(1));
+        } else if (StringUtils.isNotBlank(sourceId) && sourceId.startsWith("job_")) {
+            // 岗位咨询
+            insertSystemMessage(sessionId, "text",
+                "您好!我是您的专属客服,很高兴为您服务", now);
+            insertSystemMessage(sessionId, "text",
+                "您正在咨询的是岗位信息,客服将为您详细介绍岗位要求及薪资待遇", now.plusSeconds(1));
+        } else {
+            // 默认欢迎语
+            insertSystemMessage(sessionId, "text",
+                "您好!我是您的专属客服,请问有什么可以帮助您", now);
+        }
+
+        // 更新会话最后消息
+        CsSession update = new CsSession();
+        update.setId(sessionId);
+        update.setLastMsg("您好!我是您的专属客服");
+        update.setLastMsgTime(now);
+        baseMapper.updateById(update);
+    }
+
+    /**
+     * 插入一条系统消息
+     */
+    private void insertSystemMessage(Long sessionId, String msgType, String content, LocalDateTime sendTime) {
+        CsMessage msg = new CsMessage();
+        msg.setSessionId(sessionId);
+        msg.setMsgNo("AUTO_" + IdUtil.getSnowflakeNextIdStr());
+        msg.setSenderType(3); // 系统消息
+        msg.setMsgType(msgType);
+        msg.setContent(content);
+        msg.setStatus(1);
+        msg.setIsRead(0);
+        msg.setSendTime(sendTime);
+        msg.setCreateTime(LocalDateTime.now());
+        messageMapper.insert(msg);
+    }
+
     private void assignSeatAndWaiter(CsSession session) {
         String module = session.getSessionType() != null && session.getSessionType() == 2 ? "merchant" : "mini";
         List<String> moduleCandidates = "merchant".equals(module)

+ 7 - 0
ruoyi-modules/ruoyi-main/src/main/java/org/dromara/main/service/impl/MainStudentDislikeServiceImpl.java

@@ -61,4 +61,11 @@ public class MainStudentDislikeServiceImpl extends ServiceImpl<MainStudentDislik
                 .eq(MainStudentDislike::getDislikeType, "2"))
             .stream().map(MainStudentDislike::getTenantId).collect(Collectors.toList());
     }
+    @Override
+    public boolean cancelDislikeCompany(Long studentId, String tenantId) {
+        return baseMapper.delete(Wrappers.<MainStudentDislike>lambdaQuery()
+            .eq(MainStudentDislike::getStudentId, studentId)
+            .eq(MainStudentDislike::getDislikeType, "2")
+            .eq(MainStudentDislike::getTenantId, tenantId)) > 0;
+    }
 }