Compare commits
22 Commits
b7686c31b1
...
main
Author | SHA1 | Date | |
---|---|---|---|
8b3b7f63f9 | |||
9b9e80dc62 | |||
7752c74063 | |||
f4730c60fb | |||
d57ce9e3fc | |||
8988c52594 | |||
ba3e66a3c4 | |||
aa55276a81 | |||
8c5ec3e0b3 | |||
c795e63e96 | |||
9281eb700b | |||
8cf753ad54 | |||
65487c073f | |||
4c28d07bc3 | |||
a6d43c0bca | |||
070239d1d5 | |||
6680622a85 | |||
0eee50be78 | |||
2616b60283 | |||
be0b432140 | |||
![]() |
fca00d41a2 | ||
![]() |
b4da3c25a5 |
@@ -92,3 +92,5 @@ easy-es:
|
||||
process-index-mode: manual
|
||||
db-config:
|
||||
refresh-policy: immediate
|
||||
username: elastic
|
||||
password: zkr2024@@.com
|
@@ -89,3 +89,5 @@ easy-es:
|
||||
process-index-mode: manual
|
||||
db-config:
|
||||
refresh-policy: immediate
|
||||
username: elastic
|
||||
password: zkr2024@@.com
|
||||
|
@@ -12,6 +12,7 @@ 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.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
@@ -133,4 +134,14 @@ public class AppCompanyController extends BaseController
|
||||
Company status = companyService.registerStatus();
|
||||
return AjaxResult.success(status);
|
||||
}
|
||||
|
||||
@GetMapping("/queryCodeCompany")
|
||||
@ApiOperation("根据社会信用代码查询企业")
|
||||
public AjaxResult queryCodeCompany(@RequestParam("code") String code)
|
||||
{
|
||||
if (!StringUtils.hasText(code)) {
|
||||
return AjaxResult.error("社会信用代码不能为空");
|
||||
}
|
||||
return AjaxResult.success(companyService.queryCodeCompany(code));
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||
import com.ruoyi.cms.service.IESJobSearchService;
|
||||
import com.ruoyi.cms.service.IJobCollectionService;
|
||||
import com.ruoyi.cms.service.IJobService;
|
||||
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;
|
||||
@@ -13,6 +14,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -36,6 +38,8 @@ public class AppJobController extends BaseController
|
||||
private IJobCollectionService jobCollectionService;
|
||||
@Autowired
|
||||
private IESJobSearchService esJobSearchService;
|
||||
@Autowired
|
||||
private SensitiveWordChecker sensitiveWordChecker;
|
||||
|
||||
/**
|
||||
* 查询岗位列表
|
||||
@@ -192,7 +196,25 @@ public class AppJobController extends BaseController
|
||||
@PostMapping("/publishJob")
|
||||
public AjaxResult fix(@RequestBody Job job)
|
||||
{
|
||||
// 校验描述中的敏感词
|
||||
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
||||
if (!sensitiveWords.isEmpty()) {
|
||||
String errorMsg = "描述中包含敏感词:" + String.join("、", sensitiveWords);
|
||||
return AjaxResult.error(errorMsg);
|
||||
}
|
||||
jobService.publishJob(job);
|
||||
return success();
|
||||
}
|
||||
|
||||
@GetMapping("/jobCompare")
|
||||
@ApiOperation("根据多个岗位id查询岗位详情")
|
||||
public AjaxResult jobCompare(@ApiParam("岗位ID数组") @RequestParam("jobIds") Long[] jobIds) {
|
||||
if (ArrayUtils.isEmpty(jobIds)) {
|
||||
return AjaxResult.error("请传递岗位ID参数(jobIds),多个ID用&分隔");
|
||||
}
|
||||
if (jobIds.length > 5) {
|
||||
return AjaxResult.error("最多支持对比5个岗位,请减少参数数量");
|
||||
}
|
||||
return success(esJobSearchService.selectByIds(jobIds));
|
||||
}
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ public class Job extends BaseEntity
|
||||
@ApiModelProperty("是否收藏 0为否 1为是")
|
||||
private Integer isCollection;
|
||||
|
||||
@ApiModelProperty("工作地点")
|
||||
@ApiModelProperty("岗位描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("是否发布 0未发布 1发布")
|
||||
@@ -169,4 +169,8 @@ public class Job extends BaseEntity
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("岗位联系人列表")
|
||||
private List<JobContact> jobContactList;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("附件列表")
|
||||
private List<File> filesList;
|
||||
}
|
||||
|
@@ -15,4 +15,6 @@ import java.util.List;
|
||||
public interface JobContactMapper extends BaseMapper<JobContact> {
|
||||
|
||||
List<JobContact> getSelectList(JobContact jobContact);
|
||||
|
||||
int batchInsert(List<JobContact> list);
|
||||
}
|
||||
|
@@ -75,4 +75,6 @@ public interface ICompanyService
|
||||
List<Company> approvalList(Company company);
|
||||
|
||||
Company approval(Company company);
|
||||
|
||||
Company queryCodeCompany(String code);
|
||||
}
|
||||
|
@@ -67,4 +67,6 @@ public interface IESJobSearchService
|
||||
void updateJob(Long jobId);
|
||||
|
||||
void deleteJob(Long jobId);
|
||||
|
||||
List<ESJobDocument> selectByIds(Long[] jobIds);
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.cms.mapper.*;
|
||||
import com.ruoyi.cms.util.StringUtil;
|
||||
import com.ruoyi.common.core.domain.entity.Company;
|
||||
import com.ruoyi.common.core.domain.entity.JobTitle;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
@@ -130,13 +131,23 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
@Override
|
||||
public int registerAppUser(RegisterBody registerBody) {
|
||||
AppUser appUser=registerBody.getAppUser();
|
||||
appUser.setUserId(SiteSecurityUtils.getUserId());
|
||||
System.out.println("userId================"+SiteSecurityUtils.getUserId());
|
||||
if(SiteSecurityUtils.isLogin()){
|
||||
AppUser appUserResult=appUserMapper.selectById(SiteSecurityUtils.getUserId());
|
||||
if(appUser==null){
|
||||
appUser=appUserResult;
|
||||
}else{
|
||||
appUser.setPhone(appUserResult.getPhone());
|
||||
appUser.setUserId(appUserResult.getUserId());
|
||||
}
|
||||
}
|
||||
//角色集合
|
||||
Map mapUserRole=new HashMap<>();
|
||||
switch (appUser.getIsCompanyUser()){
|
||||
case "0"://企业
|
||||
if(registerBody.getCompany()!=null){
|
||||
Long companyId=registerBody.getCompany().getCompanyId();
|
||||
Company company=registerBody.getCompany();
|
||||
Long companyId=company.getCompanyId();
|
||||
if(companyId==null){
|
||||
companyMapper.insert(registerBody.getCompany());
|
||||
registerBody.getCompany().getCompanyContactList().forEach(it->{
|
||||
@@ -146,29 +157,38 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
if(registerBody.getCompany().getCompanyContactList()!=null){
|
||||
companyContactMapper.batchInsert(registerBody.getCompany().getCompanyContactList());
|
||||
}
|
||||
//保存app_user信息
|
||||
appUser.setIdCard(company.getCode());
|
||||
appUser.setName(company.getName());
|
||||
}
|
||||
mapUserRole.put("roleId",100);
|
||||
break;
|
||||
default://求职者
|
||||
if(registerBody.getExperiencesList()!=null){
|
||||
registerBody.getExperiencesList().forEach(it->{
|
||||
it.setUserId(SiteSecurityUtils.getUserId());
|
||||
});
|
||||
userWorkExperiencesMapper.batchInsert(registerBody.getExperiencesList());
|
||||
}
|
||||
if(registerBody.getAppSkillsList()!=null){
|
||||
registerBody.getAppSkillsList().forEach(it->{
|
||||
it.setUserId(SiteSecurityUtils.getUserId());
|
||||
});
|
||||
appSkillMapper.batchInsert(registerBody.getAppSkillsList());
|
||||
}
|
||||
mapUserRole.put("roleId",1);
|
||||
}
|
||||
//保存sys_user
|
||||
SysUser sysUser=new SysUser();
|
||||
sysUser.setUserId(appUser.getUserId());
|
||||
sysUser.setUserName(appUser.getPhone());
|
||||
sysUser.setNickName(appUser.getName());
|
||||
sysUser.setNickName(StringUtils.isEmpty(appUser.getName())?appUser.getPhone():appUser.getName());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword("123456"));
|
||||
sysUser.setPhonenumber(appUser.getPhone());
|
||||
sysUser.setSex(appUser.getSex());
|
||||
sysUser.setStatus("0");
|
||||
sysUser.setLoginIp(appUser.getLoginIp());
|
||||
sysUser.setLoginDate(appUser.getLoginDate());
|
||||
sysUser.setIdCard(appUser.getIdCard());
|
||||
appUserMapper.insertSysUser(sysUser);
|
||||
//保存sys_user_role
|
||||
mapUserRole.put("userId",appUser.getUserId());
|
||||
|
@@ -296,4 +296,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||
return company1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Company queryCodeCompany(String code) {
|
||||
Company companyResult = companyMapper.selectOne(Wrappers.<Company>lambdaQuery().eq(Company::getCode, code).orderByDesc(Company::getUpdateTime).last("LIMIT 1"));
|
||||
return companyResult;
|
||||
}
|
||||
}
|
||||
|
@@ -178,6 +178,12 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getType())){
|
||||
newSearch.setType(esJobSearch.getType());
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getDescription())){
|
||||
newSearch.setDescription(esJobSearch.getDescription());
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getCompanyNature())){
|
||||
newSearch.setCompanyNature(esJobSearch.getCompanyNature());
|
||||
}
|
||||
}
|
||||
|
||||
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(newSearch,jobIds);
|
||||
@@ -405,6 +411,12 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getType())){
|
||||
wrapper.and(x->x.eq(ESJobDocument::getType,esJobSearch.getType()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getDescription())){
|
||||
wrapper.and(x->x.like(ESJobDocument::getDescription,esJobSearch.getDescription()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getCompanyNature())){
|
||||
wrapper.and(x->x.eq(ESJobDocument::getCompanyNature,esJobSearch.getCompanyNature()));
|
||||
}
|
||||
if(Objects.nonNull(esJobSearch.getOrder())){
|
||||
if(esJobSearch.getOrder()==1){
|
||||
wrapper.orderByDesc(ESJobDocument::getIsHot);
|
||||
@@ -553,4 +565,10 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
|
||||
esJobDocumentMapper.insert(esJobDocument);
|
||||
}
|
||||
|
||||
public List<ESJobDocument> selectByIds(Long[] jobIds) {
|
||||
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
|
||||
wrapper.in(ESJobDocument::getJobId,jobIds);
|
||||
return esJobDocumentMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.cms.domain.*;
|
||||
import com.ruoyi.cms.domain.File;
|
||||
import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||
import com.ruoyi.cms.domain.vo.CandidateVO;
|
||||
import com.ruoyi.cms.mapper.*;
|
||||
@@ -75,6 +76,8 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
private RedisCache redisCache;
|
||||
@Autowired
|
||||
private JobContactMapper jobContactMapper;
|
||||
@Autowired
|
||||
private FileMapper fileMapper;
|
||||
|
||||
/**
|
||||
* 更新工作地址的经纬度信息
|
||||
@@ -206,6 +209,14 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
if(contacts!=null){
|
||||
job.setJobContactList(contacts);
|
||||
}
|
||||
//查询附件
|
||||
File file=new File();
|
||||
file.setBussinessId(jobId);
|
||||
List<File> filesList=fileMapper.selectFileList(file);
|
||||
if(filesList!=null){
|
||||
job.setFilesList(filesList);
|
||||
}
|
||||
|
||||
return job;
|
||||
}
|
||||
|
||||
@@ -784,6 +795,12 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
// }
|
||||
// job.setCompanyId(company.getCompanyId());
|
||||
jobMapper.insert(job);
|
||||
if(job.getJobContactList()!=null){
|
||||
job.getJobContactList().forEach(it->{
|
||||
it.setJobId(job.getJobId());
|
||||
});
|
||||
jobContactMapper.batchInsert(job.getJobContactList());
|
||||
}
|
||||
iesJobSearchService.updateJob(job.getJobId());
|
||||
}
|
||||
}
|
||||
|
@@ -28,8 +28,8 @@ public class WechatUtil {
|
||||
/**
|
||||
* 生成signature
|
||||
**/
|
||||
private static String appid = "wxee0d0655e464f184";
|
||||
private static String secret = "38a71cb90ea12c6b2eee4434ae7932cf";
|
||||
private static String appid = "wx9d1cbc11c8c40ba7";
|
||||
private static String secret = "38e87cf6251945446e8ac091a0ba9ab2";
|
||||
public AppWechatEntity sign(String url) {
|
||||
Map<String, String> ret = new HashMap();
|
||||
String nonceStr = create_nonce_str();
|
||||
|
@@ -29,10 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="jobTitleId" column="job_title_id" />
|
||||
<result property="isRecommend" column="is_recommend" />
|
||||
<result property="idCard" column="id_card" />
|
||||
<result property="workExperience" column="work_experience" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppUserVo">
|
||||
select user_id, name, age, sex, birth_date, education, political_affiliation, phone, avatar, salary_min, salary_max, area, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark,job_title_id,is_recommend,id_card from app_user
|
||||
select user_id, name, age, sex, birth_date, education, political_affiliation, phone, avatar, salary_min, salary_max, area, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark,job_title_id,is_recommend,id_card,work_experience from app_user
|
||||
</sql>
|
||||
|
||||
<select id="selectAppUserList" parameterType="AppUser" resultMap="AppUserResult">
|
||||
@@ -64,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectByOpenid" resultType="com.ruoyi.common.core.domain.entity.AppUser">
|
||||
SELECT * FROM app_user WHERE DEL_FLAG = '0' and openid=#{openid} LIMIT 1
|
||||
<include refid="selectAppUserVo"/> WHERE DEL_FLAG = '0' and openid=#{openid} LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUserRole" parameterType="java.util.Map">
|
||||
|
@@ -31,10 +31,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="notPassReason" column="not_pass_reason" />
|
||||
<result property="registeredAddress" column="registered_address" />
|
||||
<result property="isAbnormal" column="is_abnormal" />
|
||||
<result property="enterpriseType" column="enterprise_type" />
|
||||
<result property="isImpCompany" column="is_imp_company" />
|
||||
<result property="impCompanyType" column="imp_company_type" />
|
||||
<result property="legalPerson" column="legal_person" />
|
||||
<result property="legalIdCard" column="legal_id_card" />
|
||||
<result property="legalPhone" column="legal_phone" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCompanyVo">
|
||||
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time from company
|
||||
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone from company
|
||||
</sql>
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO company (
|
||||
|
@@ -42,4 +42,17 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO job_contact (
|
||||
job_id, contact_person, contact_person_phone,position,
|
||||
create_by, create_time, del_flag,remark
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.jobId}, #{item.contactPerson}, #{item.contactPersonPhone},#{item.position},
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@@ -25,7 +25,7 @@ public class AppSkill extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "user_id",type = IdType.AUTO)
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty("用户ID")
|
||||
private Long id;
|
||||
/**
|
||||
|
@@ -127,4 +127,7 @@ public class AppUser extends BaseEntity
|
||||
|
||||
@ApiModelProperty("民族")
|
||||
private String nation;
|
||||
|
||||
@ApiModelProperty("工作经验")
|
||||
private String workExperience;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class Company extends BaseEntity
|
||||
@ApiModelProperty("单位介绍")
|
||||
private String description;
|
||||
|
||||
@Excel(name = "性质")
|
||||
@Excel(name = "性质-已改为企业类型")
|
||||
@ApiModelProperty("性质")
|
||||
private String nature;
|
||||
|
||||
@@ -111,4 +111,16 @@ public class Company extends BaseEntity
|
||||
|
||||
@ApiModelProperty("本地重点发展产业")
|
||||
private String impCompanyType;
|
||||
|
||||
@ApiModelProperty("是否是就业见习基地 0是 1否")
|
||||
private String enterpriseType;
|
||||
|
||||
@ApiModelProperty("法人姓名")
|
||||
private String legalPerson;
|
||||
|
||||
@ApiModelProperty("法人身份证")
|
||||
private String legalIdCard;
|
||||
|
||||
@ApiModelProperty("法人联系方式")
|
||||
private String legalPhone;
|
||||
}
|
||||
|
@@ -70,6 +70,9 @@ public class SysUser extends BaseEntity
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
@Excel(name = "身份证/信用代码")
|
||||
private String idCard;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@@ -297,6 +300,14 @@ public class SysUser extends BaseEntity
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getIdCard() {
|
||||
return idCard;
|
||||
}
|
||||
|
||||
public void setIdCard(String idCard) {
|
||||
this.idCard = idCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@@ -319,6 +330,7 @@ public class SysUser extends BaseEntity
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.append("idCard", getIdCard())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@@ -256,9 +256,15 @@ public class SysLoginService
|
||||
//验证是否登录过
|
||||
AppUser existingUser=appUserService.selectByOpenid(openid);
|
||||
if(existingUser!=null){
|
||||
if(StringUtils.isEmpty(existingUser.getIsCompanyUser())){
|
||||
existingUser.setIsCompanyUser(dto.getUserType());
|
||||
appUserService.updateAppUser(existingUser);
|
||||
}
|
||||
String token = loginUserIdApp(existingUser);
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("isNewUser", false);
|
||||
ajax.put("idCard",existingUser.getIdCard());
|
||||
ajax.put("isCompanyUser",existingUser.getIsCompanyUser());
|
||||
return ajax;
|
||||
}else {
|
||||
JSONObject phoneInfo = wechatUtil.decryptPhoneNumber(dto.getEncryptedData(), sessionKey, dto.getIv());
|
||||
@@ -269,10 +275,16 @@ public class SysLoginService
|
||||
|
||||
// 3. 检查手机号是否已被绑定
|
||||
AppUser existUser = appUserService.getPhone(phone);
|
||||
String token="";
|
||||
boolean isNewUser=false;
|
||||
if (existUser != null) {
|
||||
return AjaxResult.error("该手机号已注册");
|
||||
}
|
||||
|
||||
existUser.setOpenid(openid);
|
||||
appUserService.updateAppUser(existUser);
|
||||
// 5. 生成系统令牌
|
||||
token = loginUserIdApp(existUser);
|
||||
ajax.put("idCard",existUser.getIdCard());
|
||||
ajax.put("isCompanyUser",existUser.getIsCompanyUser());
|
||||
}else{
|
||||
// 4. 创建用户并存储所有信息
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setOpenid(openid);
|
||||
@@ -280,11 +292,14 @@ public class SysLoginService
|
||||
appUser.setPhone(phone);
|
||||
appUser.setIsCompanyUser(dto.getUserType());//保存角色
|
||||
appUserService.insertAppUser(appUser);
|
||||
|
||||
// 5. 生成系统令牌
|
||||
String token = loginUserIdApp(appUser);
|
||||
token = loginUserIdApp(appUser);
|
||||
isNewUser=true;
|
||||
ajax.put("idCard",null);
|
||||
ajax.put("isCompanyUser",dto.getUserType());
|
||||
}
|
||||
ajax.put("isNewUser", isNewUser);
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("isNewUser", true);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="idCard" column="id_card" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
@@ -49,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,u.id_card from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
@@ -81,12 +82,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
AND u.id_card = #{idCard}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,id_card
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -98,12 +102,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
AND u.id_card =#{idCard}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.id_card
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -116,6 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
AND u.id_card =#{idCard}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
@@ -159,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="idCard != null and idCard != ''">id_card,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
@@ -173,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
@@ -193,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="idCard != null">id_card = #{idCard},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
|
Reference in New Issue
Block a user