mirror of https://gitee.com/stylefeng/roses
【7.2.2】更新实体代码
parent
84925b434d
commit
affe1060cb
|
@ -0,0 +1,101 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.controller;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandRequest;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展控制器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@RestController
|
||||
@ApiResource(name = "业务拓展")
|
||||
public class SysExpandController {
|
||||
|
||||
@Resource
|
||||
private SysExpandService sysExpandService;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "添加", path = "/sysExpand/add")
|
||||
public ResponseData<SysExpand> add(@RequestBody @Validated(SysExpandRequest.add.class) SysExpandRequest sysExpandRequest) {
|
||||
sysExpandService.add(sysExpandRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "删除", path = "/sysExpand/delete")
|
||||
public ResponseData<?> delete(@RequestBody @Validated(SysExpandRequest.delete.class) SysExpandRequest sysExpandRequest) {
|
||||
sysExpandService.del(sysExpandRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "编辑", path = "/sysExpand/edit")
|
||||
public ResponseData<?> edit(@RequestBody @Validated(SysExpandRequest.edit.class) SysExpandRequest sysExpandRequest) {
|
||||
sysExpandService.edit(sysExpandRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "查看详情", path = "/sysExpand/detail")
|
||||
public ResponseData<SysExpand> detail(@Validated(SysExpandRequest.detail.class) SysExpandRequest sysExpandRequest) {
|
||||
return new SuccessResponseData<>(sysExpandService.detail(sysExpandRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "获取列表", path = "/sysExpand/list")
|
||||
public ResponseData<List<SysExpand>> list(SysExpandRequest sysExpandRequest) {
|
||||
return new SuccessResponseData<>(sysExpandService.findList(sysExpandRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "分页查询", path = "/sysExpand/page")
|
||||
public ResponseData<PageResult<SysExpand>> page(SysExpandRequest sysExpandRequest) {
|
||||
return new SuccessResponseData<>(sysExpandService.findPage(sysExpandRequest));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.controller;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandDataRequest;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandDataService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据控制器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@RestController
|
||||
@ApiResource(name = "业务拓展-具体数据")
|
||||
public class SysExpandDataController {
|
||||
|
||||
@Resource
|
||||
private SysExpandDataService sysExpandDataService;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "添加", path = "/sysExpandData/add")
|
||||
public ResponseData<SysExpandData> add(@RequestBody @Validated(SysExpandDataRequest.add.class) SysExpandDataRequest sysExpandDataRequest) {
|
||||
sysExpandDataService.add(sysExpandDataRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "删除", path = "/sysExpandData/delete")
|
||||
public ResponseData<?> delete(@RequestBody @Validated(SysExpandDataRequest.delete.class) SysExpandDataRequest sysExpandDataRequest) {
|
||||
sysExpandDataService.del(sysExpandDataRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "编辑", path = "/sysExpandData/edit")
|
||||
public ResponseData<?> edit(@RequestBody @Validated(SysExpandDataRequest.edit.class) SysExpandDataRequest sysExpandDataRequest) {
|
||||
sysExpandDataService.edit(sysExpandDataRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "查看详情", path = "/sysExpandData/detail")
|
||||
public ResponseData<SysExpandData> detail(@Validated(SysExpandDataRequest.detail.class) SysExpandDataRequest sysExpandDataRequest) {
|
||||
return new SuccessResponseData<>(sysExpandDataService.detail(sysExpandDataRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "获取列表", path = "/sysExpandData/list")
|
||||
public ResponseData<List<SysExpandData>> list(SysExpandDataRequest sysExpandDataRequest) {
|
||||
return new SuccessResponseData<>(sysExpandDataService.findList(sysExpandDataRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "分页查询", path = "/sysExpandData/page")
|
||||
public ResponseData<PageResult<SysExpandData>> page(SysExpandDataRequest sysExpandDataRequest) {
|
||||
return new SuccessResponseData<>(sysExpandDataService.findPage(sysExpandDataRequest));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.controller;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandFieldRequest;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandFieldService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息控制器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@RestController
|
||||
@ApiResource(name = "业务拓展-字段信息")
|
||||
public class SysExpandFieldController {
|
||||
|
||||
@Resource
|
||||
private SysExpandFieldService sysExpandFieldService;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "添加", path = "/sysExpandField/add")
|
||||
public ResponseData<SysExpandField> add(@RequestBody @Validated(SysExpandFieldRequest.add.class) SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
sysExpandFieldService.add(sysExpandFieldRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "删除", path = "/sysExpandField/delete")
|
||||
public ResponseData<?> delete(@RequestBody @Validated(SysExpandFieldRequest.delete.class) SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
sysExpandFieldService.del(sysExpandFieldRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@PostResource(name = "编辑", path = "/sysExpandField/edit")
|
||||
public ResponseData<?> edit(@RequestBody @Validated(SysExpandFieldRequest.edit.class) SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
sysExpandFieldService.edit(sysExpandFieldRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "查看详情", path = "/sysExpandField/detail")
|
||||
public ResponseData<SysExpandField> detail(@Validated(SysExpandFieldRequest.detail.class) SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
return new SuccessResponseData<>(sysExpandFieldService.detail(sysExpandFieldRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "获取列表", path = "/sysExpandField/list")
|
||||
public ResponseData<List<SysExpandField>> list(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
return new SuccessResponseData<>(sysExpandFieldService.findList(sysExpandFieldRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@GetResource(name = "分页查询", path = "/sysExpandField/page")
|
||||
public ResponseData<PageResult<SysExpandField>> page(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
return new SuccessResponseData<>(sysExpandFieldService.findPage(sysExpandFieldRequest));
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.controller;
|
|
@ -0,0 +1,58 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.entity;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 业务拓展实例类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@TableName("sys_expand")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysExpand extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "expand_id", type = IdType.ASSIGN_ID)
|
||||
@ChineseDescription("主键id")
|
||||
private Long expandId;
|
||||
|
||||
/**
|
||||
* 拓展业务名称
|
||||
*/
|
||||
@TableField("expand_name")
|
||||
@ChineseDescription("拓展业务名称")
|
||||
private String expandName;
|
||||
|
||||
/**
|
||||
* 拓展业务唯一编码
|
||||
*/
|
||||
@TableField("expand_code")
|
||||
@ChineseDescription("拓展业务唯一编码")
|
||||
private String expandCode;
|
||||
|
||||
/**
|
||||
* 状态:1-启用,2-禁用
|
||||
*/
|
||||
@TableField("expand_status")
|
||||
@ChineseDescription("状态:1-启用,2-禁用")
|
||||
private Integer expandStatus;
|
||||
|
||||
/**
|
||||
* 业务主键id字段名,例如:user_id
|
||||
*/
|
||||
@TableField("primary_field_name")
|
||||
@ChineseDescription("业务主键id字段名,例如:user_id")
|
||||
private String primaryFieldName;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.entity;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据实例类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@TableName("sys_expand_data")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysExpandData extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "expand_data_id", type = IdType.ASSIGN_ID)
|
||||
@ChineseDescription("主键id")
|
||||
private Long expandDataId;
|
||||
|
||||
/**
|
||||
* 拓展业务id
|
||||
*/
|
||||
@TableField("expand_id")
|
||||
@ChineseDescription("拓展业务id")
|
||||
private Long expandId;
|
||||
|
||||
/**
|
||||
* 业务主键id
|
||||
*/
|
||||
@TableField("primary_field_value")
|
||||
@ChineseDescription("业务主键id")
|
||||
private Long primaryFieldValue;
|
||||
|
||||
/**
|
||||
* 拓展业务具体数据
|
||||
*/
|
||||
@TableField("expand_data")
|
||||
@ChineseDescription("拓展业务具体数据")
|
||||
private String expandData;
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.entity;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息实例类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@TableName("sys_expand_field")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysExpandField extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "field_id", type = IdType.ASSIGN_ID)
|
||||
@ChineseDescription("主键id")
|
||||
private Long fieldId;
|
||||
|
||||
/**
|
||||
* 对应拓展业务的主键id
|
||||
*/
|
||||
@TableField("expand_id")
|
||||
@ChineseDescription("对应拓展业务的主键id")
|
||||
private Long expandId;
|
||||
|
||||
/**
|
||||
* 字段中文名称,例如:身份证号
|
||||
*/
|
||||
@TableField("field_name")
|
||||
@ChineseDescription("字段中文名称,例如:身份证号")
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 字段英文名称,例如:idCard
|
||||
*/
|
||||
@TableField("field_code")
|
||||
@ChineseDescription("字段英文名称,例如:idCard")
|
||||
private String fieldCode;
|
||||
|
||||
/**
|
||||
* 字段类型:1-字符串类型,2-数字类型,3-字典类型
|
||||
*/
|
||||
@TableField("field_type")
|
||||
@ChineseDescription("字段类型:1-字符串类型,2-数字类型,3-字典类型")
|
||||
private Integer fieldType;
|
||||
|
||||
/**
|
||||
* 是否必填:Y-必填,N-非必填
|
||||
*/
|
||||
@TableField("field_required")
|
||||
@ChineseDescription("是否必填:Y-必填,N-非必填")
|
||||
private String fieldRequired;
|
||||
|
||||
/**
|
||||
* 属性值长度,用于数字类型
|
||||
*/
|
||||
@TableField("field_length")
|
||||
@ChineseDescription("属性值长度,用于数字类型")
|
||||
private Integer fieldLength;
|
||||
|
||||
/**
|
||||
* 列表是否显示:Y-显示,N-不显示
|
||||
*/
|
||||
@TableField("list_show_flag")
|
||||
@ChineseDescription("列表是否显示:Y-显示,N-不显示")
|
||||
private String listShowFlag;
|
||||
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.entity;
|
|
@ -0,0 +1,36 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.enums;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据异常相关枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@Getter
|
||||
public enum SysExpandDataExceptionEnum implements AbstractExceptionEnum {
|
||||
|
||||
/**
|
||||
* 查询结果不存在
|
||||
*/
|
||||
SYS_EXPAND_DATA_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "查询结果不存在");
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
*/
|
||||
private final String errorCode;
|
||||
|
||||
/**
|
||||
* 提示用户信息
|
||||
*/
|
||||
private final String userTip;
|
||||
|
||||
SysExpandDataExceptionEnum(String errorCode, String userTip) {
|
||||
this.errorCode = errorCode;
|
||||
this.userTip = userTip;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.enums;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 业务拓展异常相关枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@Getter
|
||||
public enum SysExpandExceptionEnum implements AbstractExceptionEnum {
|
||||
|
||||
/**
|
||||
* 查询结果不存在
|
||||
*/
|
||||
SYS_EXPAND_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "查询结果不存在");
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
*/
|
||||
private final String errorCode;
|
||||
|
||||
/**
|
||||
* 提示用户信息
|
||||
*/
|
||||
private final String userTip;
|
||||
|
||||
SysExpandExceptionEnum(String errorCode, String userTip) {
|
||||
this.errorCode = errorCode;
|
||||
this.userTip = userTip;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.enums;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息异常相关枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@Getter
|
||||
public enum SysExpandFieldExceptionEnum implements AbstractExceptionEnum {
|
||||
|
||||
/**
|
||||
* 查询结果不存在
|
||||
*/
|
||||
SYS_EXPAND_FIELD_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "查询结果不存在");
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
*/
|
||||
private final String errorCode;
|
||||
|
||||
/**
|
||||
* 提示用户信息
|
||||
*/
|
||||
private final String userTip;
|
||||
|
||||
SysExpandFieldExceptionEnum(String errorCode, String userTip) {
|
||||
this.errorCode = errorCode;
|
||||
this.userTip = userTip;
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.enums;
|
|
@ -0,0 +1,14 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.mapper;
|
||||
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据 Mapper 接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
public interface SysExpandDataMapper extends BaseMapper<SysExpandData> {
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.mapper;
|
||||
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息 Mapper 接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
public interface SysExpandFieldMapper extends BaseMapper<SysExpandField> {
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.mapper;
|
||||
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 业务拓展 Mapper 接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
public interface SysExpandMapper extends BaseMapper<SysExpand> {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?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="cn.stylefeng.roses.kernel.expand.modular.modular.mapper.SysExpandDataMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?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="cn.stylefeng.roses.kernel.expand.modular.modular.mapper.SysExpandFieldMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?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="cn.stylefeng.roses.kernel.expand.modular.modular.mapper.SysExpandMapper">
|
||||
|
||||
</mapper>
|
|
@ -1 +0,0 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.mapper;
|
|
@ -1 +0,0 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.pojo;
|
|
@ -0,0 +1,45 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据封装类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysExpandDataRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = {edit.class, delete.class})
|
||||
@ChineseDescription("主键id")
|
||||
private Long expandDataId;
|
||||
|
||||
/**
|
||||
* 拓展业务id
|
||||
*/
|
||||
@ChineseDescription("拓展业务id")
|
||||
private Long expandId;
|
||||
|
||||
/**
|
||||
* 业务主键id
|
||||
*/
|
||||
@ChineseDescription("业务主键id")
|
||||
private Long primaryFieldValue;
|
||||
|
||||
/**
|
||||
* 拓展业务具体数据
|
||||
*/
|
||||
@ChineseDescription("拓展业务具体数据")
|
||||
private String expandData;
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息封装类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysExpandFieldRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = {edit.class, delete.class})
|
||||
@ChineseDescription("主键id")
|
||||
private Long fieldId;
|
||||
|
||||
/**
|
||||
* 对应拓展业务的主键id
|
||||
*/
|
||||
@NotNull(message = "对应拓展业务的主键id不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("对应拓展业务的主键id")
|
||||
private Long expandId;
|
||||
|
||||
/**
|
||||
* 字段中文名称,例如:身份证号
|
||||
*/
|
||||
@NotBlank(message = "字段中文名称,例如:身份证号不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("字段中文名称,例如:身份证号")
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 字段英文名称,例如:idCard
|
||||
*/
|
||||
@NotBlank(message = "字段英文名称,例如:idCard不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("字段英文名称,例如:idCard")
|
||||
private String fieldCode;
|
||||
|
||||
/**
|
||||
* 字段类型:1-字符串类型,2-数字类型,3-字典类型
|
||||
*/
|
||||
@ChineseDescription("字段类型:1-字符串类型,2-数字类型,3-字典类型")
|
||||
private Integer fieldType;
|
||||
|
||||
/**
|
||||
* 是否必填:Y-必填,N-非必填
|
||||
*/
|
||||
@ChineseDescription("是否必填:Y-必填,N-非必填")
|
||||
private String fieldRequired;
|
||||
|
||||
/**
|
||||
* 属性值长度,用于数字类型
|
||||
*/
|
||||
@ChineseDescription("属性值长度,用于数字类型")
|
||||
private Integer fieldLength;
|
||||
|
||||
/**
|
||||
* 列表是否显示:Y-显示,N-不显示
|
||||
*/
|
||||
@ChineseDescription("列表是否显示:Y-显示,N-不显示")
|
||||
private String listShowFlag;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 业务拓展封装类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysExpandRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = {edit.class, delete.class})
|
||||
@ChineseDescription("主键id")
|
||||
private Long expandId;
|
||||
|
||||
/**
|
||||
* 拓展业务名称
|
||||
*/
|
||||
@ChineseDescription("拓展业务名称")
|
||||
private String expandName;
|
||||
|
||||
/**
|
||||
* 拓展业务唯一编码
|
||||
*/
|
||||
@ChineseDescription("拓展业务唯一编码")
|
||||
private String expandCode;
|
||||
|
||||
/**
|
||||
* 状态:1-启用,2-禁用
|
||||
*/
|
||||
@ChineseDescription("状态:1-启用,2-禁用")
|
||||
private Integer expandStatus;
|
||||
|
||||
/**
|
||||
* 业务主键id字段名,例如:user_id
|
||||
*/
|
||||
@ChineseDescription("业务主键id字段名,例如:user_id")
|
||||
private String primaryFieldName;
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandDataRequest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据 服务类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
public interface SysExpandDataService extends IService<SysExpandData> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param sysExpandDataRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void add(SysExpandDataRequest sysExpandDataRequest);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sysExpandDataRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void del(SysExpandDataRequest sysExpandDataRequest);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysExpandDataRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void edit(SysExpandDataRequest sysExpandDataRequest);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param sysExpandDataRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
SysExpandData detail(SysExpandDataRequest sysExpandDataRequest);
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param sysExpandDataRequest 请求参数
|
||||
* @return List<SysExpandData> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
List<SysExpandData> findList(SysExpandDataRequest sysExpandDataRequest);
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @param sysExpandDataRequest 请求参数
|
||||
* @return PageResult<SysExpandData> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
PageResult<SysExpandData> findPage(SysExpandDataRequest sysExpandDataRequest);
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandFieldRequest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息 服务类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
public interface SysExpandFieldService extends IService<SysExpandField> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param sysExpandFieldRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void add(SysExpandFieldRequest sysExpandFieldRequest);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sysExpandFieldRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void del(SysExpandFieldRequest sysExpandFieldRequest);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysExpandFieldRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void edit(SysExpandFieldRequest sysExpandFieldRequest);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param sysExpandFieldRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
SysExpandField detail(SysExpandFieldRequest sysExpandFieldRequest);
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param sysExpandFieldRequest 请求参数
|
||||
* @return List<SysExpandField> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
List<SysExpandField> findList(SysExpandFieldRequest sysExpandFieldRequest);
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @param sysExpandFieldRequest 请求参数
|
||||
* @return PageResult<SysExpandField> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
PageResult<SysExpandField> findPage(SysExpandFieldRequest sysExpandFieldRequest);
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandRequest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展 服务类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
public interface SysExpandService extends IService<SysExpand> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param sysExpandRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void add(SysExpandRequest sysExpandRequest);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sysExpandRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void del(SysExpandRequest sysExpandRequest);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysExpandRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
void edit(SysExpandRequest sysExpandRequest);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param sysExpandRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
SysExpand detail(SysExpandRequest sysExpandRequest);
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param sysExpandRequest 请求参数
|
||||
* @return List<SysExpand> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
List<SysExpand> findList(SysExpandRequest sysExpandRequest);
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @param sysExpandRequest 请求参数
|
||||
* @return PageResult<SysExpand> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
PageResult<SysExpand> findPage(SysExpandRequest sysExpandRequest);
|
||||
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.enums.SysExpandDataExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.mapper.SysExpandDataMapper;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandDataRequest;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandDataService;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展-具体数据业务实现层
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@Service
|
||||
public class SysExpandDataServiceImpl extends ServiceImpl<SysExpandDataMapper, SysExpandData> implements SysExpandDataService {
|
||||
|
||||
@Override
|
||||
public void add(SysExpandDataRequest sysExpandDataRequest) {
|
||||
SysExpandData sysExpandData = new SysExpandData();
|
||||
BeanUtil.copyProperties(sysExpandDataRequest, sysExpandData);
|
||||
this.save(sysExpandData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(SysExpandDataRequest sysExpandDataRequest) {
|
||||
SysExpandData sysExpandData = this.querySysExpandData(sysExpandDataRequest);
|
||||
this.removeById(sysExpandData.getExpandDataId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SysExpandDataRequest sysExpandDataRequest) {
|
||||
SysExpandData sysExpandData = this.querySysExpandData(sysExpandDataRequest);
|
||||
BeanUtil.copyProperties(sysExpandDataRequest, sysExpandData);
|
||||
this.updateById(sysExpandData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysExpandData detail(SysExpandDataRequest sysExpandDataRequest) {
|
||||
return this.querySysExpandData(sysExpandDataRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SysExpandData> findPage(SysExpandDataRequest sysExpandDataRequest) {
|
||||
LambdaQueryWrapper<SysExpandData> wrapper = createWrapper(sysExpandDataRequest);
|
||||
Page<SysExpandData> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
|
||||
return PageResultFactory.createPageResult(sysRolePage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysExpandData> findList(SysExpandDataRequest sysExpandDataRequest) {
|
||||
LambdaQueryWrapper<SysExpandData> wrapper = this.createWrapper(sysExpandDataRequest);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
private SysExpandData querySysExpandData(SysExpandDataRequest sysExpandDataRequest) {
|
||||
SysExpandData sysExpandData = this.getById(sysExpandDataRequest.getExpandDataId());
|
||||
if (ObjectUtil.isEmpty(sysExpandData)) {
|
||||
throw new ServiceException(SysExpandDataExceptionEnum.SYS_EXPAND_DATA_NOT_EXISTED);
|
||||
}
|
||||
return sysExpandData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建查询wrapper
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
private LambdaQueryWrapper<SysExpandData> createWrapper(SysExpandDataRequest sysExpandDataRequest) {
|
||||
LambdaQueryWrapper<SysExpandData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
Long expandDataId = sysExpandDataRequest.getExpandDataId();
|
||||
Long expandId = sysExpandDataRequest.getExpandId();
|
||||
Long primaryFieldValue = sysExpandDataRequest.getPrimaryFieldValue();
|
||||
String expandData = sysExpandDataRequest.getExpandData();
|
||||
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(expandDataId), SysExpandData::getExpandDataId, expandDataId);
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpandData::getExpandId, expandId);
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(primaryFieldValue), SysExpandData::getPrimaryFieldValue, primaryFieldValue);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(expandData), SysExpandData::getExpandData, expandData);
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.enums.SysExpandFieldExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.mapper.SysExpandFieldMapper;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandFieldRequest;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandFieldService;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展-字段信息业务实现层
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@Service
|
||||
public class SysExpandFieldServiceImpl extends ServiceImpl<SysExpandFieldMapper, SysExpandField> implements SysExpandFieldService {
|
||||
|
||||
@Override
|
||||
public void add(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
SysExpandField sysExpandField = new SysExpandField();
|
||||
BeanUtil.copyProperties(sysExpandFieldRequest, sysExpandField);
|
||||
this.save(sysExpandField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
SysExpandField sysExpandField = this.querySysExpandField(sysExpandFieldRequest);
|
||||
this.removeById(sysExpandField.getFieldId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
SysExpandField sysExpandField = this.querySysExpandField(sysExpandFieldRequest);
|
||||
BeanUtil.copyProperties(sysExpandFieldRequest, sysExpandField);
|
||||
this.updateById(sysExpandField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysExpandField detail(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
return this.querySysExpandField(sysExpandFieldRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SysExpandField> findPage(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
LambdaQueryWrapper<SysExpandField> wrapper = createWrapper(sysExpandFieldRequest);
|
||||
Page<SysExpandField> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
|
||||
return PageResultFactory.createPageResult(sysRolePage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysExpandField> findList(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
LambdaQueryWrapper<SysExpandField> wrapper = this.createWrapper(sysExpandFieldRequest);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
private SysExpandField querySysExpandField(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
SysExpandField sysExpandField = this.getById(sysExpandFieldRequest.getFieldId());
|
||||
if (ObjectUtil.isEmpty(sysExpandField)) {
|
||||
throw new ServiceException(SysExpandFieldExceptionEnum.SYS_EXPAND_FIELD_NOT_EXISTED);
|
||||
}
|
||||
return sysExpandField;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建查询wrapper
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
private LambdaQueryWrapper<SysExpandField> createWrapper(SysExpandFieldRequest sysExpandFieldRequest) {
|
||||
LambdaQueryWrapper<SysExpandField> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
Long fieldId = sysExpandFieldRequest.getFieldId();
|
||||
Long expandId = sysExpandFieldRequest.getExpandId();
|
||||
String fieldName = sysExpandFieldRequest.getFieldName();
|
||||
String fieldCode = sysExpandFieldRequest.getFieldCode();
|
||||
Integer fieldType = sysExpandFieldRequest.getFieldType();
|
||||
String fieldRequired = sysExpandFieldRequest.getFieldRequired();
|
||||
Integer fieldLength = sysExpandFieldRequest.getFieldLength();
|
||||
String listShowFlag = sysExpandFieldRequest.getListShowFlag();
|
||||
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(fieldId), SysExpandField::getFieldId, fieldId);
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpandField::getExpandId, expandId);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(fieldName), SysExpandField::getFieldName, fieldName);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(fieldCode), SysExpandField::getFieldCode, fieldCode);
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(fieldType), SysExpandField::getFieldType, fieldType);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(fieldRequired), SysExpandField::getFieldRequired, fieldRequired);
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(fieldLength), SysExpandField::getFieldLength, fieldLength);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(listShowFlag), SysExpandField::getListShowFlag, listShowFlag);
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.enums.SysExpandExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.mapper.SysExpandMapper;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandRequest;
|
||||
import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandService;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务拓展业务实现层
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
@Service
|
||||
public class SysExpandServiceImpl extends ServiceImpl<SysExpandMapper, SysExpand> implements SysExpandService {
|
||||
|
||||
@Override
|
||||
public void add(SysExpandRequest sysExpandRequest) {
|
||||
SysExpand sysExpand = new SysExpand();
|
||||
BeanUtil.copyProperties(sysExpandRequest, sysExpand);
|
||||
this.save(sysExpand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(SysExpandRequest sysExpandRequest) {
|
||||
SysExpand sysExpand = this.querySysExpand(sysExpandRequest);
|
||||
this.removeById(sysExpand.getExpandId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SysExpandRequest sysExpandRequest) {
|
||||
SysExpand sysExpand = this.querySysExpand(sysExpandRequest);
|
||||
BeanUtil.copyProperties(sysExpandRequest, sysExpand);
|
||||
this.updateById(sysExpand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysExpand detail(SysExpandRequest sysExpandRequest) {
|
||||
return this.querySysExpand(sysExpandRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SysExpand> findPage(SysExpandRequest sysExpandRequest) {
|
||||
LambdaQueryWrapper<SysExpand> wrapper = createWrapper(sysExpandRequest);
|
||||
Page<SysExpand> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
|
||||
return PageResultFactory.createPageResult(sysRolePage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysExpand> findList(SysExpandRequest sysExpandRequest) {
|
||||
LambdaQueryWrapper<SysExpand> wrapper = this.createWrapper(sysExpandRequest);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
private SysExpand querySysExpand(SysExpandRequest sysExpandRequest) {
|
||||
SysExpand sysExpand = this.getById(sysExpandRequest.getExpandId());
|
||||
if (ObjectUtil.isEmpty(sysExpand)) {
|
||||
throw new ServiceException(SysExpandExceptionEnum.SYS_EXPAND_NOT_EXISTED);
|
||||
}
|
||||
return sysExpand;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建查询wrapper
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/03/29 23:47
|
||||
*/
|
||||
private LambdaQueryWrapper<SysExpand> createWrapper(SysExpandRequest sysExpandRequest) {
|
||||
LambdaQueryWrapper<SysExpand> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
Long expandId = sysExpandRequest.getExpandId();
|
||||
String expandName = sysExpandRequest.getExpandName();
|
||||
String expandCode = sysExpandRequest.getExpandCode();
|
||||
Integer expandStatus = sysExpandRequest.getExpandStatus();
|
||||
String primaryFieldName = sysExpandRequest.getPrimaryFieldName();
|
||||
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpand::getExpandId, expandId);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(expandName), SysExpand::getExpandName, expandName);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(expandCode), SysExpand::getExpandCode, expandCode);
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(expandStatus), SysExpand::getExpandStatus, expandStatus);
|
||||
queryWrapper.like(ObjectUtil.isNotEmpty(primaryFieldName), SysExpand::getPrimaryFieldName, primaryFieldName);
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
package cn.stylefeng.roses.kernel.expand.modular.modular.service;
|
Loading…
Reference in New Issue