Browse Source

Merge branch 'dev'

# Conflicts:
#	pom.xml
shaoguo 7 tháng trước cách đây
mục cha
commit
161e7b6f5a
100 tập tin đã thay đổi với 2615 bổ sung216 xóa
  1. 7 7
      db/zhaopin.sql
  2. 22 25
      pom.xml
  3. 3 0
      src/main/java/com/sqx/SqxApplication.java
  4. 12 0
      src/main/java/com/sqx/WebSocketApp.java
  5. 46 0
      src/main/java/com/sqx/common/MyWebSocketHandler.java
  6. 19 0
      src/main/java/com/sqx/config/WebSocketConfig.java
  7. 6 2
      src/main/java/com/sqx/modules/app/controller/UserBrowseController.java
  8. 16 15
      src/main/java/com/sqx/modules/app/controller/app/AppController.java
  9. 13 0
      src/main/java/com/sqx/modules/app/controller/app/AppUserController.java
  10. 3 0
      src/main/java/com/sqx/modules/app/entity/UserEntity.java
  11. 4 0
      src/main/java/com/sqx/modules/app/service/UserService.java
  12. 242 7
      src/main/java/com/sqx/modules/app/service/impl/UserServiceImpl.java
  13. 2 1
      src/main/java/com/sqx/modules/app/vo/ResumesBrowseVo.java
  14. 3 6
      src/main/java/com/sqx/modules/chat/controller/ChatController.java
  15. 32 3
      src/main/java/com/sqx/modules/chat/controller/app/AppChatController.java
  16. 42 46
      src/main/java/com/sqx/modules/chat/controller/app/AppChatSocket.java
  17. 5 0
      src/main/java/com/sqx/modules/chat/entity/ChatContent.java
  18. 15 0
      src/main/java/com/sqx/modules/chat/entity/ChatConversation.java
  19. 1 0
      src/main/java/com/sqx/modules/chat/service/ChatConversationService.java
  20. 38 1
      src/main/java/com/sqx/modules/chat/service/impl/ChatConversationServiceImpl.java
  21. 1 1
      src/main/java/com/sqx/modules/chats/controller/WebSocket.java
  22. 10 0
      src/main/java/com/sqx/modules/chats/controller/app/AppChatsController.java
  23. 81 0
      src/main/java/com/sqx/modules/firstLogin/control/HrController.java
  24. 39 0
      src/main/java/com/sqx/modules/firstLogin/control/PostPreferenceController.java
  25. 266 0
      src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistController.java
  26. 10 0
      src/main/java/com/sqx/modules/firstLogin/dao/DepartmentDao.java
  27. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/EduDao.java
  28. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/HrDao.java
  29. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/PostPreferenceDao.java
  30. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/PostSkillDao.java
  31. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/SkillDao.java
  32. 20 0
      src/main/java/com/sqx/modules/firstLogin/dao/WorkExpDao.java
  33. 9 0
      src/main/java/com/sqx/modules/firstLogin/dao/WorkExpDetailDao.java
  34. 20 0
      src/main/java/com/sqx/modules/firstLogin/dto/WorkExpDetailDto.java
  35. 14 0
      src/main/java/com/sqx/modules/firstLogin/dto/WorkExpDto.java
  36. 9 0
      src/main/java/com/sqx/modules/firstLogin/dto/WorkExpTime.java
  37. 45 0
      src/main/java/com/sqx/modules/firstLogin/entity/Department.java
  38. 32 0
      src/main/java/com/sqx/modules/firstLogin/entity/Edu.java
  39. 21 0
      src/main/java/com/sqx/modules/firstLogin/entity/HrEntity.java
  40. 11 0
      src/main/java/com/sqx/modules/firstLogin/entity/PostPreference.java
  41. 49 0
      src/main/java/com/sqx/modules/firstLogin/entity/PostSkill.java
  42. 29 0
      src/main/java/com/sqx/modules/firstLogin/entity/ResumesDto.java
  43. 19 0
      src/main/java/com/sqx/modules/firstLogin/entity/Skill.java
  44. 54 0
      src/main/java/com/sqx/modules/firstLogin/entity/WorkExp.java
  45. 28 0
      src/main/java/com/sqx/modules/firstLogin/entity/WorkExpDetail.java
  46. 11 0
      src/main/java/com/sqx/modules/firstLogin/service/DepartmentService.java
  47. 10 0
      src/main/java/com/sqx/modules/firstLogin/service/EduService.java
  48. 8 0
      src/main/java/com/sqx/modules/firstLogin/service/HrService.java
  49. 7 0
      src/main/java/com/sqx/modules/firstLogin/service/PostPreferenceService.java
  50. 10 0
      src/main/java/com/sqx/modules/firstLogin/service/PostSkillService.java
  51. 10 0
      src/main/java/com/sqx/modules/firstLogin/service/SkillService.java
  52. 7 0
      src/main/java/com/sqx/modules/firstLogin/service/WorkExpDetailService.java
  53. 19 0
      src/main/java/com/sqx/modules/firstLogin/service/WorkExpService.java
  54. 19 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/DepartmentServiceImpl.java
  55. 22 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/EduServiceImpl.java
  56. 19 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/HrServiceImpl.java
  57. 14 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/Interval.java
  58. 11 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/PostPreferenceServiceImpl.java
  59. 33 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/PostSkillImpl.java
  60. 21 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/SkillServiceImpl.java
  61. 11 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/WorkExpDetailServiceImpl.java
  62. 154 0
      src/main/java/com/sqx/modules/firstLogin/service/impl/WorkExpServiceImpl.java
  63. 26 7
      src/main/java/com/sqx/modules/intention/controller/AppIntentionController.java
  64. 2 0
      src/main/java/com/sqx/modules/intention/entity/Intention.java
  65. 4 0
      src/main/java/com/sqx/modules/intention/service/IntentionService.java
  66. 14 28
      src/main/java/com/sqx/modules/intention/service/impl/IntentionServiceImpl.java
  67. 71 9
      src/main/java/com/sqx/modules/interviewRecord/controller/InterviewRecordController.java
  68. 9 0
      src/main/java/com/sqx/modules/interviewRecord/dao/HrPhoneDao.java
  69. 2 0
      src/main/java/com/sqx/modules/interviewRecord/dao/InterviewRecordDao.java
  70. 20 0
      src/main/java/com/sqx/modules/interviewRecord/entity/HrPhone.java
  71. 31 0
      src/main/java/com/sqx/modules/interviewRecord/entity/InterviewRecord.java
  72. 7 0
      src/main/java/com/sqx/modules/interviewRecord/service/HrPhoneService.java
  73. 2 0
      src/main/java/com/sqx/modules/interviewRecord/service/InterviewRecordService.java
  74. 11 0
      src/main/java/com/sqx/modules/interviewRecord/service/impl/HrPhoneServiceImpl.java
  75. 59 37
      src/main/java/com/sqx/modules/interviewRecord/service/impl/InterviewRecordServiceImpl.java
  76. 50 0
      src/main/java/com/sqx/modules/message/controller/NoticeController.java
  77. 0 4
      src/main/java/com/sqx/modules/message/controller/app/AppMessageController.java
  78. 9 0
      src/main/java/com/sqx/modules/message/dao/NoticeDao.java
  79. 20 0
      src/main/java/com/sqx/modules/message/entity/Notice.java
  80. 8 0
      src/main/java/com/sqx/modules/message/service/NoticeService.java
  81. 11 0
      src/main/java/com/sqx/modules/message/service/impl/NoticeServiceImpl.java
  82. 2 2
      src/main/java/com/sqx/modules/myCollection/controller/AdminMyCollectionController.java
  83. 1 1
      src/main/java/com/sqx/modules/myCollection/controller/MyCollectionController.java
  84. 3 0
      src/main/java/com/sqx/modules/myCollection/dao/MyCollectionDao.java
  85. 4 0
      src/main/java/com/sqx/modules/myCollection/entity/MyCollection.java
  86. 1 1
      src/main/java/com/sqx/modules/myCollection/service/MyCollectionService.java
  87. 26 12
      src/main/java/com/sqx/modules/myCollection/service/impl/MyCollectionServiceImpl.java
  88. 3 1
      src/main/java/com/sqx/modules/pay/service/PayDetailsService.java
  89. 79 0
      src/main/java/com/sqx/modules/post/controller/PostController.java
  90. 65 0
      src/main/java/com/sqx/modules/post/controller/ViewPostController.java
  91. 9 0
      src/main/java/com/sqx/modules/post/dao/PostDao.java
  92. 9 0
      src/main/java/com/sqx/modules/post/dao/ViewPostDao.java
  93. 22 0
      src/main/java/com/sqx/modules/post/dto/SelectAllDto.java
  94. 101 0
      src/main/java/com/sqx/modules/post/dto/SelectOneDto.java
  95. 91 0
      src/main/java/com/sqx/modules/post/entity/PostEntity.java
  96. 27 0
      src/main/java/com/sqx/modules/post/entity/ViewPost.java
  97. 23 0
      src/main/java/com/sqx/modules/post/mapper/PostMapper.java
  98. 15 0
      src/main/java/com/sqx/modules/post/service/PostService.java
  99. 14 0
      src/main/java/com/sqx/modules/post/service/ViewPostService.java
  100. 35 0
      src/main/java/com/sqx/modules/post/service/impl/PostServiceImpl.java

+ 7 - 7
db/zhaopin.sql

@@ -282,14 +282,14 @@ CREATE TABLE `common_info`  (
 INSERT INTO `common_info` VALUES (1, '2022-10-08 12:34:17', NULL, '客服二维码', 1, '1', 'xitongs');
 INSERT INTO `common_info` VALUES (2, '2020-02-21 21:17:17', NULL, '公众号二维码', 2, 'https://taobao.xianmxkj.com/erweima.jpg', 'image');
 INSERT INTO `common_info` VALUES (6, '2023-08-09 20:31:05', NULL, '微信公众号APPID	', 5, '', 'weixin');
-INSERT INTO `common_info` VALUES (7, '2023-07-11 21:24:15', NULL, '短信签名', 6, '省钱兄', 'duanxin');
+INSERT INTO `common_info` VALUES (7, '2023-07-11 21:24:15', NULL, '短信签名', 6, '亿职赞', 'duanxin');
 INSERT INTO `common_info` VALUES (16, '2023-08-09 20:31:15', NULL, '微信公众号秘钥	', 21, '', 'weixin');
 INSERT INTO `common_info` VALUES (17, '2020-02-25 20:43:59', NULL, '公众号Token', 16, 'mxkj', 'weixin');
 INSERT INTO `common_info` VALUES (18, '2020-02-25 20:44:15', NULL, '公众号EncodingAESKey	', 17, 'WkswfqVwn7noJxzXyzFS1UcIDCGJ8dCd2wNEtb32xQn', 'weixin');
 INSERT INTO `common_info` VALUES (20, '2023-02-22 14:10:36', NULL, '后台管理平台域名配置	', 20, 'https://zpadmin.xianmaxiong.com', 'xitong');
 INSERT INTO `common_info` VALUES (21, '2023-12-25 12:13:31', NULL, 'h5服务域名配置	', 19, 'https://zp.xianmaxiong.com', 'xitong');
 INSERT INTO `common_info` VALUES (22, '2022-03-28 11:22:48', NULL, '短信服务商(1 腾讯云 2 阿里云 3短信宝)', 79, '3', 'duanxin');
-INSERT INTO `common_info` VALUES (23, '2023-02-22 14:09:15', NULL, '后台服务名称	', 12, '码兄', 'xitong');
+INSERT INTO `common_info` VALUES (23, '2023-02-22 14:09:15', NULL, '后台服务名称	', 12, '亿职赞', 'xitong');
 INSERT INTO `common_info` VALUES (27, '2020-03-09 20:46:10', NULL, '通用APP下载地址	', 25, 'https://zp.xianmaxiong.com/mxzp.apk', 'xitong');
 INSERT INTO `common_info` VALUES (33, '2021-03-15 21:19:27', NULL, '腾讯云短信clientId	', 31, '', 'duanxin');
 INSERT INTO `common_info` VALUES (34, '2020-03-28 00:47', NULL, '腾讯云短信clientSecret	', 32, '', 'duanxin');
@@ -320,8 +320,8 @@ INSERT INTO `common_info` VALUES (100, '2020-07-27 15:17', NULL, '阿里云短
 INSERT INTO `common_info` VALUES (101, '2021-02-24 18:46:57', NULL, '官方邀请码', 88, '666666', 'xitongs');
 INSERT INTO `common_info` VALUES (102, '2022-04-21 19:39:21', NULL, '转账方式 1支付宝证书  2支付宝秘钥 3手动', 98, '3', 'zhifubao');
 INSERT INTO `common_info` VALUES (108, '2021-11-02 15:26:21', NULL, '公众号是否自动登录', 108, '是', 'weixins');
-INSERT INTO `common_info` VALUES (118, '2023-07-13 15:28:33', NULL, '邀请赚钱推广内容', 101, '码兄招聘邀请您加入', 'xitong');
-INSERT INTO `common_info` VALUES (120, '2023-07-13 15:28:25', NULL, '邀请赚钱微信分享内容', 103, '码兄招聘邀请您加入', 'xitong');
+INSERT INTO `common_info` VALUES (118, '2023-07-13 15:28:33', NULL, '邀请赚钱推广内容', 101, '亿职赞招聘邀请您加入', 'xitong');
+INSERT INTO `common_info` VALUES (120, '2023-07-13 15:28:25', NULL, '邀请赚钱微信分享内容', 103, '亿职赞招聘邀请您加入', 'xitong');
 INSERT INTO `common_info` VALUES (130, '2021-12-03 17:59:08', NULL, '提现最低额度', 112, '10', 'fuwufei');
 INSERT INTO `common_info` VALUES (140, '2020-07-27 15:17', NULL, '用户端腾讯地图key', 128, 'BFBBZ-X6Z3B-DN2UX-JAWGE-E5QKJ-AJF53', 'weixin');
 INSERT INTO `common_info` VALUES (154, '2024-03-20 11:09:11', NULL, '是否开启APP微信分享', 136, '是', 'kaiguan');
@@ -352,7 +352,7 @@ INSERT INTO `common_info` VALUES (251, '2020-11-04 10:31:40', NULL, '几条未
 INSERT INTO `common_info` VALUES (252, '2023-07-12 19:21:38', NULL, '一级佣金', 207, '0.2', 'fuwufei');
 INSERT INTO `common_info` VALUES (253, '2023-07-12 19:21:48', NULL, '二级佣金', 208, '0.1', 'fuwufei');
 INSERT INTO `common_info` VALUES (254, '2022-01-24 21:03:25', NULL, '是否开启佣金', 209, '是', 'kaiguan');
-INSERT INTO `common_info` VALUES (255, '2023-02-22 14:09:07', NULL, '分享提示语', 255, '码兄招聘邀请您加入', 'xitong');
+INSERT INTO `common_info` VALUES (255, '2023-02-22 14:09:07', NULL, '分享提示语', 255, '亿职赞招聘邀请您加入', 'xitong');
 INSERT INTO `common_info` VALUES (256, '2022-04-22 17:02:44', NULL, '商家佣金', 206, '0.7', 'yongjins');
 INSERT INTO `common_info` VALUES (257, '2024-10-25 13:27:04', NULL, '小程序上架是否显示2', 257, '是', 'kaiguan');
 INSERT INTO `common_info` VALUES (258, '2022-05-06 12:35:13', NULL, '支付宝方式 1证书 2秘钥', 258, '2', 'zhifubao');
@@ -402,10 +402,10 @@ INSERT INTO `common_info` VALUES (422, '2024-04-17 21:19:52', NULL, '非会员
 INSERT INTO `common_info` VALUES (423, '2024-05-17 17:35:37', NULL, '微信小程序码', 423, 'https://zp.xianmaxiong.com/file/uploadPath/2024/05/17/5502084c45fa5dfe22f4c719855e48ae.jpg', 'image');
 INSERT INTO `common_info` VALUES (424, '2024-06-08 14:22:23', NULL, '新注册赠送钻石数', 424, '100', 'xitong');
 INSERT INTO `common_info` VALUES (425, '2024-05-17 17:35:37', NULL, '备案号', 425, '陕ICP备19023892号-1', 'xitong');
-INSERT INTO `common_info` VALUES (426, '2024-06-08 14:22:23', NULL, '备案官网', 426, 'COPYRIGHT@ 西安省钱兄网络科技有限公司.版权所有', 'xitong');
+INSERT INTO `common_info` VALUES (426, '2024-06-08 14:22:23', NULL, '备案官网', 426, 'COPYRIGHT@ 亿职赞网络科技有限公司.版权所有', 'xitong');
 INSERT INTO `common_info` VALUES (427, '2024-06-08 14:22:23', NULL, '163邮箱发送主机地址', 427, 'smtp.163.com', 'xitong');
 INSERT INTO `common_info` VALUES (428, '2024-06-08 14:22:23', NULL, ' pc端移动访问显示二维码', 428, 'https://taobao.xianmxkj.com/erweima.jpg', 'image');
-INSERT INTO `common_info` VALUES (429, '2024-06-08 14:22:23', NULL, ' pc端移动访问显示文字', 429, '省钱兄', 'xitong');
+INSERT INTO `common_info` VALUES (429, '2024-06-08 14:22:23', NULL, ' pc端移动访问显示文字', 429, '亿职赞', 'xitong');
 INSERT INTO `common_info` VALUES (430, '2024-07-31 16:03:05', NULL, 'pc是否打开二维码页面', 430, '是', 'kaiguan');
 INSERT INTO `common_info` VALUES (431, '2024-07-31 16:03:23', NULL, 'pc是否跳转移动端', 431, '是', 'kaiguan');
 INSERT INTO `common_info` VALUES (432, '2024-06-08 14:22:23', NULL, '移动是否打开pc', 432, '是', 'kaiguan');

+ 22 - 25
pom.xml

@@ -115,12 +115,17 @@
             <version>2.0.3</version>
         </dependency>
 
-
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-websocket</artifactId>
-            <version>5.1.2.RELEASE</version>
-        </dependency>
+<!--
+<dependency>
+    <groupId>org.springframework</groupId>
+    <artifactId>spring-websocket</artifactId>
+    <version>5.1.2.RELEASE</version>
+</dependency>
+-->
+<dependency>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-websocket</artifactId>
+</dependency>
 
         <dependency>
             <groupId>net.java.dev.jna</groupId>
@@ -136,7 +141,7 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid</artifactId>
-            <version>1.1.10</version>
+            <version>${druid.version}</version>
         </dependency>
         <!-- 苹果工具类 -->
         <dependency>
@@ -247,18 +252,7 @@
             <artifactId>mysql-connector-java</artifactId>
             <version>${mysql.version}</version>
         </dependency>
-        <!--oracle驱动-->
-        <dependency>
-            <groupId>com.oracle</groupId>
-            <artifactId>ojdbc6</artifactId>
-            <version>${oracle.version}</version>
-        </dependency>
-        <!--mssql驱动-->
-        <dependency>
-            <groupId>com.microsoft.sqlserver</groupId>
-            <artifactId>sqljdbc4</artifactId>
-            <version>${mssql.version}</version>
-        </dependency>
+
         <!--postgresql驱动-->
         <dependency>
             <groupId>org.postgresql</groupId>
@@ -448,6 +442,9 @@
                 <configuration>
                     <fork>true</fork>
                     <includeSystemScope>true</includeSystemScope>
+                    <!-- 关键新增:指定唯一主类(二选一,根据你的实际入口选择) -->
+                    <mainClass>com.sqx.SqxApplication</mainClass>
+                    <!-- 若要使用 WebSocketApp 作为入口,替换为:<mainClass>com.sqx.WebSocketApp</mainClass> -->
                 </configuration>
             </plugin>
             <!-- 跳过单元测试 -->
@@ -507,9 +504,9 @@
 
     <repositories>
         <repository>
-            <id>public</id>
-            <name>aliyun nexus</name>
-            <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
+            <id>central</id>
+            <name>Maven Central</name>
+            <url>https://repo1.maven.org/maven2/</url>
             <releases>
                 <enabled>true</enabled>
             </releases>
@@ -517,9 +514,9 @@
     </repositories>
     <pluginRepositories>
         <pluginRepository>
-            <id>public</id>
-            <name>aliyun nexus</name>
-            <url>https//maven.aliyun.com/nexus/content/groups/public/</url>
+            <id>central</id>
+            <name>Maven Central</name>
+            <url>https://repo1.maven.org/maven2/</url>
             <releases>
                 <enabled>true</enabled>
             </releases>

+ 3 - 0
src/main/java/com/sqx/SqxApplication.java

@@ -1,11 +1,13 @@
 package com.sqx;
 
+import com.sqx.config.WebSocketConfig;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
 import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Import;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 
@@ -13,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @EnableScheduling
 @EnableCaching
 @SpringBootApplication
+@Import(WebSocketConfig.class)
 public class SqxApplication {
 
 	public static void main(String[] args) {

+ 12 - 0
src/main/java/com/sqx/WebSocketApp.java

@@ -0,0 +1,12 @@
+package com.sqx;
+
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class WebSocketApp {
+    public static void main(String[] args) {
+        SpringApplication.run(WebSocketApp.class, args);
+    }
+}

+ 46 - 0
src/main/java/com/sqx/common/MyWebSocketHandler.java

@@ -0,0 +1,46 @@
+package com.sqx.common;
+
+import org.springframework.web.socket.CloseStatus;
+import org.springframework.web.socket.TextMessage;
+import org.springframework.web.socket.WebSocketSession;
+import org.springframework.web.socket.handler.TextWebSocketHandler;
+
+import java.util.concurrent.CopyOnWriteArraySet;
+
+public class MyWebSocketHandler extends TextWebSocketHandler {
+    // 存储所有在线会话
+    private static final CopyOnWriteArraySet<WebSocketSession> sessions = new CopyOnWriteArraySet<>();
+
+    // 连接建立时触发
+    @Override
+    public void afterConnectionEstablished(WebSocketSession session) throws Exception {
+        sessions.add(session);
+        System.out.println("新连接加入,当前在线:" + sessions.size());
+    }
+
+    // 收到消息时触发
+    @Override
+    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
+        String receivedMsg = message.getPayload();
+        System.out.println("收到消息:" + receivedMsg);
+        // 广播消息给所有在线客户端
+        for (WebSocketSession s : sessions) {
+            if (s.isOpen()) {
+                s.sendMessage(new TextMessage("服务器回复:" + receivedMsg));
+            }
+        }
+    }
+
+    // 连接关闭时触发
+    @Override
+    public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
+        sessions.remove(session);
+        System.out.println("连接关闭,当前在线:" + sessions.size());
+    }
+
+    @Override
+    public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception {
+        System.err.println("WebSocket 传输错误:" + exception.getMessage());
+        exception.printStackTrace();
+    }
+}

+ 19 - 0
src/main/java/com/sqx/config/WebSocketConfig.java

@@ -0,0 +1,19 @@
+package com.sqx.config;
+
+import com.sqx.common.MyWebSocketHandler;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.socket.config.annotation.EnableWebSocket;
+import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
+import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
+
+@Configuration
+@EnableWebSocket // 启用Spring WebSocket支持
+public class WebSocketConfig implements WebSocketConfigurer {
+
+    @Override
+    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
+        // 注册Spring WebSocket处理器,端点为/ws
+        registry.addHandler(new MyWebSocketHandler(), "/ws")
+                .setAllowedOrigins("*"); // 允许跨域(生产环境需限制)
+    }
+}

+ 6 - 2
src/main/java/com/sqx/modules/app/controller/UserBrowseController.java

@@ -5,6 +5,8 @@ import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.app.entity.UserBrowse;
 import com.sqx.modules.app.service.UserBrowseService;
+import com.sqx.modules.chat.entity.ChatConversation;
+import com.sqx.modules.chat.service.ChatConversationService;
 import com.sqx.modules.resumes.entity.PostPush;
 import com.sqx.modules.resumes.entity.Resumes;
 import io.swagger.annotations.Api;
@@ -20,15 +22,18 @@ import org.springframework.web.bind.annotation.*;
 public class UserBrowseController {
     @Autowired
     private UserBrowseService userBrowseService;
+    @Autowired
+    private ChatConversationService chatConversationService;
 
     @ApiOperation("查询我的浏览记录")
     @GetMapping("/selectMyBrowseV2")
     public Result selectMyBrowseV2(Long userId, Integer page, Integer limit, UserBrowse userBrowse, PostPush postPush) {
         return Result.success().put("data", userBrowseService.selectMyBrowseV2(userId, page, limit, userBrowse, postPush));
     }
+    @Login
     @ApiOperation("查询我的浏览记录")
     @GetMapping("/selectMyBrowse")
-    public Result selectMyBrowse(Long userId, Integer page, Integer limit, UserBrowse userBrowse) {
+    public Result selectMyBrowse(@RequestAttribute("userId") Long userId, Integer page, Integer limit, UserBrowse userBrowse) {
         return Result.success().put("data", userBrowseService.selectMyBrowse(userId, page, limit, userBrowse));
     }
         @ApiOperation("删除浏览记录")
@@ -55,5 +60,4 @@ public class UserBrowseController {
     private Result deleteUserByBrowse(Long postPushId){
         return userBrowseService.remove(new QueryWrapper<UserBrowse>().eq("post_push_id", postPushId)) ? Result.success():Result.error();
     }
-
 }

+ 16 - 15
src/main/java/com/sqx/modules/app/controller/app/AppController.java

@@ -49,7 +49,8 @@ public class AppController {
     @Login
     @PostMapping("/updateUserResumes")
     @ApiOperation("修改用户")
-    public Result updateUserResumes(@LoginUser UserEntity user, String resumesContent) {
+    public Result updateUserResumes(  @RequestBody UserEntity user, String resumesContent,@RequestAttribute("userId")Long userId) {
+        user.setUserId(userId);
         userService.updateById(user);
         MessageInfo messageInfo = new MessageInfo();
         messageInfo.setState("10");
@@ -139,20 +140,20 @@ public class AppController {
     @RequestMapping(value = "/selectUserById", method = RequestMethod.GET)
     @ApiOperation("获取用户详细信息")
     @ResponseBody
-    public Result selectUserById(@LoginUser UserEntity user) {
-        if (user.getUserType() == 2) {
-            Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", user.getUserId()));
-            if (company != null) {
-                user.setCompanyId(company.getCompanyId());
-            }
-        }
-        if (user.getZhiRate() == null) {
-            user.setZhiRate(new BigDecimal(commonInfoService.findOne(207).getValue()));
-        }
-        if (user.getFeiRate() == null) {
-            user.setFeiRate(new BigDecimal(commonInfoService.findOne(208).getValue()));
-        }
-        userService.updateById(user);
+    public Result selectUserById(@RequestAttribute("userId")Long userId) {
+//        if (user.getUserType() == 2) {
+//            Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", user.getUserId()));
+//            if (company != null) {
+//                user.setCompanyId(company.getCompanyId());
+//            }
+//        }
+//        if (user.getZhiRate() == null) {
+//            user.setZhiRate(new BigDecimal(commonInfoService.findOne(207).getValue()));
+//        }
+//        if (user.getFeiRate() == null) {
+//            user.setFeiRate(new BigDecimal(commonInfoService.findOne(208).getValue()));
+//        }
+        UserEntity user = userService.selectUserById(userId);
         return Result.success().put("data", user);
 
     }

+ 13 - 0
src/main/java/com/sqx/modules/app/controller/app/AppUserController.java

@@ -1,5 +1,6 @@
 package com.sqx.modules.app.controller.app;
 
+import com.baomidou.mybatisplus.extension.api.R;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.common.utils.DateUtils;
 import com.sqx.common.utils.Result;
@@ -22,11 +23,15 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.apache.catalina.User;
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.web.bind.annotation.*;
 
+import javax.xml.crypto.Data;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
 import java.util.*;
 
 /**
@@ -54,4 +59,12 @@ public class AppUserController {
     public Result userData(@RequestAttribute("userId") Long userId){
         return Result.success().put("data", userService.userData(userId));
     }
+
+    @Login
+    @GetMapping("userYesterdayData")
+    @ApiOperation("用户昨日数据")
+    public Result userYesterdayData(@RequestAttribute("userId")Long userId, @RequestParam("todayStart")  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")LocalDateTime todayStart, @RequestParam("todayEnd") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime todayEnd, Integer postPushId){
+        return Result.success().put("data",userService.userYesterdayData(userId,todayStart,todayEnd,postPushId));
+    }
+
 }

+ 3 - 0
src/main/java/com/sqx/modules/app/entity/UserEntity.java

@@ -235,4 +235,7 @@ public class UserEntity implements Serializable {
 
     @TableField(exist = false)
     private BigDecimal money;
+
+    private Integer vipPostTimes;
+    private Integer vipDueTimes;
 }

+ 4 - 0
src/main/java/com/sqx/modules/app/service/UserService.java

@@ -9,7 +9,9 @@ import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.form.UpdateUserTypeForm;
 import com.sqx.modules.utils.excel.ExcelData;
+import org.joda.time.DateTime;
 
+import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -223,4 +225,6 @@ public interface UserService extends IService<UserEntity> {
     Result saveUser(UserEntity userEntity);
 
     Result updateUserType(UpdateUserTypeForm updateUserTypeForm);
+
+    HashMap<String,Object> userYesterdayData(Long userId, LocalDateTime todayStart, LocalDateTime todayEnd, Integer postPushId);
 }

+ 242 - 7
src/main/java/com/sqx/modules/app/service/impl/UserServiceImpl.java

@@ -1,5 +1,6 @@
 package com.sqx.modules.app.service.impl;
 
+import cn.hutool.core.lang.Assert;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONException;
 import com.alibaba.fastjson.JSONObject;
@@ -44,16 +45,24 @@ import com.sqx.modules.app.service.UserMoneyDetailsService;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.app.utils.JwtUtils;
 import com.sqx.modules.app.utils.UserConstantInterface;
+import com.sqx.modules.chat.entity.ChatContent;
+import com.sqx.modules.chat.entity.ChatConversation;
+import com.sqx.modules.chat.service.ChatContentService;
+import com.sqx.modules.chat.service.ChatConversationService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.file.utils.Md5Utils;
+import com.sqx.modules.interviewRecord.entity.InterviewRecord;
+import com.sqx.modules.interviewRecord.service.InterviewRecordService;
 import com.sqx.modules.invite.service.InviteService;
 import com.sqx.modules.message.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
 import com.sqx.modules.myCollection.entity.MyCollection;
 import com.sqx.modules.myCollection.service.MyCollectionService;
 import com.sqx.modules.resumes.entity.Company;
+import com.sqx.modules.resumes.entity.PostPush;
 import com.sqx.modules.resumes.service.CompanyService;
+import com.sqx.modules.resumes.service.PostPushService;
 import com.sqx.modules.sendRecord.entity.SendRecord;
 import com.sqx.modules.sendRecord.service.SendRecordService;
 import com.sqx.modules.utils.HttpClientUtil;
@@ -63,6 +72,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.http.client.utils.DateUtils;
+import org.apache.ibatis.jdbc.Null;
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -72,9 +83,14 @@ import weixin.popular.util.JsonUtil;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAdjusters;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 用户
@@ -116,6 +132,14 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
     private UserMoneyDetailsDao detailsDao;
     @Autowired
     private MsgService msgService;
+    @Autowired
+    private ChatConversationService chatConversationService;
+    @Autowired
+    private ChatContentService chatContentService;
+    @Autowired
+    private InterviewRecordService interviewRecordService;
+    @Autowired
+    private PostPushService postPushService;
 
     @Override
     public UserEntity queryByPhone(String phone) {
@@ -877,14 +901,12 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
         UserEntity userEntity = baseMapper.selectById(userId);
         if (userEntity != null) {
             if (userEntity.getUserType() == 2) {
-                Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", userEntity.getUserId()));
+                Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", userEntity.getUserId()).eq("status",2));
                 if (company != null) {
                     userEntity.setCompanyId(company.getCompanyId());
                 }
             }
         }
-
-
         return userEntity;
     }
 
@@ -1141,22 +1163,38 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
         HashMap<String, Object> map = new HashMap<>();
         UserEntity userEntity = baseMapper.selectById(userId);
         QueryWrapper<UserBrowse> wrapper = new QueryWrapper<UserBrowse>().eq("user_id", userId);
-        //个人
+        QueryWrapper<MyCollection> queryWrapper =new QueryWrapper<MyCollection>().eq("user_id",userId);
+        QueryWrapper<SendRecord> queryWrapper1 =new QueryWrapper<>();
+        QueryWrapper<InterviewRecord>queryWrapper2 =new QueryWrapper<>();
+        QueryWrapper<ChatConversation> queryWrapper3 =new QueryWrapper<>();
+
         if (userEntity.getUserType() == 1) {
             wrapper.eq("browse_type", 1);
+            queryWrapper.eq("type",1);
+            queryWrapper1.eq("user_id",userId);
+            queryWrapper2.eq("interviewer_id",userId);
+            queryWrapper3.eq("use_id",userId);
             //企业
         } else {
             wrapper.eq("browse_type", 2);
+            queryWrapper.eq("type",2);
+            queryWrapper1.eq("company_user_id",userId);
+            queryWrapper2.eq("user_id",userId);
+            queryWrapper3.eq("focused_user_id",userId);
         }
         int browseCount = userBrowseService.count(wrapper);
-        int collectionCount = collectionService.count(new QueryWrapper<MyCollection>().eq("user_id", userId));
-        int deliveryCount = sendRecordService.count(new QueryWrapper<SendRecord>().eq("user_id", userId));
+        int collectionCount = collectionService.count(queryWrapper);
+        int deliveryCount = sendRecordService.count(queryWrapper1);
+        int chatCount = chatConversationService.count();
+        int interviewCount = interviewRecordService.count(queryWrapper2);
         //浏览记录
         map.put("browseCount", browseCount);
         //收藏记录
         map.put("collectionCount", collectionCount);
         //投递记录
         map.put("deliveryCount", deliveryCount);
+        map.put("chatCount",chatCount);
+        map.put("interviewCount",interviewCount);
         return map;
 
     }
@@ -1455,4 +1493,201 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
         return Result.success();
     }
 
-}
+    @Override
+
+
+        /**
+         * 获取指定用户的今日招聘数据
+         * @param userId 用户ID(企业用户,对应user_type=2)
+         * @return 包含各指标今日数据及较昨日变化的Map
+         */
+    public HashMap<String, Object> userYesterdayData(Long userId,LocalDateTime todayStart, LocalDateTime todayEnd, Integer postPushId) {
+
+        HashMap<String, Object> resultMap = new HashMap<>();
+        boolean isCalculateDiff = false; // 是否计算「今日-昨日」差值(默认不计算)
+        LocalDateTime yesterdayStart = null;
+        LocalDateTime yesterdayEnd = null;
+
+        // -------------------------- 1. 时间参数处理(核心改造)--------------------------
+        if (todayStart == null && todayEnd == null) {
+            // 场景1:未传时间 → 用今日+昨日时间范围,计算差值
+            isCalculateDiff = true;
+            // 今日:00:00:00 ~ 23:59:59
+            todayStart = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
+            todayEnd = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
+            // 昨日:00:00:00 ~ 23:59:59
+            yesterdayStart = LocalDateTime.of(LocalDate.now().minusDays(1), LocalTime.MIN);
+            yesterdayEnd = LocalDateTime.of(LocalDate.now().minusDays(1), LocalTime.MAX);
+        } else {
+            // 场景2:传了时间 → 校验时间合理性,不计算差值
+            Assert.notNull(todayStart, "传入时间时,todayStart不能为空");
+            Assert.notNull(todayEnd, "传入时间时,todayEnd不能为空");
+            Assert.isTrue(!todayStart.isAfter(todayEnd), "todayStart不能晚于todayEnd");
+        }
+
+        // -------------------------- 2. 公共查询条件准备 --------------------------
+        // 「看过我」所需的:当前用户发布的岗位ID列表
+        List<Long> myPostIds = new ArrayList<>();
+        List<Object> postIdObjs = postPushService.listObjs(
+                new QueryWrapper<PostPush>()
+                        .eq("user_id", userId)
+                        .select("post_push_id")
+        );
+        if (postIdObjs != null && !postIdObjs.isEmpty()) {
+            myPostIds = postIdObjs.stream()
+                    .map(obj -> Long.valueOf(obj.toString()))
+                    .collect(Collectors.toList());
+        }
+
+        // -------------------------- 3. 指标查询(按需求差异化处理)--------------------------
+        // 3.1 我看过(企业查看求职者数量)
+        int currentISaw = userBrowseService.count(
+                new QueryWrapper<UserBrowse>()
+                        .eq("user_id", userId)
+                        .eq("browse_type", 2)
+                        .between("update_time", todayStart, todayEnd)
+        );
+        resultMap.put("iSaw", currentISaw);
+        if (isCalculateDiff) {
+            int yesterdayISaw = userBrowseService.count(
+                    new QueryWrapper<UserBrowse>()
+                            .eq("user_id", userId)
+                            .eq("browse_type", 2)
+                            .between("update_time", yesterdayStart, yesterdayEnd)
+            );
+            resultMap.put("tyIsaw", currentISaw - yesterdayISaw);
+        }
+
+        // 3.2 看过我(求职者查看企业岗位数量)
+        int currentSawMe = 0;
+        if (!myPostIds.isEmpty()) {
+            currentSawMe = userBrowseService.count(
+                    new QueryWrapper<UserBrowse>()
+                            .in("post_push_id", myPostIds)
+                            .eq("post_push_id", postPushId) // 筛选指定岗位
+                            .between("update_time", todayStart, todayEnd)
+            );
+        }
+        resultMap.put("sawMe", currentSawMe);
+        if (isCalculateDiff) {
+            int yesterdaySawMe = 0;
+            if (!myPostIds.isEmpty()) {
+                yesterdaySawMe = userBrowseService.count(
+                        new QueryWrapper<UserBrowse>()
+                                .in("post_push_id", myPostIds)
+                                .eq("post_push_id", postPushId)
+                                .between("update_time", yesterdayStart, yesterdayEnd)
+                );
+            }
+            resultMap.put("tySawMe", currentSawMe - yesterdaySawMe);
+        }
+
+        // 3.3 我沟通(企业主动发起沟通数量)
+        int currentICommunicated = chatConversationService.count(
+                new QueryWrapper<ChatConversation>()
+                        .eq("focused_user_id", userId)
+                        .eq("type", 2)
+                        .eq("post_push_id", postPushId)
+                        .between("create_time", todayStart, todayEnd)
+        );
+        resultMap.put("iCommunicated", currentICommunicated);
+        if (isCalculateDiff) {
+            int yesterdayICommunicated = chatConversationService.count(
+                    new QueryWrapper<ChatConversation>()
+                            .eq("focused_user_id", userId)
+                            .eq("type", 2)
+                            .eq("post_push_id", postPushId)
+                            .between("create_time", yesterdayStart, yesterdayEnd)
+            );
+            resultMap.put("tyICommunicated", currentICommunicated - yesterdayICommunicated);
+        }
+
+        // 3.4 求职者沟通(求职者主动发起沟通数量)
+        int currentCandidateCommunicated = chatConversationService.count(
+                new QueryWrapper<ChatConversation>()
+                        .eq("focused_user_id", userId)
+                        .eq("type", 1)
+                        .eq("post_push_id", postPushId)
+                        .between("create_time", todayStart, todayEnd)
+        );
+        resultMap.put("candidateCommunicated", currentCandidateCommunicated);
+        if (isCalculateDiff) {
+            int yesterdayCandidateCommunicated = chatConversationService.count(
+                    new QueryWrapper<ChatConversation>()
+                            .eq("focused_user_id", userId)
+                            .eq("type", 1)
+                            .eq("post_push_id", postPushId)
+                            .between("create_time", yesterdayStart, yesterdayEnd)
+            );
+            resultMap.put("tyCandidateCommunicated", currentCandidateCommunicated - yesterdayCandidateCommunicated);
+        }
+
+        // 3.5 收获简历(企业收到简历数量)
+        int currentReceivedResumes = chatConversationService.count(
+                new QueryWrapper<ChatConversation>()
+                        .eq("focused_user_id", userId)
+                        .eq("is_send_resumes", 1)
+                        .eq("post_push_id", postPushId)
+                        .between("update_time", todayStart, todayEnd)
+        );
+        resultMap.put("receivedResumes", currentReceivedResumes);
+        if (isCalculateDiff) {
+            int yesterdayReceivedResumes = chatConversationService.count(
+                    new QueryWrapper<ChatConversation>()
+                            .eq("focused_user_id", userId)
+                            .eq("is_send_resumes", 1)
+                            .eq("post_push_id", postPushId)
+                            .between("update_time", yesterdayStart, yesterdayEnd)
+            );
+            resultMap.put("tyReceivedResumes", currentReceivedResumes - yesterdayReceivedResumes);
+        }
+
+        // 3.6 交换电话微信(修复原Bug:昨日查询用昨日时间范围)
+        int currentExchangedContact = chatConversationService.count(
+                new QueryWrapper<ChatConversation>()
+                        .eq("focused_user_id", userId)
+                        .eq("post_push_id", postPushId)
+                        .and(qw -> qw.eq("is_send_phone", 1).or().eq("is_send_wx", 1))
+                        .between("update_time", todayStart, todayEnd)
+        );
+        resultMap.put("exchangedContact", currentExchangedContact);
+        if (isCalculateDiff) {
+            int yesterdayExchangedContact = chatConversationService.count(
+                    new QueryWrapper<ChatConversation>()
+                            .eq("focused_user_id", userId)
+                            .eq("post_push_id", postPushId)
+                            .and(qw -> qw.eq("is_send_phone", 1).or().eq("is_send_wx", 1))
+                            .between("update_time", yesterdayStart, yesterdayEnd) // 原代码误用todayStart,现已修正
+            );
+            resultMap.put("tyExchangeContact", currentExchangedContact - yesterdayExchangedContact);
+        }
+
+        // 3.7 接受面试(求职者接受面试数量)
+        int currentAcceptedInterview = interviewRecordService.count(
+                new QueryWrapper<InterviewRecord>()
+                        .eq("user_id", userId)
+                        .eq("status", 2)
+                        .eq("post_push_id", postPushId)
+                        .between("create_time", todayStart, todayEnd)
+        );
+        resultMap.put("acceptedInterview", currentAcceptedInterview);
+        if (isCalculateDiff) {
+            int yesterdayAcceptedInterview = interviewRecordService.count(
+                    new QueryWrapper<InterviewRecord>()
+                            .eq("user_id", userId)
+                            .eq("status", 2)
+                            .eq("post_push_id", postPushId)
+                            .between("create_time", yesterdayStart, yesterdayEnd)
+            );
+            resultMap.put("tyAcceptedInterview", currentAcceptedInterview - yesterdayAcceptedInterview);
+        }
+        int currentSendInterview = interviewRecordService.count(
+                new QueryWrapper<InterviewRecord>()
+                        .eq("user_id", userId)
+                        .eq("post_push_id", postPushId)
+                        .between("create_time", todayStart, todayEnd)
+        );
+        resultMap.put("sendInterview", currentSendInterview);
+        return resultMap;
+    }
+    }

+ 2 - 1
src/main/java/com/sqx/modules/app/vo/ResumesBrowseVo.java

@@ -2,6 +2,7 @@ package com.sqx.modules.app.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.sqx.modules.resumes.entity.Resumes;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -32,5 +33,5 @@ public class ResumesBrowseVo extends Resumes implements Serializable {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime bUpdateTime;
-
+    private ResumesListDto resumesListDto;
 }

+ 3 - 6
src/main/java/com/sqx/modules/chat/controller/ChatController.java

@@ -1,15 +1,14 @@
 package com.sqx.modules.chat.controller;
 
 import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.chat.entity.ChatConversation;
 import com.sqx.modules.chat.service.ChatContentService;
 import com.sqx.modules.chat.service.ChatConversationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 @RestController
 @Api(value = "聊天", tags = {"聊天"})
@@ -44,6 +43,4 @@ public class ChatController {
 
 
 
-
-
 }

+ 32 - 3
src/main/java/com/sqx/modules/chat/controller/app/AppChatController.java

@@ -1,22 +1,25 @@
 package com.sqx.modules.chat.controller.app;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.chat.entity.ChatContent;
 import com.sqx.modules.chat.entity.ChatConversation;
 import com.sqx.modules.chat.service.ChatContentService;
 import com.sqx.modules.chat.service.ChatConversationService;
 import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.message.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
+import com.sqx.modules.resumes.dao.ResumesDao;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import com.sqx.modules.utils.TLSSigAPIv2;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 @RestController
 @Api(value = "聊天", tags = {"聊天"})
@@ -31,6 +34,8 @@ public class AppChatController {
     private MessageService messageService;
     @Autowired
     private CommonInfoService commonInfoService;
+    @Autowired
+    private ResumesDao resumesDao;
 
     @Login
     @GetMapping("/selectChatConversationPage")
@@ -43,6 +48,9 @@ public class AppChatController {
     @PostMapping("/insertChatConversation")
     @ApiOperation("发起聊天")
     public Result insertChatConversation(@RequestBody ChatConversation chatConversation){
+        if (chatConversation.getUserId().equals(chatConversation.getFocusedUserId())){
+            return Result.error("发起会话失败");
+        }
         return chatConversationService.insertChatConversations(chatConversation);
     }
 
@@ -139,6 +147,27 @@ public class AppChatController {
         return chatContentService.updateChatContent(chatContentId, videoStatus, voiceLength);
     }
 
-
+    @Login
+    @GetMapping("/chatUser")
+    @ApiOperation("获取和自己聊过天的列表")
+    public Page<ResumesListDto> chatUser(@RequestAttribute("userId")Long userId, Integer limit, Integer page){
+        List<ChatContent> list = chatContentService.getBaseMapper().selectList(new QueryWrapper<ChatContent>().eq("user_id",userId).orderByDesc("create_time").last("limit 1"));
+
+
+        Set<ResumesListDto> tempSet = new LinkedHashSet<>();
+        for(ChatContent chatContent:list){
+            ResumesListDto resumesListDto =new ResumesListDto();
+            resumesListDto.setResumesId(chatContent.getResumesId());
+            List<ResumesListDto> resumesListDto1 = resumesDao.selectResumesListHr(resumesListDto);
+            resumesListDto1.forEach(resumesListDto2 -> resumesListDto2.setLastTime(chatContent.getCreateTime()));
+           tempSet.addAll(resumesListDto1);
+        }
+        List<ResumesListDto> list1 = new ArrayList<>(tempSet);
+        Integer currentPage = (page == null || page < 1) ? 1 : page;
+        Integer pageSize = (limit == null || limit < 1) ? 10 : limit;
+        Page<ResumesListDto> page1 =new Page<>(currentPage,pageSize);
+        page1.setRecords(list1);
+        return page1;
+    }
 
 }

+ 42 - 46
src/main/java/com/sqx/modules/chat/controller/app/AppChatSocket.java

@@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
 @Slf4j
 @Component
 @ServerEndpoint("/chatSocket/{userId}")
-public class AppChatSocket {//用户聊天
+public class AppChatSocket {// 用户聊天
 
     /**
      * 在线人数
@@ -34,7 +34,7 @@ public class AppChatSocket {//用户聊天
      * 以用户的id为key,WebSocket为对象保存起来
      */
     private static Map<String, AppChatSocket> clients = new ConcurrentHashMap<String, AppChatSocket>();
-    private static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     /**
      * 会话
      */
@@ -50,55 +50,51 @@ public class AppChatSocket {//用户聊天
 
     // 注入的时候,给类的 service 注入
     @Autowired
-    public void setWxChatContentService(ChatContentService chatContentService,UserService userService) {
+    public void setWxChatContentService(ChatContentService chatContentService, UserService userService) {
         AppChatSocket.chatContentService = chatContentService;
         AppChatSocket.userService = userService;
     }
 
-
-
     /**
      * 建立连接
      *
      * @param session
      */
     @OnOpen
-    public void onOpen(@PathParam("userId") String userId, Session session)
-    {
+    public void onOpen(@PathParam("userId") String userId, Session session) {
         onlineNumber++;
-        log.info("现在来连接的客户id:"+userId);
+        log.info("现在来连接的客户id:" + userId);
         this.userId = userId;
         this.session = session;
         log.info("有新连接加入! 当前在线人数" + onlineNumber);
         try {
-            //把自己的信息加入到map当中去
+            // 把自己的信息加入到map当中去
             AppChatSocket appChatSocket = clients.get(userId);
-            if(appChatSocket!=null){
+            if (appChatSocket != null) {
                 clients.remove(userId);
             }
             clients.put(userId, this);
 
-            /*sendMessageTo("恭喜你连接成功!",wxUserId);*/
-        }
-        catch (Exception e){
-            log.error(userId+"上线的时候通知所有人发生了错误");
+            /* sendMessageTo("恭喜你连接成功!",wxUserId); */
+        } catch (Exception e) {
+            log.error(userId + "上线的时候通知所有人发生了错误");
         }
 
     }
 
     @OnError
     public void onError(Session session, Throwable error) {
-        log.error("服务端发生了错误"+error.getMessage());
-        //error.printStackTrace();
+        log.error("服务端发生了错误" + error.getMessage());
+        // error.printStackTrace();
     }
+
     /**
      * 连接关闭
      */
     @OnClose
-    public void onClose()
-    {
+    public void onClose() {
         onlineNumber--;
-        //webSockets.remove(this);
+        // webSockets.remove(this);
         clients.remove(userId);
         log.info("有连接关闭! 当前在线人数" + onlineNumber);
     }
@@ -110,8 +106,7 @@ public class AppChatSocket {//用户聊天
      * @param session 会话
      */
     @OnMessage
-    public void onMessage(String message, Session session)
-    {
+    public void onMessage(String message, Session session) {
 
         if (Objects.equals("HeartBeat", message)) {
             return;
@@ -125,15 +120,16 @@ public class AppChatSocket {//用户聊天
             String height = jsonObject.getString("height");
             String userId = jsonObject.getString("userId");
             String chatConversationId = jsonObject.getString("chatConversationId");
-            chatContentService.updateChatContentStatusByUserIdAndChatId(Long.parseLong(this.userId), Long.parseLong(chatConversationId));
-            if("24".equals(messageType)){
+            chatContentService.updateChatContentStatusByUserIdAndChatId(Long.parseLong(this.userId),
+                    Long.parseLong(chatConversationId));
+            if ("24".equals(messageType)) {
                 AppChatSocket chatSocket = clients.get(userId);
-                if (chatSocket!=null) {
+                if (chatSocket != null) {
                     chatSocket.session.getAsyncRemote().sendText(message);
                 }
-            }else{
-                //将聊天记录保存包数据库中
-                ChatContent wxChatContent=new ChatContent();
+            } else {
+                // 将聊天记录保存包数据库中
+                ChatContent wxChatContent = new ChatContent();
                 wxChatContent.setChatConversationId(Long.parseLong(chatConversationId));
                 wxChatContent.setUserId(Long.parseLong(this.userId));
                 wxChatContent.setWidth(width);
@@ -141,48 +137,48 @@ public class AppChatSocket {//用户聊天
                 wxChatContent.setContent(textMessage);
                 wxChatContent.setMessageType(messageType);
                 wxChatContent.setCreateTime(sdf.format(new Date()));
-                //判断对方是否在线
+                // 判断对方是否在线
                 AppChatSocket chatSocket = clients.get(userId);
-                if (chatSocket!=null) {
+                if (chatSocket != null) {
                     chatSocket.session.getAsyncRemote().sendText(message);
                 }
                 wxChatContent.setStatus(0);
                 chatContentService.save(wxChatContent);
                 UserEntity userEntity = userService.selectUserById(Long.parseLong(userId));
-                if(userEntity!=null && StringUtils.isNotBlank(userEntity.getClientid())){
+                if (userEntity != null && StringUtils.isNotBlank(userEntity.getClientid())) {
                     UserEntity user = userService.selectUserById(Long.parseLong(this.userId));
-                    if("2".equals(messageType)){
-                        textMessage="[图片]";
-                    }else if("3".equals(messageType)){
-                        textMessage="[语音]";
+                    if ("2".equals(messageType)) {
+                        textMessage = "[图片]";
+                    } else if ("3".equals(messageType)) {
+                        textMessage = "[语音]";
                     }
-                    userService.pushToSingle("新消息提醒",user.getUserName()+":"+textMessage,userEntity.getClientid());
+                    userService.pushToSingle("新消息提醒", user.getUserName() + ":" + textMessage, userEntity.getClientid());
                 }
             }
 
-            /*AppChatSocket chatSocket = clients.get(userId);
-            if (chatSocket!=null) {
-                chatSocket.session.getAsyncRemote().sendText(message);
-            }*/
-        }
-        catch (Exception e){
-            log.error("发生了错误了"+e.getMessage(),e);
+            /*
+             * AppChatSocket chatSocket = clients.get(userId);
+             * if (chatSocket!=null) {
+             * chatSocket.session.getAsyncRemote().sendText(message);
+             * }
+             */
+        } catch (Exception e) {
+            log.error("发生了错误了" + e.getMessage(), e);
         }
 
     }
 
-
     public void sendMessageTo(String message, String ToUserName) throws IOException {
         for (AppChatSocket item : clients.values()) {
-            if (item.userId.equals(ToUserName) ) {
+            if (item.userId.equals(ToUserName)) {
                 item.session.getAsyncRemote().sendText(message);
-                System.err.println(this.userId+"发送成功:"+ToUserName);
+                System.err.println(this.userId + "发送成功:" + ToUserName);
                 break;
             }
         }
     }
 
-    public void sendMessageAll(String message,String FromUserName) throws IOException {
+    public void sendMessageAll(String message, String FromUserName) throws IOException {
         for (AppChatSocket item : clients.values()) {
             item.session.getAsyncRemote().sendText(message);
         }

+ 5 - 0
src/main/java/com/sqx/modules/chat/entity/ChatContent.java

@@ -1,13 +1,16 @@
 package com.sqx.modules.chat.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 聊天内容对象 chat_content
@@ -63,5 +66,7 @@ public class ChatContent {
     private Long resumesId;
 
     private Integer userType;
+    @TableField(exist = false)
+    private List<ResumesListDto> list;
 
 }

+ 15 - 0
src/main/java/com/sqx/modules/chat/entity/ChatConversation.java

@@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import com.sqx.modules.resumes.entity.Company;
+import com.sqx.modules.resumes.entity.PostPush;
+import com.sqx.modules.resumes.entity.Resumes;
 import lombok.Data;
 
 
@@ -80,5 +85,15 @@ public class ChatConversation {
 
     @TableField(exist = false)
     private String messageType;
+    @TableField(exist = false)
+    private Resumes resumes;
+    @TableField(exist = false)
+    private UserEntity userEntity;
+    @TableField(exist = false)
+    private PostPush postPush;
+    @TableField(exist = false)
+    private HrEntity hr;
+    @TableField(exist = false)
+    private Company company;
 
 }

+ 1 - 0
src/main/java/com/sqx/modules/chat/service/ChatConversationService.java

@@ -21,4 +21,5 @@ public interface ChatConversationService extends IService<ChatConversation> {
 
     Result insertChatConversationByChatVideo(Long userId,ChatConversation chatConversation,String messageType);
 
+    Object getConversationList(Integer page,Integer limit,ChatConversation chatConversation);
 }

+ 38 - 1
src/main/java/com/sqx/modules/chat/service/impl/ChatConversationServiceImpl.java

@@ -1,6 +1,7 @@
 package com.sqx.modules.chat.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.sqx.common.utils.DateUtils;
@@ -13,6 +14,11 @@ import com.sqx.modules.chat.entity.ChatContent;
 import com.sqx.modules.chat.entity.ChatConversation;
 import com.sqx.modules.chat.service.ChatContentService;
 import com.sqx.modules.chat.service.ChatConversationService;
+import com.sqx.modules.firstLogin.service.HrService;
+import com.sqx.modules.resumes.entity.PostPush;
+import com.sqx.modules.resumes.service.CompanyService;
+import com.sqx.modules.resumes.service.PostPushService;
+import com.sqx.modules.resumes.service.ResumesService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -20,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 
@@ -31,6 +38,14 @@ public class ChatConversationServiceImpl extends ServiceImpl<ChatConversationDao
     private UserService userService;
     @Autowired
     private ChatContentService chatContentService;
+    @Autowired
+    private PostPushService postPushService;
+    @Autowired
+    private HrService hrService;
+    @Autowired
+    private CompanyService companyService;
+    @Autowired
+    private ResumesService resumesService;
 
 
     @Override
@@ -142,6 +157,28 @@ public class ChatConversationServiceImpl extends ServiceImpl<ChatConversationDao
         return Result.error("系统繁忙,请稍后再试");
     }
 
-
+    @Override
+    public Object getConversationList(Integer page,Integer limit ,ChatConversation chatConversation) {
+        Page<ChatConversation> pages;
+        if (page != null && limit != null) {
+            pages = new Page<>(page, limit);
+        } else {
+            pages = new Page<>();
+            pages.setSize(-1);
+        }
+        QueryWrapper<ChatConversation> wrapper = new QueryWrapper<>();
+        wrapper.eq("user_id",chatConversation.getUserId()).orderByAsc("update_time");
+        IPage<ChatConversation> selectPage = baseMapper.selectPage(pages,wrapper);
+        List<ChatConversation> chatConversations = selectPage.getRecords();
+        for (ChatConversation chatConversation1 : chatConversations){
+            PostPush postPush = postPushService.getById(chatConversation1.getPostPushId());
+            chatConversation1.setPostPush(postPush);
+            chatConversation1.setHr(hrService.getByUserId(String.valueOf(chatConversation1.getFocusedUserId())));
+            chatConversation1.setCompany(companyService.getById(postPush.getCompanyId()));
+            chatConversation1.setUserEntity(userService.getById(chatConversation1.getFocusedUserId()));
+            chatConversation1.setResumes(resumesService.getById(chatConversation1.getResumesId()));
+        }
+        return  selectPage;
+    }
 
 }

+ 1 - 1
src/main/java/com/sqx/modules/chats/controller/WebSocket.java

@@ -21,7 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * WebSocket聊天实现
  */
 @Component
-@ServerEndpoint("/websocket/{wxUserId}")
+@ServerEndpoint("/sqx_fast/websocket/{wxUserId}")
 public class WebSocket {
     private Logger logger = LoggerFactory.getLogger(this.getClass());
 

+ 10 - 0
src/main/java/com/sqx/modules/chats/controller/app/AppChatsController.java

@@ -1,17 +1,27 @@
 package com.sqx.modules.chats.controller.app;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.chat.entity.ChatContent;
+import com.sqx.modules.chat.service.ChatContentService;
 import com.sqx.modules.chats.entity.Chats;
 import com.sqx.modules.chats.service.ChatsContentService;
 import com.sqx.modules.chats.service.ChatsService;
 import com.sqx.modules.chats.utils.Result;
+import com.sqx.modules.resumes.dao.ResumesDao;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
+import java.util.List;
+
 @RestController
 @Api(value="聊天会话",tags={"聊天会话"})
 @RequestMapping(value = "/app/chats")

+ 81 - 0
src/main/java/com/sqx/modules/firstLogin/control/HrController.java

@@ -0,0 +1,81 @@
+package com.sqx.modules.firstLogin.control;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.api.R;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.app.service.UserService;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import com.sqx.modules.firstLogin.service.HrService;
+import com.sqx.modules.resumes.entity.Company;
+import com.sqx.modules.resumes.entity.CompanyUser;
+import com.sqx.modules.resumes.service.CompanyService;
+import com.sqx.modules.resumes.service.CompanyUserService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Objects;
+
+@RestController
+@RequestMapping("/app/HrFirst" )
+public class HrController {
+
+@Autowired
+private  HrService hrService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private CompanyUserService companyUserService;
+    @Autowired
+    private CompanyService companyService;
+
+    @Login
+    @PostMapping("addHr")
+    @ApiOperation("hr设置名片信息")
+    public Result addHr (@RequestAttribute Integer userId, @RequestBody HrEntity hr){
+        if(hr.getHrImg()==null ||hr.getHrPosition() == null|| hr.getHrImg().isEmpty() || hr.getHrPosition().isEmpty()){
+            return Result.error("请完整信息再次尝试");
+        }
+        hr.setUserId(userId);
+        hrService.saveOrUpdate(hr);
+        return  Result.success().put("data",hr);
+    }
+    @Login
+    @GetMapping
+    @ApiOperation("获取个人hr信息")
+    public Result getHr(@RequestAttribute("userId")Long userId){
+        return  Result.success().put("data",hrService.getByUserId(String.valueOf(userId)));
+    }
+    @Login
+    @PostMapping("updateHr")
+    @ApiOperation("个人中心hr信息")
+    public Result updateHr(@RequestAttribute("userId")Long userId, @RequestBody HrEntity hr, UserEntity userEntity){
+        userService.updateById(userEntity);
+        hrService.updateById(hr);
+        return Result.success("更新完成");
+    }
+    @Login
+    @GetMapping("getUserHr")
+    @ApiOperation("获取Hr信息")
+    public Result getUserHr(@RequestAttribute("userId")Long userId){
+        UserEntity userEntity= userService.selectUserById(userId);
+        HrEntity hr = hrService.getByUserId(String.valueOf(userId));
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("userEntity",userEntity);
+        map.put("HrEntity",hr);
+        CompanyUser companyUser = companyUserService.getOne(new QueryWrapper<CompanyUser>().eq("user_id",userId).eq("is_use",1));
+        if (companyUser == null){
+            QueryWrapper<Company> queryWrapper =new QueryWrapper<>();
+            queryWrapper.eq("user_id",userId).orderByDesc("update_time").last("limit 1 ");
+            Company company = companyService.getBaseMapper().selectOne(queryWrapper);
+            map.put("company",company);
+        }else {
+            Company company = companyService.getById(companyUser.getCompanyId());
+            map.put("company",company);
+        }
+        return Result.success().put("data",map);
+    }
+}

+ 39 - 0
src/main/java/com/sqx/modules/firstLogin/control/PostPreferenceController.java

@@ -0,0 +1,39 @@
+package com.sqx.modules.firstLogin.control;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.firstLogin.entity.PostPreference;
+import com.sqx.modules.firstLogin.service.PostPreferenceService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("app/postPreference")
+public class PostPreferenceController {
+    @Autowired
+    private PostPreferenceService postPreferenceServer;
+    @Login
+    @GetMapping("getPostPreference")
+    @ApiOperation("获取岗位偏向")
+    public Result getPostPreference(Long ruleClassifyId){
+        return Result.success().put("data",postPreferenceServer.getBaseMapper().selectList(new QueryWrapper<PostPreference>().eq("rule_classify_id",ruleClassifyId).eq("is_use",1)));
+    }
+    @PostMapping("addPostPreference")
+    @ApiOperation("增加岗位偏向")
+    public Result addPostPreference(@RequestBody PostPreference postPreference){
+        postPreference.setIsUse(1);
+        postPreferenceServer.saveOrUpdate(postPreference);
+        return Result.success("修改完成");
+    }
+    @PostMapping("deletePostPreference")
+    @ApiOperation("增加岗位偏向")
+    public Result deletePostPreference(Long postPreferenceId){
+        PostPreference postPreference =postPreferenceServer.getById(postPreferenceId);
+        postPreference.setIsUse(0);
+        postPreferenceServer.updateById(postPreference);
+        return Result.success("修改完成");
+    }
+
+}

+ 266 - 0
src/main/java/com/sqx/modules/firstLogin/control/UserFirstRegistController.java

@@ -0,0 +1,266 @@
+package com.sqx.modules.firstLogin.control;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.app.entity.UserBrowse;
+import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.app.service.UserBrowseService;
+import com.sqx.modules.app.service.UserService;
+import com.sqx.modules.firstLogin.dto.WorkExpDto;
+import com.sqx.modules.firstLogin.entity.*;
+import com.sqx.modules.firstLogin.service.*;
+import com.sqx.modules.intention.service.IntentionService;
+import com.sqx.modules.resumes.entity.Resumes;
+import com.sqx.modules.resumes.service.ResumesService;
+import io.swagger.annotations.ApiOperation;
+import jodd.util.CollectionUtil;
+import org.apache.commons.collections.CollectionUtils;
+import org.hibernate.jdbc.Work;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDateTime;
+import java.util.*;
+
+
+@RestController
+@RequestMapping("/app/userFirst" )
+public class UserFirstRegistController {
+    @Autowired
+    private ResumesService resumesService;
+    @Autowired
+    private DepartmentService departmentService;
+    @Autowired
+    private WorkExpService workExpService;
+    @Autowired
+    private PostSkillService postSkillService;
+    @Autowired
+    private EduService eduService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private SkillService skillService;
+    @Autowired
+    private IntentionService intentionService;
+    @Autowired
+    private WorkExpDetailService workExpDetailService;
+    @Autowired
+    private UserBrowseService userBrowseService;
+
+
+    @Login
+    @PostMapping ("regist")
+    @ApiOperation("初次加载信息")
+    public Result userFirstRegist(@RequestAttribute("userId") Long userId,@RequestBody Resumes resumes) {
+        Resumes oldResumes = resumesService.selectResumesByUserId(userId);
+        if (oldResumes != null) {
+            QueryWrapper<Resumes> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("resumes_id",oldResumes.getResumesId());
+            resumes.setStatus(0);
+            resumes.setUpdateTime(String.valueOf(LocalDateTime.now()));
+            resumesService.update(resumes,queryWrapper);
+        }else{
+            resumes.setUserId(userId);
+            resumes.setStatus(0);
+            resumesService.save(resumes);
+        }
+        return  Result.success();
+    }
+    @Login
+    @GetMapping ("getUserResumes")
+    @ApiOperation("获取简历信息")
+    public Result getUserResumes(@RequestAttribute Long userId) {
+        ResumesDto resumesDto = new ResumesDto();
+        resumesDto.setUserEntity(userService.getById(userId));
+        resumesDto.setResumeList( resumesService.selectResumesByUserId(userId));
+        resumesDto.setEduList(eduService.selectEdu(Math.toIntExact(userId)));
+        resumesDto.setIntentions(intentionService.getIntention(userId));
+        resumesDto.setWorkExps(workExpService.selectWorkExpOnly(userId));
+        resumesDto.setWorkExpList(workExpService.selectWorkExp(Math.toIntExact(userId)));
+        resumesDto.setSkills(skillService.selectSkill(Math.toIntExact(userId)));
+        resumesDto.setWorkExpTimes(workExpService.getWorkTime(userId));
+        return Result.success().put("data",resumesDto);
+    }
+    @Login
+    @GetMapping("getResumes")
+    @ApiOperation("获取简历详情")
+    public Result getResumesByResumesId(@RequestAttribute("userId")Long userId, Long resumesId){
+        ResumesDto resumesDto =new ResumesDto();
+        Resumes resumes = resumesService.getById(resumesId);
+        String userId1 = String.valueOf(resumes.getUserId());
+        resumesDto.setUserEntity(userService.getById(userId1));
+        resumesDto.setResumeList( resumes);
+        resumesDto.setEduList(eduService.selectEdu(Integer.valueOf(userId1)));
+        resumesDto.setIntentions(intentionService.getIntention(Long.valueOf(userId1)));
+//        resumesDto.setWorkExps(workExpService.selectWorkExpOnly(Long.valueOf(userId1)));
+//        resumesDto.setWorkExpList(workExpService.selectWorkExp(Integer.valueOf(userId1)));
+//        List<WorkExp> workExps =workExpService.getBaseMapper().selectList(new QueryWrapper<WorkExp>().eq("user_id",userId1).eq("is_use",1));
+//        for (WorkExp workExp:workExps) {
+//            List<WorkExpDetail> workExpDetails =workExpDetailService.getBaseMapper().selectList(new QueryWrapper<WorkExpDetail>().eq("work_exp_id",workExp.getWorkExpId()));
+//            workExp.setWorkExpDetailList(workExpDetails);
+//        }
+//        resumesDto.setWorkExps(workExps);
+        resumesDto.setWorkExpList(workExpService.selectWorkExp(Math.toIntExact(userId)));
+        resumesDto.setSkills(skillService.selectSkill(Integer.valueOf(userId1)));
+        resumesDto.setWorkExpTimes(workExpService.getWorkTime(Long.valueOf(userId1)));
+        UserBrowse userBrowseOld = userBrowseService.getOne(new QueryWrapper<UserBrowse>().eq("user_id",userId).eq("resumes_id",resumesId));
+        if (userBrowseOld != null){
+            userBrowseOld.setUpdateTime(LocalDateTime.now());
+            userBrowseService.updateById(userBrowseOld);
+        }else {
+            UserBrowse userBrowse = new UserBrowse();
+            userBrowse.setUserId(userId);
+            userBrowse.setResumesId(resumesId);
+            userBrowse.setBrowseType(2);
+            userBrowse.setUpdateTime(LocalDateTime.now());
+            userBrowseService.save(userBrowse);
+        }
+        return Result.success().put("data",resumesDto);
+    }
+    @Login
+    @GetMapping ("getWorkExpDetailOne")
+    @ApiOperation("获取简历信息")
+    public Result getWorkExpDetailOne(Long workExpId) {
+        return Result.success().put("data",workExpService.getWorkExpDetailOne(workExpId));
+    }
+    @Login
+    @PostMapping("savemsg")
+    @ApiOperation("更改基础信息")
+    public  Result savemsg(@RequestAttribute("userId")Long userId, @RequestBody UserEntity userEntity,@RequestBody Resumes resumes){
+        userEntity.setUserId(userId);
+        userEntity.setUpdateTime(String.valueOf(LocalDateTime.now()));
+        Resumes oldresumes =resumesService.selectResumesByUserId(userId);
+        resumes.setUserId(oldresumes.getUserId());
+        resumes.setUpdateTime(String.valueOf(LocalDateTime.now()));
+        resumesService.updateById(resumes);
+        return  Result.success();
+    }
+
+
+    @PostMapping("getDepartment")
+    @ApiOperation("获取工作部门列表")
+    public Result getDepartment(Department department) {
+        return Result.success().put("data", departmentService.getDepartmentList(department));
+    }
+
+    @GetMapping("getPostSkill")
+    @ApiOperation("获取专业技能")
+    public Result getPostSkill( PostSkill postSkill) {
+        return Result.success().put("data", postSkillService.getPostSkill(postSkill));
+    }
+
+    @Login
+    @PostMapping("addWorkExp")
+    @ApiOperation("新增或修改工作经验")
+    public  Result addWorkExp(@RequestAttribute("userId") Long userId, @RequestBody WorkExpDto workExp){
+        WorkExp workExp1 = workExp.getWorkExp();
+        // 存入数据库
+        workExp1.setUserId(userId);
+        workExp1.setIsUse(1);
+        workExpService.saveOrUpdate(workExp1);
+        List<WorkExpDetail> workExpDetails = workExp.getWorkExpDetails();
+        workExpDetails.forEach(workExpDetail -> workExpDetail.setWorkExpId(workExp1.getWorkExpId()));
+        workExpDetails.forEach(workExpDetail ->workExpDetailService.saveOrUpdate(workExpDetail));
+        Resumes resumes = resumesService.getOne(new QueryWrapper<Resumes>().eq("user_id",userId));
+        int times = workExpService.getWorkTime(userId);
+        resumes.setResumesWorkExperience(String.valueOf(times));
+        return Result.success();
+    }
+    @Login
+    @PostMapping("addEdu")
+    @ApiOperation("增加或修改学历")
+    public Result addEdu(@RequestAttribute("userId") Long userId,@RequestBody  Edu edu) {
+        edu.setUserId(userId);
+        edu.setIsUse(1);
+        eduService.saveOrUpdate(edu);
+        Edu edu1 =eduService.getBaseMapper().selectOne(new QueryWrapper<Edu>().eq("userId",userId).orderByDesc("end_time").last("1"));
+        Resumes resumes = resumesService.getOne(new QueryWrapper<Resumes>().eq("user_id",userId));
+        resumes.setResumesEducation(String.valueOf(DEGREE_MIN_RANGE_MAP.get(edu1.getDegree())));
+        return Result.success();
+    }
+    private static Map<String, Integer> DEGREE_MIN_RANGE_MAP = Collections.emptyMap();
+    static {
+        Map<String, Integer> tempMap = new HashMap<>();
+        tempMap.put("小学", 0);
+        tempMap.put("初中", 0);  // 最小范围(最低学历)
+        tempMap.put("高中", 1);
+        tempMap.put("中专", 1);
+        tempMap.put("大专", 3);
+        tempMap.put("本科", 4);
+        tempMap.put("硕士", 5);
+        tempMap.put("博士", 6);
+        DEGREE_MIN_RANGE_MAP = Collections.unmodifiableMap(tempMap);// 最大范围(最高学历)
+    }
+    @Login
+    @PostMapping("addSkill")
+    @ApiOperation("增加技能")
+    public Result addSkill(@RequestAttribute("userId") Long userId,@RequestBody List<Skill> skills) {
+        skills.forEach(skill -> skill.setUserId(userId));
+        // 设置isUse为1
+        skills.forEach(skill -> skill.setIsUse(1));
+        // 批量保存或更新
+        skillService.saveOrUpdateBatch(skills);
+        return Result.success();
+    }
+    @Login
+    @GetMapping("selectEdu")
+    @ApiOperation("查找学历")
+    public Result selectEdu(Long eduId) {
+        return Result.success().put("data", eduService.getById(eduId));
+    }
+    @Login
+    @GetMapping("selectWorkExp")
+    @ApiOperation("查找工作经历")
+    public Result selectWorkExp(Integer workExpId) {
+        return Result.success().put("data", workExpService.selectWorkExpOne(workExpId));
+    }
+    @Login
+    @GetMapping("selectSkill")
+    @ApiOperation("查找技能")
+    public Result selectSkill(@RequestAttribute("userId") Integer userId) {
+        return Result.success().put("data", skillService.selectSkill(userId));
+    }
+    @Login
+    @PostMapping("deleteWorkExp")
+    @ApiOperation("删除工作经历")
+    public Result deleteExp(@RequestBody WorkExp workExp) {
+        workExp.setIsUse(0);
+        workExpService.saveOrUpdate(workExp);
+        return Result.success();
+    }
+    @Login
+    @PostMapping("deleteEdu")
+    @ApiOperation("删除教育经历")
+    public Result deleteEdu( @RequestBody Edu edu) {
+        edu.setIsUse(0);
+        eduService.saveOrUpdate(edu);
+        return Result.success();
+    }
+    @Login
+    @PostMapping("deleteSkill")
+    @ApiOperation("删除技能")
+    public Result deleteSkill(@RequestBody List<Skill> skills) {
+        skills.forEach(skill -> skill.setIsUse(0));
+        skillService.updateBatchById(skills);
+        return Result.success();
+    }
+    @Login
+    @PostMapping("updateSkill")
+    @ApiOperation("更新技能")
+    public Result deleteSkill(@RequestBody List<Skill> skills,@RequestAttribute("userId")Integer userId) {
+        List<Skill> oldSkills = skillService.selectSkill(userId);
+        if (CollectionUtils.isNotEmpty(oldSkills)){
+        oldSkills.forEach(skill -> skill.setIsUse(0));
+        skillService.updateBatchById(oldSkills);
+        }
+        if (CollectionUtils.isNotEmpty(skills)){
+        skills.forEach(skill -> skill.setUserId(Long.valueOf(userId)));
+        skills.forEach(skill -> skill.setIsUse(1));
+        skillService.saveBatch(skills);
+        }
+        return Result.success();
+
+    }
+}

+ 10 - 0
src/main/java/com/sqx/modules/firstLogin/dao/DepartmentDao.java

@@ -0,0 +1,10 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.Department;
+import org.apache.ibatis.annotations.Mapper;
+
+
+@Mapper
+  public interface DepartmentDao extends BaseMapper<Department> {
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/EduDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.Edu;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EduDao  extends BaseMapper<Edu> {
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/HrDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface HrDao extends BaseMapper<HrEntity> {
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/PostPreferenceDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.PostPreference;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PostPreferenceDao extends BaseMapper<PostPreference> {
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/PostSkillDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.PostSkill;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PostSkillDao extends BaseMapper<PostSkill> {
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/SkillDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.Skill;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface SkillDao extends BaseMapper<Skill> {
+}

+ 20 - 0
src/main/java/com/sqx/modules/firstLogin/dao/WorkExpDao.java

@@ -0,0 +1,20 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.dto.WorkExpDetailDto;
+import com.sqx.modules.firstLogin.dto.WorkExpDto;
+import com.sqx.modules.firstLogin.dto.WorkExpTime;
+import com.sqx.modules.firstLogin.entity.WorkExp;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+
+@Mapper
+public interface WorkExpDao extends BaseMapper<WorkExp> {
+    List<WorkExpDetailDto> selectWorkExpList(Integer userId);
+
+    List<Object> selectWorkExpOne(Integer workExpId);
+
+    List<WorkExpTime> getTime(Long userId);
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dao/WorkExpDetailDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.firstLogin.entity.WorkExpDetail;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface WorkExpDetailDao extends BaseMapper<WorkExpDetail> {
+}

+ 20 - 0
src/main/java/com/sqx/modules/firstLogin/dto/WorkExpDetailDto.java

@@ -0,0 +1,20 @@
+package com.sqx.modules.firstLogin.dto;
+
+import lombok.Data;
+
+@Data
+public class WorkExpDetailDto {
+    private Integer workExpId;
+    private  Integer workExpDetailId;
+    private String skills;         // 技能数组
+    private String position;             // 职位名称
+    private Integer positionId;          // 职位ID(若数值较大,可改为Long)
+    private String workContent;          // 工作内容
+    private Integer departmentId;        // 部门ID(若数值较大,可改为Long)
+    private String positionLevel;        // 职位级别(初级/中级/高级等)
+    private String startTime; // 任职时间数组(格式:yyyy-MM-dd)
+    private String endTime;
+    private String department;     // 部门索引
+    private String workPerformance;
+    private String companyName;
+}

+ 14 - 0
src/main/java/com/sqx/modules/firstLogin/dto/WorkExpDto.java

@@ -0,0 +1,14 @@
+package com.sqx.modules.firstLogin.dto;
+
+import com.sqx.modules.firstLogin.entity.WorkExp;
+import com.sqx.modules.firstLogin.entity.WorkExpDetail;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+@Data
+public class WorkExpDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+        private WorkExp workExp;
+        private List<WorkExpDetail> workExpDetails;  // List字段
+}

+ 9 - 0
src/main/java/com/sqx/modules/firstLogin/dto/WorkExpTime.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.firstLogin.dto;
+
+import lombok.Data;
+
+@Data
+public class WorkExpTime {
+    private String startTime;
+    private String endTime;
+}

+ 45 - 0
src/main/java/com/sqx/modules/firstLogin/entity/Department.java

@@ -0,0 +1,45 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.SqlCondition;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.sqx.modules.industry.entity.Industry;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+@Data
+public class Department implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 部门id
+     */
+    @TableId(value = "department_id", type = IdType.AUTO)
+    private Long departmentId;
+
+    /**
+     * 部门名称
+     */
+    @TableField(condition = SqlCondition.LIKE)
+    private String departmentName;
+
+    /**
+     * 是否启用 0不启用 1启用
+     */
+    private Integer isEnable;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 更新时间
+     */
+    private  String  updateTime;
+
+    @TableField(exist = false)
+    private List<Industry> childrenList;
+}

+ 32 - 0
src/main/java/com/sqx/modules/firstLogin/entity/Edu.java

@@ -0,0 +1,32 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+@TableName("edu")
+public class Edu implements Serializable {
+    private static final long serialVersionUID = 1L;
+    //教育经历id
+    @TableId(value = "edu_id", type = IdType.AUTO)
+    private Integer eduId;
+    // 学校名称
+    private String school;
+    // 用户id
+    private Long userId;
+    // 专业
+    private String profession;
+    // 起始时间
+    private String startTime;
+    // 结束时间
+    private String endTime;
+    // 学位
+    private String degree;
+    // 详细内容
+    private String detail;
+    //是否启用
+    private  Integer isUse;
+}

+ 21 - 0
src/main/java/com/sqx/modules/firstLogin/entity/HrEntity.java

@@ -0,0 +1,21 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@TableName("hr")
+public class HrEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "hr_id", type = IdType.AUTO)
+    private  Integer hrId;
+    private  Integer userId;
+    private  String  hrImg;
+    private  String  hrPosition;
+    private  String  hrEmail;
+
+}

+ 11 - 0
src/main/java/com/sqx/modules/firstLogin/entity/PostPreference.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.firstLogin.entity;
+
+import lombok.Data;
+
+@Data
+public class PostPreference {
+    private Integer postPreferenceId;
+    private Integer ruleClassifyId;
+    private String preferenceName;
+    private Integer isUse;
+}

+ 49 - 0
src/main/java/com/sqx/modules/firstLogin/entity/PostSkill.java

@@ -0,0 +1,49 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.SqlCondition;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import org.joda.time.DateTime;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class PostSkill implements Serializable {
+    /**
+     * 岗位技能id
+     */
+    @TableId(value = "post_skill_id", type = IdType.AUTO)
+    private Long postSkillId;
+
+    /**
+     * 岗位技能名称
+     */
+    @TableField(condition = SqlCondition.LIKE)
+    private String postSkillName;
+
+    /**
+     * 是否启用 0不启用 1启用
+     */
+    private Integer isEnable;
+
+    /**
+     * 上级id
+     */
+    private Long parentId;
+
+    /**
+     * 排序
+     */
+    private  Integer sort;
+    /**
+     * 更新时间
+     */
+    private DateTime updateTime;
+
+    private Integer ruleClassifyId;
+    @TableField(exist = false)
+    private List<PostSkill> childrenList;
+}

+ 29 - 0
src/main/java/com/sqx/modules/firstLogin/entity/ResumesDto.java

@@ -0,0 +1,29 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.firstLogin.dto.WorkExpDetailDto;
+import com.sqx.modules.firstLogin.dto.WorkExpDto;
+import com.sqx.modules.intention.entity.Intention;
+import com.sqx.modules.resumes.entity.Resumes;
+import lombok.Data;
+import java.util.List;
+@Data // lombok注解,自动生成getter、setter
+public class ResumesDto {
+    // 简历列表(假设Resume是简历实体类)
+    private Resumes resumeList;
+    // 教育经历列表(假设Education是教育经历实体类)
+    private List<Edu> eduList;
+    // 工作经历列表(假设WorkExperience是工作经历实体类)
+    private List<WorkExpDetailDto> workExpList;
+
+    private List<WorkExp> workExps;
+    private UserEntity userEntity;
+
+    private List<Intention> intentions;
+
+    private List<Skill> skills;
+    private Integer workExpTimes;
+
+    public void getResumeList(Resumes resumes) {
+    }
+}

+ 19 - 0
src/main/java/com/sqx/modules/firstLogin/entity/Skill.java

@@ -0,0 +1,19 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@TableName("skill")
+public class Skill implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "skill_id", type = IdType.AUTO)
+    private Long skillId;
+    private Long userId;
+    private String skillName;
+    private  Integer isUse;
+}

+ 54 - 0
src/main/java/com/sqx/modules/firstLogin/entity/WorkExp.java

@@ -0,0 +1,54 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import javax.persistence.Column;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+@TableName("work_exp")
+public class WorkExp implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 工作经验id
+     */
+    @TableId(value = "work_exp_id", type = IdType.AUTO)
+    @Column(name = "work_exp_id")
+    private Integer workExpId;
+
+    /**
+     * 类型(JSON数组存储,例如:["0","1"])
+     * 0: 跨境电商 1: 国内电商 2: 外贸 3: 其他
+     */
+    private String type; // JSON类型在Java中通常用String存储,也可根据需求映射为自定义对象
+
+    /**
+     * 启用状态
+     * 0: 停用 1: 使用
+     */
+    @Column(name = "is_use")
+    private Integer isUse;
+
+    /**
+     * 用户id
+     */
+    @Column(name = "user_id")
+    private Long userId;
+
+    /**
+     * 公司名称
+     */
+    @Column(name = "company_name", length = 255)
+    private String companyName;
+
+    @TableField(exist = false)
+    private List<WorkExpDetail> workExpDetailList;
+
+
+}

+ 28 - 0
src/main/java/com/sqx/modules/firstLogin/entity/WorkExpDetail.java

@@ -0,0 +1,28 @@
+package com.sqx.modules.firstLogin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import javax.persistence.Column;
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class WorkExpDetail implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "work_exp_detail_id", type = IdType.AUTO)
+    private  Integer workExpDetailId;
+    private  Integer workExpId;
+    private String skills;         // 技能数组
+    private String position;             // 职位名称
+    private Integer positionId;          // 职位ID(若数值较大,可改为Long)
+    private String workContent;          // 工作内容
+    private Integer departmentId;        // 部门ID(若数值较大,可改为Long)
+    private String positionLevel;        // 职位级别(初级/中级/高级等)
+    private String startTime; // 任职时间数组(格式:yyyy-MM-dd)
+    private String endTime;
+    private String department;     // 部门索引
+    private String workPerformance;
+}

+ 11 - 0
src/main/java/com/sqx/modules/firstLogin/service/DepartmentService.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.Department;
+
+import java.util.List;
+
+public interface DepartmentService extends IService<Department> {
+
+    List<Department> getDepartmentList(Department department);
+}

+ 10 - 0
src/main/java/com/sqx/modules/firstLogin/service/EduService.java

@@ -0,0 +1,10 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.Edu;
+
+import java.util.List;
+
+public interface EduService extends IService<Edu> {
+    List<Edu> selectEdu(Integer userId);
+}

+ 8 - 0
src/main/java/com/sqx/modules/firstLogin/service/HrService.java

@@ -0,0 +1,8 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+
+public interface HrService extends IService<HrEntity> {
+    HrEntity getByUserId(String userId);
+}

+ 7 - 0
src/main/java/com/sqx/modules/firstLogin/service/PostPreferenceService.java

@@ -0,0 +1,7 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.PostPreference;
+
+public interface PostPreferenceService extends IService<PostPreference> {
+}

+ 10 - 0
src/main/java/com/sqx/modules/firstLogin/service/PostSkillService.java

@@ -0,0 +1,10 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.PostSkill;
+
+import java.util.List;
+
+public interface PostSkillService extends IService<PostSkill> {
+    List<PostSkill> getPostSkill(PostSkill postSkill);
+}

+ 10 - 0
src/main/java/com/sqx/modules/firstLogin/service/SkillService.java

@@ -0,0 +1,10 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.Skill;
+
+import java.util.List;
+
+public interface SkillService extends IService<Skill> {
+    List<Skill> selectSkill(Integer userId) ;
+}

+ 7 - 0
src/main/java/com/sqx/modules/firstLogin/service/WorkExpDetailService.java

@@ -0,0 +1,7 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.entity.WorkExpDetail;
+
+public interface WorkExpDetailService extends IService<WorkExpDetail> {
+}

+ 19 - 0
src/main/java/com/sqx/modules/firstLogin/service/WorkExpService.java

@@ -0,0 +1,19 @@
+package com.sqx.modules.firstLogin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.firstLogin.dto.WorkExpDetailDto;
+import com.sqx.modules.firstLogin.entity.WorkExp;
+
+import java.util.List;
+
+public interface WorkExpService extends IService<WorkExp> {
+    List<WorkExpDetailDto> selectWorkExp(Integer userId);
+
+    List<Object> selectWorkExpOne(Integer workExpId);
+
+    List<WorkExp> selectWorkExpOnly(Long userId);
+
+    Object getWorkExpDetailOne(Long workExpId);
+
+    Integer getWorkTime(Long userId);
+}

+ 19 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/DepartmentServiceImpl.java

@@ -0,0 +1,19 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.DepartmentDao;
+import com.sqx.modules.firstLogin.entity.Department;
+import com.sqx.modules.firstLogin.service.DepartmentService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class DepartmentServiceImpl extends ServiceImpl<DepartmentDao, Department> implements DepartmentService {
+    @Override
+    public List<Department> getDepartmentList(Department department){
+
+        return   baseMapper.selectList(new QueryWrapper<>(department));
+    }
+}

+ 22 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/EduServiceImpl.java

@@ -0,0 +1,22 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.EduDao;
+import com.sqx.modules.firstLogin.entity.Edu;
+import com.sqx.modules.firstLogin.service.EduService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class EduServiceImpl extends ServiceImpl<EduDao, Edu> implements EduService {
+    @Override
+    public List<Edu> selectEdu( Integer userId) {
+        QueryWrapper<Edu> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId).eq("is_use",1);
+        queryWrapper.orderByAsc("start_time");
+        return baseMapper.selectList(queryWrapper);
+
+    }
+}

+ 19 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/HrServiceImpl.java

@@ -0,0 +1,19 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.HrDao;
+import com.sqx.modules.firstLogin.entity.HrEntity;
+import com.sqx.modules.firstLogin.service.HrService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class HrServiceImpl extends ServiceImpl<HrDao, HrEntity> implements HrService {
+
+    @Override
+    public HrEntity getByUserId(String userId) {
+        QueryWrapper<HrEntity> queryWrapper =new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId);
+        return  baseMapper.selectOne(queryWrapper);
+    }
+}

+ 14 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/Interval.java

@@ -0,0 +1,14 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import java.time.LocalDateTime; /**
+     * 内部辅助类:存储时间区间的起止时间
+     */
+    public class Interval {
+        final LocalDateTime start;
+        final LocalDateTime end;
+
+        Interval(LocalDateTime start, LocalDateTime end) {
+            this.start = start;
+            this.end = end;
+        }
+    }

+ 11 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/PostPreferenceServiceImpl.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.PostPreferenceDao;
+import com.sqx.modules.firstLogin.entity.PostPreference;
+import com.sqx.modules.firstLogin.service.PostPreferenceService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PostPreferenceServiceImpl extends ServiceImpl<PostPreferenceDao,PostPreference> implements PostPreferenceService {
+}

+ 33 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/PostSkillImpl.java

@@ -0,0 +1,33 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.PostSkillDao;
+import com.sqx.modules.firstLogin.entity.PostSkill;
+import com.sqx.modules.firstLogin.service.PostSkillService;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class PostSkillImpl extends ServiceImpl<PostSkillDao,PostSkill> implements PostSkillService {
+    @Override
+    public List<PostSkill> getPostSkill(PostSkill postSkill) {
+        return getPostSkillTree(baseMapper.selectList(new QueryWrapper<>(postSkill)));
+    }
+    private List<PostSkill> getPostSkillTree(List<PostSkill> records) {
+        return records.stream()
+                .filter(e -> e.getParentId() == 0)
+                .peek((menu) -> menu.setChildrenList(getChildrenList(menu, records)))
+                .sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort())))
+                .collect(Collectors.toList());
+    }
+    private List<PostSkill> getChildrenList(PostSkill root, List<PostSkill> all) {
+        return all.stream().filter(categoryEntity -> categoryEntity.getParentId().equals(root.getPostSkillId())).peek(categoryEntity -> {
+            //1、找到子菜单(递归)
+            categoryEntity.setChildrenList(getChildrenList(categoryEntity, all));
+        }).sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))).collect(Collectors.toList());
+    }
+}

+ 21 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/SkillServiceImpl.java

@@ -0,0 +1,21 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.SkillDao;
+import com.sqx.modules.firstLogin.entity.Skill;
+import com.sqx.modules.firstLogin.service.SkillService;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+@Service
+public class SkillServiceImpl extends ServiceImpl<SkillDao, Skill> implements SkillService {
+    @Override
+    public List<Skill> selectSkill(Integer userId) {
+        QueryWrapper<Skill> queryWrapper =new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("is_use",1);
+        return  baseMapper.selectList(queryWrapper);
+    }
+}

+ 11 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/WorkExpDetailServiceImpl.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.WorkExpDetailDao;
+import com.sqx.modules.firstLogin.entity.WorkExpDetail;
+import com.sqx.modules.firstLogin.service.WorkExpDetailService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class WorkExpDetailServiceImpl extends ServiceImpl<WorkExpDetailDao,WorkExpDetail> implements WorkExpDetailService {
+}

+ 154 - 0
src/main/java/com/sqx/modules/firstLogin/service/impl/WorkExpServiceImpl.java

@@ -0,0 +1,154 @@
+package com.sqx.modules.firstLogin.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.firstLogin.dao.WorkExpDao;
+import com.sqx.modules.firstLogin.dto.WorkExpDetailDto;
+import com.sqx.modules.firstLogin.dto.WorkExpDto;
+import com.sqx.modules.firstLogin.dto.WorkExpTime;
+import com.sqx.modules.firstLogin.entity.WorkExp;
+import com.sqx.modules.firstLogin.entity.WorkExpDetail;
+import com.sqx.modules.firstLogin.service.WorkExpDetailService;
+import com.sqx.modules.firstLogin.service.WorkExpService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@Service
+public class WorkExpServiceImpl extends ServiceImpl<WorkExpDao, WorkExp>implements WorkExpService {
+    @Autowired
+    private WorkExpDetailService workExpDetailService;
+
+    private final WorkExpDao workExpDao;
+
+    public WorkExpServiceImpl(WorkExpDao workExpDao) {
+        this.workExpDao = workExpDao;
+    }
+
+    @Override
+    public List<WorkExpDetailDto> selectWorkExp(Integer userId) {
+        return workExpDao.selectWorkExpList(userId);
+    }
+
+
+    @Override
+    public List<Object> selectWorkExpOne(Integer workExpId) {
+        return workExpDao.selectWorkExpOne(workExpId);
+    }
+
+    @Override
+    public List<WorkExp> selectWorkExpOnly(Long userId) {
+        QueryWrapper<WorkExp> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId).eq("is_use", 1);
+        return baseMapper.selectList(queryWrapper);
+    }
+
+    @Override
+    public Object getWorkExpDetailOne(Long workExpId) {
+        WorkExpDto workExpDto = new WorkExpDto();
+        workExpDto.setWorkExp(baseMapper.selectById(workExpId));
+        QueryWrapper<WorkExpDetail> workExpDetailQueryWrapper = new QueryWrapper<>();
+        workExpDetailQueryWrapper.eq("work_exp_id", workExpId);
+        workExpDto.setWorkExpDetails(workExpDetailService.getBaseMapper().selectList(workExpDetailQueryWrapper));
+        return workExpDto;
+    }
+
+    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+@Override
+public Integer getWorkTime(Long userId) {
+        List<WorkExpTime> sortedWorkExpTimes = workExpDao.getTime(userId);
+        if (sortedWorkExpTimes == null || sortedWorkExpTimes.isEmpty()) {
+            return 0;
+        }
+
+        // 1. 解析并过滤有效时间区间
+        List<Interval> validIntervals = new ArrayList<>();
+        for (WorkExpTime workExp : sortedWorkExpTimes) {
+            Interval interval = parseInterval(workExp.getStartTime(), workExp.getEndTime());
+            if (interval != null) {
+                validIntervals.add(interval);
+            }
+        }
+
+        // 2. 合并重叠/相邻区间(已排序,直接线性合并)
+        List<Interval> mergedIntervals = mergeSortedIntervals(validIntervals);
+
+        // 3. 计算总天数并转换为年(按365.25天/年,兼容闰年)
+        long totalDays = 0;
+        for (Interval interval : mergedIntervals) {
+            totalDays += ChronoUnit.DAYS.between(interval.start, interval.end);
+        }
+
+        return (int) (Math.round((totalDays / 365.25) * 100.0) / 100.0);
+    }
+
+    /**
+     * 解析单条工作经历时间为Interval对象(验证有效性)
+     */
+    private static Interval parseInterval(String startStr, String endStr) {
+        // 过滤空值
+        if (startStr == null || endStr == null || startStr.trim().isEmpty() || endStr.trim().isEmpty()) {
+            return null;
+        }
+
+        try {
+            // 解析时间(去除空格,防止格式错误)
+            LocalDateTime start = LocalDateTime.parse(startStr.trim(), FORMATTER);
+            LocalDateTime end = LocalDateTime.parse(endStr.trim(), FORMATTER);
+
+            // 确保start <= end(若颠倒则交换)
+            if (start.isAfter(end)) {
+                LocalDateTime temp = start;
+                start = end;
+                end = temp;
+            }
+
+            return new Interval(start, end);
+        } catch (Exception e) {
+            // 忽略解析失败的记录(如格式不匹配)
+            System.err.println("解析失败:start=" + startStr + ", end=" + endStr);
+            return null;
+        }
+    }
+
+    /**
+     * 合并已按start升序排列的区间(核心逻辑)
+     */
+    private static List<Interval> mergeSortedIntervals(List<Interval> sortedIntervals) {
+        if (sortedIntervals.isEmpty()) {
+            return Collections.emptyList();
+        }
+
+        List<Interval> merged = new ArrayList<>();
+        // 初始化当前区间为第一个有效区间
+        Interval current = sortedIntervals.get(0);
+
+        // 从第二个区间开始遍历
+        for (int i = 1; i < sortedIntervals.size(); i++) {
+            Interval next = sortedIntervals.get(i);
+
+            // 若下一个区间的start <= 当前区间的end → 重叠或相邻,合并
+            if (!next.start.isAfter(current.end)) {
+                // 合并后的end取两者中较晚的时间
+                LocalDateTime newEnd = next.end.isAfter(current.end) ? next.end : current.end;
+                current = new Interval(current.start, newEnd);
+            } else {
+                // 不重叠,将当前区间加入结果,更新current为下一个区间
+                merged.add(current);
+                current = next;
+            }
+        }
+
+        // 加入最后一个区间
+        merged.add(current);
+        return merged;
+    }
+}
+
+

+ 26 - 7
src/main/java/com/sqx/modules/intention/controller/AppIntentionController.java

@@ -1,6 +1,7 @@
 package com.sqx.modules.intention.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.intention.entity.Intention;
@@ -10,6 +11,8 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.time.LocalDateTime;
+
 /**
  * <p>
  * 前端控制器
@@ -29,24 +32,36 @@ public class AppIntentionController {
     @Login
     @ApiOperation("添加求职意向")
     @PostMapping(value = "saveUpdate")
-    public Result saveUpdate(@RequestAttribute("userId") Long userId, Intention Intention) {
+    public Result saveUpdate(@RequestAttribute("userId") Long userId, @RequestBody Intention Intention) {
         Intention.setUserId(userId);
+        Intention.setClassifyOneId(0L);
+        Intention.setClassifyTwoId(0L);
+        Intention.setCreateTime(LocalDateTime.now());
+        Intention.setIndustryId(201L);
+        Intention.setIndustryOneId(200L);
+        Intention.setIsDefault(1);
+        String[] parts = Intention.getSalaryRange().trim().split("-", 2);
+        Intention.setMinSalary(Integer.parseInt(parts[0].trim()));
+        Intention.setMaxSalary(Integer.parseInt(parts[1].trim()));
         return intentionService.saveUpdate(Intention);
     }
 
     @Login
     @ApiOperation("获取求职意向列表")
     @GetMapping(value = "getIntentionList")
-    public Result getIntentionList(@RequestAttribute("userId") Long userId, Integer page, Integer limit, Intention intention) {
-        intention.setUserId(userId);
-        return Result.success().put("data", intentionService.getIntentionList(page, limit, intention));
+    public Result getIntentionList(@RequestAttribute("userId") Long userId) {
+        QueryWrapper<Intention> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("is_default",1);
+        return Result.success().put("data", intentionService.getBaseMapper().selectList(queryWrapper));
     }
 
     @Login
     @ApiOperation("获取求职意向信息")
     @GetMapping(value = "getIntentionInfo")
     public Result getIntentionInfo(Long intentionId) {
-        return Result.success().put("data", intentionService.getById(intentionId));
+        QueryWrapper<Intention> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("intention_id",intentionId);
+        return Result.success().put("data", intentionService.getOne(queryWrapper));
 
 
     }
@@ -54,8 +69,12 @@ public class AppIntentionController {
     @Login
     @ApiOperation("删除求职意向")
     @PostMapping(value = "deleteIntention")
-    public Result deleteIntention(Long intentionId) {
-        return intentionService.removeById(intentionId) ? Result.success() : Result.error();
+    public Result deleteIntention(@RequestAttribute("userId")Long userId,@RequestBody Intention intention) {
+        int a = intentionService.count(new QueryWrapper<Intention>().eq("user_id",userId).eq("is_default",1));
+        if(a==1){
+            return Result.error("请至少保留一条意向");
+        }
+        return intentionService.removeById(intention.getIntentionId()) ? Result.success() : Result.error();
     }
 }
 

+ 2 - 0
src/main/java/com/sqx/modules/intention/entity/Intention.java

@@ -90,5 +90,7 @@ public class Intention implements Serializable {
      *是否是默认 0否 1是
      */
     private Integer isDefault;
+    private Integer minSalary;
+    private Integer maxSalary;
 
 }

+ 4 - 0
src/main/java/com/sqx/modules/intention/service/IntentionService.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.intention.entity.Intention;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -18,4 +20,6 @@ public interface IntentionService extends IService<Intention> {
     Result saveUpdate(Intention Intention);
 
     IPage<Intention> getIntentionList(Integer page, Integer limit, Intention intention);
+
+    List<Intention> getIntention(Long userId);
 }

+ 14 - 28
src/main/java/com/sqx/modules/intention/service/impl/IntentionServiceImpl.java

@@ -19,6 +19,8 @@ import org.springframework.stereotype.Service;
 import weixin.popular.bean.datacube.article.Usershare;
 
 import java.time.LocalDateTime;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * <p>
@@ -39,36 +41,13 @@ public class IntentionServiceImpl extends ServiceImpl<IntentionDao, Intention> i
 
     @Override
     public Result saveUpdate(Intention intention) {
-        if (intention.getIsDefault() == 1) {
-            Intention updateIntention = new Intention();
-            updateIntention.setIsDefault(0);
-            baseMapper.update(updateIntention, new QueryWrapper<Intention>().eq("user_id", intention.getUserId()));
-        }
-        QueryWrapper<Intention> wrapper = new QueryWrapper<Intention>().eq("user_id", intention.getUserId());
-        if (intention.getIntentionId() != null) {
-            wrapper.ne("intention_id", intention.getIntentionId());
-        }
-        int count = baseMapper.selectCount(wrapper);
-        UserEntity userEntity = userService.getById(intention.getUserId());
-        int maxCount = Integer.parseInt(commonInfoService.findOne(325).getValue());
-        if (count > maxCount) {
-            return Result.error("求职意向最多添加" + maxCount + "个");
-        }
-        if (intention.getIntentionId() != null) {
-            return Result.upStatus(baseMapper.updateById(intention));
-        } else {
-            intention.setCreateTime(LocalDateTime.now());
-            intention.setUserName(userEntity.getUserName());
-            RuleClassify ruleClassify = classifyService.getById(intention.getRuleClassifyId());
-            RuleClassify twoClassify = classifyService.getOne(new QueryWrapper<RuleClassify>().eq("rule_classify_id", ruleClassify.getParentId()));
-            RuleClassify oneClassify = classifyService.getOne(new QueryWrapper<RuleClassify>().eq("rule_classify_id", twoClassify.getParentId()));
-            intention.setRuleClassifyId(ruleClassify.getRuleClassifyId());
-            intention.setClassifyTwoId(twoClassify.getRuleClassifyId());
-            intention.setClassifyOneId(oneClassify.getRuleClassifyId());
-            return Result.upStatus(baseMapper.insert(intention));
+        int num = baseMapper.selectCount(new QueryWrapper<Intention>().eq("user_id", intention.getUserId()).eq("is_default", 1));
+        if (num < 3) {
+             return Result.upStatus(baseMapper.insert(intention));
+        }else {
+            return  Result.error("最多保存三条求职意向");
         }
     }
-
     @Override
     public IPage<Intention> getIntentionList(Integer page, Integer limit, Intention intention) {
         Page<Intention> pages;
@@ -80,4 +59,11 @@ public class IntentionServiceImpl extends ServiceImpl<IntentionDao, Intention> i
         }
         return baseMapper.selectPage(pages, new QueryWrapper<>(intention).orderByDesc("create_time"));
     }
+
+    @Override
+    public List<Intention> getIntention(Long userId) {
+        QueryWrapper<Intention>queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("is_default",1);
+        return baseMapper.selectList(queryWrapper);
+    }
 }

+ 71 - 9
src/main/java/com/sqx/modules/interviewRecord/controller/InterviewRecordController.java

@@ -6,7 +6,9 @@ import com.sqx.common.utils.Result;
 import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.service.UserService;
+import com.sqx.modules.interviewRecord.entity.HrPhone;
 import com.sqx.modules.interviewRecord.entity.InterviewRecord;
+import com.sqx.modules.interviewRecord.service.HrPhoneService;
 import com.sqx.modules.interviewRecord.service.InterviewRecordService;
 import com.sqx.modules.resumes.entity.Company;
 import com.sqx.modules.resumes.service.CompanyService;
@@ -33,17 +35,28 @@ public class InterviewRecordController {
     private UserService userService;
     @Autowired
     private CompanyService companyService;
+    @Autowired
+    private InterviewRecordService interviewRecordService;
+    @Autowired
+    private HrPhoneService hrPhoneService;
+
     @Login
     @ApiOperation("获取面试记录列表")
     @GetMapping("interviewList")
     public Result interviewList(@RequestAttribute("userId")Long userId, Integer page, Integer limit, InterviewRecord interviewRecord) {
-        UserEntity userEntity = userService.getById(userId);
-        if(userEntity.getUserType()==1){
-            interviewRecord.setUserId(userId);
-        }else {
-            Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", userId));
-            interviewRecord.setCompanyId(company.getCompanyId());
-        }
+            UserEntity userEntity = userService.getById(userId);
+            if(userEntity.getUserType() == 1){
+            interviewRecord.setInterviewerId(Math.toIntExact(userId));
+            }else {
+                interviewRecord.setUserId(userId);
+            }
+        return Result.success().put("data", recordService.interviewList(page, limit, interviewRecord));
+    }
+    @Login
+    @GetMapping("getHrInterviewList")
+    @ApiOperation("招聘端获取自己发布的岗位")
+    public Result getHrInterviewList(@RequestAttribute("userId")Long userId, Integer page, Integer limit, InterviewRecord interviewRecord) {
+        interviewRecord.setUserId(userId);
         return Result.success().put("data", recordService.interviewList(page, limit, interviewRecord));
     }
 
@@ -52,10 +65,16 @@ public class InterviewRecordController {
     public Result getInterviewInfo(Long recordId){
         return Result.success().put("data", recordService.getInterviewInfo(recordId));
     }
-
+    @Login
     @ApiOperation("添加或修改面试记录")
     @PostMapping("saveInterview")
-    public Result saveInterview(@RequestBody InterviewRecord interviewRecord) {
+    public Result saveInterview(@RequestAttribute("userId")Long userId,@RequestBody InterviewRecord interviewRecord) {
+        UserEntity userEntity = userService.getById(userId);
+        if(userEntity.getUserType() == 1){
+            interviewRecord.setInterviewerId(Math.toIntExact(userId));
+        }else {
+            interviewRecord.setUserId(userId);
+        }
         return recordService.saveInterview(interviewRecord);
     }
 
@@ -72,5 +91,48 @@ public class InterviewRecordController {
     public Result isSendView(Long postPushId,Long userId) {
         return recordService.isSendView(postPushId,userId);
     }
+
+//    @Login
+//    @PostMapping("addInterview")
+//    @ApiOperation("新增面试邀请")
+//    public  Result addInterview(@RequestAttribute("userId")Long userId,@RequestBody InterviewRecord interviewRecord){
+//        interviewRecord.setUserId(userId);
+//        interviewRecordService.saveOrUpdate(interviewRecord);
+//        return  Result.success();
+//    }
+
+    @Login
+    @GetMapping("selectInterviewListOfUser")
+    @ApiOperation("用户搜索面试列表")
+    public  Result selectInterviewList(@RequestAttribute("userId")Long userId){
+        return Result.success().put("data",interviewRecordService.selectInterviewList(userId));
+    }
+
+    @Login
+    @PostMapping("addHrPhone")
+    @ApiOperation("新增岗位联系人")
+    public  Result addHrPhone (@RequestAttribute("userId")Long userId, @RequestBody HrPhone hrPhone){
+        hrPhone.setUserId(Math.toIntExact(userId));
+        hrPhone.setIsUse(1);
+        hrPhoneService.saveOrUpdate(hrPhone);
+        return  Result.success();
+    }
+    @Login
+    @GetMapping("selectHrPhone")
+    @ApiOperation("搜索岗位联系人")
+    public  Result selectHrPhone (@RequestAttribute("userId")Long userId){
+        return Result.success().put("data",hrPhoneService.getBaseMapper().selectList(new QueryWrapper<HrPhone>().eq("user_id",userId).eq("is_use",1)));
+    }
+    @Login
+    @PostMapping("deleteHrPhone")
+    @ApiOperation("删除联系人")
+    public  Result deleteHrPhone ( @RequestBody HrPhone hrPhone){
+        HrPhone hrPhone1 =hrPhoneService.getById(hrPhone.getHrPhoneId());
+        hrPhone1.setIsUse(0);
+        hrPhoneService.updateById(hrPhone1);
+        return Result.success();
+    }
+
+
 }
 

+ 9 - 0
src/main/java/com/sqx/modules/interviewRecord/dao/HrPhoneDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.interviewRecord.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.interviewRecord.entity.HrPhone;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface HrPhoneDao extends BaseMapper<HrPhone> {
+}

+ 2 - 0
src/main/java/com/sqx/modules/interviewRecord/dao/InterviewRecordDao.java

@@ -19,4 +19,6 @@ import java.util.List;
 public interface InterviewRecordDao extends BaseMapper<InterviewRecord> {
 
     List<InterviewRecord> getRecordList(@Param("hour") Integer hour);
+
+    List<Object> selectInterviewList(Long userId);
 }

+ 20 - 0
src/main/java/com/sqx/modules/interviewRecord/entity/HrPhone.java

@@ -0,0 +1,20 @@
+package com.sqx.modules.interviewRecord.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class HrPhone implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "hr_phone_id", type = IdType.AUTO)
+    private Integer hrPhoneId;
+    private Integer userId;
+    private String hrName;
+    private String hrPhone;
+    private java.util.Date creatTime;
+    private Integer isUse;
+}

+ 31 - 0
src/main/java/com/sqx/modules/interviewRecord/entity/InterviewRecord.java

@@ -7,12 +7,15 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.sqx.modules.app.entity.UserEntity;
+import com.sqx.modules.firstLogin.entity.HrEntity;
 import com.sqx.modules.resumes.entity.Company;
 import com.sqx.modules.resumes.entity.PostPush;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import lombok.Data;
 
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -103,6 +106,25 @@ public class InterviewRecord implements Serializable {
      */
     private Integer isSendHour;
 
+    private Integer postId;
+    private Integer type;
+    private String address;
+    private String  detailTime;
+    private Integer onlineType;
+    private String  onlineMsg;
+    private String  hrName;
+    private String  hrPhone;
+    private Integer interviewerId;
+    private String  interviewResultMsg;
+    private Integer interviewResultType;
+    private String  interviewRecordType;
+    private String  interviewRecordMsg;
+    private Integer interviewProcesses;
+    private Integer sign;
+    private String  signTime;
+    private String  reason;
+    private String  quiteMsg;
+    private String  quiteType;
     /**
      * 详细地址
      */
@@ -113,5 +135,14 @@ public class InterviewRecord implements Serializable {
     private PostPush postPush;
     @TableField(exist = false)
     private UserEntity userEntity;
+    @TableField(exist = false)
+    private HrEntity hr;
+    @TableField(exist = false)
+    private  Long resumesId;
+    @TableField(exist = false)
+    private List<ResumesListDto> resumesListDto;
+    @TableField(exist = false)
+    private UserEntity hrUserEntity;
+
 
 }

+ 7 - 0
src/main/java/com/sqx/modules/interviewRecord/service/HrPhoneService.java

@@ -0,0 +1,7 @@
+package com.sqx.modules.interviewRecord.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.interviewRecord.entity.HrPhone;
+
+public interface HrPhoneService extends IService<HrPhone> {
+}

+ 2 - 0
src/main/java/com/sqx/modules/interviewRecord/service/InterviewRecordService.java

@@ -28,4 +28,6 @@ public interface InterviewRecordService extends IService<InterviewRecord> {
     InterviewRecord getInterviewInfo(Long recordId);
 
     Result isSendView(Long postPushId, Long userId);
+
+    List<Object> selectInterviewList(Long userId);
 }

+ 11 - 0
src/main/java/com/sqx/modules/interviewRecord/service/impl/HrPhoneServiceImpl.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.interviewRecord.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.interviewRecord.dao.HrPhoneDao;
+import com.sqx.modules.interviewRecord.entity.HrPhone;
+import com.sqx.modules.interviewRecord.service.HrPhoneService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class HrPhoneServiceImpl extends ServiceImpl<HrPhoneDao, HrPhone>implements HrPhoneService {
+}

+ 59 - 37
src/main/java/com/sqx/modules/interviewRecord/service/impl/InterviewRecordServiceImpl.java

@@ -3,22 +3,22 @@ package com.sqx.modules.interviewRecord.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.sqx.common.utils.DateUtils;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.app.service.UserService;
 import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
-import com.sqx.modules.industry.entity.Industry;
+import com.sqx.modules.firstLogin.service.HrService;
 import com.sqx.modules.interviewRecord.entity.InterviewRecord;
 import com.sqx.modules.interviewRecord.dao.InterviewRecordDao;
 import com.sqx.modules.interviewRecord.service.InterviewRecordService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.sqx.modules.message.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
+import com.sqx.modules.resumes.dao.ResumesDao;
 import com.sqx.modules.resumes.entity.Company;
-import com.sqx.modules.resumes.entity.PostPush;
 import com.sqx.modules.resumes.entity.Resumes;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import com.sqx.modules.resumes.service.CompanyService;
 import com.sqx.modules.resumes.service.PostPushService;
 import com.sqx.modules.resumes.service.ResumesService;
@@ -56,6 +56,10 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
     private ResumesService resumesService;
     @Autowired
     private MessageService messageService;
+    @Autowired
+    private HrService hrService;
+    @Autowired
+    private ResumesDao resumesDao;
 
     @Override
     public IPage<InterviewRecord> interviewList(Integer page, Integer limit, InterviewRecord interviewRecord) {
@@ -71,15 +75,15 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
         for (InterviewRecord record : records) {
             record.setCompany(companyService.getById(record.getCompanyId()));
             record.setPostPush(postPushService.getById(record.getPostPushId()));
-            UserEntity userEntity = userService.getById(record.getUserId());
-            if (userEntity != null) {
-                Resumes resumes = resumesService.getOne(new QueryWrapper<Resumes>().eq("user_id", userEntity.getUserId()));
-                if (resumes != null) {
-                    userEntity.setResumesId(resumes.getResumesId());
-                }
-                record.setUserEntity(userEntity);
+            UserEntity userEntity = userService.getById(record.getInterviewerId());
+            record.setHr(hrService.getByUserId(String.valueOf(record.getUserId())));
+            record.setUserEntity(userEntity);
+            ResumesListDto resumesListDto =new ResumesListDto();
+            resumesListDto.setResumesId(record.getResumesId());
+            record.setResumesListDto(resumesDao.selectResumesListHr(resumesListDto));
+            Resumes resumes =resumesService.selectResumesByUserId(Long.valueOf(record.getInterviewerId()));
+            record.setResumesId(resumes.getResumesId());
             }
-        }
         return selectPage;
     }
 
@@ -88,7 +92,8 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
         if (interviewRecord.getRecordId() != null) {
             return Result.upStatus(baseMapper.updateById(interviewRecord));
         } else {
-            InterviewRecord record = baseMapper.selectOne(new QueryWrapper<InterviewRecord>().in("company_id", interviewRecord.getCompanyId()).eq("user_id", interviewRecord.getUserId()).eq("status", 1));
+
+            InterviewRecord record = baseMapper.selectOne(new QueryWrapper<InterviewRecord>().in("company_id", interviewRecord.getCompanyId()).eq("interviewer_id",interviewRecord.getInterviewerId()).eq("interview_date_time",interviewRecord.getInterviewDateTime()).eq("user_id", interviewRecord.getUserId()).eq("status", 1));
             if (record != null) {
                 return Result.error("已发送面试邀请,请等待对方处理");
             }
@@ -96,8 +101,7 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             interviewRecord.setIsSendDay(0);
             interviewRecord.setIsSendHour(0);
             interviewRecord.setCreateTime(LocalDateTime.now());
-
-            UserEntity userEntity = userService.getById(interviewRecord.getUserId());
+            UserEntity userEntity = userService.getById(interviewRecord.getInterviewerId());
             if (StringUtils.isNotEmpty(userEntity.getClientid())) {
                 userService.pushToSingle("面试邀请", "您收到一个面试邀请", userEntity.getClientid());
             }
@@ -150,6 +154,7 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             int result = baseMapper.updateById(interview);
             if (result > 0) {
                 //给用户的通知
+
                 if (StringUtils.isNotBlank(userEntity.getOpenId())) {
                     sendInterViewMsg(userEntity, interview, 1);
                 }
@@ -161,11 +166,11 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
                 }
                 MessageInfo messageInfo = new MessageInfo();
                 messageInfo.setTitle("面试预约通知");
-                Resumes resumes = resumesService.selectResumesByUserId(interview.getUserId());
+//                Resumes resumes = resumesService.selectResumesByUserId(interview.getUserId());
                 if (type == 1) {
-                    messageInfo.setContent(resumes.getResumesName() + "同意了您的面试邀请");
+                    messageInfo.setContent(userEntity.getUserName() + "同意了您的面试邀请");
                 } else {
-                    messageInfo.setContent(resumes.getResumesName() + "拒绝了您的面试邀请");
+                    messageInfo.setContent(userEntity.getUserName() + "拒绝了您的面试邀请");
                 }
                 messageInfo.setState(String.valueOf(8));
                 messageInfo.setUserId(companyUser.getUserId().toString());
@@ -186,12 +191,6 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
             return Result.error("面试邀请不存在");
         }
     }
-
-    /**
-     * @param userEntity
-     * @param interview
-     * @param userType   1用户 2企业
-     */
     private void sendInterViewMsg(UserEntity userEntity, InterviewRecord interview, Integer userType) {
         CommonInfo tempId = commonInfoService.findOne(337);
         List<String> msgList = new ArrayList<>();
@@ -244,25 +243,48 @@ public class InterviewRecordServiceImpl extends ServiceImpl<InterviewRecordDao,
         InterviewRecord record = baseMapper.selectById(recordId);
         record.setCompany(companyService.getById(record.getCompanyId()));
         record.setPostPush(postPushService.getById(record.getPostPushId()));
-        record.setUserEntity(userService.getById(record.getUserId()));
+        record.setUserEntity(userService.getById(record.getInterviewerId()));
+        record.setHrUserEntity(userService.getById(record.getUserId()));
+        record.setHr(hrService.getByUserId(String.valueOf(record.getUserId())));
+        Resumes resumes = resumesService.selectResumesByUserId(Long.valueOf(record.getInterviewerId()));
+        record.setResumesId(resumes.getResumesId());
         return record;
-
     }
 
-    /**
-     * 是否能发送简历
-     *
-     * @param postPushId
-     * @param userId
-     * @return
-     */
-    @Override
+
     public Result isSendView(Long postPushId, Long userId) {
-        List<InterviewRecord> records = baseMapper.selectList(new QueryWrapper<InterviewRecord>().eq("user_id", userId).eq("post_push_id", postPushId).in("status", 1, 2));
-        if (records.size() > 0) {
-            return Result.success().put("data", false);
+        // 构建查询条件:用户ID、岗位推送ID、状态为待接受或已同意
+        QueryWrapper<InterviewRecord> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId)
+                .eq("post_push_id", postPushId)
+                .in("status", 1, 2); // 1待接受、2已同意
+
+        // 查询单条记录(因为 user_id + post_push_id + status 理论上唯一)
+        InterviewRecord record = baseMapper.selectOne(queryWrapper);
+
+        if (record != null) {
+            // 存在记录:返回 record_id
+            return Result.success().put("data", record.getRecordId());
+
         } else {
-            return Result.success().put("data", true);
+            // 不存在记录:返回 null 或约定值
+            return Result.success().put("data", null);
         }
     }
+
+
+//    @Override
+//    public Result isSendView(Long postPushId, Long userId) {
+//        List<InterviewRecord> records = baseMapper.selectList(new QueryWrapper<InterviewRecord>().eq("user_id", userId).eq("post_push_id", postPushId).in("status", 1, 2));
+//        if (!records.isEmpty()) {
+//            return Result.success().put("data", false);
+//        } else {
+//            return Result.success().put("data", true);
+//        }
+//    }
+
+    @Override
+    public List<Object> selectInterviewList(Long userId) {
+        return baseMapper.selectInterviewList(userId);
+    }
 }

+ 50 - 0
src/main/java/com/sqx/modules/message/controller/NoticeController.java

@@ -0,0 +1,50 @@
+package com.sqx.modules.message.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.message.entity.Notice;
+import com.sqx.modules.message.service.NoticeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+
+@RestController
+@Api(value = "公告管理", tags = {"公告管理"})
+@RequestMapping(value = "/app/message")
+public class NoticeController {
+    private final NoticeService noticeService;
+
+    public NoticeController(NoticeService noticeService) {
+        this.noticeService = noticeService;
+    }
+
+    @GetMapping("/selectNotice")
+    @ApiOperation("获取公告列表")
+    public Result selectNotice(){
+        HashMap<String,Object> map = new HashMap<>();
+        map.put("banner",noticeService.getBaseMapper().selectList(new QueryWrapper<Notice>().eq("is_use",1).eq("type",0)));
+        map.put("rule",noticeService.getBaseMapper().selectList(new QueryWrapper<Notice>().eq("is_use",1).eq("type",1)));
+        map.put("notice",noticeService.getBaseMapper().selectList(new QueryWrapper<Notice>().eq("is_use",1).eq("type",2)));
+        return  Result.success().put("data",map);
+    }
+
+    @PostMapping("/insertNotice")
+    @ApiOperation("增加或修改公告")
+    public  Result insertNotice(Notice notice){
+        noticeService.saveOrUpdate(notice);
+        return Result.success();
+    }
+    @PostMapping("/deleteNotice")
+    @ApiOperation("增加或修改公告")
+    public  Result deleteNotice(Long noticeId){
+        Notice notice = noticeService.getById(noticeId);
+        notice.setIsUse(0);
+        noticeService.saveOrUpdate(notice);
+        return Result.success();
+    }
+}

+ 0 - 4
src/main/java/com/sqx/modules/message/controller/app/AppMessageController.java

@@ -101,8 +101,4 @@ public class AppMessageController {
         messageService.delete(id);
         return Result.success();
     }
-
-
-
-
 }

+ 9 - 0
src/main/java/com/sqx/modules/message/dao/NoticeDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.message.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.message.entity.Notice;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface NoticeDao extends BaseMapper<Notice> {
+}

+ 20 - 0
src/main/java/com/sqx/modules/message/entity/Notice.java

@@ -0,0 +1,20 @@
+package com.sqx.modules.message.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class Notice implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(type = IdType.AUTO)
+    private  Long  noticeId;
+    private String noticeDetail;
+    private String noticeUpdateTime;
+    private Integer isUse;
+    private String noticeTitle;
+    private Integer type;
+
+}

+ 8 - 0
src/main/java/com/sqx/modules/message/service/NoticeService.java

@@ -0,0 +1,8 @@
+package com.sqx.modules.message.service;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.message.entity.Notice;
+
+public interface NoticeService extends IService<Notice> {
+}

+ 11 - 0
src/main/java/com/sqx/modules/message/service/impl/NoticeServiceImpl.java

@@ -0,0 +1,11 @@
+package com.sqx.modules.message.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.message.dao.NoticeDao;
+import com.sqx.modules.message.entity.Notice;
+import com.sqx.modules.message.service.NoticeService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class NoticeServiceImpl extends ServiceImpl<NoticeDao, Notice> implements NoticeService{
+}

+ 2 - 2
src/main/java/com/sqx/modules/myCollection/controller/AdminMyCollectionController.java

@@ -36,9 +36,9 @@ public class AdminMyCollectionController {
     @Login
     @GetMapping(value = "getCompanyCollectionList")
     @ApiOperation("企业获取我的收藏列表")
-    public Result getCompanyCollectionList(Integer page, Integer limit, MyCollection collection, Resumes resumes) {
+    public Result getCompanyCollectionList(@RequestAttribute("userId")Long userId, Integer page, Integer limit, MyCollection collection, Resumes resumes) {
         collection.setType(2);
-        return Result.success().put("data", collectionService.getCompanyCollectionList(page, limit, collection, resumes));
+        return Result.success().put("data", collectionService.getCompanyCollectionList(page, limit, collection, resumes,userId));
     }
 
     @Login

+ 1 - 1
src/main/java/com/sqx/modules/myCollection/controller/MyCollectionController.java

@@ -50,7 +50,7 @@ public class MyCollectionController {
     public Result getCompanyCollectionList(Integer page, Integer limit, @RequestAttribute("userId") Long userId, MyCollection collection, Resumes resumes) {
         collection.setUserId(userId);
         collection.setType(2);
-        return Result.success().put("data", collectionService.getCompanyCollectionList(page, limit, collection, resumes));
+        return Result.success().put("data", collectionService.getCompanyCollectionList(page, limit, collection, resumes,userId));
     }
 
     @Login

+ 3 - 0
src/main/java/com/sqx/modules/myCollection/dao/MyCollectionDao.java

@@ -1,5 +1,6 @@
 package com.sqx.modules.myCollection.dao;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sqx.modules.app.vo.ResumesBrowseVo;
@@ -25,4 +26,6 @@ public interface MyCollectionDao extends BaseMapper<MyCollection> {
     IPage<UserPostPushBrowseVo> getMyCollectionList(@Param("pages") Page<UserPostPushBrowseVo> pages, @Param("collection") MyCollection collection, @Param("postPush") PostPush postPush, @Param("industry") String[] industry, @Param("education") String[] education, @Param("experience") String[] experience, @Param("companyPeople") String[] companyPeople, @Param("salaryRange") String[] salaryRange);
 
     IPage<ResumesBrowseVo> getCompanyCollectionList(@Param("pages") Page<ResumesBrowseVo> pages, @Param("collection") MyCollection collection, @Param("resumes") Resumes resumes, @Param("resumesCompensation") String[] resumesCompensation, @Param("resumesEducation") String[] resumesEducation, @Param("resumesWorkExperience") String[] resumesWorkExperience, @Param("industryName") String[] industryName);
+
+    IPage<ResumesBrowseVo> selectPage(Page<ResumesBrowseVo> pages, QueryWrapper<MyCollection> queryWrapper);
 }

+ 4 - 0
src/main/java/com/sqx/modules/myCollection/entity/MyCollection.java

@@ -7,10 +7,12 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.sqx.modules.app.entity.UserEntity;
 import com.sqx.modules.resumes.entity.Company;
 import com.sqx.modules.resumes.entity.PostPush;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import lombok.Data;
 
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -48,6 +50,8 @@ public class MyCollection implements Serializable {
      * 简历id
      */
     private Integer resumesId;
+    @TableField(exist = false)
+    private List<ResumesListDto> resumesListDto;
 
     /**
      * 创建时间

+ 1 - 1
src/main/java/com/sqx/modules/myCollection/service/MyCollectionService.java

@@ -25,5 +25,5 @@ public interface MyCollectionService extends IService<MyCollection> {
 
     IPage<MyCollection> getMyCollectionList(Integer page, Integer limit, MyCollection collection);
 
-    IPage<ResumesBrowseVo> getCompanyCollectionList(Integer page, Integer limit, MyCollection collection, Resumes resumes);
+    IPage<MyCollection> getCompanyCollectionList(Integer page, Integer limit, MyCollection collection, Resumes resumes,Long userId);
 }

+ 26 - 12
src/main/java/com/sqx/modules/myCollection/service/impl/MyCollectionServiceImpl.java

@@ -11,9 +11,11 @@ import com.sqx.modules.myCollection.entity.MyCollection;
 import com.sqx.modules.myCollection.dao.MyCollectionDao;
 import com.sqx.modules.myCollection.service.MyCollectionService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.resumes.dao.ResumesDao;
 import com.sqx.modules.resumes.entity.PostPush;
 import com.sqx.modules.resumes.entity.Resumes;
 import com.sqx.modules.resumes.entity.ResumesDetails;
+import com.sqx.modules.resumes.entity.ResumesListDto;
 import com.sqx.modules.resumes.service.CompanyService;
 import com.sqx.modules.resumes.service.PostPushService;
 import com.sqx.modules.resumes.service.ResumesDetailsService;
@@ -40,6 +42,10 @@ public class MyCollectionServiceImpl extends ServiceImpl<MyCollectionDao, MyColl
     private PostPushService postPushService;
     @Autowired
     private ResumesDetailsService resumesDetailsService;
+    @Autowired
+    private MyCollectionService myCollectionService;
+    @Autowired
+    private ResumesDao resumesDao;
 
     @Override
     public Result saveCollection(MyCollection collection) {
@@ -78,8 +84,8 @@ public class MyCollectionServiceImpl extends ServiceImpl<MyCollectionDao, MyColl
     }
 
     @Override
-    public IPage<ResumesBrowseVo> getCompanyCollectionList(Integer page, Integer limit, MyCollection collection, Resumes resumes) {
-        Page<ResumesBrowseVo> pages;
+    public IPage<MyCollection> getCompanyCollectionList(Integer page, Integer limit, MyCollection collection, Resumes resumes, Long userId) {
+        Page<MyCollection> pages;
         if (page != null && limit != null) {
             pages = new Page<>(page, limit);
         } else {
@@ -87,16 +93,24 @@ public class MyCollectionServiceImpl extends ServiceImpl<MyCollectionDao, MyColl
             pages.setSize(-1);
         }
 
-        String[] resumesCompensation = StringUtils.isNotBlank(resumes.getResumesCompensation()) ? resumes.getResumesCompensation().split(",") : null;
-        String[] resumesEducation = StringUtils.isNotBlank(resumes.getResumesEducation()) ? resumes.getResumesEducation().split(",") : null;
-        String[] resumesWorkExperience = StringUtils.isNotBlank(resumes.getResumesWorkExperience()) ? resumes.getResumesWorkExperience().split(",") : null;
-        String[] industryName = StringUtils.isNotBlank(resumes.getIndustryName()) ? resumes.getIndustryName().split(",") : null;
-
-
-        IPage<ResumesBrowseVo> companyCollectionList = baseMapper.getCompanyCollectionList(pages, collection, resumes, resumesCompensation, resumesEducation, resumesWorkExperience, industryName);
-        for (ResumesBrowseVo record : companyCollectionList.getRecords()) {
-            record.setResumesCompanyList(resumesDetailsService.list(new QueryWrapper<ResumesDetails>().eq("resumes_id", record.getResumesId()).eq("resumes_classify", 1)));
-
+//        String[] resumesCompensation = StringUtils.isNotBlank(resumes.getResumesCompensation()) ? resumes.getResumesCompensation().split(",") : null;
+//        String[] resumesEducation = StringUtils.isNotBlank(resumes.getResumesEducation()) ? resumes.getResumesEducation().split(",") : null;
+//        String[] resumesWorkExperience = StringUtils.isNotBlank(resumes.getResumesWorkExperience()) ? resumes.getResumesWorkExperience().split(",") : null;
+//        String[] industryName = StringUtils.isNotBlank(resumes.getIndustryName()) ? resumes.getIndustryName().split(",") : null;
+
+
+//        IPage<ResumesBrowseVo> companyCollectionList = baseMapper.getCompanyCollectionList(pages, collection, resumes, resumesCompensation, resumesEducation, resumesWorkExperience, industryName);
+//        for (ResumesBrowseVo record : companyCollectionList.getRecords()) {
+//            record.setResumesCompanyList(resumesDetailsService.list(new QueryWrapper<ResumesDetails>().eq("resumes_id", record.getResumesId()).eq("resumes_classify", 1)));
+//
+//        }
+        QueryWrapper<MyCollection> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("type",2);
+        IPage<MyCollection> companyCollectionList =myCollectionService.getBaseMapper().selectPage(pages,queryWrapper);
+        for (MyCollection c : companyCollectionList.getRecords()){
+            ResumesListDto resumesListDto = new ResumesListDto();
+            resumesListDto.setResumesId(Long.valueOf(c.getResumesId()));
+            c.setResumesListDto(resumesDao.selectResumesListHr(resumesListDto));
         }
         return companyCollectionList;
     }

+ 3 - 1
src/main/java/com/sqx/modules/pay/service/PayDetailsService.java

@@ -1,9 +1,11 @@
 package com.sqx.modules.pay.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
+import com.sqx.modules.pay.entity.PayDetails;
 
-public interface PayDetailsService {
+public interface PayDetailsService extends IService<PayDetails> {
 
     PageUtils selectPayDetails(int page, int limit, String startTime, String endTime, Long userId, Integer state, String userName, String orderId, Integer type, String phone);
 

+ 79 - 0
src/main/java/com/sqx/modules/post/controller/PostController.java

@@ -0,0 +1,79 @@
+package com.sqx.modules.post.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sqx.common.utils.Result;
+
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.post.entity.PostEntity;
+import com.sqx.modules.post.service.PostService;
+import com.sqx.modules.post.service.ViewPostService;
+import io.swagger.annotations.ApiOperation;
+import org.joda.time.LocalDateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/app/post")
+public class PostController {
+    @Autowired
+    private PostService postService;
+    @Autowired
+    private ViewPostService viewPostService;
+
+
+    @GetMapping("getPostListOfUser")
+    @ApiOperation("获取岗位列表")
+    public Result getPostListOfUser() {
+        return Result.success().put("data", postService.getPostListOfUser());
+    }
+    @Login
+    @GetMapping("getPostOnly")
+    @ApiOperation("获取岗位详细信息")
+    public Result getPostListOne(Integer postId,@RequestAttribute("userId") Long userId) {
+        viewPostService.addViewPost(postId,userId);
+        return Result.success().put("data", postService.getPostListOne(postId));
+    }
+    @Login
+    @GetMapping("getPostOnlyHr")
+    @ApiOperation("获取岗位详细信息")
+    public Result getPostListOneByHr(Integer postId) {
+        return Result.success().put("data", postService.getPostListOne(postId));
+    }
+    @Login
+    @PostMapping("addPost")
+    @ApiOperation("增加岗位")
+    public void addPost(@RequestAttribute("userId") Long userId,@RequestBody PostEntity postEntity) {
+        postEntity.setUserId(userId);
+        postService.saveOrUpdate(postEntity);
+
+    }
+
+    @PostMapping("changePostStatus")
+    @ApiOperation("更改岗位状态岗位列表")
+    public void changePostStatus(Integer postId, Integer status) {
+        PostEntity postEntity1 = postService.getById(postId);
+        postEntity1.setStatus(status);
+        postService.updateById(postEntity1);
+    }
+
+    @GetMapping("findPost")
+    @ApiOperation("查找岗位列表")
+    public Result findPost(String address, Integer wage, Integer edu, Integer companyPeople, String key) {
+        return Result.success().put("data", postService.findPost(address, wage, edu, companyPeople, key));
+    }
+    @PostMapping("changePost")
+    @ApiOperation("更改岗位状态岗位列表")
+    public Result changePost(@RequestBody PostEntity postEntity) {
+        postEntity.setUpdateTime(String.valueOf(LocalDateTime.now()));
+        postService.saveOrUpdate(postEntity);
+        return  Result.success();
+    }
+    @Login
+    @GetMapping("getMyPost")
+    @ApiOperation("获取我发布的岗位详细信息")
+    public Result getPostListOne(@RequestAttribute("userId") Integer userId) {
+        QueryWrapper<PostEntity> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId);
+        return Result.success().put("data", postService.getBaseMapper().selectList(queryWrapper));
+    }
+}

+ 65 - 0
src/main/java/com/sqx/modules/post/controller/ViewPostController.java

@@ -0,0 +1,65 @@
+package com.sqx.modules.post.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.app.annotation.Login;
+import com.sqx.modules.post.entity.ViewPost;
+import com.sqx.modules.post.service.ViewPostService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDateTime;
+
+@RestController
+@RequestMapping("/app/viewPost")
+public class ViewPostController {
+    @Autowired
+    private ViewPostService viewPostService;
+    @Login
+    @GetMapping("getViewPost")
+    @ApiOperation("获取查看的岗位列表")
+    public Result getViewPost(@RequestAttribute("userId") Long userId){
+
+        return  Result.success().put("data",viewPostService.getViewPostList(userId));
+
+    }
+
+    @Login
+    @GetMapping("getCollectPost")
+    @ApiOperation("获取收藏的岗位列表")
+    public Result getCollectPost(@RequestAttribute("userId") Long userId) {
+
+        return  Result.success().put("data",viewPostService.getCollectPost(userId));
+    }
+    @Login
+    @PostMapping("collectPost")
+    @ApiOperation("是否收藏岗位")
+    public Result  collectPost(@RequestAttribute("userId") Integer userId,Integer postId,Integer isCollect){
+        QueryWrapper<ViewPost> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id",userId).eq("post_id",postId);
+        ViewPost viewPost = viewPostService.getOne(queryWrapper);
+        viewPost.setIsCollect(isCollect);
+        viewPostService.saveOrUpdate(viewPost);
+        return  Result.success();
+    }
+
+    @Login
+    @PostMapping("pushPost")
+    @ApiOperation("投送简历")
+    public Result pushPost(@RequestAttribute("userId")  Long userId, String postId) {
+        QueryWrapper<ViewPost> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId).eq("post_id", postId);
+        ViewPost viewPost = viewPostService.getOne(queryWrapper);
+        viewPost.setIsPush(1);
+        viewPost.setCreatTime(String.valueOf(LocalDateTime.now()));
+        viewPostService.saveOrUpdate(viewPost);
+        return Result.success();
+    }
+    @Login
+    @GetMapping("gerPushPost")
+    @ApiOperation("获取收藏的岗位列表")
+    public Result getPushPost(@RequestAttribute("userId") Long userId) {
+        return  Result.success().put("data",viewPostService.getPushPost(userId));
+    }
+}

+ 9 - 0
src/main/java/com/sqx/modules/post/dao/PostDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.post.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.post.entity.PostEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PostDao extends BaseMapper<PostEntity> {
+}

+ 9 - 0
src/main/java/com/sqx/modules/post/dao/ViewPostDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.post.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.post.entity.ViewPost;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ViewPostDao extends BaseMapper<ViewPost> { ;
+}

+ 22 - 0
src/main/java/com/sqx/modules/post/dto/SelectAllDto.java

@@ -0,0 +1,22 @@
+package com.sqx.modules.post.dto;
+
+import lombok.Data;
+
+@Data
+public class SelectAllDto {
+    private Integer postId; // 对应 p.post_id AS postId(职位ID)
+    private String ruleClassifyName; // 对应 p.rule_classify_name AS ruleClassifyName(职位分类名称)
+    private String postImTag; // 对应 p.post_im_tag AS postImTag(职位标签)
+    private String wage; // 对应 p.wage AS wage(薪资)
+    private String address; // 对应 p.address AS address(工作地址)
+    private Integer ifDue; // 对应 p.if_due AS ifDue(是否到期,状态标识)
+
+    // 公司表字段(c前缀)
+    private Integer companyId; // 对应 c.company_id AS companyId(公司ID)
+    private String companyName; // 对应 c.company_name AS companyName(公司名称)
+    private String companyPeople; // 对应 c.company_people AS companyPeople(公司人数)
+
+    // HR表字段(h前缀)
+    private String hrImg; // 对应 h.hr_img AS hrImg(HR头像)
+    private String hrName; // 对应 h.hr_name AS hrName(HR姓名
+}

+ 101 - 0
src/main/java/com/sqx/modules/post/dto/SelectOneDto.java

@@ -0,0 +1,101 @@
+package com.sqx.modules.post.dto;
+
+import lombok.Data;
+
+@Data
+public class SelectOneDto {
+    /**
+     * 岗位ID
+     */
+    private Long postId;
+
+    /**
+     * 岗位类型
+     */
+    private Integer postType;  // 若为字符串类型可改为String
+
+    /**
+     * 规则分类名称
+     */
+    private String ruleClassifyName;
+
+    /**
+     * 岗位IM标签
+     */
+    private String postImTag;  // 若为多标签可改为List<String>
+
+    /**
+     * 岗位描述
+     */
+    private String postDescribe;
+
+    /**
+     * 工作经验要求
+     */
+    private String exp;  // 例如:"1-3年"
+
+    /**
+     * 学历要求
+     */
+    private String edu;  // 例如:"本科"
+
+    /**
+     * 薪资范围
+     */
+    private String wage;  // 例如:"10k-20k"
+
+    /**
+     * 福利标签
+     */
+    private String welfareTag;  // 若为多标签可改为List<String>
+
+    /**
+     * 福利详情
+     */
+    private String welfareDetails;
+
+    /**
+     * 评价标签
+     */
+    private String commentTag;  // 若为多标签可改为List<String>
+
+    /**
+     * 工作地址
+     */
+    private String address;
+
+    /**
+     * 岗位状态(例如:0-未发布,1-已发布)
+     */
+    private Integer status;
+
+    /**
+     * 是否到期(例如:0-未到期,1-已到期)
+     */
+    private Integer ifDue;
+
+    /**
+     * 公司ID
+     */
+    private Long companyId;
+
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
+    /**
+     * 公司人数
+     */
+    private String companyPeople;  // 例如:"500-1000人"
+
+    /**
+     * HR头像
+     */
+    private String hrImg;  // 通常为图片URL
+
+    /**
+     * HR姓名
+     */
+    private String hrName;
+}

+ 91 - 0
src/main/java/com/sqx/modules/post/entity/PostEntity.java

@@ -0,0 +1,91 @@
+package com.sqx.modules.post.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+@TableName("post")
+public class PostEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 发布岗位id
+     */
+    @TableId(value = "post_id", type = IdType.AUTO)
+    private Integer postId;
+    /**
+     * 岗位类型  0 社招全职 1 应届生校园招聘 2 实习生招聘 3 兼职招聘
+     */
+    private Integer postType;
+    /**
+     * 招聘职位名称
+     */
+    private String ruleClassifyName;
+    /**
+     * 招聘推荐词条
+     */
+    private String postImTag;
+    /**
+     * 招聘详细信息
+     */
+    private String PostDescribe;
+    /**
+     * 招聘经验要求 0 不限 1 一年以内 2 一到三年 3 三到五年 4 五到十年 5 十年以上
+     */
+    private Integer exp;
+    /**
+     * 招聘最低学历要求  0 不限 1 专科 2 本科 3 硕士 4 博士
+     */
+    private Integer edu;
+
+    /**
+     * 薪资范围
+     */
+    private Integer wage;
+    /**
+     * 福利tag
+     */
+    private String welfareTag;
+
+    /**
+     * 福利详情
+     */
+    private String welfareDetails;
+
+    /**
+     * 详情tag
+     */
+    private String commentTag;
+
+    /**
+     * 公司地址
+     */
+    private String address;
+
+    /**
+     * 招聘发布人Id
+     */
+    private Long userId;
+
+    /**
+     * 招聘公司id
+     */
+    private Integer companyId;
+
+    /**
+     * 招聘状态 0 审核未通过 1 审核通过 2 下架
+     */
+    private Integer status;
+
+    /**
+     * 是否加急 0 未加急 1 加急
+     */
+    private Integer ifDue;
+    /**
+     * 更新时间
+     */
+    private String updateTime;
+    private  Integer wageTime;
+}

+ 27 - 0
src/main/java/com/sqx/modules/post/entity/ViewPost.java

@@ -0,0 +1,27 @@
+package com.sqx.modules.post.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class ViewPost implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "view_post_id", type = IdType.AUTO)
+    private Integer viewPostId;
+
+    /** 用户id */
+    private Long userId;
+
+    /** 查看简历id */
+    private Integer postId;
+
+    /** 收藏状态:0=收藏,1=未收藏 */
+    private Integer isCollect;
+
+    /** 创建时间 */
+    private String creatTime;
+
+    private  Integer isPush;
+}

+ 23 - 0
src/main/java/com/sqx/modules/post/mapper/PostMapper.java

@@ -0,0 +1,23 @@
+package com.sqx.modules.post.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.post.entity.PostEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+
+import java.util.List;
+@Mapper
+public interface PostMapper extends BaseMapper<PostEntity> {
+
+    List<Object> selectPostWithUserAndCompanyByPostId();
+
+    List<Object> selectPostOne(Integer postId);
+
+    List<Object> findPost(String address, Integer wage, Integer exp, Integer companyPeople, String key);
+
+    List<Object> getViewPostList(Long userId);
+
+    List<Object> getCollectPostList(Long userId);
+
+    List<Object> getPushPost(Long userId);
+}

+ 15 - 0
src/main/java/com/sqx/modules/post/service/PostService.java

@@ -0,0 +1,15 @@
+package com.sqx.modules.post.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.post.entity.PostEntity;
+
+import java.util.List;
+
+public interface PostService extends IService<PostEntity>  {
+    List<Object> getPostListOfUser();
+
+
+    List<Object> getPostListOne(Integer postId);
+
+    List<Object> findPost(String address, Integer wage, Integer edu, Integer companyPeople, String key);
+}

+ 14 - 0
src/main/java/com/sqx/modules/post/service/ViewPostService.java

@@ -0,0 +1,14 @@
+package com.sqx.modules.post.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.modules.post.entity.ViewPost;
+
+public interface ViewPostService extends IService<ViewPost> {
+    void addViewPost(Integer postId, Long userId);
+
+    Object getViewPostList(Long userId);
+
+    Object getCollectPost(Long userId);
+
+    Object getPushPost(Long userId);
+}

+ 35 - 0
src/main/java/com/sqx/modules/post/service/impl/PostServiceImpl.java

@@ -0,0 +1,35 @@
+package com.sqx.modules.post.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.modules.post.dao.PostDao;
+import com.sqx.modules.post.entity.PostEntity;
+import com.sqx.modules.post.mapper.PostMapper;
+import com.sqx.modules.post.service.PostService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+@Service
+public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements PostService {
+
+ @Autowired
+ private PostMapper postMapper;
+
+    @Override
+    public List<Object> getPostListOfUser() {
+
+    return Collections.singletonList(postMapper.selectPostWithUserAndCompanyByPostId());
+    }
+
+    @Override
+    public List<Object> getPostListOne(Integer postId) {
+        return  postMapper.selectPostOne(postId);
+    }
+
+    @Override
+    public List<Object> findPost(String address, Integer wage, Integer edu, Integer companyPeople, String key) {
+        return  postMapper.findPost(address,wage,edu,companyPeople,key);
+    }
+}

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác