务工者追加app的个人基本信息查询
This commit is contained in:
		@ -0,0 +1,18 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.req;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotBlank;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
public class WgzAppPersonalBasicInformationReq implements Serializable {
 | 
			
		||||
	@ApiModelProperty("唯一标识")
 | 
			
		||||
	@NotBlank(message = "唯一标识不能为空")
 | 
			
		||||
	private Long userId;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,58 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
 | 
			
		||||
public class WgzAppPersonalBasicInformationRes {
 | 
			
		||||
	@ApiModelProperty("主键ID")
 | 
			
		||||
	@TableId(value = "id")
 | 
			
		||||
	private String id;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("唯一标识")
 | 
			
		||||
	private Long userId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("姓名")
 | 
			
		||||
	private String username;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("性别")
 | 
			
		||||
	private String gender;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("民族")
 | 
			
		||||
	private String nation;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("出生日期")
 | 
			
		||||
	private String birthdate;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("身份证号码")
 | 
			
		||||
	private String identityCard;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("所在区域")
 | 
			
		||||
	private String area;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("地址")
 | 
			
		||||
	private String site;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("联系电话")
 | 
			
		||||
	private String phone;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("银行")
 | 
			
		||||
	private String bank;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("银行卡号")
 | 
			
		||||
	private String cardNo;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("头像地址")
 | 
			
		||||
	private String avatarName;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("身份证正面图路径")
 | 
			
		||||
	private String frontPath;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("身份证反面图路径")
 | 
			
		||||
	private String reverseSidePath;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("银行卡图路径")
 | 
			
		||||
	private String bankCardPath;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("评分")
 | 
			
		||||
	private Double score;
 | 
			
		||||
}
 | 
			
		||||
@ -1,20 +1,15 @@
 | 
			
		||||
package com.ruoyi.wgz.domain;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.*;
 | 
			
		||||
import com.ruoyi.common.annotation.Excel;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.*;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.time.LocalTime;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * APP务工者对象 wgz_user
 | 
			
		||||
@ -116,6 +111,11 @@ public class WgzUser implements Serializable {
 | 
			
		||||
    @ApiModelProperty("银行卡图路径")
 | 
			
		||||
    private String bankCardPath;
 | 
			
		||||
 | 
			
		||||
	/** 评分 */
 | 
			
		||||
	@Excel(name = "评分")
 | 
			
		||||
	@ApiModelProperty("评分")
 | 
			
		||||
	private Double score;
 | 
			
		||||
 | 
			
		||||
    /** 帐号状态(0正常 1停用) */
 | 
			
		||||
    @Excel(name = "帐号状态" , readConverterExp = "0=正常,1=停用")
 | 
			
		||||
    @ApiModelProperty("帐号状态(0正常 1停用)")
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,12 @@
 | 
			
		||||
package com.ruoyi.wgz.service;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUserLongInReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserLongInRes;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzUser;
 | 
			
		||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppPersonalBasicInformationReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppPersonalBasicInformationRes;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzUser;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@ -71,5 +71,17 @@ public interface IWgzUserService extends IServicePlus<WgzUser> {
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean userRegister(WgzAppUserRegisterReq bo);
 | 
			
		||||
 | 
			
		||||
	WgzAppUserLongInRes userLongIn(WgzAppUserLongInReq req);
 | 
			
		||||
    /**
 | 
			
		||||
     * 务工者APP登录账号
 | 
			
		||||
     * @param phone APP务工者登录业务对象
 | 
			
		||||
     * @return bool
 | 
			
		||||
     */
 | 
			
		||||
	WgzUser userLongIn(String phone);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 务工者APP登录账号
 | 
			
		||||
     * @param req APP务工者登录业务对象
 | 
			
		||||
     * @return bool
 | 
			
		||||
     */
 | 
			
		||||
    WgzAppPersonalBasicInformationRes  userPersonalBasicInformation(WgzAppPersonalBasicInformationReq req);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,29 +1,26 @@
 | 
			
		||||
package com.ruoyi.wgz.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUserLongInReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppPersonalBasicInformationReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserLongInRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppPersonalBasicInformationRes;
 | 
			
		||||
import com.ruoyi.wgz.common.SnowflakeIdUtil;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzUser;
 | 
			
		||||
import com.ruoyi.wgz.mapper.WgzUserMapper;
 | 
			
		||||
import com.ruoyi.wgz.service.IWgzUserService;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
@ -38,9 +35,6 @@ import java.util.Map;
 | 
			
		||||
@Service
 | 
			
		||||
public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser> implements IWgzUserService {
 | 
			
		||||
 | 
			
		||||
//	@Autowired
 | 
			
		||||
//	private TokenService tokenService;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
    public WgzUser queryById(String id){
 | 
			
		||||
        return getById(id);
 | 
			
		||||
@ -109,7 +103,7 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	//注册
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean userRegister(WgzAppUserRegisterReq bo) {
 | 
			
		||||
		WgzUser wgzUser = new WgzUser();
 | 
			
		||||
@ -129,35 +123,24 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
		return  baseMapper.insert(wgzUser) > 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	//登录-获取用户
 | 
			
		||||
	@Override
 | 
			
		||||
	public WgzAppUserLongInRes userLongIn(WgzAppUserLongInReq req) {
 | 
			
		||||
		//1、验证验证码是否正确(展示忽略)
 | 
			
		||||
		//2、验证账号是否存在
 | 
			
		||||
		WgzUser wgzUser = baseMapper.selectOne(new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getPhone, req.getPhone()));
 | 
			
		||||
		if (wgzUser == null){
 | 
			
		||||
			throw new RuntimeException("账号不存在!");
 | 
			
		||||
		}
 | 
			
		||||
		//3、验证密码是否正确
 | 
			
		||||
		if (!SecurityUtils.matchesPassword(req.getPassword(),wgzUser.getPassword())){
 | 
			
		||||
			throw new RuntimeException("密码错误!");
 | 
			
		||||
		}
 | 
			
		||||
		//4、创建token返回wgzUser
 | 
			
		||||
//		String token = tokenService.createToken(wgzUser);
 | 
			
		||||
//		WgzAppUserLongInRes res = new WgzAppUserLongInRes();
 | 
			
		||||
//		res.setToken(token);
 | 
			
		||||
		return null;
 | 
			
		||||
	public WgzUser userLongIn(String phone) {
 | 
			
		||||
		return baseMapper.selectOne(new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getPhone, phone));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	//获取用户个人信息
 | 
			
		||||
    @Override
 | 
			
		||||
    public WgzAppPersonalBasicInformationRes userPersonalBasicInformation(WgzAppPersonalBasicInformationReq req) {
 | 
			
		||||
        //1、根据唯一标识查询用户基本信息
 | 
			
		||||
        WgzUser wgzUser = baseMapper.selectOne(new LambdaQueryWrapper<WgzUser>().eq(WgzUser::getUserId, req.getUserId()));
 | 
			
		||||
        if (wgzUser == null){
 | 
			
		||||
            throw new RuntimeException("当前用户不存在!");
 | 
			
		||||
        }
 | 
			
		||||
        //2、copy数据返回
 | 
			
		||||
        WgzAppPersonalBasicInformationRes wgzAppPersonalBasicInformationRes = new WgzAppPersonalBasicInformationRes();
 | 
			
		||||
        BeanUtils.copyProperties(wgzUser,wgzAppPersonalBasicInformationRes);
 | 
			
		||||
        return wgzAppPersonalBasicInformationRes;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//	public String createToken(WgzUser wu) {
 | 
			
		||||
//		String token = IdUtil.fastUUID();
 | 
			
		||||
//		loginUser.setToken(token);
 | 
			
		||||
//		setUserAgent(loginUser);
 | 
			
		||||
//		refreshToken(loginUser);
 | 
			
		||||
//
 | 
			
		||||
//		Map<String, Object> claims = new HashMap<>();
 | 
			
		||||
//		claims.put(Constants.LOGIN_USER_KEY, token);
 | 
			
		||||
//		return createToken(claims);
 | 
			
		||||
//	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user