PAD登录时输入手机号获取此账号最后登录信息,及拥有的所有机构,登录成功更新最后登录机构信息
This commit is contained in:
parent
1beafa4faf
commit
d124534486
|
|
@ -1,5 +1,6 @@
|
|||
package com.nu.modules.EmployessInfo.api;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.nu.entity.EmployeesAdvisoryInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -15,4 +16,6 @@ public interface IEmployessAdvisioryInfoApi {
|
|||
int updateByTel(EmployeesAdvisoryInfoEntity employeesAdvisoryInfoEntity);
|
||||
|
||||
int updateByOpenId(EmployeesAdvisoryInfoEntity employeesAdvisoryInfoEntity);
|
||||
|
||||
JSONObject getEmployeeInfo(String tel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ import java.io.Serializable;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
|
|
@ -100,4 +98,7 @@ public class EmployeesOrg implements Serializable {
|
|||
@Excel(name = "修改状态", width = 15)
|
||||
@ApiModelProperty(value = "修改状态")
|
||||
private java.lang.String modifyStatus;
|
||||
/**机构访问地址*/
|
||||
@TableField(exist = false)
|
||||
private String serverUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,5 +282,7 @@ public class NuEmployeesAdvisoryInfo implements Serializable {
|
|||
private java.util.Date lastLoginTime;//最近上一次登录时间
|
||||
|
||||
private String izInit;//是否需要员工初始化 0否 1是
|
||||
|
||||
/**机构访问地址*/
|
||||
@TableField(exist = false)
|
||||
private String serverUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface EmployeesOrgMapper extends BaseMapper<EmployeesOrg> {
|
||||
|
||||
List<EmployeesOrg> getEmployeesOrgListByEmpId(@Param("employeesId") String employeesId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ public interface NuEmployeesAdvisoryInfoMapper extends BaseMapper<NuEmployeesAdv
|
|||
int updateByOpenId(EmployeesAdvisoryInfoEntity employeesAdvisoryInfoEntity);
|
||||
|
||||
List<NuEmployeesAdvisoryInfo> queryEmployeeInfo(@Param("openId") String openId, @Param("orgCode") String orgCode);
|
||||
|
||||
NuEmployeesAdvisoryInfo getEmployeeInfoByTel(@Param("tel") String tel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,17 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.employees.mapper.EmployeesOrgMapper">
|
||||
|
||||
<select id="getEmployeesOrgListByEmpId" resultType="com.nu.modules.employees.entity.EmployeesOrg">
|
||||
SELECT
|
||||
a.org_code as orgCode,
|
||||
concat(REGEXP_REPLACE(b.url, '/([^/]*)$', '\\'),b.context_path) AS serverUrl
|
||||
FROM nu_biz_employees_org a
|
||||
LEFT JOIN sys_depart b
|
||||
ON a.org_code = b.org_code
|
||||
WHERE a.employees_id = #{employeesId}
|
||||
AND a.status = '2'
|
||||
AND a.iz_history = '1'
|
||||
AND a.iz_freeze = '0'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -53,4 +53,14 @@
|
|||
WHERE adinfo.open_id = #{openId}
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeInfoByTel" resultType="com.nu.modules.employees.entity.NuEmployeesAdvisoryInfo">
|
||||
SELECT
|
||||
adinfo.*,
|
||||
concat(REGEXP_REPLACE(sd.url, '/([^/]*)$', '\\'),sd.context_path) AS serverUrl
|
||||
FROM nu_employees_advisory_info adinfo
|
||||
LEFT JOIN sys_depart sd
|
||||
ON adinfo.last_login_org = sd.org_code
|
||||
WHERE adinfo.tel = #{tel}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.nu.modules.employees.service;
|
|||
import com.nu.modules.employees.entity.EmployeesOrg;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 员工-机构关系中间表
|
||||
* @Author: jeecg-boot
|
||||
|
|
@ -10,5 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface IEmployeesOrgService extends IService<EmployeesOrg> {
|
||||
|
||||
List<EmployeesOrg> getEmployeesOrgListByEmpId(String employeesId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,4 +104,9 @@ public class EmployeesOrgServiceImpl extends ServiceImpl<EmployeesOrgMapper, Emp
|
|||
employeesAdvisoryInfoService.updateById(employeesAd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmployeesOrg> getEmployeesOrgListByEmpId(String employeesId){
|
||||
return baseMapper.getEmployeesOrgListByEmpId(employeesId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,4 +181,22 @@ public class NuEmployeesAdvisoryInfoServiceImpl extends ServiceImpl<NuEmployeesA
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getEmployeeInfo(String tel){
|
||||
JSONObject resultData = new JSONObject();
|
||||
resultData.set("code","0");
|
||||
resultData.set("msg","成功!");
|
||||
NuEmployeesAdvisoryInfo entity = baseMapper.getEmployeeInfoByTel(tel);
|
||||
if(entity!=null){
|
||||
resultData.set("data",entity);
|
||||
List<EmployeesOrg> list = employeesOrgService.getEmployeesOrgListByEmpId(entity.getId());
|
||||
resultData.set("orgList",list);
|
||||
}else{
|
||||
resultData.set("code","1");
|
||||
resultData.set("msg","此号码无效,请确认此员工是否成功入驻机构!");
|
||||
}
|
||||
return resultData;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.nu.modules.pad.api;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.nu.modules.EmployessInfo.api.IEmployessAdvisioryInfoApi;
|
||||
import com.nu.modules.advisoryinfo.api.IAdvisoryInfoApi;
|
||||
import com.nu.modules.advisoryinfo.entity.AdvisoryInfoEntity;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
|
@ -13,8 +15,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping("/api/pad/loginApi")
|
||||
public class PadLoginApi {
|
||||
|
||||
/* @Autowired
|
||||
private IAdvisoryInfoApi advisoryInfoApi; */
|
||||
@Autowired
|
||||
private IAdvisoryInfoApi advisoryInfoApi;
|
||||
private IEmployessAdvisioryInfoApi service;
|
||||
|
||||
/**
|
||||
* 根据电话号获取信息
|
||||
|
|
@ -22,8 +26,8 @@ public class PadLoginApi {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/getAdvisoryInfo")
|
||||
public Result<AdvisoryInfoEntity> getAdvisoryInfo(@RequestParam("tel") String tel){
|
||||
AdvisoryInfoEntity advisoryInfo = advisoryInfoApi.getAdvisoryInfo(tel);
|
||||
return Result.ok(advisoryInfo);
|
||||
public Result<JSONObject> getAdvisoryInfo(@RequestParam("tel") String tel){
|
||||
JSONObject resultData = service.getEmployeeInfo(tel);
|
||||
return Result.ok(resultData);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1050,4 +1050,6 @@ public class LoginController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue