diff --git a/kernel-s-expand/.gitignore b/kernel-s-expand/.gitignore deleted file mode 100644 index 4cf5330ff..000000000 --- a/kernel-s-expand/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -*.class - -# Package Files # -*.jar -*.war -*.ear -target/ - -# eclipse -.settings/ -.classpath -.project -logs/ - -# idea -.idea/ -*.iml - -*velocity.log* - -### STS ### -.apt_generated -.factorypath -.springBeans - -### IntelliJ IDEA ### -.idea -*.iws -*.ipr - -### NetBeans ### -nbproject/private/ -build/ -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ - -*.log -tmp/ \ No newline at end of file diff --git a/kernel-s-expand/README.md b/kernel-s-expand/README.md deleted file mode 100644 index 1a6115fde..000000000 --- a/kernel-s-expand/README.md +++ /dev/null @@ -1 +0,0 @@ -# 拓展字段 \ No newline at end of file diff --git a/kernel-s-expand/expand-api/README.md b/kernel-s-expand/expand-api/README.md deleted file mode 100644 index 27e91dc89..000000000 --- a/kernel-s-expand/expand-api/README.md +++ /dev/null @@ -1 +0,0 @@ -# api模块,存放接口、常量、异常、枚举等模块规则相关类 \ No newline at end of file diff --git a/kernel-s-expand/expand-api/pom.xml b/kernel-s-expand/expand-api/pom.xml deleted file mode 100644 index 6215cd273..000000000 --- a/kernel-s-expand/expand-api/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - - cn.stylefeng.roses - kernel-s-expand - 8.0.0 - ../pom.xml - - - expand-api - - jar - - - - - - cn.stylefeng.roses - config-api - ${roses.version} - - - - - - cn.stylefeng.roses - validator-api - ${roses.version} - - - - - diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/ExpandApi.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/ExpandApi.java deleted file mode 100644 index ed537229c..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/ExpandApi.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright [2020-2030] [https://www.stylefeng.cn] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: - * - * 1.请不要删除和修改根目录下的LICENSE文件。 - * 2.请不要删除和修改Guns源码头部的版权声明。 - * 3.请保留源码和相关描述文件的项目出处,作者声明等。 - * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns - * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns - * 6.若您的项目无法满足以上几点,可申请商业授权 - */ -package cn.stylefeng.roses.kernel.expand.modular.api; - -import cn.stylefeng.roses.kernel.expand.modular.api.pojo.ExpandDataInfo; -import cn.stylefeng.roses.kernel.expand.modular.api.pojo.ExpandFieldInfo; - -import java.util.List; -import java.util.Map; - -/** - * 拓展字段Api - * - * @author fengshuonan - * @since 2022-03-29 23:14:31 - */ -public interface ExpandApi { - - /** - * 保存或更新动态数据 - * - * @author fengshuonan - * @since 2022/3/31 21:20 - */ - void saveOrUpdateExpandData(ExpandDataInfo expandDataInfo); - - /** - * 获取列表需要的拓展字段信息 - * - * @author fengshuonan - * @since 2022/4/1 9:48 - */ - List getPageListExpandFieldList(String expandCode); - - /** - * 获取某一条拓展数据 - * - * @author fengshuonan - * @since 2022/4/1 9:55 - */ - Map getExpandDataInfo(String expandCode, Long primaryFieldValue); - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/constants/ExpandConstants.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/constants/ExpandConstants.java deleted file mode 100644 index e41d9fc48..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/constants/ExpandConstants.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright [2020-2030] [https://www.stylefeng.cn] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: - * - * 1.请不要删除和修改根目录下的LICENSE文件。 - * 2.请不要删除和修改Guns源码头部的版权声明。 - * 3.请保留源码和相关描述文件的项目出处,作者声明等。 - * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns - * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns - * 6.若您的项目无法满足以上几点,可申请商业授权 - */ -package cn.stylefeng.roses.kernel.expand.modular.api.constants; - -/** - * 拓展字段业务 - * - * @author fengshuonan - * @since 2022-03-29 23:14:31 - */ -public interface ExpandConstants { - - /** - * 拓展字段模块名称 - */ - String EXPAND_MODULE_NAME = "kernel-s-expand"; - - /** - * 异常枚举的步进值 - */ - String EXPAND_EXCEPTION_STEP_CODE = "99"; - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/enums/DemoEnum.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/enums/DemoEnum.java deleted file mode 100644 index 8d50b8c52..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/enums/DemoEnum.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.stylefeng.roses.kernel.expand.modular.api.enums; - -import lombok.Getter; - -/** - * 一个示例 - * - * @author fengshuonan - * @since 2022-03-29 23:14:31 - */ -@Getter -public enum DemoEnum { - - /** - * markdown格式 - */ - MARKDOWN(1, "markdown格式"), - - /** - * 富文本格式 - */ - TEXT(2, "富文本格式"); - - private final Integer code; - - private final String message; - - DemoEnum(Integer code, String message) { - this.code = code; - this.message = message; - } - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/enums/FieldTypeEnum.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/enums/FieldTypeEnum.java deleted file mode 100644 index 1bfb5569b..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/enums/FieldTypeEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.stylefeng.roses.kernel.expand.modular.api.enums; - -import lombok.Getter; - -/** - * 字段类型枚举 - * - * @author fengshuonan - * @since 2022/4/1 10:34 - */ -@Getter -public enum FieldTypeEnum { - - /** - * 字符串 - */ - STR(1), - - /** - * 数字 - */ - NUM(2), - - /** - * 字典格式 - */ - DICT(3); - - private final Integer code; - - FieldTypeEnum(Integer code) { - this.code = code; - } - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/exception/ExpandException.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/exception/ExpandException.java deleted file mode 100644 index a81f98339..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/exception/ExpandException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright [2020-2030] [https://www.stylefeng.cn] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: - * - * 1.请不要删除和修改根目录下的LICENSE文件。 - * 2.请不要删除和修改Guns源码头部的版权声明。 - * 3.请保留源码和相关描述文件的项目出处,作者声明等。 - * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns - * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns - * 6.若您的项目无法满足以上几点,可申请商业授权 - */ -package cn.stylefeng.roses.kernel.expand.modular.api.exception; - -import cn.hutool.core.util.StrUtil; -import cn.stylefeng.roses.kernel.expand.modular.api.constants.ExpandConstants; -import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum; -import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException; - -/** - * 拓展字段异常 - * - * @author fengshuonan - * @since 2022-03-29 23:14:31 - */ -public class ExpandException extends ServiceException { - - public ExpandException(AbstractExceptionEnum exception, Object... params) { - super(ExpandConstants.EXPAND_MODULE_NAME, exception.getErrorCode(), StrUtil.format(exception.getUserTip(), params)); - } - - public ExpandException(AbstractExceptionEnum exception) { - super(ExpandConstants.EXPAND_MODULE_NAME, exception); - } - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/exception/enums/ExpandExceptionEnum.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/exception/enums/ExpandExceptionEnum.java deleted file mode 100644 index 8f6b68a8f..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/exception/enums/ExpandExceptionEnum.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright [2020-2030] [https://www.stylefeng.cn] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: - * - * 1.请不要删除和修改根目录下的LICENSE文件。 - * 2.请不要删除和修改Guns源码头部的版权声明。 - * 3.请保留源码和相关描述文件的项目出处,作者声明等。 - * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns - * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns - * 6.若您的项目无法满足以上几点,可申请商业授权 - */ -package cn.stylefeng.roses.kernel.expand.modular.api.exception.enums; - -import cn.stylefeng.roses.kernel.expand.modular.api.constants.ExpandConstants; -import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; -import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum; -import lombok.Getter; - -/** - * 拓展字段的异常枚举 - * - * @author fengshuonan - * @since 2022-03-29 23:14:31 - */ -@Getter -public enum ExpandExceptionEnum implements AbstractExceptionEnum { - - /** - * 查询不到对应拓展字段 - */ - CANT_FIND_EXPAND(RuleConstants.BUSINESS_ERROR_TYPE_CODE + ExpandConstants.EXPAND_EXCEPTION_STEP_CODE + "01", "查询不到对应拓展字段,具体信息:{}"); - - /** - * 错误编码 - */ - private final String errorCode; - - /** - * 提示用户信息 - */ - private final String userTip; - - ExpandExceptionEnum(String errorCode, String userTip) { - this.errorCode = errorCode; - this.userTip = userTip; - } - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/pojo/ExpandDataInfo.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/pojo/ExpandDataInfo.java deleted file mode 100644 index 1f09ddfe7..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/pojo/ExpandDataInfo.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.stylefeng.roses.kernel.expand.modular.api.pojo; - -import lombok.Data; - -import java.util.Map; - -/** - * 拓展数据信息 - * - * @author fengshuonan - * @since 2022/3/31 21:25 - */ -@Data -public class ExpandDataInfo { - - /** - * 拓展id - */ - private Long expandId; - - /** - * 动态表单数据 - */ - private Map expandData; - - /** - * 主键字段值 - */ - private Long primaryFieldValue; - -} diff --git a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/pojo/ExpandFieldInfo.java b/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/pojo/ExpandFieldInfo.java deleted file mode 100644 index 2188d3621..000000000 --- a/kernel-s-expand/expand-api/src/main/java/cn/stylefeng/roses/kernel/expand/modular/api/pojo/ExpandFieldInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.stylefeng.roses.kernel.expand.modular.api.pojo; - -import lombok.Data; - -/** - * 拓展字段信息 - * - * @author fengshuonan - * @since 2022/4/1 9:46 - */ -@Data -public class ExpandFieldInfo { - - /** - * 拓展id - */ - private Long expandId; - - /** - * 字段中文名 - */ - private String fieldName; - - /** - * 字段英文名 - */ - private String fieldCode; - -} diff --git a/kernel-s-expand/expand-business/README.md b/kernel-s-expand/expand-business/README.md deleted file mode 100644 index 7a3f68b56..000000000 --- a/kernel-s-expand/expand-business/README.md +++ /dev/null @@ -1 +0,0 @@ -# 业务模块-存放CRUD相关业务 \ No newline at end of file diff --git a/kernel-s-expand/expand-business/pom.xml b/kernel-s-expand/expand-business/pom.xml deleted file mode 100644 index 93901171f..000000000 --- a/kernel-s-expand/expand-business/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - 4.0.0 - - - cn.stylefeng.roses - kernel-s-expand - 8.0.0 - ../pom.xml - - - expand-business - - jar - - - - - - cn.stylefeng.roses - expand-api - ${roses.version} - - - - - - cn.stylefeng.roses - sys-api - ${roses.version} - - - - - - cn.stylefeng.roses - scanner-api - ${roses.version} - - - - - cn.stylefeng.roses - dict-api - ${roses.version} - - - - - - cn.stylefeng.roses - db-sdk-mp - ${roses.version} - - - - - org.springframework.boot - spring-boot-starter-web - - - - - diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandController.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandController.java deleted file mode 100644 index 7762e003c..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandController.java +++ /dev/null @@ -1,143 +0,0 @@ -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.api.ExpandApi; -import cn.stylefeng.roses.kernel.expand.modular.api.pojo.ExpandFieldInfo; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData; -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.enums.ResBizTypeEnum; -import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest; -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 - * @since 2022/03/29 23:47 - */ -@RestController -@ApiResource(name = "业务拓展", resBizType = ResBizTypeEnum.SYSTEM) -public class SysExpandController { - - @Resource - private SysExpandService sysExpandService; - - @Resource - private ExpandApi expandApi; - - /** - * 添加 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @PostResource(name = "添加", path = "/sysExpand/add") - public ResponseData add(@RequestBody @Validated(SysExpandRequest.add.class) SysExpandRequest sysExpandRequest) { - sysExpandService.add(sysExpandRequest); - return new SuccessResponseData<>(); - } - - /** - * 删除 - * - * @author fengshuonan - * @since 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 - * @since 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 - * @since 2022/03/29 23:47 - */ - @PostResource(name = "修改业务状态", path = "/sysExpand/updateStatus") - public ResponseData updateStatus(@RequestBody @Validated(BaseRequest.updateStatus.class) SysExpandRequest sysExpandRequest) { - sysExpandService.updateStatus(sysExpandRequest); - return new SuccessResponseData<>(); - } - - /** - * 查看详情 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "查看详情", path = "/sysExpand/detail") - public ResponseData detail(@Validated(SysExpandRequest.detail.class) SysExpandRequest sysExpandRequest) { - return new SuccessResponseData<>(sysExpandService.detail(sysExpandRequest)); - } - - /** - * 根据业务编码获取业务数据详情 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "根据业务编码获取业务数据详情", path = "/sysExpand/getByExpandCode") - public ResponseData getByExpandCode(@Validated(SysExpandRequest.getByExpandCode.class) SysExpandRequest sysExpandRequest) { - return new SuccessResponseData<>(sysExpandService.getByExpandCode(sysExpandRequest)); - } - - /** - * 获取列表 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "获取列表", path = "/sysExpand/list") - public ResponseData> list(SysExpandRequest sysExpandRequest) { - return new SuccessResponseData<>(sysExpandService.findList(sysExpandRequest)); - } - - /** - * 获取列表(带分页) - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "分页查询", path = "/sysExpand/page") - public ResponseData> page(SysExpandRequest sysExpandRequest) { - return new SuccessResponseData<>(sysExpandService.findPage(sysExpandRequest)); - } - - /** - * 获取某个业务,需要列表展示的拓展字段 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "获取某个业务,需要列表展示的拓展字段", path = "/sysExpand/getListFields") - public ResponseData> getListFields(@Validated(SysExpandRequest.getByExpandCode.class) SysExpandRequest sysExpandRequest) { - return new SuccessResponseData<>(expandApi.getPageListExpandFieldList(sysExpandRequest.getExpandCode())); - } - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandDataController.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandDataController.java deleted file mode 100644 index 76308394a..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandDataController.java +++ /dev/null @@ -1,78 +0,0 @@ -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.enums.ResBizTypeEnum; -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 - * @since 2022/03/29 23:47 - */ -@RestController -@ApiResource(name = "业务拓展-具体数据", resBizType = ResBizTypeEnum.SYSTEM) -public class SysExpandDataController { - - @Resource - private SysExpandDataService sysExpandDataService; - - /** - * 删除 - * - * @author fengshuonan - * @since 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 - * @since 2022/03/29 23:47 - */ - @GetResource(name = "查看详情", path = "/sysExpandData/detail") - public ResponseData detail(@Validated(SysExpandDataRequest.detail.class) SysExpandDataRequest sysExpandDataRequest) { - return new SuccessResponseData<>(sysExpandDataService.detail(sysExpandDataRequest)); - } - - /** - * 获取列表 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "获取列表", path = "/sysExpandData/list") - public ResponseData> list(SysExpandDataRequest sysExpandDataRequest) { - return new SuccessResponseData<>(sysExpandDataService.findList(sysExpandDataRequest)); - } - - /** - * 获取列表(带分页) - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "分页查询", path = "/sysExpandData/page") - public ResponseData> page(SysExpandDataRequest sysExpandDataRequest) { - return new SuccessResponseData<>(sysExpandDataService.findPage(sysExpandDataRequest)); - } - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandFieldController.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandFieldController.java deleted file mode 100644 index 548b3f5f1..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/controller/SysExpandFieldController.java +++ /dev/null @@ -1,102 +0,0 @@ -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.enums.ResBizTypeEnum; -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 - * @since 2022/03/29 23:47 - */ -@RestController -@ApiResource(name = "业务拓展-字段信息", resBizType = ResBizTypeEnum.SYSTEM) -public class SysExpandFieldController { - - @Resource - private SysExpandFieldService sysExpandFieldService; - - /** - * 添加 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @PostResource(name = "添加", path = "/sysExpandField/add") - public ResponseData add(@RequestBody @Validated(SysExpandFieldRequest.add.class) SysExpandFieldRequest sysExpandFieldRequest) { - sysExpandFieldService.add(sysExpandFieldRequest); - return new SuccessResponseData<>(); - } - - /** - * 删除 - * - * @author fengshuonan - * @since 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 - * @since 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 - * @since 2022/03/29 23:47 - */ - @GetResource(name = "查看详情", path = "/sysExpandField/detail") - public ResponseData detail(@Validated(SysExpandFieldRequest.detail.class) SysExpandFieldRequest sysExpandFieldRequest) { - return new SuccessResponseData<>(sysExpandFieldService.detail(sysExpandFieldRequest)); - } - - /** - * 获取列表 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "获取列表", path = "/sysExpandField/list") - public ResponseData> list(SysExpandFieldRequest sysExpandFieldRequest) { - return new SuccessResponseData<>(sysExpandFieldService.findList(sysExpandFieldRequest)); - } - - /** - * 获取列表(带分页) - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - @GetResource(name = "分页查询", path = "/sysExpandField/page") - public ResponseData> page(SysExpandFieldRequest sysExpandFieldRequest) { - return new SuccessResponseData<>(sysExpandFieldService.findPage(sysExpandFieldRequest)); - } - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpand.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpand.java deleted file mode 100644 index 5ad733d82..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpand.java +++ /dev/null @@ -1,73 +0,0 @@ -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 - * @since 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; - - /** - * 主业务表,例如:sys_user - */ - @TableField("primary_table_name") - @ChineseDescription("主业务表,例如:sys_user") - private String primaryTableName; - - /** - * 业务主键id字段名,例如:user_id - */ - @TableField("primary_field_name") - @ChineseDescription("业务主键id字段名,例如:user_id") - private String primaryFieldName; - - /** - * 业务主键id字段名驼峰法,例如:userId - */ - @TableField("primary_field_camel") - @ChineseDescription("业务主键id字段名驼峰法,例如:userId") - private String primaryFieldCamel; - - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpandData.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpandData.java deleted file mode 100644 index d1bf1356c..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpandData.java +++ /dev/null @@ -1,65 +0,0 @@ -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; - -import java.util.List; - -/** - * 业务拓展-具体数据实例类 - * - * @author fengshuonan - * @since 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; - - /** - * 拓展业务信息 - */ - @ChineseDescription("拓展业务信息") - private transient SysExpand expandInfo; - - /** - * 字段元数据信息列表 - */ - @ChineseDescription("字段元数据信息列表") - private transient List fieldInfoList; - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpandField.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpandField.java deleted file mode 100644 index d504c9d4c..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/entity/SysExpandField.java +++ /dev/null @@ -1,86 +0,0 @@ -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 - * @since 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; - - /** - * 字典类型编码,用于字典类型 - */ - @TableField("field_dict_type_code") - @ChineseDescription("字典类型编码,用于字典类型") - private String fieldDictTypeCode; - - /** - * 列表是否显示:Y-显示,N-不显示 - */ - @TableField("list_show_flag") - @ChineseDescription("列表是否显示:Y-显示,N-不显示") - private String listShowFlag; - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandDataExceptionEnum.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandDataExceptionEnum.java deleted file mode 100644 index 635022b0f..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandDataExceptionEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -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 - * @since 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; - } - -} \ No newline at end of file diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandExceptionEnum.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandExceptionEnum.java deleted file mode 100644 index 8b93619f4..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandExceptionEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -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 - * @since 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; - } - -} \ No newline at end of file diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandFieldExceptionEnum.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandFieldExceptionEnum.java deleted file mode 100644 index c261b156f..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/enums/SysExpandFieldExceptionEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -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 - * @since 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; - } - -} \ No newline at end of file diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandDataMapper.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandDataMapper.java deleted file mode 100644 index 027dbf0b0..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandDataMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -public interface SysExpandDataMapper extends BaseMapper { - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandFieldMapper.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandFieldMapper.java deleted file mode 100644 index f92d14df3..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandFieldMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -public interface SysExpandFieldMapper extends BaseMapper { - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandMapper.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandMapper.java deleted file mode 100644 index f65fbef8f..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/SysExpandMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -public interface SysExpandMapper extends BaseMapper { - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandDataMapper.xml b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandDataMapper.xml deleted file mode 100644 index 0efdb4d6f..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandDataMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandFieldMapper.xml b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandFieldMapper.xml deleted file mode 100644 index 9c98368f1..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandFieldMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandMapper.xml b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandMapper.xml deleted file mode 100644 index f5f93de23..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/mapper/mapping/SysExpandMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandDataRequest.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandDataRequest.java deleted file mode 100644 index a5ed7bae8..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandDataRequest.java +++ /dev/null @@ -1,45 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class SysExpandDataRequest extends BaseRequest { - - /** - * 主键id - */ - @NotNull(message = "主键id不能为空", groups = {edit.class, delete.class, detail.class}) - @ChineseDescription("主键id") - private Long expandDataId; - - /** - * 拓展业务id - */ - @ChineseDescription("拓展业务id") - private Long expandId; - - /** - * 业务主键id - */ - @ChineseDescription("业务主键id") - private Long primaryFieldValue; - - /** - * 拓展业务具体数据 - */ - @ChineseDescription("拓展业务具体数据") - private String expandData; - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandFieldRequest.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandFieldRequest.java deleted file mode 100644 index 404f28bbe..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandFieldRequest.java +++ /dev/null @@ -1,82 +0,0 @@ -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 - * @since 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, page.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-字典类型") - @NotNull(message = "字典类型不能为空", groups = {add.class, edit.class}) - private Integer fieldType; - - /** - * 是否必填:Y-必填,N-非必填 - */ - @ChineseDescription("是否必填:Y-必填,N-非必填") - @NotBlank(message = "是否必填不能为空", groups = {add.class, edit.class}) - private String fieldRequired; - - /** - * 属性值长度,用于数字类型 - */ - @ChineseDescription("属性值长度,用于数字类型") - private Integer fieldLength; - - /** - * 字典类型编码,用于字典类型 - */ - @ChineseDescription("字典类型编码,用于字典类型") - private String fieldDictTypeCode; - - /** - * 列表是否显示:Y-显示,N-不显示 - */ - @ChineseDescription("列表是否显示:Y-显示,N-不显示") - @NotBlank(message = "列表是否显示不能为空", groups = {add.class, edit.class}) - private String listShowFlag; - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandRequest.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandRequest.java deleted file mode 100644 index d2fcc4a6a..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/pojo/request/SysExpandRequest.java +++ /dev/null @@ -1,84 +0,0 @@ -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 cn.stylefeng.roses.kernel.validator.api.validators.status.StatusValue; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * 业务拓展封装类 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class SysExpandRequest extends BaseRequest { - - /** - * 主键id - */ - @NotNull(message = "主键id不能为空", groups = {edit.class, delete.class, updateStatus.class}) - @ChineseDescription("主键id") - private Long expandId; - - /** - * 拓展业务名称 - */ - @ChineseDescription("拓展业务名称") - private String expandName; - - /** - * 拓展业务唯一编码 - */ - @ChineseDescription("拓展业务唯一编码") - @NotBlank(message = "拓展编码不能为空", groups = getByExpandCode.class) - private String expandCode; - - /** - * 状态:1-启用,2-禁用 - */ - @ChineseDescription("状态:1-启用,2-禁用") - @NotNull(message = "状态不能为空", groups = {updateStatus.class}) - @StatusValue(groups = updateStatus.class) - private Integer expandStatus; - - /** - * 主业务表,例如:sys_user - */ - @ChineseDescription("主业务表,例如:sys_user") - private String primaryTableName; - - /** - * 业务主键id字段名,例如:user_id - */ - @ChineseDescription("业务主键id字段名,例如:user_id") - private String primaryFieldName; - - /** - * 业务主键id字段名驼峰法,例如:userId - */ - @ChineseDescription("业务主键id字段名驼峰法,例如:userId") - private String primaryFieldCamel; - - /** - * 业务主键id的值 - */ - @ChineseDescription("业务主键id的值") - private Long primaryFieldValue; - - /** - * 获取业务元数据信息 - * - * @author fengshuonan - * @since 2022/3/31 15:25 - */ - public @interface getByExpandCode { - } - - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandDataService.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandDataService.java deleted file mode 100644 index 8f767592f..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandDataService.java +++ /dev/null @@ -1,82 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -public interface SysExpandDataService extends IService { - - /** - * 新增 - * - * @param sysExpandDataRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void add(SysExpandDataRequest sysExpandDataRequest); - - /** - * 删除 - * - * @param sysExpandDataRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void del(SysExpandDataRequest sysExpandDataRequest); - - /** - * 编辑 - * - * @param sysExpandDataRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void edit(SysExpandDataRequest sysExpandDataRequest); - - /** - * 查询详情 - * - * @param sysExpandDataRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - SysExpandData detail(SysExpandDataRequest sysExpandDataRequest); - - /** - * 查询详情 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - SysExpandData detailByPrimaryFieldValue(Long primaryFieldValue); - - /** - * 获取列表 - * - * @param sysExpandDataRequest 请求参数 - * @return List 返回结果 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - List findList(SysExpandDataRequest sysExpandDataRequest); - - /** - * 获取列表(带分页) - * - * @param sysExpandDataRequest 请求参数 - * @return PageResult 返回结果 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - PageResult findPage(SysExpandDataRequest sysExpandDataRequest); - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandFieldService.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandFieldService.java deleted file mode 100644 index cca52997c..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandFieldService.java +++ /dev/null @@ -1,74 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -public interface SysExpandFieldService extends IService { - - /** - * 新增 - * - * @param sysExpandFieldRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void add(SysExpandFieldRequest sysExpandFieldRequest); - - /** - * 删除 - * - * @param sysExpandFieldRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void del(SysExpandFieldRequest sysExpandFieldRequest); - - /** - * 编辑 - * - * @param sysExpandFieldRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void edit(SysExpandFieldRequest sysExpandFieldRequest); - - /** - * 查询详情 - * - * @param sysExpandFieldRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - SysExpandField detail(SysExpandFieldRequest sysExpandFieldRequest); - - /** - * 获取列表 - * - * @param sysExpandFieldRequest 请求参数 - * @return List 返回结果 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - List findList(SysExpandFieldRequest sysExpandFieldRequest); - - /** - * 获取列表(带分页) - * - * @param sysExpandFieldRequest 请求参数 - * @return PageResult 返回结果 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - PageResult findPage(SysExpandFieldRequest sysExpandFieldRequest); - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandService.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandService.java deleted file mode 100644 index 5e85cff53..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/SysExpandService.java +++ /dev/null @@ -1,91 +0,0 @@ -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.api.ExpandApi; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData; -import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandRequest; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - * 业务拓展 服务类 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ -public interface SysExpandService extends IService, ExpandApi { - - /** - * 新增 - * - * @param sysExpandRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void add(SysExpandRequest sysExpandRequest); - - /** - * 删除 - * - * @param sysExpandRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void del(SysExpandRequest sysExpandRequest); - - /** - * 编辑 - * - * @param sysExpandRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - void edit(SysExpandRequest sysExpandRequest); - - /** - * 查询详情 - * - * @param sysExpandRequest 请求参数 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - SysExpand detail(SysExpandRequest sysExpandRequest); - - /** - * 获取列表 - * - * @param sysExpandRequest 请求参数 - * @return List 返回结果 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - List findList(SysExpandRequest sysExpandRequest); - - /** - * 获取列表(带分页) - * - * @param sysExpandRequest 请求参数 - * @return PageResult 返回结果 - * @author fengshuonan - * @since 2022/03/29 23:47 - */ - PageResult findPage(SysExpandRequest sysExpandRequest); - - /** - * 修改业务状态 - * - * @author fengshuonan - * @since 2022/3/30 10:37 - */ - void updateStatus(SysExpandRequest sysExpandRequest); - - /** - * 获取业务元数据信息 - * - * @author fengshuonan - * @since 2022/3/31 15:26 - */ - SysExpandData getByExpandCode(SysExpandRequest sysExpandRequest); -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandDataServiceImpl.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandDataServiceImpl.java deleted file mode 100644 index 2e87b8cae..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandDataServiceImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -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.entity.SysExpandData; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField; -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.pojo.request.SysExpandFieldRequest; -import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandRequest; -import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandDataService; -import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandFieldService; -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 javax.annotation.Resource; -import java.util.List; - -/** - * 业务拓展-具体数据业务实现层 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ -@Service -public class SysExpandDataServiceImpl extends ServiceImpl implements SysExpandDataService { - - @Resource - private SysExpandService sysExpandService; - - @Resource - private SysExpandFieldService sysExpandFieldService; - - @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) { - // 获取拓展数据详情 - SysExpandData sysExpandData = this.querySysExpandData(sysExpandDataRequest); - - // 获取拓展业务信息 - SysExpandRequest sysExpandRequest = new SysExpandRequest(); - sysExpandRequest.setExpandId(sysExpandData.getExpandId()); - SysExpand detail = sysExpandService.detail(sysExpandRequest); - - // 获取拓展业务的字段信息 - SysExpandFieldRequest sysExpandFieldRequest = new SysExpandFieldRequest(); - sysExpandFieldRequest.setExpandId(sysExpandData.getExpandId()); - List list = sysExpandFieldService.findList(sysExpandFieldRequest); - - // 设置返回结果的元数据字段信息 - sysExpandData.setExpandInfo(detail); - sysExpandData.setFieldInfoList(list); - return sysExpandData; - } - - @Override - public SysExpandData detailByPrimaryFieldValue(Long primaryFieldValue) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(SysExpandData::getPrimaryFieldValue, primaryFieldValue); - return this.getOne(wrapper, false); - } - - @Override - public PageResult findPage(SysExpandDataRequest sysExpandDataRequest) { - LambdaQueryWrapper wrapper = createWrapper(sysExpandDataRequest); - Page sysRolePage = this.page(PageFactory.defaultPage(), wrapper); - return PageResultFactory.createPageResult(sysRolePage); - } - - @Override - public List findList(SysExpandDataRequest sysExpandDataRequest) { - LambdaQueryWrapper wrapper = this.createWrapper(sysExpandDataRequest); - return this.list(wrapper); - } - - /** - * 获取信息 - * - * @author fengshuonan - * @since 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 - * @since 2022/03/29 23:47 - */ - private LambdaQueryWrapper createWrapper(SysExpandDataRequest sysExpandDataRequest) { - LambdaQueryWrapper 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; - } - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandFieldServiceImpl.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandFieldServiceImpl.java deleted file mode 100644 index 238ccb120..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandFieldServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -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 - * @since 2022/03/29 23:47 - */ -@Service -public class SysExpandFieldServiceImpl extends ServiceImpl 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 findPage(SysExpandFieldRequest sysExpandFieldRequest) { - LambdaQueryWrapper wrapper = createWrapper(sysExpandFieldRequest); - Page sysRolePage = this.page(PageFactory.defaultPage(), wrapper); - return PageResultFactory.createPageResult(sysRolePage); - } - - @Override - public List findList(SysExpandFieldRequest sysExpandFieldRequest) { - LambdaQueryWrapper wrapper = this.createWrapper(sysExpandFieldRequest); - return this.list(wrapper); - } - - /** - * 获取信息 - * - * @author fengshuonan - * @since 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 - * @since 2022/03/29 23:47 - */ - private LambdaQueryWrapper createWrapper(SysExpandFieldRequest sysExpandFieldRequest) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - - Long expandId = sysExpandFieldRequest.getExpandId(); - - queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpandField::getExpandId, expandId); - - return queryWrapper; - } - -} diff --git a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandServiceImpl.java b/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandServiceImpl.java deleted file mode 100644 index 229ba81b4..000000000 --- a/kernel-s-expand/expand-business/src/main/java/cn/stylefeng/roses/kernel/expand/modular/modular/service/impl/SysExpandServiceImpl.java +++ /dev/null @@ -1,263 +0,0 @@ -package cn.stylefeng.roses.kernel.expand.modular.modular.service.impl; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -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.dict.api.DictApi; -import cn.stylefeng.roses.kernel.expand.modular.api.enums.FieldTypeEnum; -import cn.stylefeng.roses.kernel.expand.modular.api.pojo.ExpandDataInfo; -import cn.stylefeng.roses.kernel.expand.modular.api.pojo.ExpandFieldInfo; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpand; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandData; -import cn.stylefeng.roses.kernel.expand.modular.modular.entity.SysExpandField; -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.SysExpandFieldRequest; -import cn.stylefeng.roses.kernel.expand.modular.modular.pojo.request.SysExpandRequest; -import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandDataService; -import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandFieldService; -import cn.stylefeng.roses.kernel.expand.modular.modular.service.SysExpandService; -import cn.stylefeng.roses.kernel.rule.enums.StatusEnum; -import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum; -import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -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 javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 业务拓展业务实现层 - * - * @author fengshuonan - * @since 2022/03/29 23:47 - */ -@Service -public class SysExpandServiceImpl extends ServiceImpl implements SysExpandService { - - @Resource - private SysExpandFieldService sysExpandFieldService; - - @Resource - private SysExpandDataService sysExpandDataService; - - @Resource - private DictApi dictApi; - - @Override - public void add(SysExpandRequest sysExpandRequest) { - SysExpand sysExpand = new SysExpand(); - BeanUtil.copyProperties(sysExpandRequest, sysExpand); - - // 设置启用状态 - sysExpand.setExpandStatus(StatusEnum.ENABLE.getCode()); - - 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 findPage(SysExpandRequest sysExpandRequest) { - LambdaQueryWrapper wrapper = createWrapper(sysExpandRequest); - Page sysRolePage = this.page(PageFactory.defaultPage(), wrapper); - return PageResultFactory.createPageResult(sysRolePage); - } - - @Override - public void updateStatus(SysExpandRequest sysExpandRequest) { - SysExpand sysExpand = this.querySysExpand(sysExpandRequest); - sysExpand.setExpandStatus(sysExpandRequest.getExpandStatus()); - this.updateById(sysExpand); - } - - @Override - public SysExpandData getByExpandCode(SysExpandRequest sysExpandRequest) { - // 根据编码获取拓展信息 - LambdaQueryWrapper sysExpandLambdaQueryWrapper = new LambdaQueryWrapper<>(); - sysExpandLambdaQueryWrapper.eq(SysExpand::getExpandCode, sysExpandRequest.getExpandCode()); - SysExpand sysExpand = this.getOne(sysExpandLambdaQueryWrapper, false); - if (sysExpand == null) { - throw new ServiceException(SysExpandExceptionEnum.SYS_EXPAND_NOT_EXISTED); - } - - // 获取拓展业务的字段信息 - SysExpandFieldRequest sysExpandFieldRequest = new SysExpandFieldRequest(); - sysExpandFieldRequest.setExpandId(sysExpand.getExpandId()); - List list = sysExpandFieldService.findList(sysExpandFieldRequest); - - // 如果传了主键id,则查询一下业务表单的数据 - SysExpandData sysExpandData = new SysExpandData(); - if (sysExpandRequest.getPrimaryFieldValue() != null) { - sysExpandData = sysExpandDataService.detailByPrimaryFieldValue(sysExpandRequest.getPrimaryFieldValue()); - if (sysExpandData == null) { - sysExpandData = new SysExpandData(); - } - } - - // 设置返回信息 - sysExpandData.setExpandId(sysExpand.getExpandId()); - sysExpandData.setFieldInfoList(list); - sysExpandData.setExpandInfo(sysExpand); - - return sysExpandData; - } - - @Override - public List findList(SysExpandRequest sysExpandRequest) { - LambdaQueryWrapper wrapper = this.createWrapper(sysExpandRequest); - wrapper.select(SysExpand::getExpandId, SysExpand::getExpandName, SysExpand::getExpandCode); - wrapper.eq(SysExpand::getExpandStatus, StatusEnum.ENABLE.getCode()); - return this.list(wrapper); - } - - @Override - public void saveOrUpdateExpandData(ExpandDataInfo expandDataInfo) { - if (expandDataInfo == null) { - return; - } - - Map dynamicFormData = expandDataInfo.getExpandData(); - if (dynamicFormData == null || dynamicFormData.size() <= 0) { - return; - } - - // 具体数据转化为json - String dynamicData = JSON.toJSONString(dynamicFormData); - - SysExpandData saveData = new SysExpandData(); - saveData.setExpandId(expandDataInfo.getExpandId()); - saveData.setPrimaryFieldValue(expandDataInfo.getPrimaryFieldValue()); - saveData.setExpandData(dynamicData); - - // 查询数据有没有在库中存在 - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(SysExpandData::getExpandId, expandDataInfo.getExpandId()); - wrapper.eq(SysExpandData::getPrimaryFieldValue, expandDataInfo.getPrimaryFieldValue()); - SysExpandData sysExpandData = this.sysExpandDataService.getOne(wrapper, false); - - // 数据库中不存在,则保存 - if (sysExpandData == null) { - this.sysExpandDataService.save(saveData); - } else { - saveData.setExpandDataId(sysExpandData.getExpandDataId()); - this.sysExpandDataService.updateById(saveData); - } - } - - @Override - public List getPageListExpandFieldList(String expandCode) { - SysExpandRequest sysExpandRequest = new SysExpandRequest(); - sysExpandRequest.setExpandCode(expandCode); - SysExpandData sysExpandData = this.getByExpandCode(sysExpandRequest); - - List fieldInfoList = sysExpandData.getFieldInfoList(); - - ArrayList expandFieldInfos = new ArrayList<>(); - for (SysExpandField sysExpandField : fieldInfoList) { - // 获取是否需要列表展示 - String listShowFlag = sysExpandField.getListShowFlag(); - if (YesOrNotEnum.Y.getCode().equals(listShowFlag)) { - ExpandFieldInfo expandFieldInfo = new ExpandFieldInfo(); - expandFieldInfo.setExpandId(sysExpandField.getExpandId()); - expandFieldInfo.setFieldName(sysExpandField.getFieldName()); - expandFieldInfo.setFieldCode(sysExpandField.getFieldCode()); - expandFieldInfos.add(expandFieldInfo); - } - } - - return expandFieldInfos; - } - - @Override - public Map getExpandDataInfo(String expandCode, Long primaryFieldValue) { - - SysExpandRequest sysExpandRequest = new SysExpandRequest(); - sysExpandRequest.setExpandCode(expandCode); - sysExpandRequest.setPrimaryFieldValue(primaryFieldValue); - SysExpandData sysExpandData = this.getByExpandCode(sysExpandRequest); - - // 获取对应数据 - HashMap result = new HashMap<>(); - String expandData = sysExpandData.getExpandData(); - if (StrUtil.isEmpty(expandData)) { - return result; - } - - // 将json转化为Map - JSONObject jsonObject = JSON.parseObject(expandData); - - // 获取字段元数据,将需要进行字典转化的,转化为字典中文名称 - List fieldInfoList = sysExpandData.getFieldInfoList(); - for (SysExpandField sysExpandField : fieldInfoList) { - if (FieldTypeEnum.DICT.getCode().equals(sysExpandField.getFieldType())) { - String dictTypeCode = sysExpandField.getFieldDictTypeCode(); - String dictValue = jsonObject.getString(sysExpandField.getFieldCode()); - String dictName = dictApi.getDictName(dictTypeCode, dictValue); - jsonObject.put(sysExpandField.getFieldCode(), dictName); - } - } - - return jsonObject; - } - - /** - * 获取信息 - * - * @author fengshuonan - * @since 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 - * @since 2022/03/29 23:47 - */ - private LambdaQueryWrapper createWrapper(SysExpandRequest sysExpandRequest) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - - Long expandId = sysExpandRequest.getExpandId(); - String expandName = sysExpandRequest.getExpandName(); - String expandCode = sysExpandRequest.getExpandCode(); - - queryWrapper.eq(ObjectUtil.isNotNull(expandId), SysExpand::getExpandId, expandId); - queryWrapper.like(ObjectUtil.isNotEmpty(expandName), SysExpand::getExpandName, expandName); - queryWrapper.like(ObjectUtil.isNotEmpty(expandCode), SysExpand::getExpandCode, expandCode); - - return queryWrapper; - } -} diff --git a/kernel-s-expand/expand-spring-boot-starter/README.md b/kernel-s-expand/expand-spring-boot-starter/README.md deleted file mode 100644 index ab408c724..000000000 --- a/kernel-s-expand/expand-spring-boot-starter/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Spring Boot自动装配 - diff --git a/kernel-s-expand/expand-spring-boot-starter/pom.xml b/kernel-s-expand/expand-spring-boot-starter/pom.xml deleted file mode 100644 index 9ce03f434..000000000 --- a/kernel-s-expand/expand-spring-boot-starter/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 4.0.0 - - - cn.stylefeng.roses - kernel-s-expand - 8.0.0 - ../pom.xml - - - expand-spring-boot-starter - - jar - - - - - - cn.stylefeng.roses - expand-business - ${roses.version} - - - - - diff --git a/kernel-s-expand/expand-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/expand/modular/starter/ExpandAutoConfiguration.java b/kernel-s-expand/expand-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/expand/modular/starter/ExpandAutoConfiguration.java deleted file mode 100644 index c0374d87c..000000000 --- a/kernel-s-expand/expand-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/expand/modular/starter/ExpandAutoConfiguration.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright [2020-2030] [https://www.stylefeng.cn] - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: - * - * 1.请不要删除和修改根目录下的LICENSE文件。 - * 2.请不要删除和修改Guns源码头部的版权声明。 - * 3.请保留源码和相关描述文件的项目出处,作者声明等。 - * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns - * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns - * 6.若您的项目无法满足以上几点,可申请商业授权 - */ -package cn.stylefeng.roses.kernel.expand.modular.starter; - -import org.springframework.context.annotation.Configuration; - -/** - * 拓展字段自动装配 - * - * @author fengshuonan - * @since 2022-03-29 23:14:31 - */ -@Configuration -public class ExpandAutoConfiguration { - -} diff --git a/kernel-s-expand/expand-spring-boot-starter/src/main/resources/META-INF/spring.factories b/kernel-s-expand/expand-spring-boot-starter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 52dbcb55a..000000000 --- a/kernel-s-expand/expand-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - cn.stylefeng.roses.kernel.expand.modular.starter.ExpandAutoConfiguration diff --git a/kernel-s-expand/pom.xml b/kernel-s-expand/pom.xml deleted file mode 100644 index 88de0247e..000000000 --- a/kernel-s-expand/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - - cn.stylefeng.roses - roses-kernel - 8.0.0 - ../pom.xml - - - kernel-s-expand - - pom - - - expand-api - expand-business - expand-spring-boot-starter - - - - - - - cn.stylefeng.roses - kernel-a-rule - ${roses.version} - - - - - diff --git a/kernel-s-sys/sys-spring-boot-starter/pom.xml b/kernel-s-sys/sys-spring-boot-starter/pom.xml index 92e8f09ca..c31a8efd9 100644 --- a/kernel-s-sys/sys-spring-boot-starter/pom.xml +++ b/kernel-s-sys/sys-spring-boot-starter/pom.xml @@ -145,13 +145,6 @@ ${roses.version} - - - cn.stylefeng.roses - expand-spring-boot-starter - ${roses.version} - - diff --git a/pom.xml b/pom.xml index a543cd22b..528a857fb 100644 --- a/pom.xml +++ b/pom.xml @@ -94,9 +94,6 @@ kernel-s-dict - - kernel-s-expand - kernel-s-group