|  |  | 
 |  |  | import com.dy.pipIrrBase.result.SystemResultCode; | 
 |  |  | import com.dy.pipIrrGlobal.pojoBa.BaUser; | 
 |  |  | import com.dy.pipIrrGlobal.util.Constant; | 
 |  |  | import com.dy.pipIrrGlobal.voBa.VoSimpleUser; | 
 |  |  | import com.dy.pipIrrGlobal.voBa.VoUserInfo; | 
 |  |  | import com.mysql.cj.util.StringUtils; | 
 |  |  | import io.swagger.v3.oas.annotations.Operation; | 
 |  |  | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoUserInfo>>> some(QueryVo vo) { | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoUserInfo>> res = this.sv.selectSome(vo); | 
 |  |  |             if(res.itemTotal == 0) { | 
 |  |  |                 return BaseResponseUtils.buildFail(SystemResultCode.THE_USER_NOT_EXIST.getMessage()); | 
 |  |  |             }else { | 
 |  |  | //            if(res.itemTotal == 0) { | 
 |  |  | //                return BaseResponseUtils.buildSuccess(SystemResultCode.THE_USER_NOT_EXIST.getMessage()); | 
 |  |  | //            }else { | 
 |  |  |                 return BaseResponseUtils.buildSuccess(res); | 
 |  |  |             } | 
 |  |  | //            } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         } catch (Exception e) { | 
 |  |  | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<Boolean> changePassword(String id, String oldPassword, String newPassword) throws Exception { | 
 |  |  |         if (id == null) { | 
 |  |  |             return BaseResponseUtils.buildFail("id不能为空"); | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("id不能为空"); | 
 |  |  |         } | 
 |  |  |         if (StringUtils.isNullOrEmpty(oldPassword)) { | 
 |  |  |             return BaseResponseUtils.buildFail("旧密码不能为空"); | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("旧密码不能为空"); | 
 |  |  |         } | 
 |  |  |         if (StringUtils.isNullOrEmpty(newPassword)) { | 
 |  |  |             return BaseResponseUtils.buildFail("新密码不能为空"); | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("新密码不能为空"); | 
 |  |  |         } | 
 |  |  |         /* | 
 |  |  |         如果前端进行了base64加密 | 
 |  |  | 
 |  |  |         try { | 
 |  |  |             BaUser po = this.sv.selectById(idLg); | 
 |  |  |             if (Objects.isNull(po)) { | 
 |  |  |                 return BaseResponseUtils.buildFail("未得到用户,请求失败"); | 
 |  |  |                 return BaseResponseUtils.buildErrorMsg("未得到用户,请求失败"); | 
 |  |  |             } else { | 
 |  |  |                 if (!po.password.equalsIgnoreCase(oldPassword)) { | 
 |  |  |                     return BaseResponseUtils.buildFail("旧密码不正确,请求失败"); | 
 |  |  |                     return BaseResponseUtils.buildErrorMsg("旧密码不正确,请求失败"); | 
 |  |  |                 } else { | 
 |  |  |                     count = this.sv.changePassword(idLg, newPassword); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |         if (count <= 0) { | 
 |  |  |             return BaseResponseUtils.buildFail("数据库存储失败"); | 
 |  |  |             return BaseResponseUtils.buildErrorMsg("数据库存储失败"); | 
 |  |  |         } else { | 
 |  |  |             return BaseResponseUtils.buildSuccess(true); | 
 |  |  |         } | 
 |  |  | 
 |  |  |                             schema = @Schema(implementation = Boolean.class))} | 
 |  |  |             ) | 
 |  |  |     }) | 
 |  |  |     @PostMapping(path = "resetPassword") | 
 |  |  |     @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE) | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<Boolean> resetPassword(String id) throws Exception { | 
 |  |  |         if (id == null || id == "") { | 
 |  |  |     public BaseResponse<Boolean> resetPassword(@RequestBody ResetPasswordVo vo) throws Exception { | 
 |  |  |         if (vo.id == null || vo.id == "") { | 
 |  |  |             return BaseResponseUtils.buildFail("id不能为空"); | 
 |  |  |         } | 
 |  |  |         Long idLg = Long.parseLong(id); | 
 |  |  |         Long idLg = Long.parseLong(vo.id); | 
 |  |  |         int count; | 
 |  |  |         try { | 
 |  |  |             BaUser po = this.sv.selectById(idLg); | 
 |  |  | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取简单用户数据列表,数据列表查询条件中使用 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping(path = "simple_users") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<List<VoSimpleUser>> getSimpleUsers(){ | 
 |  |  |         try { | 
 |  |  |             return BaseResponseUtils.buildSuccess(sv.getSimpleUsers()); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("查询简单用户信息异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |