47个文件已修改
95个文件已删除
150个文件已添加
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_agent_application") |
| | | @ApiModel(value="AgentApplication对象", description="") |
| | | public class AgentApplication implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "申请类型 对应vip_id") |
| | | @TableField("application_vip_id") |
| | | private Integer applicationVipId; |
| | | |
| | | @ApiModelProperty(value = "申请时间") |
| | | @TableField("application_time") |
| | | private LocalDateTime applicationTime; |
| | | |
| | | @ApiModelProperty(value = "1'待处理',2'已处理-同意',3'已处理-拒绝'") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "用户当前消费积分") |
| | | @TableField("shop_point") |
| | | private BigDecimal shopPoint; |
| | | |
| | | @ApiModelProperty(value = "用户当前分佣积分") |
| | | @TableField("share_point") |
| | | private BigDecimal sharePoint; |
| | | |
| | | @ApiModelProperty(value = "直推用户已达钻石会员数") |
| | | @TableField("direct_vip_num") |
| | | private Integer directVipNum; |
| | | |
| | | @ApiModelProperty(value = "直推用户已成为代理数") |
| | | @TableField("direct_agent_num") |
| | | private Integer directAgentNum; |
| | | |
| | | @ApiModelProperty(value = "已绑定门店数") |
| | | @TableField("bind_shop_num") |
| | | private Integer bindShopNum; |
| | | |
| | | @ApiModelProperty(value = "处理意见") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 用户 |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/21 9:25 |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_app_user") |
| | | public class AppUser { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | @ApiModel(value="AppUser对象", description="") |
| | | public class AppUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Long id; |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "用户") |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 头像 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | @TableField("avatar") |
| | | private String avatar; |
| | | /** |
| | | * 会员id |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | /** |
| | | * 微信openid |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "微信openid") |
| | | @TableField("wx_openid") |
| | | private String wxOpenid; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=注销) |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "支付宝openid") |
| | | @TableField("ali_openid") |
| | | private String aliOpenid; |
| | | |
| | | @ApiModelProperty(value = "状态(1=正常,2=冻结,3=注销)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * 删除(0=否,1=是) |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | /** |
| | | * 0否1是第一次添加 |
| | | */ |
| | | @TableLogic |
| | | private Boolean delFlag; |
| | | |
| | | @ApiModelProperty(value = "0否1是第一次添加") |
| | | @TableField("first_add") |
| | | private Integer firstAdd; |
| | | /** |
| | | * 最后一次登录时间 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "最后一次登录时间") |
| | | @TableField("last_login_time") |
| | | private LocalDateTime lastLoginTime; |
| | | /** |
| | | * 推广人id |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "推广人id") |
| | | @TableField("invite_user_id") |
| | | private Long inviteUserId; |
| | | /** |
| | | * 拥有门店id |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "拥有门店id") |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | /** |
| | | * 合伙人积分数 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "合伙人积分数") |
| | | @TableField("part_point") |
| | | private Integer partPoint; |
| | | /** |
| | | * 合伙人培育积分数 |
| | | */ |
| | | private BigDecimal partPoint; |
| | | |
| | | @ApiModelProperty(value = "合伙人培育积分数") |
| | | @TableField("part_grow_point") |
| | | private Integer partGrowPoint; |
| | | /** |
| | | * 消费积分数 |
| | | */ |
| | | private BigDecimal partGrowPoint; |
| | | |
| | | @ApiModelProperty(value = "消费积分数") |
| | | @TableField("shop_point") |
| | | private Integer shopPoint; |
| | | /** |
| | | * 返佣积分数 |
| | | */ |
| | | private BigDecimal shopPoint; |
| | | |
| | | @ApiModelProperty(value = "返佣积分数") |
| | | @TableField("share_point") |
| | | private Integer sharePoint; |
| | | /** |
| | | * 消费总金额 |
| | | */ |
| | | private BigDecimal sharePoint; |
| | | |
| | | @ApiModelProperty(value = "消费总金额") |
| | | @TableField("shop_amount") |
| | | private BigDecimal shopAmount; |
| | | /** |
| | | * 最后消费时间 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "最后消费时间") |
| | | @TableField("last_shop_time") |
| | | private LocalDateTime lastShopTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_address") |
| | | @ApiModel(value="UserAddress对象", description="") |
| | | public class UserAddress implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "收件人姓名") |
| | | @TableField("recieve_name") |
| | | private String recieveName; |
| | | |
| | | @ApiModelProperty(value = "收件人电话") |
| | | @TableField("recieve_phone") |
| | | private String recievePhone; |
| | | |
| | | @ApiModelProperty(value = "收件人地址") |
| | | @TableField("recieve_address") |
| | | private String recieveAddress; |
| | | |
| | | @ApiModelProperty(value = "是否默认1是0否") |
| | | @TableField("is_default") |
| | | private Integer isDefault; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_cancellation_log") |
| | | @ApiModel(value="UserCancellationLog对象", description="") |
| | | public class UserCancellationLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "会员等级") |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_change_log") |
| | | @ApiModel(value="UserChangeLog对象", description="") |
| | | public class UserChangeLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "变更前等级") |
| | | @TableField("before_vip_id") |
| | | private Integer beforeVipId; |
| | | |
| | | @ApiModelProperty(value = "变更后等级") |
| | | @TableField("after_vip_id") |
| | | private Integer afterVipId; |
| | | |
| | | @ApiModelProperty(value = "变更类型") |
| | | @TableField("change_type") |
| | | private Integer changeType; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_click_log") |
| | | @ApiModel(value="UserClickLog对象", description="") |
| | | public class UserClickLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "会员等级") |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_coupon") |
| | | @ApiModel(value="UserCoupon对象", description="") |
| | | public class UserCoupon implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "使用时间") |
| | | @TableField("use_time") |
| | | private LocalDateTime useTime; |
| | | |
| | | @ApiModelProperty(value = "优惠劵id") |
| | | @TableField("coupon_id") |
| | | private Integer couponId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_point") |
| | | @ApiModel(value="UserPoint对象", description="") |
| | | public class UserPoint implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 10 =注册积分)") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "历史余额") |
| | | @TableField("historical_point") |
| | | private BigDecimal historicalPoint; |
| | | |
| | | @ApiModelProperty(value = "变动金额") |
| | | @TableField("variable_point") |
| | | private BigDecimal variablePoint; |
| | | |
| | | @ApiModelProperty(value = "变动时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "变动用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "关联对象id") |
| | | @TableField("object_id") |
| | | private Long objectId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_user_sign_record") |
| | | @ApiModel(value="UserSignRecord对象", description="") |
| | | public class UserSignRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "签到时间") |
| | | @TableField("sign_day") |
| | | private LocalDate signDay; |
| | | |
| | | @ApiModelProperty(value = "红包金额") |
| | | @TableField("red_amount") |
| | | private BigDecimal redAmount; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_withdrawal_requests") |
| | | @ApiModel(value="WithdrawalRequests对象", description="") |
| | | public class WithdrawalRequests implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "提现金额") |
| | | @TableField("withdrawal_amount") |
| | | private BigDecimal withdrawalAmount; |
| | | |
| | | @ApiModelProperty(value = "1微信2银行卡") |
| | | @TableField("withdrawal_method") |
| | | private Integer withdrawalMethod; |
| | | |
| | | @ApiModelProperty(value = "开户人") |
| | | @TableField("account_holder") |
| | | private String accountHolder; |
| | | |
| | | @ApiModelProperty(value = "银行卡号") |
| | | @TableField("bank_card_number") |
| | | private String bankCardNumber; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1'待审核',2'审核通过',3'审核拒绝' ") |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order") |
| | | @ApiModel(value="Order对象", description="") |
| | | public class Order implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "订单类型1服务单2商品") |
| | | @TableField("order_type") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty(value = "1待发货2待收货3待使用4已完成5已取消6已退款7售后中") |
| | | @TableField("order_status") |
| | | private Integer orderStatus; |
| | | |
| | | @ApiModelProperty(value = "核销时间") |
| | | @TableField("end_time") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "技师id") |
| | | @TableField("technician_id") |
| | | private Integer technicianId; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | @TableField("order_number") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty(value = "订单总金额") |
| | | @TableField("total_amount") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty(value = "实际支付价格") |
| | | @TableField("payment_amount") |
| | | private BigDecimal paymentAmount; |
| | | |
| | | @ApiModelProperty(value = "使用积分") |
| | | @TableField("point") |
| | | private BigDecimal point; |
| | | |
| | | @ApiModelProperty(value = "1wx2积分") |
| | | @TableField("pay_method") |
| | | private Integer payMethod; |
| | | |
| | | @ApiModelProperty(value = "使用的优惠劵json") |
| | | @TableField("coupon_json") |
| | | private String couponJson; |
| | | |
| | | @ApiModelProperty(value = "运费") |
| | | @TableField("express_amount") |
| | | private BigDecimal expressAmount; |
| | | |
| | | @ApiModelProperty(value = "第三方快递信息") |
| | | @TableField("express_json") |
| | | private String expressJson; |
| | | |
| | | @ApiModelProperty(value = "平台分佣") |
| | | @TableField("share_amount") |
| | | private BigDecimal shareAmount; |
| | | |
| | | @ApiModelProperty(value = "本单获取的积分") |
| | | @TableField("get_point") |
| | | private BigDecimal getPoint; |
| | | |
| | | @ApiModelProperty(value = "微信支付号") |
| | | @TableField("serial_number") |
| | | private String serialNumber; |
| | | |
| | | @ApiModelProperty(value = "1待支付2已支付") |
| | | @TableField("pay_status") |
| | | private Integer payStatus; |
| | | |
| | | @ApiModelProperty(value = "对应门店id") |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_order_good") |
| | | @ApiModel(value="OrderGood对象", description="") |
| | | public class OrderGood implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | |
| | | @ApiModelProperty(value = "购买商品的json快照") |
| | | @TableField("good_json") |
| | | private String goodJson; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | @TableField("num") |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_refund_pass") |
| | | @ApiModel(value="RefundPass对象", description="") |
| | | public class RefundPass implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField("order_id") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty(value = "1待审核2已完成3已拒绝4待退货5待平台收货") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "1退货退款2仅退款") |
| | | @TableField("refund_method") |
| | | private Integer refundMethod; |
| | | |
| | | @ApiModelProperty(value = "用户申请原因") |
| | | @TableField("refund_reason") |
| | | private String refundReason; |
| | | |
| | | @ApiModelProperty(value = "用户申请备注") |
| | | @TableField("user_remark") |
| | | private String userRemark; |
| | | |
| | | @ApiModelProperty(value = "申请图片") |
| | | @TableField("pics") |
| | | private String pics; |
| | | |
| | | @ApiModelProperty(value = "1待审核2同意3拒绝") |
| | | @TableField("pass_status") |
| | | private Integer passStatus; |
| | | |
| | | @ApiModelProperty(value = "后台审核备注") |
| | | @TableField("pass_remark") |
| | | private String passRemark; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("gen_table") |
| | | @ApiModel(value="GenTable对象", description="") |
| | | public class GenTable implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableId(value = "table_id", type = IdType.AUTO) |
| | | private Long tableId; |
| | | |
| | | @ApiModelProperty(value = "表名称") |
| | | @TableField("table_name") |
| | | private String tableName; |
| | | |
| | | @ApiModelProperty(value = "表描述") |
| | | @TableField("table_comment") |
| | | private String tableComment; |
| | | |
| | | @ApiModelProperty(value = "关联子表的表名") |
| | | @TableField("sub_table_name") |
| | | private String subTableName; |
| | | |
| | | @ApiModelProperty(value = "子表关联的外键名") |
| | | @TableField("sub_table_fk_name") |
| | | private String subTableFkName; |
| | | |
| | | @ApiModelProperty(value = "实体类名称") |
| | | @TableField("class_name") |
| | | private String className; |
| | | |
| | | @ApiModelProperty(value = "使用的模板(crud单表操作 tree树表操作)") |
| | | @TableField("tpl_category") |
| | | private String tplCategory; |
| | | |
| | | @ApiModelProperty(value = "生成包路径") |
| | | @TableField("package_name") |
| | | private String packageName; |
| | | |
| | | @ApiModelProperty(value = "生成模块名") |
| | | @TableField("module_name") |
| | | private String moduleName; |
| | | |
| | | @ApiModelProperty(value = "生成业务名") |
| | | @TableField("business_name") |
| | | private String businessName; |
| | | |
| | | @ApiModelProperty(value = "生成功能名") |
| | | @TableField("function_name") |
| | | private String functionName; |
| | | |
| | | @ApiModelProperty(value = "生成功能作者") |
| | | @TableField("function_author") |
| | | private String functionAuthor; |
| | | |
| | | @ApiModelProperty(value = "生成代码方式(0zip压缩包 1自定义路径)") |
| | | @TableField("gen_type") |
| | | private String genType; |
| | | |
| | | @ApiModelProperty(value = "生成路径(不填默认项目路径)") |
| | | @TableField("gen_path") |
| | | private String genPath; |
| | | |
| | | @ApiModelProperty(value = "其它生成选项") |
| | | @TableField("options") |
| | | private String options; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("gen_table_column") |
| | | @ApiModel(value="GenTableColumn对象", description="") |
| | | public class GenTableColumn implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableId(value = "column_id", type = IdType.AUTO) |
| | | private Long columnId; |
| | | |
| | | @ApiModelProperty(value = "归属表编号") |
| | | @TableField("table_id") |
| | | private String tableId; |
| | | |
| | | @ApiModelProperty(value = "列名称") |
| | | @TableField("column_name") |
| | | private String columnName; |
| | | |
| | | @ApiModelProperty(value = "列描述") |
| | | @TableField("column_comment") |
| | | private String columnComment; |
| | | |
| | | @ApiModelProperty(value = "列类型") |
| | | @TableField("column_type") |
| | | private String columnType; |
| | | |
| | | @ApiModelProperty(value = "JAVA类型") |
| | | @TableField("java_type") |
| | | private String javaType; |
| | | |
| | | @ApiModelProperty(value = "JAVA字段名") |
| | | @TableField("java_field") |
| | | private String javaField; |
| | | |
| | | @ApiModelProperty(value = "是否主键(1是)") |
| | | @TableField("is_pk") |
| | | private String isPk; |
| | | |
| | | @ApiModelProperty(value = "是否自增(1是)") |
| | | @TableField("is_increment") |
| | | private String isIncrement; |
| | | |
| | | @ApiModelProperty(value = "是否必填(1是)") |
| | | @TableField("is_required") |
| | | private String isRequired; |
| | | |
| | | @ApiModelProperty(value = "是否为插入字段(1是)") |
| | | @TableField("is_insert") |
| | | private String isInsert; |
| | | |
| | | @ApiModelProperty(value = "是否编辑字段(1是)") |
| | | @TableField("is_edit") |
| | | private String isEdit; |
| | | |
| | | @ApiModelProperty(value = "是否列表字段(1是)") |
| | | @TableField("is_list") |
| | | private String isList; |
| | | |
| | | @ApiModelProperty(value = "是否查询字段(1是)") |
| | | @TableField("is_query") |
| | | private String isQuery; |
| | | |
| | | @ApiModelProperty(value = "查询方式(等于、不等于、大于、小于、范围)") |
| | | @TableField("query_type") |
| | | private String queryType; |
| | | |
| | | @ApiModelProperty(value = "显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)") |
| | | @TableField("html_type") |
| | | private String htmlType; |
| | | |
| | | @ApiModelProperty(value = "字典类型") |
| | | @TableField("dict_type") |
| | | private String dictType; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_config") |
| | | @ApiModel(value="SysConfig对象", description="") |
| | | public class SysConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "参数主键") |
| | | @TableId(value = "config_id", type = IdType.AUTO) |
| | | private Integer configId; |
| | | |
| | | @ApiModelProperty(value = "参数名称") |
| | | @TableField("config_name") |
| | | private String configName; |
| | | |
| | | @ApiModelProperty(value = "参数键名") |
| | | @TableField("config_key") |
| | | private String configKey; |
| | | |
| | | @ApiModelProperty(value = "参数键值") |
| | | @TableField("config_value") |
| | | private String configValue; |
| | | |
| | | @ApiModelProperty(value = "系统内置(Y是 N否)") |
| | | @TableField("config_type") |
| | | private String configType; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_dept") |
| | | @ApiModel(value="SysDept对象", description="") |
| | | public class SysDept implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "部门id") |
| | | @TableId(value = "dept_id", type = IdType.AUTO) |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "父部门id") |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "祖级列表") |
| | | @TableField("ancestors") |
| | | private String ancestors; |
| | | |
| | | @ApiModelProperty(value = "部门名称") |
| | | @TableField("dept_name") |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty(value = "显示顺序") |
| | | @TableField("order_num") |
| | | private Integer orderNum; |
| | | |
| | | @ApiModelProperty(value = "负责人") |
| | | @TableField("leader") |
| | | private String leader; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "邮箱") |
| | | @TableField("email") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "部门状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_dict_data") |
| | | @ApiModel(value="SysDictData对象", description="") |
| | | public class SysDictData implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "字典编码") |
| | | @TableId(value = "dict_code", type = IdType.AUTO) |
| | | private Long dictCode; |
| | | |
| | | @ApiModelProperty(value = "字典排序") |
| | | @TableField("dict_sort") |
| | | private Integer dictSort; |
| | | |
| | | @ApiModelProperty(value = "字典标签") |
| | | @TableField("dict_label") |
| | | private String dictLabel; |
| | | |
| | | @ApiModelProperty(value = "字典键值") |
| | | @TableField("dict_value") |
| | | private String dictValue; |
| | | |
| | | @ApiModelProperty(value = "字典类型") |
| | | @TableField("dict_type") |
| | | private String dictType; |
| | | |
| | | @ApiModelProperty(value = "样式属性(其他样式扩展)") |
| | | @TableField("css_class") |
| | | private String cssClass; |
| | | |
| | | @ApiModelProperty(value = "表格回显样式") |
| | | @TableField("list_class") |
| | | private String listClass; |
| | | |
| | | @ApiModelProperty(value = "是否默认(Y是 N否)") |
| | | @TableField("is_default") |
| | | private String isDefault; |
| | | |
| | | @ApiModelProperty(value = "状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_dict_type") |
| | | @ApiModel(value="SysDictType对象", description="") |
| | | public class SysDictType implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "字典主键") |
| | | @TableId(value = "dict_id", type = IdType.AUTO) |
| | | private Long dictId; |
| | | |
| | | @ApiModelProperty(value = "字典名称") |
| | | @TableField("dict_name") |
| | | private String dictName; |
| | | |
| | | @ApiModelProperty(value = "字典类型") |
| | | @TableField("dict_type") |
| | | private String dictType; |
| | | |
| | | @ApiModelProperty(value = "状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_job") |
| | | @ApiModel(value="SysJob对象", description="") |
| | | public class SysJob implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "任务ID") |
| | | @TableId(value = "job_id", type = IdType.AUTO) |
| | | private Long jobId; |
| | | |
| | | @ApiModelProperty(value = "任务名称") |
| | | @TableField("job_name") |
| | | private String jobName; |
| | | |
| | | @ApiModelProperty(value = "任务组名") |
| | | @TableField("job_group") |
| | | private String jobGroup; |
| | | |
| | | @ApiModelProperty(value = "调用目标字符串") |
| | | @TableField("invoke_target") |
| | | private String invokeTarget; |
| | | |
| | | @ApiModelProperty(value = "cron执行表达式") |
| | | @TableField("cron_expression") |
| | | private String cronExpression; |
| | | |
| | | @ApiModelProperty(value = "计划执行错误策略(1立即执行 2执行一次 3放弃执行)") |
| | | @TableField("misfire_policy") |
| | | private String misfirePolicy; |
| | | |
| | | @ApiModelProperty(value = "是否并发执行(0允许 1禁止)") |
| | | @TableField("concurrent") |
| | | private String concurrent; |
| | | |
| | | @ApiModelProperty(value = "状态(0正常 1暂停)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注信息") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_job_log") |
| | | @ApiModel(value="SysJobLog对象", description="") |
| | | public class SysJobLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "任务日志ID") |
| | | @TableId(value = "job_log_id", type = IdType.AUTO) |
| | | private Long jobLogId; |
| | | |
| | | @ApiModelProperty(value = "任务名称") |
| | | @TableField("job_name") |
| | | private String jobName; |
| | | |
| | | @ApiModelProperty(value = "任务组名") |
| | | @TableField("job_group") |
| | | private String jobGroup; |
| | | |
| | | @ApiModelProperty(value = "调用目标字符串") |
| | | @TableField("invoke_target") |
| | | private String invokeTarget; |
| | | |
| | | @ApiModelProperty(value = "日志信息") |
| | | @TableField("job_message") |
| | | private String jobMessage; |
| | | |
| | | @ApiModelProperty(value = "执行状态(0正常 1失败)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "异常信息") |
| | | @TableField("exception_info") |
| | | private String exceptionInfo; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_login_log") |
| | | @ApiModel(value="SysLoginLog对象", description="") |
| | | public class SysLoginLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "登录账号") |
| | | @TableField("username") |
| | | private String username; |
| | | |
| | | @ApiModelProperty(value = "登录IP地址") |
| | | @TableField("ip_address") |
| | | private String ipAddress; |
| | | |
| | | @ApiModelProperty(value = "登录地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "浏览器类型") |
| | | @TableField("browser_type") |
| | | private String browserType; |
| | | |
| | | @ApiModelProperty(value = "操作系统") |
| | | @TableField("operating_system") |
| | | private String operatingSystem; |
| | | |
| | | @ApiModelProperty(value = "登录时间") |
| | | @TableField("login_time") |
| | | private LocalDateTime loginTime; |
| | | |
| | | @ApiModelProperty(value = "登录状态(1=成功,2=失败)") |
| | | @TableField("login_status") |
| | | private Integer loginStatus; |
| | | |
| | | @ApiModelProperty(value = "提示消息") |
| | | @TableField("message") |
| | | private String message; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除状态(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_menu") |
| | | @ApiModel(value="SysMenu对象", description="") |
| | | public class SysMenu implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "菜单ID") |
| | | @TableId(value = "menu_id", type = IdType.AUTO) |
| | | private Long menuId; |
| | | |
| | | @ApiModelProperty(value = "菜单名称") |
| | | @TableField("menu_name") |
| | | private String menuName; |
| | | |
| | | @ApiModelProperty(value = "父菜单ID") |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "显示顺序") |
| | | @TableField("order_num") |
| | | private Integer orderNum; |
| | | |
| | | @ApiModelProperty(value = "路由地址") |
| | | @TableField("path") |
| | | private String path; |
| | | |
| | | @ApiModelProperty(value = "组件路径") |
| | | @TableField("component") |
| | | private String component; |
| | | |
| | | @ApiModelProperty(value = "路由参数") |
| | | @TableField("query") |
| | | private String query; |
| | | |
| | | @ApiModelProperty(value = "是否为外链(0是 1否)") |
| | | @TableField("is_frame") |
| | | private Integer isFrame; |
| | | |
| | | @ApiModelProperty(value = "是否缓存(0缓存 1不缓存)") |
| | | @TableField("is_cache") |
| | | private Integer isCache; |
| | | |
| | | @ApiModelProperty(value = "菜单类型(M目录 C菜单 F按钮)") |
| | | @TableField("menu_type") |
| | | private String menuType; |
| | | |
| | | @ApiModelProperty(value = "菜单状态(0显示 1隐藏)") |
| | | @TableField("visible") |
| | | private String visible; |
| | | |
| | | @ApiModelProperty(value = "菜单状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty(value = "权限标识") |
| | | @TableField("perms") |
| | | private String perms; |
| | | |
| | | @ApiModelProperty(value = "菜单图标") |
| | | @TableField("icon") |
| | | private String icon; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Blob; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_notice") |
| | | @ApiModel(value="SysNotice对象", description="") |
| | | public class SysNotice implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "公告ID") |
| | | @TableId(value = "notice_id", type = IdType.AUTO) |
| | | private Integer noticeId; |
| | | |
| | | @ApiModelProperty(value = "公告标题") |
| | | @TableField("notice_title") |
| | | private String noticeTitle; |
| | | |
| | | @ApiModelProperty(value = "公告类型(1通知 2公告)") |
| | | @TableField("notice_type") |
| | | private String noticeType; |
| | | |
| | | @ApiModelProperty(value = "公告内容") |
| | | @TableField("notice_content") |
| | | private Blob noticeContent; |
| | | |
| | | @ApiModelProperty(value = "公告状态(0正常 1关闭)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_oper_log") |
| | | @ApiModel(value="SysOperLog对象", description="") |
| | | public class SysOperLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "日志主键") |
| | | @TableId(value = "oper_id", type = IdType.AUTO) |
| | | private Long operId; |
| | | |
| | | @ApiModelProperty(value = "模块标题") |
| | | @TableField("title") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "业务类型(0其它 1新增 2修改 3删除)") |
| | | @TableField("business_type") |
| | | private Integer businessType; |
| | | |
| | | @ApiModelProperty(value = "方法名称") |
| | | @TableField("method") |
| | | private String method; |
| | | |
| | | @ApiModelProperty(value = "请求方式") |
| | | @TableField("request_method") |
| | | private String requestMethod; |
| | | |
| | | @ApiModelProperty(value = "操作类别(0其它 1后台用户 2手机端用户)") |
| | | @TableField("operator_type") |
| | | private Integer operatorType; |
| | | |
| | | @ApiModelProperty(value = "操作人员") |
| | | @TableField("oper_name") |
| | | private String operName; |
| | | |
| | | @ApiModelProperty(value = "部门名称") |
| | | @TableField("dept_name") |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty(value = "请求URL") |
| | | @TableField("oper_url") |
| | | private String operUrl; |
| | | |
| | | @ApiModelProperty(value = "主机地址") |
| | | @TableField("oper_ip") |
| | | private String operIp; |
| | | |
| | | @ApiModelProperty(value = "操作地点") |
| | | @TableField("oper_location") |
| | | private String operLocation; |
| | | |
| | | @ApiModelProperty(value = "请求参数") |
| | | @TableField("oper_param") |
| | | private String operParam; |
| | | |
| | | @ApiModelProperty(value = "返回参数") |
| | | @TableField("json_result") |
| | | private String jsonResult; |
| | | |
| | | @ApiModelProperty(value = "操作状态(0正常 1异常)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "错误消息") |
| | | @TableField("error_msg") |
| | | private String errorMsg; |
| | | |
| | | @ApiModelProperty(value = "操作时间") |
| | | @TableField("oper_time") |
| | | private LocalDateTime operTime; |
| | | |
| | | @ApiModelProperty(value = "消耗时间") |
| | | @TableField("cost_time") |
| | | private Long costTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_post") |
| | | @ApiModel(value="SysPost对象", description="") |
| | | public class SysPost implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "岗位ID") |
| | | @TableId(value = "post_id", type = IdType.AUTO) |
| | | private Long postId; |
| | | |
| | | @ApiModelProperty(value = "岗位编码") |
| | | @TableField("post_code") |
| | | private String postCode; |
| | | |
| | | @ApiModelProperty(value = "岗位名称") |
| | | @TableField("post_name") |
| | | private String postName; |
| | | |
| | | @ApiModelProperty(value = "显示顺序") |
| | | @TableField("post_sort") |
| | | private Integer postSort; |
| | | |
| | | @ApiModelProperty(value = "状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_role") |
| | | @ApiModel(value="SysRole对象", description="") |
| | | public class SysRole implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "角色ID") |
| | | @TableId(value = "role_id", type = IdType.AUTO) |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "角色名称") |
| | | @TableField("role_name") |
| | | private String roleName; |
| | | |
| | | @ApiModelProperty(value = "角色权限字符串") |
| | | @TableField("role_key") |
| | | private String roleKey; |
| | | |
| | | @ApiModelProperty(value = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)") |
| | | @TableField("data_scope") |
| | | private String dataScope; |
| | | |
| | | @ApiModelProperty(value = "角色状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_role_dept") |
| | | @ApiModel(value="SysRoleDept对象", description="") |
| | | public class SysRoleDept implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "角色ID") |
| | | @TableId("role_id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "部门ID") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_role_menu") |
| | | @ApiModel(value="SysRoleMenu对象", description="") |
| | | public class SysRoleMenu implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "角色ID") |
| | | @TableId("role_id") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value = "菜单ID") |
| | | @TableField("menu_id") |
| | | private Long menuId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_user") |
| | | @ApiModel(value="SysUser对象", description="") |
| | | public class SysUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "用户ID") |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "部门ID") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "用户账号") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "用户昵称") |
| | | @TableField("nick_name") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "用户类型(00系统用户)") |
| | | @TableField("user_type") |
| | | private String userType; |
| | | |
| | | @ApiModelProperty(value = "用户邮箱") |
| | | @TableField("email") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "手机号码") |
| | | @TableField("phonenumber") |
| | | private String phonenumber; |
| | | |
| | | @ApiModelProperty(value = "用户性别(0男 1女 2未知)") |
| | | @TableField("sex") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "头像地址") |
| | | @TableField("avatar") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | @TableField("password") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "帐号状态(0正常 1停用)") |
| | | @TableField("status") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | @ApiModelProperty(value = "最后登录IP") |
| | | @TableField("login_ip") |
| | | private String loginIp; |
| | | |
| | | @ApiModelProperty(value = "最后登录时间") |
| | | @TableField("login_date") |
| | | private LocalDateTime loginDate; |
| | | |
| | | @ApiModelProperty(value = "角色类型 1=平台 2=门店") |
| | | @TableField("roleType") |
| | | private Integer roleType; |
| | | |
| | | @ApiModelProperty(value = "密码修改时间") |
| | | @TableField("passWordUpdate") |
| | | private LocalDateTime passWordUpdate; |
| | | |
| | | @ApiModelProperty(value = "对象ID") |
| | | @TableField("objectId") |
| | | private Integer objectId; |
| | | |
| | | @ApiModelProperty(value = "创建者") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "更新者") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "禁用账户备注") |
| | | @TableField("forbidden_remark") |
| | | private String forbiddenRemark; |
| | | |
| | | @ApiModelProperty(value = "前端用户id") |
| | | @TableField("app_user_id") |
| | | private Integer appUserId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_user_post") |
| | | @ApiModel(value="SysUserPost对象", description="") |
| | | public class SysUserPost implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "用户ID") |
| | | @TableId("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "岗位ID") |
| | | @TableField("post_id") |
| | | private Long postId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("sys_user_role") |
| | | @ApiModel(value="SysUserRole对象", description="") |
| | | public class SysUserRole implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "用户ID") |
| | | @TableId("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "角色ID") |
| | | @TableField("role_id") |
| | | private Long roleId; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | package com.ruoyi.auth.service; |
| | | |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.api.feignClient.SysLoginLogClient; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/gen-table-column") |
| | | public class GenTableColumnController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/gen-table") |
| | | public class GenTableController { |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | |
| | | /** |
| | | * 参数配置 信息操作处理 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/config") |
| | | public class SysConfigController extends BaseController { |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | @RequestMapping("/sys-config") |
| | | public class SysConfigController { |
| | | |
| | | /** |
| | | * 获取参数配置列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysConfig config) { |
| | | startPage(); |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "参数管理", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysConfig config) { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | util.exportExcel(response, list, "参数数据"); |
| | | } |
| | | |
| | | /** |
| | | * 根据参数编号获取详细信息 |
| | | */ |
| | | @GetMapping(value = "/{configId}") |
| | | public AjaxResult getInfo(@PathVariable Long configId) { |
| | | return success(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据参数键名查询参数值 |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public AjaxResult getConfigKey(@PathVariable String configKey) { |
| | | return success(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | */ |
| | | @Log(title = "参数管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) { |
| | | if (!configService.checkConfigKeyUnique(config)) { |
| | | return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(configService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | */ |
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) { |
| | | if (!configService.checkConfigKeyUnique(config)) { |
| | | return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| | | } |
| | | config.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(configService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * 删除参数配置 |
| | | */ |
| | | @Log(title = "参数管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) { |
| | | configService.deleteConfigByIds(configIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新参数缓存 |
| | | */ |
| | | @Log(title = "参数管理", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() { |
| | | configService.resetConfigCache(); |
| | | return success(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | |
| | | /** |
| | | * 部门信息 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dept") |
| | | public class SysDeptController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | @RequestMapping("/sys-dept") |
| | | public class SysDeptController { |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) |
| | | { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return success(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增部门 |
| | | */ |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | dept.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 修改部门 |
| | | */ |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | { |
| | | return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己"); |
| | | } |
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) |
| | | { |
| | | return error("该部门包含未停用的子部门!"); |
| | | } |
| | | dept.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(deptService.updateDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * 删除部门 |
| | | */ |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | | { |
| | | if (deptService.hasChildByDeptId(deptId)) |
| | | { |
| | | return warn("存在下级部门,不允许删除"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) |
| | | { |
| | | return warn("部门存在用户,不允许删除"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | return toAjax(deptService.deleteDeptById(deptId)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysDictData; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dict/data") |
| | | public class SysDictDataController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | @RequestMapping("/sys-dict-data") |
| | | public class SysDictDataController { |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) |
| | | { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | util.exportExcel(response, list, "字典数据"); |
| | | } |
| | | |
| | | /** |
| | | * 查询字典数据详细 |
| | | */ |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据信息 |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @Log(title = "字典数据", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典类型 |
| | | */ |
| | | @Log(title = "字典数据", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysDictType; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dict/type") |
| | | public class SysDictTypeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | @RequestMapping("/sys-dict-type") |
| | | public class SysDictTypeController { |
| | | |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) |
| | | { |
| | | startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "字典类型", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictType dictType) |
| | | { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | util.exportExcel(response, list, "字典类型"); |
| | | } |
| | | |
| | | /** |
| | | * 查询字典类型详细 |
| | | */ |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) |
| | | { |
| | | return success(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @Log(title = "字典类型", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(dictTypeService.insertDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改字典类型 |
| | | */ |
| | | @Log(title = "字典类型", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| | | } |
| | | dict.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(dictTypeService.updateDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) |
| | | { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 刷新字典缓存 |
| | | */ |
| | | @Log(title = "字典类型", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | dictTypeService.resetDictCache(); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return success(dictTypes); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys-job") |
| | | public class SysJobController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys-job-log") |
| | | public class SysJobLogController { |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.service.ISysLoginLogService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/12 15:48 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sysLoginLog") |
| | | @RequestMapping("/sys-login-log") |
| | | public class SysLoginLogController { |
| | | |
| | | |
| | | @Resource |
| | | private ISysLoginLogService sysLoginLogService; |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @ApiOperation(value = "获取登录日志列表", tags = {"管理后台-登录日志"}) |
| | | public AjaxResult<PageInfo<SysLoginLog>> pageList(String name, BasePage basePage){ |
| | | PageInfo<SysLoginLog> pageInfo = sysLoginLogService.pageList(name, basePage); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/addLoginLog") |
| | | @ApiOperation(value = "添加登录日志", tags = {"管理后台-登录日志"}) |
| | | public AjaxResult addLoginLog(@RequestBody SysLoginLog loginLog){ |
| | | return sysLoginLogService.addLoginLog(loginLog); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加登陆日志 |
| | | * @param loginLog |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveLoginLog") |
| | | public R saveLoginLog(@RequestBody SysLoginLog loginLog){ |
| | | loginLog.setCreateTime(LocalDateTime.now()); |
| | | loginLog.setDelFlag(0); |
| | | sysLoginLogService.save(loginLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * 菜单信息 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/menu") |
| | | @Api(tags = "菜单模块") |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | @RequestMapping("/sys-menu") |
| | | public class SysMenuController { |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("所有菜单列表") |
| | | public AjaxResult list() |
| | | { |
| | | List<SysMenus> list= menuService.getAllMenu(); |
| | | return success(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据菜单编号获取详细信息 |
| | | */ |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) |
| | | { |
| | | return success(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单下拉树列表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public AjaxResult treeselect(SysMenu menu) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, userId); |
| | | ArrayList<SysMenus> sysMenus = new ArrayList<>(); |
| | | for (SysMenu sysMenu : menus) { |
| | | SysMenus sysMenus1 = new SysMenus(); |
| | | BeanUtils.copyProperties(sysMenu,sysMenus1); |
| | | sysMenus.add(sysMenus1); |
| | | } |
| | | |
| | | return success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * 加载对应角色菜单列表树 |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuList(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 新增菜单 |
| | | */ |
| | | @Log(title = "菜单管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | menu.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(menuService.insertMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 修改菜单 |
| | | */ |
| | | @Log(title = "菜单管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| | | } |
| | | else if (menu.getMenuId().equals(menu.getParentId())) |
| | | { |
| | | return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); |
| | | } |
| | | menu.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(menuService.updateMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * 删除菜单 |
| | | */ |
| | | @Log(title = "菜单管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) |
| | | { |
| | | if (menuService.hasChildByMenuId(menuId)) |
| | | { |
| | | return warn("存在子菜单,不允许删除"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) |
| | | { |
| | | return warn("菜单已分配,不允许删除"); |
| | | } |
| | | return toAjax(menuService.deleteMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取路由信息 |
| | | * |
| | | * @return 路由信息 |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * 公告 信息操作处理 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/notice") |
| | | public class SysNoticeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysNoticeService noticeService; |
| | | @RequestMapping("/sys-notice") |
| | | public class SysNoticeController { |
| | | |
| | | /** |
| | | * 获取通知公告列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) |
| | | { |
| | | startPage(); |
| | | List<SysNotice> list = noticeService.selectNoticeList(notice); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知公告编号获取详细信息 |
| | | */ |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) |
| | | { |
| | | return success(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增通知公告 |
| | | */ |
| | | @Log(title = "通知公告", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 修改通知公告 |
| | | */ |
| | | @Log(title = "通知公告", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * 删除通知公告 |
| | | */ |
| | | @Log(title = "通知公告", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) |
| | | { |
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys-oper-log") |
| | | public class SysOperLogController { |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * 岗位信息操作处理 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/post") |
| | | public class SysPostController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | @RequestMapping("/sys-post") |
| | | public class SysPostController { |
| | | |
| | | /** |
| | | * 获取岗位列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | | startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "岗位管理", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysPost post) |
| | | { |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | util.exportExcel(response, list, "岗位数据"); |
| | | } |
| | | |
| | | /** |
| | | * 根据岗位编号获取详细信息 |
| | | */ |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) |
| | | { |
| | | return success(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增岗位 |
| | | */ |
| | | @Log(title = "岗位管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(postService.insertPost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 修改岗位 |
| | | */ |
| | | @Log(title = "岗位管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| | | } |
| | | post.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(postService.updatePost(post)); |
| | | } |
| | | |
| | | /** |
| | | * 删除岗位 |
| | | */ |
| | | @Log(title = "岗位管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) |
| | | { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * 获取岗位选择框列表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return success(posts); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.domain.dto.RoleAddDto; |
| | | import com.ruoyi.system.domain.dto.RoleUpdateDto; |
| | | import com.ruoyi.system.domain.vo.RoleInfoVo; |
| | | import com.ruoyi.system.mapper.SysMenuMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 角色信息 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/role") |
| | | @Api(tags = "角色模块") |
| | | public class SysRoleController extends BaseController { |
| | | @Resource |
| | | private ISysRoleService roleService; |
| | | @RequestMapping("/sys-role") |
| | | public class SysRoleController { |
| | | |
| | | @Resource |
| | | private ISysUserService userService; |
| | | |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | | |
| | | @Resource |
| | | private SysRoleMenuMapper sysRoleMenuMapper; |
| | | |
| | | @Resource |
| | | private ISysUserRoleService sysUserRoleService; |
| | | |
| | | @Resource |
| | | private SysMenuMapper menuMapper; |
| | | |
| | | @Resource |
| | | private RoleSiteClient roleSiteClient; |
| | | |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-系统用户管理"}) |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | List<SysRole> list = roleService.list(new LambdaQueryWrapper<SysRole>().eq(SysRole::getDelFlag, 0).eq(SysRole::getStatus, 0)); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/listPage") |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-角色管理"}) |
| | | public AjaxResult listPage(String name, BasePage basePage) { |
| | | PageInfo<SysRole> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | LambdaQueryWrapper<SysRole> wrapper = new LambdaQueryWrapper<SysRole>().eq(SysRole::getStatus, 0).eq(SysRole::getDelFlag, 0); |
| | | if (StringUtils.isNotEmpty(name)) { |
| | | wrapper.like(SysRole::getRoleName, name); |
| | | } |
| | | |
| | | PageInfo<SysRole> page = roleService.page(pageInfo, wrapper.orderByDesc(SysRole::getCreateTime)); |
| | | for (SysRole record : page.getRecords()) { |
| | | List<Integer> data = roleSiteClient.getSiteIds(record.getRoleId()).getData(); |
| | | List<Site> sites = siteClient.getSiteByIds(data).getData(); |
| | | if (null != sites) { |
| | | List<String> collect = sites.stream().map(Site::getName).collect(Collectors.toList()); |
| | | record.setSiteNames(collect); |
| | | } |
| | | long count = sysUserRoleService.count(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getRoleId, record.getRoleId())); |
| | | record.setNumber(count); |
| | | } |
| | | return AjaxResult.success(page); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/roleAdd") |
| | | @ApiOperation(value = "添加角色", tags = {"管理后台-角色管理"}) |
| | | @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 |
| | | public AjaxResult roleAdd(@Validated @RequestBody RoleAddDto dto) { |
| | | SysRole role = new SysRole(); |
| | | role.setRoleName(dto.getRoleName()); |
| | | long count = roleService.count(Wrappers.lambdaQuery(SysRole.class) |
| | | .eq(SysRole::getRoleName, dto.getRoleName())); |
| | | if (count > 0) { |
| | | return AjaxResult.error("角色已存在,请重新输入"); |
| | | } |
| | | List<Long> menuIds1 = dto.getMenuIds(); |
| | | if (CollectionUtils.isEmpty(menuIds1)) { |
| | | return AjaxResult.error("菜单id不能为空"); |
| | | } |
| | | role.setMenuIds(dto.getMenuIds().toArray((new Long[dto.getMenuIds().size()]))); |
| | | // 添加角色 |
| | | role.setRemark(dto.getRemark()); |
| | | role.setCreateBy(SecurityUtils.getUsername()); |
| | | role.setCreateTime(new Date()); |
| | | roleService.insertRole(role); |
| | | //添加站点权限 |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/roleInfo") |
| | | @ApiOperation(value = "角色详情", tags = {"管理后台-角色管理"}) |
| | | public AjaxResult roleInfo(@RequestParam Long id) { |
| | | SysRole role = roleService.selectRoleById(id); |
| | | RoleInfoVo roleInfoVo = new RoleInfoVo(); |
| | | roleInfoVo.setRoleId(role.getRoleId()); |
| | | roleInfoVo.setRoleName(role.getRoleName()); |
| | | // 获取当前角色的菜单id |
| | | List<Long> menusId = sysRoleMenuMapper.selectList(new LambdaQueryWrapper<SysRoleMenu>().eq(SysRoleMenu::getRoleId, id)).stream().map(SysRoleMenu::getMenuId).collect(Collectors.toList()); |
| | | if (menusId.size() == 0) { |
| | | return AjaxResult.success(new ArrayList<>()); |
| | | } |
| | | //获取当前的权限菜单 |
| | | List<SysMenus> all = menuMapper.getAllInIds(menusId); |
| | | // 第三级 |
| | | List<SysMenus> s3 = all.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); |
| | | // 第二级 |
| | | List<SysMenus> s2 = all.stream().filter(e -> e.getMenuType().equals("C")).collect(Collectors.toList()); |
| | | // 第一级 |
| | | List<SysMenus> s1 = all.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); |
| | | |
| | | for (SysMenus menus : s2) { |
| | | List<SysMenus> collect = s3.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); |
| | | menus.setChildren(collect); |
| | | } |
| | | |
| | | for (SysMenus menus : s1) { |
| | | List<SysMenus> collect = s2.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); |
| | | menus.setChildren(collect); |
| | | } |
| | | roleInfoVo.setMenus(menusId); |
| | | roleInfoVo.setRemark(role.getRemark()); |
| | | List<Integer> siteIds = roleSiteClient.getSiteIds(role.getRoleId()).getData(); |
| | | if (null != siteIds && siteIds.size() > 0) { |
| | | List<Site> sites = siteClient.getSiteByIds(siteIds).getData(); |
| | | List<String> siteNames = sites.stream().map(Site::getName).collect(Collectors.toList()); |
| | | roleInfoVo.setSiteNames(siteNames); |
| | | roleInfoVo.setSiteIds(siteIds); |
| | | } |
| | | return AjaxResult.success(roleInfoVo); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/roleUpdate") |
| | | @ApiOperation(value = "编辑角色", tags = {"管理后台-角色管理"}) |
| | | @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 |
| | | public AjaxResult roleUpdate(@Validated @RequestBody RoleUpdateDto dto) { |
| | | SysRole role = new SysRole(); |
| | | role.setRoleName(dto.getRoleName()); |
| | | SysRole one = roleService.getOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleName, dto.getRoleName())); |
| | | if (null != one && !one.getRoleId().equals(dto.getRoleId())) { |
| | | return AjaxResult.error("角色已存在,请重新输入"); |
| | | } |
| | | role.setRemark(dto.getRemark()); |
| | | role.setUpdateBy(SecurityUtils.getUsername()); |
| | | role.setUpdateTime(new Date()); |
| | | role.setRoleId(dto.getRoleId()); |
| | | roleService.updateRole(role); |
| | | ArrayList<SysRoleMenu> sysRoleMenus = new ArrayList<>(); |
| | | List<Long> menuIds = dto.getMenuIds(); |
| | | // 移除原来的权限菜单 |
| | | if (menuIds.contains(1061L)) { |
| | | sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() |
| | | .eq(SysRoleMenu::getRoleId, dto.getRoleId())); |
| | | } else { |
| | | sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() |
| | | .eq(SysRoleMenu::getRoleId, dto.getRoleId()) |
| | | .ne(SysRoleMenu::getMenuId, 1061L) |
| | | .ne(SysRoleMenu::getMenuId, 1062L) |
| | | .ne(SysRoleMenu::getMenuId, 1065L) |
| | | .ne(SysRoleMenu::getMenuId, 1073L) |
| | | .ne(SysRoleMenu::getMenuId, 1161L) |
| | | .ne(SysRoleMenu::getMenuId, 1203L) |
| | | ); |
| | | } |
| | | for (Long menuId : menuIds) { |
| | | SysRoleMenu sysRoleMenu = new SysRoleMenu(); |
| | | sysRoleMenu.setMenuId(menuId); |
| | | sysRoleMenu.setRoleId(role.getRoleId()); |
| | | sysRoleMenus.add(sysRoleMenu); |
| | | } |
| | | sysRoleMenuMapper.batchRoleMenu(sysRoleMenus); |
| | | //删除旧站点数据 |
| | | roleSiteClient.delRoleSite(dto.getRoleId()); |
| | | //添加站点权限 |
| | | List<TRoleSite> roleSites = new ArrayList<>(); |
| | | if(null != dto.getSiteIds()){ |
| | | for (Integer siteId : dto.getSiteIds()) { |
| | | TRoleSite roleSite = new TRoleSite(); |
| | | roleSite.setRoleId(role.getRoleId().intValue()); |
| | | roleSite.setSiteId(siteId); |
| | | roleSites.add(roleSite); |
| | | } |
| | | } |
| | | roleSiteClient.addRoleSite(roleSites); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | @ApiOperation(value = "删除角色", tags = {"管理后台-角色管理"}) |
| | | public AjaxResult remove(@PathVariable Long[] roleIds) { |
| | | return toAjax(roleService.deleteRoleByIds(roleIds)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id集合获取数据 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/getSysRoleByIds") |
| | | public R<List<SysRole>> getSysRoleByIds(@RequestBody GetSysRoleByIds ids) { |
| | | List<SysRole> sysRoleByIds = roleService.getSysRoleByIds(ids.getIds()); |
| | | return R.ok(sysRoleByIds); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys-role-dept") |
| | | public class SysRoleDeptController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys-role-menu") |
| | | public class SysRoleMenuController { |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.feignClient.RoleSiteClient; |
| | | import com.ruoyi.other.api.feignClient.UserSiteClient; |
| | | import com.ruoyi.system.api.query.ChangeUserQuery; |
| | | import com.ruoyi.system.api.model.*; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.query.GetSysUserList; |
| | | import com.ruoyi.system.query.ShopUserStart; |
| | | import com.ruoyi.system.service.*; |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user") |
| | | @Api(tags = "用户信息") |
| | | public class SysUserController extends BaseController { |
| | | @Resource |
| | | private ISysUserService userService; |
| | | |
| | | @Resource |
| | | private ISysRoleService roleService; |
| | | |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | | |
| | | @Resource |
| | | private ISysPostService postService; |
| | | |
| | | @Resource |
| | | private ISysPermissionService permissionService; |
| | | |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | |
| | | @Resource |
| | | private ISysUserRoleService userRoleService; |
| | | |
| | | @Resource |
| | | private ISysUserRoleService sysUserRoleService; |
| | | |
| | | @Resource |
| | | private UserSiteClient userSiteClient; |
| | | |
| | | @Resource |
| | | private RoleSiteClient roleSiteClient; |
| | | |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取系统用户列表", tags = {"管理后台-系统用户管理", "管理后台-角色管理"}) |
| | | public AjaxResult list(GetSysUserList getSysUserList) { |
| | | PageInfo<SysUser> pageInfo = new PageInfo<>(getSysUserList.getPageCurr(), getSysUserList.getPageSize()); |
| | | PageInfo<SysUser> page = userService.getList(pageInfo, getSysUserList); |
| | | return AjaxResult.success(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户选择列表 |
| | | */ |
| | | @PostMapping("/getChangeUserList") |
| | | @ApiOperation(value = "获取用户选择列表", tags = {"管理后台-获取用户选择列表"}) |
| | | public AjaxResult<PageInfo<SysUser>> getChangeUserList(@RequestBody ChangeUserQuery query) { |
| | | return AjaxResult.success(userService.getChangeUserList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户 |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加系统用户", tags = {"管理后台-系统用户管理"}) |
| | | @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 |
| | | public AjaxResult add(@RequestBody SysUser user) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("手机号已开通账号"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { |
| | | return error("登录账号重复"); |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setRoleType(1); |
| | | userService.insertUser(user); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(user.getRoleId()); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | List<Integer> siteIds = user.getSiteIds(); |
| | | List<TUserSite> userSites = new ArrayList<>(); |
| | | for (Integer siteId : siteIds) { |
| | | TUserSite userSite = new TUserSite(); |
| | | userSite.setUserId(user.getUserId().intValue()); |
| | | userSite.setSiteId(siteId); |
| | | userSites.add(userSite); |
| | | } |
| | | userSiteClient.addUserSite(userSites); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/verifyUserNameRepeat/{username}") |
| | | @ApiOperation(value = "校验账号是否重复", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult verifyUserNameRepeat(@PathVariable String username){ |
| | | SysUser user = new SysUser(); |
| | | user.setUserName(username); |
| | | if (StringUtils.isNotEmpty(username) && !userService.checkUserNameUnique(user)) { |
| | | return error("账号不可重复"); |
| | | } |
| | | return success(); |
| | | } |
| | | |
| | | @GetMapping("/getRoleSiteName/{roleId}") |
| | | @ApiOperation(value = "获取角色对应的站点名称", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult<List<String>> getRoleSiteName(@PathVariable Integer roleId){ |
| | | List<Integer> ids = roleSiteClient.getSiteIds(roleId.longValue()).getData(); |
| | | List<Site> data = siteClient.getSiteByIds(ids).getData(); |
| | | if(null == data){ |
| | | return AjaxResult.success(new ArrayList<>()); |
| | | } |
| | | List<String> siteNames = data.stream().map(Site::getName).collect(Collectors.toList()); |
| | | return AjaxResult.success(siteNames); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据用户编号获取详细信息 |
| | | */ |
| | | @ApiOperation(value = "获取用户详情", tags = {"管理后台-系统用户管理"}) |
| | | @GetMapping("/getInfo/{userId}") |
| | | public AjaxResult getInfo(@PathVariable Long userId) { |
| | | userService.checkUserDataScope(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | ajax.put("posts", postService.selectPostAll()); |
| | | if (StringUtils.isNotNull(userId)) { |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | List<Integer> siteIds = userSiteClient.getSiteIds(userId).getData(); |
| | | sysUser.setSiteIds(siteIds); |
| | | List<Site> data = siteClient.getSiteByIds(siteIds).getData(); |
| | | List<String> siteNames = data.stream().map(Site::getName).collect(Collectors.toList()); |
| | | sysUser.setSiteNames(siteNames); |
| | | ajax.put(AjaxResult.DATA_TAG, sysUser); |
| | | ajax.put("postIds", postService.selectPostListByUserId(userId)); |
| | | ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); |
| | | } |
| | | return AjaxResult.success(ajax); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改用户 |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/update") |
| | | @ApiOperation(value = "编辑系统用户", tags = {"管理后台-系统用户管理"}) |
| | | @GlobalTransactional(rollbackFor = Exception.class)//分布式事务 |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | R<Integer> admin = this.isAdmin(user.getUserId()); |
| | | Integer data = admin.getData(); |
| | | if(data == null || data != 1){ |
| | | SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, user.getUserId())); |
| | | one.setRoleId(user.getRoleId()); |
| | | sysUserRoleService.updateSysUserRole(one); |
| | | } |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | SysUser sysUser = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | | .eq(SysUser::getPhonenumber, user.getPhonenumber()) |
| | | .eq(SysUser::getDelFlag,0) |
| | | .last("LIMIT 1")); |
| | | |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && (Objects.nonNull(sysUser) && !user.getUserId().equals(sysUser.getUserId()) )) { |
| | | return error("手机号已开通账号"); |
| | | } |
| | | sysUser = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | | .eq(SysUser::getUserName, user.getUserName()) |
| | | .eq(SysUser::getDelFlag,0) |
| | | .last("LIMIT 1")); |
| | | if (StringUtils.isNotEmpty(user.getUserName()) && (Objects.nonNull(sysUser) && !user.getUserId().equals(sysUser.getUserId()) )) { |
| | | return error("登录账号重复"); |
| | | } |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | if (user.getPassword() != null && !"".equals(user.getPassword())) { |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setPassWordUpdate(new Date()); |
| | | } |
| | | if (user.getPhonenumber() != null) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | } |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | user.setUpdateTime(new Date()); |
| | | userService.updateUser(user); |
| | | |
| | | //删除旧的站点数据后添加新的 |
| | | userSiteClient.delUserSite(user.getUserId()); |
| | | List<Integer> siteIds = user.getSiteIds(); |
| | | List<TUserSite> userSites = new ArrayList<>(); |
| | | for (Integer siteId : siteIds) { |
| | | TUserSite userSite = new TUserSite(); |
| | | userSite.setUserId(user.getUserId().intValue()); |
| | | userSite.setSiteId(siteId); |
| | | userSites.add(userSite); |
| | | } |
| | | userSiteClient.addUserSite(userSites); |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | @ApiOperation(value = "删除系统用户", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult remove(@PathVariable Long[] userIds) { |
| | | if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) { |
| | | return error("当前用户不能删除"); |
| | | } |
| | | return toAjax(userService.deleteUserByIds(userIds)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/shopUserStart") |
| | | @ApiOperation(value = "账号管理--禁用/启用", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult shopUserStart(@RequestBody ShopUserStart shopUserStart) { |
| | | if (shopUserStart.getUserId() == null) { |
| | | return AjaxResult.error("userId不能为空"); |
| | | } |
| | | SysUser sysUser = userService.selectUserById(shopUserStart.getUserId()); |
| | | if (sysUser.getStatus().equals("0")) { |
| | | sysUser.setStatus("1"); |
| | | sysUser.setForbiddenRemark(shopUserStart.getRemark()); |
| | | } else { |
| | | sysUser.setStatus("0"); |
| | | sysUser.setForbiddenRemark(""); |
| | | } |
| | | return toAjax(userService.updateUser(sysUser)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/getUserList") |
| | | public R<List<SysUser>> getUserList(@RequestBody List<Integer> userIds) { |
| | | List<SysUser> list = userService.list(new LambdaQueryWrapper<SysUser>().in(SysUser::getUserId, userIds)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @PostMapping("/getSysUserFromCompanyId") |
| | | public R<List<CompanyUserListVo>> getSysUserFromCompanyId(@RequestBody CompanySysUserReq companySysUserReq) { |
| | | LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if (companySysUserReq.getUserIds().size() == 0) { |
| | | List<Integer> userIds = companySysUserReq.getUserIds(); |
| | | userIds.add(-1); |
| | | companySysUserReq.setUserIds(userIds); |
| | | } |
| | | sysUserLambdaQueryWrapper.in(SysUser::getUserId, companySysUserReq.getUserIds()); |
| | | if (companySysUserReq.getName() != null && !"".equals(companySysUserReq.getName())) { |
| | | sysUserLambdaQueryWrapper.like(SysUser::getUserName, companySysUserReq.getName()).or().like(SysUser::getPhonenumber, companySysUserReq.getName()); |
| | | } |
| | | sysUserLambdaQueryWrapper.eq(SysUser::getRoleType,2); |
| | | List<SysUser> list = userService.list(sysUserLambdaQueryWrapper); |
| | | ArrayList<CompanyUserListVo> companyUserListVos = new ArrayList<>(); |
| | | for (SysUser sysUser : list) { |
| | | CompanyUserListVo companyUserListVo = new CompanyUserListVo(); |
| | | companyUserListVo.setId(sysUser.getUserId()); |
| | | companyUserListVo.setPassword(sysUser.getPassword()); |
| | | companyUserListVo.setPhoneNumber(sysUser.getPhonenumber()); |
| | | companyUserListVo.setUserName(sysUser.getUserName()); |
| | | companyUserListVo.setNickName(sysUser.getNickName()); |
| | | companyUserListVos.add(companyUserListVo); |
| | | } |
| | | return R.ok(companyUserListVos); |
| | | } |
| | | |
| | | @PostMapping("/getSysUserFromCompanyIdOne") |
| | | public R<List<CompanyUserListVo>> getSysUserFromCompanyIdOne(@RequestBody CompanySysUserReq companySysUserReq) { |
| | | LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | sysUserLambdaQueryWrapper.eq(SysUser::getRoleType, 2); |
| | | if (companySysUserReq.getName() != null && !"".equals(companySysUserReq.getName())) { |
| | | sysUserLambdaQueryWrapper.like(SysUser::getPhonenumber, companySysUserReq.getName()); |
| | | } |
| | | List<SysUser> list = userService.list(sysUserLambdaQueryWrapper); |
| | | ArrayList<CompanyUserListVo> companyUserListVos = new ArrayList<>(); |
| | | for (SysUser sysUser : list) { |
| | | CompanyUserListVo companyUserListVo = new CompanyUserListVo(); |
| | | companyUserListVo.setId(sysUser.getUserId()); |
| | | companyUserListVo.setPassword(sysUser.getPassword()); |
| | | companyUserListVo.setPhoneNumber(sysUser.getPhonenumber()); |
| | | companyUserListVo.setUserName(sysUser.getUserName()); |
| | | companyUserListVo.setNickName(sysUser.getNickName()); |
| | | companyUserListVos.add(companyUserListVo); |
| | | } |
| | | return R.ok(companyUserListVos); |
| | | } |
| | | @PostMapping("/isAdmin") |
| | | public R<Integer> isAdmin(@RequestBody Long userId){ |
| | | SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId)); |
| | | Long id =one.getRoleId(); |
| | | return R.ok(id.intValue()); |
| | | } |
| | | |
| | | @PostMapping("/getSysUser") |
| | | public R<SysUser> getSysUser(@RequestParam("userId") Long userId) { |
| | | try { |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | return R.ok(sysUser); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/updateSysUser") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> updateSysUser(@RequestBody SysUser sysUser) { |
| | | try { |
| | | sysUser.setUpdateBy(SecurityUtils.getUsername()); |
| | | sysUser.setUpdateTime(new Date()); |
| | | userService.updateUser(sysUser); |
| | | if(null != sysUser.getRoleId()){ |
| | | userRoleService.deleteSysUserRoleByUserId(sysUser.getUserId()); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(sysUser.getRoleId()); |
| | | sysUserRole.setUserId(sysUser.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | } |
| | | return R.ok(true); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @PostMapping("/companySaveSysUser") |
| | | public R<List<Integer>> companySaveSysUser(@RequestBody CompanyAddSysUserDto dto) { |
| | | List<CompanyUserListVo> list = dto.getList(); |
| | | ArrayList<Integer> userIds = new ArrayList<>(); |
| | | try { |
| | | for (CompanyUserListVo companyUserListVo : list) { |
| | | List<Long> ids = userService.getSysUserFromPhone(companyUserListVo.getPhoneNumber()); |
| | | SysUser sysUser = new SysUser(); |
| | | if (ids.size() > 0) { |
| | | sysUser.setRoleType(2); |
| | | sysUser.setObjectId(dto.getCompanyId()); |
| | | if(companyUserListVo.getPassword()!=null){ |
| | | sysUser.setPassword(SecurityUtils.encryptPassword(companyUserListVo.getPassword())); |
| | | } |
| | | sysUser.setPhonenumber(companyUserListVo.getPhoneNumber()); |
| | | sysUser.setUserName(companyUserListVo.getPhoneNumber()); |
| | | sysUser.setNickName(companyUserListVo.getNickName()); |
| | | sysUser.setUserId(ids.get(0).longValue()); |
| | | userService.updateUser(sysUser); |
| | | userIds.add(ids.get(0).intValue()); |
| | | } else { |
| | | |
| | | sysUser.setRoleType(2); |
| | | sysUser.setObjectId(dto.getCompanyId()); |
| | | if(companyUserListVo.getPassword()!=null){ |
| | | sysUser.setPassword(SecurityUtils.encryptPassword(companyUserListVo.getPassword())); |
| | | } |
| | | sysUser.setPhonenumber(companyUserListVo.getPhoneNumber()); |
| | | sysUser.setUserName(companyUserListVo.getPhoneNumber()); |
| | | sysUser.setNickName(companyUserListVo.getNickName()); |
| | | sysUser.setCreateBy(SecurityUtils.getUsername()); |
| | | sysUser.setCreateTime(new Date()); |
| | | userService.insertUser(sysUser); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(20l); |
| | | sysUserRole.setUserId(sysUser.getUserId()); |
| | | sysUserRoleService.insertSysUserRole(sysUserRole); |
| | | userIds.add(sysUser.getUserId().intValue()); |
| | | } |
| | | } |
| | | return R.ok(userIds); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @PostMapping("/addTRepairSysUser") |
| | | public R<List<Integer>> addTRepairSysUser(@RequestBody TRepairShopAddDto dto) { |
| | | List<TRepairShopAdd> list = dto.getList(); |
| | | ArrayList<Integer> userIds = new ArrayList<>(); |
| | | try { |
| | | for (TRepairShopAdd add : list) { |
| | | List<Long> ids = userService.getSysUserFromPhone(add.getPhonenumber()); |
| | | if (ids.size() > 0) { |
| | | userIds.add(ids.get(0).intValue()); |
| | | } else { |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setPhonenumber(add.getPhonenumber()); |
| | | sysUser.setCreateTime(new Date()); |
| | | sysUser.setCreateBy(SecurityUtils.getUsername()); |
| | | sysUser.setPassword(SecurityUtils.encryptPassword(add.getPwd())); |
| | | sysUser.setRoleType(4); |
| | | sysUser.setObjectId(dto.getRepairId()); |
| | | sysUser.setUserName(add.getPhonenumber()); |
| | | sysUser.setNickName(add.getPhonenumber()); |
| | | userService.insertUser(sysUser); |
| | | userIds.add(sysUser.getUserId().intValue()); |
| | | } |
| | | } |
| | | return R.ok(userIds); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前用户信息 |
| | | */ |
| | | @InnerAuth |
| | | @GetMapping("/info/{username}") |
| | | public R<LoginUser> info(@PathVariable("username") String username) { |
| | | SysUser sysUser = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(sysUser)) { |
| | | return R.fail("用户名或密码错误"); |
| | | } |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(sysUser); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(sysUser); |
| | | LoginUser sysUserVo = new LoginUser(); |
| | | sysUserVo.setSysUser(sysUser); |
| | | sysUserVo.setRoles(roles); |
| | | sysUserVo.setPermissions(permissions); |
| | | |
| | | return R.ok(sysUserVo); |
| | | } |
| | | |
| | | /** |
| | | * 注册用户信息 |
| | | */ |
| | | @PostMapping("/register") |
| | | public R<Boolean> register(@RequestBody SysUser sysUser) { |
| | | String username = sysUser.getUserName(); |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { |
| | | return R.fail("当前系统没有开启注册功能!"); |
| | | } |
| | | if (!userService.checkUserNameUnique(sysUser)) { |
| | | return R.fail("保存用户'" + username + "'失败,注册账号已存在"); |
| | | } |
| | | return R.ok(userService.registerUser(sysUser)); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | @GetMapping("/getInfo") |
| | | public AjaxResult getInfo() { |
| | | SysUser user = userService.selectUserById(SecurityUtils.getUserId()); |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | @ApiOperation(value = "重置密码", tags = {"管理后台-系统用户管理"}) |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * 状态修改 |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { |
| | | userService.checkUserDataScope(userId); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取部门树列表 |
| | | */ |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) { |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | |
| | | @PostMapping("/updateUser") |
| | | public R<Boolean> updateUser(@RequestBody SysUser sysUser){ |
| | | return R.ok(userService.updateById(sysUser)); |
| | | } |
| | | |
| | | /** |
| | | * 通过用户id查询角色对象 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @PostMapping("/queryRoleByUserId/{userId}") |
| | | public R<SysRole> queryRoleByUserId(@PathVariable("userId") Long userId){ |
| | | SysUserRole one = sysUserRoleService.getOne(Wrappers.lambdaQuery(SysUserRole.class) |
| | | .eq(SysUserRole::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | System.out.println("通过用户id查询角色对象"+one); |
| | | if(Objects.nonNull(one)){ |
| | | SysRole byId = roleService.getOne(Wrappers.lambdaQuery(SysRole.class) |
| | | .eq(SysRole::getRoleId,one.getRoleId()) |
| | | .last("LIMIT 1")); |
| | | return R.ok(byId); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/queryRoleByRoleId/{roleId}") |
| | | public R<SysRole> queryRoleByRoleId(@PathVariable("roleId") Long roleId){ |
| | | return R.ok( roleService.getOne(Wrappers.lambdaQuery(SysRole.class) |
| | | .eq(SysRole::getRoleId, roleId) |
| | | .last("LIMIT 1"))); |
| | | } |
| | | |
| | | /** |
| | | * 通过手机号集合查询用户 |
| | | * @param phoneList |
| | | * @return |
| | | */ |
| | | @PostMapping("/queryUserByPhoneList") |
| | | public R<List<SysUser>> queryUserByPhoneList(@RequestBody List<String> phoneList){ |
| | | List<SysUser> list = userService.list(Wrappers.lambdaQuery(SysUser.class) |
| | | .in(SysUser::getPhonenumber, phoneList) |
| | | .ne(SysUser::getDelFlag,2)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 默认批量添加修理厂 |
| | | * @param dtoList |
| | | * @return |
| | | */ |
| | | @PostMapping("/addUserRole") |
| | | public R<Boolean> addUserRole(@RequestBody List<SysUserRoleDTO> dtoList){ |
| | | List<SysUserRole> userRoles = new ArrayList<>(); |
| | | for (SysUserRoleDTO userRoleDTO : dtoList) { |
| | | SysUserRole userRole = new SysUserRole(); |
| | | userRole.setRoleId(userRoleDTO.getRoleId()); |
| | | userRole.setUserId(userRoleDTO.getUserId()); |
| | | userRoles.add(userRole); |
| | | } |
| | | return R.ok(sysUserRoleService.saveBatch(userRoles)); |
| | | } |
| | | |
| | | /** |
| | | * 通过手机号查询用户 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @PostMapping("/queryUserByPhone") |
| | | public R<SysUser> queryUserByPhone(@RequestBody String phone){ |
| | | SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | | .eq(SysUser::getPhonenumber, phone) |
| | | .last("LIMIT 1")); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过账号查询用户 |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryUserByUserName") |
| | | public R<SysUser> queryUserByUserName(@RequestBody String userName){ |
| | | SysUser user = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | | .eq(SysUser::getUserName, userName) |
| | | .last("LIMIT 1")); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加管理员 |
| | | * @param user |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/addSysUser") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Long> addSysUser(@RequestBody SysUser user) { |
| | | if(StringUtils.isEmpty(user.getUserName())){ |
| | | user.setUserName(user.getPhonenumber()); |
| | | } |
| | | if(!org.springframework.util.StringUtils.hasLength(user.getNickName())){ |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | // if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | // throw new RuntimeException("手机号已开通账号"); |
| | | // } |
| | | if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { |
| | | throw new RuntimeException("登录账号已存在"); |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | if(null == user.getRoleType()){ |
| | | user.setRoleType(1); |
| | | } |
| | | userService.insertUser(user); |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(user.getRoleId()); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | return R.ok(user.getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/sys-user") |
| | | public class SysUserController { |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/resetPassword") |
| | | public R resetPassword(@RequestBody SysUser user) { |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | userService.resetPwd(user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getSysUserById") |
| | | public SysUser getSysUserById(@RequestParam("userId") Long userId){ |
| | | return userService.getById(userId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sys-user-post") |
| | | public class SysUserPostController { |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.model.SysUserRoleVo; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.service.ISysUserRoleService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 用户和角色关联Controller |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @date 2023-06-12 |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/userRole") |
| | | public class SysUserRoleController extends BaseController { |
| | | @Autowired |
| | | private ISysUserRoleService sysUserRoleService; |
| | | @RequestMapping("/sys-user-role") |
| | | public class SysUserRoleController { |
| | | |
| | | /** |
| | | * 查询用户和角色关联列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUserRole sysUserRole) { |
| | | startPage(); |
| | | List<SysUserRole> list = sysUserRoleService.selectSysUserRoleList(sysUserRole); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出用户和角色关联列表 |
| | | */ |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUserRole sysUserRole) { |
| | | List<SysUserRole> list = sysUserRoleService.selectSysUserRoleList(sysUserRole); |
| | | ExcelUtil<SysUserRole> util = new ExcelUtil<SysUserRole>(SysUserRole.class); |
| | | util.exportExcel(response, list, "用户和角色关联数据"); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户和角色关联详细信息 |
| | | */ |
| | | @GetMapping(value = "/{userId}") |
| | | public AjaxResult getInfo(@PathVariable("userId") Long userId) { |
| | | return success(sysUserRoleService.selectSysUserRoleByUserId(userId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户和角色关联 |
| | | */ |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody SysUserRole sysUserRole) { |
| | | return toAjax(sysUserRoleService.insertSysUserRole(sysUserRole)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户和角色关联 |
| | | */ |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody SysUserRole sysUserRole) { |
| | | return toAjax(sysUserRoleService.updateSysUserRole(sysUserRole)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户和角色关联 |
| | | */ |
| | | @Log(title = "用户和角色关联", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public AjaxResult remove(@PathVariable Long[] userIds) { |
| | | return toAjax(sysUserRoleService.deleteSysUserRoleByUserIds(userIds)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据用户id获取角色 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @PostMapping("/getRoleByUserId") |
| | | public R<List<SysUserRoleVo>> getRoleByUserId(@RequestParam("userId") Long userId){ |
| | | List<SysUserRole> list = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId)); |
| | | List<SysUserRoleVo> data = new ArrayList<>(); |
| | | for (SysUserRole sysUserRole : list) { |
| | | SysUserRoleVo vo = new SysUserRoleVo(); |
| | | BeanUtils.copyProperties(sysUserRole, vo); |
| | | data.add(vo); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.GenTableColumn; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface GenTableColumnMapper extends BaseMapper<GenTableColumn> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.GenTable; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface GenTableMapper extends BaseMapper<GenTable> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.ruoyi.system.api.model.SysConfig; |
| | | |
| | | /** |
| | | * 参数配置 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Mapper |
| | | public interface SysConfigMapper extends BaseMapper<SysConfig> { |
| | | /** |
| | | * 查询参数配置信息 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 参数配置信息 |
| | | */ |
| | | public SysConfig selectConfig(SysConfig config); |
| | | |
| | | /** |
| | | * 通过ID查询配置 |
| | | * |
| | | * @param configId 参数ID |
| | | * @return 参数配置信息 |
| | | */ |
| | | public SysConfig selectConfigById(Long configId); |
| | | |
| | | /** |
| | | * 查询参数配置列表 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 参数配置集合 |
| | | */ |
| | | public List<SysConfig> selectConfigList(SysConfig config); |
| | | |
| | | /** |
| | | * 根据键名查询参数配置信息 |
| | | * |
| | | * @param configKey 参数键名 |
| | | * @return 参数配置信息 |
| | | */ |
| | | public SysConfig checkConfigKeyUnique(String configKey); |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertConfig(SysConfig config); |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateConfig(SysConfig config); |
| | | |
| | | /** |
| | | * 删除参数配置 |
| | | * |
| | | * @param configId 参数ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigById(Long configId); |
| | | |
| | | /** |
| | | * 批量删除参数信息 |
| | | * |
| | | * @param configIds 需要删除的参数ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteConfigByIds(Long[] configIds); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysDept; |
| | | |
| | | /** |
| | | * 部门管理 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysDeptMapper |
| | | { |
| | | /** |
| | | * 查询部门管理数据 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 部门信息集合 |
| | | */ |
| | | public List<SysDept> selectDeptList(SysDept dept); |
| | | public interface SysDeptMapper extends BaseMapper<SysDept> { |
| | | |
| | | /** |
| | | * 根据角色ID查询部门树信息 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param deptCheckStrictly 部门树选择项是否关联显示 |
| | | * @return 选中部门列表 |
| | | */ |
| | | public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); |
| | | |
| | | /** |
| | | * 根据部门ID查询信息 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 部门信息 |
| | | */ |
| | | public SysDept selectDeptById(Long deptId); |
| | | |
| | | /** |
| | | * 根据ID查询所有子部门 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 部门列表 |
| | | */ |
| | | public List<SysDept> selectChildrenDeptById(Long deptId); |
| | | |
| | | /** |
| | | * 根据ID查询所有子部门(正常状态) |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 子部门数 |
| | | */ |
| | | public int selectNormalChildrenDeptById(Long deptId); |
| | | |
| | | /** |
| | | * 是否存在子节点 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | public int hasChildByDeptId(Long deptId); |
| | | |
| | | /** |
| | | * 查询部门是否存在用户 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | public int checkDeptExistUser(Long deptId); |
| | | |
| | | /** |
| | | * 校验部门名称是否唯一 |
| | | * |
| | | * @param deptName 部门名称 |
| | | * @param parentId 父部门ID |
| | | * @return 结果 |
| | | */ |
| | | public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); |
| | | |
| | | /** |
| | | * 新增部门信息 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertDept(SysDept dept); |
| | | |
| | | /** |
| | | * 修改部门信息 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateDept(SysDept dept); |
| | | |
| | | /** |
| | | * 修改所在部门正常状态 |
| | | * |
| | | * @param deptIds 部门ID组 |
| | | */ |
| | | public void updateDeptStatusNormal(Long[] deptIds); |
| | | |
| | | /** |
| | | * 修改子元素关系 |
| | | * |
| | | * @param depts 子元素 |
| | | * @return 结果 |
| | | */ |
| | | public int updateDeptChildren(@Param("depts") List<SysDept> depts); |
| | | |
| | | /** |
| | | * 删除部门管理信息 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDeptById(Long deptId); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.api.domain.SysDictData; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysDictData; |
| | | |
| | | /** |
| | | * 字典表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysDictDataMapper |
| | | { |
| | | /** |
| | | * 根据条件分页查询字典数据 |
| | | * |
| | | * @param dictData 字典数据信息 |
| | | * @return 字典数据集合信息 |
| | | */ |
| | | public List<SysDictData> selectDictDataList(SysDictData dictData); |
| | | public interface SysDictDataMapper extends BaseMapper<SysDictData> { |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典数据集合信息 |
| | | */ |
| | | public List<SysDictData> selectDictDataByType(String dictType); |
| | | |
| | | /** |
| | | * 根据字典类型和字典键值查询字典数据信息 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictValue 字典键值 |
| | | * @return 字典标签 |
| | | */ |
| | | public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); |
| | | |
| | | /** |
| | | * 根据字典数据ID查询信息 |
| | | * |
| | | * @param dictCode 字典数据ID |
| | | * @return 字典数据 |
| | | */ |
| | | public SysDictData selectDictDataById(Long dictCode); |
| | | |
| | | /** |
| | | * 查询字典数据 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典数据 |
| | | */ |
| | | public int countDictDataByType(String dictType); |
| | | |
| | | /** |
| | | * 通过字典ID删除字典数据信息 |
| | | * |
| | | * @param dictCode 字典数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDictDataById(Long dictCode); |
| | | |
| | | /** |
| | | * 批量删除字典数据信息 |
| | | * |
| | | * @param dictCodes 需要删除的字典数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDictDataByIds(Long[] dictCodes); |
| | | |
| | | /** |
| | | * 新增字典数据信息 |
| | | * |
| | | * @param dictData 字典数据信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertDictData(SysDictData dictData); |
| | | |
| | | /** |
| | | * 修改字典数据信息 |
| | | * |
| | | * @param dictData 字典数据信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateDictData(SysDictData dictData); |
| | | |
| | | /** |
| | | * 同步修改字典类型 |
| | | * |
| | | * @param oldDictType 旧字典类型 |
| | | * @param newDictType 新旧字典类型 |
| | | * @return 结果 |
| | | */ |
| | | public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.api.domain.SysDictType; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysDictType; |
| | | |
| | | /** |
| | | * 字典表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysDictTypeMapper |
| | | { |
| | | /** |
| | | * 根据条件分页查询字典类型 |
| | | * |
| | | * @param dictType 字典类型信息 |
| | | * @return 字典类型集合信息 |
| | | */ |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType); |
| | | public interface SysDictTypeMapper extends BaseMapper<SysDictType> { |
| | | |
| | | /** |
| | | * 根据所有字典类型 |
| | | * |
| | | * @return 字典类型集合信息 |
| | | */ |
| | | public List<SysDictType> selectDictTypeAll(); |
| | | |
| | | /** |
| | | * 根据字典类型ID查询信息 |
| | | * |
| | | * @param dictId 字典类型ID |
| | | * @return 字典类型 |
| | | */ |
| | | public SysDictType selectDictTypeById(Long dictId); |
| | | |
| | | /** |
| | | * 根据字典类型查询信息 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典类型 |
| | | */ |
| | | public SysDictType selectDictTypeByType(String dictType); |
| | | |
| | | /** |
| | | * 通过字典ID删除字典信息 |
| | | * |
| | | * @param dictId 字典ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDictTypeById(Long dictId); |
| | | |
| | | /** |
| | | * 批量删除字典类型信息 |
| | | * |
| | | * @param dictIds 需要删除的字典ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDictTypeByIds(Long[] dictIds); |
| | | |
| | | /** |
| | | * 新增字典类型信息 |
| | | * |
| | | * @param dictType 字典类型信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertDictType(SysDictType dictType); |
| | | |
| | | /** |
| | | * 修改字典类型信息 |
| | | * |
| | | * @param dictType 字典类型信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateDictType(SysDictType dictType); |
| | | |
| | | /** |
| | | * 校验字典类型称是否唯一 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 结果 |
| | | */ |
| | | public SysDictType checkDictTypeUnique(String dictType); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysJobLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysJobLogMapper extends BaseMapper<SysJobLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysJob; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysJobMapper extends BaseMapper<SysJob> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.api.model.SysLoginLog; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/12 15:44 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysLoginLogMapper extends BaseMapper<SysLoginLog> { |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * @param pageInfo |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<SysLoginLog> pageList(PageInfo<SysLoginLog> pageInfo, @Param("name") String name); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.api.model.SysMenu; |
| | | |
| | | /** |
| | | * 菜单表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysMenuMapper extends BaseMapper<SysMenu> |
| | | { |
| | | /** |
| | | * 查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuList(SysMenu menu); |
| | | |
| | | /** |
| | | * 根据用户所有权限 |
| | | * |
| | | * @return 权限列表 |
| | | */ |
| | | public List<String> selectMenuPerms(); |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuListByUserId(SysMenu menu); |
| | | |
| | | /** |
| | | * 根据角色ID查询权限 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 权限列表 |
| | | */ |
| | | public List<String> selectMenuPermsByRoleId(Long roleId); |
| | | |
| | | /** |
| | | * 根据用户ID查询权限 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 权限列表 |
| | | */ |
| | | public List<String> selectMenuPermsByUserId(Long userId); |
| | | |
| | | /** |
| | | * 根据用户ID查询菜单 |
| | | * |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuTreeAll(); |
| | | |
| | | /** |
| | | * 根据用户ID查询菜单 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuTreeByUserId(Long userId); |
| | | |
| | | /** |
| | | * 根据角色ID查询菜单树信息 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param menuCheckStrictly 菜单树选择项是否关联显示 |
| | | * @return 选中菜单列表 |
| | | */ |
| | | public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); |
| | | |
| | | /** |
| | | * 根据菜单ID查询信息 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 菜单信息 |
| | | */ |
| | | public SysMenu selectMenuById(Long menuId); |
| | | |
| | | /** |
| | | * 是否存在菜单子节点 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 结果 |
| | | */ |
| | | public int hasChildByMenuId(Long menuId); |
| | | |
| | | /** |
| | | * 新增菜单信息 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertMenu(SysMenu menu); |
| | | |
| | | /** |
| | | * 修改菜单信息 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateMenu(SysMenu menu); |
| | | |
| | | /** |
| | | * 删除菜单管理信息 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteMenuById(Long menuId); |
| | | |
| | | /** |
| | | * 校验菜单名称是否唯一 |
| | | * |
| | | * @param menuName 菜单名称 |
| | | * @param parentId 父菜单ID |
| | | * @return 结果 |
| | | */ |
| | | public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId); |
| | | |
| | | List<SysMenus> getAll(); |
| | | |
| | | List<SysMenus> getAllInIds(@Param("menusId") List<Long> menusId); |
| | | |
| | | List<SysMenus> getAllOne(); |
| | | |
| | | |
| | | public interface SysMenuMapper extends BaseMapper<SysMenu> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysNotice; |
| | | |
| | | /** |
| | | * 通知公告表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysNoticeMapper { |
| | | /** |
| | | * 查询公告信息 |
| | | * |
| | | * @param noticeId 公告ID |
| | | * @return 公告信息 |
| | | */ |
| | | public SysNotice selectNoticeById(Long noticeId); |
| | | public interface SysNoticeMapper extends BaseMapper<SysNotice> { |
| | | |
| | | /** |
| | | * 查询公告列表 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 公告集合 |
| | | */ |
| | | public List<SysNotice> selectNoticeList(SysNotice notice); |
| | | |
| | | /** |
| | | * 新增公告 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertNotice(SysNotice notice); |
| | | |
| | | /** |
| | | * 修改公告 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateNotice(SysNotice notice); |
| | | |
| | | /** |
| | | * 批量删除公告 |
| | | * |
| | | * @param noticeId 公告ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteNoticeById(Long noticeId); |
| | | |
| | | /** |
| | | * 批量删除公告信息 |
| | | * |
| | | * @param noticeIds 需要删除的公告ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteNoticeByIds(Long[] noticeIds); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.domain.SysOperLog; |
| | | import com.ruoyi.system.api.model.SysOperLog; |
| | | |
| | | /** |
| | | * 操作日志 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysOperLogMapper extends BaseMapper<SysOperLog> { |
| | | /** |
| | | * 新增操作日志 |
| | | * |
| | | * @param operLog 操作日志对象 |
| | | */ |
| | | public int insertOperlog(SysOperLog operLog); |
| | | |
| | | /** |
| | | * 查询系统操作日志集合 |
| | | * |
| | | * @param operLog 操作日志对象 |
| | | * @return 操作日志集合 |
| | | */ |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog); |
| | | |
| | | /** |
| | | * 批量删除系统操作日志 |
| | | * |
| | | * @param operIds 需要删除的操作日志ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteOperLogByIds(Long[] operIds); |
| | | |
| | | /** |
| | | * 查询操作日志详细 |
| | | * |
| | | * @param operId 操作ID |
| | | * @return 操作日志对象 |
| | | */ |
| | | public SysOperLog selectOperLogById(Long operId); |
| | | |
| | | /** |
| | | * 清空操作日志 |
| | | */ |
| | | public void cleanOperLog(); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysPost; |
| | | |
| | | /** |
| | | * 岗位信息 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysPostMapper |
| | | { |
| | | /** |
| | | * 查询岗位数据集合 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 岗位数据集合 |
| | | */ |
| | | public List<SysPost> selectPostList(SysPost post); |
| | | public interface SysPostMapper extends BaseMapper<SysPost> { |
| | | |
| | | /** |
| | | * 查询所有岗位 |
| | | * |
| | | * @return 岗位列表 |
| | | */ |
| | | public List<SysPost> selectPostAll(); |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位信息 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 角色对象信息 |
| | | */ |
| | | public SysPost selectPostById(Long postId); |
| | | |
| | | /** |
| | | * 根据用户ID获取岗位选择框列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中岗位ID列表 |
| | | */ |
| | | public List<Long> selectPostListByUserId(Long userId); |
| | | |
| | | /** |
| | | * 查询用户所属岗位组 |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 结果 |
| | | */ |
| | | public List<SysPost> selectPostsByUserName(String userName); |
| | | |
| | | /** |
| | | * 删除岗位信息 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | | public int deletePostById(Long postId); |
| | | |
| | | /** |
| | | * 批量删除岗位信息 |
| | | * |
| | | * @param postIds 需要删除的岗位ID |
| | | * @return 结果 |
| | | */ |
| | | public int deletePostByIds(Long[] postIds); |
| | | |
| | | /** |
| | | * 修改岗位信息 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updatePost(SysPost post); |
| | | |
| | | /** |
| | | * 新增岗位信息 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertPost(SysPost post); |
| | | |
| | | /** |
| | | * 校验岗位名称 |
| | | * |
| | | * @param postName 岗位名称 |
| | | * @return 结果 |
| | | */ |
| | | public SysPost checkPostNameUnique(String postName); |
| | | |
| | | /** |
| | | * 校验岗位编码 |
| | | * |
| | | * @param postCode 岗位编码 |
| | | * @return 结果 |
| | | */ |
| | | public SysPost checkPostCodeUnique(String postCode); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysRoleDept; |
| | | |
| | | /** |
| | | * 角色与部门关联表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysRoleDeptMapper |
| | | { |
| | | /** |
| | | * 通过角色ID删除角色和部门关联 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRoleDeptByRoleId(Long roleId); |
| | | public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> { |
| | | |
| | | /** |
| | | * 批量删除角色部门关联信息 |
| | | * |
| | | * @param ids 需要删除的数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRoleDept(Long[] ids); |
| | | |
| | | /** |
| | | * 查询部门使用数量 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | public int selectCountRoleDeptByDeptId(Long deptId); |
| | | |
| | | /** |
| | | * 批量新增角色部门信息 |
| | | * |
| | | * @param roleDeptList 角色部门列表 |
| | | * @return 结果 |
| | | */ |
| | | public int batchRoleDept(List<SysRoleDept> roleDeptList); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.api.model.SysRole; |
| | | |
| | | /** |
| | | * 角色表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysRoleMapper extends BaseMapper<SysRole> |
| | | { |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 角色数据集合信息 |
| | | */ |
| | | public List<SysRole> selectRoleList(SysRole role); |
| | | public interface SysRoleMapper extends BaseMapper<SysRole> { |
| | | |
| | | /** |
| | | * 根据用户ID查询角色 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 角色列表 |
| | | */ |
| | | public List<SysRole> selectRolePermissionByUserId(Long userId); |
| | | |
| | | /** |
| | | * 查询所有角色 |
| | | * |
| | | * @return 角色列表 |
| | | */ |
| | | public List<SysRole> selectRoleAll(); |
| | | |
| | | /** |
| | | * 根据用户ID获取角色选择框列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中角色ID列表 |
| | | */ |
| | | public List<Long> selectRoleListByUserId(Long userId); |
| | | |
| | | /** |
| | | * 通过角色ID查询角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 角色对象信息 |
| | | */ |
| | | public SysRole selectRoleById(Long roleId); |
| | | |
| | | /** |
| | | * 根据用户ID查询角色 |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 角色列表 |
| | | */ |
| | | public List<SysRole> selectRolesByUserName(String userName); |
| | | |
| | | /** |
| | | * 校验角色名称是否唯一 |
| | | * |
| | | * @param roleName 角色名称 |
| | | * @return 角色信息 |
| | | */ |
| | | public SysRole checkRoleNameUnique(String roleName); |
| | | |
| | | /** |
| | | * 校验角色权限是否唯一 |
| | | * |
| | | * @param roleKey 角色权限 |
| | | * @return 角色信息 |
| | | */ |
| | | public SysRole checkRoleKeyUnique(String roleKey); |
| | | |
| | | /** |
| | | * 修改角色信息 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateRole(SysRole role); |
| | | |
| | | /** |
| | | * 新增角色信息 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertRole(SysRole role); |
| | | |
| | | /** |
| | | * 通过角色ID删除角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRoleById(Long roleId); |
| | | |
| | | /** |
| | | * 批量删除角色信息 |
| | | * |
| | | * @param roleIds 需要删除的角色ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRoleByIds(Long[] roleIds); |
| | | |
| | | List<SysRole> isExitUpdate(@Param("roleName") String roleName, @Param("roleId") Long roleId, @Param("companyId") Integer companyId); |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<SysRole> getSysRoleByIds(@Param("ids") List<Integer> ids); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.api.model.SysRoleMenu; |
| | | |
| | | /** |
| | | * 角色与菜单关联表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> |
| | | { |
| | | /** |
| | | * 查询菜单使用数量 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 结果 |
| | | */ |
| | | public int checkMenuExistRole(Long menuId); |
| | | public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> { |
| | | |
| | | /** |
| | | * 通过角色ID删除角色和菜单关联 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRoleMenuByRoleId(Long roleId); |
| | | |
| | | /** |
| | | * 批量删除角色菜单关联信息 |
| | | * |
| | | * @param ids 需要删除的数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRoleMenu(Long[] ids); |
| | | |
| | | /** |
| | | * 批量新增角色菜单信息 |
| | | * |
| | | * @param roleMenuList 角色菜单列表 |
| | | * @return 结果 |
| | | */ |
| | | public int batchRoleMenu(List<SysRoleMenu> roleMenuList); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.query.ChangeUserQuery; |
| | | import com.ruoyi.system.query.GetSysUserList; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.model.SysUser; |
| | | |
| | | /** |
| | | * 用户表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysUserMapper extends BaseMapper<SysUser> |
| | | { |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | | * @param sysUser 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectUserList(SysUser sysUser); |
| | | public interface SysUserMapper extends BaseMapper<SysUser> { |
| | | |
| | | /** |
| | | * 根据条件分页查询已配用户角色列表 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectAllocatedList(SysUser user); |
| | | |
| | | /** |
| | | * 根据条件分页查询未分配用户角色列表 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | public List<SysUser> selectUnallocatedList(SysUser user); |
| | | |
| | | /** |
| | | * 通过用户名查询用户 |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 用户对象信息 |
| | | */ |
| | | public SysUser selectUserByUserName(String userName); |
| | | |
| | | /** |
| | | * 通过用户ID查询用户 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 用户对象信息 |
| | | */ |
| | | public SysUser selectUserById(Long userId); |
| | | |
| | | /** |
| | | * 新增用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertUser(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUser(SysUser user); |
| | | |
| | | /** |
| | | * 修改用户头像 |
| | | * |
| | | * @param userName 用户名 |
| | | * @param avatar 头像地址 |
| | | * @return 结果 |
| | | */ |
| | | public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | | * |
| | | * @param userName 用户名 |
| | | * @param password 密码 |
| | | * @return 结果 |
| | | */ |
| | | public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); |
| | | |
| | | /** |
| | | * 通过用户ID删除用户 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserById(Long userId); |
| | | |
| | | /** |
| | | * 批量删除用户信息 |
| | | * |
| | | * @param userIds 需要删除的用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserByIds(Long[] userIds); |
| | | |
| | | /** |
| | | * 校验用户名称是否唯一 |
| | | * |
| | | * @param userName 用户名称 |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkUserNameUnique(String userName); |
| | | |
| | | /** |
| | | * 校验手机号码是否唯一 |
| | | * |
| | | * @param phonenumber 手机号码 |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkPhoneUnique(String phonenumber); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 校验email是否唯一 |
| | | * |
| | | * @param email 用户邮箱 |
| | | * @return 结果 |
| | | */ |
| | | public SysUser checkEmailUnique(String email); |
| | | |
| | | List<SysUser> getList(@Param("pageInfo") PageInfo<SysUser> pageInfo, @Param("req") GetSysUserList getSysUserList); |
| | | |
| | | PageInfo<SysUser> getAllList(@Param("pageInfo") PageInfo<SysUser> pageInfo, @Param("ids") List<Integer> collect); |
| | | |
| | | List<Long> getSysUserFromPhone(@Param("phoneNumber") String phoneNumber); |
| | | |
| | | void deleteSysUser(@Param("userIds") ArrayList<Integer> userIds); |
| | | |
| | | /** |
| | | * 获取用户选择列表 |
| | | * @param pageInfo |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<SysUser> getChangeUserList(@Param("pageInfo")PageInfo<SysUser> pageInfo,@Param("query") ChangeUserQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.SysUserPost; |
| | | |
| | | /** |
| | | * 用户与岗位关联表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysUserPostMapper |
| | | { |
| | | /** |
| | | * 通过用户ID删除用户和岗位关联 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserPostByUserId(Long userId); |
| | | public interface SysUserPostMapper extends BaseMapper<SysUserPost> { |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位使用数量 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | | public int countUserPostById(Long postId); |
| | | |
| | | /** |
| | | * 批量删除用户和岗位关联 |
| | | * |
| | | * @param ids 需要删除的数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserPost(Long[] ids); |
| | | |
| | | /** |
| | | * 批量新增用户岗位信息 |
| | | * |
| | | * @param userPostList 用户角色列表 |
| | | * @return 结果 |
| | | */ |
| | | public int batchUserPost(List<SysUserPost> userPostList); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.api.model.SysUserRole; |
| | | |
| | | /** |
| | | * 用户与角色关联表 数据层 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysUserRoleMapper extends BaseMapper<SysUserRole> |
| | | { |
| | | /** |
| | | * 通过用户ID删除用户和角色关联 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserRoleByUserId(Long userId); |
| | | |
| | | /** |
| | | * 批量删除用户和角色关联 |
| | | * |
| | | * @param ids 需要删除的数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserRole(Long[] ids); |
| | | |
| | | /** |
| | | * 通过角色ID查询角色使用数量 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | public int countUserRoleByRoleId(Long roleId); |
| | | |
| | | /** |
| | | * 批量新增用户角色信息 |
| | | * |
| | | * @param userRoleList 用户角色列表 |
| | | * @return 结果 |
| | | */ |
| | | public int batchUserRole(List<SysUserRole> userRoleList); |
| | | |
| | | /** |
| | | * 删除用户和角色关联信息 |
| | | * |
| | | * @param userRole 用户和角色关联信息 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserRoleInfo(SysUserRole userRole); |
| | | |
| | | /** |
| | | * 批量取消授权用户角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要删除的用户数据ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); |
| | | |
| | | |
| | | /** |
| | | * 查询用户和角色关联 |
| | | * |
| | | * @param userId 用户和角色关联主键 |
| | | * @return 用户和角色关联 |
| | | */ |
| | | public SysUserRole selectSysUserRoleByUserId(Long userId); |
| | | |
| | | /** |
| | | * 查询用户和角色关联列表 |
| | | * |
| | | * @param sysUserRole 用户和角色关联 |
| | | * @return 用户和角色关联集合 |
| | | */ |
| | | public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole); |
| | | |
| | | /** |
| | | * 新增用户和角色关联 |
| | | * |
| | | * @param sysUserRole 用户和角色关联 |
| | | * @return 结果 |
| | | */ |
| | | public int insertSysUserRole(SysUserRole sysUserRole); |
| | | |
| | | /** |
| | | * 修改用户和角色关联 |
| | | * |
| | | * @param sysUserRole 用户和角色关联 |
| | | * @return 结果 |
| | | */ |
| | | public int updateSysUserRole(SysUserRole sysUserRole); |
| | | |
| | | /** |
| | | * 删除用户和角色关联 |
| | | * |
| | | * @param userId 用户和角色关联主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteSysUserRoleByUserId(Long userId); |
| | | |
| | | /** |
| | | * 批量删除用户和角色关联 |
| | | * |
| | | * @param userIds 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteSysUserRoleByUserIds(Long[] userIds); |
| | | public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.GenTableColumn; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface GenTableColumnService extends IService<GenTableColumn> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.GenTable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface GenTableService extends IService<GenTable> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysConfigService extends IService<SysConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysDept; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysDeptService extends IService<SysDept> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysDictData; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysDictDataService extends IService<SysDictData> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysDictType; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysDictTypeService extends IService<SysDictType> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysJobLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysJobLogService extends IService<SysJobLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysJob; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysJobService extends IService<SysJob> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysLoginLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysLoginLogService extends IService<SysLoginLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysMenu; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysMenuService extends IService<SysMenu> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysNotice; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysNoticeService extends IService<SysNotice> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysOperLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysOperLogService extends IService<SysOperLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysPost; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysPostService extends IService<SysPost> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysRoleDept; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysRoleDeptService extends IService<SysRoleDept> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysRoleMenu; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysRoleMenuService extends IService<SysRoleMenu> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysRole; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysRoleService extends IService<SysRole> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysUserPost; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysUserPostService extends IService<SysUserPost> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysUserRole; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysUserRoleService extends IService<SysUserRole> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.SysUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface SysUserService extends IService<SysUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.GenTableColumnMapper; |
| | | import com.ruoyi.system.api.model.GenTableColumn; |
| | | import com.ruoyi.account.service.GenTableColumnService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class GenTableColumnServiceImpl extends ServiceImpl<GenTableColumnMapper, GenTableColumn> implements GenTableColumnService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.GenTableMapper; |
| | | import com.ruoyi.system.api.model.GenTable; |
| | | import com.ruoyi.account.service.GenTableService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class GenTableServiceImpl extends ServiceImpl<GenTableMapper, GenTable> implements GenTableService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.api.model.SysConfig; |
| | | import com.ruoyi.account.service.SysConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | |
| | | /** |
| | | * 参数配置 服务层实现 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysConfigServiceImpl implements ISysConfigService { |
| | | @Resource |
| | | private SysConfigMapper configMapper; |
| | | public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService { |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | /** |
| | | * 项目启动时,初始化参数到缓存 |
| | | */ |
| | | @PostConstruct |
| | | public void init() { |
| | | // TODO |
| | | // loadingConfigCache(); |
| | | } |
| | | |
| | | /** |
| | | * 查询参数配置信息 |
| | | * |
| | | * @param configId 参数配置ID |
| | | * @return 参数配置信息 |
| | | */ |
| | | @Override |
| | | public SysConfig selectConfigById(Long configId) { |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigId(configId); |
| | | return configMapper.selectConfig(config); |
| | | } |
| | | |
| | | /** |
| | | * 根据键名查询参数配置信息 |
| | | * |
| | | * @param configKey 参数key |
| | | * @return 参数键值 |
| | | */ |
| | | @Override |
| | | public String selectConfigByKey(String configKey) { |
| | | String configValue = Convert.toStr(redisService.getCacheObject(getCacheKey(configKey))); |
| | | if (StringUtils.isNotEmpty(configValue)) { |
| | | return configValue; |
| | | } |
| | | SysConfig config = new SysConfig(); |
| | | config.setConfigKey(configKey); |
| | | SysConfig retConfig = configMapper.selectConfig(config); |
| | | if (StringUtils.isNotNull(retConfig)) { |
| | | redisService.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); |
| | | return retConfig.getConfigValue(); |
| | | } |
| | | return StringUtils.EMPTY; |
| | | } |
| | | |
| | | /** |
| | | * 查询参数配置列表 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 参数配置集合 |
| | | */ |
| | | @Override |
| | | public List<SysConfig> selectConfigList(SysConfig config) { |
| | | return configMapper.selectConfigList(config); |
| | | } |
| | | |
| | | /** |
| | | * 新增参数配置 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertConfig(SysConfig config) { |
| | | int row = configMapper.insertConfig(config); |
| | | if (row > 0) { |
| | | redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | | * 修改参数配置 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateConfig(SysConfig config) { |
| | | SysConfig temp = configMapper.selectConfigById(config.getConfigId()); |
| | | if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { |
| | | redisService.deleteObject(getCacheKey(temp.getConfigKey())); |
| | | } |
| | | |
| | | int row = configMapper.updateConfig(config); |
| | | if (row > 0) { |
| | | redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除参数信息 |
| | | * |
| | | * @param configIds 需要删除的参数ID |
| | | */ |
| | | @Override |
| | | public void deleteConfigByIds(Long[] configIds) { |
| | | for (Long configId : configIds) { |
| | | SysConfig config = selectConfigById(configId); |
| | | if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { |
| | | throw new ServiceException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); |
| | | } |
| | | configMapper.deleteConfigById(configId); |
| | | redisService.deleteObject(getCacheKey(config.getConfigKey())); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 加载参数缓存数据 |
| | | */ |
| | | @Override |
| | | public void loadingConfigCache() { |
| | | List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); |
| | | for (SysConfig config : configsList) { |
| | | redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 清空参数缓存数据 |
| | | */ |
| | | @Override |
| | | public void clearConfigCache() { |
| | | Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*"); |
| | | redisService.deleteObject(keys); |
| | | } |
| | | |
| | | /** |
| | | * 重置参数缓存数据 |
| | | */ |
| | | @Override |
| | | public void resetConfigCache() { |
| | | clearConfigCache(); |
| | | loadingConfigCache(); |
| | | } |
| | | |
| | | /** |
| | | * 校验参数键名是否唯一 |
| | | * |
| | | * @param config 参数配置信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkConfigKeyUnique(SysConfig config) { |
| | | Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); |
| | | SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); |
| | | if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 设置cache key |
| | | * |
| | | * @param configKey 参数键 |
| | | * @return 缓存键key |
| | | */ |
| | | private String getCacheKey(String configKey) { |
| | | return CacheConstants.SYS_CONFIG_KEY + configKey; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.system.domain.vo.TreeSelect; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysDeptMapper; |
| | | import com.ruoyi.system.api.model.SysDept; |
| | | import com.ruoyi.account.service.SysDeptService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.datascope.annotation.DataScope; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | |
| | | /** |
| | | * 部门管理 服务实现 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysDeptServiceImpl implements ISysDeptService |
| | | { |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | | public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements SysDeptService { |
| | | |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | | |
| | | /** |
| | | * 查询部门管理数据 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 部门信息集合 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d") |
| | | public List<SysDept> selectDeptList(SysDept dept) |
| | | { |
| | | return deptMapper.selectDeptList(dept); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门树结构信息 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 部门树信息集合 |
| | | */ |
| | | @Override |
| | | public List<TreeSelect> selectDeptTreeList(SysDept dept) |
| | | { |
| | | List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); |
| | | return buildDeptTreeSelect(depts); |
| | | } |
| | | |
| | | /** |
| | | * 构建前端所需要树结构 |
| | | * |
| | | * @param depts 部门列表 |
| | | * @return 树结构列表 |
| | | */ |
| | | @Override |
| | | public List<SysDept> buildDeptTree(List<SysDept> depts) |
| | | { |
| | | List<SysDept> returnList = new ArrayList<SysDept>(); |
| | | List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList()); |
| | | for (SysDept dept : depts) |
| | | { |
| | | // 如果是顶级节点, 遍历该父节点的所有子节点 |
| | | if (!tempList.contains(dept.getParentId())) |
| | | { |
| | | recursionFn(depts, dept); |
| | | returnList.add(dept); |
| | | } |
| | | } |
| | | if (returnList.isEmpty()) |
| | | { |
| | | returnList = depts; |
| | | } |
| | | return returnList; |
| | | } |
| | | |
| | | /** |
| | | * 构建前端所需要下拉树结构 |
| | | * |
| | | * @param depts 部门列表 |
| | | * @return 下拉树结构列表 |
| | | */ |
| | | @Override |
| | | public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) |
| | | { |
| | | List<SysDept> deptTrees = buildDeptTree(depts); |
| | | return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * 根据角色ID查询部门树信息 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 选中部门列表 |
| | | */ |
| | | @Override |
| | | public List<Long> selectDeptListByRoleId(Long roleId) |
| | | { |
| | | SysRole role = roleMapper.selectRoleById(roleId); |
| | | return deptMapper.selectDeptListByRoleId(roleId, false); |
| | | } |
| | | |
| | | /** |
| | | * 根据部门ID查询信息 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 部门信息 |
| | | */ |
| | | @Override |
| | | public SysDept selectDeptById(Long deptId) |
| | | { |
| | | return deptMapper.selectDeptById(deptId); |
| | | } |
| | | |
| | | /** |
| | | * 根据ID查询所有子部门(正常状态) |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 子部门数 |
| | | */ |
| | | @Override |
| | | public int selectNormalChildrenDeptById(Long deptId) |
| | | { |
| | | return deptMapper.selectNormalChildrenDeptById(deptId); |
| | | } |
| | | |
| | | /** |
| | | * 是否存在子节点 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean hasChildByDeptId(Long deptId) |
| | | { |
| | | int result = deptMapper.hasChildByDeptId(deptId); |
| | | return result > 0; |
| | | } |
| | | |
| | | /** |
| | | * 查询部门是否存在用户 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 true 存在 false 不存在 |
| | | */ |
| | | @Override |
| | | public boolean checkDeptExistUser(Long deptId) |
| | | { |
| | | int result = deptMapper.checkDeptExistUser(deptId); |
| | | return result > 0; |
| | | } |
| | | |
| | | /** |
| | | * 校验部门名称是否唯一 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkDeptNameUnique(SysDept dept) |
| | | { |
| | | Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); |
| | | SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); |
| | | if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验部门是否有数据权限 |
| | | * |
| | | * @param deptId 部门id |
| | | */ |
| | | @Override |
| | | public void checkDeptDataScope(Long deptId) |
| | | { |
| | | if (!SysUser.isAdmin(SecurityUtils.getUserId())) |
| | | { |
| | | SysDept dept = new SysDept(); |
| | | dept.setDeptId(deptId); |
| | | List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); |
| | | if (StringUtils.isEmpty(depts)) |
| | | { |
| | | throw new ServiceException("没有权限访问部门数据!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增保存部门信息 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDept(SysDept dept) |
| | | { |
| | | SysDept info = deptMapper.selectDeptById(dept.getParentId()); |
| | | // 如果父节点不为正常状态,则不允许新增子节点 |
| | | if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) |
| | | { |
| | | throw new ServiceException("部门停用,不允许新增"); |
| | | } |
| | | dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); |
| | | return deptMapper.insertDept(dept); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存部门信息 |
| | | * |
| | | * @param dept 部门信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateDept(SysDept dept) |
| | | { |
| | | SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); |
| | | SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); |
| | | if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) |
| | | { |
| | | String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); |
| | | String oldAncestors = oldDept.getAncestors(); |
| | | dept.setAncestors(newAncestors); |
| | | updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); |
| | | } |
| | | int result = deptMapper.updateDept(dept); |
| | | if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) |
| | | && !StringUtils.equals("0", dept.getAncestors())) |
| | | { |
| | | // 如果该部门是启用状态,则启用该部门的所有上级部门 |
| | | updateParentDeptStatusNormal(dept); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 修改该部门的父级部门状态 |
| | | * |
| | | * @param dept 当前部门 |
| | | */ |
| | | private void updateParentDeptStatusNormal(SysDept dept) |
| | | { |
| | | String ancestors = dept.getAncestors(); |
| | | Long[] deptIds = Convert.toLongArray(ancestors); |
| | | deptMapper.updateDeptStatusNormal(deptIds); |
| | | } |
| | | |
| | | /** |
| | | * 修改子元素关系 |
| | | * |
| | | * @param deptId 被修改的部门ID |
| | | * @param newAncestors 新的父ID集合 |
| | | * @param oldAncestors 旧的父ID集合 |
| | | */ |
| | | public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) |
| | | { |
| | | List<SysDept> children = deptMapper.selectChildrenDeptById(deptId); |
| | | for (SysDept child : children) |
| | | { |
| | | child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); |
| | | } |
| | | if (children.size() > 0) |
| | | { |
| | | deptMapper.updateDeptChildren(children); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除部门管理信息 |
| | | * |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteDeptById(Long deptId) |
| | | { |
| | | return deptMapper.deleteDeptById(deptId); |
| | | } |
| | | |
| | | /** |
| | | * 递归列表 |
| | | */ |
| | | private void recursionFn(List<SysDept> list, SysDept t) |
| | | { |
| | | // 得到子节点列表 |
| | | List<SysDept> childList = getChildList(list, t); |
| | | t.setChildren(childList); |
| | | for (SysDept tChild : childList) |
| | | { |
| | | if (hasChild(list, tChild)) |
| | | { |
| | | recursionFn(list, tChild); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到子节点列表 |
| | | */ |
| | | private List<SysDept> getChildList(List<SysDept> list, SysDept t) |
| | | { |
| | | List<SysDept> tlist = new ArrayList<SysDept>(); |
| | | Iterator<SysDept> it = list.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | | SysDept n = (SysDept) it.next(); |
| | | if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) |
| | | { |
| | | tlist.add(n); |
| | | } |
| | | } |
| | | return tlist; |
| | | } |
| | | |
| | | /** |
| | | * 判断是否有子节点 |
| | | */ |
| | | private boolean hasChild(List<SysDept> list, SysDept t) |
| | | { |
| | | return getChildList(list, t).size() > 0 ? true : false; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.api.model.SysDictData; |
| | | import com.ruoyi.account.service.SysDictDataService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.security.utils.DictUtils; |
| | | import com.ruoyi.system.api.domain.SysDictData; |
| | | |
| | | /** |
| | | * 字典 业务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysDictDataServiceImpl implements ISysDictDataService |
| | | { |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService { |
| | | |
| | | /** |
| | | * 根据条件分页查询字典数据 |
| | | * |
| | | * @param dictData 字典数据信息 |
| | | * @return 字典数据集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataList(SysDictData dictData) |
| | | { |
| | | return dictDataMapper.selectDictDataList(dictData); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型和字典键值查询字典数据信息 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @param dictValue 字典键值 |
| | | * @return 字典标签 |
| | | */ |
| | | @Override |
| | | public String selectDictLabel(String dictType, String dictValue) |
| | | { |
| | | return dictDataMapper.selectDictLabel(dictType, dictValue); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典数据ID查询信息 |
| | | * |
| | | * @param dictCode 字典数据ID |
| | | * @return 字典数据 |
| | | */ |
| | | @Override |
| | | public SysDictData selectDictDataById(Long dictCode) |
| | | { |
| | | return dictDataMapper.selectDictDataById(dictCode); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除字典数据信息 |
| | | * |
| | | * @param dictCodes 需要删除的字典数据ID |
| | | */ |
| | | @Override |
| | | public void deleteDictDataByIds(Long[] dictCodes) |
| | | { |
| | | for (Long dictCode : dictCodes) |
| | | { |
| | | SysDictData data = selectDictDataById(dictCode); |
| | | dictDataMapper.deleteDictDataById(dictCode); |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); |
| | | DictUtils.setDictCache(data.getDictType(), dictDatas); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增保存字典数据信息 |
| | | * |
| | | * @param data 字典数据信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDictData(SysDictData data) |
| | | { |
| | | int row = dictDataMapper.insertDictData(data); |
| | | if (row > 0) |
| | | { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); |
| | | DictUtils.setDictCache(data.getDictType(), dictDatas); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典数据信息 |
| | | * |
| | | * @param data 字典数据信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateDictData(SysDictData data) |
| | | { |
| | | int row = dictDataMapper.updateDictData(data); |
| | | if (row > 0) |
| | | { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); |
| | | DictUtils.setDictCache(data.getDictType(), dictDatas); |
| | | } |
| | | return row; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.mapper.SysDictTypeMapper; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysDictTypeMapper; |
| | | import com.ruoyi.system.api.model.SysDictType; |
| | | import com.ruoyi.account.service.SysDictTypeService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.utils.DictUtils; |
| | | import com.ruoyi.system.api.domain.SysDictData; |
| | | import com.ruoyi.system.api.domain.SysDictType; |
| | | |
| | | /** |
| | | * 字典 业务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysDictTypeServiceImpl implements ISysDictTypeService |
| | | { |
| | | @Autowired |
| | | private SysDictTypeMapper dictTypeMapper; |
| | | public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements SysDictTypeService { |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | |
| | | /** |
| | | * 项目启动时,初始化字典到缓存 |
| | | */ |
| | | @PostConstruct |
| | | public void init() |
| | | { |
| | | // TODO |
| | | // loadingDictCache(); |
| | | } |
| | | |
| | | /** |
| | | * 根据条件分页查询字典类型 |
| | | * |
| | | * @param dictType 字典类型信息 |
| | | * @return 字典类型集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType) |
| | | { |
| | | return dictTypeMapper.selectDictTypeList(dictType); |
| | | } |
| | | |
| | | /** |
| | | * 根据所有字典类型 |
| | | * |
| | | * @return 字典类型集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictType> selectDictTypeAll() |
| | | { |
| | | return dictTypeMapper.selectDictTypeAll(); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典数据集合信息 |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataByType(String dictType) |
| | | { |
| | | List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); |
| | | if (StringUtils.isNotEmpty(dictDatas)) |
| | | { |
| | | return dictDatas; |
| | | } |
| | | dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| | | if (StringUtils.isNotEmpty(dictDatas)) |
| | | { |
| | | DictUtils.setDictCache(dictType, dictDatas); |
| | | return dictDatas; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型ID查询信息 |
| | | * |
| | | * @param dictId 字典类型ID |
| | | * @return 字典类型 |
| | | */ |
| | | @Override |
| | | public SysDictType selectDictTypeById(Long dictId) |
| | | { |
| | | return dictTypeMapper.selectDictTypeById(dictId); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询信息 |
| | | * |
| | | * @param dictType 字典类型 |
| | | * @return 字典类型 |
| | | */ |
| | | @Override |
| | | public SysDictType selectDictTypeByType(String dictType) |
| | | { |
| | | return dictTypeMapper.selectDictTypeByType(dictType); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除字典类型信息 |
| | | * |
| | | * @param dictIds 需要删除的字典ID |
| | | */ |
| | | @Override |
| | | public void deleteDictTypeByIds(Long[] dictIds) |
| | | { |
| | | for (Long dictId : dictIds) |
| | | { |
| | | SysDictType dictType = selectDictTypeById(dictId); |
| | | if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) |
| | | { |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName())); |
| | | } |
| | | dictTypeMapper.deleteDictTypeById(dictId); |
| | | DictUtils.removeDictCache(dictType.getDictType()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 加载字典缓存数据 |
| | | */ |
| | | @Override |
| | | public void loadingDictCache() |
| | | { |
| | | SysDictData dictData = new SysDictData(); |
| | | dictData.setStatus("0"); |
| | | Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType)); |
| | | for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) |
| | | { |
| | | DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 清空字典缓存数据 |
| | | */ |
| | | @Override |
| | | public void clearDictCache() |
| | | { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | | |
| | | /** |
| | | * 重置字典缓存数据 |
| | | */ |
| | | @Override |
| | | public void resetDictCache() |
| | | { |
| | | clearDictCache(); |
| | | loadingDictCache(); |
| | | } |
| | | |
| | | /** |
| | | * 新增保存字典类型信息 |
| | | * |
| | | * @param dict 字典类型信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertDictType(SysDictType dict) |
| | | { |
| | | int row = dictTypeMapper.insertDictType(dict); |
| | | if (row > 0) |
| | | { |
| | | DictUtils.setDictCache(dict.getDictType(), null); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典类型信息 |
| | | * |
| | | * @param dict 字典类型信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateDictType(SysDictType dict) |
| | | { |
| | | SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); |
| | | dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); |
| | | int row = dictTypeMapper.updateDictType(dict); |
| | | if (row > 0) |
| | | { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType()); |
| | | DictUtils.setDictCache(dict.getDictType(), dictDatas); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | /** |
| | | * 校验字典类型称是否唯一 |
| | | * |
| | | * @param dict 字典类型 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkDictTypeUnique(SysDictType dict) |
| | | { |
| | | Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); |
| | | SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); |
| | | if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysJobLogMapper; |
| | | import com.ruoyi.system.api.model.SysJobLog; |
| | | import com.ruoyi.account.service.SysJobLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog> implements SysJobLogService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysJobMapper; |
| | | import com.ruoyi.system.api.model.SysJob; |
| | | import com.ruoyi.account.service.SysJobService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysJobServiceImpl extends ServiceImpl<SysJobMapper, SysJob> implements SysJobService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysLoginLog; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.mapper.SysLoginLogMapper; |
| | | import com.ruoyi.system.service.ISysLoginLogService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.account.mapper.SysLoginLogMapper; |
| | | import com.ruoyi.system.api.model.SysLoginLog; |
| | | import com.ruoyi.account.service.SysLoginLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/12 15:47 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLoginLog> implements ISysLoginLogService { |
| | | public class SysLoginLogServiceImpl extends ServiceImpl<SysLoginLogMapper, SysLoginLog> implements SysLoginLogService { |
| | | |
| | | @Resource |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * @param name |
| | | * @param basePage |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<SysLoginLog> pageList(String name, BasePage basePage) { |
| | | PageInfo<SysLoginLog> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | List<SysLoginLog> list = this.baseMapper.pageList(pageInfo, name); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加登录日志 |
| | | * @param loginLog |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult addLoginLog(SysLoginLog loginLog) { |
| | | String username = loginLog.getUsername(); |
| | | SysUser sysUser = sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, username).eq(SysUser::getDelFlag, 0)); |
| | | if(null == sysUser){ |
| | | return AjaxResult.error("用户账号无效"); |
| | | } |
| | | loginLog.setUserId(sysUser.getUserId().intValue()); |
| | | loginLog.setCreateTime(LocalDateTime.now()); |
| | | loginLog.setDelFlag(0); |
| | | this.save(loginLog); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.domain.vo.MetaVo; |
| | | import com.ruoyi.system.domain.vo.RouterVo; |
| | | import com.ruoyi.system.domain.vo.TreeSelect; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.account.mapper.SysMenuMapper; |
| | | import com.ruoyi.system.api.model.SysMenu; |
| | | import com.ruoyi.account.service.SysMenuService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 菜单 业务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService |
| | | { |
| | | public static final String PREMISSION_STRING = "perms[\"{0}\"]"; |
| | | public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService { |
| | | |
| | | @Autowired |
| | | private SysMenuMapper menuMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMenuMapper roleMenuMapper; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> selectMenuList(Long userId) |
| | | { |
| | | return selectMenuList(new SysMenu(), userId); |
| | | } |
| | | |
| | | /** |
| | | * 查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> selectMenuList(SysMenu menu, Long userId) |
| | | { |
| | | List<SysMenu> menuList = null; |
| | | // 管理员显示所有菜单信息 |
| | | { |
| | | menu.getParams().put("userId", userId); |
| | | menuList = menuMapper.selectMenuListByUserId(menu); |
| | | } |
| | | return menuList; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID查询权限 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 权限列表 |
| | | */ |
| | | @Override |
| | | public Set<String> selectMenuPermsByUserId(Long userId) |
| | | { |
| | | List<String> perms = menuMapper.selectMenuPermsByUserId(userId); |
| | | Set<String> permsSet = new HashSet<>(); |
| | | for (String perm : perms) |
| | | { |
| | | if (StringUtils.isNotEmpty(perm)) |
| | | { |
| | | permsSet.add(perm); |
| | | } |
| | | } |
| | | return permsSet; |
| | | } |
| | | |
| | | /** |
| | | * 根据角色ID查询权限 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 权限列表 |
| | | */ |
| | | @Override |
| | | public Set<String> selectMenuPermsByRoleId(Long roleId) |
| | | { |
| | | List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId); |
| | | Set<String> permsSet = new HashSet<>(); |
| | | for (String perm : perms) |
| | | { |
| | | if (StringUtils.isNotEmpty(perm)) |
| | | { |
| | | permsSet.add(perm); |
| | | } |
| | | } |
| | | return permsSet; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID查询菜单 |
| | | * |
| | | * @param userId 用户名称 |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> selectMenuTreeByUserId(Long userId) |
| | | { |
| | | List<SysMenu> menus = null; |
| | | if (SecurityUtils.isAdmin(userId)) |
| | | { |
| | | menus = menuMapper.selectMenuTreeAll(); |
| | | } |
| | | else |
| | | { |
| | | menus = menuMapper.selectMenuTreeByUserId(userId); |
| | | } |
| | | return getChildPerms(menus, 0); |
| | | } |
| | | |
| | | /** |
| | | * 根据角色ID查询菜单树信息 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 选中菜单列表 |
| | | */ |
| | | @Override |
| | | public List<Long> selectMenuListByRoleId(Long roleId) |
| | | { |
| | | SysRole role = roleMapper.selectRoleById(roleId); |
| | | return menuMapper.selectMenuListByRoleId(roleId, false); |
| | | } |
| | | |
| | | /** |
| | | * 构建前端路由所需要的菜单 |
| | | * |
| | | * @param menus 菜单列表 |
| | | * @return 路由列表 |
| | | */ |
| | | @Override |
| | | public List<RouterVo> buildMenus(List<SysMenu> menus) |
| | | { |
| | | List<RouterVo> routers = new LinkedList<RouterVo>(); |
| | | for (SysMenu menu : menus) |
| | | { |
| | | RouterVo router = new RouterVo(); |
| | | router.setHidden("1".equals(menu.getVisible())); |
| | | router.setName(getRouteName(menu)); |
| | | router.setPath(getRouterPath(menu)); |
| | | router.setComponent(getComponent(menu)); |
| | | router.setQuery(menu.getQuery()); |
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); |
| | | List<SysMenu> cMenus = menu.getChildren(); |
| | | if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) |
| | | { |
| | | router.setAlwaysShow(true); |
| | | router.setRedirect("noRedirect"); |
| | | router.setChildren(buildMenus(cMenus)); |
| | | } |
| | | else if (isMenuFrame(menu)) |
| | | { |
| | | router.setMeta(null); |
| | | List<RouterVo> childrenList = new ArrayList<RouterVo>(); |
| | | RouterVo children = new RouterVo(); |
| | | children.setPath(menu.getPath()); |
| | | children.setComponent(menu.getComponent()); |
| | | children.setName(StringUtils.capitalize(menu.getPath())); |
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); |
| | | children.setQuery(menu.getQuery()); |
| | | childrenList.add(children); |
| | | router.setChildren(childrenList); |
| | | } |
| | | else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) |
| | | { |
| | | router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); |
| | | router.setPath("/"); |
| | | List<RouterVo> childrenList = new ArrayList<RouterVo>(); |
| | | RouterVo children = new RouterVo(); |
| | | String routerPath = innerLinkReplaceEach(menu.getPath()); |
| | | children.setPath(routerPath); |
| | | children.setComponent(UserConstants.INNER_LINK); |
| | | children.setName(StringUtils.capitalize(routerPath)); |
| | | children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath())); |
| | | childrenList.add(children); |
| | | router.setChildren(childrenList); |
| | | } |
| | | routers.add(router); |
| | | } |
| | | return routers; |
| | | } |
| | | |
| | | /** |
| | | * 构建前端所需要树结构 |
| | | * |
| | | * @param menus 菜单列表 |
| | | * @return 树结构列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> buildMenuTree(List<SysMenu> menus) |
| | | { |
| | | List<SysMenu> returnList = new ArrayList<SysMenu>(); |
| | | List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); |
| | | for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();) |
| | | { |
| | | SysMenu menu = (SysMenu) iterator.next(); |
| | | // 如果是顶级节点, 遍历该父节点的所有子节点 |
| | | if (!tempList.contains(menu.getParentId())) |
| | | { |
| | | recursionFn(menus, menu); |
| | | returnList.add(menu); |
| | | } |
| | | } |
| | | if (returnList.isEmpty()) |
| | | { |
| | | returnList = menus; |
| | | } |
| | | return returnList; |
| | | } |
| | | |
| | | /** |
| | | * 构建前端所需要下拉树结构 |
| | | * |
| | | * @param menus 菜单列表 |
| | | * @return 下拉树结构列表 |
| | | */ |
| | | @Override |
| | | public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) |
| | | { |
| | | List<SysMenu> menuTrees = buildMenuTree(menus); |
| | | return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * 根据菜单ID查询信息 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 菜单信息 |
| | | */ |
| | | @Override |
| | | public SysMenu selectMenuById(Long menuId) |
| | | { |
| | | return menuMapper.selectMenuById(menuId); |
| | | } |
| | | |
| | | /** |
| | | * 是否存在菜单子节点 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean hasChildByMenuId(Long menuId) |
| | | { |
| | | int result = menuMapper.hasChildByMenuId(menuId); |
| | | return result > 0; |
| | | } |
| | | |
| | | /** |
| | | * 查询菜单使用数量 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkMenuExistRole(Long menuId) |
| | | { |
| | | int result = roleMenuMapper.checkMenuExistRole(menuId); |
| | | return result > 0; |
| | | } |
| | | |
| | | /** |
| | | * 新增保存菜单信息 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertMenu(SysMenu menu) |
| | | { |
| | | return menuMapper.insertMenu(menu); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存菜单信息 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateMenu(SysMenu menu) |
| | | { |
| | | return menuMapper.updateMenu(menu); |
| | | } |
| | | |
| | | /** |
| | | * 删除菜单管理信息 |
| | | * |
| | | * @param menuId 菜单ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteMenuById(Long menuId) |
| | | { |
| | | return menuMapper.deleteMenuById(menuId); |
| | | } |
| | | |
| | | /** |
| | | * 校验菜单名称是否唯一 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkMenuNameUnique(SysMenu menu) |
| | | { |
| | | Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); |
| | | SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); |
| | | if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysMenus> getAllMenu() { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUserRole sysUserRole = sysUserRoleMapper.selectSysUserRoleByUserId(userid); |
| | | Long roleId = sysUserRole.getRoleId(); |
| | | List<SysMenus> list=null; |
| | | if(roleId!=1){ |
| | | list = menuMapper.getAllOne(); |
| | | }else { |
| | | list = menuMapper.getAll(); |
| | | } |
| | | |
| | | // 获取所有 |
| | | |
| | | // 第三级 |
| | | List<SysMenus> s3 = list.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); |
| | | // 第二级 |
| | | List<SysMenus> s2 = list.stream().filter(e -> e.getMenuType().equals("C") |
| | | && e.getMenuId() != 1196 |
| | | && e.getMenuId() != 1197 |
| | | && e.getMenuId() != 1198 |
| | | && e.getMenuId() != 1199 |
| | | && e.getMenuId() != 1201 |
| | | && e.getMenuId() != 1205).collect(Collectors.toList()); |
| | | // 第一级 |
| | | List<SysMenus> s1 = list.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); |
| | | |
| | | for (SysMenus menus : s2) { |
| | | List<SysMenus> collect = s3.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); |
| | | menus.setChildren(collect); |
| | | } |
| | | |
| | | for (SysMenus menus : s1) { |
| | | List<SysMenus> collect = s2.stream().filter(e -> e.getParentId().equals(menus.getMenuId())).collect(Collectors.toList()); |
| | | menus.setChildren(collect); |
| | | } |
| | | return s1; |
| | | } |
| | | |
| | | /** |
| | | * 获取路由名称 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 路由名称 |
| | | */ |
| | | public String getRouteName(SysMenu menu) |
| | | { |
| | | String routerName = StringUtils.capitalize(menu.getPath()); |
| | | // 非外链并且是一级目录(类型为目录) |
| | | if (isMenuFrame(menu)) |
| | | { |
| | | routerName = StringUtils.EMPTY; |
| | | } |
| | | return routerName; |
| | | } |
| | | |
| | | /** |
| | | * 获取路由地址 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 路由地址 |
| | | */ |
| | | public String getRouterPath(SysMenu menu) |
| | | { |
| | | String routerPath = menu.getPath(); |
| | | // 内链打开外网方式 |
| | | if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) |
| | | { |
| | | routerPath = innerLinkReplaceEach(routerPath); |
| | | } |
| | | // 非外链并且是一级目录(类型为目录) |
| | | if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) |
| | | && UserConstants.NO_FRAME.equals(menu.getIsFrame())) |
| | | { |
| | | routerPath = "/" + menu.getPath(); |
| | | } |
| | | // 非外链并且是一级目录(类型为菜单) |
| | | else if (isMenuFrame(menu)) |
| | | { |
| | | routerPath = "/"; |
| | | } |
| | | return routerPath; |
| | | } |
| | | |
| | | /** |
| | | * 获取组件信息 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 组件信息 |
| | | */ |
| | | public String getComponent(SysMenu menu) |
| | | { |
| | | String component = UserConstants.LAYOUT; |
| | | if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) |
| | | { |
| | | component = menu.getComponent(); |
| | | } |
| | | else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) |
| | | { |
| | | component = UserConstants.INNER_LINK; |
| | | } |
| | | else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) |
| | | { |
| | | component = UserConstants.PARENT_VIEW; |
| | | } |
| | | return component; |
| | | } |
| | | |
| | | /** |
| | | * 是否为菜单内部跳转 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean isMenuFrame(SysMenu menu) |
| | | { |
| | | return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) |
| | | && menu.getIsFrame().equals(UserConstants.NO_FRAME); |
| | | } |
| | | |
| | | /** |
| | | * 是否为内链组件 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean isInnerLink(SysMenu menu) |
| | | { |
| | | return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); |
| | | } |
| | | |
| | | /** |
| | | * 是否为parent_view组件 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 结果 |
| | | */ |
| | | public boolean isParentView(SysMenu menu) |
| | | { |
| | | return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); |
| | | } |
| | | |
| | | /** |
| | | * 根据父节点的ID获取所有子节点 |
| | | * |
| | | * @param list 分类表 |
| | | * @param parentId 传入的父节点ID |
| | | * @return String |
| | | */ |
| | | public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) |
| | | { |
| | | List<SysMenu> returnList = new ArrayList<SysMenu>(); |
| | | for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();) |
| | | { |
| | | SysMenu t = (SysMenu) iterator.next(); |
| | | // 一、根据传入的某个父节点ID,遍历该父节点的所有子节点 |
| | | if (t.getParentId() == parentId) |
| | | { |
| | | recursionFn(list, t); |
| | | returnList.add(t); |
| | | } |
| | | } |
| | | return returnList; |
| | | } |
| | | |
| | | /** |
| | | * 递归列表 |
| | | * |
| | | * @param list |
| | | * @param t |
| | | */ |
| | | private void recursionFn(List<SysMenu> list, SysMenu t) |
| | | { |
| | | // 得到子节点列表 |
| | | List<SysMenu> childList = getChildList(list, t); |
| | | t.setChildren(childList); |
| | | for (SysMenu tChild : childList) |
| | | { |
| | | if (hasChild(list, tChild)) |
| | | { |
| | | recursionFn(list, tChild); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到子节点列表 |
| | | */ |
| | | private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) |
| | | { |
| | | List<SysMenu> tlist = new ArrayList<SysMenu>(); |
| | | Iterator<SysMenu> it = list.iterator(); |
| | | while (it.hasNext()) |
| | | { |
| | | SysMenu n = (SysMenu) it.next(); |
| | | if (n.getParentId().longValue() == t.getMenuId().longValue()) |
| | | { |
| | | tlist.add(n); |
| | | } |
| | | } |
| | | return tlist; |
| | | } |
| | | |
| | | /** |
| | | * 判断是否有子节点 |
| | | */ |
| | | private boolean hasChild(List<SysMenu> list, SysMenu t) |
| | | { |
| | | return getChildList(list, t).size() > 0; |
| | | } |
| | | |
| | | /** |
| | | * 内链域名特殊字符替换 |
| | | * |
| | | * @return |
| | | */ |
| | | public String innerLinkReplaceEach(String path) |
| | | { |
| | | return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, |
| | | new String[] { "", "", "", "/" }); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.mapper.SysNoticeMapper; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysNoticeMapper; |
| | | import com.ruoyi.system.api.model.SysNotice; |
| | | import com.ruoyi.account.service.SysNoticeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 公告 服务层实现 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysNoticeServiceImpl implements ISysNoticeService { |
| | | @Resource |
| | | private SysNoticeMapper noticeMapper; |
| | | public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService { |
| | | |
| | | /** |
| | | * 查询公告信息 |
| | | * |
| | | * @param noticeId 公告ID |
| | | * @return 公告信息 |
| | | */ |
| | | @Override |
| | | public SysNotice selectNoticeById(Long noticeId) |
| | | { |
| | | return noticeMapper.selectNoticeById(noticeId); |
| | | } |
| | | |
| | | /** |
| | | * 查询公告列表 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 公告集合 |
| | | */ |
| | | @Override |
| | | public List<SysNotice> selectNoticeList(SysNotice notice) |
| | | { |
| | | return noticeMapper.selectNoticeList(notice); |
| | | } |
| | | |
| | | /** |
| | | * 新增公告 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertNotice(SysNotice notice) |
| | | { |
| | | return noticeMapper.insertNotice(notice); |
| | | } |
| | | |
| | | /** |
| | | * 修改公告 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateNotice(SysNotice notice) |
| | | { |
| | | return noticeMapper.updateNotice(notice); |
| | | } |
| | | |
| | | /** |
| | | * 删除公告对象 |
| | | * |
| | | * @param noticeId 公告ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteNoticeById(Long noticeId) |
| | | { |
| | | return noticeMapper.deleteNoticeById(noticeId); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除公告信息 |
| | | * |
| | | * @param noticeIds 需要删除的公告ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteNoticeByIds(Long[] noticeIds) |
| | | { |
| | | return noticeMapper.deleteNoticeByIds(noticeIds); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.SysOperLogMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.account.mapper.SysOperLogMapper; |
| | | import com.ruoyi.system.api.model.SysOperLog; |
| | | import com.ruoyi.account.service.SysOperLogService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.api.domain.SysOperLog; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 操作日志 服务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { |
| | | public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements SysOperLogService { |
| | | |
| | | |
| | | @Resource |
| | | private SysOperLogMapper operLogMapper; |
| | | |
| | | /** |
| | | * 新增操作日志 |
| | | * |
| | | * @param operLog 操作日志对象 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertOperlog(SysOperLog operLog) { |
| | | return operLogMapper.insertOperlog(operLog); |
| | | } |
| | | |
| | | /** |
| | | * 查询系统操作日志集合 |
| | | * |
| | | * @param operLog 操作日志对象 |
| | | * @return 操作日志集合 |
| | | */ |
| | | @Override |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog) { |
| | | return operLogMapper.selectOperLogList(operLog); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除系统操作日志 |
| | | * |
| | | * @param operIds 需要删除的操作日志ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteOperLogByIds(Long[] operIds) { |
| | | return operLogMapper.deleteOperLogByIds(operIds); |
| | | } |
| | | |
| | | /** |
| | | * 查询操作日志详细 |
| | | * |
| | | * @param operId 操作ID |
| | | * @return 操作日志对象 |
| | | */ |
| | | @Override |
| | | public SysOperLog selectOperLogById(Long operId) { |
| | | return operLogMapper.selectOperLogById(operId); |
| | | } |
| | | |
| | | /** |
| | | * 清空操作日志 |
| | | */ |
| | | @Override |
| | | public void cleanOperLog() { |
| | | operLogMapper.cleanOperLog(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysPostMapper; |
| | | import com.ruoyi.system.api.model.SysPost; |
| | | import com.ruoyi.account.service.SysPostService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | |
| | | /** |
| | | * 岗位信息 服务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysPostServiceImpl implements ISysPostService |
| | | { |
| | | @Autowired |
| | | private SysPostMapper postMapper; |
| | | public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements SysPostService { |
| | | |
| | | @Autowired |
| | | private SysUserPostMapper userPostMapper; |
| | | |
| | | /** |
| | | * 查询岗位信息集合 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 岗位信息集合 |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostList(SysPost post) |
| | | { |
| | | return postMapper.selectPostList(post); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有岗位 |
| | | * |
| | | * @return 岗位列表 |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostAll() |
| | | { |
| | | return postMapper.selectPostAll(); |
| | | } |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位信息 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 角色对象信息 |
| | | */ |
| | | @Override |
| | | public SysPost selectPostById(Long postId) |
| | | { |
| | | return postMapper.selectPostById(postId); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID获取岗位选择框列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中岗位ID列表 |
| | | */ |
| | | @Override |
| | | public List<Long> selectPostListByUserId(Long userId) |
| | | { |
| | | return postMapper.selectPostListByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * 校验岗位名称是否唯一 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkPostNameUnique(SysPost post) |
| | | { |
| | | Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostNameUnique(post.getPostName()); |
| | | if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验岗位编码是否唯一 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkPostCodeUnique(SysPost post) |
| | | { |
| | | Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); |
| | | if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位使用数量 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int countUserPostById(Long postId) |
| | | { |
| | | return userPostMapper.countUserPostById(postId); |
| | | } |
| | | |
| | | /** |
| | | * 删除岗位信息 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deletePostById(Long postId) |
| | | { |
| | | return postMapper.deletePostById(postId); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除岗位信息 |
| | | * |
| | | * @param postIds 需要删除的岗位ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deletePostByIds(Long[] postIds) |
| | | { |
| | | for (Long postId : postIds) |
| | | { |
| | | SysPost post = selectPostById(postId); |
| | | if (countUserPostById(postId) > 0) |
| | | { |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName())); |
| | | } |
| | | } |
| | | return postMapper.deletePostByIds(postIds); |
| | | } |
| | | |
| | | /** |
| | | * 新增保存岗位信息 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertPost(SysPost post) |
| | | { |
| | | return postMapper.insertPost(post); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存岗位信息 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updatePost(SysPost post) |
| | | { |
| | | return postMapper.updatePost(post); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysRoleDeptMapper; |
| | | import com.ruoyi.system.api.model.SysRoleDept; |
| | | import com.ruoyi.account.service.SysRoleDeptService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysRoleDeptServiceImpl extends ServiceImpl<SysRoleDeptMapper, SysRoleDept> implements SysRoleDeptService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysRoleMenuMapper; |
| | | import com.ruoyi.system.api.model.SysRoleMenu; |
| | | import com.ruoyi.account.service.SysRoleMenuService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRoleMenu> implements SysRoleMenuService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysRoleDeptMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.account.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.api.model.SysRole; |
| | | import com.ruoyi.account.service.SysRoleService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.datascope.annotation.DataScope; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | |
| | | /** |
| | | * 角色 业务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService { |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | | public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService { |
| | | |
| | | @Autowired |
| | | private SysRoleMenuMapper roleMenuMapper; |
| | | |
| | | @Autowired |
| | | private SysUserRoleMapper userRoleMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleDeptMapper roleDeptMapper; |
| | | |
| | | /** |
| | | * 根据条件分页查询角色数据 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 角色数据集合信息 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d") |
| | | public List<SysRole> selectRoleList(SysRole role) { |
| | | return roleMapper.selectRoleList(role); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID查询角色 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 角色列表 |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRolesByUserId(Long userId) { |
| | | List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId); |
| | | List<SysRole> roles = selectRoleAll(); |
| | | for (SysRole role : roles) { |
| | | for (SysRole userRole : userRoles) { |
| | | if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) { |
| | | role.setFlag(true); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return roles; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID查询权限 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 权限列表 |
| | | */ |
| | | @Override |
| | | public Set<String> selectRolePermissionByUserId(Long userId) { |
| | | List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId); |
| | | Set<String> permsSet = new HashSet<>(); |
| | | for (SysRole perm : perms) { |
| | | if (StringUtils.isNotNull(perm)) { |
| | | permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); |
| | | } |
| | | } |
| | | return permsSet; |
| | | } |
| | | |
| | | /** |
| | | * 查询所有角色 |
| | | * |
| | | * @return 角色列表 |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRoleAll() { |
| | | return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID获取角色选择框列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 选中角色ID列表 |
| | | */ |
| | | @Override |
| | | public List<Long> selectRoleListByUserId(Long userId) { |
| | | return roleMapper.selectRoleListByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * 通过角色ID查询角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 角色对象信息 |
| | | */ |
| | | @Override |
| | | public SysRole selectRoleById(Long roleId) { |
| | | return roleMapper.selectRoleById(roleId); |
| | | } |
| | | |
| | | /** |
| | | * 校验角色名称是否唯一 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkRoleNameUnique(SysRole role) { |
| | | Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); |
| | | SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); |
| | | if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验角色权限是否唯一 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkRoleKeyUnique(SysRole role) { |
| | | Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); |
| | | SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); |
| | | if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验角色是否允许操作 |
| | | * |
| | | * @param role 角色信息 |
| | | */ |
| | | @Override |
| | | public void checkRoleAllowed(SysRole role) { |
| | | if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) { |
| | | throw new ServiceException("不允许操作超级管理员角色"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验角色是否有数据权限 |
| | | * |
| | | * @param roleId 角色id |
| | | */ |
| | | @Override |
| | | public void checkRoleDataScope(Long roleId) { |
| | | if (!SysUser.isAdmin(SecurityUtils.getUserId())) { |
| | | SysRole role = new SysRole(); |
| | | role.setRoleId(roleId); |
| | | List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role); |
| | | if (StringUtils.isEmpty(roles)) { |
| | | throw new ServiceException("没有权限访问角色数据!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过角色ID查询角色使用数量 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int countUserRoleByRoleId(Long roleId) { |
| | | return userRoleMapper.countUserRoleByRoleId(roleId); |
| | | } |
| | | |
| | | /** |
| | | * 新增保存角色信息 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertRole(SysRole role) { |
| | | // 新增角色信息 |
| | | roleMapper.insertRole(role); |
| | | return insertRoleMenu(role); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存角色信息 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateRole(SysRole role) { |
| | | // 修改角色信息 |
| | | // roleMapper.updateRole(role); |
| | | // 删除角色与菜单关联 |
| | | // roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); |
| | | return roleMapper.updateRole(role); |
| | | } |
| | | |
| | | /** |
| | | * 修改角色状态 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateRoleStatus(SysRole role) { |
| | | return roleMapper.updateRole(role); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据权限信息 |
| | | * |
| | | * @param role 角色信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int authDataScope(SysRole role) { |
| | | // 修改角色信息 |
| | | roleMapper.updateRole(role); |
| | | // 删除角色与部门关联 |
| | | roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); |
| | | // 新增角色和部门信息(数据权限) |
| | | return insertRoleDept(role); |
| | | } |
| | | |
| | | /** |
| | | * 新增角色菜单信息 |
| | | * |
| | | * @param role 角色对象 |
| | | */ |
| | | public int insertRoleMenu(SysRole role) { |
| | | int rows = 1; |
| | | // 新增用户与角色管理 |
| | | List<SysRoleMenu> list = new ArrayList<SysRoleMenu>(); |
| | | Long[] menuIds = role.getMenuIds(); |
| | | // List<Long> longs = Arrays.asList(menuIds); |
| | | List<Long> longs = new ArrayList<>(); |
| | | for (Long menuId : menuIds) { |
| | | longs.add(menuId); |
| | | } |
| | | if (!longs.contains(1061L)) { |
| | | longs.add(1061L); |
| | | longs.add(1062L); |
| | | longs.add(1065L); |
| | | longs.add(1073L); |
| | | longs.add(1161L); |
| | | longs.add(1203L); |
| | | } |
| | | |
| | | for (Long menuId : longs) { |
| | | SysRoleMenu rm = new SysRoleMenu(); |
| | | rm.setRoleId(role.getRoleId()); |
| | | rm.setMenuId(menuId); |
| | | list.add(rm); |
| | | } |
| | | if (list.size() > 0) { |
| | | rows = roleMenuMapper.batchRoleMenu(list); |
| | | } |
| | | return rows; |
| | | } |
| | | |
| | | /** |
| | | * 新增角色部门信息(数据权限) |
| | | * |
| | | * @param role 角色对象 |
| | | */ |
| | | public int insertRoleDept(SysRole role) { |
| | | int rows = 1; |
| | | // 新增角色与部门(数据权限)管理 |
| | | List<SysRoleDept> list = new ArrayList<SysRoleDept>(); |
| | | for (Long deptId : role.getDeptIds()) { |
| | | SysRoleDept rd = new SysRoleDept(); |
| | | rd.setRoleId(role.getRoleId()); |
| | | rd.setDeptId(deptId); |
| | | list.add(rd); |
| | | } |
| | | if (list.size() > 0) { |
| | | rows = roleDeptMapper.batchRoleDept(list); |
| | | } |
| | | return rows; |
| | | } |
| | | |
| | | /** |
| | | * 通过角色ID删除角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteRoleById(Long roleId) { |
| | | // 删除角色与菜单关联 |
| | | roleMenuMapper.deleteRoleMenuByRoleId(roleId); |
| | | // 删除角色与部门关联 |
| | | roleDeptMapper.deleteRoleDeptByRoleId(roleId); |
| | | return roleMapper.deleteRoleById(roleId); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除角色信息 |
| | | * |
| | | * @param roleIds 需要删除的角色ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteRoleByIds(Long[] roleIds) { |
| | | for (Long roleId : roleIds) { |
| | | checkRoleAllowed(new SysRole(roleId)); |
| | | checkRoleDataScope(roleId); |
| | | SysRole role = selectRoleById(roleId); |
| | | if (countUserRoleByRoleId(roleId) > 0) { |
| | | throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName())); |
| | | } |
| | | } |
| | | // 删除角色与菜单关联 |
| | | roleMenuMapper.deleteRoleMenu(roleIds); |
| | | // 删除角色与部门关联 |
| | | roleDeptMapper.deleteRoleDept(roleIds); |
| | | return roleMapper.deleteRoleByIds(roleIds); |
| | | } |
| | | |
| | | /** |
| | | * 取消授权用户角色 |
| | | * |
| | | * @param userRole 用户和角色关联信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteAuthUser(SysUserRole userRole) { |
| | | return userRoleMapper.deleteUserRoleInfo(userRole); |
| | | } |
| | | |
| | | /** |
| | | * 批量取消授权用户角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要取消授权的用户数据ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteAuthUsers(Long roleId, Long[] userIds) { |
| | | return userRoleMapper.deleteUserRoleInfos(roleId, userIds); |
| | | } |
| | | |
| | | /** |
| | | * 批量选择授权用户角色 |
| | | * |
| | | * @param roleId 角色ID |
| | | * @param userIds 需要授权的用户数据ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertAuthUsers(Long roleId, Long[] userIds) { |
| | | // 新增用户与角色管理 |
| | | List<SysUserRole> list = new ArrayList<SysUserRole>(); |
| | | for (Long userId : userIds) { |
| | | SysUserRole ur = new SysUserRole(); |
| | | ur.setUserId(userId); |
| | | ur.setRoleId(roleId); |
| | | list.add(ur); |
| | | } |
| | | return userRoleMapper.batchUserRole(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysRole> isExitUpdate(String roleName, Long roleId, Integer companyId) { |
| | | return roleMapper.isExitUpdate(roleName, roleId, companyId); |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param ids 数据id集合 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SysRole> getSysRoleByIds(List<Integer> ids) { |
| | | return this.baseMapper.getSysRoleByIds(ids); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.api.model.SysUserPost; |
| | | import com.ruoyi.account.service.SysUserPostService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysUserPostServiceImpl extends ServiceImpl<SysUserPostMapper, SysUserPost> implements SysUserPostService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.service.ISysUserRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.account.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.api.model.SysUserRole; |
| | | import com.ruoyi.account.service.SysUserRoleService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 用户和角色关联Service业务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @date 2023-06-12 |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService { |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService { |
| | | |
| | | /** |
| | | * 查询用户和角色关联 |
| | | * |
| | | * @param userId 用户和角色关联主键 |
| | | * @return 用户和角色关联 |
| | | */ |
| | | @Override |
| | | public SysUserRole selectSysUserRoleByUserId(Long userId) { |
| | | return sysUserRoleMapper.selectSysUserRoleByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户和角色关联列表 |
| | | * |
| | | * @param sysUserRole 用户和角色关联 |
| | | * @return 用户和角色关联 |
| | | */ |
| | | @Override |
| | | public List<SysUserRole> selectSysUserRoleList(SysUserRole sysUserRole) { |
| | | return sysUserRoleMapper.selectSysUserRoleList(sysUserRole); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户和角色关联 |
| | | * |
| | | * @param sysUserRole 用户和角色关联 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertSysUserRole(SysUserRole sysUserRole) { |
| | | return sysUserRoleMapper.insertSysUserRole(sysUserRole); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户和角色关联 |
| | | * |
| | | * @param sysUserRole 用户和角色关联 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateSysUserRole(SysUserRole sysUserRole) { |
| | | return sysUserRoleMapper.updateSysUserRole(sysUserRole); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除用户和角色关联 |
| | | * |
| | | * @param userIds 需要删除的用户和角色关联主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSysUserRoleByUserIds(Long[] userIds) { |
| | | return sysUserRoleMapper.deleteSysUserRoleByUserIds(userIds); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户和角色关联信息 |
| | | * |
| | | * @param userId 用户和角色关联主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSysUserRoleByUserId(Long userId) { |
| | | return sysUserRoleMapper.deleteSysUserRoleByUserId(userId); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Validator; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.query.ChangeUserQuery; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.query.GetSysUserList; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.ruoyi.account.mapper.SysUserMapper; |
| | | import com.ruoyi.system.api.model.SysUser; |
| | | import com.ruoyi.account.service.SysUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanValidators; |
| | | import com.ruoyi.common.datascope.annotation.DataScope; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | |
| | | /** |
| | | * 用户 业务层处理 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author ruoyi |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { |
| | | private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SysUserMapper userMapper; |
| | | |
| | | @Resource |
| | | private SysRoleMapper roleMapper; |
| | | |
| | | @Resource |
| | | private SysPostMapper postMapper; |
| | | |
| | | @Resource |
| | | private SysUserRoleMapper userRoleMapper; |
| | | |
| | | @Resource |
| | | private SysUserPostMapper userPostMapper; |
| | | |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | |
| | | @Resource |
| | | protected Validator validator; |
| | | |
| | | @Resource |
| | | private ISysUserRoleService sysUserRoleService; |
| | | |
| | | @Resource |
| | | private ISysRoleService sysRoleService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<SysUser> selectUserList(SysUser user) { |
| | | return userMapper.selectUserList(user); |
| | | } |
| | | |
| | | /** |
| | | * 根据条件分页查询已分配用户角色列表 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<SysUser> selectAllocatedList(SysUser user) { |
| | | return userMapper.selectAllocatedList(user); |
| | | } |
| | | |
| | | /** |
| | | * 根据条件分页查询未分配用户角色列表 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 用户信息集合信息 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<SysUser> selectUnallocatedList(SysUser user) { |
| | | return userMapper.selectUnallocatedList(user); |
| | | } |
| | | |
| | | /** |
| | | * 通过用户名查询用户 |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 用户对象信息 |
| | | */ |
| | | @Override |
| | | public SysUser selectUserByUserName(String userName) { |
| | | return userMapper.selectUserByUserName(userName); |
| | | } |
| | | |
| | | /** |
| | | * 通过用户ID查询用户 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 用户对象信息 |
| | | */ |
| | | @Override |
| | | public SysUser selectUserById(Long userId) { |
| | | return userMapper.selectUserById(userId); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户所属角色组 |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String selectUserRoleGroup(String userName) { |
| | | List<SysRole> list = roleMapper.selectRolesByUserName(userName); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(",")); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户所属岗位组 |
| | | * |
| | | * @param userName 用户名 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String selectUserPostGroup(String userName) { |
| | | List<SysPost> list = postMapper.selectPostsByUserName(userName); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return list.stream().map(SysPost::getPostName).collect(Collectors.joining(",")); |
| | | } |
| | | |
| | | /** |
| | | * 校验用户名称是否唯一 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean checkUserNameUnique(SysUser user) { |
| | | Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkUserNameUnique(user.getUserName()); |
| | | if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验手机号码是否唯一 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean checkPhoneUnique(SysUser user) { |
| | | Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); |
| | | if (StringUtils.isNotNull(info)) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验email是否唯一 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean checkEmailUnique(SysUser user) { |
| | | Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkEmailUnique(user.getEmail()); |
| | | if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | /** |
| | | * 校验用户是否允许操作 |
| | | * |
| | | * @param user 用户信息 |
| | | */ |
| | | @Override |
| | | public void checkUserAllowed(SysUser user) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | if (StringUtils.isNotNull(user.getUserId()) && !userid.equals(user.getUserId()) && user.isAdmin()) { |
| | | throw new ServiceException("不允许操作超级管理员用户"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验用户是否有数据权限 |
| | | * |
| | | * @param userId 用户id |
| | | */ |
| | | @Override |
| | | public void checkUserDataScope(Long userId) { |
| | | if (!SysUser.isAdmin(SecurityUtils.getUserId())) { |
| | | SysUser user = new SysUser(); |
| | | user.setUserId(userId); |
| | | List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user); |
| | | if (StringUtils.isEmpty(users)) { |
| | | throw new ServiceException("没有权限访问用户数据!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增保存用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertUser(SysUser user) { |
| | | // 新增用户信息 |
| | | int rows = userMapper.insertUser(user); |
| | | // // 新增用户岗位关联 |
| | | // insertUserPost(user); |
| | | // // 新增用户与角色管理 |
| | | // insertUserRole(user); |
| | | return rows; |
| | | } |
| | | |
| | | /** |
| | | * 注册用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean registerUser(SysUser user) { |
| | | return userMapper.insertUser(user) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 修改保存用户信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateUser(SysUser user) { |
| | | // Long userId = user.getUserId(); |
| | | // // 删除用户与角色关联 |
| | | // userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // // 新增用户与角色管理 |
| | | // insertUserRole(user); |
| | | // // 删除用户与岗位关联 |
| | | // userPostMapper.deleteUserPostByUserId(userId); |
| | | // // 新增用户与岗位管理 |
| | | // insertUserPost(user); |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param roleIds 角色组 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void insertUserAuth(Long userId, Long[] roleIds) { |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | insertUserRole(userId, roleIds); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户状态 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateUserStatus(SysUser user) { |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户基本信息 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateUserProfile(SysUser user) { |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户头像 |
| | | * |
| | | * @param userName 用户名 |
| | | * @param avatar 头像地址 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public boolean updateUserAvatar(String userName, String avatar) { |
| | | return userMapper.updateUserAvatar(userName, avatar) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | | * |
| | | * @param user 用户信息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int resetPwd(SysUser user) { |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | | /** |
| | | * 重置用户密码 |
| | | * |
| | | * @param userName 用户名 |
| | | * @param password 密码 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int resetUserPwd(String userName, String password) { |
| | | return userMapper.resetUserPwd(userName, password); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户角色信息 |
| | | * |
| | | * @param user 用户对象 |
| | | */ |
| | | public void insertUserRole(SysUser user) { |
| | | this.insertUserRole(user.getUserId(), user.getRoleIds()); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户岗位信息 |
| | | * |
| | | * @param user 用户对象 |
| | | */ |
| | | public void insertUserPost(SysUser user) { |
| | | Long[] posts = user.getPostIds(); |
| | | if (StringUtils.isNotEmpty(posts)) { |
| | | // 新增用户与岗位管理 |
| | | List<SysUserPost> list = new ArrayList<SysUserPost>(); |
| | | for (Long postId : posts) { |
| | | SysUserPost up = new SysUserPost(); |
| | | up.setUserId(user.getUserId()); |
| | | up.setPostId(postId); |
| | | list.add(up); |
| | | } |
| | | userPostMapper.batchUserPost(list); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增用户角色信息 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param roleIds 角色组 |
| | | */ |
| | | public void insertUserRole(Long userId, Long[] roleIds) { |
| | | if (StringUtils.isNotEmpty(roleIds)) { |
| | | // 新增用户与角色管理 |
| | | List<SysUserRole> list = new ArrayList<SysUserRole>(); |
| | | for (Long roleId : roleIds) { |
| | | SysUserRole ur = new SysUserRole(); |
| | | ur.setUserId(userId); |
| | | ur.setRoleId(roleId); |
| | | list.add(ur); |
| | | } |
| | | userRoleMapper.batchUserRole(list); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过用户ID删除用户 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteUserById(Long userId) { |
| | | // 删除用户与角色关联 |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // 删除用户与岗位表 |
| | | userPostMapper.deleteUserPostByUserId(userId); |
| | | return userMapper.deleteUserById(userId); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除用户信息 |
| | | * |
| | | * @param userIds 需要删除的用户ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteUserByIds(Long[] userIds) { |
| | | for (Long userId : userIds) { |
| | | checkUserAllowed(new SysUser(userId)); |
| | | // checkUserDataScope(userId); |
| | | } |
| | | // 删除用户与角色关联 |
| | | // userRoleMapper.deleteUserRole(userIds); |
| | | // // 删除用户与岗位关联 |
| | | // userPostMapper.deleteUserPost(userIds); |
| | | return userMapper.deleteUserByIds(userIds); |
| | | } |
| | | |
| | | /** |
| | | * 导入用户数据 |
| | | * |
| | | * @param userList 用户数据列表 |
| | | * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 |
| | | * @param operName 操作用户 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) { |
| | | if (StringUtils.isNull(userList) || userList.size() == 0) { |
| | | throw new ServiceException("导入用户数据不能为空!"); |
| | | } |
| | | int successNum = 0; |
| | | int failureNum = 0; |
| | | StringBuilder successMsg = new StringBuilder(); |
| | | StringBuilder failureMsg = new StringBuilder(); |
| | | String password = configService.selectConfigByKey("sys.user.initPassword"); |
| | | for (SysUser user : userList) { |
| | | try { |
| | | // 验证是否存在这个用户 |
| | | SysUser u = userMapper.selectUserByUserName(user.getUserName()); |
| | | if (StringUtils.isNull(u)) { |
| | | BeanValidators.validateWithException(validator, user); |
| | | user.setPassword(SecurityUtils.encryptPassword(password)); |
| | | user.setCreateBy(operName); |
| | | userMapper.insertUser(user); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功"); |
| | | } else if (isUpdateSupport) { |
| | | BeanValidators.validateWithException(validator, user); |
| | | checkUserAllowed(u); |
| | | checkUserDataScope(u.getUserId()); |
| | | user.setUserId(u.getUserId()); |
| | | user.setUpdateBy(operName); |
| | | userMapper.updateUser(user); |
| | | successNum++; |
| | | successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功"); |
| | | } else { |
| | | failureNum++; |
| | | failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在"); |
| | | } |
| | | } catch (Exception e) { |
| | | failureNum++; |
| | | String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:"; |
| | | failureMsg.append(msg + e.getMessage()); |
| | | log.error(msg, e); |
| | | } |
| | | } |
| | | if (failureNum > 0) { |
| | | failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); |
| | | throw new ServiceException(failureMsg.toString()); |
| | | } else { |
| | | successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); |
| | | } |
| | | return successMsg.toString(); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList) { |
| | | List<SysUser> list = this.baseMapper.getList(pageInfo, getSysUserList); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<SysUser> getAllList(PageInfo<SysUser> pageInfo, List<Integer> collect) { |
| | | return this.baseMapper.getAllList(pageInfo, collect); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getSysUserFromPhone(String phoneNumber) { |
| | | return this.baseMapper.getSysUserFromPhone(phoneNumber); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSysUser(ArrayList<Integer> userIds) { |
| | | this.baseMapper.deleteSysUser(userIds); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<SysUser> getChangeUserList(ChangeUserQuery query) { |
| | | PageInfo<SysUser> pageInfo = new PageInfo<>(query.getPageCurr(), query.getPageSize()); |
| | | List<SysUser> list = this.baseMapper.getChangeUserList(pageInfo, query); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService { |
| | | |
| | | } |
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.ruoyi.account.mapper.GenTableColumnMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.GenTableColumn"> |
| | | <id column="column_id" property="columnId" /> |
| | | <result column="table_id" property="tableId" /> |
| | | <result column="column_name" property="columnName" /> |
| | | <result column="column_comment" property="columnComment" /> |
| | | <result column="column_type" property="columnType" /> |
| | | <result column="java_type" property="javaType" /> |
| | | <result column="java_field" property="javaField" /> |
| | | <result column="is_pk" property="isPk" /> |
| | | <result column="is_increment" property="isIncrement" /> |
| | | <result column="is_required" property="isRequired" /> |
| | | <result column="is_insert" property="isInsert" /> |
| | | <result column="is_edit" property="isEdit" /> |
| | | <result column="is_list" property="isList" /> |
| | | <result column="is_query" property="isQuery" /> |
| | | <result column="query_type" property="queryType" /> |
| | | <result column="html_type" property="htmlType" /> |
| | | <result column="dict_type" property="dictType" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.GenTableMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.GenTable"> |
| | | <id column="table_id" property="tableId" /> |
| | | <result column="table_name" property="tableName" /> |
| | | <result column="table_comment" property="tableComment" /> |
| | | <result column="sub_table_name" property="subTableName" /> |
| | | <result column="sub_table_fk_name" property="subTableFkName" /> |
| | | <result column="class_name" property="className" /> |
| | | <result column="tpl_category" property="tplCategory" /> |
| | | <result column="package_name" property="packageName" /> |
| | | <result column="module_name" property="moduleName" /> |
| | | <result column="business_name" property="businessName" /> |
| | | <result column="function_name" property="functionName" /> |
| | | <result column="function_author" property="functionAuthor" /> |
| | | <result column="gen_type" property="genType" /> |
| | | <result column="gen_path" property="genPath" /> |
| | | <result column="options" property="options" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysConfigMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysConfig"> |
| | | <id column="config_id" property="configId" /> |
| | | <result column="config_name" property="configName" /> |
| | | <result column="config_key" property="configKey" /> |
| | | <result column="config_value" property="configValue" /> |
| | | <result column="config_type" property="configType" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysDeptMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysDept"> |
| | | <id column="dept_id" property="deptId" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="ancestors" property="ancestors" /> |
| | | <result column="dept_name" property="deptName" /> |
| | | <result column="order_num" property="orderNum" /> |
| | | <result column="leader" property="leader" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="email" property="email" /> |
| | | <result column="status" property="status" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="shop_id" property="shopId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email, status, del_flag, create_by, create_time, update_by, update_time, shop_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysDictDataMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysDictData"> |
| | | <id column="dict_code" property="dictCode" /> |
| | | <result column="dict_sort" property="dictSort" /> |
| | | <result column="dict_label" property="dictLabel" /> |
| | | <result column="dict_value" property="dictValue" /> |
| | | <result column="dict_type" property="dictType" /> |
| | | <result column="css_class" property="cssClass" /> |
| | | <result column="list_class" property="listClass" /> |
| | | <result column="is_default" property="isDefault" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysDictTypeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysDictType"> |
| | | <id column="dict_id" property="dictId" /> |
| | | <result column="dict_name" property="dictName" /> |
| | | <result column="dict_type" property="dictType" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysJobLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysJobLog"> |
| | | <id column="job_log_id" property="jobLogId" /> |
| | | <result column="job_name" property="jobName" /> |
| | | <result column="job_group" property="jobGroup" /> |
| | | <result column="invoke_target" property="invokeTarget" /> |
| | | <result column="job_message" property="jobMessage" /> |
| | | <result column="status" property="status" /> |
| | | <result column="exception_info" property="exceptionInfo" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysJobMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysJob"> |
| | | <id column="job_id" property="jobId" /> |
| | | <result column="job_name" property="jobName" /> |
| | | <result column="job_group" property="jobGroup" /> |
| | | <result column="invoke_target" property="invokeTarget" /> |
| | | <result column="cron_expression" property="cronExpression" /> |
| | | <result column="misfire_policy" property="misfirePolicy" /> |
| | | <result column="concurrent" property="concurrent" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysLoginLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysLoginLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="username" property="username" /> |
| | | <result column="ip_address" property="ipAddress" /> |
| | | <result column="address" property="address" /> |
| | | <result column="browser_type" property="browserType" /> |
| | | <result column="operating_system" property="operatingSystem" /> |
| | | <result column="login_time" property="loginTime" /> |
| | | <result column="login_status" property="loginStatus" /> |
| | | <result column="message" property="message" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, username, ip_address, address, browser_type, operating_system, login_time, login_status, message, create_time, del_flag |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysMenuMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysMenu"> |
| | | <id column="menu_id" property="menuId" /> |
| | | <result column="menu_name" property="menuName" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="order_num" property="orderNum" /> |
| | | <result column="path" property="path" /> |
| | | <result column="component" property="component" /> |
| | | <result column="query" property="query" /> |
| | | <result column="is_frame" property="isFrame" /> |
| | | <result column="is_cache" property="isCache" /> |
| | | <result column="menu_type" property="menuType" /> |
| | | <result column="visible" property="visible" /> |
| | | <result column="status" property="status" /> |
| | | <result column="perms" property="perms" /> |
| | | <result column="icon" property="icon" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysNoticeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysNotice"> |
| | | <id column="notice_id" property="noticeId" /> |
| | | <result column="notice_title" property="noticeTitle" /> |
| | | <result column="notice_type" property="noticeType" /> |
| | | <result column="notice_content" property="noticeContent" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysOperLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysOperLog"> |
| | | <id column="oper_id" property="operId" /> |
| | | <result column="title" property="title" /> |
| | | <result column="business_type" property="businessType" /> |
| | | <result column="method" property="method" /> |
| | | <result column="request_method" property="requestMethod" /> |
| | | <result column="operator_type" property="operatorType" /> |
| | | <result column="oper_name" property="operName" /> |
| | | <result column="dept_name" property="deptName" /> |
| | | <result column="oper_url" property="operUrl" /> |
| | | <result column="oper_ip" property="operIp" /> |
| | | <result column="oper_location" property="operLocation" /> |
| | | <result column="oper_param" property="operParam" /> |
| | | <result column="json_result" property="jsonResult" /> |
| | | <result column="status" property="status" /> |
| | | <result column="error_msg" property="errorMsg" /> |
| | | <result column="oper_time" property="operTime" /> |
| | | <result column="cost_time" property="costTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysPostMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysPost"> |
| | | <id column="post_id" property="postId" /> |
| | | <result column="post_code" property="postCode" /> |
| | | <result column="post_name" property="postName" /> |
| | | <result column="post_sort" property="postSort" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | post_id, post_code, post_name, post_sort, status, create_by, create_time, update_by, update_time, remark |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysRoleDeptMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysRoleDept"> |
| | | <id column="role_id" property="roleId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | role_id, dept_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysRoleMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysRole"> |
| | | <id column="role_id" property="roleId" /> |
| | | <result column="role_name" property="roleName" /> |
| | | <result column="role_key" property="roleKey" /> |
| | | <result column="data_scope" property="dataScope" /> |
| | | <result column="status" property="status" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="shop_id" property="shopId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | role_id, role_name, role_key, data_scope, status, del_flag, create_by, create_time, update_by, update_time, remark, shop_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysRoleMenuMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysRoleMenu"> |
| | | <id column="role_id" property="roleId" /> |
| | | <result column="menu_id" property="menuId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | role_id, menu_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysUser"> |
| | | <id column="user_id" property="userId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="user_name" property="userName" /> |
| | | <result column="nick_name" property="nickName" /> |
| | | <result column="user_type" property="userType" /> |
| | | <result column="email" property="email" /> |
| | | <result column="phonenumber" property="phonenumber" /> |
| | | <result column="sex" property="sex" /> |
| | | <result column="avatar" property="avatar" /> |
| | | <result column="password" property="password" /> |
| | | <result column="status" property="status" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="login_ip" property="loginIp" /> |
| | | <result column="login_date" property="loginDate" /> |
| | | <result column="roleType" property="roleType" /> |
| | | <result column="passWordUpdate" property="passWordUpdate" /> |
| | | <result column="objectId" property="objectId" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="forbidden_remark" property="forbiddenRemark" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, roleType, passWordUpdate, objectId, create_by, create_time, update_by, update_time, remark, forbidden_remark, app_user_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysUserPostMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysUserPost"> |
| | | <id column="user_id" property="userId" /> |
| | | <result column="post_id" property="postId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | user_id, post_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.SysUserRoleMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.api.model.SysUserRole"> |
| | | <id column="user_id" property="userId" /> |
| | | <result column="role_id" property="roleId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | user_id, role_id |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/agent-application") |
| | | public class AgentApplicationController { |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.IAppUserService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/21 9:47 |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/appUser") |
| | | @RequestMapping("/app-user") |
| | | public class AppUserController { |
| | | |
| | | @Resource |
| | | private IAppUserService appUserService; |
| | | |
| | | |
| | | /** |
| | | * 根据id获取用户信息 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/getAppUserById") |
| | | public AppUser getAppUserById(@RequestParam("id") Long id){ |
| | | return appUserService.getById(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-address") |
| | | public class UserAddressController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-cancellation-log") |
| | | public class UserCancellationLogController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-change-log") |
| | | public class UserChangeLogController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-click-log") |
| | | public class UserClickLogController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-coupon") |
| | | public class UserCouponController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-point") |
| | | public class UserPointController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user-sign-record") |
| | | public class UserSignRecordController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/withdrawal-requests") |
| | | public class WithdrawalRequestsController { |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.apache.logging.log4j.core.config.Order; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface AgentApplicationMapper extends BaseMapper<AgentApplication> { |
| | | |
| | | } |
| | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/21 9:46 |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface AppUserMapper extends BaseMapper<AppUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserAddressMapper extends BaseMapper<UserAddress> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserCancellationLogMapper extends BaseMapper<UserCancellationLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserChangeLogMapper extends BaseMapper<UserChangeLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserClickLogMapper extends BaseMapper<UserClickLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserCouponMapper extends BaseMapper<UserCoupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserPointMapper extends BaseMapper<UserPoint> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserSignRecordMapper extends BaseMapper<UserSignRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface WithdrawalRequestsMapper extends BaseMapper<WithdrawalRequests> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface AgentApplicationService extends IService<AgentApplication> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface AppUserService extends IService<AppUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserAddressService extends IService<UserAddress> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserCancellationLogService extends IService<UserCancellationLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserChangeLogService extends IService<UserChangeLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserClickLogService extends IService<UserClickLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserCouponService extends IService<UserCoupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserPointService extends IService<UserPoint> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserSignRecordService extends IService<UserSignRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface WithdrawalRequestsService extends IService<WithdrawalRequests> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.mapper.AgentApplicationMapper; |
| | | import com.ruoyi.account.service.AgentApplicationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class AgentApplicationServiceImpl extends ServiceImpl<AgentApplicationMapper, AgentApplication> implements AgentApplicationService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.mapper.AppUserMapper; |
| | | import com.ruoyi.account.service.IAppUserService; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/21 9:46 |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements IAppUserService { |
| | | public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements AppUserService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserAddressMapper; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.account.service.UserAddressService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserAddressServiceImpl extends ServiceImpl<UserAddressMapper, UserAddress> implements UserAddressService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserCancellationLogMapper; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserCancellationLogServiceImpl extends ServiceImpl<UserCancellationLogMapper, UserCancellationLog> implements UserCancellationLogService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserChangeLogMapper; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | import com.ruoyi.account.service.UserChangeLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserChangeLogServiceImpl extends ServiceImpl<UserChangeLogMapper, UserChangeLog> implements UserChangeLogService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserClickLogMapper; |
| | | import com.ruoyi.account.api.model.UserClickLog; |
| | | import com.ruoyi.account.service.UserClickLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserClickLogServiceImpl extends ServiceImpl<UserClickLogMapper, UserClickLog> implements UserClickLogService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserCouponMapper; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserCouponServiceImpl extends ServiceImpl<UserCouponMapper, UserCoupon> implements UserCouponService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserPointMapper; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserPointServiceImpl extends ServiceImpl<UserPointMapper, UserPoint> implements UserPointService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.UserSignRecordMapper; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.service.UserSignRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class UserSignRecordServiceImpl extends ServiceImpl<UserSignRecordMapper, UserSignRecord> implements UserSignRecordService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.WithdrawalRequestsMapper; |
| | | import com.ruoyi.account.api.model.WithdrawalRequests; |
| | | import com.ruoyi.account.service.WithdrawalRequestsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class WithdrawalRequestsServiceImpl extends ServiceImpl<WithdrawalRequestsMapper, WithdrawalRequests> implements WithdrawalRequestsService { |
| | | |
| | | } |
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.ruoyi.account.mapper.AgentApplicationMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.AgentApplication"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="application_vip_id" property="applicationVipId" /> |
| | | <result column="application_time" property="applicationTime" /> |
| | | <result column="status" property="status" /> |
| | | <result column="shop_point" property="shopPoint" /> |
| | | <result column="share_point" property="sharePoint" /> |
| | | <result column="direct_vip_num" property="directVipNum" /> |
| | | <result column="direct_agent_num" property="directAgentNum" /> |
| | | <result column="bind_shop_num" property="bindShopNum" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, application_vip_id, application_time, status, shop_point, share_point, direct_vip_num, direct_agent_num, bind_shop_num, remark, del_flag, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.AppUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.AppUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="avatar" property="avatar" /> |
| | | <result column="vip_id" property="vipId" /> |
| | | <result column="wx_openid" property="wxOpenid" /> |
| | | <result column="ali_openid" property="aliOpenid" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="first_add" property="firstAdd" /> |
| | | <result column="last_login_time" property="lastLoginTime" /> |
| | | <result column="invite_user_id" property="inviteUserId" /> |
| | | <result column="shop_id" property="shopId" /> |
| | | <result column="part_point" property="partPoint" /> |
| | | <result column="part_grow_point" property="partGrowPoint" /> |
| | | <result column="shop_point" property="shopPoint" /> |
| | | <result column="share_point" property="sharePoint" /> |
| | | <result column="shop_amount" property="shopAmount" /> |
| | | <result column="last_shop_time" property="lastShopTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, phone, avatar, vip_id, wx_openid, ali_openid, status, create_time, del_flag, first_add, last_login_time, invite_user_id, shop_id, part_point, part_grow_point, shop_point, share_point, shop_amount, last_shop_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserAddressMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserAddress"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="recieve_name" property="recieveName" /> |
| | | <result column="recieve_phone" property="recievePhone" /> |
| | | <result column="recieve_address" property="recieveAddress" /> |
| | | <result column="is_default" property="isDefault" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, recieve_name, recieve_phone, recieve_address, is_default, del_flag, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserCancellationLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserCancellationLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="vip_id" property="vipId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, vip_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserChangeLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserChangeLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="before_vip_id" property="beforeVipId" /> |
| | | <result column="after_vip_id" property="afterVipId" /> |
| | | <result column="change_type" property="changeType" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, before_vip_id, after_vip_id, change_type |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserClickLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserClickLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="vip_id" property="vipId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, vip_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserCouponMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserCoupon"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="use_time" property="useTime" /> |
| | | <result column="coupon_id" property="couponId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, use_time, coupon_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserPointMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserPoint"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="historical_point" property="historicalPoint" /> |
| | | <result column="variable_point" property="variablePoint" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="object_id" property="objectId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, type, historical_point, variable_point, create_time, app_user_id, object_id |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.UserSignRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.UserSignRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="sign_day" property="signDay" /> |
| | | <result column="red_amount" property="redAmount" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, sign_day, red_amount, del_flag, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.WithdrawalRequestsMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.api.model.WithdrawalRequests"> |
| | | <id column="id" property="id" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="withdrawal_amount" property="withdrawalAmount" /> |
| | | <result column="withdrawal_method" property="withdrawalMethod" /> |
| | | <result column="account_holder" property="accountHolder" /> |
| | | <result column="bank_card_number" property="bankCardNumber" /> |
| | | <result column="audit_status" property="auditStatus" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, withdrawal_amount, withdrawal_method, account_holder, bank_card_number, audit_status |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | public class OrderController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/order-good") |
| | | public class OrderGoodController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/refund-pass") |
| | | public class RefundPassController { |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.apache.logging.log4j.core.config.Order; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import model.RefundPassOrderGood; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface OrderGoodMapper extends BaseMapper<OrderGood> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import model.RefundPassOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import model.RefundPassRefundPass; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface RefundPassMapper extends BaseMapper<RefundPass> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import model.RefundPassOrderGood; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface OrderGoodService extends IService<OrderGood> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import model.RefundPassOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface OrderService extends IService<Order> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import model.RefundPass; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface RefundPassService extends IService<RefundPass> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.OrderGoodMapper; |
| | | import model.RefundPassOrderGood; |
| | | import com.ruoyi.account.service.OrderGoodService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class OrderGoodServiceImpl extends ServiceImpl<OrderGoodMapper, OrderGood> implements OrderGoodService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.OrderMapper; |
| | | import model.RefundPassOrder; |
| | | import com.ruoyi.account.service.OrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.mapper.RefundPassMapper; |
| | | import model.RefundPassRefundPass; |
| | | import com.ruoyi.account.service.RefundPassService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author luodangjia |
| | | * @since 2024-11-21 |
| | | */ |
| | | @Service |
| | | public class RefundPassServiceImpl extends ServiceImpl<RefundPassMapper, RefundPass> implements RefundPassService { |
| | | |
| | | } |
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.ruoyi.account.mapper.OrderGoodMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="model.RefundPassOrderGood"> |
| | | <id column="id" property="id" /> |
| | | <result column="order_id" property="orderId" /> |
| | | <result column="good_json" property="goodJson" /> |
| | | <result column="num" property="num" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, order_id, good_json, num, del_flag, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.OrderMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="model.RefundPassOrder"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="order_type" property="orderType" /> |
| | | <result column="order_status" property="orderStatus" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="technician_id" property="technicianId" /> |
| | | <result column="order_number" property="orderNumber" /> |
| | | <result column="total_amount" property="totalAmount" /> |
| | | <result column="payment_amount" property="paymentAmount" /> |
| | | <result column="point" property="point" /> |
| | | <result column="pay_method" property="payMethod" /> |
| | | <result column="coupon_json" property="couponJson" /> |
| | | <result column="express_amount" property="expressAmount" /> |
| | | <result column="express_json" property="expressJson" /> |
| | | <result column="share_amount" property="shareAmount" /> |
| | | <result column="get_point" property="getPoint" /> |
| | | <result column="serial_number" property="serialNumber" /> |
| | | <result column="pay_status" property="payStatus" /> |
| | | <result column="shop_id" property="shopId" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, order_type, order_status, end_time, technician_id, order_number, total_amount, payment_amount, point, pay_method, coupon_json, express_amount, express_json, share_amount, get_point, serial_number, pay_status, shop_id, del_flag, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
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.ruoyi.account.mapper.RefundPassMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="model.RefundPassRefundPass"> |
| | | <id column="id" property="id" /> |
| | | <result column="order_id" property="orderId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="refund_method" property="refundMethod" /> |
| | | <result column="refund_reason" property="refundReason" /> |
| | | <result column="user_remark" property="userRemark" /> |
| | | <result column="pics" property="pics" /> |
| | | <result column="pass_status" property="passStatus" /> |
| | | <result column="pass_remark" property="passRemark" /> |
| | | <result column="del_flag" property="delFlag" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, order_id, status, refund_method, refund_reason, user_remark, pics, pass_status, pass_remark, del_flag, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.apache.logging.log4j.core.config.Order; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |