bonus_houqin
This commit is contained in:
parent
8c7aa86c22
commit
501da8d637
|
|
@ -59,8 +59,8 @@ public interface RemoteUserService {
|
||||||
* @param source 请求来源
|
* @param source 请求来源
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/user/custInfoPhoto/{phone}")
|
// @GetMapping("/user/custInfoPhoto/{phone}")
|
||||||
public R<LoginUser> getCustInfoByPhone(@PathVariable("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
// public R<LoginUser> getCustInfoByPhone(@PathVariable("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户信息
|
* 通过用户名查询用户信息
|
||||||
|
|
|
||||||
|
|
@ -163,15 +163,11 @@ public class SysUser extends BaseEntity {
|
||||||
private String isBuiltIn = "1";
|
private String isBuiltIn = "1";
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("人员id")
|
@ApiModelProperty("客户端人员id")
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
private Long custId;
|
private Long custId;
|
||||||
@ApiModelProperty("人员姓名")
|
@ApiModelProperty("客户端人员编号")
|
||||||
private String custName;
|
|
||||||
@ApiModelProperty("人员编号")
|
|
||||||
private String custNum;
|
private String custNum;
|
||||||
@ApiModelProperty("人脸照片地址")
|
|
||||||
private String custPhotoUrl;
|
|
||||||
|
|
||||||
|
|
||||||
public SysUser() {
|
public SysUser() {
|
||||||
|
|
@ -391,14 +387,6 @@ public class SysUser extends BaseEntity {
|
||||||
this.custId = custId;
|
this.custId = custId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCustName() {
|
|
||||||
return custName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustName(String custName) {
|
|
||||||
this.custName = custName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCustNum() {
|
public String getCustNum() {
|
||||||
return custNum;
|
return custNum;
|
||||||
}
|
}
|
||||||
|
|
@ -407,13 +395,6 @@ public class SysUser extends BaseEntity {
|
||||||
this.custNum = custNum;
|
this.custNum = custNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCustPhotoUrl() {
|
|
||||||
return custPhotoUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustPhotoUrl(String custPhotoUrl) {
|
|
||||||
this.custPhotoUrl = custPhotoUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,10 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
return R.fail("获取用户失败:" + throwable.getMessage());
|
return R.fail("获取用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public R<LoginUser> getCustInfoByPhone(String phone, String source) {
|
// public R<LoginUser> getCustInfoByPhone(String phone, String source) {
|
||||||
return R.fail("获取用户失败:" + throwable.getMessage());
|
// return R.fail("获取用户失败:" + throwable.getMessage());
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户信息
|
* 通过用户名查询用户信息
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public class CustPhoneOtpLoginStrategy implements LoginStrategy {
|
||||||
throw new ServiceException("用户不存在/验证码错误");
|
throw new ServiceException("用户不存在/验证码错误");
|
||||||
}
|
}
|
||||||
passwordValidatorService.checkPhoneCaptcha(phone, otp);
|
passwordValidatorService.checkPhoneCaptcha(phone, otp);
|
||||||
R<LoginUser> userResult = remoteUserService.getCustInfoByPhone(phone, SecurityConstants.INNER);
|
R<LoginUser> userResult = remoteUserService.getUserInfoByPhone(phone, SecurityConstants.INNER);
|
||||||
//验证用户是否存在
|
//验证用户是否存在
|
||||||
passwordValidatorService.validateUserResult(phone, userResult);
|
passwordValidatorService.validateUserResult(phone, userResult);
|
||||||
LoginUser userInfo = userResult.getData();
|
LoginUser userInfo = userResult.getData();
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class CustPhonePasswordLoginStrategy implements LoginStrategy {
|
||||||
throw new ServiceException("用户不存在/密码错误");
|
throw new ServiceException("用户不存在/密码错误");
|
||||||
}
|
}
|
||||||
//通过手机号获取用户信息
|
//通过手机号获取用户信息
|
||||||
R<LoginUser> userResult = remoteUserService.getCustInfoByPhone(phone, SecurityConstants.INNER);
|
R<LoginUser> userResult = remoteUserService.getUserInfoByPhone(phone, SecurityConstants.INNER);
|
||||||
//验证用户是否存在
|
//验证用户是否存在
|
||||||
passwordValidatorService.validateUserResult(phone, userResult);
|
passwordValidatorService.validateUserResult(phone, userResult);
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
|
|
|
||||||
|
|
@ -209,28 +209,24 @@ public class SysUserController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取当前用户信息
|
* 获取当前用户信息
|
||||||
*/
|
*/
|
||||||
@InnerAuth
|
// @InnerAuth
|
||||||
@GetMapping("/custInfoPhoto/{photoNumber}")
|
// @GetMapping("/custInfoPhoto/{photoNumber}")
|
||||||
public R<LoginUser> custInfoPhotoNumber(@PathVariable("photoNumber") String photoNumber) {
|
// public R<LoginUser> custInfoPhotoNumber(@PathVariable("photoNumber") String photoNumber) {
|
||||||
SysUser sysUser = userService.selectCustInfoByPhoneNumber(photoNumber);
|
// SysUser sysUser = userService.selectCustInfoByPhoneNumber(photoNumber);
|
||||||
if (StringUtils.isNull(sysUser)) {
|
// if (StringUtils.isNull(sysUser)) {
|
||||||
return R.fail("用户名或密码错误");
|
// return R.fail("用户名或密码错误");
|
||||||
}
|
|
||||||
// SysDept sysDept = deptService.selectActiveDeptById(sysUser.getCompanyId());
|
|
||||||
// if (StringUtils.isNull(sysDept)) {
|
|
||||||
// return R.fail("用户所在公司停用或注销");
|
|
||||||
// }
|
// }
|
||||||
// 角色集合
|
// // 角色集合
|
||||||
//Set<String> roles = permissionService.getRolePermission(sysUser);
|
// //Set<String> roles = permissionService.getRolePermission(sysUser);
|
||||||
// 权限集合
|
// // 权限集合
|
||||||
//Set<String> permissions = permissionService.getMenuPermission(sysUser);
|
// //Set<String> permissions = permissionService.getMenuPermission(sysUser);
|
||||||
LoginUser loginUser = new LoginUser();
|
// LoginUser loginUser = new LoginUser();
|
||||||
loginUser.setCustId(sysUser.getCustId());
|
// loginUser.setCustId(sysUser.getCustId());
|
||||||
loginUser.setSysUser(sysUser);
|
// loginUser.setSysUser(sysUser);
|
||||||
//sysUserVo.setRoles(roles);
|
// //sysUserVo.setRoles(roles);
|
||||||
//sysUserVo.setPermissions(permissions);
|
// //sysUserVo.setPermissions(permissions);
|
||||||
return R.ok(loginUser);
|
// return R.ok(loginUser);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册用户信息
|
* 注册用户信息
|
||||||
|
|
|
||||||
|
|
@ -159,10 +159,10 @@ public interface SysUserMapper {
|
||||||
/**
|
/**
|
||||||
* 通过手机号查询用户
|
* 通过手机号查询用户
|
||||||
*
|
*
|
||||||
* @param phoneNumber 手机号
|
* @param
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
public SysUser selectCustInfoByPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
// public SysUser selectCustInfoByPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
||||||
|
|
||||||
public void transferUserInfo(SysUser sysUser);
|
public void transferUserInfo(SysUser sysUser);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -237,5 +237,5 @@ public interface ISysUserService {
|
||||||
|
|
||||||
public AjaxResult systemUpdateUser(SysUser user);
|
public AjaxResult systemUpdateUser(SysUser user);
|
||||||
|
|
||||||
public SysUser selectCustInfoByPhoneNumber(String photoNumber);
|
// public SysUser selectCustInfoByPhoneNumber(String photoNumber);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -688,9 +688,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
* @param photoNumber 用户名
|
* @param photoNumber 用户名
|
||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
// @Override
|
||||||
public SysUser selectCustInfoByPhoneNumber(String photoNumber) {
|
// public SysUser selectCustInfoByPhoneNumber(String photoNumber) {
|
||||||
return userMapper.selectCustInfoByPhoneNumber(Sm4Utils.custEncrypt(photoNumber));
|
// return userMapper.selectCustInfoByPhoneNumber(Sm4Utils.custEncrypt(photoNumber));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
<result property="approvalStatus" column="approval_status"/>
|
<result property="approvalStatus" column="approval_status"/>
|
||||||
<result property="isPermanent" column="is_permanent"/>
|
<result property="isPermanent" column="is_permanent"/>
|
||||||
<result property="isBuiltIn" column="is_built_in"/>
|
<result property="isBuiltIn" column="is_built_in"/>
|
||||||
|
<result property="custId" column="cust_id"/>
|
||||||
|
<result property="custNum" column="cust_num"/>
|
||||||
<association property="dept" javaType="SysDept" resultMap="deptResult"/>
|
<association property="dept" javaType="SysDept" resultMap="deptResult"/>
|
||||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
||||||
|
|
||||||
|
|
@ -91,12 +93,13 @@
|
||||||
r.data_scope,
|
r.data_scope,
|
||||||
r.status as role_status,
|
r.status as role_status,
|
||||||
u.login_type,
|
u.login_type,
|
||||||
u.is_built_in
|
u.is_built_in,
|
||||||
|
u.cust_id,
|
||||||
|
u.cust_num
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
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
|
left join sys_user_role ur on u.user_id = ur.user_id
|
||||||
left join sys_role r on r.role_id = ur.role_id
|
left join sys_role r on r.role_id = ur.role_id
|
||||||
left join sys_dept sd on r.company_id = sd.dept_id
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||||
|
|
@ -218,7 +221,7 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="selectUserByPhoneNumber" resultMap="SysUserResult">
|
<select id="selectUserByPhoneNumber" resultMap="SysUserResult">
|
||||||
<include refid="selectUserVo"/>
|
<include refid="selectUserVo"/>
|
||||||
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber} AND sd.del_flag = '0' AND sd.status = '0'
|
where u.del_flag = '0'AND u.phonenumber = #{phoneNumber}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectUserByEmail" resultMap="SysUserResult">
|
<select id="selectUserByEmail" resultMap="SysUserResult">
|
||||||
<include refid="selectUserVo"/>
|
<include refid="selectUserVo"/>
|
||||||
|
|
@ -369,18 +372,18 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<!--根据人员id集合获取人员信息-->
|
<!-- <!–根据人员id集合获取人员信息–>-->
|
||||||
<select id="selectCustInfoByPhoneNumber" resultType="com.bonus.system.api.domain.SysUser">
|
<!-- <select id="selectCustInfoByPhoneNumber" resultType="com.bonus.system.api.domain.SysUser">-->
|
||||||
select cust_id as custId, cust_name as custName, cust_num as custNum, cust_photo_url as custPhotoUrl,
|
<!-- select cust_id as custId, cust_name as custName, cust_num as custNum, cust_photo_url as custPhotoUrl,-->
|
||||||
mobile as phonenumber, pwd as password
|
<!-- mobile as phonenumber, pwd as password-->
|
||||||
from cust_info
|
<!-- from cust_info-->
|
||||||
<where>
|
<!-- <where>-->
|
||||||
cust_state = 1 and (psn_type != 999 or psn_type is null)
|
<!-- cust_state = 1 and (psn_type != 999 or psn_type is null)-->
|
||||||
<if test="phoneNumber != null and phoneNumber != ''">
|
<!-- <if test="phoneNumber != null and phoneNumber != ''">-->
|
||||||
and mobile = #{phoneNumber}
|
<!-- and mobile = #{phoneNumber}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
</where>
|
<!-- </where>-->
|
||||||
</select>
|
<!-- </select>-->
|
||||||
|
|
||||||
<!-- 安徽送变电绿智食堂用户数据转换工具 -->
|
<!-- 安徽送变电绿智食堂用户数据转换工具 -->
|
||||||
<delete id="transferUserInfo" parameterType="com.bonus.system.api.domain.SysUser">
|
<delete id="transferUserInfo" parameterType="com.bonus.system.api.domain.SysUser">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue