Merge branch 'huacheng_test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into huacheng_test
| | |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | <version>0.9.1</version> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | */ |
| | | public static final String AUTHORIZATION = "Authorization"; |
| | | |
| | | /** |
| | | * 小程序 花城e+token |
| | | */ |
| | | public static final String HCAUTHORIZATION = "HCAuthorization"; |
| | | |
| | | } |
| | |
| | | return ResultData.error("导办人员id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserPhone())) |
| | | { |
| | | return ResultData.error("导办人员电话不能为空"); |
| | | } |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | |
| | | { |
| | | return ResultData.error("该工单已办结!"); |
| | | } |
| | | |
| | | if(!StringUtils.equals(order.getState(),"2")) |
| | | { |
| | | return ResultData.error("该工单非是待办状态!"); |
| | | if(StringUtils.equals(entity.getState(),"2")){//如果用户选择未解决则状态改为待办 |
| | | order.setState("2"); |
| | | entity.setState("8"); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | //待评价 |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | | } |
| | | //新增已办结记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("4"); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.service.IAreaCodeService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"所属地区接口"}) |
| | | @RestController |
| | |
| | | public TableDataInfo getAreaCodeByTransactionId(@RequestParam("transactionId") Integer transactionId){ |
| | | return getDataTable(iAreaCodeService.getAreaCodeByTransactionId(transactionId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取攀枝花所有所属地区 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取攀枝花所有所属地区",response = AreaCode2022.class) |
| | | @GetMapping("/getListByPCode") |
| | | public TableDataInfo getListByPCode(){ |
| | | return getDataTable(iAreaCodeService.getListByPCode("510400000000")); |
| | | } |
| | | } |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Api(tags = {"组织架构接口"}) |
| | |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | @ApiOperation("查询机构列表") |
| | | @ApiOperation(value = "查询机构列表",response = OrganizationChartEntity.class) |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList() |
| | | { |
| | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | @ApiOperation("新增机构") |
| | | @ApiOperation(value = "新增机构",response = OrganizationChartEntity.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody OrganizationChartEntity entity) |
| | |
| | | /** |
| | | * 更新机构 |
| | | */ |
| | | @ApiOperation("更新机构") |
| | | @ApiOperation(value = "更新机构",response = OrganizationChartEntity.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity) |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setUpdateUserId(Integer.parseInt(String.valueOf(sysUser.getUserId()))); |
| | | return toAjax(iOrganizationChartService.updateConfig(entity)); |
| | | } |
| | | |
| | |
| | | return ResultData.success(iOrganizationChartService.selectConfigById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | @ApiOperation(value = "查询机构列表(分页)(部门应用)",response = OrganizationChartEntity.class) |
| | | @GetMapping("/queryList") |
| | | @Authorization |
| | | public TableDataInfo queryList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "organizationName",required = false)String organizationName){ |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<OrganizationChartEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | return getDataTable(iOrganizationChartService.queryList(pageParam,pageSize,organizationName),iOrganizationChartService.countList(organizationName)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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("用户不存在"); |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 级别1-5,省市县镇村 |
| | | */ |
| | | @ApiModelProperty("级别1-5,省市县镇村") |
| | | private Boolean level; |
| | | private Integer level; |
| | | |
| | | /** |
| | | * 父级区划代码 |
| | |
| | | @ApiModelProperty("父级区划代码") |
| | | private Long pcode; |
| | | |
| | | /** |
| | | * 子节点 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("子节点") |
| | | private List<AreaCode2022> child; |
| | | |
| | | |
| | | } |
| | |
| | | @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 String departmentalApplication; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty("修改人") |
| | | private Integer updateUserId; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty("修改人姓名") |
| | | private String updateUserName; |
| | | |
| | | |
| | | /** |
| | | * 下属机构 |
| | | */ |
| | | @TableField(exist = false) |
| | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | |
| | | OrganizationChartEntity selectConfigById(@Param("id") String id); |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName); |
| | | |
| | | |
| | | /** |
| | | * 统计数量(部门应用) |
| | | */ |
| | | int countList(String organizationName); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,@Param("userType") String userType); |
| | | |
| | | |
| | | |
| | | SysUser selectData(String userId); |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | |
| | | @Autowired |
| | | private TokenManager manager; |
| | | |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | |
| | | |
| | | //从header中得到token |
| | | String token = request.getHeader(Constant.AUTHORIZATION); |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | SysUser ss = IUserService.getUserById(manager.getUserId(token)); |
| | | //花城token |
| | | String HCtoken = request.getHeader(Constant.HCAUTHORIZATION); |
| | | |
| | | return true; |
| | | if(StringUtils.isEmpty(token)) |
| | | { |
| | | // if(StringUtils.isEmpty(HCtoken)) |
| | | // { |
| | | // String reponse = "{\"result\": 448, \"message\": \"token not is null \"}"; |
| | | // response.setStatus(200); |
| | | // response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); |
| | | // ResponseFacade facade = (ResponseFacade) response; |
| | | // facade.setContentLength(reponse.getBytes(StandardCharsets.UTF_8).length); |
| | | // facade.getWriter().write(reponse); |
| | | // return false; |
| | | // } |
| | | // else |
| | | // { |
| | | // |
| | | // } |
| | | |
| | | //花城e+ token |
| | | if (manager.checkHCToken(HCtoken)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getHCUserId(HCtoken)); |
| | | // SysUser ss = IUserService.selectData(manager.getHCUserId(HCtoken)+""); |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | // SysUser ss = IUserService.selectData(manager.getUserId(token)+""); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | | //如果验证token失败,并且方法或类注明了Authorization,返回401错误 |
| | | if (method.getAnnotation(Authorization.class) != null || bean.getClass().getAnnotation(Authorization.class) != null) { |
| | | if (method.getAnnotation(Authorization.class) != null || |
| | | bean.getClass().getAnnotation(Authorization.class) != null) |
| | | { |
| | | String reponse = "{\"result\": 449, \"message\": \"Overdue token\"}"; |
| | | response.setStatus(200); |
| | | response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import io.jsonwebtoken.Claims; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * token验证处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JWTTokenUtil implements Serializable { |
| | | /** |
| | | * 从数据声明生成令牌 |
| | | * |
| | | * @param claims |
| | | * 数据声明 |
| | | * @return 令牌 |
| | | */ |
| | | private static String generateToken(Map<String, Object> claims) { |
| | | Date expirationDate = new Date(System.currentTimeMillis() + TokenConstant.EXPIRETIME_LONG * 60 * 1000 * 72); |
| | | return Jwts.builder().setClaims(claims).setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, TokenConstant.SECRET).compact(); |
| | | } |
| | | |
| | | /** |
| | | * 生成刷新token |
| | | * |
| | | * @param claims |
| | | * tokenbody |
| | | * @return refreshtoken |
| | | */ |
| | | private static String generateTokenRefreshToken(Map<String, Object> claims) { |
| | | Date expirationDate = new Date(System.currentTimeMillis() + TokenConstant.EXPIRETIME_REFRESH * 60 * 60 * 1000); |
| | | return Jwts.builder().setClaims(claims).setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, TokenConstant.SECRET).compact(); |
| | | } |
| | | |
| | | /** |
| | | * 从令牌中获取数据声明 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 数据声明 |
| | | */ |
| | | public static Claims getClaimsFromToken(String token) { |
| | | Claims claims; |
| | | try { |
| | | claims = Jwts.parser().setSigningKey(TokenConstant.SECRET).parseClaimsJws(token).getBody(); |
| | | } catch (Exception e) { |
| | | claims = null; |
| | | } |
| | | return claims; |
| | | } |
| | | |
| | | /** |
| | | * 生成令牌 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * 用户 |
| | | * @return 令牌 |
| | | */ |
| | | public static String generateToken(HuaChengSysUser loginUserInfoVO) { |
| | | Map<String, Object> claims = new HashMap<>(2); |
| | | claims.put("sub", loginUserInfoVO.getUserId()); |
| | | claims.put("created", new Date()); |
| | | claims.put("type", loginUserInfoVO.getType()); |
| | | return generateToken(claims); |
| | | } |
| | | |
| | | /** |
| | | * 从令牌中获取用户名 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 用户名 |
| | | */ |
| | | public static String getUsernameFromToken(String token) { |
| | | String username; |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | username = claims.getSubject(); |
| | | } catch (Exception e) { |
| | | username = null; |
| | | } |
| | | return username; |
| | | } |
| | | |
| | | /** |
| | | * 判断令牌是否过期 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 是否过期 |
| | | */ |
| | | public static Boolean isTokenExpired(String token) { |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | Date expiration = claims.getExpiration(); |
| | | return expiration.before(new Date()); |
| | | } catch (Exception e) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 刷新令牌 |
| | | * |
| | | * @param token |
| | | * 原令牌 |
| | | * @return 新令牌 |
| | | */ |
| | | public static String refreshToken(String token) { |
| | | String refreshedToken; |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | claims.put("created", new Date()); |
| | | refreshedToken = generateToken(claims); |
| | | } catch (Exception e) { |
| | | refreshedToken = null; |
| | | } |
| | | return refreshedToken; |
| | | } |
| | | |
| | | /** |
| | | * 验证令牌 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @param loginUserInfoVO |
| | | * 用户 |
| | | * @return 是否有效 |
| | | */ |
| | | public static Boolean validateToken(String token, HuaChengSysUser loginUserInfoVO) { |
| | | String username = getUsernameFromToken(token); |
| | | return (username.equals(loginUserInfoVO.getUserId()) && !isTokenExpired(token)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken( |
| | | "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjIsInR5cGUiOjEsImV4cCI6MTYwNjM1NzkzOSwiY3JlYXRlZCI6MTYwNjM1NjEzOTEzN30.zIj31TLHk4B9F45OszrJWfOlhZL5CWviP2RgsFP6LZuci6MlPn0iVbekioP01DRsu59mWd5FMyhd9WLvMtfxMg"); |
| | | Boolean tokenExpired = JWTTokenUtil.isTokenExpired( |
| | | "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjIsInR5cGUiOjEsImV4cCI6MTYwNjM2MDQzNSwiY3JlYXRlZCI6MTYwNjM1ODYzNTI3MX0.7R3SG6hu-sr_KiPpgepubl_1FdaooCNJ0URHWv6Jynr7m8JIar2kUAnhHfWOfHrNILQb5Q-nqxceXdavcuVOXg"); |
| | | System.out.println(claims); |
| | | } |
| | | |
| | | /** |
| | | * 生成刷新token |
| | | * |
| | | * @param loginUserInfoVO |
| | | * 登录用户基本信息 |
| | | * @return refreshtoken |
| | | */ |
| | | public static String generateRefeshToken(HuaChengSysUser loginUserInfoVO) { |
| | | Map<String, Object> claims = new HashMap<>(2); |
| | | claims.put("sub", loginUserInfoVO.getUserId()); |
| | | claims.put("created", new Date()); |
| | | claims.put("type", loginUserInfoVO.getType()); |
| | | return generateTokenRefreshToken(claims); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | import com.dg.core.Constant; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.script.DigestUtils; |
| | | import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | * 通过Redis存储和验证token的实现类 |
| | | */ |
| | | @Component |
| | | public class RedisTokenManager implements TokenManager { |
| | | |
| | | public class RedisTokenManager implements TokenManager |
| | | { |
| | | private RedisTemplate<String, String> redis; |
| | | |
| | | @Qualifier("redisTemplate") |
| | |
| | | return token; |
| | | } |
| | | |
| | | |
| | | public boolean checkToken(String token) { |
| | | if (token == null) { |
| | | return false; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 验证花城token |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean checkHCToken(String token) { |
| | | if (token == null) { |
| | | return false; |
| | | } |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if (ObjectUtils.isEmpty(claims)) { |
| | | return false; |
| | | } |
| | | String userId = claims.getSubject(); |
| | | if (ObjectUtils.isEmpty(userId)) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public long getUserId(String token) { |
| | | if (token == null) { |
| | |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取花城e+的 UserId |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public long getHCUserId(String token) { |
| | | if (token == null) { |
| | | return -1; |
| | | } |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if (ObjectUtils.isEmpty(claims)) { |
| | | return -1; |
| | | } |
| | | String userId = claims.getSubject(); |
| | | if (ObjectUtils.isEmpty(userId)) |
| | | { |
| | | return -1; |
| | | } |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | public void deleteToken(String token) { |
| | | redis.delete(token); |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: token |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 14:44 |
| | | **/ |
| | | public class TokenConstant { |
| | | |
| | | public static final String TOKEN_HEADER = "Authorization"; |
| | | public static final String TOKEN_LOGOUT = "token_logout"; |
| | | public static final String TOKEN_PRE = "Bearer "; |
| | | public static final String TOKEN_USERINFO = "token_userinfo"; |
| | | /** |
| | | * 30分钟 |
| | | */ |
| | | public static final int EXPIRETIME = 300; |
| | | public static final Long EXPIRETIME_LONG = 300L; |
| | | public static final String SECRET = "UTivpbn%n9O!KnnL"; |
| | | /** |
| | | * 24小时 |
| | | */ |
| | | public static final int EXPIRETIME_REFRESH = 24; |
| | | } |
| | |
| | | */ |
| | | public boolean checkToken(String token); |
| | | |
| | | /** |
| | | * 检查花城token是否有效 |
| | | * @param token |
| | | * @return |
| | | */ |
| | | public boolean checkHCToken(String token); |
| | | |
| | | public long getUserId(String token); |
| | | public long getHCUserId(String token); |
| | | |
| | | public void deleteToken(String token); |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getAreaCodeByTransactionId(Integer transactionId); |
| | | |
| | | /** |
| | | * 根据pcode获取所属地区 |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getListByPCode(String 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(); |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | |
| | | * 根据id查取消组织机构 |
| | | */ |
| | | OrganizationChartEntity selectConfigById(String id); |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName); |
| | | |
| | | |
| | | /** |
| | | * 统计数量(部门应用) |
| | | */ |
| | | int countList(String organizationName); |
| | | |
| | | } |
| | |
| | | |
| | | 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); |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | } |
| | | |
| | | |
| | | public List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity){ |
| | | List<OrganizationChartEntity> organizationChartEntitys= organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId())); |
| | |
| | | return areaCodes; |
| | | } |
| | | |
| | | @Override |
| | | public List<AreaCode2022> getListByPCode(String id){ |
| | | List<AreaCode2022> areaCode2022s = baseMapper.selectList(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getPcode, id)); |
| | | for (AreaCode2022 areaCode2022:areaCode2022s) { |
| | | if (areaCode2022.getLevel()!=4) |
| | | areaCode2022.setChild(this.getListByPCode(areaCode2022.getCode().toString())); |
| | | } |
| | | return areaCode2022s; |
| | | } |
| | | |
| | | |
| | | } |
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(); |
| | | } |
| | | } |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | |
| | | public OrganizationChartEntity selectConfigById(String id) { |
| | | return baseMapper.selectConfigById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName) { |
| | | return baseMapper.queryList(page,state,organizationName); |
| | | } |
| | | |
| | | @Override |
| | | public int countList(String organizationName) { |
| | | return baseMapper.countList(organizationName); |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | #password: nahanMysqlPwd&&RemoteRemote2019nahan |
| | | |
| | | |
| | | server.port=8187 |
| | | server.port=8187 |
| | | #server.port=8088 |
| | | |
| | | swagger.enabled=true |
| | |
| | | spring.servlet.multipart.max-file-size=20MB |
| | | spring.servlet.multipart.max-request-size=50MB |
| | | |
| | | # ?????? |
| | | # ???? ??? Windows??D:/ruoyi/uploadPath?Linux?? /home/ruoyi/uploadPath? |
| | | #profile=E:/java/flower_city_automessage/flower_citys/files |
| | | profile=D:/tupianshuju |
| | | |
| | | |
| | | wx.open.app_id=wx118de8a734d269f0 |
| | |
| | | <include refid="selectGuideRepairOrderVo"/> |
| | | <where> |
| | | <if test="matterName != null and matterName != ''"> |
| | | AND matterName=#{matterName} |
| | | AND matter_name like concat('%', #{matterName}, '%') |
| | | </if> |
| | | </where> |
| | | order by update_time desc , create_time desc |
| | | </select> |
| | | |
| | | <select id="countConfigList" resultType="integer"> |
| | | select count(id) from automessage_guide_repair_order |
| | | <where> |
| | | <if test="matterName != null and matterName != ''"> |
| | | AND matterName=#{matterName} |
| | | AND matter_name like concat('%', #{matterName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
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> |
| | |
| | | create_time, |
| | | update_time, |
| | | parent_id, |
| | | update_user_id, |
| | | (select user_name from automessage_sys_user where user_id=automessage_organization_chart.update_user_id)updateUserName, |
| | | (select organization_name from automessage_organization_chart as oc where oc.id=automessage_organization_chart.parent_id) as parentName, |
| | | city, |
| | | district, |
| | |
| | | <select id="queryList" resultMap="OrganizationChartResult"> |
| | | <include refid="selectOrganizationChartVo"/> |
| | | <where> |
| | | <if test="parentId != null and parentId != ''"> |
| | | AND parent_id=#{parentId} |
| | | <if test="organizationName != null and organizationName != ''"> |
| | | AND organization_name like concat('%', #{organizationName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <if test="grade != null and grade != ''"> |
| | | AND grade=#{grade} |
| | | <select id="countList" resultType="integer"> |
| | | select count(id) from automessage_organization_chart |
| | | <where> |
| | | <if test="organizationName != null and organizationName != ''"> |
| | | AND organization_name like concat('%', #{organizationName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | <if test="village != null and village != '' ">village=#{village},</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">detailed_address=#{detailedAddress},</if> |
| | | <if test="grade != null and grade != '' ">grade=#{grade},</if> |
| | | <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application=#{departmentalApplication},</if> |
| | | <if test="updateUserId != null">update_user_id=#{updateUserId},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | |
| | | <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> |