Your Name 7 月之前
父节点
当前提交
58e3754ea0

+ 5 - 71
src/main/java/com/sqx/modules/intention/service/impl/IntentionServiceImpl.java

@@ -41,79 +41,13 @@ public class IntentionServiceImpl extends ServiceImpl<IntentionDao, Intention> i
 
     @Override
     public Result saveUpdate(Intention intention) {
-        // 1. 处理默认意向:全局最多3条is_default=1的数据
-        boolean isSetDefault = intention.getIsDefault() == 1;
-        if (isSetDefault) {
-            // 查询当前数据库中is_default=1的总数
-            int currentDefaultCount = baseMapper.selectCount(new QueryWrapper<Intention>().eq("is_default", 1));
-
-            // 判断是否需要校验(新增默认 或 修改非默认→默认)
-            boolean needCheck = false;
-            if (intention.getIntentionId() == null) {
-                // 新增操作:设置为默认会使总数+1,需校验
-                needCheck = true;
-            } else {
-                // 修改操作:查询原记录的is_default值
-                Intention oldIntention = baseMapper.selectById(intention.getIntentionId());
-                if (oldIntention != null && oldIntention.getIsDefault() == 0) {
-                    // 原记录不是默认,现在改为默认,总数+1,需校验
-                    needCheck = true;
-                }
-            }
-
-            // 校验:若需要检查且当前总数已≥3,禁止操作
-            if (needCheck && currentDefaultCount >= 3) {
-                return Result.error("系统最多只能有3条默认求职意向");
-            }
-        }
-
-        // 2. 校验用户的意向总数限制(原有逻辑:每个用户最多maxCount个意向)
-        QueryWrapper<Intention> countWrapper = new QueryWrapper<Intention>()
-                .eq("user_id", intention.getUserId())
-                .ne(intention.getIntentionId() != null, "intention_id", intention.getIntentionId());
-        int userIntentionCount = baseMapper.selectCount(countWrapper);
-        int maxUserCount = Integer.parseInt(commonInfoService.findOne(325).getValue()); // 每个用户的最大意向数
-        if (userIntentionCount >= maxUserCount) {
-            return Result.error("当前用户求职意向最多添加" + maxUserCount + "个");
-        }
-
-        // 3. 区分新增/修改操作
-        if (intention.getIntentionId() != null) {
-            // 修改操作
-            return Result.upStatus(baseMapper.updateById(intention));
-        } else {
-            // 新增操作:补充基础信息
-            UserEntity userEntity = userService.getById(intention.getUserId());
-            if (userEntity == null) {
-                return Result.error("用户不存在");
-            }
-            intention.setCreateTime(LocalDateTime.now());
-            intention.setUserName(userEntity.getUserName());
-
-            // 补充三级分类信息
-            RuleClassify ruleClassify = classifyService.getById(intention.getRuleClassifyId());
-            if (ruleClassify == null) {
-                return Result.error("三级分类不存在");
-            }
-            RuleClassify twoClassify = classifyService.getOne(new QueryWrapper<RuleClassify>()
-                    .eq("rule_classify_id", ruleClassify.getParentId()));
-            if (twoClassify == null) {
-                return Result.error("二级分类不存在");
-            }
-            RuleClassify oneClassify = classifyService.getOne(new QueryWrapper<RuleClassify>()
-                    .eq("rule_classify_id", twoClassify.getParentId()));
-            if (oneClassify == null) {
-                return Result.error("一级分类不存在");
-            }
-            intention.setRuleClassifyId(ruleClassify.getRuleClassifyId());
-            intention.setClassifyTwoId(twoClassify.getRuleClassifyId());
-            intention.setClassifyOneId(oneClassify.getRuleClassifyId());
-
-            // 执行插入
-            return Result.upStatus(baseMapper.insert(intention));
+        int num = baseMapper.selectCount(new QueryWrapper<Intention>().eq("user_id", intention.getUserId()).eq("is_default", 1));
+        if (num < 3) {
+             return Result.upStatus(baseMapper.insert(intention));
+        }else {
+            return  Result.error("最多保存三条求职意向");
         }
     }
-
     @Override
     public IPage<Intention> getIntentionList(Integer page, Integer limit, Intention intention) {
         Page<Intention> pages;

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

@@ -108,7 +108,7 @@ public class InterviewRecordController {
     }
     @Login
     @PostMapping("selectHrPhone")
-    @ApiOperation("新增岗位联系人")
+    @ApiOperation("搜索岗位联系人")
     public  Result selectHrPhone (@RequestAttribute("userID")Long userId){
         return Result.success().put("data",hrPhoneService.getBaseMapper().selectList(new QueryWrapper<HrPhone>().eq("user_id",userId).eq("is_use",1)));
     }

+ 1 - 1
src/main/java/com/sqx/modules/resumes/controller/app/AppCompanyController.java

@@ -122,6 +122,6 @@ public class AppCompanyController {
     @GetMapping("/getCompanyPostPush")
     @ApiOperation("获取公司岗位列表")
     public Result getCompanyPostPush(String key, Integer page, Integer limit,Double lng,Double lat, PostPush postPush){
-        return companyService.selectCompanyPostPushList(key,postPush,page,limit,lat,lng);
+        return Result.success().put("data",companyService.selectCompanyPostPushList(key,postPush,page,limit,lat,lng));
     }
 }

+ 3 - 1
src/main/java/com/sqx/modules/resumes/dao/PostPushDao.java

@@ -42,9 +42,11 @@ public interface PostPushDao extends BaseMapper<PostPush> {
 
     List<String> getCityCompanyId(@Param("companyId") Long companyId);
 
-    List<String> getCompanyClassify(@Param("companyId") Long companyId);
+   List<PostPush> getCompanyClassify(@Param("companyId") Long companyId);
 
     IPage<PostPush> getAdminPostPushList(@Param("pages") Page<PostPush> pages, @Param("postPush") PostPush postPush, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     List<Object> getHotPost();
+
+    List<PostPush> getPostPushListUser(Double lng, Double lat, PostPush postPush, String[] industry, String[] education, String[] experience, String[] companyPeople, String[] salaryRange);
 }

+ 15 - 14
src/main/java/com/sqx/modules/resumes/entity/ResumesListDto.java

@@ -5,32 +5,33 @@ import lombok.Data;
 @Data
 public class ResumesListDto {
         // 用户基本信息
-        private String userName;
-        private Integer userAge;
-        private Integer userSex;
-        private String  userAvatar;
+        private String userName;//用户名
+        private Integer userAge;//年龄
+        private Integer userSex;//性别
+        private String  userAvatar;//头像
 
         // 工作经历信息
-        private String workType;
-        private String companyName;
+        private String workType;//最后一份工作工作类型
+        private String companyName;//公司名称
         private String intentIndustry;// 最后工作结束时间
-        private String lastWorkStartTime;
-        private String lastWorkEndTime;
-        private String workContent;
+        private String lastWorkStartTime;//开始时间
+        private String lastWorkEndTime;//结束时间
+        private String workContent;//工作内容
 
         // 教育经历信息
-        private String school;
+        private String school;//毕业学校
         private String degree;  // 学历(如本科、硕士)
 
         // 求职意向信息
         private String expectedPosition;  // 期望职位
         private String expectedCity;      // 期望城市
-        private Integer minSalary; // 期望薪资范围
-        private Integer maxSalary;
+        private Integer minSalary; // 期望薪资最小范围
+        private Integer maxSalary;//期望薪资最大范围
         // 简历信息
         private String resumesEducation;  // 简历学历信息
         private String resumesWorkExperience;  // 简历工作经历信息
-        private Long resumesId;
-        private Integer  isRecommend;
+        private Long resumesId;//简历ID
+        private Integer  isRecommend;//是否推荐
+        private Integer resumesStatus;//个人现在状态
     }
 

+ 4 - 1
src/main/java/com/sqx/modules/resumes/service/CompanyService.java

@@ -1,12 +1,15 @@
 package com.sqx.modules.resumes.service;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.resumes.entity.Company;
 import com.sqx.modules.resumes.entity.PostPush;
 import com.sqx.modules.utils.excel.ExcelData;
 
+import java.util.List;
+
 public interface CompanyService extends IService<Company> {
 
     Result insertCompany(Company company,Long userId);
@@ -29,6 +32,6 @@ public interface CompanyService extends IService<Company> {
 
     Result listCompany(Integer page, Integer limit, String companyName, String city, String companyScope, String companyPeople);
 
-    Result selectCompanyPostPushList(String key, PostPush postPush, Integer page, Integer limit, Double lat, Double lng);
+    IPage<Company> selectCompanyPostPushList(String key, PostPush postPush, Integer page, Integer limit, Double lat, Double lng);
 
 }

+ 1 - 1
src/main/java/com/sqx/modules/resumes/service/PostPushService.java

@@ -48,7 +48,7 @@ public interface PostPushService extends IService<PostPush> {
 
     List<String> getCityCompanyId(Long companyId);
 
-    List<String> getCompanyClassify(Long companyId);
+   List<PostPush> getCompanyClassify(Long companyId);
 
     Result refreshPostPush(Long userId);
 

+ 33 - 12
src/main/java/com/sqx/modules/resumes/service/impl/CompanyServiceImpl.java

@@ -17,6 +17,7 @@ import com.sqx.modules.firstLogin.service.HrService;
 import com.sqx.modules.message.entity.MessageInfo;
 import com.sqx.modules.message.service.MessageService;
 import com.sqx.modules.resumes.dao.CompanyDao;
+import com.sqx.modules.resumes.dao.PostPushDao;
 import com.sqx.modules.resumes.entity.Company;
 import com.sqx.modules.resumes.entity.CompanyUser;
 import com.sqx.modules.resumes.entity.PostPush;
@@ -26,6 +27,7 @@ import com.sqx.modules.resumes.service.PostPushService;
 import com.sqx.modules.utils.SenInfoCheckUtil;
 import com.sqx.modules.utils.excel.ExcelData;
 import org.apache.commons.lang.StringUtils;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -52,9 +54,13 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
     private HrService hrService;
     @Autowired
     private CompanyUserService companyUserService;
+    @Autowired
+    private CompanyService companyService;
+    @Autowired
+    private PostPushDao postPushDao;
 
 
-//    @Override
+    //    @Override
 //    public Result insertCompany(Company company) {
 //        Company oldCompany = selectCompanyByUserId(company.getUserId());
 //        if (oldCompany != null) {
@@ -185,8 +191,8 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
     }
     @Override
     public Company selectCompanyByUserId(Long userId) {
-
-        return baseMapper.selectOne(new QueryWrapper<Company>().eq("user_id", userId));
+        CompanyUser companyUser = companyUserService.getOne(new QueryWrapper<CompanyUser>().eq("user_id",userId).eq("is_use",1));
+        return companyService.getById(companyUser.getCompanyId());
     }
 
     @Override
@@ -357,15 +363,30 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
     }
 
     @Override
-    public Result selectCompanyPostPushList(String key, PostPush postPush, Integer page, Integer limit, Double lat, Double lng) {
-        QueryWrapper<Company> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("status",1).eq("is_use",1).like("company_all_name",key);
-        List<Company> companies = baseMapper.selectList(queryWrapper);
-        for (Company company :companies){
-            postPush.setCompanyId(company.getCompanyId());
-            company.setPostPushList( postPushService.getPostPushList(page,limit,lng,lat,null,postPush,null,null));
+    public IPage<Company> selectCompanyPostPushList(String key, PostPush postPush, Integer page, Integer limit, Double lat, Double lng) {
+
+        Page<Company> pages;
+        if (page != null && limit != null) {
+            pages = new Page<>(page, limit);
+        } else {
+            pages = new Page<>();
+            pages.setSize(-1);
         }
-        return Result.success().put("data",companies);
+        String[] industry = StringUtils.isNotBlank(postPush.getIndustry()) ? postPush.getIndustry().split(",") : null;
+        String[] education = StringUtils.isNotBlank(postPush.getEducation()) ? postPush.getEducation().split(",") : null;
+        String[] experience = StringUtils.isNotBlank(postPush.getExperience()) ? postPush.getExperience().split(",") : null;
+        String[] companyPeople = StringUtils.isNotBlank(postPush.getCompanyPeople()) ? postPush.getCompanyPeople().split(",") : null;
+        String[] salaryRange = StringUtils.isNotBlank(postPush.getSalaryRange()) ? postPush.getSalaryRange().split(",") : null;
+
+        IPage<Company> companies = companyService.getBaseMapper().selectPage(pages, new QueryWrapper<Company>().eq("is_use", 1).eq("status", 1).like(StringUtils.isNotBlank(key), "company_all_name", key));
+
+            for (Company company : companies.getRecords()){
+                company.setPostPushList(postPushDao.getPostPushListUser(lng, lat, postPush, industry, education, experience, companyPeople, salaryRange));
+            }
+            return companies;
+        }
+
+
     }
 
 //    @Override
@@ -380,4 +401,4 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
 //        return Result.success().put("data",companies);
 //    }
 
-}
+

+ 7 - 4
src/main/java/com/sqx/modules/resumes/service/impl/PostPushServiceImpl.java

@@ -435,7 +435,7 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
     }
 
     @Override
-    public List<String> getCompanyClassify(Long companyId) {
+    public List<PostPush> getCompanyClassify(Long companyId) {
         return baseMapper.getCompanyClassify(companyId);
 
     }
@@ -521,9 +521,9 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
         PostPush postPush = baseMapper.selectById(postPushId);
         Company company = companyService.getById(postPush.getCompanyId());
         Long a = Long.valueOf(postPush.getUserId());
-            if (a.equals(userId)){
-                int count = userBrowseService.count(new QueryWrapper<UserBrowse>().eq("user_id", userId).eq("post_push_id", postPushId));
-                if (count == 0) {
+            if (!a.equals(userId)){
+                UserBrowse userBrowseOld = userBrowseService.getBaseMapper().selectOne(new QueryWrapper<UserBrowse>().eq("user_id", userId).eq("post_push_id", postPushId));
+                if (userBrowseOld == null) {
                     UserBrowse userBrowse = new UserBrowse();
                     userBrowse.setUserId(userId);
                     userBrowse.setBrowseType(1);
@@ -531,6 +531,9 @@ public class PostPushServiceImpl extends ServiceImpl<PostPushDao, PostPush> impl
                     userBrowse.setPostPushCompanyId(company.getCompanyId());
                     userBrowse.setUpdateTime(LocalDateTime.now());
                     userBrowseService.save(userBrowse);
+                }else {
+                    userBrowseOld.setUpdateTime(LocalDateTime.now());
+                    userBrowseService.updateById(userBrowseOld);
                 }
                 postPush.setCompany(company);
                 postPush.setUser(userService.getById(postPush.getUserId()));

+ 1 - 1
src/main/java/com/sqx/modules/resumes/service/impl/ResumesServiceImpl.java

@@ -391,7 +391,7 @@ public class ResumesServiceImpl extends ServiceImpl<ResumesDao, Resumes> impleme
     @Override
     public Result sendResumes(Long userId, Long to, Long postPushId) {
         Resumes resumes = baseMapper.selectOne(new QueryWrapper<Resumes>().eq("user_id", userId));
-        Company company = companyService.getOne(new QueryWrapper<Company>().eq("user_id", to));
+        Company company = companyService.selectCompanyByUserId(to);
         sendEmail(resumes.getResumesId(), company.getEmail(), resumes.getResumesName());
         SendRecord sendRecord = new SendRecord();
         sendRecord.setUserId(userId);

+ 1 - 1
src/main/resources/mapper/chat/ChatContentDao.xml

@@ -10,7 +10,7 @@
         c.user_id as userId,
         u.user_name as userName,
         <if test="userType!=null and userType == 1">
-            (select company_logo from company co where c.user_id =co.user_id) as avatar,
+            (select hr_img from hr where hr.user_id = c.user_id) as avatar,
         </if>
         <if test="userType!=null and userType == 2">
             u.avatar,

+ 6 - 5
src/main/resources/mapper/chat/ChatConversationDao.xml

@@ -9,14 +9,15 @@
         c.chat_conversation_id as chatConversationId,
         c.update_time as updateTime,
         <if test="userType == 1">
-            (select company_name from company co where c.focused_user_id =co.user_id) as userName,
-            (select company_logo from company co where c.focused_user_id =co.user_id) as avatar,
+            (SELECT company_name FROM  company co LEFT JOIN  company_user cu ON co.company_id=cu.company_id WHERE c.focused_user_id= cu.user_id AND cu.is_use = 1) as companyName,
+            (select user_name from tb_user u where u.user_id =  c.focused_user_id) as userName,
+            (select hr.hr_img FROM hr WHERE hr.user_id =  c.focused_user_id) as avatar,
         </if>
         <if test="userType == 2">
-            (select resumes_name from resumes r where c.user_id = r.user_id) as userName,
-            (select avatar from tb_user u where u.user_id = c.user_id) as avatar,
+            (select user_name from tb_user u where c.user_id = u.user_id) as userName,
+            (select avatar from tb_user u where c.user_id = u.user_id) as avatar,
         </if>
-             (select station_name from post_push p where p.post_push_id=c.post_push_id) as stationName,
+             (select rule_classify_name from post_push p where p.post_push_id=c.post_push_id) as stationName,
         c.type,
         c.post_push_id as postPushId,
         c.resumes_id as resumesId,

+ 76 - 2
src/main/resources/mapper/resumes/PostPushDao.xml

@@ -19,7 +19,81 @@
         </if>
         order by p.create_time desc
     </select>
+<select id="getPostPushListUser" resultType="com.sqx.modules.resumes.entity.PostPush">
+    SELECT
+    p.*
+    <if test="postPush.lng!=null and postPush.lat!=null">
+        ,(st_distance(POINT(lng,lat),POINT(#{postPush.lng},#{postPush.lat})) * 111195) AS
+        distance
+    </if>
+    FROM
+    post_push p,
+    company c
+    WHERE p.company_id = c.company_id
+    and c.is_use = 1
+    limit 3
+    <if test="postPush.companyId!=null">
+        and p.company_id = #{postPush.companyId}
+    </if>
+<!--    <if test="isDue!=null">-->
+<!--        and p.is_due = #{isDue}-->
+<!--    </if>-->
+    <if test="postPush.companyName!=null and postPush.companyName!=''">
+        and c.company_name like concat("%",#{postPush.companyName},"%")
+    </if>
+    <if test="companyPeople!=null and companyPeople.length!=0">
+        and
+        <foreach collection="companyPeople" item="item" open="(" separator="or" close=")">
+            c.company_people like concat("%",#{item},"%")
+        </foreach>
+    </if>
+    <if test="education!=null and education.length!=0">
+        and
+        <foreach collection="education" item="item" open="(" separator="or" close=")">
+            p.education like concat("%",#{item},"%")
+        </foreach>
+    </if>
+    <if test="postPush.status !=null">
+        and p.status = #{postPush.status}
+    </if>
+    <if test="postPush.ruleClassifyName!=null and postPush.ruleClassifyName!=''">
+        and p.rule_classify_name like concat("%",#{postPush.ruleClassifyName},"%")
+    </if>
+
+    <if test="experience!=null and experience.length!=0">
+        and
+        <foreach collection="experience" item="item" open="(" separator="or" close=")">
+            p.experience like concat("%",#{item},"%")
+        </foreach>
+    </if>
 
+    <if test="salaryRange!=null and salaryRange.length!=0">
+        and
+        <foreach collection="salaryRange" item="item" open="(" separator="or" close=")">
+            p.salary_range like concat("%",#{item},"%")
+        </foreach>
+    </if>
+
+    <if test="postPush.postType!=null and postPush.postType!=''">
+        and p.post_type = #{postPush.postType}
+    </if>
+
+    <if test="industry!=null and industry.length!=0">
+        and
+        <foreach collection="industry" item="item" open="(" separator="or" close=")">
+            p.industry like concat("%",#{item},"%")
+        </foreach>
+    </if>
+    <if test="postPush.province!=null and postPush.province!=''">
+        and p.province = like concat("%",#{postPush.province},"%")
+    </if>
+    <if test="postPush.city!=null and postPush.city!=''">
+        and p.city like concat("%",#{postPush.city},"%")
+    </if>
+    <if test="postPush.county!=null and postPush.county!=''">
+        and p.county like concat("%",#{postPush.county},"%")
+    </if>
+</select>
     <select id="getPostPushList" resultType="com.sqx.modules.resumes.entity.PostPush">
         SELECT
         p.*
@@ -178,8 +252,8 @@
         WHERE p.company_id = #{companyId}
         GROUP BY city
     </select>
-    <select id="getCompanyClassify" resultType="java.lang.String">
-        SELECT rule_classify_name
+    <select id="getCompanyClassify" resultType="com.sqx.modules.resumes.entity.PostPush">
+        SELECT rule_classify_name ,rule_classify_id,post_push_id
         FROM post_push p
         WHERE p.company_id = #{companyId}
           and p.status = 2

+ 2 - 1
src/main/resources/mapper/resumes/ResumesDao.xml

@@ -90,7 +90,8 @@
         resumes.resumes_education AS resumesEducation,
         resumes.resumes_work_experience AS resumesWorkExperience,
         resumes.resumes_id AS resumesId,
-        resumes.is_recommend AS isRecommend
+        resumes.is_recommend AS isRecommend,
+        resumes.resumes_status AS resumesStatus
         FROM
         tb_user u
         INNER JOIN resumes