| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:major:list')") |
| | | @ApiOperation(value = "专业管理分页列表", response = TMajorQuery.class) |
| | | @PostMapping(value = "/api/t-division-team/pageList") |
| | | @PostMapping(value = "/api/t-major/pageList") |
| | | public R<PageInfo<TMajor>> pageList(@RequestBody String param) { |
| | | TMajorQuery query = JSON.parseObject(param, TMajorQuery.class); |
| | | return R.ok(majorService.pageList(query)); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('system:major:add')") |
| | | @Log(title = "专业管理信息-新增专业管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加专业管理",response = TMajor.class) |
| | | @PostMapping(value = "/api/t-division-team/add") |
| | | @PostMapping(value = "/api/t-major/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TMajor dto = JSON.parseObject(param,TMajor.class); |
| | | if(majorService.isExit(dto)){ |
| | |
| | | //@PreAuthorize("@ss.hasPermi('system:major:edit')") |
| | | @Log(title = "专业管理信息-修改专业管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改专业管理") |
| | | @PostMapping(value = "/api/t-division-team/update") |
| | | @PostMapping(value = "/api/t-major/update") |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TMajor dto = JSON.parseObject(param,TMajor.class); |
| | | if(majorService.isExit(dto)){ |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:major:detail')") |
| | | @ApiOperation(value = "查看专业管理详情") |
| | | @GetMapping(value = "/open/t-division-team/getDetailById") |
| | | @GetMapping(value = "/open/t-major/getDetailById") |
| | | public R<TMajor> getDetailById(@RequestParam String id) { |
| | | TMajor equipment = majorService.getById(id); |
| | | return R.ok(equipment); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('system:major:delete')") |
| | | @Log(title = "专业管理信息-删除专业管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除专业管理") |
| | | @DeleteMapping(value = "/open/t-division-team/deleteById") |
| | | @DeleteMapping(value = "/open/t-major/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(majorService.removeById(id)); |
| | | } |
| | |
| | | //@PreAuthorize("@ss.hasPermi('system:major:delete')") |
| | | @Log(title = "专业管理信息-删除专业管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除专业管理") |
| | | @DeleteMapping(value = "/open/t-division-team/deleteByIds") |
| | | @DeleteMapping(value = "/open/t-major/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(majorService.removeByIds(ids)); |
| | | } |
| | |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "短信登录",notes = "短信登录") |
| | | @PostMapping("/loginCode") |
| | | public AjaxResult loginCode(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.loginCode(loginBody.getUsername(), loginBody.getCode()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | if(CollectionUtils.isEmpty(roles)){ |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | ajax.put("menus",menus); |
| | | ajax.put("roleName",roles.get(0).getRoleName()); |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | // @ApiOperation(value = "短信登录",notes = "短信登录") |
| | | // @PostMapping("/loginCode") |
| | | // public AjaxResult loginCode(@RequestBody LoginBody loginBody) |
| | | // { |
| | | // AjaxResult ajax = AjaxResult.success(); |
| | | // // 生成令牌 |
| | | // LoginUser loginUser = loginService.loginCode(loginBody.getUsername(), loginBody.getCode()); |
| | | // ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | // List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | // if(CollectionUtils.isEmpty(roles)){ |
| | | // return AjaxResult.error("请关联角色!"); |
| | | // } |
| | | // List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | // |
| | | // ajax.put("menus",menus); |
| | | // ajax.put("roleName",roles.get(0).getRoleName()); |
| | | // ajax.put("userInfo",loginUser); |
| | | // return ajax; |
| | | // } |
| | | |
| | | /** |
| | | * 获取验证码 |
| | |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TAppUser; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | |
| | | private final TAppUserService appUserService; |
| | | private final TokenService tokenService; |
| | | private final PasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | public TAppUserController(TAppUserService appUserService, TokenService tokenService) { |
| | | public TAppUserController(TAppUserService appUserService, TokenService tokenService, PasswordEncoder passwordEncoder) { |
| | | this.appUserService = appUserService; |
| | | this.tokenService = tokenService; |
| | | this.passwordEncoder = passwordEncoder; |
| | | } |
| | | |
| | | /** |
| | | * 添加人员管理管理管理 |
| | | */ |
| | | @ApiOperation(value = "添加人员管理",response = TAppUser.class) |
| | | @ApiOperation(value = "注册人员管理",response = TAppUser.class) |
| | | @PostMapping(value = "/api/t-equipment/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TAppUser dto = JSON.parseObject(param,TAppUser.class); |
| | | long count = appUserService.count(Wrappers.lambdaQuery(TAppUser.class).eq(TAppUser::getAccount, dto.getAccount())); |
| | | if (count>0) { |
| | | return R.fail("该账号已存在"); |
| | | } |
| | | dto.setState(0); |
| | | dto.setStatus(1); |
| | | passwordEncoder.encode(dto.getPassword()); |
| | | appUserService.save(dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginBody; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.domain.model.LoginAppBody; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @param param 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "账号密码登录",notes = "账号密码登录") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | @PostMapping("/api/loginApp") |
| | | public AjaxResult login(@RequestBody String param) |
| | | { |
| | | LoginAppBody loginAppBody = JSON.parseObject(param, LoginAppBody.class); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | if(CollectionUtils.isEmpty(roles)){ |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | if(roles.get(0).getStatus() == 1){ |
| | | return AjaxResult.error("该账号角色已被禁用!"); |
| | | } |
| | | |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | ajax.put("menus",menus); |
| | | ajax.put("roleName",roles.get(0).getRoleName()); |
| | | LoginUserApplet loginUser = loginService.loginCodeApplet(loginAppBody.getAccount(), loginAppBody.getPassword()); |
| | | ajax.put(Constants.TOKEN, tokenService.createTokenApplet(loginUser)); |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "短信登录",notes = "短信登录") |
| | | @PostMapping("/loginCode") |
| | | public AjaxResult loginCode(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取验证码 |
| | | * |
| | | * @param phone 手机号 |
| | | * @return 结果 |
| | | */ |
| | | // @ApiOperation(value = "获取验证码",notes = "获取验证码") |
| | | // @GetMapping("/getCode") |
| | | // public AjaxResult getCode(@RequestParam String phone) |
| | | // { |
| | | // // 发送验证码并存储到redis |
| | | // if (StringUtils.hasLength(phone)) { |
| | | // String code = String.valueOf((int) (Math.random() * 1000000)); |
| | | // redisCache.setCacheObject(phone, code,5*60,TimeUnit.SECONDS); |
| | | // try { |
| | | // smsUtil.sendSms(phone, "2369926", new String[]{code}); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // return AjaxResult.success("发送短信验证码成功!5分钟内有效"); |
| | | // } |
| | | // return AjaxResult.error(500, "发送短信验证码失败,请确认手机号码!"); |
| | | // } |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Value("${code.config.accessKeyId}") |
| | | private String accessKeyId; |
| | | @Value("${code.config.accessKeySecret}") |
| | | private String accessKeySecret; |
| | | @Value("${code.config.signName}") |
| | | private String signName; |
| | | @Value("${code.config.templateCode}") |
| | | private String templateCode; |
| | | @Value("${code.config.signNameTest}") |
| | | private String signNameTest; |
| | | @Value("${code.config.templateCodeTest}") |
| | | private String templateCodeTest; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @param accessKeyId |
| | | * @param accessKeySecret |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | Config config = new Config() |
| | | // 您的 AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的 AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone,String code) throws Exception { |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(signName) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone) |
| | | .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | } catch (TeaException error) { |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } catch (Exception _error) { |
| | | TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | // @Value("${code.config.accessKeyId}") |
| | | // private String accessKeyId; |
| | | // @Value("${code.config.accessKeySecret}") |
| | | // private String accessKeySecret; |
| | | // @Value("${code.config.signName}") |
| | | // private String signName; |
| | | // @Value("${code.config.templateCode}") |
| | | // private String templateCode; |
| | | // @Value("${code.config.signNameTest}") |
| | | // private String signNameTest; |
| | | // @Value("${code.config.templateCodeTest}") |
| | | // private String templateCodeTest; |
| | | // |
| | | // /** |
| | | // * 使用AK&SK初始化账号Client |
| | | // * @param accessKeyId |
| | | // * @param accessKeySecret |
| | | // * @return Client |
| | | // * @throws Exception |
| | | // */ |
| | | // public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | // Config config = new Config() |
| | | // // 您的 AccessKey ID |
| | | // .setAccessKeyId(accessKeyId) |
| | | // // 您的 AccessKey Secret |
| | | // .setAccessKeySecret(accessKeySecret); |
| | | // // 访问的域名 |
| | | // config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | // return new com.aliyun.dysmsapi20170525.Client(config); |
| | | // } |
| | | // |
| | | // public void sendMsg(String phone,String code) throws Exception { |
| | | // com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | // SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | // .setSignName(signName) |
| | | // .setTemplateCode(templateCode) |
| | | // .setPhoneNumbers(phone) |
| | | // .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | // RuntimeOptions runtime = new RuntimeOptions(); |
| | | // try { |
| | | // // 复制代码运行请自行打印 API 的返回值 |
| | | // SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | // log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | // } catch (TeaException error) { |
| | | // // 如有需要,请打印 error |
| | | // com.aliyun.teautil.Common.assertAsString(error.message); |
| | | // log.info("短信发送失败:{}",error.message); |
| | | // } catch (Exception _error) { |
| | | // TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // // 如有需要,请打印 error |
| | | // com.aliyun.teautil.Common.assertAsString(error.message); |
| | | // log.info("短信发送失败:{}",error.message); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | addressEnabled: false |
| | | # 验证码类型 math 数字计算 char 字符验证 |
| | | captchaType: math |
| | | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8082 |
| | | port: 9099 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: / |
| | |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | # host: 127.0.0.1 |
| | | # # 端口,默认为6379 |
| | | # port: 6379 |
| | | # # 数据库索引 |
| | | # database: 0 |
| | | # # 密码 |
| | | # password: 123456 |
| | | host: xzgt.test.591taxi.cn |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 16379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 8f5z9g52gx4bg |
| | | password: 123456 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://xzgt.test.591taxi.cn:13306/xizang?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://127.0.0.1:3306/intelligent_dispatching?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 8f5z9g52gx4bg |
| | | password: 123456 |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | |
| | | location: /file/ |
| | | qrLocation: /file/qrCode/ |
| | | accessPath: /file/ |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF |
| | | url: |
| | | # prefix: http://localhost:${server.port}${server.servlet.context-path} |
| | | prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF|.xls|.xlsx|.rar|.zip|.rar |
| | | wx: |
| | | conf: |
| | | appId: wxe91f1af7638aa5dd |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | templateCodeTest: "SMS_154950909" |
| | | signNameTest: "阿里云短信测试" |
| | | accessKeyId: LTAI5tAdba8HtT1C6UqtSxBt |
| | | accessKeySecret: 0SRb6XGkciQDPWn2rYqbJtq2qRMDY8 |
| | | signName: "四川金达通信工程" |
| | | templateCode: "SMS_293985284" |
| | | cos: |
| | | client: |
| | | accessKey: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretKey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | bucket: xzgttest-1305134071 |
| | | bucketAddr: ap-chengdu |
| | | rootSrc: https://xzgttest-1305134071.cos.ap-chengdu.myqcloud.com/ |
| | | location: xizang |
| | | sms: |
| | | enable: true |
| | | appId: 1400957506 |
| | | secretid: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretkey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | sign: 畅云出行 |
| | | appId: |
| | | secretId: |
New file |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * 租户 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-01-20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="TAppUser对象", description="登录返回") |
| | | public class TAppUserResp { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "登录账号") |
| | | private String account; |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "分队名称 注册提交时使用") |
| | | private String teamName; |
| | | |
| | | @ApiModelProperty(value = "分队id") |
| | | private String teamId; |
| | | |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "实训次数") |
| | | private Integer practicalTrainCount; |
| | | |
| | | @ApiModelProperty(value = "其他次数") |
| | | private Integer otherCount; |
| | | |
| | | @ApiModelProperty(value = "审核状态 0=待审核 1=通过 2=拒绝") |
| | | private Integer state; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.core.domain.model; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 用户登录对象 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @ApiModel(value = "App登录对象Body") |
| | | public class LoginAppBody |
| | | { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | @ApiModelProperty(value = "账号",notes = "账号") |
| | | private String account; |
| | | |
| | | /** |
| | | * 用户密码 |
| | | */ |
| | | @ApiModelProperty(value = "用户密码") |
| | | private String password; |
| | | |
| | | |
| | | /** |
| | | * 唯一标识 |
| | | */ |
| | | private String uuid; |
| | | |
| | | public String getAccount() |
| | | { |
| | | return account; |
| | | } |
| | | |
| | | public void setAccount(String account) |
| | | { |
| | | this.account = account; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getUuid() |
| | | { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) |
| | | { |
| | | this.uuid = uuid; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.core.domain.model; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.TTenantResp; |
| | | import com.ruoyi.common.core.domain.entity.TAppUserResp; |
| | | import lombok.Data; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | |
| | | /** |
| | | * 用户信息 |
| | | */ |
| | | private TTenantResp user; |
| | | private TAppUserResp user; |
| | | |
| | | |
| | | public LoginUserApplet() |
| | | { |
| | | } |
| | | |
| | | public LoginUserApplet(TTenantResp user, Set<String> permissions) |
| | | public LoginUserApplet(TAppUserResp user, Set<String> permissions) |
| | | { |
| | | this.user = user; |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public LoginUserApplet(String userId, Long deptId, TTenantResp user, Set<String> permissions) |
| | | public LoginUserApplet(String userId, Long deptId, TAppUserResp user, Set<String> permissions) |
| | | { |
| | | this.userId = userId; |
| | | this.deptId = deptId; |
| | |
| | | @Override |
| | | public String getUsername() |
| | | { |
| | | return user.getResidentName(); |
| | | return user.getNickName(); |
| | | } |
| | | |
| | | /** |
| | |
| | | .authorizeRequests() |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | .antMatchers("/getPrivacyAgreement/{agreementType}", |
| | | "/applet/queryProtocolConfigByType","/applet/login", |
| | | "/applet/queryProtocolConfigByType","/api/loginApp", |
| | | "/api/login","/applet/queryProtocolConfigByType", |
| | | "/register","/applet/getCode","/applet/loginCode", |
| | | "/applet/changepwd", "/captchaImage","/getCode","/loginCode", |
| | |
| | | package com.ruoyi.framework.web.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.UserStatus; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TAppUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | } |
| | | try |
| | | { |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); |
| | | String userName = username + "_1"; |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userName, password); |
| | | AuthenticationContextHolder.setContext(authenticationToken); |
| | | // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername |
| | | authentication = authenticationManager.authenticate(authenticationToken); |
| | |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | LoginUser loginUser = (LoginUser) authentication.getPrincipal(); |
| | | recordLoginInfo(loginUser.getUserId()); |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | | |
| | | /** |
| | | * 登录验证 |
| | | * |
| | | * @param account 用户名 |
| | | * @param password 密码 |
| | | * @return 结果 |
| | | */ |
| | | public LoginUserApplet loginCodeApplet(String account, String password) |
| | | { |
| | | // 登录前置校验 |
| | | if (StringUtils.isEmpty(account)){ |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(account, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); |
| | | throw new UserNotExistsException(); |
| | | } |
| | | // 用户验证 |
| | | Authentication authentication = null; |
| | | // 用户验证 |
| | | TAppUser appUser = appUserService.getOne(Wrappers.<TAppUser>lambdaQuery().eq(TAppUser::getAccount,account)); |
| | | if (StringUtils.isNull(appUser)){ |
| | | log.info("登录用户:{} 不存在.", account); |
| | | throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | } else if (appUser.getDisabled()) { |
| | | log.info("登录用户:{} 已被删除.", account); |
| | | throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | } else if (2 == appUser.getStatus()) { |
| | | log.info("登录用户:{} 已被停用.", account); |
| | | throw new ServiceException(MessageUtils.message("user.blocked")); |
| | | } |
| | | try |
| | | { |
| | | String userName = account + "_2"; |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userName, password); |
| | | AuthenticationContextHolder.setContext(authenticationToken); |
| | | // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername |
| | | authentication = authenticationManager.authenticate(authenticationToken); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (e instanceof BadCredentialsException) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(account, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | else |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(account, Constants.LOGIN_FAIL, e.getMessage())); |
| | | throw new ServiceException(e.getMessage()); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | AuthenticationContextHolder.clearContext(); |
| | | } |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(account, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | LoginUserApplet loginUser = (LoginUserApplet) authentication.getPrincipal(); |
| | | recordAppLoginInfo(loginUser.getUserId()); |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | |
| | | sysUser.setLoginDate(DateUtils.getNowDate()); |
| | | userService.updateUserProfile(sysUser); |
| | | } |
| | | /** |
| | | * 记录登录信息 |
| | | * |
| | | * @param userId 用户ID |
| | | */ |
| | | public void recordAppLoginInfo(String userId) |
| | | { |
| | | TAppUser appUser = new TAppUser(); |
| | | appUser.setId(userId); |
| | | // sysUser.setLoginIp(IpUtils.getIpAddr()); |
| | | // sysUser.setLoginDate(DateUtils.getNowDate()); |
| | | // userService.updateUserProfile(sysUser); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.framework.web.service; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 登录密码方法 |
| | |
| | | clearLoginRecordCache(username); |
| | | } |
| | | } |
| | | public void validateApp(TAppUser user) |
| | | { |
| | | Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext(); |
| | | String username = usernamePasswordAuthenticationToken.getName(); |
| | | String password = usernamePasswordAuthenticationToken.getCredentials().toString(); |
| | | |
| | | Integer retryCount = redisCache.getCacheObject(getCacheKey(username)); |
| | | |
| | | if (retryCount == null) |
| | | { |
| | | retryCount = 0; |
| | | } |
| | | |
| | | if (retryCount >= Integer.valueOf(maxRetryCount).intValue()) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, |
| | | MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount, lockTime))); |
| | | throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime); |
| | | } |
| | | |
| | | if (!matchesApp(user, password)) |
| | | { |
| | | retryCount = retryCount + 1; |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, |
| | | MessageUtils.message("user.password.retry.limit.count", retryCount))); |
| | | redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | else |
| | | { |
| | | clearLoginRecordCache(username); |
| | | } |
| | | } |
| | | |
| | | public boolean matches(SysUser user, String rawPassword) |
| | | { |
| | | return SecurityUtils.matchesPassword(rawPassword, user.getPassword()); |
| | | } |
| | | public boolean matchesApp(TAppUser user, String rawPassword) |
| | | { |
| | | return SecurityUtils.matchesPassword(rawPassword, user.getPassword()); |
| | | } |
| | | |
| | | public void clearLoginRecordCache(String loginName) |
| | | { |
| | |
| | | package com.ruoyi.framework.web.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.entity.TAppUserResp; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import com.ruoyi.common.enums.UserStatus; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TAppUserService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import org.springframework.security.core.userdetails.UserDetailsService; |
| | | import org.springframework.security.core.userdetails.UsernameNotFoundException; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.UserStatus; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * 用户验证处理 |
| | |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | |
| | | @Override |
| | | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException |
| | | { |
| | | String[] split = username.split("_"); |
| | | username = split[0]; |
| | | String type = split[1]; |
| | | if("1".equals(type)){ |
| | | SysUser user = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(user)) |
| | | { |
| | |
| | | passwordService.validate(user); |
| | | |
| | | return createLoginUser(user); |
| | | }else { |
| | | TAppUser user = appUserService.getOne(Wrappers.<TAppUser>lambdaQuery().eq(TAppUser::getAccount,username)); |
| | | if (StringUtils.isNull(user)) |
| | | { |
| | | log.info("登录用户:{} 不存在.", username); |
| | | throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | } |
| | | else if (user.getDisabled()) |
| | | { |
| | | log.info("登录用户:{} 已被删除.", username); |
| | | throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | } |
| | | else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
| | | { |
| | | log.info("登录用户:{} 已被停用.", username); |
| | | throw new ServiceException(MessageUtils.message("user.blocked")); |
| | | } |
| | | passwordService.validateApp(user); |
| | | |
| | | TAppUserResp appUserResp = new TAppUserResp(); |
| | | BeanUtils.copyProperties(user,appUserResp); |
| | | |
| | | return createLoginUserApp(appUserResp); |
| | | } |
| | | } |
| | | |
| | | public UserDetails createLoginUser(SysUser user) |
| | | { |
| | | return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user)); |
| | | } |
| | | public UserDetails createLoginUserApp(TAppUserResp user) |
| | | { |
| | | return new LoginUserApplet(user.getId(), null, user, null); |
| | | } |
| | | } |
| | |
| | | @TableField("team_id") |
| | | private String teamId; |
| | | |
| | | @ApiModelProperty(value = "状态 1=启用 0=禁用") |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | |
| | | @TableField("other_count") |
| | | private Integer otherCount; |
| | | |
| | | @ApiModelProperty(value = "审核状态 0=待审核 1=通过 2=拒绝") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | |
| | | } |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="ifBlack" column="ifBlack" /> |
| | | <result property="districtId" column="districtId" /> |
| | | <result property="roleType" column="role_type" /> |
| | | <result property="signPicture" column="sign_picture" /> |
| | | <result property="allocateIp" column="allocateIp" /> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password,u.sign_picture AS signPicture, |
| | | u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.role_type,u.allocateIp, |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, |
| | | u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | <select id="selectUserById" parameterType="Long" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, |
| | | u.districtId AS districtId,u.sign_picture AS signPicture, |
| | | u.role_type AS roleType,u.allocateIp AS allocateIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark, |
| | | ur.role_id AS roleId,sr.role_name AS roleName,u.deptName as deptName |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | <select id="selectList" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark |
| | | from sys_user u |
| | | WHERE u.del_flag = 0 |
| | | </select> |
| | |
| | | <select id="selectListByNamePhone" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark |
| | | from sys_user u |
| | | WHERE u.del_flag = 0 |
| | | <if test="name != null and name != ''"> |
| | |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, |
| | | u.avatar AS avatar,u.disable_remark AS disableRemark,u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, |
| | | u.del_flag AS delFlag, u.login_ip AS loginIp,u.operating_time AS operatingTime,u.operating_person AS operatingPerson, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, |
| | | u.districtId AS districtId,u.role_type AS roleType,u.allocateIp AS allocateIp,r.role_id AS roleId, r.role_name AS roleName, |
| | | r.role_key AS roleKey, r.role_sort AS roleSort, r.data_scope AS dataScope, r.status as role_status,u.deptName as deptName |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,r.role_id AS roleId, r.role_name AS roleName, |
| | | r.role_key AS roleKey, r.role_sort AS roleSort, r.data_scope AS dataScope, r.status as role_status |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | |
| | | <select id="listByRole" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, |
| | | u.districtId AS districtId, u.role_type AS roleType,r.role_id AS roleId |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,r.role_id AS roleId |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | |
| | | <select id="selectListByNameAndUserIds" resultType="com.ruoyi.common.core.domain.entity.SysUser"> |
| | | select u.user_id AS userId, u.dept_id AS deptId, u.user_name AS userName, u.nick_name AS nickName, u.email AS email, u.avatar AS avatar, |
| | | u.phonenumber AS phonenumber, u.sex AS sex, u.status AS status, u.del_flag AS delFlag, u.login_ip AS loginIp, |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark,u.ifBlack AS ifBlack, u.districtId AS districtId |
| | | u.login_date AS loginDate, u.create_by AS createBy, u.create_time AS createTime, u.remark AS remark |
| | | from sys_user u |
| | | WHERE u.del_flag = 0 |
| | | <if test="userIds != null and userIds.size()>0"> |
| | |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="ifBlack != null">ifBlack,</if> |
| | | <if test="districtId != null">districtId,</if> |
| | | <if test="roleType != null">role_type,</if> |
| | | <if test="allocateIp != null">allocateIp,</if> |
| | | <if test="userIdentification != null and userIdentification != ''">userIdentification,</if> |
| | | create_time |
| | | )values( |
| | |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="ifBlack != null">#{ifBlack},</if> |
| | | <if test="districtId != null">#{districtId},</if> |
| | | <if test="roleType != null">#{roleType},</if> |
| | | <if test="allocateIp != null">#{allocateIp},</if> |
| | | <if test="userIdentification != null and userIdentification != ''">#{userIdentification},</if> |
| | | sysdate() |
| | | ) |
| | |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="ifBlack != null">ifBlack = #{ifBlack},</if> |
| | | <if test="districtId != null">districtId = #{districtId},</if> |
| | | <if test="disableRemark != null">disable_remark = #{disableRemark},</if> |
| | | <if test="operatingTime != null">operating_time = #{operatingTime},</if> |
| | | <if test="operatingPerson != null">operating_person = #{operatingPerson},</if> |
| | | <if test="roleType != null">role_type = #{roleType},</if> |
| | | <if test="allocateIp != null">allocateIp = #{allocateIp},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |