模块构建,增加源对象注入属性
parent
496ce76280
commit
a4904014bc
|
@ -84,14 +84,14 @@ public class BaseController {
|
||||||
/**
|
/**
|
||||||
* 返回成功
|
* 返回成功
|
||||||
*/
|
*/
|
||||||
public Result success () {
|
public Result<String> success () {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回失败消息
|
* 返回失败消息
|
||||||
*/
|
*/
|
||||||
public Result error () {
|
public Result<String> error () {
|
||||||
return Result.error();
|
return Result.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ public class BaseController {
|
||||||
*
|
*
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
protected Result toAjax (boolean result) {
|
protected Result<String> toAjax (boolean result) {
|
||||||
return result ? success() : error();
|
return result ? success() : error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
@ -30,35 +31,35 @@ public class BaseEntity implements Serializable {
|
||||||
* 搜索值
|
* 搜索值
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
|
@TableField(exist = false)
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建者
|
* 创建者
|
||||||
*/
|
*/
|
||||||
|
@TableField(value = "create_by" , fill = FieldFill.INSERT)
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@TableField(value = "create_time" , fill = FieldFill.INSERT)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新者
|
* 更新者
|
||||||
*/
|
*/
|
||||||
|
@TableField(value = "update_by" , fill = FieldFill.UPDATE)
|
||||||
private Long updateBy;
|
private Long updateBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@TableField(value = "update_time" , fill = FieldFill.UPDATE)
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,6 +4,11 @@ import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -15,6 +20,11 @@ import javax.validation.constraints.Size;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysDictData extends BaseEntity {
|
public class SysDictData extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -70,21 +80,10 @@ public class SysDictData extends BaseEntity {
|
||||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
public Long getDictCode () {
|
/**
|
||||||
return dictCode;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
public void setDictCode (Long dictCode) {
|
|
||||||
this.dictCode = dictCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getDictSort () {
|
|
||||||
return dictSort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDictSort (Long dictSort) {
|
|
||||||
this.dictSort = dictSort;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "字典标签不能为空")
|
@NotBlank(message = "字典标签不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
||||||
|
@ -92,67 +91,23 @@ public class SysDictData extends BaseEntity {
|
||||||
return dictLabel;
|
return dictLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDictLabel (String dictLabel) {
|
|
||||||
this.dictLabel = dictLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "字典键值不能为空")
|
@NotBlank(message = "字典键值不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||||
public String getDictValue () {
|
public String getDictValue () {
|
||||||
return dictValue;
|
return dictValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDictValue (String dictValue) {
|
|
||||||
this.dictValue = dictValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "字典类型不能为空")
|
@NotBlank(message = "字典类型不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
||||||
public String getDictType () {
|
public String getDictType () {
|
||||||
return dictType;
|
return dictType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDictType (String dictType) {
|
|
||||||
this.dictType = dictType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
||||||
public String getCssClass () {
|
public String getCssClass () {
|
||||||
return cssClass;
|
return cssClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCssClass (String cssClass) {
|
|
||||||
this.cssClass = cssClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getListClass () {
|
|
||||||
return listClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setListClass (String listClass) {
|
|
||||||
this.listClass = listClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getDefault () {
|
|
||||||
return UserConstants.YES.equals(this.isDefault);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsDefault () {
|
|
||||||
return isDefault;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsDefault (String isDefault) {
|
|
||||||
this.isDefault = isDefault;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -3,6 +3,11 @@ package com.ruoyi.common.core.domain.entity;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -15,6 +20,11 @@ import javax.validation.constraints.Size;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysDictType extends BaseEntity {
|
public class SysDictType extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -42,13 +52,11 @@ public class SysDictType extends BaseEntity {
|
||||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
public Long getDictId () {
|
/**
|
||||||
return dictId;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
public void setDictId (Long dictId) {
|
|
||||||
this.dictId = dictId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "字典名称不能为空")
|
@NotBlank(message = "字典名称不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||||
|
@ -56,10 +64,6 @@ public class SysDictType extends BaseEntity {
|
||||||
return dictName;
|
return dictName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDictName (String dictName) {
|
|
||||||
this.dictName = dictName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "字典类型不能为空")
|
@NotBlank(message = "字典类型不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||||
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
|
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
|
||||||
|
@ -67,18 +71,6 @@ public class SysDictType extends BaseEntity {
|
||||||
return dictType;
|
return dictType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDictType (String dictType) {
|
|
||||||
this.dictType = dictType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
package com.ruoyi.common.core.domain.entity;
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -15,6 +20,11 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysMenu extends BaseEntity {
|
public class SysMenu extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -98,13 +108,11 @@ public class SysMenu extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private List<SysMenu> children = new ArrayList<SysMenu>();
|
private List<SysMenu> children = new ArrayList<SysMenu>();
|
||||||
|
|
||||||
public Long getMenuId () {
|
/**
|
||||||
return menuId;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
public void setMenuId (Long menuId) {
|
|
||||||
this.menuId = menuId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "菜单名称不能为空")
|
@NotBlank(message = "菜单名称不能为空")
|
||||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
||||||
|
@ -112,127 +120,32 @@ public class SysMenu extends BaseEntity {
|
||||||
return menuName;
|
return menuName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMenuName (String menuName) {
|
|
||||||
this.menuName = menuName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentName () {
|
|
||||||
return parentName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentName (String parentName) {
|
|
||||||
this.parentName = parentName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getParentId () {
|
|
||||||
return parentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentId (Long parentId) {
|
|
||||||
this.parentId = parentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull(message = "显示顺序不能为空")
|
@NotNull(message = "显示顺序不能为空")
|
||||||
public Integer getOrderNum () {
|
public Integer getOrderNum () {
|
||||||
return orderNum;
|
return orderNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrderNum (Integer orderNum) {
|
|
||||||
this.orderNum = orderNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
||||||
public String getPath () {
|
public String getPath () {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPath (String path) {
|
|
||||||
this.path = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
||||||
public String getComponent () {
|
public String getComponent () {
|
||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComponent (String component) {
|
|
||||||
this.component = component;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuery () {
|
|
||||||
return query;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQuery (String query) {
|
|
||||||
this.query = query;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsFrame () {
|
|
||||||
return isFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsFrame (String isFrame) {
|
|
||||||
this.isFrame = isFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsCache () {
|
|
||||||
return isCache;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsCache (String isCache) {
|
|
||||||
this.isCache = isCache;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "菜单类型不能为空")
|
@NotBlank(message = "菜单类型不能为空")
|
||||||
public String getMenuType () {
|
public String getMenuType () {
|
||||||
return menuType;
|
return menuType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMenuType (String menuType) {
|
|
||||||
this.menuType = menuType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVisible () {
|
|
||||||
return visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVisible (String visible) {
|
|
||||||
this.visible = visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||||
public String getPerms () {
|
public String getPerms () {
|
||||||
return perms;
|
return perms;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPerms (String perms) {
|
|
||||||
this.perms = perms;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIcon () {
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIcon (String icon) {
|
|
||||||
this.icon = icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<SysMenu> getChildren () {
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChildren (List<SysMenu> children) {
|
|
||||||
this.children = children;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -3,6 +3,11 @@ package com.ruoyi.common.core.domain.entity;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -16,6 +21,10 @@ import java.util.Set;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysRole extends BaseEntity {
|
public class SysRole extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -90,6 +99,12 @@ public class SysRole extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Set<String> permissions;
|
private Set<String> permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
public SysRole () {
|
public SysRole () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -102,14 +117,6 @@ public class SysRole extends BaseEntity {
|
||||||
return roleId != null && 1L == roleId;
|
return roleId != null && 1L == roleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getRoleId () {
|
|
||||||
return roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleId (Long roleId) {
|
|
||||||
this.roleId = roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAdmin () {
|
public boolean isAdmin () {
|
||||||
return isAdmin(this.roleId);
|
return isAdmin(this.roleId);
|
||||||
}
|
}
|
||||||
|
@ -120,101 +127,24 @@ public class SysRole extends BaseEntity {
|
||||||
return roleName;
|
return roleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRoleName (String roleName) {
|
|
||||||
this.roleName = roleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "权限字符不能为空")
|
@NotBlank(message = "权限字符不能为空")
|
||||||
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
||||||
public String getRoleKey () {
|
public String getRoleKey () {
|
||||||
return roleKey;
|
return roleKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRoleKey (String roleKey) {
|
|
||||||
this.roleKey = roleKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull(message = "显示顺序不能为空")
|
@NotNull(message = "显示顺序不能为空")
|
||||||
public Integer getRoleSort () {
|
public Integer getRoleSort () {
|
||||||
return roleSort;
|
return roleSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRoleSort (Integer roleSort) {
|
|
||||||
this.roleSort = roleSort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataScope () {
|
|
||||||
return dataScope;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataScope (String dataScope) {
|
|
||||||
this.dataScope = dataScope;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMenuCheckStrictly () {
|
public boolean isMenuCheckStrictly () {
|
||||||
return menuCheckStrictly;
|
return menuCheckStrictly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMenuCheckStrictly (boolean menuCheckStrictly) {
|
|
||||||
this.menuCheckStrictly = menuCheckStrictly;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDeptCheckStrictly () {
|
public boolean isDeptCheckStrictly () {
|
||||||
return deptCheckStrictly;
|
return deptCheckStrictly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDeptCheckStrictly (boolean deptCheckStrictly) {
|
|
||||||
this.deptCheckStrictly = deptCheckStrictly;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDelFlag () {
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelFlag (String delFlag) {
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFlag () {
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFlag (boolean flag) {
|
|
||||||
this.flag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getMenuIds () {
|
|
||||||
return menuIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMenuIds (Long[] menuIds) {
|
|
||||||
this.menuIds = menuIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getDeptIds () {
|
|
||||||
return deptIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptIds (Long[] deptIds) {
|
|
||||||
this.deptIds = deptIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getPermissions () {
|
|
||||||
return permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPermissions (Set<String> permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -6,6 +6,11 @@ import com.ruoyi.common.annotation.Excel.Type;
|
||||||
import com.ruoyi.common.annotation.Excels;
|
import com.ruoyi.common.annotation.Excels;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.xss.Xss;
|
import com.ruoyi.common.xss.Xss;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -20,6 +25,10 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysUser extends BaseEntity {
|
public class SysUser extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -127,6 +136,11 @@ public class SysUser extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
public SysUser () {
|
public SysUser () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -139,36 +153,16 @@ public class SysUser extends BaseEntity {
|
||||||
return userId != null && 1L == userId;
|
return userId != null && 1L == userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getUserId () {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId (Long userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAdmin () {
|
public boolean isAdmin () {
|
||||||
return isAdmin(this.userId);
|
return isAdmin(this.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId () {
|
|
||||||
return deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptId (Long deptId) {
|
|
||||||
this.deptId = deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "用户昵称不能包含脚本字符")
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||||
public String getNickName () {
|
public String getNickName () {
|
||||||
return nickName;
|
return nickName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNickName (String nickName) {
|
|
||||||
this.nickName = nickName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "用户账号不能包含脚本字符")
|
@Xss(message = "用户账号不能包含脚本字符")
|
||||||
@NotBlank(message = "用户账号不能为空")
|
@NotBlank(message = "用户账号不能为空")
|
||||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||||
|
@ -176,125 +170,16 @@ public class SysUser extends BaseEntity {
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserName (String userName) {
|
|
||||||
this.userName = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Email(message = "邮箱格式不正确")
|
@Email(message = "邮箱格式不正确")
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||||
public String getEmail () {
|
public String getEmail () {
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmail (String email) {
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||||
public String getPhonenumber () {
|
public String getPhonenumber () {
|
||||||
return phonenumber;
|
return phonenumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPhonenumber (String phonenumber) {
|
|
||||||
this.phonenumber = phonenumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSex () {
|
|
||||||
return sex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSex (String sex) {
|
|
||||||
this.sex = sex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAvatar () {
|
|
||||||
return avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAvatar (String avatar) {
|
|
||||||
this.avatar = avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPassword () {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPassword (String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDelFlag () {
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelFlag (String delFlag) {
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLoginIp () {
|
|
||||||
return loginIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginIp (String loginIp) {
|
|
||||||
this.loginIp = loginIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getLoginDate () {
|
|
||||||
return loginDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginDate (Date loginDate) {
|
|
||||||
this.loginDate = loginDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysDept getDept () {
|
|
||||||
return dept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDept (SysDept dept) {
|
|
||||||
this.dept = dept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<SysRole> getRoles () {
|
|
||||||
return roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoles (List<SysRole> roles) {
|
|
||||||
this.roles = roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getRoleIds () {
|
|
||||||
return roleIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleIds (Long[] roleIds) {
|
|
||||||
this.roleIds = roleIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getPostIds () {
|
|
||||||
return postIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostIds (Long[] postIds) {
|
|
||||||
this.postIds = postIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getRoleId () {
|
|
||||||
return roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleId (Long roleId) {
|
|
||||||
this.roleId = roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.ruoyi.framework.config.mybatisplus;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体类字段填充
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
this.setFieldValByName("createBy", SecurityUtils.getUserId(), metaObject);
|
||||||
|
this.setFieldValByName("createTime", new Date(), metaObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
this.setFieldValByName("updateBy", SecurityUtils.getUserId(), metaObject);
|
||||||
|
this.setFieldValByName("updateTime", new Date(),metaObject);
|
||||||
|
}
|
||||||
|
}
|
|
@ -72,7 +72,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
|
||||||
@GetMapping(value = "/{${pkColumn.javaField}}")
|
@GetMapping(value = "/{${pkColumn.javaField}}")
|
||||||
public Result getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
|
public Result getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||||
return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}));
|
return success(${className}Service.getById(${pkColumn.javaField}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +82,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody ${ClassName} ${className}) {
|
public Result add(@RequestBody ${ClassName} ${className}) {
|
||||||
return toAjax(${className}Service.insert${ClassName}(${className}));
|
return toAjax(${className}Service.save(${className}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +92,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result edit(@RequestBody ${ClassName} ${className}) {
|
public Result edit(@RequestBody ${ClassName} ${className}) {
|
||||||
return toAjax(${className}Service.update${ClassName}(${className}));
|
return toAjax(${className}Service.updateById(${className}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,7 +101,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
|
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||||
public Result remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
public Result remove(@PathVariable List<${pkColumn.javaType}> ${pkColumn.javaField}s) {
|
||||||
return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s));
|
return toAjax(${className}Service.removeBatchByIds(${pkColumn.javaField}s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,13 +14,6 @@ import ${packageName}.domain.${subClassName};
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
public interface ${ClassName}Mapper extends BaseMapper<${ClassName}> {
|
public interface ${ClassName}Mapper extends BaseMapper<${ClassName}> {
|
||||||
/**
|
|
||||||
* 查询${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return ${functionName}
|
|
||||||
*/
|
|
||||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
|
@ -29,55 +22,4 @@ public interface ${ClassName}Mapper extends BaseMapper<${ClassName}> {
|
||||||
* @return ${functionName}集合
|
* @return ${functionName}集合
|
||||||
*/
|
*/
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int update${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
|
||||||
#if($table.sub)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${subTable.functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量新增${subTable.functionName}
|
|
||||||
*
|
|
||||||
* @param ${subclassName}List ${subTable.functionName}列表
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int batch${subClassName}(List<${subClassName}> ${subclassName}List);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过${functionName}主键删除${subTable.functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}ID
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
#end
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
public interface ${ClassName}Service extends IService<${ClassName}> {
|
public interface ${ClassName}Service extends IService<${ClassName}> {
|
||||||
/**
|
|
||||||
* 查询${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return ${functionName}
|
|
||||||
*/
|
|
||||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
*
|
*
|
||||||
|
@ -27,35 +19,4 @@ public interface ${ClassName}Service extends IService<${ClassName}> {
|
||||||
*/
|
*/
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className});
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insert${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int update${ClassName}(${ClassName} ${className});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除${functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,12 @@
|
||||||
package ${packageName}.service.impl;
|
package ${packageName}.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
#break
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
#if($table.sub)
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import ${packageName}.domain.${subClassName};
|
|
||||||
#end
|
|
||||||
import ${packageName}.mapper.${ClassName}Mapper;
|
import ${packageName}.mapper.${ClassName}Mapper;
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
import ${packageName}.service.${ClassName}Service;
|
import ${packageName}.service.${ClassName}Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}Service业务层处理
|
* ${functionName}Service业务层处理
|
||||||
|
@ -31,17 +19,6 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${C
|
||||||
@Autowired
|
@Autowired
|
||||||
private ${ClassName}Mapper ${className}Mapper;
|
private ${ClassName}Mapper ${className}Mapper;
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return ${functionName}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) {
|
|
||||||
return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
*
|
*
|
||||||
|
@ -52,110 +29,4 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${C
|
||||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) {
|
public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) {
|
||||||
return ${className}Mapper.select${ClassName}List(${className});
|
return ${className}Mapper.select${ClassName}List(${className});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int insert${ClassName}(${ClassName} ${className}) {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.javaField == 'createTime')
|
|
||||||
${className}.setCreateTime(DateUtils.getNowDate());
|
|
||||||
#end
|
|
||||||
#if($column.javaField == 'createBy')
|
|
||||||
${className}.setCreateBy(SecurityUtils.getUserId());
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
int rows = ${className}Mapper.insert${ClassName}(${className});
|
|
||||||
insert${subClassName}(${className});
|
|
||||||
return rows;
|
|
||||||
#else
|
|
||||||
return ${className}Mapper.insert(${className});
|
|
||||||
#end
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改${functionName}
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int update${ClassName}(${ClassName} ${className}) {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.javaField == 'updateTime')
|
|
||||||
${className}.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}());
|
|
||||||
insert${subClassName}(${className});
|
|
||||||
#end
|
|
||||||
return ${className}Mapper.update${ClassName}(${className});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除${functionName}
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
|
||||||
#if($table.sub)
|
|
||||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
|
||||||
#end
|
|
||||||
return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除${functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${pkColumn.javaField} ${functionName}主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
#if($table.sub)
|
|
||||||
@Transactional
|
|
||||||
#end
|
|
||||||
@Override
|
|
||||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) {
|
|
||||||
#if($table.sub)
|
|
||||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField});
|
|
||||||
#end
|
|
||||||
return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField});
|
|
||||||
}
|
|
||||||
#if($table.sub)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增${subTable.functionName}信息
|
|
||||||
*
|
|
||||||
* @param ${className} ${functionName}对象
|
|
||||||
*/
|
|
||||||
public void insert${subClassName}(${ClassName} ${className}) {
|
|
||||||
List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List();
|
|
||||||
${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}();
|
|
||||||
if (StringUtils.isNotNull(${subclassName}List)) {
|
|
||||||
List<${subClassName}> list = new ArrayList<${subClassName}>();
|
|
||||||
for (${subClassName} ${subclassName} : ${subclassName}List){
|
|
||||||
${subclassName}.set${subTableFkClassName}(${pkColumn.javaField});
|
|
||||||
list.add(${subclassName});
|
|
||||||
} if (list.size() > 0) {
|
|
||||||
${className}Mapper.batch${subClassName}(list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,18 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="${column.javaField}" column="${column.columnName}" />
|
<result property="${column.javaField}" column="${column.columnName}" />
|
||||||
#end
|
#end
|
||||||
</resultMap>
|
</resultMap>
|
||||||
#if($table.sub)
|
|
||||||
|
|
||||||
<resultMap id="${ClassName}${subClassName}Result" type="${packageName}.domain.${ClassName}" extends="${ClassName}Result">
|
|
||||||
<collection property="${subclassName}List" notNullColumn="sub_${subTable.pkColumn.columnName}" javaType="java.util.List" resultMap="${subClassName}Result" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<resultMap type="${subClassName}" id="${subClassName}Result">
|
|
||||||
#foreach ($column in $subTable.columns)
|
|
||||||
<result property="${column.javaField}" column="sub_${column.columnName}" />
|
|
||||||
#end
|
|
||||||
</resultMap>
|
|
||||||
#end
|
|
||||||
|
|
||||||
<sql id="select${ClassName}Vo">
|
<sql id="select${ClassName}Vo">
|
||||||
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
||||||
|
@ -57,61 +45,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#end
|
#end
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">
|
|
||||||
#if($table.crud || $table.tree)
|
|
||||||
<include refid="select${ClassName}Vo"/>
|
|
||||||
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
|
||||||
#elseif($table.sub)
|
|
||||||
select#foreach($column in $columns) a.$column.columnName#if($foreach.count != $columns.size()),#end#end,
|
|
||||||
#foreach($column in $subTable.columns) b.$column.columnName as sub_$column.columnName#if($foreach.count != $subTable.columns.size()),#end#end
|
|
||||||
|
|
||||||
from ${tableName} a
|
|
||||||
left join ${subTableName} b on b.${subTableFkName} = a.${pkColumn.columnName}
|
|
||||||
where a.${pkColumn.columnName} = #{${pkColumn.javaField}}
|
|
||||||
#end
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="update${ClassName}" parameterType="${packageName}.domain.${ClassName}">
|
|
||||||
update ${tableName}
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#if($column.columnName != $pkColumn.columnName)
|
|
||||||
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName = #{$column.javaField},</if>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
</trim>
|
|
||||||
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="delete${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}">
|
|
||||||
delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="delete${ClassName}By${pkColumn.capJavaField}s" parameterType="String">
|
|
||||||
delete from ${tableName} where ${pkColumn.columnName} in
|
|
||||||
<foreach item="${pkColumn.javaField}" collection="array" open="(" separator="," close=")">
|
|
||||||
#{${pkColumn.javaField}}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
#if($table.sub)
|
|
||||||
|
|
||||||
<delete id="delete${subClassName}By${subTableFkClassName}s" parameterType="String">
|
|
||||||
delete from ${subTableName} where ${subTableFkName} in
|
|
||||||
<foreach item="${subTableFkclassName}" collection="array" open="(" separator="," close=")">
|
|
||||||
#{${subTableFkclassName}}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="delete${subClassName}By${subTableFkClassName}" parameterType="${pkColumn.javaType}">
|
|
||||||
delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<insert id="batch${subClassName}">
|
|
||||||
insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values
|
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
|
||||||
(#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end)
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
#end
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -7,6 +7,11 @@ import com.ruoyi.common.constant.ScheduleConstants;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.quartz.util.CronUtils;
|
import com.ruoyi.quartz.util.CronUtils;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -19,6 +24,11 @@ import java.util.Date;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysJob extends BaseEntity {
|
public class SysJob extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -70,13 +80,10 @@ public class SysJob extends BaseEntity {
|
||||||
@Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停")
|
@Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
public Long getJobId () {
|
/**
|
||||||
return jobId;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
public void setJobId (Long jobId) {
|
|
||||||
this.jobId = jobId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "任务名称不能为空")
|
@NotBlank(message = "任务名称不能为空")
|
||||||
@Size(min = 0, max = 64, message = "任务名称不能超过64个字符")
|
@Size(min = 0, max = 64, message = "任务名称不能超过64个字符")
|
||||||
|
@ -84,38 +91,18 @@ public class SysJob extends BaseEntity {
|
||||||
return jobName;
|
return jobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJobName (String jobName) {
|
|
||||||
this.jobName = jobName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getJobGroup () {
|
|
||||||
return jobGroup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJobGroup (String jobGroup) {
|
|
||||||
this.jobGroup = jobGroup;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "调用目标字符串不能为空")
|
@NotBlank(message = "调用目标字符串不能为空")
|
||||||
@Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符")
|
@Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符")
|
||||||
public String getInvokeTarget () {
|
public String getInvokeTarget () {
|
||||||
return invokeTarget;
|
return invokeTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInvokeTarget (String invokeTarget) {
|
|
||||||
this.invokeTarget = invokeTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "Cron执行表达式不能为空")
|
@NotBlank(message = "Cron执行表达式不能为空")
|
||||||
@Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符")
|
@Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符")
|
||||||
public String getCronExpression () {
|
public String getCronExpression () {
|
||||||
return cronExpression;
|
return cronExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCronExpression (String cronExpression) {
|
|
||||||
this.cronExpression = cronExpression;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
public Date getNextValidTime () {
|
public Date getNextValidTime () {
|
||||||
if (StringUtils.isNotEmpty(cronExpression)) {
|
if (StringUtils.isNotEmpty(cronExpression)) {
|
||||||
|
@ -124,30 +111,6 @@ public class SysJob extends BaseEntity {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMisfirePolicy () {
|
|
||||||
return misfirePolicy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMisfirePolicy (String misfirePolicy) {
|
|
||||||
this.misfirePolicy = misfirePolicy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConcurrent () {
|
|
||||||
return concurrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConcurrent (String concurrent) {
|
|
||||||
this.concurrent = concurrent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class BookInfoController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('book:info:query')")
|
@PreAuthorize("@ss.hasPermi('book:info:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public Result getInfo(@PathVariable("id") Long id) {
|
public Result getInfo(@PathVariable("id") Long id) {
|
||||||
return success(bookInfoService.selectBookInfoById(id));
|
return success(bookInfoService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +72,7 @@ public class BookInfoController extends BaseController {
|
||||||
@Log(title = "书籍信息", businessType = BusinessType.INSERT)
|
@Log(title = "书籍信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody BookInfo bookInfo) {
|
public Result add(@RequestBody BookInfo bookInfo) {
|
||||||
return toAjax(bookInfoService.insertBookInfo(bookInfo));
|
return toAjax(bookInfoService.save(bookInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +82,7 @@ public class BookInfoController extends BaseController {
|
||||||
@Log(title = "书籍信息", businessType = BusinessType.UPDATE)
|
@Log(title = "书籍信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result edit(@RequestBody BookInfo bookInfo) {
|
public Result edit(@RequestBody BookInfo bookInfo) {
|
||||||
return toAjax(bookInfoService.updateBookInfo(bookInfo));
|
return toAjax(bookInfoService.updateById(bookInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,7 +91,7 @@ public class BookInfoController extends BaseController {
|
||||||
@PreAuthorize("@ss.hasPermi('book:info:remove')")
|
@PreAuthorize("@ss.hasPermi('book:info:remove')")
|
||||||
@Log(title = "书籍信息", businessType = BusinessType.DELETE)
|
@Log(title = "书籍信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public Result remove(@PathVariable Long[] ids) {
|
public Result remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(bookInfoService.deleteBookInfoByIds(ids));
|
return toAjax(bookInfoService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,13 +11,6 @@ import com.ruoyi.book.domain.BookInfo;
|
||||||
* @date 2023-10-09
|
* @date 2023-10-09
|
||||||
*/
|
*/
|
||||||
public interface BookInfoMapper extends BaseMapper<BookInfo> {
|
public interface BookInfoMapper extends BaseMapper<BookInfo> {
|
||||||
/**
|
|
||||||
* 查询书籍信息
|
|
||||||
*
|
|
||||||
* @param id 书籍信息主键
|
|
||||||
* @return 书籍信息
|
|
||||||
*/
|
|
||||||
public BookInfo selectBookInfoById(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询书籍信息列表
|
* 查询书籍信息列表
|
||||||
|
@ -26,28 +19,4 @@ public interface BookInfoMapper extends BaseMapper<BookInfo> {
|
||||||
* @return 书籍信息集合
|
* @return 书籍信息集合
|
||||||
*/
|
*/
|
||||||
public List<BookInfo> selectBookInfoList(BookInfo bookInfo);
|
public List<BookInfo> selectBookInfoList(BookInfo bookInfo);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改书籍信息
|
|
||||||
*
|
|
||||||
* @param bookInfo 书籍信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateBookInfo(BookInfo bookInfo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除书籍信息
|
|
||||||
*
|
|
||||||
* @param id 书籍信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteBookInfoById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除书籍信息
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteBookInfoByIds(Long[] ids);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
* @date 2023-10-09
|
* @date 2023-10-09
|
||||||
*/
|
*/
|
||||||
public interface BookInfoService extends IService<BookInfo> {
|
public interface BookInfoService extends IService<BookInfo> {
|
||||||
/**
|
|
||||||
* 查询书籍信息
|
|
||||||
*
|
|
||||||
* @param id 书籍信息主键
|
|
||||||
* @return 书籍信息
|
|
||||||
*/
|
|
||||||
public BookInfo selectBookInfoById(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询书籍信息列表
|
* 查询书籍信息列表
|
||||||
*
|
*
|
||||||
|
@ -27,35 +19,4 @@ public interface BookInfoService extends IService<BookInfo> {
|
||||||
*/
|
*/
|
||||||
public List<BookInfo> selectBookInfoList(BookInfo bookInfo);
|
public List<BookInfo> selectBookInfoList(BookInfo bookInfo);
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增书籍信息
|
|
||||||
*
|
|
||||||
* @param bookInfo 书籍信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertBookInfo(BookInfo bookInfo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改书籍信息
|
|
||||||
*
|
|
||||||
* @param bookInfo 书籍信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateBookInfo(BookInfo bookInfo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除书籍信息
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的书籍信息主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteBookInfoByIds(Long[] ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除书籍信息信息
|
|
||||||
*
|
|
||||||
* @param id 书籍信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteBookInfoById(Long id);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
package com.ruoyi.book.service.impl;
|
package com.ruoyi.book.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.book.mapper.BookInfoMapper;
|
import com.ruoyi.book.mapper.BookInfoMapper;
|
||||||
import com.ruoyi.book.domain.BookInfo;
|
import com.ruoyi.book.domain.BookInfo;
|
||||||
import com.ruoyi.book.service.BookInfoService;
|
import com.ruoyi.book.service.BookInfoService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 书籍信息Service业务层处理
|
* 书籍信息Service业务层处理
|
||||||
|
@ -18,21 +15,10 @@ import com.ruoyi.book.service.BookInfoService;
|
||||||
* @date 2023-10-09
|
* @date 2023-10-09
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class BookInfoServiceImpl extends ServiceImpl<BookInfoMapper, BookInfo> implements BookInfoService {
|
public class BookInfoServiceImpl extends ServiceImpl<BookInfoMapper, BookInfo> implements BookInfoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private BookInfoMapper bookInfoMapper;
|
private BookInfoMapper bookInfoMapper;
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询书籍信息
|
|
||||||
*
|
|
||||||
* @param id 书籍信息主键
|
|
||||||
* @return 书籍信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public BookInfo selectBookInfoById(Long id) {
|
|
||||||
return bookInfoMapper.selectBookInfoById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询书籍信息列表
|
* 查询书籍信息列表
|
||||||
*
|
*
|
||||||
|
@ -43,50 +29,4 @@ public class BookInfoServiceImpl extends ServiceImpl<BookInfoMapper, BookInfo> i
|
||||||
public List<BookInfo> selectBookInfoList(BookInfo bookInfo) {
|
public List<BookInfo> selectBookInfoList(BookInfo bookInfo) {
|
||||||
return bookInfoMapper.selectBookInfoList(bookInfo);
|
return bookInfoMapper.selectBookInfoList(bookInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增书籍信息
|
|
||||||
*
|
|
||||||
* @param bookInfo 书籍信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertBookInfo(BookInfo bookInfo) {
|
|
||||||
bookInfo.setCreateBy(SecurityUtils.getUserId());
|
|
||||||
bookInfo.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return bookInfoMapper.insert(bookInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改书籍信息
|
|
||||||
*
|
|
||||||
* @param bookInfo 书籍信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateBookInfo(BookInfo bookInfo) {
|
|
||||||
return bookInfoMapper.updateBookInfo(bookInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除书籍信息
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的书籍信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteBookInfoByIds(Long[] ids) {
|
|
||||||
return bookInfoMapper.deleteBookInfoByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除书籍信息信息
|
|
||||||
*
|
|
||||||
* @param id 书籍信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteBookInfoById(Long id) {
|
|
||||||
return bookInfoMapper.deleteBookInfoById(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,11 @@ package com.ruoyi.system.domain;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -14,6 +19,11 @@ import javax.validation.constraints.Size;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysConfig extends BaseEntity {
|
public class SysConfig extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -47,13 +57,10 @@ public class SysConfig extends BaseEntity {
|
||||||
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
|
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
|
||||||
private String configType;
|
private String configType;
|
||||||
|
|
||||||
public Long getConfigId () {
|
/**
|
||||||
return configId;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
public void setConfigId (Long configId) {
|
|
||||||
this.configId = configId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "参数名称不能为空")
|
@NotBlank(message = "参数名称不能为空")
|
||||||
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
|
||||||
|
@ -61,38 +68,18 @@ public class SysConfig extends BaseEntity {
|
||||||
return configName;
|
return configName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigName (String configName) {
|
|
||||||
this.configName = configName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "参数键名长度不能为空")
|
@NotBlank(message = "参数键名长度不能为空")
|
||||||
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
|
||||||
public String getConfigKey () {
|
public String getConfigKey () {
|
||||||
return configKey;
|
return configKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigKey (String configKey) {
|
|
||||||
this.configKey = configKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "参数键值不能为空")
|
@NotBlank(message = "参数键值不能为空")
|
||||||
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
|
||||||
public String getConfigValue () {
|
public String getConfigValue () {
|
||||||
return configValue;
|
return configValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigValue (String configValue) {
|
|
||||||
this.configValue = configValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConfigType () {
|
|
||||||
return configType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConfigType (String configType) {
|
|
||||||
this.configType = configType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -2,6 +2,11 @@ package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import com.ruoyi.common.xss.Xss;
|
import com.ruoyi.common.xss.Xss;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -13,6 +18,11 @@ import javax.validation.constraints.Size;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysNotice extends BaseEntity {
|
public class SysNotice extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -41,13 +51,10 @@ public class SysNotice extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
public Long getNoticeId () {
|
/**
|
||||||
return noticeId;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
public void setNoticeId (Long noticeId) {
|
|
||||||
this.noticeId = noticeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "公告标题不能包含脚本字符")
|
@Xss(message = "公告标题不能包含脚本字符")
|
||||||
@NotBlank(message = "公告标题不能为空")
|
@NotBlank(message = "公告标题不能为空")
|
||||||
|
@ -56,34 +63,6 @@ public class SysNotice extends BaseEntity {
|
||||||
return noticeTitle;
|
return noticeTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNoticeTitle (String noticeTitle) {
|
|
||||||
this.noticeTitle = noticeTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNoticeType () {
|
|
||||||
return noticeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNoticeType (String noticeType) {
|
|
||||||
this.noticeType = noticeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNoticeContent () {
|
|
||||||
return noticeContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNoticeContent (String noticeContent) {
|
|
||||||
this.noticeContent = noticeContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -3,6 +3,11 @@ package com.ruoyi.system.domain;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
@ -15,6 +20,11 @@ import javax.validation.constraints.Size;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class SysPost extends BaseEntity {
|
public class SysPost extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -53,13 +63,10 @@ public class SysPost extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private boolean flag = false;
|
private boolean flag = false;
|
||||||
|
|
||||||
public Long getPostId () {
|
/**
|
||||||
return postId;
|
* 备注
|
||||||
}
|
*/
|
||||||
|
private String remark;
|
||||||
public void setPostId (Long postId) {
|
|
||||||
this.postId = postId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "岗位编码不能为空")
|
@NotBlank(message = "岗位编码不能为空")
|
||||||
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
|
||||||
|
@ -67,44 +74,17 @@ public class SysPost extends BaseEntity {
|
||||||
return postCode;
|
return postCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPostCode (String postCode) {
|
|
||||||
this.postCode = postCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotBlank(message = "岗位名称不能为空")
|
@NotBlank(message = "岗位名称不能为空")
|
||||||
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
|
||||||
public String getPostName () {
|
public String getPostName () {
|
||||||
return postName;
|
return postName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPostName (String postName) {
|
|
||||||
this.postName = postName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull(message = "显示顺序不能为空")
|
@NotNull(message = "显示顺序不能为空")
|
||||||
public Integer getPostSort () {
|
public Integer getPostSort () {
|
||||||
return postSort;
|
return postSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPostSort (Integer postSort) {
|
|
||||||
this.postSort = postSort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus () {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus (String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isFlag () {
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFlag (boolean flag) {
|
|
||||||
this.flag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
|
|
|
@ -23,31 +23,4 @@
|
||||||
<if test="params.beginPrice != null and params.beginPrice != '' and params.endPrice != null and params.endPrice != ''"> and price between #{params.beginPrice} and #{params.endPrice}</if>
|
<if test="params.beginPrice != null and params.beginPrice != '' and params.endPrice != null and params.endPrice != ''"> and price between #{params.beginPrice} and #{params.endPrice}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBookInfoById" parameterType="Long" resultMap="BookInfoResult">
|
|
||||||
<include refid="selectBookInfoVo"/>
|
|
||||||
where id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="updateBookInfo" parameterType="com.ruoyi.book.domain.BookInfo">
|
|
||||||
update book_info
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
<if test="name != null and name != ''">name = #{name},</if>
|
|
||||||
<if test="price != null">price = #{price},</if>
|
|
||||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
|
||||||
</trim>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteBookInfoById" parameterType="Long">
|
|
||||||
delete from book_info where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteBookInfoByIds" parameterType="String">
|
|
||||||
delete from book_info where id in
|
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
||||||
#{id}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue