| | |
| | | import com.dg.core.HttpStatus; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @ApiOperation("登录接口") |
| | | @PostMapping(path = "/login") |
| | | public ResultData login(@RequestParam String account, @RequestParam String password, HttpServletRequest request) { |
| | | Assert.notNull(account, "username can not be empty"); |
| | | Assert.notNull(password, "password can not be empty"); |
| | | |
| | | SysUser user = IUserService.getUserByAccount(account); |
| | | if (user == null || !password.equals(user.getPassword())) { |
| | | SysUser user=null; |
| | | //管理员登录 |
| | | if(StringUtils.equals("zigonggaoadmin",account)) |
| | | { |
| | | user= IUserService.getUserByAccount(account); |
| | | |
| | | if(user==null || !password.equals(user.getPassword())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | | System.out.println("token "+token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(user.getUserId(), user.getUserId()); |
| | | } |
| | | |
| | | user.setLoginDate(LocalDateTime.now()); |
| | | //更新登录时间 |
| | | IUserService.updateConfig(user); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", user.getUserId()); |
| | | map.put("userName", user.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData("",account,""); |
| | | if(huaChengSysUser==null || !password.equals(huaChengSysUser.getPassword())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | |
| | | //本地表查询用户 |
| | | user = IUserService.selectData(huaChengSysUser.getUserId()+""); |
| | | if (user == null) { |
| | | //本地没有此用户 新用户 |
| | | SysUser newSysUser=new SysUser(); |
| | | //默认 1系统后台用户 |
| | | newSysUser.setUserType("1"); |
| | | newSysUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newSysUser.setUserId(huaChengSysUser.getUserId()); |
| | | newSysUser.setUserName(huaChengSysUser.getNickName()); |
| | | newSysUser.setSex(huaChengSysUser.getSex()); |
| | | newSysUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newSysUser.setCreateTime(LocalDateTime.now()); |
| | | newSysUser.setUpdateTime(LocalDateTime.now()); |
| | | IUserService.insertConfig(newSysUser); |
| | | } |
| | | |
| | | user = IUserService.selectData(huaChengSysUser.getUserId()+""); |
| | | |
| | | if (user == null) { |
| | | return ResultData.error("用户不存在!请联系管理员"); |
| | | } |
| | | |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | SysUser sysUser=IUserService.getUserById(Long.valueOf(userId)); |
| | | SysUser sysUser=IUserService.selectData(userId); |
| | | //删除标志(0代表存在 2代表删除) |
| | | sysUser.setDelFlag("2"); |
| | | return toAjax(IUserService.updateConfig(sysUser)); |
| | |
| | | return error("密码不能为空"); |
| | | } |
| | | |
| | | SysUser sysUser=IUserService.getUserById(config.getUserId()); |
| | | SysUser sysUser=IUserService.selectData(config.getUserId()+""); |
| | | if(sysUser==null) |
| | | { |
| | | return error("用户不存在"); |
| | |
| | | @ApiModelProperty(name = "suggest", value = "建议") |
| | | private String suggest; |
| | | |
| | | @ApiModelProperty(name = "evaluateState", value = "评价状态") |
| | | @ApiModelProperty(name = "evaluateState", value = "评价状态(1 满意 2不满意)") |
| | | private String evaluateState; |
| | | |
| | | @ApiModelProperty(name = "serviceState", value = "服务状态(1.已解决 2.未解决)") |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * 此类为花城e+主体类 |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | */ |
| | | @ApiModel("花城用户信息实体类") |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class HuaChengSysUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | @ApiModelProperty(name = "userId", value = "主键用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 登录账户 |
| | | */ |
| | | @ApiModelProperty(name = "account", value = "登录账户") |
| | | private String account; |
| | | |
| | | /** |
| | | * 登录密码 |
| | | */ |
| | | @ApiModelProperty(name = "password", value = "登录密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 微信小程序唯一标识 |
| | | */ |
| | | @ApiModelProperty(name = "openid", value = "微信小程序唯一标识") |
| | | private String openid; |
| | | |
| | | /** |
| | | * 会话密钥 |
| | | */ |
| | | @ApiModelProperty(name = "sessionKey", value = "会话密钥") |
| | | private String sessionKey; |
| | | |
| | | /** |
| | | * 用户在开放平台的唯一标识符 |
| | | */ |
| | | @ApiModelProperty(name = "unionid", value = "用户在开放平台的唯一标识符") |
| | | private String unionid; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @ApiModelProperty(name = "phone", value = "手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(name = "nickName", value = "昵称") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 真实名字 |
| | | */ |
| | | @ApiModelProperty(name = "name", value = "真实名字") |
| | | private String name; |
| | | |
| | | /** |
| | | * 社区ID |
| | | */ |
| | | @ApiModelProperty(name = "communityId", value = "社区ID") |
| | | private String communityId; |
| | | |
| | | /** |
| | | * 性别 1 男 2 女 |
| | | */ |
| | | @ApiModelProperty(name = "sex", value = "性别 1 男 2 女") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ApiModelProperty(name = "idCard", value = "身份证号") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @ApiModelProperty(name = "birthday", value = "生日") |
| | | private String birthday; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(name = "imageUrl", value = "头像") |
| | | private String imageUrl; |
| | | |
| | | /** |
| | | * 用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10 便民服务商家后台 11三说会堂后台 12行业分中心后台 |
| | | */ |
| | | @ApiModelProperty(name = "type", value = "用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10 便民服务商家后台 11三说会堂后台 12行业分中心后台") |
| | | private String type; |
| | | |
| | | /** |
| | | * 职业 |
| | | */ |
| | | @ApiModelProperty(name = "job", value = "职业") |
| | | private String job; |
| | | |
| | | /** |
| | | * 是否志愿者 0 否 1 是 |
| | | */ |
| | | @ApiModelProperty(name = "isVolunteer", value = "是否志愿者 0 否 1 是") |
| | | private String isVolunteer; |
| | | |
| | | /** |
| | | * 是否党员 0 否 1 是 |
| | | */ |
| | | @ApiModelProperty(name = "isPartymember", value = "是否党员 0 否 1 是") |
| | | private String isPartymember; |
| | | |
| | | /** |
| | | * 1 启用 2 禁用 |
| | | */ |
| | | @ApiModelProperty(name = "status", value = "1 启用 2 禁用") |
| | | private String status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(name = "createAt", value = "创建时间") |
| | | private String createAt; |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | @ApiModelProperty(name = "lastLoginTime", value = "最后登录时间") |
| | | private String lastLoginTime; |
| | | |
| | | /** |
| | | * 标签多个用,隔开 |
| | | */ |
| | | @ApiModelProperty(name = "tags", value = "标签多个用,隔开") |
| | | private String tags; |
| | | |
| | | /** |
| | | * 家庭id |
| | | */ |
| | | @ApiModelProperty(name = "familyId", value = "家庭id") |
| | | private String familyId; |
| | | |
| | | /** |
| | | * 人脸采集照片url |
| | | */ |
| | | @ApiModelProperty(name = "faceUrl", value = "人脸采集照片url") |
| | | private String faceUrl; |
| | | |
| | | /** |
| | | * 人脸采集审核状态 0 待审核 1 审核通过 2驳回 |
| | | */ |
| | | @ApiModelProperty(name = "faceState", value = "人脸采集审核状态 0 待审核 1 审核通过 2驳回") |
| | | private String faceState; |
| | | |
| | | /** |
| | | * 驳回原因 |
| | | */ |
| | | @ApiModelProperty(name = "rejectReson", value = "驳回原因") |
| | | private String rejectReson; |
| | | |
| | | /** |
| | | * 小区id |
| | | */ |
| | | @ApiModelProperty(name = "areaId", value = "小区id") |
| | | private String areaId; |
| | | |
| | | /** |
| | | * 证件照(人相面)照片 |
| | | */ |
| | | @ApiModelProperty(name = "cardPhotoFront", value = "证件照(人相面)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | @ApiModelProperty(name = "cardPhotoBack", value = "证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | /** |
| | | * 户口本 |
| | | */ |
| | | @ApiModelProperty(name = "familyBook", value = "户口本") |
| | | private String familyBook; |
| | | |
| | | /** |
| | | * 连续登陆天数 每天凌晨定时任务更新 |
| | | */ |
| | | @ApiModelProperty(name = "continuousLandingDays", value = "连续登陆天数 每天凌晨定时任务更新") |
| | | private String continuousLandingDays; |
| | | |
| | | /** |
| | | * 小程序首页是否显示公告(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(name = "isTips", value = "小程序首页是否显示公告(1.是 2.否)") |
| | | private String isTips; |
| | | |
| | | /** |
| | | * 网格员工作状态(1.在岗 2.脱岗 3.已下班) |
| | | */ |
| | | @ApiModelProperty(name = "workStatus", value = "网格员工作状态(1.在岗 2.脱岗 3.已下班)") |
| | | private String workStatus; |
| | | |
| | | /** |
| | | * 网格员上班开始时间 |
| | | */ |
| | | @ApiModelProperty(name = "workStartTime", value = "网格员上班开始时间") |
| | | private String workStartTime; |
| | | |
| | | /** |
| | | * 网格员上班结束时间 |
| | | */ |
| | | @ApiModelProperty(name = "workEndTime", value = "网格员上班结束时间") |
| | | private String workEndTime; |
| | | |
| | | /** |
| | | * 高龄认证显示提示(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(name = "bigAgeTips", value = "高龄认证显示提示(1.是 2.否)") |
| | | private String bigAgeTips; |
| | | |
| | | /** |
| | | * 明文密码 |
| | | */ |
| | | @ApiModelProperty(name = "plaintextPassword", value = "明文密码") |
| | | private String plaintextPassword; |
| | | |
| | | /** |
| | | * 街道id |
| | | */ |
| | | @ApiModelProperty(name = "streetId", value = "街道id") |
| | | private String streetId; |
| | | |
| | | /** |
| | | * 绑定单位 |
| | | */ |
| | | @ApiModelProperty(name = "relationName", value = "绑定单位") |
| | | private String relationName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty(name = "appId", value = "") |
| | | private String appId; |
| | | |
| | | /** |
| | | * 是否接收推送 |
| | | */ |
| | | @ApiModelProperty(name = "isAccept", value = "是否接收推送") |
| | | private String isAccept; |
| | | |
| | | /** |
| | | * 报到单位id |
| | | */ |
| | | @ApiModelProperty(name = "bindingCheckUnitId", value = "报到单位id") |
| | | private String bindingCheckUnitId; |
| | | |
| | | } |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 用户ID |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | |
| | |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * 用户性别(0男 1女 2未知) |
| | | * 性别 1 男 2 女 |
| | | */ |
| | | @ApiModelProperty("用户性别(0男 1女 2未知)") |
| | | @ApiModelProperty("性别 1 男 2 女") |
| | | private String sex; |
| | | |
| | | /** |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiang |
| | | * @since 2022-07-11 |
| | | */ |
| | | public interface HuaChengSysUserMapper extends BaseMapper<HuaChengSysUser> |
| | | { |
| | | public List<HuaChengSysUser> selectConfigList(); |
| | | |
| | | public HuaChengSysUser selectData(@Param("userId") String userId,@Param("account") String account,@Param("phone") String phone); |
| | | |
| | | public int selectNum(); |
| | | } |
| | |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,@Param("userType") String userType); |
| | | |
| | | |
| | | |
| | | SysUser selectData(String userId); |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | SysUser ss = IUserService.getUserById(manager.getUserId(token)); |
| | | SysUser ss = IUserService.selectData(manager.getUserId(token)+""); |
| | | |
| | | return true; |
| | | } |
| | |
| | | Long currentUserId = (Long) webRequest.getAttribute(Constant.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST); |
| | | if (currentUserId != null) { |
| | | //从数据库中查询并返回 |
| | | return userService.getUserById(currentUserId); |
| | | return userService.selectData(currentUserId+""); |
| | | } |
| | | throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IHuaChengSysUserService |
| | | { |
| | | public List<HuaChengSysUser> selectConfigList(); |
| | | |
| | | public HuaChengSysUser selectData(String userId,String account,String phone); |
| | | |
| | | public int selectNum(); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ISysUserService { |
| | | SysUser getUserById(Long id); |
| | | public interface ISysUserService |
| | | { |
| | | SysUser getUserByAccount(String account); |
| | | /** |
| | | * 查询聊天列表 |
| | |
| | | */ |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType); |
| | | |
| | | |
| | | SysUser selectData(String userId); |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.mapper.HuaChengSysUserMapper; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class HuaChengSysUserImpl extends ServiceImpl<HuaChengSysUserMapper, HuaChengSysUser> implements IHuaChengSysUserService |
| | | { |
| | | |
| | | @Override |
| | | public List<HuaChengSysUser> selectConfigList() { |
| | | return baseMapper.selectConfigList(); |
| | | } |
| | | |
| | | @Override |
| | | public HuaChengSysUser selectData(String userId,String account,String phone) { |
| | | return baseMapper.selectData(userId,account,phone); |
| | | } |
| | | |
| | | @Override |
| | | public int selectNum() { |
| | | return baseMapper.selectNum(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | @Override |
| | | public SysUser getUserById(Long id) { |
| | | return baseMapper.selectById(id); |
| | | } |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Override |
| | | public SysUser getUserByAccount(String account) { |
| | |
| | | |
| | | @Override |
| | | public ResultData smsSend(SysUser user){ |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, user.getPhonenumber())); |
| | | if (sysUser==null){ |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setLoginName(user.getPhonenumber()); |
| | | newUser.setUserName(user.getPhonenumber().substring(0,3)+"xxxx"+user.getPhonenumber().substring(7,11)+"用户"); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(user.getPhonenumber()); |
| | | newUser.setSex("2"); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insert(newUser); |
| | | } |
| | | return smsUtil.sendSms(user.getPhonenumber()); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData loginByAccount(String phonenumber, String code){ |
| | | String code1 = redisTemplate.opsForValue().get(phonenumber) + ""; |
| | | |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser==null){ |
| | | //查询花城e+是否存在此用户 |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData("","",phonenumber); |
| | | if(huaChengSysUser==null) |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(Snowflake.getId()); |
| | | newUser.setLoginName(phonenumber); |
| | | newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户"); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(phonenumber); |
| | | newUser.setSex("1"); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insert(newUser); |
| | | } |
| | | else |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(huaChengSysUser.getUserId()); |
| | | newUser.setLoginName(huaChengSysUser.getPhone()); |
| | | newUser.setUserName(huaChengSysUser.getNickName()); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newUser.setSex(huaChengSysUser.getSex()); |
| | | newUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insert(newUser); |
| | | } |
| | | } |
| | | |
| | | if (code.equals(code1)) { |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser!=null){ |
| | | String token = tokenManager.getTokenByUserId(sysUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | |
| | | return baseMapper.selectConfigList(page, state,userType); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public SysUser selectData(String userId) { |
| | | return baseMapper.selectData(userId); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | spring.datasource.password=nahanMysqlPwd&&RemoteRemote2019nahan |
| | | #spring.datasource.url=jdbc:mysql://10.8.0.74:3306/flower_city_automessage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8 |
| | | #spring.datasource.url=jdbc:mysql://localhost:3306/flower_city_automessage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8 |
| | | #spring.datasource.url=jdbc:mysql://10.8.0.74:3306/huacheng_smart_life?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8 |
| | | spring.datasource.url=jdbc:mysql://182.151.2.19:3306/huacheng_smart_life?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | spring.datasource.url=jdbc:mysql://10.8.0.74:3306/huacheng_smart_life?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8 |
| | | #spring.datasource.url=jdbc:mysql://182.151.2.19:3306/huacheng_smart_life?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 |
| | | |
| | | |
| | | #datasource: |
| | |
| | | #password: nahanMysqlPwd&&RemoteRemote2019nahan |
| | | |
| | | |
| | | server.port=8187 |
| | | server.port=8187 |
| | | #server.port=8088 |
| | | |
| | | swagger.enabled=true |
| | |
| | | #Redis |
| | | spring.redis.host=127.0.0.1 |
| | | spring.redis.port=6379 |
| | | spring.redis.password=nahanRedisPwsIsVerySimple&& |
| | | #spring.redis.password=nahanRedisPwsIsVerySimple&& |
| | | |
| | | |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.HuaChengSysUserMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.HuaChengSysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id" /> |
| | | <id property="account" column="account" /> |
| | | <id property="password" column="password" /> |
| | | <id property="openid" column="openid" /> |
| | | <id property="sessionKey" column="session_key" /> |
| | | <id property="unionid" column="unionid" /> |
| | | <id property="phone" column="phone" /> |
| | | <id property="nickName" column="nick_name" /> |
| | | <id property="name" column="name" /> |
| | | <id property="communityId" column="community_id" /> |
| | | <id property="sex" column="sex" /> |
| | | <id property="idCard" column="id_card" /> |
| | | <id property="birthday" column="birthday" /> |
| | | <id property="imageUrl" column="image_url" /> |
| | | <id property="type" column="type" /> |
| | | <id property="job" column="job" /> |
| | | <id property="isVolunteer" column="is_volunteer" /> |
| | | <id property="isPartymember" column="is_partymember" /> |
| | | <id property="status" column="status" /> |
| | | <id property="createAt" column="create_at" /> |
| | | <id property="lastLoginTime" column="last_login_time" /> |
| | | <id property="tags" column="tags" /> |
| | | <id property="familyId" column="family_id" /> |
| | | <id property="faceUrl" column="face_url" /> |
| | | <id property="faceState" column="face_state" /> |
| | | <id property="rejectReson" column="reject_reson" /> |
| | | <id property="areaId" column="area_id" /> |
| | | <id property="cardPhotoFront" column="card_photo_front" /> |
| | | <id property="cardPhotoBack" column="card_photo_back" /> |
| | | <id property="familyBook" column="family_book" /> |
| | | <id property="continuousLandingDays" column="continuous_landing_days" /> |
| | | <id property="isTips" column="is_tips" /> |
| | | <id property="workStatus" column="work_status" /> |
| | | <id property="workStartTime" column="work_start_time" /> |
| | | <id property="workEndTime" column="work_end_time" /> |
| | | <id property="bigAgeTips" column="big_age_tips" /> |
| | | <id property="plaintextPassword" column="plaintext_password" /> |
| | | <id property="streetId" column="street_id" /> |
| | | <id property="relationName" column="relation_name" /> |
| | | <id property="appId" column="app_id" /> |
| | | <id property="isAccept" column="is_accept" /> |
| | | <id property="bindingCheckUnitId" column="binding_check_unit_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSysUserVo"> |
| | | SELECT |
| | | user_id, |
| | | account, |
| | | password, |
| | | openid, |
| | | session_key, |
| | | unionid, |
| | | phone, |
| | | nick_name, |
| | | name, |
| | | community_id, |
| | | sex, |
| | | id_card, |
| | | birthday, |
| | | image_url, |
| | | type, |
| | | job, |
| | | is_volunteer, |
| | | is_partymember, |
| | | status, |
| | | create_at, |
| | | last_login_time, |
| | | tags, |
| | | family_id, |
| | | face_url, |
| | | face_state, |
| | | reject_reson, |
| | | area_id, |
| | | card_photo_front, |
| | | card_photo_back, |
| | | family_book, |
| | | continuous_landing_days, |
| | | is_tips, |
| | | work_status, |
| | | work_start_time, |
| | | work_end_time, |
| | | big_age_tips, |
| | | plaintext_password, |
| | | street_id, |
| | | relation_name, |
| | | app_id, |
| | | is_accept, |
| | | binding_check_unit_id |
| | | FROM |
| | | sys_user |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectNum" resultType="integer"> |
| | | select count(user_id) from sys_user |
| | | </select> |
| | | |
| | | <select id="selectConfigList" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | </select> |
| | | |
| | | <select id="selectData" parameterType="string" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |
| | | <if test="userId!=null and userId!=''"> |
| | | and user_id=#{userId} |
| | | </if> |
| | | <if test="account!=null and account!=''"> |
| | | and account=#{account} |
| | | </if> |
| | | <if test="phone!=null and phone!=''"> |
| | | and phone=#{phone} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.dg.core.db.gen.mapper.SysUserMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.SysUser" id="SysUserResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="userId" column="user_id" /> |
| | | <result property="loginName" column="login_name" /> |
| | | <result property="userName" column="user_name" /> |
| | |
| | | |
| | | <sql id="selectSysUserVo"> |
| | | SELECT |
| | | id, |
| | | user_id, |
| | | login_name, |
| | | user_name, |
| | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectData" parameterType="string" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |
| | | <if test="userId!=null and userId!='' "> |
| | | user_id= #{userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectListByDepartmentId" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |