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