|  |  | 
 |  |  | import com.dy.common.webUtil.BaseResponse; | 
 |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
 |  |  | import com.dy.common.webUtil.QueryResultVo; | 
 |  |  | import com.dy.pmsGlobal.aop.Log; | 
 |  |  | import com.dy.pmsGlobal.pojoBa.BaRole; | 
 |  |  | import com.dy.pmsGlobal.pojoBa.BaUser; | 
 |  |  | import com.dy.pmsGlobal.util.Constant; | 
 |  |  | import com.mysql.cj.util.StringUtils; | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     //@SsoAop() //只有登录验证,没有权限验证 | 
 |  |  |     @SsoPowerAop(power = "10100010") //登录与权限同时验证 | 
 |  |  |     @SsoPowerAop(power = "10100000") //登录与权限同时验证 | 
 |  |  |     @Log("查询用户") | 
 |  |  |     public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody QueryVo vo) { | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo); | 
 |  |  | 
 |  |  |     //@GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)//指前端向后传的参数类型 | 
 |  |  |     @GetMapping(path = "one") | 
 |  |  |     //@SsoAop() //只有登录验证,没有权限验证 | 
 |  |  |     @SsoPowerAop(power = "10100010") //登录与权限同时验证 | 
 |  |  |     @SsoPowerAop(power = "10100000") //登录与权限同时验证 | 
 |  |  |     @Log("查询单个用户") | 
 |  |  |     public BaseResponse<BaUser> one(String id) { | 
 |  |  |         try { | 
 |  |  |             return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id))); | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     //@SsoAop() //只有登录验证,没有权限验证 | 
 |  |  |     @SsoPowerAop(power = "10100011") //登录与权限同时验证 | 
 |  |  |     @SsoPowerAop(power = "10100001") //登录与权限同时验证 | 
 |  |  |     @Log("保存用户信息") | 
 |  |  |     public BaseResponse<Boolean> save(@RequestBody @Valid BaUser po, BindingResult bindingResult) { | 
 |  |  |         if (bindingResult != null && bindingResult.hasErrors()) { | 
 |  |  |             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
 |  |  | 
 |  |  |         Long id; | 
 |  |  |         try { | 
 |  |  |             po.supperAdmin = Constant.no.byteValue() ; | 
 |  |  |             po.disabled = false ;//默认不禁用 | 
 |  |  | //            po.disabled = false ;//默认不禁用 | 
 |  |  |             po.deleted = false;//默认不删除 | 
 |  |  |             if (!StringUtils.isNullOrEmpty(po.password)) { | 
 |  |  |                 /* | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     //@SsoAop() //只有登录验证,没有权限验证 | 
 |  |  |     @SsoPowerAop(power = "10100011") //登录与权限同时验证 | 
 |  |  |     @SsoPowerAop(power = "10100001") //登录与权限同时验证 | 
 |  |  |     @Log("更新用户信息") | 
 |  |  |     public BaseResponse<Boolean> update(@RequestBody @Validated BaUser po, BindingResult bindingResult) { | 
 |  |  |         int count; | 
 |  |  |         try { | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 禁用或启用用户信息 | 
 |  |  |      * @param po | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path="disabled") | 
 |  |  |     @SsoPowerAop(power = "10100001") | 
 |  |  |     @Log("禁用或启用用户信息") | 
 |  |  |     public BaseResponse<BaRole> disabled(@RequestBody BaUser po){ | 
 |  |  |         try { | 
 |  |  |             return BaseResponseUtils.buildSuccess(sv.disabled(po.id,po.disabled)); | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             log.error("禁用或启用用户信息异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 删除用户信息 | 
 |  |  |      * @param id | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping(path = "delete") | 
 |  |  |     @SsoPowerAop(power = "10100001") //登录与权限同时验证 | 
 |  |  |     @Log("删除用户") | 
 |  |  |     public BaseResponse<Boolean> delete(Long id) { | 
 |  |  |         int count; | 
 |  |  |         try { | 
 |  |  |             BaUser po = new BaUser(); | 
 |  |  |             po.id = id; | 
 |  |  |             po.deleted = true; | 
 |  |  |             count = this.sv.update(po); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("删除用户异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |         if (count <= 0) { | 
 |  |  |             return BaseResponseUtils.buildFail("数据库存储失败"); | 
 |  |  |         } else { | 
 |  |  |             return BaseResponseUtils.buildSuccess(true); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 修改密码 | 
 |  |  |      * @param id 用户ID | 
 |  |  |      * @return 是否成功 | 
 |  |  | 
 |  |  |     //@GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE) | 
 |  |  |     @GetMapping(path = "changePassword") | 
 |  |  |     @SsoAop() | 
 |  |  |     @Log("修改密码") | 
 |  |  |     public BaseResponse<Boolean> changePassword(String id, String oldPassword, String newPassword) { | 
 |  |  |         int count; | 
 |  |  |         try { | 
 |  |  | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("保存用户异常", e); | 
 |  |  |             log.error("修改密码异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |         if (count <= 0) { | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     //@SsoAop() //只有登录验证,没有权限验证 | 
 |  |  |     @SsoPowerAop(power = "10100011") //登录与权限同时验证 | 
 |  |  |     @SsoPowerAop(power = "10100001") //登录与权限同时验证 | 
 |  |  |     @Log("重置密码") | 
 |  |  |     public BaseResponse<Boolean> resetPassword(@RequestBody @Validated ResetPasswordVo vo, BindingResult bindingResult) { | 
 |  |  |         int count; | 
 |  |  |         try { |