liuxm
2024-05-06 2661ce7da0b5544d5574cfad50cba9a9a643254c
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java
@@ -7,6 +7,7 @@
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;
@@ -166,6 +167,49 @@
    }
    /**
     * 禁用或启用用户信息
     * @param po
     * @return
     */
    @PostMapping(path="disabled")
    @SsoPowerAop(power = "10100011")
    @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 = "10100011") //登录与权限同时验证
    @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 是否成功
@@ -207,7 +251,7 @@
                }
            }
        } catch (Exception e) {
            log.error("保存用户异常", e);
            log.error("修改密码异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        if (count <= 0) {