Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5556690788 | ||
|
|
6cfd8c57e1 | ||
|
|
09cf4cd5ed | ||
|
|
45dd6efe79 | ||
|
|
14cfeabb0b | ||
|
|
93ecc2364e | ||
|
|
a6a1081f74 | ||
|
|
ce801c1cf7 | ||
|
|
f6927c3327 | ||
|
|
1e5fc1506f | ||
|
|
313cc3593b | ||
|
|
ccec793079 | ||
|
|
d685dec660 | ||
|
|
f79a73a0c2 | ||
|
|
f4c60efdf2 | ||
|
|
c115f8b655 | ||
|
|
ab009d728a | ||
|
|
89e33e3713 |
+204
-93
@@ -10,11 +10,11 @@ offerpie/back-end
|
||||
│
|
||||
├─ pom.xml # 父 Maven 项目,统一管理依赖、插件、属性
|
||||
│
|
||||
├─ client‑api/ # **C 端**(面向用户)API 服务
|
||||
├─ client‑api/ # **C 端**(面向用户)API 服务,启动类 ClientApplication
|
||||
│ ├─ pom.xml
|
||||
│ └─ src/main/java
|
||||
│ └─ org.jiayunet
|
||||
│ ├─ ClientApplication.java # Spring Boot 主入口
|
||||
│ ├─ ClientApplication.java # Spring Boot 主入口(C 端)
|
||||
│ ├─ annotation/
|
||||
│ │ └─ FuncPermission.java # 功能权限校验注解(标记在Controller方法上)
|
||||
│ ├─ aop/
|
||||
@@ -29,6 +29,9 @@ offerpie/back-end
|
||||
│ │ ├─ JobIntentionController.java # 求职意向接口(查询与保存)
|
||||
│ │ ├─ JobController.java # 岗位接口(岗位列表查询、收藏、投递、不感兴趣、求职助手任务列表、AI岗位推荐)
|
||||
│ │ ├─ JobAgentConfigController.java # 求职助手配置接口(配置查询与保存)
|
||||
│ │ ├─ CompanyController.java # 公司接口(查询公司类型列表,/company)
|
||||
│ │ ├─ RecruitAnnouncementController.java # 招聘公告接口(公开免鉴权,/public/recruitAnnouncement)
|
||||
│ │ ├─ MentorController.java # 导师接口(对接简历星球开放平台,公开免鉴权,/public/mentor)
|
||||
│ │ ├─ MemberProductController.java # 会员商品接口(商品列表、创建订单、查询订单详情)【暂未启用,注释@RestController】
|
||||
│ │ ├─ MemberStatusController.java # 会员状态接口(查询会员状态、查询功能权限库存)
|
||||
│ │ └─ MessageController.java # 站内信消息接口(消息列表、未读数、按类型未读数、标记已读)
|
||||
@@ -43,6 +46,8 @@ offerpie/back-end
|
||||
│ │ ├─ JobIntentionService.java # 求职意向服务(查询与保存/更新)
|
||||
│ │ ├─ JobService.java # 岗位服务(岗位列表查询、匹配度计算编排、求职助手任务列表、AI岗位推荐)
|
||||
│ │ ├─ JobAgentConfigService.java # 求职助手配置服务(配置查询与保存)
|
||||
│ │ ├─ CompanyService.java # 公司服务(公司类型去重列表,兜底过滤NULL与空白值)
|
||||
│ │ ├─ RecruitAnnouncementService.java # 招聘公告服务(列表/详情/推荐/统计/筛选项/投递入口)
|
||||
│ │ ├─ UserResumeService.java # 用户简历服务(简历列表、主表及5张子表的CRUD、子表单条添加/编辑/删除、设置默认简历)
|
||||
│ │ ├─ MemberProductService.java # 会员商品服务(商品列表、创建订单、支付回调处理)【暂未启用,注释@Service】
|
||||
│ │ ├─ MemberGrantService.java # 会员权益发放服务(续费会员+发放功能/菜单权限)
|
||||
@@ -53,9 +58,10 @@ offerpie/back-end
|
||||
│ └─ pojo/
|
||||
│ ├─ param/
|
||||
│ │ ├─ userProfile/ # 个人资料入参(UserProfileParam、各子表Param)
|
||||
│ │ ├─ resume/ # 简历入参(ResumeParam、各子表Param、各子表UpdateParam、ResumeSubTableParam)
|
||||
│ │ ├─ resume/ # 简历入参(ResumeParam、各子表Param、各子表UpdateParam、ResumeSubTableParam、ResumeInfoUpdateParam)
|
||||
│ │ ├─ job/ # 岗位相关入参(JobIntentionParam、JobQueryParam、JobAgentTaskQueryParam、JobAgentRecommendParam、JobApplyParam、JobApplyQueryParam、JobFavoriteQueryParam、JobDislikeParam)
|
||||
│ │ ├─ jobAgent/ # 求职助手入参(JobAgentConfigParam、ChatMessageParam)
|
||||
│ │ ├─ recruitAnnouncement/ # 招聘公告入参(RecruitAnnouncementQueryParam、RecruitAnnouncementRecommendParam)
|
||||
│ │ ├─ memberProduct/ # 会员商品入参(CreateOrderParam)
|
||||
│ │ ├─ message/ # 站内信入参(MessageQueryParam)
|
||||
│ │ ├─ feedback/ # 用户反馈入参(UserFeedbackParam)
|
||||
@@ -66,6 +72,7 @@ offerpie/back-end
|
||||
│ │ ├─ resume/ # 简历出参(ResumeDto、ResumeListItemDto、各子表Dto)
|
||||
│ │ ├─ job/ # 岗位相关出参(JobIntentionDto、JobDto、JobDetailDto、JobMatchScoreDto、JobAgentRecommendDto、JobApplicationDto)
|
||||
│ │ ├─ jobAgent/ # 求职助手出参(JobAgentConfigDto、ChatMessageDto)
|
||||
│ │ ├─ recruitAnnouncement/ # 招聘公告出参(RecruitAnnouncementDto、RecruitAnnouncementDetailDto、RecruitAnnouncementRecommendDto、RecruitAnnouncementStatisticsDto)
|
||||
│ │ ├─ memberProduct/ # 会员商品出参(CreateOrderDto、OrderDetailDto)
|
||||
│ │ ├─ memberStatus/ # 会员状态出参(MemberStatusDto、FuncStockDto)
|
||||
│ │ ├─ message/ # 站内信出参(MessageDto、MessageUnreadCountDto)
|
||||
@@ -76,6 +83,31 @@ offerpie/back-end
|
||||
│ ├─ JobApplyCountVo.java # 岗位投递数量统计VO
|
||||
│ └─ JobFavoriteCountVo.java # 岗位收藏数量统计VO
|
||||
│
|
||||
├─ admin/ # **B 端**管理后台服务,启动类 AdminApplication(Thymeleaf 页面 + REST 接口)
|
||||
│ ├─ pom.xml
|
||||
│ ├─ Dockerfile / Jenkinsfile / nginx.conf
|
||||
│ └─ src/main
|
||||
│ ├─ java/org.jiayunet
|
||||
│ │ ├─ AdminApplication.java # Spring Boot 主入口(B 端)
|
||||
│ │ └─ admin/
|
||||
│ │ ├─ constant/
|
||||
│ │ │ └─ AdminRedisKeyName.java # B 端 Redis Key 常量(login:token、login:fail、login:lock)
|
||||
│ │ ├─ controller/
|
||||
│ │ │ ├─ AdminLoginController.java # 管理员登录(/public)
|
||||
│ │ │ ├─ AdminUserController.java # 用户管理(列表/统计/禁用启用,/user)
|
||||
│ │ │ ├─ AdminOrderController.java # 订单管理(列表/统计,/order)
|
||||
│ │ │ ├─ AdminProductController.java # 商品管理(CRUD,/product)
|
||||
│ │ │ └─ PageController.java # 页面路由(返回Thymeleaf视图名,不走统一响应包装)
|
||||
│ │ ├─ service/
|
||||
│ │ │ ├─ AdminLoginService.java # 管理员登录(密码校验、失败累计3次锁4小时、JWT、多设备踢出、Cookie)
|
||||
│ │ │ ├─ AdminUserService.java # 用户管理(分页+简历数量统计、新增数统计、禁用/启用)
|
||||
│ │ │ ├─ AdminOrderService.java # 订单管理(分页+关联用户/商品、支付数与收入统计)
|
||||
│ │ │ └─ AdminProductService.java # 商品管理(会员商品CRUD)
|
||||
│ │ └─ pojo/
|
||||
│ │ ├─ param/ # login/AdminLoginParam、user/UserPageParam、order/OrderPageParam、product/ProductPageParam、product/ProductSaveParam
|
||||
│ │ └─ dto/ # user/UserListDto、user/UserStatsDto、order/OrderListDto、order/OrderStatsDto
|
||||
│ └─ resources/ # application.yml + dev/test/prod 多环境配置、Thymeleaf 模板与静态资源
|
||||
│
|
||||
├─ common/ # **共享层**:被 C 端和 B 端共同使用的代码库
|
||||
│ ├─ pom.xml
|
||||
│ └─ src/main/java
|
||||
@@ -83,7 +115,7 @@ offerpie/back-end
|
||||
│ ├─ config/ # 统一配置
|
||||
│ │ ├─ OssConfig.java # 阿里云OSS凭证配置
|
||||
│ │ ├─ RedissonConf.java # Redisson客户端配置
|
||||
│ │ ├─ SecurityConfig.java # Spring Security配置(JWT过滤器、白名单路径)
|
||||
│ │ ├─ SecurityConfig.java # Spring Security配置(JWT过滤器、app.ignore.urls 白名单)
|
||||
│ │ ├─ WxPayConfig.java # 微信支付配置
|
||||
│ │ ├─ SmsConfig.java # 阿里云短信客户端配置
|
||||
│ │ ├─ AsyncConfig.java # 异步线程池配置
|
||||
@@ -114,8 +146,7 @@ offerpie/back-end
|
||||
│ │ └─ SqlLoggerInterceptor.java # SQL日志拦截器
|
||||
│ ├─ aop/
|
||||
│ │ └─ ControllerLogAspect.java # Controller日志切面
|
||||
│ ├─ exception/ # 业务异常统一处理
|
||||
│ │ ├─ GlobalExceptionAdvice.java # → 移至web包,此处为异常定义
|
||||
│ ├─ exception/ # 业务异常定义
|
||||
│ │ ├─ BusinessException.java # 业务异常
|
||||
│ │ ├─ BusinessExpCodeEnum.java # 业务异常码枚举
|
||||
│ │ └─ BusinessExpCodeOperations.java # 异常码操作接口
|
||||
@@ -124,7 +155,7 @@ offerpie/back-end
|
||||
│ │ └─ UnifiedResponseBodyAdvice.java # 统一响应体包装
|
||||
│ ├─ pojo/ # 公共POJO
|
||||
│ │ ├─ UnifiedResponse.java # 统一响应结构
|
||||
│ │ ├─ PageParam.java # 分页请求参数基类
|
||||
│ │ ├─ PageParam.java # 分页请求参数基类(pageNum/pageSize/keyword,pageSize上限200)
|
||||
│ │ ├─ PageResult.java # 分页结果包装
|
||||
│ │ ├─ login/
|
||||
│ │ │ └─ RedisLoginTokenInfo.java # Redis中登录Token信息结构
|
||||
@@ -152,7 +183,8 @@ offerpie/back-end
|
||||
│ ├─ WxPayNotifyController.java # 微信支付回调入口
|
||||
│ ├─ WxPayNotifyMessageAbstract.java # 微信回调处理抽象接口
|
||||
│ └─ server/
|
||||
│ └─ TransferServer.java # 微信转账服务端封装
|
||||
│ ├─ TransferServer.java # 微信转账服务端封装
|
||||
│ └─ model/ # 转账相关请求/响应模型(TransferBillsRequest/Response、CancelRequest/Response、BillNoQueryRequest、TransferNotification、TransferResultResponse、JsRequestPay)
|
||||
│
|
||||
└─ manager/ # **B 端 + C 端共享** 的业务实现
|
||||
├─ pom.xml
|
||||
@@ -171,9 +203,18 @@ offerpie/back-end
|
||||
│ ├─ AgreementController.java # 协议接口(根据协议码查询最新启用版本)
|
||||
│ ├─ RegionController.java # 地区接口(树形/层级/搜索/批量查询)
|
||||
│ ├─ JobCategoryController.java # 岗位分类接口(树形/层级/搜索/批量查询)
|
||||
│ └─ IndustryController.java # 行业接口(树形/层级/搜索/批量查询)
|
||||
│ ├─ IndustryController.java # 行业接口(树形/层级/搜索/批量查询)
|
||||
│ └─ MentorMockChatController.java # 导师模拟对话接口(/public/mentor/mockChat)
|
||||
├─ remote/jsxq/ # 简历星球(jianshixingqiu)开放平台远程调用
|
||||
│ ├─ JsxqClient.java # 平台客户端(统一请求头、拆 {code,msg,data,ok} 包装、按类型反序列化)
|
||||
│ ├─ JsxqProperties.java # 域名/令牌/租户配置
|
||||
│ ├─ pojo/JsxqResponse.java # 平台统一响应结构
|
||||
│ ├─ pojo/JsxqPage.java # 平台分页结构
|
||||
│ ├─ pojo/param/ # MentorPageParam、QrCodeParam
|
||||
│ └─ pojo/dto/ # MentorItemDto、MentorFullInfoDto、TeacherTalkDto、ChatEvaluateDto
|
||||
├─ mapper/ # MyBatis Mapper
|
||||
│ ├─ UserMapper.java
|
||||
│ ├─ AdminUserMapper.java # 管理员用户Mapper
|
||||
│ ├─ OssFileMapper.java
|
||||
│ ├─ UserInviteMapper.java # 用户邀请记录Mapper
|
||||
│ ├─ RouteMenuMapper.java # 路由菜单Mapper
|
||||
@@ -184,12 +225,21 @@ offerpie/back-end
|
||||
│ ├─ ChinaRegionsCodeMapper.java # 地区Mapper
|
||||
│ ├─ JobCategoryMapper.java # 岗位类型Mapper
|
||||
│ ├─ CompanyMapper.java # 公司Mapper
|
||||
│ ├─ JobMapper.java # 岗位Mapper
|
||||
│ ├─ JobMapper.java # 岗位Mapper(含selectJobPage自定义SQL)
|
||||
│ ├─ JobRegionRelationMapper.java # 岗位-地区关联Mapper
|
||||
│ ├─ JobSkillTagRelationMapper.java # 岗位-技能标签关联Mapper
|
||||
│ ├─ IndustryMapper.java # 行业Mapper
|
||||
│ ├─ SkillTagMapper.java # 技能标签Mapper(含insertIgnore自定义SQL)
|
||||
│ ├─ MajorCategoryMapper.java # 专业分类Mapper
|
||||
│ ├─ RecruitAnnouncementMapper.java # 招聘公告主表Mapper(XML:最后更新时间、统计、列表分页、推荐分页)
|
||||
│ ├─ RecruitAnnouncementYearMapper.java # 公告-招聘届数Mapper(@Select分组去重)
|
||||
│ ├─ RecruitAnnouncementBatchMapper.java # 公告-批次Mapper(@Select分组去重)
|
||||
│ ├─ RecruitAnnouncementTagMapper.java # 公告-标签Mapper(@Select分组去重)
|
||||
│ ├─ RecruitAnnouncementCityMapper.java # 公告-热招城市Mapper(@Select分组去重)
|
||||
│ ├─ RecruitAnnouncementCategoryMapper.java # 公告-岗位大类Mapper(@Select分组去重)
|
||||
│ ├─ RecruitAnnouncementIndustryMapper.java # 公告-行业Mapper(@Select分组去重)
|
||||
│ ├─ RecruitAnnouncementEducationMapper.java # 公告-学历要求Mapper(@Select分组去重)
|
||||
│ ├─ MentorMockChatMapper.java # 导师模拟对话缓存Mapper
|
||||
│ ├─ UserJobFavoriteMapper.java # 用户收藏岗位Mapper
|
||||
│ ├─ UserJobApplicationMapper.java # 用户投递记录Mapper
|
||||
│ ├─ UserJobDislikeMapper.java # 用户不感兴趣记录Mapper
|
||||
@@ -222,11 +272,11 @@ offerpie/back-end
|
||||
│ ├─ MemberRouteItemMapper.java # 会员菜单配置项Mapper
|
||||
│ ├─ PayWechatFlowMapper.java # 微信支付流水Mapper
|
||||
│ ├─ PayAlipayFlowMapper.java # 支付宝支付流水Mapper
|
||||
│ ├─ UserFeedbackMapper.java # 用户反馈Mapper
|
||||
│ └─ AppJobDataMapper.java # 爬虫岗位原始数据Mapper
|
||||
│ └─ UserFeedbackMapper.java # 用户反馈Mapper
|
||||
├─ pojo/
|
||||
│ ├─ po/ # 持久化实体
|
||||
│ │ ├─ User.java
|
||||
│ │ ├─ AdminUser.java # 管理员用户表(bg_admin_user)
|
||||
│ │ ├─ OssFile.java
|
||||
│ │ ├─ UserInvite.java # 用户邀请记录表(bg_user_invite)
|
||||
│ │ ├─ RouteMenu.java # 路由菜单表(bg_route_menu)
|
||||
@@ -243,6 +293,15 @@ offerpie/back-end
|
||||
│ │ ├─ Industry.java # 行业字典表(bg_industry)
|
||||
│ │ ├─ SkillTag.java # 技能标签表(bg_skill_tag)
|
||||
│ │ ├─ MajorCategory.java # 专业分类表(bg_major_category)
|
||||
│ │ ├─ RecruitAnnouncement.java # 招聘公告主表(bg_recruit_announcement)
|
||||
│ │ ├─ RecruitAnnouncementYear.java # 公告-招聘届数关联表(bg_recruit_announcement_year)
|
||||
│ │ ├─ RecruitAnnouncementBatch.java # 公告-批次关联表(bg_recruit_announcement_batch)
|
||||
│ │ ├─ RecruitAnnouncementTag.java # 公告-标签关联表(bg_recruit_announcement_tag)
|
||||
│ │ ├─ RecruitAnnouncementCity.java # 公告-热招城市关联表(bg_recruit_announcement_city)
|
||||
│ │ ├─ RecruitAnnouncementCategory.java # 公告-岗位大类关联表(bg_recruit_announcement_category)
|
||||
│ │ ├─ RecruitAnnouncementIndustry.java # 公告-行业关联表(bg_recruit_announcement_industry)
|
||||
│ │ ├─ RecruitAnnouncementEducation.java # 公告-学历要求关联表(bg_recruit_announcement_education)
|
||||
│ │ ├─ MentorMockChat.java # 导师模拟对话表(bg_mentor_mock_chat,按导师ID唯一)
|
||||
│ │ ├─ UserJobFavorite.java # 用户收藏岗位表(bg_user_job_favorite)
|
||||
│ │ ├─ UserJobApplication.java # 用户投递记录表(bg_user_job_application)
|
||||
│ │ ├─ UserJobDislike.java # 用户不感兴趣记录表(bg_user_job_dislike)
|
||||
@@ -270,18 +329,22 @@ offerpie/back-end
|
||||
│ │ ├─ Agreement.java # 协议表(bg_agreement,版本递增)
|
||||
│ │ ├─ MemberProduct.java # 会员商品表(bg_member_product)
|
||||
│ │ ├─ MemberOrder.java # 会员订单表(bg_member_order)
|
||||
│ │ ├─ MemberUser.java # 会员用户表(bg_member_user,记录会员到期时间)
|
||||
│ │ ├─ MemberFuncItem.java # 会员功能配置项表(bg_member_func_item,定义会员包含的功能权限)
|
||||
│ │ ├─ MemberRouteItem.java # 会员菜单配置项表(bg_member_route_item,定义会员包含的菜单权限)
|
||||
│ │ ├─ MemberUser.java # 会员用户表(bg_member_user)
|
||||
│ │ ├─ MemberFuncItem.java # 会员功能配置项表(bg_member_func_item)
|
||||
│ │ ├─ MemberRouteItem.java # 会员菜单配置项表(bg_member_route_item)
|
||||
│ │ ├─ PayWechatFlow.java # 微信支付流水表(bg_pay_wechat_flow)
|
||||
│ │ ├─ PayAlipayFlow.java # 支付宝支付流水表(bg_pay_alipay_flow)
|
||||
│ │ ├─ UserFeedback.java # 用户反馈表(bg_user_feedback)
|
||||
│ │ └─ AppJobData.java # 爬虫岗位原始数据表(app_job_data)
|
||||
│ └─ vo/ # ViewObject
|
||||
│ │ └─ UserFeedback.java # 用户反馈表(bg_user_feedback)
|
||||
│ ├─ dto/ # Mapper 入参 / 跨模块传输对象
|
||||
│ │ ├─ RecruitAnnouncementQueryDto.java # 招聘公告查询条件(供Mapper使用,避免manager反向依赖client-api)
|
||||
│ │ └─ mentor/MentorMockChatDto.java # 导师模拟对话出参
|
||||
│ └─ vo/ # ViewObject / SQL查询结果
|
||||
│ ├─ OssUrlVo.java # OSS签名URL返回
|
||||
│ ├─ DescriptionParagraph.java # 描述段落对象(JSON字段通用结构)
|
||||
│ ├─ LanguageAbility.java # 语言能力对象(求职助手配置JSON字段)
|
||||
│ ├─ JobListItemVo.java # 岗位列表项VO
|
||||
│ ├─ RecruitAnnouncementListItemVo.java # 公告列表项VO(列表与推荐共用)
|
||||
│ ├─ RecruitAnnouncementStatisticsVo.java # 公告统计VO(日/月/累计)
|
||||
│ ├─ UserHonorsVo.java # 用户荣誉VO
|
||||
│ ├─ AgreementListVo.java # 协议列表VO
|
||||
│ ├─ RegionTreeVo.java # 地区树形VO
|
||||
@@ -291,7 +354,8 @@ offerpie/back-end
|
||||
│ ├─ IndustryTreeVo.java # 行业树形VO
|
||||
│ └─ IndustryVo.java # 行业VO
|
||||
├─ resources/mapper/ # MyBatis XML映射文件
|
||||
│ └─ JobMapper.xml # 岗位自定义SQL(selectJobPage)
|
||||
│ ├─ JobMapper.xml # 岗位自定义SQL(selectJobPage)
|
||||
│ └─ RecruitAnnouncementMapper.xml # 公告自定义SQL(selectLastCreateTime、selectStatistics、selectAnnouncementPage、selectRecommendPage)
|
||||
└─ service/ # 业务Service
|
||||
├─ OssService.java # 文件上传/下载服务
|
||||
├─ SmsService.java # 短信发送服务
|
||||
@@ -300,83 +364,67 @@ offerpie/back-end
|
||||
├─ JobCategoryService.java # 岗位分类服务(树形/层级/搜索/批量查询)
|
||||
├─ IndustryService.java # 行业服务(树形/层级/搜索/批量查询)
|
||||
├─ AgreementService.java # 协议服务(查询最新版本、列表、创建/编辑版本递增)
|
||||
├─ JobCleanService.java # 岗位清洗服务(爬虫数据→业务表)
|
||||
├─ JobCleanTransactionService.java # 岗位清洗事务服务
|
||||
├─ CompanyCleanService.java # 公司清洗服务
|
||||
├─ CompanyCleanTransactionService.java # 公司清洗事务服务
|
||||
├─ MentorMockChatService.java # 导师模拟对话生成服务(查缓存→取导师信息与话题→AI生成→入库)
|
||||
├─ UserProfileAnalyzeService.java # 用户简历分析服务(AI三次调用:综合分析/专业归一化/技能提取)
|
||||
├─ JobMatchService.java # 岗位匹配度计算服务(教育30%+经历30%+技能40%)
|
||||
└─ MessageService.java # 站内信服务(发送系统/运营/订单消息)
|
||||
```
|
||||
> **设计理念** – 业务实体和 Mapper 位于 `manager`,B 端和 C 端共享;C 端特有的注解、切面、权限服务、路由菜单服务位于 `client-api`,避免 B 端误用;`common` 提供统一的技术支撑。
|
||||
> **设计理念** – 业务实体和 Mapper 位于 `manager`,B 端(admin)和 C 端(client-api)共享;C 端特有的注解、切面、权限服务、路由菜单服务位于 `client-api`,B 端特有的登录与管理服务位于 `admin`;`common` 提供统一的技术支撑。
|
||||
>
|
||||
> **模块依赖方向**:`client-api` / `admin` → `manager` → `common`,反向依赖不成立。因此 Mapper 需要接收复杂查询条件时,要在 `manager` 侧定义 DTO(如 `RecruitAnnouncementQueryDto`),不能直接引用 `client-api` 的 Param;SQL 查询结果同理放在 `manager/pojo/vo`。
|
||||
|
||||
## 2️⃣ 各层模块职责
|
||||
| 层级 | 主要职责 | 关键类/包 |
|
||||
|------|----------|-----------|
|
||||
| **client-api** | - 面向终端用户的 REST API <br> - 启动 Spring Boot 应用 <br> - 短信验证码登录(含自动注册、邀请码绑定) <br> - **功能权限校验**:注解 + 切面 + 权限服务(校验、扣减、回退) <br> - **路由菜单**:获取用户有效菜单树 <br> - **用户管理**:查看/修改信息、注销账号、邀请统计 <br> - **用户反馈**:提交反馈 <br> - **会员体系**:商品下单、支付回调、会员状态查询、权益发放 <br> - **求职助手**:配置管理、AI岗位推荐、任务列表 | `ClientApplication`、`LoginController`、`RouteMenuController`、`UserManageController`、`UserFeedbackController`、`MemberProductController`、`MemberStatusController`、`JobController`、`JobAgentConfigController`、`UserResumeController`、`MessageController`、`FuncPermission`、`FuncPermissionAspect`、`FuncPermissionService`、`MemberGrantService`、`MemberProductService`、`MemberStatusService`、`UserManageService` |
|
||||
| **common** | - **统一配置**:OSS、Redis、Security、WxPay、Alipay、Sms、Async、Jackson、MyBatis、Web 等 <br> - **跨层工具**:HTTP、IP、认证、验证码、Redis Server、用户安全 <br> - **通用Mapper**:CommonMapper(批量插入/更新) <br> - **全局拦截/切面**:日志、TraceId、黑名单、防重放、SQL打印 <br> - **统一异常/响应**:`GlobalExceptionAdvice`、`UnifiedResponse`、`PageResult` <br> - **业务能力抽象**:邮件(EmailAbility)、短信(AliYunSmsAbility)、OSS(AliOssAbility)、AI对话(AiChatAbility)、微信支付(Native/JS/Transfer)、支付宝支付(PagePay) <br> - **公共 POJO**:登录令牌、防重放信息、分页参数/结果 | `config/`, `constant/`, `mapper/`, `tool/`, `interceptor/`, `aop/`, `exception/`, `web/`, `pojo/`, `email/`, `sms/`, `oss/`, `ai/`, `alipay/`, `wxPay/` |
|
||||
| **manager** | - **业务实体**(User、OssFile、UserInvite、RouteMenu、FuncPermission、库存表、地区/岗位分类/行业/技能标签/专业分类字典、岗位及关联表、用户行为表、个人资料及5张子表、简历及5张子表、诊断报告/问题、求职助手配置/对话/定制简历、站内信、协议、会员商品/订单/用户/配置项、支付流水、用户反馈、爬虫原始数据) <br> - **MyBatis Mapper**(对应全部业务实体) <br> - **字典/公共 API**:文件上传/下载、健康检查、地区/岗位分类/行业字典查询、协议查询 <br> - **业务逻辑**:OssService、SmsService、DictCacheService、RegionService、JobCategoryService、IndustryService、AgreementService、JobCleanService、CompanyCleanService、UserProfileAnalyzeService、JobMatchService、MessageService | `controller/`, `mapper/`, `pojo/po/`, `pojo/vo/`, `service/`, `constant/` |
|
||||
| **client-api** | - 面向终端用户的 REST API <br> - 启动 Spring Boot 应用(`ClientApplication`) <br> - 短信验证码登录(含自动注册、邀请码绑定) <br> - **功能权限校验**:注解 + 切面 + 权限服务(校验、扣减、回退) <br> - **路由菜单**:获取用户有效菜单树 <br> - **用户管理**:查看/修改信息、注销账号、邀请统计 <br> - **用户反馈**:提交反馈 <br> - **会员体系**:商品下单、支付回调、会员状态查询、权益发放 <br> - **求职助手**:配置管理、AI岗位推荐、任务列表 <br> - **招聘公告**:列表/详情/推荐/统计/筛选项查询 <br> - **导师**:对接简历星球开放平台 | `ClientApplication`、`LoginController`、`RouteMenuController`、`UserManageController`、`UserFeedbackController`、`MemberProductController`、`MemberStatusController`、`JobController`、`JobAgentConfigController`、`UserResumeController`、`MessageController`、`RecruitAnnouncementController`、`CompanyController`、`MentorController`、`FuncPermission`、`FuncPermissionAspect`、`FuncPermissionService`、`MemberGrantService`、`RecruitAnnouncementService` |
|
||||
| **admin** | - B 端管理后台(`AdminApplication`),Thymeleaf 页面 + REST 接口 <br> - **管理员登录**:账号密码 + JWT + 失败锁定 <br> - **用户管理**:分页列表、注册统计、禁用/启用 <br> - **订单管理**:分页列表、支付数与收入统计 <br> - **商品管理**:会员商品 CRUD | `AdminApplication`、`AdminLoginController`、`AdminUserController`、`AdminOrderController`、`AdminProductController`、`PageController`、`AdminLoginService`、`AdminUserService`、`AdminOrderService`、`AdminProductService`、`AdminRedisKeyName` |
|
||||
| **common** | - **统一配置**:OSS、Redis、Security、WxPay、Alipay、Sms、Async、Jackson、MyBatis、Web 等 <br> - **跨层工具**:HTTP、IP、认证、验证码、Redis Server、用户安全 <br> - **通用Mapper**:CommonMapper(批量插入/更新) <br> - **全局拦截/切面**:日志、TraceId、黑名单、防重放、SQL打印 <br> - **统一异常/响应**:`GlobalExceptionAdvice`、`UnifiedResponse`、`PageResult` <br> - **业务能力抽象**:邮件、短信、OSS、AI对话、微信支付(Native/JS/Transfer)、支付宝支付(PagePay) <br> - **公共 POJO**:登录令牌、防重放信息、分页参数/结果 | `config/`, `constant/`, `mapper/`, `tool/`, `interceptor/`, `aop/`, `exception/`, `web/`, `pojo/`, `email/`, `sms/`, `oss/`, `ai/`, `alipay/`, `wxPay/` |
|
||||
| **manager** | - **业务实体**(用户/管理员、OSS文件、邀请、权限与库存、地区/岗位分类/行业/技能标签/专业分类字典、岗位及关联表、招聘公告及7张关联表、用户行为表、个人资料及5张子表、简历及5张子表、诊断报告/问题、求职助手配置/对话/定制简历、导师模拟对话、站内信、协议、会员商品/订单/用户/配置项、支付流水、用户反馈) <br> - **MyBatis Mapper**(对应全部业务实体) <br> - **字典/公共 API**:文件上传/下载、健康检查、地区/岗位分类/行业字典查询、协议查询、导师模拟对话 <br> - **远程调用**:简历星球开放平台客户端(`remote/jsxq`) <br> - **业务逻辑**:OssService、SmsService、DictCacheService、RegionService、JobCategoryService、IndustryService、AgreementService、MentorMockChatService、UserProfileAnalyzeService、JobMatchService、MessageService | `controller/`, `mapper/`, `remote/`, `pojo/po/`, `pojo/dto/`, `pojo/vo/`, `service/`, `constant/` |
|
||||
|
||||
> **注**:岗位与公司的数据清洗已迁出后端,由独立服务 `offerpie_job_cleaner` 负责(读 PostgreSQL 爬虫原始数据 → AI 清洗 → 写入 MySQL 业务库);招聘公告采集由 `offerpie_spider` 负责。后端只消费清洗后的业务表。
|
||||
|
||||
## 3️⃣ 关键业务实体
|
||||
| 实体 | 所属模块 | 作用概述 |
|
||||
|------|----------|----------|
|
||||
| `User` | manager | 记录用户基础信息(手机号、邮箱、密码、昵称、头像、生日、性别、真实姓名、微信绑定、邀请码等),配合 `UserMapper` 完成持久化。 |
|
||||
| `OssFile` | manager | 描述 OSS(对象存储)中文件的元数据(路径、大小、标签等),通过 `OssFileMapper` 进行增删改查。 |
|
||||
| `User` | manager | 记录用户基础信息(手机号、邮箱、密码、昵称、头像、生日、性别、真实姓名、微信绑定、邀请码等)。 |
|
||||
| `AdminUser` | manager | 管理员用户表(bg_admin_user),B 端后台登录账号。 |
|
||||
| `OssFile` | manager | 描述 OSS 中文件的元数据(路径、大小、标签等)。 |
|
||||
| `UserInvite` | manager | 用户邀请记录表,记录邀请人与被邀请人的关系、邀请时间、奖励天数。 |
|
||||
| `UserFeedback` | manager | 用户反馈表(bg_user_feedback),记录用户提交的反馈类型和内容。 |
|
||||
| `RouteMenu` | manager | 路由菜单表(bg_route_menu),支持多级树形结构,通过 rootId/parentId 表达层级关系,openAccess 标识是否公开免费。 |
|
||||
| `FuncPermission` | manager | 功能权限表(bg_func_permission),定义功能点编码(func_code,最长12字符,唯一约束),daily_free_count 配置每日免费次数。 |
|
||||
| `UserRouteMenuStock` | manager | 用户路由菜单库存表(bg_user_route_menu_stock),记录用户拥有的菜单权限,支持时间维度。 |
|
||||
| `UserFuncPermissionStock` | manager | 用户功能权限库存表(bg_user_func_permission_stock),记录用户拥有的功能权限,支持时间/次数/复合维度。 |
|
||||
| `UserFuncUsageLog` | manager | 用户功能使用记录表(bg_user_func_usage_log),记录每次功能使用,用于免费次数统计和异常回退。 |
|
||||
| `Agreement` | manager | 协议表(bg_agreement),按协议码(agreementCode)分组,版本递增管理,支持启用/禁用状态。 |
|
||||
| `MemberProduct` | manager | 会员商品表(bg_member_product),定义商品名称、价格、时长天数、排序、上下架状态。 |
|
||||
| `MemberOrder` | manager | 会员订单表(bg_member_order),记录用户下单信息、支付渠道、订单状态(0待支付/1已支付)、支付时间。 |
|
||||
| `MemberUser` | manager | 会员用户表(bg_member_user),记录用户的会员到期时间,一个用户一条记录。 |
|
||||
| `MemberFuncItem` | manager | 会员功能配置项表(bg_member_func_item),定义会员套餐包含的功能权限项(funcCode、countLimit、addCount)。 |
|
||||
| `MemberRouteItem` | manager | 会员菜单配置项表(bg_member_route_item),定义会员套餐包含的菜单权限项(routeId)。 |
|
||||
| `PayWechatFlow` | manager | 微信支付流水表(bg_pay_wechat_flow),记录微信支付的订单号、金额、状态、回调数据。 |
|
||||
| `PayAlipayFlow` | manager | 支付宝支付流水表(bg_pay_alipay_flow),记录支付宝支付的订单号、金额、状态、交易号、回调数据。 |
|
||||
| `ChinaRegionsCode` | manager | 地区表(bg_china_regions_code),行政区划编码,省/市/区三级,code为主键。 |
|
||||
| `JobCategory` | manager | 岗位类型表(bg_job_category),树形结构,一级/二级分类。 |
|
||||
| `Company` | manager | 公司表(bg_company),公司基本信息、融资、规模、新闻动态等。 |
|
||||
| `Job` | manager | 岗位表(bg_job),岗位信息、薪资、标签、技能标签、要求专业、专业敏感度,关联公司和岗位类型。 |
|
||||
| `JobRegionRelation` | manager | 岗位-地区关联表(bg_job_region_relation),一个岗位可关联多个地区。 |
|
||||
| `JobSkillTagRelation` | manager | 岗位-技能标签关联表(bg_job_skill_tag_relation),AI提取的技能标签与岗位的关联,用于匹配度计算。 |
|
||||
| `Industry` | manager | 行业字典表(bg_industry),树形结构,一级/二级分类。 |
|
||||
| `SkillTag` | manager | 技能标签表(bg_skill_tag),AI自动入库,name唯一索引,用于匹配度计算。 |
|
||||
| `MajorCategory` | manager | 专业分类表(bg_major_category),基于教育部专业目录,三级树形结构,用于专业匹配。 |
|
||||
| `UserJobFavorite` | manager | 用户收藏岗位表(bg_user_job_favorite),用户与岗位唯一约束。 |
|
||||
| `UserJobApplication` | manager | 用户投递记录表(bg_user_job_application),记录投递状态流转。 |
|
||||
| `UserJobDislike` | manager | 用户不感兴趣记录表(bg_user_job_dislike),冗余公司ID/地区编码/行业ID方便推荐过滤。 |
|
||||
| `UserJobIntention` | manager | 用户求职意向表(bg_user_job_intention),存储意向岗位类型、城市、行业(JSON数组)和工作类型。 |
|
||||
| `UserProfile` | manager | 用户个人资料表(bg_user_profile),存储维度评分字段(学校等级、公司背书、经历时长、职责深度、量化产出、荣誉、技能标签、证书标签等)。 |
|
||||
| `UserProfileEducation` | manager | 用户教育经历表(bg_user_profile_education,profile子表)。 |
|
||||
| `UserProfileWork` | manager | 用户工作经历表(bg_user_profile_work,profile子表)。 |
|
||||
| `UserProfileInternship` | manager | 用户实习经历表(bg_user_profile_internship,profile子表)。 |
|
||||
| `UserProfileProject` | manager | 用户项目经历表(bg_user_profile_project,profile子表)。 |
|
||||
| `UserProfileCompetition` | manager | 用户竞赛经历表(bg_user_profile_competition,profile子表)。 |
|
||||
| `UserProfileSkillTagRelation` | manager | 用户技能标签关联表(bg_user_profile_skill_tag_relation),AI自动识别生成。 |
|
||||
| `UserResume` | manager | 用户简历表(bg_user_resume),简历维度信息+个人基本信息合并存储,一个用户可有多份简历。 |
|
||||
| `UserResumeEducation` | manager | 简历-教育经历表(bg_user_resume_education)。 |
|
||||
| `UserResumeWork` | manager | 简历-工作经历表(bg_user_resume_work)。 |
|
||||
| `UserResumeInternship` | manager | 简历-实习经历表(bg_user_resume_internship)。 |
|
||||
| `UserResumeProject` | manager | 简历-项目经历表(bg_user_resume_project)。 |
|
||||
| `UserResumeCompetition` | manager | 简历-竞赛经历表(bg_user_resume_competition)。 |
|
||||
| `ResumeDiagnosisReport` | manager | 简历诊断报告表(bg_resume_diagnosis_report),AI整体诊断评级(A/B/C/D)和各类问题统计。 |
|
||||
| `ResumeDiagnosisIssue` | manager | 简历诊断问题表(bg_resume_diagnosis_issue),AI对简历各模块的诊断发现、建议、改写内容。 |
|
||||
| `JobAgentConfig` | manager | 求职助手配置表(bg_job_agent_config),一个用户一条记录,存储Agent模式、投递目标、网申常见问题预设答案。 |
|
||||
| `JobAgentChatMessage` | manager | 求职助手对话消息表(bg_job_agent_chat_message),完整对话流,含4种消息类型。 |
|
||||
| `UserJobCustomizeResume` | manager | 用户岗位定制简历表(bg_user_job_customize_resume),唯一索引(user_id, job_id)。 |
|
||||
| `Message` | manager | 站内信消息表(bg_message),支持系统(1)/运营(2)/订单(3)消息,支持指定用户和全员推送。 |
|
||||
| `MessageRead` | manager | 消息已读状态表(bg_message_read),唯一索引(message_id, user_id)。 |
|
||||
| `AppJobData` | manager | 爬虫岗位原始数据表(app_job_data),存储爬虫抓取的原始岗位数据,供清洗服务读取。 |
|
||||
| `RouteMenu` | manager | 路由菜单表(bg_route_menu),支持多级树形结构,openAccess 标识是否公开免费。 |
|
||||
| `FuncPermission` | manager | 功能权限表(bg_func_permission),func_code 唯一,daily_free_count 配置每日免费次数。 |
|
||||
| `UserRouteMenuStock` | manager | 用户路由菜单库存表,记录用户拥有的菜单权限,支持时间维度。 |
|
||||
| `UserFuncPermissionStock` | manager | 用户功能权限库存表,支持时间/次数/复合维度。 |
|
||||
| `UserFuncUsageLog` | manager | 用户功能使用记录表,用于免费次数统计和异常回退。 |
|
||||
| `Agreement` | manager | 协议表(bg_agreement),按协议码分组,版本递增管理。 |
|
||||
| `MemberProduct` / `MemberOrder` / `MemberUser` | manager | 会员商品、订单、会员到期状态。 |
|
||||
| `MemberFuncItem` / `MemberRouteItem` | manager | 会员套餐包含的功能权限项与菜单权限项。 |
|
||||
| `PayWechatFlow` / `PayAlipayFlow` | manager | 微信 / 支付宝支付流水。 |
|
||||
| `ChinaRegionsCode` | manager | 地区表(bg_china_regions_code),省/市/区三级,code 为主键。 |
|
||||
| `JobCategory` | manager | 岗位类型表(bg_job_category),树形结构。 |
|
||||
| `Company` | manager | 公司表(bg_company),公司基本信息、融资、规模、新闻动态、company_type、logo_url。 |
|
||||
| `Job` | manager | 岗位表(bg_job),岗位信息、薪资、标签、技能标签、要求专业、专业敏感度。 |
|
||||
| `JobRegionRelation` / `JobSkillTagRelation` | manager | 岗位-地区、岗位-技能标签关联表。 |
|
||||
| `Industry` | manager | 行业字典表(bg_industry),树形结构。 |
|
||||
| `SkillTag` | manager | 技能标签表(bg_skill_tag),AI 自动入库,name 唯一索引。 |
|
||||
| `MajorCategory` | manager | 专业分类表(bg_major_category),三级树形结构,用于专业匹配。 |
|
||||
| `RecruitAnnouncement` | manager | 招聘公告主表(bg_recruit_announcement),公告标题、公司简介、面向对象、专业要求、招聘岗位、笔试、投递时间与入口(announcement_url/apply_url/apply_email/invite_code)、来源、clean_status、status。 |
|
||||
| `RecruitAnnouncement{Year,Batch,Tag,City,Category,Industry,Education}` | manager | 公告的 7 张多值维度关联表,统一结构(id + announcement_id + 值字段 + create_time),直接存原始值不引字典表,无唯一约束。 |
|
||||
| `MentorMockChat` | manager | 导师模拟对话表(bg_mentor_mock_chat),缓存 AI 生成的对话,按导师 ID 唯一。 |
|
||||
| `UserJobFavorite` / `UserJobApplication` / `UserJobDislike` / `UserJobIntention` | manager | 用户收藏、投递、不感兴趣、求职意向。 |
|
||||
| `UserProfile` + 5 张子表 | manager | 用户个人资料及教育/工作/实习/项目/竞赛经历,主表存维度评分字段。 |
|
||||
| `UserProfileSkillTagRelation` | manager | 用户技能标签关联表,AI 自动识别生成。 |
|
||||
| `UserResume` + 5 张子表 | manager | 用户简历及教育/工作/实习/项目/竞赛经历,一个用户可有多份简历。 |
|
||||
| `ResumeDiagnosisReport` / `ResumeDiagnosisIssue` | manager | 简历诊断报告与问题明细。 |
|
||||
| `JobAgentConfig` / `JobAgentChatMessage` / `UserJobCustomizeResume` | manager | 求职助手配置、对话消息、岗位定制简历。 |
|
||||
| `Message` / `MessageRead` | manager | 站内信消息与已读状态。 |
|
||||
|
||||
## 4️⃣ 权限体系设计
|
||||
### 整体架构
|
||||
- **前端**:路由控制菜单/页面可见性,登录后拉取用户有效菜单树(含公开免费菜单 + 库存授权菜单)
|
||||
- **后端**:AOP 切面拦截 `@FuncPermission` 注解,校验权限 + 扣减库存,业务异常自动回退次数
|
||||
- **权限来源**:会员购买成功后通过 `MemberGrantService` 统一发放到库存表
|
||||
- **免鉴权路径**:由配置 `app.ignore.urls` 控制(当前为 `/public/**,/job/list,/job/detail,/route/menu`),`antMatchers` 匹配完整路径,因此 `/public` 必须写在类级 `@RequestMapping` 的最前面
|
||||
|
||||
### 数据库表(5张)
|
||||
| 表名 | 说明 |
|
||||
@@ -406,7 +454,7 @@ offerpie/back-end
|
||||
|
||||
## 5️⃣ 会员商品与支付体系
|
||||
### 整体架构
|
||||
- **商品管理**:`MemberProduct` 定义会员套餐(名称、价格、时长天数、排序、上下架)
|
||||
- **商品管理**:`MemberProduct` 定义会员套餐(名称、价格、时长天数、排序、上下架),B 端由 `AdminProductService` 维护
|
||||
- **下单流程**:用户选择商品 → 创建订单(`MemberOrder`) → 根据支付渠道调用微信/支付宝下单 → 返回支付凭据
|
||||
- **支付回调**:微信/支付宝回调 → 验签 → 更新流水 → 调用 `handlePaySuccess` → 更新订单状态 → 发放权益
|
||||
- **权益发放**:`MemberGrantService.grant()` → 续费会员时长 → 按 `MemberFuncItem` 发放功能权限 → 按 `MemberRouteItem` 发放菜单权限
|
||||
@@ -438,9 +486,9 @@ offerpie/back-end
|
||||
| **短信** | `AliYunSmsAbility`(阿里云短信发送,ConditionalOnProperty) | `common/sms` |
|
||||
| **OSS** | `AliOssAbility`(阿里云OSS上传/下载/签名URL,ConditionalOnProperty) | `common/oss` |
|
||||
| **AI** | `AiChatAbility`(OpenAI 兼容多供应商对话)、`AiChatConfig`(供应商配置)、`AiResponseCleanTool`(AI响应文本清洗) | `common/ai` |
|
||||
| **支付宝** | `AlipayClientConfig`(客户端配置)、`AlipayPagePayAbility`(电脑网站支付)、`AlipayNotifyController`(回调验签)、`AlipayNotifyMessageAbstract`(回调抽象) | `common/alipay` |
|
||||
| **微信支付** | `WxJsPayAbility`, `WxNativePayAbility`, `WxTransferPayAbility`, `WxPayNotifyController`, `WxPayNotifyMessageAbstract` | `common/wxPay` |
|
||||
| **全局异常** | `GlobalExceptionAdvice`, `BusinessException`, `BusinessExpCodeEnum`, `BusinessExpCodeOperations` | `common/exception`, `common/web` |
|
||||
| **支付宝** | `AlipayClientConfig`、`AlipayPagePayAbility`、`AlipayNotifyController`、`AlipayNotifyMessageAbstract` | `common/alipay` |
|
||||
| **微信支付** | `WxJsPayAbility`, `WxNativePayAbility`, `WxTransferPayAbility`, `WxPayNotifyController`, `WxPayNotifyMessageAbstract`, `server/TransferServer` 及 `server/model/*` | `common/wxPay` |
|
||||
| **全局异常** | `GlobalExceptionAdvice`(web包), `BusinessException`, `BusinessExpCodeEnum`, `BusinessExpCodeOperations`(exception包) | `common/exception`, `common/web` |
|
||||
| **日志 & AOP** | `ControllerLogAspect`, `LoggingOriginalRequestFilter`, `TraceIdFilter`, `SqlLoggerInterceptor` | `common/aop`, `common/interceptor` |
|
||||
| **工具类** | `HttpTool`, `HttpIpTool`, `AuthenticTool`, `ObjectTool`, `UserSecurityTool`, `VerifyImageCodeUtils`, `RedisServerTool` | `common/tool` |
|
||||
| **统一返回体** | `UnifiedResponse`, `UnifiedResponseBodyAdvice`, `PageParam`, `PageResult` | `common/pojo`, `common/web` |
|
||||
@@ -448,9 +496,10 @@ offerpie/back-end
|
||||
|
||||
## 7️⃣ 岗位列表与匹配度计算设计
|
||||
### 整体架构
|
||||
- **触发时机**:用户访问岗位列表接口(支持筛选条件:地区/岗位类型/行业/工作类型)
|
||||
- **触发时机**:用户访问岗位列表接口(支持筛选条件:地区/岗位类型/行业/工作类型/公司类型/公司ID)
|
||||
- **核心流程**:扩展层级筛选 → 查询不感兴趣记录 → 扩展排除列表 → SQL分页查询 → 查询收藏状态 → 批量计算匹配度 → 组装返回
|
||||
- **匹配度计算**:教育30% + 经历30% + 技能40%,在Java层批量计算
|
||||
- **分页策略**:`pageParam.setSearchCount(false)`,不查总数(前端按「加载更多」处理)
|
||||
|
||||
### 匹配度计算规则
|
||||
|
||||
@@ -480,7 +529,45 @@ offerpie/back-end
|
||||
- **JobService**(client-api):岗位列表查询主流程编排
|
||||
- **JobMatchService**(manager):批量计算匹配度(教育/经历/技能三个维度)
|
||||
|
||||
## 8️⃣ 用户简历分析设计
|
||||
## 8️⃣ 招聘公告模块设计
|
||||
### 数据模型
|
||||
- **一主七从**:主表 `bg_recruit_announcement` + 7 张多值维度关联表(届数/批次/标签/城市/岗位大类/行业/学历)
|
||||
- 从表统一结构:`id` + `announcement_id` + 单个值字段 + `create_time`,雪花主键,只有普通索引,**无唯一约束**(重复写入需按 announcement_id 先删后插)
|
||||
- 刻意不引字典表,从表直接存原始文本值,避免归一化限制 AI 解析结果;筛选按名称匹配
|
||||
- 双状态:`clean_status`(0-清洗中 1-完成)、`status`(0-失效 1-有效),有效数据口径为两者皆为 1
|
||||
|
||||
### 接口一览(`/public/recruitAnnouncement`,全部免鉴权)
|
||||
| 接口 | 说明 |
|
||||
|------|------|
|
||||
| `POST /page` | 分页列表,支持关键字(公司名/招聘岗位 LIKE)+ 发布时间区间 + 投递截止区间 + 公司类型 + 7 个多值维度筛选(条件间为「且」) |
|
||||
| `GET /detail` | 详情,返回主表字段(不含三个投递入口地址)+ 公司 logo 与类型 + 全部 7 个多值维度 |
|
||||
| `POST /recommend` | 推荐,按传入公告的行业或岗位大类命中任一即推荐 |
|
||||
| `GET /statistics` | 统计(今日新增/本月新增/累计),一次条件聚合出三个计数 |
|
||||
| `GET /lastUpdateTime` | 最后更新时间(按 id 倒序取第一条的 create_time) |
|
||||
| `GET /announcementUrl` `/applyUrl` `/applyEmail` | 按公告 id 分别查询公告地址、投递地址、投递邮箱(只查单列) |
|
||||
| `GET /batch` `/category` `/city` `/education` `/industry` `/tag` `/year` | 各维度筛选项,`GROUP BY` 值字段去重 |
|
||||
|
||||
### 实现约定
|
||||
- **列表与推荐**:主表 + `bg_company` INNER JOIN 只取单值字段,多值维度不进 SQL;拿到本页 id 后按 `IN` 批量查从表,在 Java 侧 `groupingBy` + `mapping` 组装,避免 N+1
|
||||
- **详情**:`selectById` 取 PO + 单独查公司两列 + 7 张从表各查一次,共 9 次查询,全部走主键或 `idx_announcement_id`
|
||||
- **筛选**:多值维度用 `ra.id IN (子查询)` 半连接;推荐场景两个维度是「或」关系,用 `UNION` 合并后再套单个 `IN`(避免 `OR` 连接多个 `IN` 无法半连接优化),`<trim prefixOverrides="UNION">` 处理动态拼接
|
||||
- **统计时区**:固定 `ZoneId.of("Asia/Shanghai")` 计算今日零点与本月 1 号零点,不依赖 JVM 默认时区
|
||||
- **分页**:`setSearchCount(false)`,`total` 恒为 0
|
||||
|
||||
## 9️⃣ 导师模块设计(对接简历星球开放平台)
|
||||
### 整体架构
|
||||
- **远程客户端**:`JsxqClient`(manager/remote/jsxq)统一拼公共请求头、拆平台 `{code,msg,data,ok}` 包装、按类型反序列化 data,业务接口为其 public 方法
|
||||
- **配置**:`JsxqProperties` 管理域名、令牌、租户
|
||||
- **对外接口**:`MentorController`(client-api,`/public/mentor`)透传导师分页列表、导师完整信息、老师话题、老师评价
|
||||
- **模拟对话**:`MentorMockChatController` + `MentorMockChatService`(manager,`/public/mentor/mockChat`)
|
||||
|
||||
### 模拟对话流程
|
||||
1. 按 mentorId 查 `bg_mentor_mock_chat`,有缓存直接返回
|
||||
2. 无缓存则通过 `JsxqClient` 获取导师信息与话题
|
||||
3. 调用 `AiChatAbility` 生成对话
|
||||
4. 结果入库缓存,再返回
|
||||
|
||||
## 🔟 用户简历分析设计
|
||||
### 整体架构
|
||||
- **触发时机**:用户保存个人资料(主表或任意子表)后异步触发
|
||||
- **分析流程**:三次 AI 调用 → 第一次综合分析(学校等级、公司背书、经历时长、职责深度、量化产出、荣誉),第二次专业归一化(匹配到 bg_major_category ID),第三次技能提取(自由提取,入 bg_skill_tag)
|
||||
@@ -498,7 +585,7 @@ offerpie/back-end
|
||||
- 每次 AI 调用独立容错,某一次失败不影响其他维度
|
||||
- 核心服务:**UserProfileAnalyzeService**(manager)
|
||||
|
||||
## 9️⃣ 邀请模块设计
|
||||
## 1️⃣1️⃣ 邀请模块设计
|
||||
### 数据库表(1张)
|
||||
| 表名 | 说明 |
|
||||
|------|------|
|
||||
@@ -510,17 +597,41 @@ offerpie/back-end
|
||||
- 注册逻辑由 `UserRegisterService` 独立承担,`LoginService` 委托调用
|
||||
- 邀请统计由 `UserManageService.getInviteStats()` 提供(累计邀请人数、累计获得会员天数)
|
||||
|
||||
## 🔟 构建与运行
|
||||
- **父 POM**(`back-end/pom.xml`)统一管理子模块的依赖与插件。
|
||||
- 子模块 (`client-api`, `common`, `manager`) 均可单独 `mvn clean install`,生成各自的 jar 包。
|
||||
- **启动入口**:运行 `client-api` 中的 `ClientApplication`,Spring Boot 会自动扫描并加载 `common`(配置、拦截、工具)以及 `manager` 中声明的 Mapper 与 Service。
|
||||
- **条件加载**:多个能力组件使用 `@ConditionalOnProperty` 按配置启用(OSS、SMS、Alipay),未配置时不加载。
|
||||
## 1️⃣2️⃣ B 端管理后台设计
|
||||
### 整体架构
|
||||
- 独立启动类 `AdminApplication`,独立 `application.yml`(含 dev/test/prod),Thymeleaf 渲染页面 + REST 接口
|
||||
- `PageController` 返回视图名,不参与 `UnifiedResponseBodyAdvice` 统一包装
|
||||
- 复用 `manager` 的全部 Mapper 与 `common` 的技术设施,不重复定义实体
|
||||
|
||||
## 1️⃣1️⃣ 小结
|
||||
- 项目采用 **三层结构**:
|
||||
1. **client-api** → C 端 REST 接口 + 功能权限校验 + 路由菜单 + 用户管理 + 会员体系 + 支付回调。
|
||||
2. **manager** → 业务实体、Mapper 与业务 API/Service,B 端 + C 端共享层。
|
||||
3. **common** → 所有层共同依赖的底层设施(配置、工具、拦截、异常、支付、OSS、短信、AI、邮件等)。
|
||||
### 登录与安全
|
||||
- 账号密码登录(`bg_admin_user`),JWT 令牌写入 Redis
|
||||
- 失败累计:连续 3 次失败锁定账号 4 小时
|
||||
- Redis Key:`login:token:{adminId}`、`login:fail:{username}`、`login:lock:{username}`(常量见 `AdminRedisKeyName`)
|
||||
- 登录成功写入 Redis 并设置 Cookie,支持多设备踢出
|
||||
|
||||
### 管理能力
|
||||
| 模块 | 能力 |
|
||||
|------|------|
|
||||
| 用户管理 | 分页列表(含每人简历数量)、总数/今日/本周/本月新增统计、禁用与启用 |
|
||||
| 订单管理 | 分页列表(关联用户与商品信息)、总数/已支付数/今日本周本月支付数与收入统计 |
|
||||
| 商品管理 | 会员商品新增、编辑、分页查询 |
|
||||
|
||||
## 1️⃣3️⃣ 构建与运行
|
||||
- **父 POM**(`back-end/pom.xml`)统一管理子模块的依赖与插件,Java 17。
|
||||
- 子模块(`client-api`, `admin`, `common`, `manager`)均可单独 `mvn clean install`,生成各自的 jar 包。
|
||||
- **启动入口**:C 端运行 `client-api` 的 `ClientApplication`;B 端运行 `admin` 的 `AdminApplication`。两者都会自动扫描并加载 `common`(配置、拦截、工具)与 `manager` 中声明的 Mapper 与 Service。
|
||||
- **MyBatis XML**:`mapper-locations: classpath*:mapper/**/*.xml`,放在 `manager/src/main/resources/mapper/` 下。注意同一方法不能同时存在 `@Select` 注解和 XML 语句,否则启动报 `Mapped Statements collection already contains value`。
|
||||
- **条件加载**:多个能力组件使用 `@ConditionalOnProperty` 按配置启用(OSS、SMS、Alipay),未配置时不加载。
|
||||
- **部署**:`client-api` 与 `admin` 各有独立 `Dockerfile`、`Jenkinsfile`(含 `.test` 变体)、`nginx.conf` 与 `docker-compose.*.yml`。
|
||||
|
||||
## 1️⃣4️⃣ 小结
|
||||
- 项目采用 **四模块结构**:
|
||||
1. **client-api** → C 端 REST 接口 + 功能权限校验 + 路由菜单 + 用户管理 + 会员体系 + 支付回调 + 招聘公告 + 导师。
|
||||
2. **admin** → B 端管理后台(管理员登录、用户/订单/商品管理,Thymeleaf 页面)。
|
||||
3. **manager** → 业务实体、Mapper、远程调用与业务 API/Service,B 端 + C 端共享层。
|
||||
4. **common** → 所有层共同依赖的底层设施(配置、工具、拦截、异常、支付、OSS、短信、AI、邮件等)。
|
||||
- 依赖方向单向:`client-api` / `admin` → `manager` → `common`。跨模块传参需在 `manager` 侧定义 DTO/VO。
|
||||
- 权限体系分两层:前端路由控制菜单可见性,后端切面控制功能点权限与库存扣减。
|
||||
- 会员体系:商品下单 → 支付回调 → `MemberGrantService` 统一发放权益(会员时长 + 功能权限 + 菜单权限)。
|
||||
- 支付双通道:微信Native支付 + 支付宝电脑网站支付,各自独立流水表和回调处理。
|
||||
- 数据来源:招聘公告由 `offerpie_spider` 采集,岗位与公司由 `offerpie_job_cleaner` 清洗入库,后端只消费业务表。
|
||||
|
||||
@@ -19,4 +19,10 @@ public @interface FuncPermission {
|
||||
* 功能权限编码,对应 bg_func_permission.func_code
|
||||
*/
|
||||
String value();
|
||||
|
||||
/**
|
||||
* 业务资源标识表达式,SpEL,从方法参数中取值
|
||||
* <p>如 #jobId、#dto.jobId,为空表示不做当日幂等,每次调用均扣减</p>
|
||||
*/
|
||||
String key() default "";
|
||||
}
|
||||
|
||||
@@ -4,15 +4,25 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.jiayunet.annotation.FuncPermission;
|
||||
import org.jiayunet.service.FuncPermissionService;
|
||||
import org.jiayunet.tool.UserSecurityTool;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.expression.MethodBasedEvaluationContext;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import org.springframework.expression.EvaluationContext;
|
||||
import org.springframework.expression.ExpressionParser;
|
||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* 功能权限校验切面
|
||||
* <p>拦截 @FuncPermission 注解,校验权限并扣减库存后放行,业务异常时自动回退</p>
|
||||
* <p>拦截 @FuncPermission 注解,当日已解锁的资源直接放行,否则校验权限并扣减库存后放行,业务异常时自动回退</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@@ -21,19 +31,36 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
public class FuncPermissionAspect {
|
||||
|
||||
private static final ExpressionParser EXPRESSION_PARSER = new SpelExpressionParser();
|
||||
|
||||
private static final ParameterNameDiscoverer PARAMETER_NAME_DISCOVERER = new DefaultParameterNameDiscoverer();
|
||||
|
||||
@Autowired
|
||||
private FuncPermissionService funcPermissionService;
|
||||
|
||||
@Around("@annotation(funcPermission)")
|
||||
public Object check(ProceedingJoinPoint joinPoint, FuncPermission funcPermission) throws Throwable {
|
||||
|
||||
Long userId = UserSecurityTool.getUserId();
|
||||
String funcCode = funcPermission.value();
|
||||
Long userId = 0L;
|
||||
try {
|
||||
userId = UserSecurityTool.getUserId();
|
||||
} catch (Exception e) {
|
||||
// 接口允许不登录,未登录用户ID为0
|
||||
}
|
||||
|
||||
log.info("功能权限校验 userId:{} funcCode:{}", userId, funcCode);
|
||||
String funcCode = funcPermission.value();
|
||||
String bizKey = resolveBizKey(joinPoint, funcPermission.key());
|
||||
|
||||
log.info("功能权限校验 userId:{} funcCode:{} bizKey:{}", userId, funcCode, bizKey);
|
||||
|
||||
// 当日已解锁该资源,直接放行不再扣减
|
||||
if (!bizKey.isEmpty() && funcPermissionService.existsTodayUnlock(userId, funcCode, bizKey)) {
|
||||
log.info("当日已解锁,跳过扣减 userId:{} funcCode:{} bizKey:{}", userId, funcCode, bizKey);
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
||||
// 校验权限 + 扣减库存,返回使用记录ID
|
||||
Long logId = funcPermissionService.checkAndDeduct(userId, funcCode);
|
||||
Long logId = funcPermissionService.checkAndDeduct(userId, funcCode, bizKey);
|
||||
|
||||
// 放行,业务异常时回退使用记录和库存
|
||||
try {
|
||||
@@ -44,4 +71,27 @@ public class FuncPermissionAspect {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析业务资源标识
|
||||
* <p>注解 key 为 SpEL 表达式,从方法参数取值,如 #jobId、#dto.jobId</p>
|
||||
*
|
||||
* @param joinPoint 连接点
|
||||
* @param keyExpression SpEL 表达式
|
||||
* @return 业务资源标识实际值,表达式为空或求值为 null 时返回空串
|
||||
*/
|
||||
private String resolveBizKey(ProceedingJoinPoint joinPoint, String keyExpression) {
|
||||
if (keyExpression == null || keyExpression.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = AopUtils.getMostSpecificMethod(signature.getMethod(), joinPoint.getTarget().getClass());
|
||||
|
||||
EvaluationContext context = new MethodBasedEvaluationContext(
|
||||
joinPoint.getTarget(), method, joinPoint.getArgs(), PARAMETER_NAME_DISCOVERER);
|
||||
|
||||
Object value = EXPRESSION_PARSER.parseExpression(keyExpression).getValue(context);
|
||||
return value == null ? "" : value.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.jiayunet.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.jiayunet.annotation.FuncPermission;
|
||||
import org.jiayunet.pojo.PageResult;
|
||||
import org.jiayunet.pojo.dto.job.JobApplicationDto;
|
||||
import org.jiayunet.pojo.dto.job.JobDetailDto;
|
||||
@@ -32,6 +33,7 @@ public class JobController {
|
||||
* <p>支持按地区/岗位类型/行业/工作类型筛选,自动排除不感兴趣的岗位/公司/地区/行业,返回匹配度和收藏状态</p>
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@FuncPermission(value = "job_list", key = "#param.pageNum")
|
||||
public PageResult<JobDto> listJobs(@Validated @RequestBody JobQueryParam param) {
|
||||
|
||||
Long userId = 0L;
|
||||
@@ -50,6 +52,7 @@ public class JobController {
|
||||
* <p>返回岗位完整信息、公司信息、匹配度、收藏状态</p>
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@FuncPermission(value = "job_detail", key = "#jobId")
|
||||
public JobDetailDto getJobDetail(@RequestParam Long jobId) {
|
||||
|
||||
Long userId = 0L;
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package org.jiayunet.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.jiayunet.annotation.FuncPermission;
|
||||
import org.jiayunet.pojo.PageResult;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementDetailDto;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementDto;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementRecommendDto;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementStatisticsDto;
|
||||
import org.jiayunet.pojo.param.recruitAnnouncement.RecruitAnnouncementQueryParam;
|
||||
import org.jiayunet.pojo.param.recruitAnnouncement.RecruitAnnouncementRecommendParam;
|
||||
import org.jiayunet.service.RecruitAnnouncementService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告接口
|
||||
* <p>提供公告筛选项(批次/岗位大类/热招城市/学历要求/行业/标签/招聘届数)的去重查询</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/public/recruitAnnouncement")
|
||||
@AllArgsConstructor
|
||||
@Validated
|
||||
public class RecruitAnnouncementController {
|
||||
|
||||
private RecruitAnnouncementService recruitAnnouncementService;
|
||||
|
||||
/** 查询公告最后更新时间 */
|
||||
@GetMapping("/lastUpdateTime")
|
||||
public Instant getLastUpdateTime() {
|
||||
return recruitAnnouncementService.getLastUpdateTime();
|
||||
}
|
||||
|
||||
/** 统计公告数量(今日新增/本月新增/累计) */
|
||||
@GetMapping("/statistics")
|
||||
public RecruitAnnouncementStatisticsDto getStatistics() {
|
||||
return recruitAnnouncementService.getStatistics();
|
||||
}
|
||||
|
||||
/** 分页查询公告列表 */
|
||||
@PostMapping("/page")
|
||||
@FuncPermission(value = "ann_list", key = "#param.pageNum")
|
||||
public PageResult<RecruitAnnouncementDto> pageAnnouncement(@Validated @RequestBody RecruitAnnouncementQueryParam param) {
|
||||
return recruitAnnouncementService.pageAnnouncement(param);
|
||||
}
|
||||
|
||||
/** 分页查询推荐公告(同行业或同岗位大类) */
|
||||
@PostMapping("/recommend")
|
||||
public PageResult<RecruitAnnouncementRecommendDto> pageRecommend(@Validated @RequestBody RecruitAnnouncementRecommendParam param) {
|
||||
return recruitAnnouncementService.pageRecommend(param);
|
||||
}
|
||||
|
||||
/** 查询公告详情 */
|
||||
@GetMapping("/detail")
|
||||
@FuncPermission(value = "ann_detail", key = "#id")
|
||||
public RecruitAnnouncementDetailDto getDetail(@RequestParam Long id) {
|
||||
return recruitAnnouncementService.getDetail(id);
|
||||
}
|
||||
|
||||
/** 根据公告id查询公告地址 */
|
||||
@GetMapping("/announcementUrl")
|
||||
@FuncPermission(value = "ann_url", key = "#id")
|
||||
public String getAnnouncementUrl(@RequestParam Long id) {
|
||||
return recruitAnnouncementService.getAnnouncementUrl(id);
|
||||
}
|
||||
|
||||
/** 根据公告id查询岗位投递地址 */
|
||||
@GetMapping("/applyUrl")
|
||||
@FuncPermission(value = "ann_url", key = "#id")
|
||||
public String getApplyUrl(@RequestParam Long id) {
|
||||
return recruitAnnouncementService.getApplyUrl(id);
|
||||
}
|
||||
|
||||
/** 根据公告id查询投递邮箱 */
|
||||
@GetMapping("/applyEmail")
|
||||
@FuncPermission(value = "ann_url", key = "#id")
|
||||
public String getApplyEmail(@RequestParam Long id) {
|
||||
return recruitAnnouncementService.getApplyEmail(id);
|
||||
}
|
||||
|
||||
/** 查询公告批次列表(去重) */
|
||||
@GetMapping("/batch")
|
||||
public List<String> listBatchName() {
|
||||
return recruitAnnouncementService.listBatchName();
|
||||
}
|
||||
|
||||
/** 查询公告岗位大类列表(去重) */
|
||||
@GetMapping("/category")
|
||||
public List<String> listCategoryName() {
|
||||
return recruitAnnouncementService.listCategoryName();
|
||||
}
|
||||
|
||||
/** 查询公告热招城市列表(去重) */
|
||||
@GetMapping("/city")
|
||||
public List<String> listCityName() {
|
||||
return recruitAnnouncementService.listCityName();
|
||||
}
|
||||
|
||||
/** 查询公告学历要求列表(去重) */
|
||||
@GetMapping("/education")
|
||||
public List<String> listEducationName() {
|
||||
return recruitAnnouncementService.listEducationName();
|
||||
}
|
||||
|
||||
/** 查询公告行业列表(去重) */
|
||||
@GetMapping("/industry")
|
||||
public List<String> listIndustryName() {
|
||||
return recruitAnnouncementService.listIndustryName();
|
||||
}
|
||||
|
||||
/** 查询公告标签列表(去重) */
|
||||
@GetMapping("/tag")
|
||||
public List<String> listTagName() {
|
||||
return recruitAnnouncementService.listTagName();
|
||||
}
|
||||
|
||||
/** 查询公告招聘届数列表(去重) */
|
||||
@GetMapping("/year")
|
||||
public List<Integer> listRecruitYear() {
|
||||
return recruitAnnouncementService.listRecruitYear();
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package org.jiayunet.pojo.dto.recruitAnnouncement;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告详情返回
|
||||
* <p>公告主表字段(不含公告地址/投递地址/投递邮箱)+ 公司logo与类型 + 全部多值维度</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementDetailDto {
|
||||
|
||||
/** 公告ID */
|
||||
private Long id;
|
||||
|
||||
/** 公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 公司名称 */
|
||||
private String companyName;
|
||||
|
||||
/** 公司logo */
|
||||
private String logoUrl;
|
||||
|
||||
/** 公司类型 */
|
||||
private String companyType;
|
||||
|
||||
/** 公告标题 */
|
||||
private String title;
|
||||
|
||||
/** 公司简介 */
|
||||
private String companyIntro;
|
||||
|
||||
/** 面向对象,如2027届本硕博 */
|
||||
private String targetAudience;
|
||||
|
||||
/** 专业要求 */
|
||||
private String majorRequire;
|
||||
|
||||
/** 招聘岗位 */
|
||||
private String recruitPosition;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 是否笔试:有 / 无 / 未明确 */
|
||||
private String writtenExam;
|
||||
|
||||
/** 投递开始时间 */
|
||||
private Instant applyStartTime;
|
||||
|
||||
/** 投递结束时间 */
|
||||
private Instant applyEndTime;
|
||||
|
||||
/** 投递截止描述 */
|
||||
private String applyEndDesc;
|
||||
|
||||
/** 专属内推码 */
|
||||
private String inviteCode;
|
||||
|
||||
/** 信息来源说明 */
|
||||
private String source;
|
||||
|
||||
/** 公告发布/更新时间 */
|
||||
private Instant publishTime;
|
||||
|
||||
/** 清洗状态:0-清洗中 1-清洗完成 */
|
||||
private Integer cleanStatus;
|
||||
|
||||
/** 状态:0-失效 1-有效 */
|
||||
private Integer status;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Instant updateTime;
|
||||
|
||||
/** 行业列表 */
|
||||
private List<String> industryNames;
|
||||
|
||||
/** 岗位大类列表 */
|
||||
private List<String> categoryNames;
|
||||
|
||||
/** 热招城市列表 */
|
||||
private List<String> cityNames;
|
||||
|
||||
/** 学历要求列表 */
|
||||
private List<String> educationNames;
|
||||
|
||||
/** 招聘届数列表 */
|
||||
private List<Integer> recruitYears;
|
||||
|
||||
/** 批次列表 */
|
||||
private List<String> batchNames;
|
||||
|
||||
/** 标签列表 */
|
||||
private List<String> tagNames;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.jiayunet.pojo.dto.recruitAnnouncement;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告列表返回
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementDto {
|
||||
|
||||
/** 公告ID */
|
||||
private Long id;
|
||||
|
||||
/** 公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 公司名称 */
|
||||
private String companyName;
|
||||
|
||||
/** 公司logo */
|
||||
private String logoUrl;
|
||||
|
||||
/** 公告标题 */
|
||||
private String title;
|
||||
|
||||
/** 专业要求 */
|
||||
private String majorRequire;
|
||||
|
||||
/** 投递结束时间 */
|
||||
private Instant applyEndTime;
|
||||
|
||||
/** 投递截止描述 */
|
||||
private String applyEndDesc;
|
||||
|
||||
/** 行业列表 */
|
||||
private List<String> industryNames;
|
||||
|
||||
/** 岗位大类列表 */
|
||||
private List<String> categoryNames;
|
||||
|
||||
/** 热招城市列表 */
|
||||
private List<String> cityNames;
|
||||
|
||||
/** 学历要求列表 */
|
||||
private List<String> educationNames;
|
||||
|
||||
/** 招聘届数列表 */
|
||||
private List<Integer> recruitYears;
|
||||
|
||||
/** 批次列表 */
|
||||
private List<String> batchNames;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package org.jiayunet.pojo.dto.recruitAnnouncement;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告推荐返回
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementRecommendDto {
|
||||
|
||||
/** 公告ID */
|
||||
private Long id;
|
||||
|
||||
/** 公司名称 */
|
||||
private String companyName;
|
||||
|
||||
/** 公司logo */
|
||||
private String logoUrl;
|
||||
|
||||
/** 岗位大类列表 */
|
||||
private List<String> categoryNames;
|
||||
|
||||
/** 热招城市列表 */
|
||||
private List<String> cityNames;
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package org.jiayunet.pojo.dto.recruitAnnouncement;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 招聘公告统计返回
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementStatisticsDto {
|
||||
|
||||
/** 今日新增公告数 */
|
||||
private Long dayCount;
|
||||
|
||||
/** 本月新增公告数 */
|
||||
private Long monthCount;
|
||||
|
||||
/** 累计公告数 */
|
||||
private Long totalCount;
|
||||
}
|
||||
@@ -41,4 +41,7 @@ public class JobQueryParam extends PageParam {
|
||||
|
||||
/** 岗位状态过滤(0=有效 1=已下架 2=已过期,可多选,null或空=查所有) */
|
||||
private List<Integer> statusFilter;
|
||||
|
||||
/** 公司ID */
|
||||
private Long companyId;
|
||||
}
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package org.jiayunet.pojo.param.recruitAnnouncement;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jiayunet.pojo.PageParam;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告查询入参
|
||||
* <p>各筛选条件之间为“且”关系,为空则不参与筛选</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RecruitAnnouncementQueryParam extends PageParam {
|
||||
|
||||
/** 发布时间起(不含) */
|
||||
private Instant publishTimeStart;
|
||||
|
||||
/** 发布时间止(含) */
|
||||
private Instant publishTimeEnd;
|
||||
|
||||
/** 投递截止时间起(不含) */
|
||||
private Instant applyEndTimeStart;
|
||||
|
||||
/** 投递截止时间止(含) */
|
||||
private Instant applyEndTimeEnd;
|
||||
|
||||
/** 公司类型列表 */
|
||||
private List<String> companyTypes;
|
||||
|
||||
/** 学历要求列表 */
|
||||
private List<String> educationNames;
|
||||
|
||||
/** 招聘届数列表 */
|
||||
private List<Integer> recruitYears;
|
||||
|
||||
/** 批次列表 */
|
||||
private List<String> batchNames;
|
||||
|
||||
/** 岗位大类列表 */
|
||||
private List<String> categoryNames;
|
||||
|
||||
/** 热招城市列表 */
|
||||
private List<String> cityNames;
|
||||
|
||||
/** 行业列表 */
|
||||
private List<String> industryNames;
|
||||
|
||||
/** 标签列表 */
|
||||
private List<String> tagNames;
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package org.jiayunet.pojo.param.recruitAnnouncement;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jiayunet.pojo.PageParam;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 招聘公告推荐入参
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RecruitAnnouncementRecommendParam extends PageParam {
|
||||
|
||||
/** 公告ID */
|
||||
@NotNull(message = "公告ID不能为空")
|
||||
private Long announcementId;
|
||||
}
|
||||
@@ -7,9 +7,11 @@ import org.jiayunet.exception.BusinessException;
|
||||
import org.jiayunet.exception.BusinessExpCodeEnum;
|
||||
import org.jiayunet.mapper.FuncPermissionMapper;
|
||||
import org.jiayunet.mapper.UserFuncPermissionStockMapper;
|
||||
import org.jiayunet.mapper.UserFuncUnlockMapper;
|
||||
import org.jiayunet.mapper.UserFuncUsageLogMapper;
|
||||
import org.jiayunet.pojo.po.FuncPermission;
|
||||
import org.jiayunet.pojo.po.UserFuncPermissionStock;
|
||||
import org.jiayunet.pojo.po.UserFuncUnlock;
|
||||
import org.jiayunet.pojo.po.UserFuncUsageLog;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -38,15 +40,34 @@ public class FuncPermissionService {
|
||||
@Autowired
|
||||
private UserFuncUsageLogMapper userFuncUsageLogMapper;
|
||||
|
||||
@Autowired
|
||||
private UserFuncUnlockMapper userFuncUnlockMapper;
|
||||
|
||||
/**
|
||||
* 检查当日是否已存在该业务资源的授权记录
|
||||
* <p>存在说明用户当日已解锁该资源,可直接放行不再扣减</p>
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param funcCode 功能权限编码
|
||||
* @param bizKey 业务资源标识实际值
|
||||
* @return true=当日已授权
|
||||
*/
|
||||
public boolean existsTodayUnlock(Long userId, String funcCode, String bizKey) {
|
||||
|
||||
return userFuncUnlockMapper.exists(new LambdaQueryWrapper<UserFuncUnlock>().eq(UserFuncUnlock::getUserId, userId).eq(UserFuncUnlock::getFuncCode, funcCode).eq(UserFuncUnlock::getUnlockDate, LocalDate.now()).eq(UserFuncUnlock::getBizKey, bizKey));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户功能权限并扣减库存
|
||||
* <p>1. 查功能权限定义 2. 判断每日免费额度是否充足 3. 免费额度用完则查付费库存 4. 校验时间维度 5. 校验次数维度并原子扣减 6. 插入使用记录</p>
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param funcCode 功能权限编码
|
||||
* @param bizKey 业务资源标识实际值,为空表示不做当日幂等
|
||||
* @return 使用记录ID(用于异常回退)
|
||||
*/
|
||||
public Long checkAndDeduct(Long userId, String funcCode) {
|
||||
public Long checkAndDeduct(Long userId, String funcCode, String bizKey) {
|
||||
// 1. 查功能权限定义
|
||||
FuncPermission funcPermission = funcPermissionMapper.selectOne(
|
||||
new LambdaQueryWrapper<FuncPermission>()
|
||||
@@ -69,6 +90,7 @@ public class FuncPermissionService {
|
||||
);
|
||||
if (todayUsed < dailyFreeCount) {
|
||||
// 免费额度未用完,插入使用记录,直接放行
|
||||
insertUnlock(userId, funcCode, bizKey);
|
||||
return insertUsageLog(userId, funcCode);
|
||||
}
|
||||
}
|
||||
@@ -91,6 +113,7 @@ public class FuncPermissionService {
|
||||
// 5. 次数维度校验
|
||||
if (stock.getCountLimit() == 0) {
|
||||
// 不限次,直接放行
|
||||
insertUnlock(userId, funcCode, bizKey);
|
||||
return insertUsageLog(userId, funcCode);
|
||||
}
|
||||
|
||||
@@ -106,9 +129,30 @@ public class FuncPermissionService {
|
||||
throw new BusinessException(BusinessExpCodeEnum.PERMISSION_DENIED, "功能使用次数已用完");
|
||||
}
|
||||
|
||||
insertUnlock(userId, funcCode, bizKey);
|
||||
return insertUsageLog(userId, funcCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入当日解锁记录
|
||||
* <p>bizKey 为空表示不做当日幂等,跳过插入</p>
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param funcCode 功能编码
|
||||
* @param bizKey 业务资源标识实际值
|
||||
*/
|
||||
private void insertUnlock(Long userId, String funcCode, String bizKey) {
|
||||
if (bizKey == null || bizKey.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
UserFuncUnlock unlock = new UserFuncUnlock();
|
||||
unlock.setUserId(userId);
|
||||
unlock.setFuncCode(funcCode);
|
||||
unlock.setUnlockDate(LocalDate.now());
|
||||
unlock.setBizKey(bizKey);
|
||||
userFuncUnlockMapper.insert(unlock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入使用记录
|
||||
*
|
||||
|
||||
@@ -127,7 +127,7 @@ public class JobService {
|
||||
// 6. 执行分页查询
|
||||
Page<JobListItemVo> pageParam = param.toPage();
|
||||
pageParam.setSearchCount(false);
|
||||
Page<JobListItemVo> page = jobMapper.selectJobPage(pageParam, param.getJobIds(),param.getStatusFilter(), param.getKeyword(), expandedRegionCodes, expandedCategoryIds, expandedIndustryIds, param.getEmploymentType(), excludeJobIds, excludeCompanyIds, excludeRegionCodes, excludeIndustryIds, param.getRecruitCategory(), param.getCompanyTypes());
|
||||
Page<JobListItemVo> page = jobMapper.selectJobPage(pageParam, param.getJobIds(),param.getStatusFilter(), param.getKeyword(), expandedRegionCodes, expandedCategoryIds, expandedIndustryIds, param.getEmploymentType(), excludeJobIds, excludeCompanyIds, excludeRegionCodes, excludeIndustryIds, param.getRecruitCategory(), param.getCompanyTypes(), param.getCompanyId());
|
||||
|
||||
// 7. 查询收藏状态
|
||||
List<Long> jobIds = page.getRecords().stream().map(JobListItemVo::getId).collect(Collectors.toList());
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
package org.jiayunet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jiayunet.exception.BusinessException;
|
||||
import org.jiayunet.exception.BusinessExpCodeEnum;
|
||||
import org.jiayunet.mapper.CompanyMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementBatchMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementCategoryMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementCityMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementEducationMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementIndustryMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementTagMapper;
|
||||
import org.jiayunet.mapper.RecruitAnnouncementYearMapper;
|
||||
import org.jiayunet.pojo.PageResult;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementDetailDto;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementDto;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementRecommendDto;
|
||||
import org.jiayunet.pojo.dto.recruitAnnouncement.RecruitAnnouncementStatisticsDto;
|
||||
import org.jiayunet.pojo.param.recruitAnnouncement.RecruitAnnouncementQueryParam;
|
||||
import org.jiayunet.pojo.param.recruitAnnouncement.RecruitAnnouncementRecommendParam;
|
||||
import org.jiayunet.pojo.po.Company;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncement;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementBatch;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementCategory;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementCity;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementEducation;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementIndustry;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementTag;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementYear;
|
||||
import org.jiayunet.pojo.vo.RecruitAnnouncementListItemVo;
|
||||
import org.jiayunet.pojo.vo.RecruitAnnouncementStatisticsVo;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 招聘公告服务
|
||||
* <p>依赖:无</p>
|
||||
* <p>使用表:bg_recruit_announcement(公告主表)、bg_recruit_announcement_year(招聘届数)、
|
||||
* bg_recruit_announcement_batch(批次)、bg_recruit_announcement_tag(标签组)、
|
||||
* bg_recruit_announcement_city(热招城市)、bg_recruit_announcement_category(岗位大类)、
|
||||
* bg_recruit_announcement_industry(行业)、bg_recruit_announcement_education(学历要求)</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RecruitAnnouncementService {
|
||||
|
||||
/** 统计时间边界所用时区,固定东八区,避免受JVM默认时区影响 */
|
||||
private static final ZoneId STAT_ZONE = ZoneId.of("Asia/Shanghai");
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementMapper recruitAnnouncementMapper;
|
||||
|
||||
@Autowired
|
||||
private CompanyMapper companyMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementBatchMapper batchMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementCategoryMapper categoryMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementCityMapper cityMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementEducationMapper educationMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementIndustryMapper industryMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementTagMapper tagMapper;
|
||||
|
||||
@Autowired
|
||||
private RecruitAnnouncementYearMapper yearMapper;
|
||||
|
||||
/**
|
||||
* 查询公告最后更新时间
|
||||
* <p>按id倒序取第一条的创建时间,无数据时返回null</p>
|
||||
*/
|
||||
public Instant getLastUpdateTime() {
|
||||
return recruitAnnouncementMapper.selectLastCreateTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询招聘公告列表
|
||||
* <p>1. 主表分页查询(多值维度不参与) 2. 按本页id批量查6张从表 3. Java侧分组组装DTO</p>
|
||||
*/
|
||||
public PageResult<RecruitAnnouncementDto> pageAnnouncement(RecruitAnnouncementQueryParam param) {
|
||||
|
||||
//查询数据
|
||||
Page<RecruitAnnouncementListItemVo> pageParam = param.toPage();
|
||||
pageParam.setSearchCount(false);
|
||||
Page<RecruitAnnouncementListItemVo> page = recruitAnnouncementMapper.selectAnnouncementPage(pageParam, param.getKeyword(), param.getPublishTimeStart(), param.getPublishTimeEnd(), param.getApplyEndTimeStart(), param.getApplyEndTimeEnd(), param.getCompanyTypes(), param.getEducationNames(), param.getRecruitYears(), param.getBatchNames(), param.getCategoryNames(), param.getCityNames(), param.getIndustryNames(), param.getTagNames());
|
||||
|
||||
List<Long> announcementIds = page.getRecords().stream().map(RecruitAnnouncementListItemVo::getId).collect(Collectors.toList());
|
||||
if (announcementIds.isEmpty()) {
|
||||
return new PageResult<>(page.getCurrent(), page.getSize(), page.getTotal(), List.of());
|
||||
}
|
||||
|
||||
|
||||
// 按本页id批量查从表,各自按公告id分组
|
||||
Map<Long, List<String>> industryMap = industryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementIndustry>().in(RecruitAnnouncementIndustry::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementIndustry::getAnnouncementId, Collectors.mapping(RecruitAnnouncementIndustry::getIndustryName, Collectors.toList())));
|
||||
Map<Long, List<String>> categoryMap = categoryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCategory>().in(RecruitAnnouncementCategory::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementCategory::getAnnouncementId, Collectors.mapping(RecruitAnnouncementCategory::getCategoryName, Collectors.toList())));
|
||||
Map<Long, List<String>> cityMap = cityMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCity>().in(RecruitAnnouncementCity::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementCity::getAnnouncementId, Collectors.mapping(RecruitAnnouncementCity::getCityName, Collectors.toList())));
|
||||
Map<Long, List<String>> educationMap = educationMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementEducation>().in(RecruitAnnouncementEducation::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementEducation::getAnnouncementId, Collectors.mapping(RecruitAnnouncementEducation::getEducationName, Collectors.toList())));
|
||||
Map<Long, List<Integer>> yearMap = yearMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementYear>().in(RecruitAnnouncementYear::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementYear::getAnnouncementId, Collectors.mapping(RecruitAnnouncementYear::getRecruitYear, Collectors.toList())));
|
||||
Map<Long, List<String>> batchMap = batchMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementBatch>().in(RecruitAnnouncementBatch::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementBatch::getAnnouncementId, Collectors.mapping(RecruitAnnouncementBatch::getBatchName, Collectors.toList())));
|
||||
|
||||
// 组装返回数据
|
||||
List<RecruitAnnouncementDto> dtoList = page.getRecords().stream().map(vo -> {
|
||||
RecruitAnnouncementDto dto = new RecruitAnnouncementDto();
|
||||
BeanUtils.copyProperties(vo, dto);
|
||||
dto.setIndustryNames(industryMap.getOrDefault(vo.getId(), List.of()));
|
||||
dto.setCategoryNames(categoryMap.getOrDefault(vo.getId(), List.of()));
|
||||
dto.setCityNames(cityMap.getOrDefault(vo.getId(), List.of()));
|
||||
dto.setEducationNames(educationMap.getOrDefault(vo.getId(), List.of()));
|
||||
dto.setRecruitYears(yearMap.getOrDefault(vo.getId(), List.of()));
|
||||
dto.setBatchNames(batchMap.getOrDefault(vo.getId(), List.of()));
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
return new PageResult<>(page.getCurrent(), page.getSize(), page.getTotal(), dtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询推荐公告
|
||||
* <p>1. 校验公告存在 2. 取该公告的行业与岗位大类 3. 命中任一维度即推荐 4. 按本页id组装分类与城市</p>
|
||||
*/
|
||||
public PageResult<RecruitAnnouncementRecommendDto> pageRecommend(RecruitAnnouncementRecommendParam param) {
|
||||
|
||||
//校验公告存在
|
||||
Long announcementId = param.getAnnouncementId();
|
||||
RecruitAnnouncement announcement = recruitAnnouncementMapper.selectById(announcementId);
|
||||
if (announcement == null || announcement.getStatus() == 0) {
|
||||
throw new BusinessException(BusinessExpCodeEnum.DATA_NOT_EXIST, "公告不存在");
|
||||
}
|
||||
|
||||
//取该公告的行业与岗位大类作为推荐依据
|
||||
List<String> industryNames = industryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementIndustry>().eq(RecruitAnnouncementIndustry::getAnnouncementId, announcementId)).stream().map(RecruitAnnouncementIndustry::getIndustryName).collect(Collectors.toList());
|
||||
List<String> categoryNames = categoryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCategory>().eq(RecruitAnnouncementCategory::getAnnouncementId, announcementId)).stream().map(RecruitAnnouncementCategory::getCategoryName).collect(Collectors.toList());
|
||||
|
||||
//查询数据
|
||||
Page<RecruitAnnouncementListItemVo> pageParam = param.toPage();
|
||||
pageParam.setSearchCount(false);
|
||||
if (industryNames.isEmpty() && categoryNames.isEmpty()) {
|
||||
return new PageResult<>(pageParam.getCurrent(), pageParam.getSize(), 0L, List.of());
|
||||
}
|
||||
Page<RecruitAnnouncementListItemVo> page = recruitAnnouncementMapper.selectRecommendPage(pageParam, industryNames, categoryNames);
|
||||
|
||||
List<Long> announcementIds = page.getRecords().stream().map(RecruitAnnouncementListItemVo::getId).collect(Collectors.toList());
|
||||
if (announcementIds.isEmpty()) {
|
||||
return new PageResult<>(page.getCurrent(), page.getSize(), page.getTotal(), List.of());
|
||||
}
|
||||
|
||||
// 按本页id批量查从表,各自按公告id分组
|
||||
Map<Long, List<String>> categoryMap = categoryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCategory>().in(RecruitAnnouncementCategory::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementCategory::getAnnouncementId, Collectors.mapping(RecruitAnnouncementCategory::getCategoryName, Collectors.toList())));
|
||||
Map<Long, List<String>> cityMap = cityMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCity>().in(RecruitAnnouncementCity::getAnnouncementId, announcementIds)).stream().collect(Collectors.groupingBy(RecruitAnnouncementCity::getAnnouncementId, Collectors.mapping(RecruitAnnouncementCity::getCityName, Collectors.toList())));
|
||||
|
||||
// 组装返回数据
|
||||
List<RecruitAnnouncementRecommendDto> dtoList = page.getRecords().stream().map(vo -> {
|
||||
RecruitAnnouncementRecommendDto dto = new RecruitAnnouncementRecommendDto();
|
||||
BeanUtils.copyProperties(vo, dto);
|
||||
dto.setCategoryNames(categoryMap.getOrDefault(vo.getId(), List.of()));
|
||||
dto.setCityNames(cityMap.getOrDefault(vo.getId(), List.of()));
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
return new PageResult<>(page.getCurrent(), page.getSize(), page.getTotal(), dtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告详情
|
||||
* <p>1. 查公告主表(不存在或已失效则报错) 2. 补公司logo与类型 3. 按公告id查7张从表组装多值维度</p>
|
||||
*/
|
||||
public RecruitAnnouncementDetailDto getDetail(Long id) {
|
||||
|
||||
// 查询公告
|
||||
RecruitAnnouncement announcement = recruitAnnouncementMapper.selectById(id);
|
||||
if (announcement == null || announcement.getStatus() == 0 || announcement.getCleanStatus() == 0) {
|
||||
throw new BusinessException(BusinessExpCodeEnum.DATA_NOT_EXIST, "公告不存在");
|
||||
}
|
||||
RecruitAnnouncementDetailDto dto = new RecruitAnnouncementDetailDto();
|
||||
BeanUtils.copyProperties(announcement, dto);
|
||||
|
||||
// 补公司logo与类型
|
||||
if (announcement.getCompanyId() != null) {
|
||||
Company company = companyMapper.selectOne(new LambdaQueryWrapper<Company>().select(Company::getLogoUrl, Company::getCompanyType).eq(Company::getId, announcement.getCompanyId()));
|
||||
if (company != null) {
|
||||
dto.setLogoUrl(company.getLogoUrl());
|
||||
dto.setCompanyType(company.getCompanyType());
|
||||
}
|
||||
}
|
||||
|
||||
// 组装多值维度
|
||||
dto.setIndustryNames(industryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementIndustry>().eq(RecruitAnnouncementIndustry::getAnnouncementId, id)).stream().map(RecruitAnnouncementIndustry::getIndustryName).collect(Collectors.toList()));
|
||||
dto.setCategoryNames(categoryMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCategory>().eq(RecruitAnnouncementCategory::getAnnouncementId, id)).stream().map(RecruitAnnouncementCategory::getCategoryName).collect(Collectors.toList()));
|
||||
dto.setCityNames(cityMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementCity>().eq(RecruitAnnouncementCity::getAnnouncementId, id)).stream().map(RecruitAnnouncementCity::getCityName).collect(Collectors.toList()));
|
||||
dto.setEducationNames(educationMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementEducation>().eq(RecruitAnnouncementEducation::getAnnouncementId, id)).stream().map(RecruitAnnouncementEducation::getEducationName).collect(Collectors.toList()));
|
||||
dto.setRecruitYears(yearMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementYear>().eq(RecruitAnnouncementYear::getAnnouncementId, id)).stream().map(RecruitAnnouncementYear::getRecruitYear).collect(Collectors.toList()));
|
||||
dto.setBatchNames(batchMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementBatch>().eq(RecruitAnnouncementBatch::getAnnouncementId, id)).stream().map(RecruitAnnouncementBatch::getBatchName).collect(Collectors.toList()));
|
||||
dto.setTagNames(tagMapper.selectList(new LambdaQueryWrapper<RecruitAnnouncementTag>().eq(RecruitAnnouncementTag::getAnnouncementId, id)).stream().map(RecruitAnnouncementTag::getTagName).collect(Collectors.toList()));
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据公告id查询公告地址
|
||||
* <p>只查单列,公告不存在时返回null</p>
|
||||
*/
|
||||
public String getAnnouncementUrl(Long id) {
|
||||
RecruitAnnouncement po = recruitAnnouncementMapper.selectOne(new LambdaQueryWrapper<RecruitAnnouncement>().select(RecruitAnnouncement::getAnnouncementUrl).eq(RecruitAnnouncement::getId, id));
|
||||
return po == null ? null : po.getAnnouncementUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据公告id查询岗位投递地址
|
||||
* <p>只查单列,公告不存在时返回null</p>
|
||||
*/
|
||||
public String getApplyUrl(Long id) {
|
||||
RecruitAnnouncement po = recruitAnnouncementMapper.selectOne(new LambdaQueryWrapper<RecruitAnnouncement>().select(RecruitAnnouncement::getApplyUrl).eq(RecruitAnnouncement::getId, id));
|
||||
return po == null ? null : po.getApplyUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据公告id查询投递邮箱
|
||||
* <p>只查单列,公告不存在时返回null</p>
|
||||
*/
|
||||
public String getApplyEmail(Long id) {
|
||||
RecruitAnnouncement po = recruitAnnouncementMapper.selectOne(new LambdaQueryWrapper<RecruitAnnouncement>().select(RecruitAnnouncement::getApplyEmail).eq(RecruitAnnouncement::getId, id));
|
||||
return po == null ? null : po.getApplyEmail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计公告数量(今日新增/本月新增/累计)
|
||||
* <p>1. 按东八区算出今日零点、本月1号零点 2. 一次SQL条件聚合出三个计数 3. 转DTO返回</p>
|
||||
*/
|
||||
public RecruitAnnouncementStatisticsDto getStatistics() {
|
||||
LocalDate today = LocalDate.now(STAT_ZONE);
|
||||
Instant dayStart = today.atStartOfDay(STAT_ZONE).toInstant();
|
||||
Instant monthStart = today.withDayOfMonth(1).atStartOfDay(STAT_ZONE).toInstant();
|
||||
RecruitAnnouncementStatisticsVo vo = recruitAnnouncementMapper.selectStatistics(dayStart, monthStart);
|
||||
RecruitAnnouncementStatisticsDto dto = new RecruitAnnouncementStatisticsDto();
|
||||
BeanUtils.copyProperties(vo, dto);
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告批次列表
|
||||
* <p>按batch_name分组去重后返回</p>
|
||||
*/
|
||||
public List<String> listBatchName() {
|
||||
return batchMapper.selectBatchNameGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告岗位大类列表
|
||||
* <p>按category_name分组去重后返回</p>
|
||||
*/
|
||||
public List<String> listCategoryName() {
|
||||
return categoryMapper.selectCategoryNameGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告热招城市列表
|
||||
* <p>按city_name分组去重后返回</p>
|
||||
*/
|
||||
public List<String> listCityName() {
|
||||
return cityMapper.selectCityNameGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告学历要求列表
|
||||
* <p>按education_name分组去重后返回</p>
|
||||
*/
|
||||
public List<String> listEducationName() {
|
||||
return educationMapper.selectEducationNameGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告行业列表
|
||||
* <p>按industry_name分组去重后返回</p>
|
||||
*/
|
||||
public List<String> listIndustryName() {
|
||||
return industryMapper.selectIndustryNameGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告标签列表
|
||||
* <p>按tag_name分组去重后返回</p>
|
||||
*/
|
||||
public List<String> listTagName() {
|
||||
return tagMapper.selectTagNameGroup();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告招聘届数列表
|
||||
* <p>按recruit_year分组去重后返回</p>
|
||||
*/
|
||||
public List<Integer> listRecruitYear() {
|
||||
return yearMapper.selectRecruitYearGroup();
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ app:
|
||||
|
||||
#开放接口
|
||||
ignore:
|
||||
urls: "/public/**,/job/list,/job/detail,/route/menu"
|
||||
urls: "/public/**,/job/detail,/route/menu"
|
||||
|
||||
# 简历配置
|
||||
resume:
|
||||
|
||||
@@ -80,7 +80,7 @@ app:
|
||||
|
||||
#开放接口
|
||||
ignore:
|
||||
urls: "/public/**,/job/list,/job/detail,/route/menu"
|
||||
urls: "/public/**,/job/detail,/route/menu"
|
||||
|
||||
# 简历配置
|
||||
resume:
|
||||
|
||||
@@ -81,7 +81,7 @@ app:
|
||||
|
||||
#开放接口
|
||||
ignore:
|
||||
urls: "/public/**,/job/list,/job/detail,/route/menu"
|
||||
urls: "/public/**,/job/detail,/route/menu"
|
||||
|
||||
# 简历配置
|
||||
resume:
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PageParam {
|
||||
|
||||
/** 每页条数 */
|
||||
@Min(value = 1, message = "每页条数最小为1")
|
||||
@Max(value = 1000, message = "每页条数最大为100")
|
||||
@Max(value = 200, message = "每页条数最大为200")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,5 +19,5 @@ public interface JobMapper extends CommonMapper<Job> {
|
||||
/**
|
||||
* 分页查询岗位列表
|
||||
*/
|
||||
Page<JobListItemVo> selectJobPage(Page<JobListItemVo> page, @Param("jobIds") List<Long> jobIds, @Param("statusFilter") List<Integer> statusFilter, @Param("keyword") String keyword, @Param("regionCodes") List<String> regionCodes, @Param("categoryIds") List<Long> categoryIds, @Param("industryIds") List<Long> industryIds, @Param("employmentType") Integer employmentType, @Param("excludeJobIds") List<Long> excludeJobIds, @Param("excludeCompanyIds") List<Long> excludeCompanyIds, @Param("excludeRegionCodes") List<String> excludeRegionCodes, @Param("excludeIndustryIds") List<Long> excludeIndustryIds, @Param("recruitCategory") Integer recruitCategory, @Param("companyTypes") List<String> companyTypes);
|
||||
Page<JobListItemVo> selectJobPage(Page<JobListItemVo> page, @Param("jobIds") List<Long> jobIds, @Param("statusFilter") List<Integer> statusFilter, @Param("keyword") String keyword, @Param("regionCodes") List<String> regionCodes, @Param("categoryIds") List<Long> categoryIds, @Param("industryIds") List<Long> industryIds, @Param("employmentType") Integer employmentType, @Param("excludeJobIds") List<Long> excludeJobIds, @Param("excludeCompanyIds") List<Long> excludeCompanyIds, @Param("excludeRegionCodes") List<String> excludeRegionCodes, @Param("excludeIndustryIds") List<Long> excludeIndustryIds, @Param("recruitCategory") Integer recruitCategory, @Param("companyTypes") List<String> companyTypes, @Param("companyId") Long companyId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementBatch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-批次关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementBatchMapper extends CommonMapper<RecruitAnnouncementBatch> {
|
||||
|
||||
/**
|
||||
* 查询去重后的批次名称列表
|
||||
*/
|
||||
@Select("SELECT batch_name FROM bg_recruit_announcement_batch GROUP BY batch_name")
|
||||
List<String> selectBatchNameGroup();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-岗位大类关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementCategoryMapper extends CommonMapper<RecruitAnnouncementCategory> {
|
||||
|
||||
/**
|
||||
* 查询去重后的岗位大类名称列表
|
||||
*/
|
||||
@Select("SELECT category_name FROM bg_recruit_announcement_category GROUP BY category_name")
|
||||
List<String> selectCategoryNameGroup();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementCity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-热招城市关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementCityMapper extends CommonMapper<RecruitAnnouncementCity> {
|
||||
|
||||
/**
|
||||
* 查询去重后的热招城市名称列表
|
||||
*/
|
||||
@Select("SELECT city_name FROM bg_recruit_announcement_city GROUP BY city_name")
|
||||
List<String> selectCityNameGroup();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementEducation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-学历要求关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementEducationMapper extends CommonMapper<RecruitAnnouncementEducation> {
|
||||
|
||||
/**
|
||||
* 查询去重后的学历要求名称列表
|
||||
*/
|
||||
@Select("SELECT education_name FROM bg_recruit_announcement_education GROUP BY education_name")
|
||||
List<String> selectEducationNameGroup();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementIndustry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-行业关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementIndustryMapper extends CommonMapper<RecruitAnnouncementIndustry> {
|
||||
|
||||
/**
|
||||
* 查询去重后的行业名称列表
|
||||
*/
|
||||
@Select("SELECT industry_name FROM bg_recruit_announcement_industry GROUP BY industry_name")
|
||||
List<String> selectIndustryNameGroup();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncement;
|
||||
import org.jiayunet.pojo.vo.RecruitAnnouncementListItemVo;
|
||||
import org.jiayunet.pojo.vo.RecruitAnnouncementStatisticsVo;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告主表Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementMapper extends CommonMapper<RecruitAnnouncement> {
|
||||
|
||||
/**
|
||||
* 查询最后更新时间
|
||||
* <p>按id倒序取第一条的创建时间</p>
|
||||
*/
|
||||
Instant selectLastCreateTime();
|
||||
|
||||
/**
|
||||
* 统计公告数量(日/月/累计)
|
||||
* <p>一次扫描算三个计数,保证三个数字来自同一快照;无数据时计数为0</p>
|
||||
*
|
||||
* @param dayStart 今日开始时间
|
||||
* @param monthStart 本月开始时间
|
||||
*/
|
||||
RecruitAnnouncementStatisticsVo selectStatistics(@Param("dayStart") Instant dayStart, @Param("monthStart") Instant monthStart);
|
||||
|
||||
/**
|
||||
* 分页查询招聘公告列表
|
||||
* <p>各筛选条件为“且”关系,为空则不参与筛选;多值维度不在此查询,由Java侧按id批量组装</p>
|
||||
*/
|
||||
Page<RecruitAnnouncementListItemVo> selectAnnouncementPage(Page<RecruitAnnouncementListItemVo> page, @Param("keyword") String keyword, @Param("publishTimeStart") Instant publishTimeStart, @Param("publishTimeEnd") Instant publishTimeEnd, @Param("applyEndTimeStart") Instant applyEndTimeStart, @Param("applyEndTimeEnd") Instant applyEndTimeEnd, @Param("companyTypes") List<String> companyTypes, @Param("educationNames") List<String> educationNames, @Param("recruitYears") List<Integer> recruitYears, @Param("batchNames") List<String> batchNames, @Param("categoryNames") List<String> categoryNames, @Param("cityNames") List<String> cityNames, @Param("industryNames") List<String> industryNames, @Param("tagNames") List<String> tagNames);
|
||||
|
||||
/**
|
||||
* 分页查询推荐公告
|
||||
* <p>命中任一行业或任一岗位大类即可</p>
|
||||
*/
|
||||
Page<RecruitAnnouncementListItemVo> selectRecommendPage(Page<RecruitAnnouncementListItemVo> page, @Param("industryNames") List<String> industryNames, @Param("categoryNames") List<String> categoryNames);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementTag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-标签组关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementTagMapper extends CommonMapper<RecruitAnnouncementTag> {
|
||||
|
||||
/**
|
||||
* 查询去重后的标签名称列表
|
||||
*/
|
||||
@Select("SELECT tag_name FROM bg_recruit_announcement_tag GROUP BY tag_name")
|
||||
List<String> selectTagNameGroup();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncementYear;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告-招聘届数关联Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecruitAnnouncementYearMapper extends CommonMapper<RecruitAnnouncementYear> {
|
||||
|
||||
/**
|
||||
* 查询去重后的招聘届数列表
|
||||
*/
|
||||
@Select("SELECT recruit_year FROM bg_recruit_announcement_year GROUP BY recruit_year")
|
||||
List<Integer> selectRecruitYearGroup();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jiayunet.pojo.po.UserFuncUnlock;
|
||||
|
||||
/**
|
||||
* 用户功能当日解锁记录Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserFuncUnlockMapper extends CommonMapper<UserFuncUnlock> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.jiayunet.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告查询条件(Mapper入参)
|
||||
* <p>各条件之间为“且”关系,为空则不参与筛选</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementQueryDto {
|
||||
|
||||
/** 发布时间起(不含) */
|
||||
private Instant publishTimeStart;
|
||||
|
||||
/** 发布时间止(含) */
|
||||
private Instant publishTimeEnd;
|
||||
|
||||
/** 投递截止时间起(不含) */
|
||||
private Instant applyEndTimeStart;
|
||||
|
||||
/** 投递截止时间止(含) */
|
||||
private Instant applyEndTimeEnd;
|
||||
|
||||
/** 公司类型列表 */
|
||||
private List<String> companyTypes;
|
||||
|
||||
/** 学历要求列表 */
|
||||
private List<String> educationNames;
|
||||
|
||||
/** 招聘届数列表 */
|
||||
private List<Integer> recruitYears;
|
||||
|
||||
/** 批次列表 */
|
||||
private List<String> batchNames;
|
||||
|
||||
/** 岗位大类列表 */
|
||||
private List<String> categoryNames;
|
||||
|
||||
/** 热招城市列表 */
|
||||
private List<String> cityNames;
|
||||
|
||||
/** 行业列表 */
|
||||
private List<String> industryNames;
|
||||
|
||||
/** 标签列表 */
|
||||
private List<String> tagNames;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告主表(bg_recruit_announcement)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement")
|
||||
public class RecruitAnnouncement {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 关联企业主表ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 公司名称 */
|
||||
private String companyName;
|
||||
|
||||
/** 公告标题 */
|
||||
private String title;
|
||||
|
||||
/** 公司简介 */
|
||||
private String companyIntro;
|
||||
|
||||
/** 面向对象,如2027届本硕博 */
|
||||
private String targetAudience;
|
||||
|
||||
/** 专业要求 */
|
||||
private String majorRequire;
|
||||
|
||||
/** 招聘岗位 */
|
||||
private String recruitPosition;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 是否笔试:有 / 无 / 未明确 */
|
||||
private String writtenExam;
|
||||
|
||||
/** 投递开始时间 */
|
||||
private Instant applyStartTime;
|
||||
|
||||
/** 投递结束时间 */
|
||||
private Instant applyEndTime;
|
||||
|
||||
/** 投递截止描述,如"尽快投递" */
|
||||
private String applyEndDesc;
|
||||
|
||||
/** 专属内推码 */
|
||||
private String inviteCode;
|
||||
|
||||
/** 公告地址 */
|
||||
private String announcementUrl;
|
||||
|
||||
/** 投递地址 */
|
||||
private String applyUrl;
|
||||
|
||||
/** 投递邮箱 */
|
||||
private String applyEmail;
|
||||
|
||||
/** 信息来源说明 */
|
||||
private String source;
|
||||
|
||||
/** 公告发布/更新时间 */
|
||||
private Instant publishTime;
|
||||
|
||||
/** 清洗状态 0=清洗中 1=清洗完成 */
|
||||
private Integer cleanStatus;
|
||||
|
||||
/** 状态 0=失效 1=有效 */
|
||||
private Integer status;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Instant updateTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-批次关联表(bg_recruit_announcement_batch)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_batch")
|
||||
public class RecruitAnnouncementBatch {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 批次值,枚举:实习/暑期实习/寒假实习/秋招提前批/秋招正式批/秋招补招/春招提前批/春招正式批/春招补招/校园招聘/社招 */
|
||||
private String batchName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-岗位大类关联表(bg_recruit_announcement_category)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_category")
|
||||
public class RecruitAnnouncementCategory {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 岗位分类值,取自固定分类表,如后端开发/人工智能/产品经理 */
|
||||
private String categoryName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-热招城市关联表(bg_recruit_announcement_city)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_city")
|
||||
public class RecruitAnnouncementCity {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 城市值,如北京市/天津市 */
|
||||
private String cityName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-学历要求关联表(bg_recruit_announcement_education)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_education")
|
||||
public class RecruitAnnouncementEducation {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 学历值,如本科/硕士/博士 */
|
||||
private String educationName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-行业关联表(bg_recruit_announcement_industry)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_industry")
|
||||
public class RecruitAnnouncementIndustry {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 行业分类值,取自固定分类表,如互联网/人工智能/半导体/芯片 */
|
||||
private String industryName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-标签组关联表(bg_recruit_announcement_tag)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_tag")
|
||||
public class RecruitAnnouncementTag {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 标签值,如竞争力薪酬/六险一金/不限专业,不与批次、城市、学历重复 */
|
||||
private String tagName;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告-招聘届数关联表(bg_recruit_announcement_year)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_recruit_announcement_year")
|
||||
public class RecruitAnnouncementYear {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 公告ID */
|
||||
private Long announcementId;
|
||||
|
||||
/** 招聘届数,如2027 */
|
||||
private Integer recruitYear;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 用户功能当日解锁记录表
|
||||
* <p>同一用户当日对同一业务资源重复访问时不再扣减次数</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_user_func_unlock")
|
||||
public class UserFuncUnlock {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 功能编码
|
||||
*/
|
||||
private String funcCode;
|
||||
|
||||
/**
|
||||
* 解锁日期
|
||||
*/
|
||||
private LocalDate unlockDate;
|
||||
|
||||
/**
|
||||
* 业务资源标识,如岗位ID
|
||||
*/
|
||||
private String bizKey;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告列表项VO(SQL查询结果,多值维度由Java侧组装)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementListItemVo {
|
||||
|
||||
/** 公告ID */
|
||||
private Long id;
|
||||
|
||||
/** 公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 公司名称 */
|
||||
private String companyName;
|
||||
|
||||
/** 公司logo */
|
||||
private String logoUrl;
|
||||
|
||||
/** 公告标题 */
|
||||
private String title;
|
||||
|
||||
/** 专业要求 */
|
||||
private String majorRequire;
|
||||
|
||||
/** 投递结束时间 */
|
||||
private Instant applyEndTime;
|
||||
|
||||
/** 投递截止描述 */
|
||||
private String applyEndDesc;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 招聘公告统计VO(SQL查询结果)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementStatisticsVo {
|
||||
|
||||
/** 今日新增公告数 */
|
||||
private Long dayCount;
|
||||
|
||||
/** 本月新增公告数 */
|
||||
private Long monthCount;
|
||||
|
||||
/** 累计公告数 */
|
||||
private Long totalCount;
|
||||
}
|
||||
@@ -57,7 +57,7 @@
|
||||
r.name AS region_name,
|
||||
cat.id AS category_id,
|
||||
cat.name AS category_name
|
||||
FROM bg_job j
|
||||
FROM bg_job j force index (`PRIMARY`)
|
||||
INNER JOIN bg_company c ON j.company_id = c.id
|
||||
INNER JOIN bg_china_regions_code r ON c.region_code = r.code
|
||||
INNER JOIN bg_job_category cat ON j.category_id = cat.id
|
||||
@@ -149,6 +149,10 @@
|
||||
#{type}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 筛选条件:公司ID -->
|
||||
<if test="companyId != null">
|
||||
AND j.company_id = #{companyId}
|
||||
</if>
|
||||
ORDER BY j.id DESC
|
||||
</select>
|
||||
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jiayunet.mapper.RecruitAnnouncementMapper">
|
||||
|
||||
<resultMap id="RecruitAnnouncementStatisticsVoMap" type="org.jiayunet.pojo.vo.RecruitAnnouncementStatisticsVo">
|
||||
<result column="day_count" property="dayCount"/>
|
||||
<result column="month_count" property="monthCount"/>
|
||||
<result column="total_count" property="totalCount"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 查询最后更新时间:按id倒序取第一条的创建时间 -->
|
||||
<select id="selectLastCreateTime" resultType="java.time.Instant">
|
||||
SELECT create_time
|
||||
FROM bg_recruit_announcement
|
||||
ORDER BY id DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 统计公告数量:一次扫描算出日/月/累计三个计数,保证三个数字来自同一快照 -->
|
||||
<select id="selectStatistics" resultMap="RecruitAnnouncementStatisticsVoMap">
|
||||
SELECT
|
||||
IFNULL(SUM(create_time <![CDATA[>=]]> #{dayStart}), 0) AS day_count,
|
||||
IFNULL(SUM(create_time <![CDATA[>=]]> #{monthStart}), 0) AS month_count,
|
||||
COUNT(*) AS total_count
|
||||
FROM bg_recruit_announcement
|
||||
</select>
|
||||
|
||||
<resultMap id="RecruitAnnouncementListItemVoMap" type="org.jiayunet.pojo.vo.RecruitAnnouncementListItemVo">
|
||||
<id column="id" property="id"/>
|
||||
<result column="company_id" property="companyId"/>
|
||||
<result column="company_name" property="companyName"/>
|
||||
<result column="logo_url" property="logoUrl"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="major_require" property="majorRequire"/>
|
||||
<result column="apply_end_time" property="applyEndTime"/>
|
||||
<result column="apply_end_desc" property="applyEndDesc"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 分页查询公告列表:多值维度不在此取,由Java侧按id批量组装 -->
|
||||
<select id="selectAnnouncementPage" resultMap="RecruitAnnouncementListItemVoMap">
|
||||
SELECT
|
||||
ra.id,
|
||||
ra.company_id,
|
||||
ra.company_name,
|
||||
c.logo_url,
|
||||
ra.title,
|
||||
ra.major_require,
|
||||
ra.apply_end_time,
|
||||
ra.apply_end_desc
|
||||
FROM bg_recruit_announcement ra
|
||||
INNER JOIN bg_company c ON ra.company_id = c.id
|
||||
WHERE c.status = 1 AND ra.status = 1 and ra.clean_status = 1
|
||||
<!-- 关键字:公司名称 / 招聘岗位 -->
|
||||
<if test="keyword != null and keyword.length() > 0">
|
||||
AND (
|
||||
ra.company_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR ra.recruit_position LIKE CONCAT('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:发布时间区间 -->
|
||||
<if test="publishTimeStart != null">
|
||||
AND ra.publish_time <![CDATA[>]]> #{publishTimeStart}
|
||||
</if>
|
||||
<if test="publishTimeEnd != null">
|
||||
AND ra.publish_time <![CDATA[<=]]> #{publishTimeEnd}
|
||||
</if>
|
||||
<!-- 筛选条件:投递截止时间区间 -->
|
||||
<if test="applyEndTimeStart != null">
|
||||
AND ra.apply_end_time <![CDATA[>]]> #{applyEndTimeStart}
|
||||
</if>
|
||||
<if test="applyEndTimeEnd != null">
|
||||
AND ra.apply_end_time <![CDATA[<=]]> #{applyEndTimeEnd}
|
||||
</if>
|
||||
<!-- 筛选条件:公司类型 -->
|
||||
<if test="companyTypes != null and companyTypes.size() > 0">
|
||||
AND c.company_type IN
|
||||
<foreach collection="companyTypes" item="type" open="(" separator="," close=")">
|
||||
#{type}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 筛选条件:学历要求 -->
|
||||
<if test="educationNames != null and educationNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rae.announcement_id
|
||||
FROM bg_recruit_announcement_education rae
|
||||
WHERE rae.education_name IN
|
||||
<foreach collection="educationNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:招聘届数 -->
|
||||
<if test="recruitYears != null and recruitYears.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT ray.announcement_id
|
||||
FROM bg_recruit_announcement_year ray
|
||||
WHERE ray.recruit_year IN
|
||||
<foreach collection="recruitYears" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:批次 -->
|
||||
<if test="batchNames != null and batchNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rab.announcement_id
|
||||
FROM bg_recruit_announcement_batch rab
|
||||
WHERE rab.batch_name IN
|
||||
<foreach collection="batchNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:岗位大类 -->
|
||||
<if test="categoryNames != null and categoryNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rac.announcement_id
|
||||
FROM bg_recruit_announcement_category rac
|
||||
WHERE rac.category_name IN
|
||||
<foreach collection="categoryNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:热招城市 -->
|
||||
<if test="cityNames != null and cityNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT ract.announcement_id
|
||||
FROM bg_recruit_announcement_city ract
|
||||
WHERE ract.city_name IN
|
||||
<foreach collection="cityNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:行业 -->
|
||||
<if test="industryNames != null and industryNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rai.announcement_id
|
||||
FROM bg_recruit_announcement_industry rai
|
||||
WHERE rai.industry_name IN
|
||||
<foreach collection="industryNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:标签 -->
|
||||
<if test="tagNames != null and tagNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rat.announcement_id
|
||||
FROM bg_recruit_announcement_tag rat
|
||||
WHERE rat.tag_name IN
|
||||
<foreach collection="tagNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
ORDER BY ra.id DESC
|
||||
</select>
|
||||
|
||||
<!-- 分页查询推荐公告:命中任一行业或任一岗位大类 -->
|
||||
<select id="selectRecommendPage" resultMap="RecruitAnnouncementListItemVoMap">
|
||||
SELECT
|
||||
ra.id,
|
||||
ra.company_name,
|
||||
c.logo_url
|
||||
FROM bg_recruit_announcement ra
|
||||
INNER JOIN bg_company c ON ra.company_id = c.id
|
||||
WHERE c.status = 1
|
||||
AND ra.status = 1
|
||||
AND ra.clean_status = 1
|
||||
<!-- 命中任一维度:UNION合并两个维度的公告id,外层保持单个可半连接的IN -->
|
||||
AND ra.id IN (
|
||||
<trim prefixOverrides="UNION">
|
||||
<if test="industryNames != null and industryNames.size() > 0">
|
||||
SELECT rai.announcement_id
|
||||
FROM bg_recruit_announcement_industry rai
|
||||
WHERE rai.industry_name IN
|
||||
<foreach collection="industryNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="categoryNames != null and categoryNames.size() > 0">
|
||||
UNION
|
||||
SELECT rac.announcement_id
|
||||
FROM bg_recruit_announcement_category rac
|
||||
WHERE rac.category_name IN
|
||||
<foreach collection="categoryNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
ORDER BY ra.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user