From 6f08d63278f9c62259f8f6a66801aa0441156a63 Mon Sep 17 00:00:00 2001 From: sh Date: Mon, 26 Jan 2026 17:38:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=B2=97=E4=BD=8D=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=8E=A5=E5=8F=A3=202.=E6=B7=BB=E5=8A=A0=E5=B2=97?= =?UTF-8?q?=E4=BD=8D=E5=8F=96=E6=B6=88=E5=88=97=E8=A1=A8=203.=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AF=B9=E5=BA=94=E7=9A=84=E7=BB=9F=E8=AE=A1=204.app?= =?UTF-8?q?=5Fuser=E6=B7=BB=E5=8A=A0orgType=E6=9C=BA=E6=9E=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/controller/app/AppJobController.java | 38 +++++++++++++-- .../com/ruoyi/cms/mapper/JobApplyMapper.java | 7 +++ .../ruoyi/cms/service/IJobApplyService.java | 4 ++ .../cms/service/impl/JobApplyServiceImpl.java | 13 ++++- .../resources/mapper/app/AppUserMapper.xml | 3 +- .../resources/mapper/app/JobApplyMapper.xml | 16 +++++++ .../common/core/domain/entity/AppUser.java | 4 +- .../common/core/domain/entity/MyChart.java | 9 ++-- .../common/core/domain/model/LoginBody.java | 13 +++++ .../web/service/SysLoginService.java | 48 ++++++++++--------- 10 files changed, 122 insertions(+), 33 deletions(-) diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/app/AppJobController.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/app/AppJobController.java index ee9adfe..d997d5f 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/app/AppJobController.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/app/AppJobController.java @@ -2,17 +2,16 @@ package com.ruoyi.cms.controller.app; import com.ruoyi.cms.domain.ESJobDocument; import com.ruoyi.cms.domain.Job; +import com.ruoyi.cms.domain.JobApply; import com.ruoyi.cms.domain.query.ESJobSearch; -import com.ruoyi.cms.service.ICompanyService; -import com.ruoyi.cms.service.IESJobSearchService; -import com.ruoyi.cms.service.IJobCollectionService; -import com.ruoyi.cms.service.IJobService; +import com.ruoyi.cms.service.*; import com.ruoyi.cms.util.RoleUtils; import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker; import com.ruoyi.common.annotation.BussinessLog; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.utils.SiteSecurityUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -43,6 +42,8 @@ public class AppJobController extends BaseController private IESJobSearchService esJobSearchService; @Autowired private SensitiveWordChecker sensitiveWordChecker; + @Autowired + private IJobApplyService jobApplyService; /** * 查询岗位列表 @@ -253,4 +254,33 @@ public class AppJobController extends BaseController } return success(jobService.selectApplyJobUserList(jobId)); } + + @ApiOperation("删除岗位申请") + @DeleteMapping("/applyJobCencal") + public AjaxResult applyJobCencal(@RequestBody JobApply apply){ + if(apply==null){ + return AjaxResult.error("参数为空!"); + } + if (apply.getJobId() == null) { + return AjaxResult.error("岗位id为空!"); + } + if(!SiteSecurityUtils.isLogin()){ + return AjaxResult.error("用户未登录!"); + } + if (apply.getUserId() == null) { + apply.setUserId(SiteSecurityUtils.getUserId()); + } + return toAjax(jobApplyService.applyJobCencal(apply)); + } + + @ApiOperation("获取取消岗位岗位详情") + @GetMapping("/selectCencalList") + public TableDataInfo selectCencalList(){ + JobApply queryApply = new JobApply(); + if (queryApply.getUserId() == null) { + queryApply.setUserId(SiteSecurityUtils.getUserId()); + } + List list=jobApplyService.selectCencalList(queryApply); + return getDataTable(list); + } } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/JobApplyMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/JobApplyMapper.java index 3166570..b5f4a4c 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/JobApplyMapper.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/JobApplyMapper.java @@ -9,6 +9,7 @@ import com.ruoyi.cms.domain.Job; import com.ruoyi.cms.domain.JobApply; import com.ruoyi.cms.domain.vo.CandidateVO; import com.ruoyi.common.core.domain.entity.AppUser; +import org.apache.ibatis.annotations.Param; /** * 岗位申请Mapper接口 @@ -39,4 +40,10 @@ public interface JobApplyMapper extends BaseMapper List selectJobApplyListJob(JobApply jobApply); public int updateJobZphApply(JobApply jobApply); + + public List selectCencalList(JobApply jobApply); + + public int applyJobCencal(JobApply jobApply); + + int applyCencalCount(@Param("userId") Long userId); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/IJobApplyService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/IJobApplyService.java index e1f4ae7..f5daed7 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/IJobApplyService.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/IJobApplyService.java @@ -72,4 +72,8 @@ public interface IJobApplyService public List selectJobApplyListJob(JobApply jobApply); public int updateJobZphApply(JobApply jobApply); + + public int applyJobCencal(JobApply jobApply); + + public List selectCencalList(JobApply jobApply); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/JobApplyServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/JobApplyServiceImpl.java index 0c44db6..6125447 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/JobApplyServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/JobApplyServiceImpl.java @@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -109,12 +108,14 @@ public class JobApplyServiceImpl extends ServiceImpl im @Override public HashMap statistics() { Integer applyCount = jobApplyMapper.applyJob(SiteSecurityUtils.getUserId()).size(); + Integer applyCencalCount=jobApplyMapper.applyCencalCount(SiteSecurityUtils.getUserId()); Integer collectionJobCount = jobCollectionMapper.collectionJob(SiteSecurityUtils.getUserId()).size(); Integer collectionCompanyCount = companyCollectionMapper.collectionJob(SiteSecurityUtils.getUserId()).size(); Integer jobReviewCount = appReviewJobMapper.review(SiteSecurityUtils.getUserId(),new MineJobQuery()).size(); Integer fairCollecitonCount = fairCollectionMapper.selectList(Wrappers.lambdaQuery().eq(FairCollection::getUserId, SiteSecurityUtils.getUserId())).size(); HashMap map = new HashMap<>(); map.put("applyCount", applyCount); + map.put("applyCencalCount", applyCencalCount); map.put("collectionCount", collectionJobCount+collectionCompanyCount); map.put("jobReviewCount", jobReviewCount); map.put("fairCollecitonCount", fairCollecitonCount); @@ -160,4 +161,14 @@ public class JobApplyServiceImpl extends ServiceImpl im public int updateJobZphApply(JobApply jobApply) { return jobApplyMapper.updateJobZphApply(jobApply); } + + @Override + public List selectCencalList(JobApply jobApply) { + return jobApplyMapper.selectCencalList(jobApply); + } + + @Override + public int applyJobCencal(JobApply jobApply) { + return jobApplyMapper.applyJobCencal(jobApply); + } } diff --git a/ruoyi-bussiness/src/main/resources/mapper/app/AppUserMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/app/AppUserMapper.xml index e19a0ce..3224672 100644 --- a/ruoyi-bussiness/src/main/resources/mapper/app/AppUserMapper.xml +++ b/ruoyi-bussiness/src/main/resources/mapper/app/AppUserMapper.xml @@ -110,10 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select b.*,a.create_time as shareTime from job_apply a inner join job b on a.job_id=b.job_id and b.del_flag='0' + a.del_flag = '2' + and a.job_id = #{jobId} + and a.user_id = #{userId} + + + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppUser.java index e6051b1..3825fd2 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/AppUser.java @@ -1,6 +1,5 @@ package com.ruoyi.common.core.domain.entity; -import java.time.LocalDate; import java.util.Date; import java.util.List; @@ -135,6 +134,9 @@ public class AppUser extends BaseEntity @ApiModelProperty("工作经验") private String workExperience; + @ApiModelProperty("机构类型 0用人单位 1培训机构 2评价机构 3人力资源机构") + private String orgType; + @TableField(exist = false) @ApiModelProperty("公司信息") private Company company; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/MyChart.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/MyChart.java index a0a9e5c..2081003 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/MyChart.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/MyChart.java @@ -4,8 +4,9 @@ import lombok.Data; @Data public class MyChart { - private String ytd; - private String ysc; - private String yzj; - private String yyy; + private String ytd;//投递 + private String ysc;//收藏 + private String yzj;//足迹 + private String yyy;//已预约 + private String yqx;//已取消 } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java index d568985..4d515e2 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java @@ -44,6 +44,11 @@ public class LoginBody */ private String idCard; + /** + * 企业类型 + */ + public String orgType; + public String getUsername() { return username; @@ -115,4 +120,12 @@ public class LoginBody public void setIdCard(String idCard) { this.idCard = idCard; } + + public String getOrgType() { + return orgType; + } + + public void setOrgType(String orgType) { + this.orgType = orgType; + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 1c27820..6e75288 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -269,7 +269,7 @@ public class SysLoginService AppUser existingUser=appUserService.selectByOpenid(openid,dto.getUserType()); if(existingUser!=null){ if(StringUtils.isEmpty(existingUser.getIsCompanyUser())){ - updateAppUserCommon(existingUser,openid,unionid,dto.getUserType()); + updateAppUserCommon(existingUser,openid,unionid,dto.getUserType(),dto.getOrgType()); } String token = loginUserIdApp(existingUser); ajax.put(Constants.TOKEN, token); @@ -290,7 +290,7 @@ public class SysLoginService String token=""; boolean isNewUser=false; if (existUser != null) { - updateAppUserCommon(existUser,openid,unionid,dto.getUserType()); + updateAppUserCommon(existUser,openid,unionid,dto.getUserType(),dto.getOrgType()); // 5. 生成系统令牌 token = loginUserIdApp(existUser); ajax.put("idCard",existUser.getIdCard()); @@ -374,12 +374,12 @@ public class SysLoginService // 6.1 优先匹配「OpenID+前端传入角色」的老用户 AppUser existingUser = appUserService.selectByOpenid(openid, userType); if (existingUser != null) { - System.out.printf("小程序登录-匹配到普通老用户:openid=%s, userType=%s%n", openid, userType); - return handleExistingUser(existingUser, userType); + System.out.printf("小程序登录-匹配到普通老用户:openid=%s, userType=%s%n", openid, userType, dto.getOrgType()); + return handleExistingUser(existingUser, userType,dto.getOrgType()); } // 6.2 处理普通用户的匹配与注册(手机号绑定、新用户创建等) - return handleUserMatchAndRegister(openid, unionid, phone, userType); + return handleUserMatchAndRegister(openid, unionid, phone, userType,dto.getOrgType()); } catch (Exception e) { System.err.println("小程序登录异常:" + e.getMessage()); @@ -470,21 +470,21 @@ public class SysLoginService * @param userType * @return */ - private AjaxResult handleUserMatchAndRegister(String openid, String unionid, String phone, String userType) { + private AjaxResult handleUserMatchAndRegister(String openid, String unionid, String phone, String userType,String orgType) { // 匹配「手机号+角色」的用户 AppUser phoneRoleUser = appUserService.getPhoneAndUserType(phone, userType); if (phoneRoleUser != null) { - return handlePhoneBoundUser(phoneRoleUser, openid, unionid, userType); + return handlePhoneBoundUser(phoneRoleUser, openid, unionid, userType,orgType); } // 匹配无角色历史数据 AppUser noRoleUser = appUserService.getPhoneAndNoRole(phone); if (noRoleUser != null) { - return handleNoRoleUserBinding(openid, unionid, phone, userType, noRoleUser); + return handleNoRoleUserBinding(openid, unionid, phone, userType, noRoleUser,orgType); } // 全新用户注册 - return handleNewUserRegistration(openid, unionid, phone, userType); + return handleNewUserRegistration(openid, unionid, phone, userType,orgType); } /** @@ -496,7 +496,7 @@ public class SysLoginService * @param noRoleUser * @return */ - private AjaxResult handleNoRoleUserBinding(String openid, String unionid, String phone, String userType, AppUser noRoleUser) { + private AjaxResult handleNoRoleUserBinding(String openid, String unionid, String phone, String userType, AppUser noRoleUser,String orgType) { String lockKey = "login_no_role_bind_" + phone + "_" + userType; try (DistributedLockUtil.AutoReleaseLock lock = distributedLockUtil.tryLock(lockKey, 3, TimeUnit.SECONDS)) { if (!lock.isLocked()) { @@ -505,9 +505,9 @@ public class SysLoginService // 双重检查 AppUser doubleCheck = appUserService.getPhoneAndUserType(phone, userType); if (doubleCheck != null) { - return handlePhoneBoundUser(doubleCheck, openid, unionid, userType); + return handlePhoneBoundUser(doubleCheck, openid, unionid, userType,orgType); } - return handlePhoneBoundUser(noRoleUser, openid, unionid, userType); + return handlePhoneBoundUser(noRoleUser, openid, unionid, userType,orgType); } } @@ -519,7 +519,7 @@ public class SysLoginService * @param userType * @return */ - private AjaxResult handleNewUserRegistration(String openid, String unionid, String phone, String userType) { + private AjaxResult handleNewUserRegistration(String openid, String unionid, String phone, String userType,String orgType) { String createLockKey = "login_create_" + phone + "_" + userType; try (DistributedLockUtil.AutoReleaseLock lock = distributedLockUtil.tryLock(createLockKey, 3, TimeUnit.SECONDS)) { if (!lock.isLocked()) { @@ -528,9 +528,9 @@ public class SysLoginService // 双重检查 AppUser checkNew = appUserService.getPhoneAndUserType(phone, userType); if (checkNew != null) { - return handlePhoneBoundUser(checkNew, openid, unionid, userType); + return handlePhoneBoundUser(checkNew, openid, unionid, userType,orgType); } - return handleNewUser(openid, unionid, phone, userType); + return handleNewUser(openid, unionid, phone, userType,orgType); } } @@ -548,7 +548,7 @@ public class SysLoginService } // 原有逻辑(更新登录时间、生成token) AjaxResult ajax = AjaxResult.success(); - updateAppUserCommon(specialUser, null, null, null); + updateAppUserCommon(specialUser, null, null, null,specialUser.getOrgType()); String token = loginUserIdApp(specialUser); ajax.put(Constants.TOKEN, token); ajax.put("isNewUser", false); @@ -565,9 +565,9 @@ public class SysLoginService * 处理老用户登录(日志用println) */ @Transactional(rollbackFor = Exception.class) - public AjaxResult handleExistingUser(AppUser existingUser, String userType) { + public AjaxResult handleExistingUser(AppUser existingUser, String userType,String orgType) { AjaxResult ajax = AjaxResult.success(); - updateAppUserCommon(existingUser, null, null, userType); + updateAppUserCommon(existingUser, null, null, userType,orgType); String token = loginUserIdApp(existingUser); ajax.put(Constants.TOKEN, token); ajax.put("isNewUser", false); @@ -583,7 +583,7 @@ public class SysLoginService * 处理手机号已绑定的用户 */ @Transactional(rollbackFor = Exception.class) - public AjaxResult handlePhoneBoundUser(AppUser phoneUser, String openid, String unionid, String userType) { + public AjaxResult handlePhoneBoundUser(AppUser phoneUser, String openid, String unionid, String userType,String orgType) { AjaxResult ajax = AjaxResult.success(); if (StringUtils.hasText(phoneUser.getOpenid()) && !openid.equals(phoneUser.getOpenid())) { System.out.printf("手机号绑定冲突,phone:%s, oldOpenid:%s, newOpenid:%s%n", @@ -591,7 +591,7 @@ public class SysLoginService return AjaxResult.error("该手机号已绑定其他微信账号"); } //修改用户信息 - updateAppUserCommon(phoneUser, openid, unionid, userType); + updateAppUserCommon(phoneUser, openid, unionid, userType,orgType); phoneUser.setOpenid(openid); phoneUser.setUnionid(unionid); phoneUser.setIsCompanyUser(userType); @@ -609,7 +609,7 @@ public class SysLoginService * 处理新用户注册 */ @Transactional(rollbackFor = Exception.class) - public AjaxResult handleNewUser(String openid, String unionid, String phone, String userType) { + public AjaxResult handleNewUser(String openid, String unionid, String phone, String userType,String orgType) { AjaxResult ajax = AjaxResult.success(); AppUser newUser = new AppUser(); newUser.setOpenid(openid); @@ -617,6 +617,7 @@ public class SysLoginService newUser.setPhone(phone); newUser.setIsCompanyUser(userType); newUser.setLoginDate(new Date()); + newUser.setOrgType(orgType); appUserService.insertAppUser(newUser); String token = loginUserIdApp(newUser); ajax.put(Constants.TOKEN, token); @@ -631,7 +632,7 @@ public class SysLoginService /** * 抽取用户更新公共方法 */ - private void updateAppUserCommon(AppUser targetUser, String openid, String unionid, String userType) { + private void updateAppUserCommon(AppUser targetUser, String openid, String unionid, String userType,String orgType) { AppUser updateParm = new AppUser(); updateParm.setUserId(targetUser.getUserId()); @@ -651,6 +652,9 @@ public class SysLoginService updateParm.setUnionid(unionid); targetUser.setUnionid(unionid); } + if(StringUtils.isNotBlank(orgType)){ + updateParm.setOrgType(orgType); + } //最后登录时间 updateParm.setLoginDate(new Date()); appUserService.updateAppUser(updateParm);