From 7b5a96156c7a75a1bd678197828cba3d03a657c4 Mon Sep 17 00:00:00 2001 From: gjh <1421wake> Date: Tue, 8 Apr 2025 10:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E7=B1=BB=E5=88=AB=E3=80=81?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=B1=BB=E5=88=AB=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ContractTypeController.java | 105 ++++++++++++++ .../controller/DocumentTypeController.java | 105 ++++++++++++++ .../dromara/platform/domain/ContractType.java | 47 +++++++ .../dromara/platform/domain/DocumentInfo.java | 2 +- .../dromara/platform/domain/DocumentType.java | 47 +++++++ .../platform/domain/bo/ContractTypeBo.java | 42 ++++++ .../platform/domain/bo/DocumentInfoBo.java | 4 +- .../platform/domain/bo/DocumentTypeBo.java | 42 ++++++ .../platform/domain/vo/ContractTypeVo.java | 50 +++++++ .../platform/domain/vo/DocumentInfoVo.java | 10 +- .../platform/domain/vo/DocumentTypeVo.java | 50 +++++++ .../platform/mapper/ContractTypeMapper.java | 15 ++ .../platform/mapper/DocumentTypeMapper.java | 15 ++ .../service/IContractTypeService.java | 68 +++++++++ .../service/IDocumentTypeService.java | 68 +++++++++ .../service/impl/ContractTypeServiceImpl.java | 130 ++++++++++++++++++ .../service/impl/DocumentInfoServiceImpl.java | 2 +- .../service/impl/DocumentTypeServiceImpl.java | 130 ++++++++++++++++++ 18 files changed, 927 insertions(+), 5 deletions(-) create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractTypeController.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/DocumentTypeController.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/ContractType.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentType.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/ContractTypeBo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentTypeBo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractTypeVo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentTypeVo.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/ContractTypeMapper.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/DocumentTypeMapper.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractTypeService.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IDocumentTypeService.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractTypeServiceImpl.java create mode 100644 ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentTypeServiceImpl.java diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractTypeController.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractTypeController.java new file mode 100644 index 0000000..7beb393 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ContractTypeController.java @@ -0,0 +1,105 @@ +package org.dromara.platform.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.platform.domain.vo.ContractTypeVo; +import org.dromara.platform.domain.bo.ContractTypeBo; +import org.dromara.platform.service.IContractTypeService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 合同类别-类别 + * + * @author gejunhao + * @date 2025-04-08 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/platform/contractType") +public class ContractTypeController extends BaseController { + + private final IContractTypeService contractTypeService; + + /** + * 查询合同类别-类别列表 + */ + @SaCheckPermission("platform:contractType:list") + @GetMapping("/list") + public TableDataInfo list(ContractTypeBo bo, PageQuery pageQuery) { + return contractTypeService.queryPageList(bo, pageQuery); + } + + /** + * 导出合同类别-类别列表 + */ + @SaCheckPermission("platform:contractType:export") + @Log(title = "合同类别-类别", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ContractTypeBo bo, HttpServletResponse response) { + List list = contractTypeService.queryList(bo); + ExcelUtil.exportExcel(list, "合同类别-类别", ContractTypeVo.class, response); + } + + /** + * 获取合同类别-类别详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("platform:contractType:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable String id) { + return R.ok(contractTypeService.queryById(id)); + } + + /** + * 新增合同类别-类别 + */ + @SaCheckPermission("platform:contractType:add") + @Log(title = "合同类别-类别", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ContractTypeBo bo) { + return toAjax(contractTypeService.insertByBo(bo)); + } + + /** + * 修改合同类别-类别 + */ + @SaCheckPermission("platform:contractType:edit") + @Log(title = "合同类别-类别", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ContractTypeBo bo) { + return toAjax(contractTypeService.updateByBo(bo)); + } + + /** + * 删除合同类别-类别 + * + * @param ids 主键串 + */ + @SaCheckPermission("platform:contractType:remove") + @Log(title = "合同类别-类别", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable String[] ids) { + return toAjax(contractTypeService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/DocumentTypeController.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/DocumentTypeController.java new file mode 100644 index 0000000..923590f --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/DocumentTypeController.java @@ -0,0 +1,105 @@ +package org.dromara.platform.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.platform.domain.vo.DocumentTypeVo; +import org.dromara.platform.domain.bo.DocumentTypeBo; +import org.dromara.platform.service.IDocumentTypeService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 文件类别-类别 + * + * @author gejunhao + * @date 2025-04-08 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/platform/documentType") +public class DocumentTypeController extends BaseController { + + private final IDocumentTypeService documentTypeService; + + /** + * 查询文件类别-类别列表 + */ + @SaCheckPermission("platform:documentType:list") + @GetMapping("/list") + public TableDataInfo list(DocumentTypeBo bo, PageQuery pageQuery) { + return documentTypeService.queryPageList(bo, pageQuery); + } + + /** + * 导出文件类别-类别列表 + */ + @SaCheckPermission("platform:documentType:export") + @Log(title = "文件类别-类别", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(DocumentTypeBo bo, HttpServletResponse response) { + List list = documentTypeService.queryList(bo); + ExcelUtil.exportExcel(list, "文件类别-类别", DocumentTypeVo.class, response); + } + + /** + * 获取文件类别-类别详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("platform:documentType:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable String id) { + return R.ok(documentTypeService.queryById(id)); + } + + /** + * 新增文件类别-类别 + */ + @SaCheckPermission("platform:documentType:add") + @Log(title = "文件类别-类别", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody DocumentTypeBo bo) { + return toAjax(documentTypeService.insertByBo(bo)); + } + + /** + * 修改文件类别-类别 + */ + @SaCheckPermission("platform:documentType:edit") + @Log(title = "文件类别-类别", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody DocumentTypeBo bo) { + return toAjax(documentTypeService.updateByBo(bo)); + } + + /** + * 删除文件类别-类别 + * + * @param ids 主键串 + */ + @SaCheckPermission("platform:documentType:remove") + @Log(title = "文件类别-类别", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable String[] ids) { + return toAjax(documentTypeService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/ContractType.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/ContractType.java new file mode 100644 index 0000000..46aede8 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/ContractType.java @@ -0,0 +1,47 @@ +package org.dromara.platform.domain; + +import org.dromara.common.tenant.core.TenantEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 合同类别-类别对象 contract_type + * + * @author gejunhao + * @date 2025-04-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("contract_type") +public class ContractType extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 唯一标识符 + */ + @TableId(value = "id") + private String id; + + /** + * 合同类别名称 + */ + private String typeName; + + /** + * 当前状态 + */ + private Long status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentInfo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentInfo.java index 7945dea..0d9d427 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentInfo.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentInfo.java @@ -35,7 +35,7 @@ public class DocumentInfo extends TenantEntity { /** * 文档类型 */ - private String districtType; + private String type; /** * 附件 diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentType.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentType.java new file mode 100644 index 0000000..8906f43 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/DocumentType.java @@ -0,0 +1,47 @@ +package org.dromara.platform.domain; + +import org.dromara.common.tenant.core.TenantEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 文件类别-类别对象 document_type + * + * @author gejunhao + * @date 2025-04-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("document_type") +public class DocumentType extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 唯一标识符 + */ + @TableId(value = "id") + private String id; + + /** + * 文件类别名称 + */ + private String typeName; + + /** + * 当前状态 + */ + private Long status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + @TableLogic + private String delFlag; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/ContractTypeBo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/ContractTypeBo.java new file mode 100644 index 0000000..d7e573c --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/ContractTypeBo.java @@ -0,0 +1,42 @@ +package org.dromara.platform.domain.bo; + +import org.dromara.platform.domain.ContractType; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 合同类别-类别业务对象 contract_type + * + * @author gejunhao + * @date 2025-04-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = ContractType.class, reverseConvertGenerate = false) +public class ContractTypeBo extends BaseEntity { + + /** + * 唯一标识符 + */ + @NotBlank(message = "唯一标识符不能为空", groups = { EditGroup.class }) + private String id; + + /** + * 合同类别名称 + */ + @NotBlank(message = "合同类别名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String typeName; + + /** + * 当前状态 + */ + @NotNull(message = "当前状态不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long status; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentInfoBo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentInfoBo.java index 3e0b5ae..3ee077e 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentInfoBo.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentInfoBo.java @@ -36,12 +36,12 @@ public class DocumentInfoBo extends BaseEntity { * 文档类型 */ @NotBlank(message = "文档类型不能为空", groups = { AddGroup.class, EditGroup.class }) - private String districtType; + private String type; /** * 附件 */ - @NotBlank(message = "附件不能为空", groups = { AddGroup.class, EditGroup.class }) + //@NotBlank(message = "附件不能为空", groups = { AddGroup.class, EditGroup.class }) private String attachment; /** diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentTypeBo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentTypeBo.java new file mode 100644 index 0000000..e73c087 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/bo/DocumentTypeBo.java @@ -0,0 +1,42 @@ +package org.dromara.platform.domain.bo; + +import org.dromara.platform.domain.DocumentType; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 文件类别-类别业务对象 document_type + * + * @author gejunhao + * @date 2025-04-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = DocumentType.class, reverseConvertGenerate = false) +public class DocumentTypeBo extends BaseEntity { + + /** + * 唯一标识符 + */ + @NotBlank(message = "唯一标识符不能为空", groups = { EditGroup.class }) + private String id; + + /** + * 文件类别名称 + */ + @NotBlank(message = "文件类别名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String typeName; + + /** + * 当前状态 + */ + @NotNull(message = "当前状态不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long status; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractTypeVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractTypeVo.java new file mode 100644 index 0000000..edf51f9 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/ContractTypeVo.java @@ -0,0 +1,50 @@ +package org.dromara.platform.domain.vo; + +import org.dromara.platform.domain.ContractType; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 合同类别-类别视图对象 contract_type + * + * @author gejunhao + * @date 2025-04-08 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = ContractType.class) +public class ContractTypeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 唯一标识符 + */ + @ExcelProperty(value = "唯一标识符") + private String id; + + /** + * 合同类别名称 + */ + @ExcelProperty(value = "合同类别名称") + private String typeName; + + /** + * 当前状态 + */ +// @ExcelProperty(value = "当前状态") +// private Long status; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentInfoVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentInfoVo.java index 4e3966d..dd98a50 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentInfoVo.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentInfoVo.java @@ -1,5 +1,7 @@ package org.dromara.platform.domain.vo; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import org.dromara.platform.domain.DocumentInfo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; @@ -44,7 +46,7 @@ public class DocumentInfoVo implements Serializable { * 文档类型 */ @ExcelProperty(value = "文档类型") - private String districtType; + private String type; /** * 附件 @@ -58,5 +60,11 @@ public class DocumentInfoVo implements Serializable { @ExcelProperty(value = "当前状态:0启用 1禁用") private Long status; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + } diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentTypeVo.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentTypeVo.java new file mode 100644 index 0000000..1bc9b0d --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/domain/vo/DocumentTypeVo.java @@ -0,0 +1,50 @@ +package org.dromara.platform.domain.vo; + +import org.dromara.platform.domain.DocumentType; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 文件类别-类别视图对象 document_type + * + * @author gejunhao + * @date 2025-04-08 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = DocumentType.class) +public class DocumentTypeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 唯一标识符 + */ + @ExcelProperty(value = "唯一标识符") + private String id; + + /** + * 文件类别名称 + */ + @ExcelProperty(value = "文件类别名称") + private String typeName; + + /** + * 当前状态 + */ +// @ExcelProperty(value = "当前状态") +// private Long status; + + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/ContractTypeMapper.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/ContractTypeMapper.java new file mode 100644 index 0000000..50008a9 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/ContractTypeMapper.java @@ -0,0 +1,15 @@ +package org.dromara.platform.mapper; + +import org.dromara.platform.domain.ContractType; +import org.dromara.platform.domain.vo.ContractTypeVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 合同类别-类别Mapper接口 + * + * @author gejunhao + * @date 2025-04-08 + */ +public interface ContractTypeMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/DocumentTypeMapper.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/DocumentTypeMapper.java new file mode 100644 index 0000000..14a2ee1 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/mapper/DocumentTypeMapper.java @@ -0,0 +1,15 @@ +package org.dromara.platform.mapper; + +import org.dromara.platform.domain.DocumentType; +import org.dromara.platform.domain.vo.DocumentTypeVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 文件类别-类别Mapper接口 + * + * @author gejunhao + * @date 2025-04-08 + */ +public interface DocumentTypeMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractTypeService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractTypeService.java new file mode 100644 index 0000000..1990290 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IContractTypeService.java @@ -0,0 +1,68 @@ +package org.dromara.platform.service; + +import org.dromara.platform.domain.vo.ContractTypeVo; +import org.dromara.platform.domain.bo.ContractTypeBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 合同类别-类别Service接口 + * + * @author gejunhao + * @date 2025-04-08 + */ +public interface IContractTypeService { + + /** + * 查询合同类别-类别 + * + * @param id 主键 + * @return 合同类别-类别 + */ + ContractTypeVo queryById(String id); + + /** + * 分页查询合同类别-类别列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 合同类别-类别分页列表 + */ + TableDataInfo queryPageList(ContractTypeBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的合同类别-类别列表 + * + * @param bo 查询条件 + * @return 合同类别-类别列表 + */ + List queryList(ContractTypeBo bo); + + /** + * 新增合同类别-类别 + * + * @param bo 合同类别-类别 + * @return 是否新增成功 + */ + Boolean insertByBo(ContractTypeBo bo); + + /** + * 修改合同类别-类别 + * + * @param bo 合同类别-类别 + * @return 是否修改成功 + */ + Boolean updateByBo(ContractTypeBo bo); + + /** + * 校验并批量删除合同类别-类别信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IDocumentTypeService.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IDocumentTypeService.java new file mode 100644 index 0000000..69c2b8b --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/IDocumentTypeService.java @@ -0,0 +1,68 @@ +package org.dromara.platform.service; + +import org.dromara.platform.domain.vo.DocumentTypeVo; +import org.dromara.platform.domain.bo.DocumentTypeBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 文件类别-类别Service接口 + * + * @author gejunhao + * @date 2025-04-08 + */ +public interface IDocumentTypeService { + + /** + * 查询文件类别-类别 + * + * @param id 主键 + * @return 文件类别-类别 + */ + DocumentTypeVo queryById(String id); + + /** + * 分页查询文件类别-类别列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 文件类别-类别分页列表 + */ + TableDataInfo queryPageList(DocumentTypeBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的文件类别-类别列表 + * + * @param bo 查询条件 + * @return 文件类别-类别列表 + */ + List queryList(DocumentTypeBo bo); + + /** + * 新增文件类别-类别 + * + * @param bo 文件类别-类别 + * @return 是否新增成功 + */ + Boolean insertByBo(DocumentTypeBo bo); + + /** + * 修改文件类别-类别 + * + * @param bo 文件类别-类别 + * @return 是否修改成功 + */ + Boolean updateByBo(DocumentTypeBo bo); + + /** + * 校验并批量删除文件类别-类别信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractTypeServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractTypeServiceImpl.java new file mode 100644 index 0000000..66f7b89 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/ContractTypeServiceImpl.java @@ -0,0 +1,130 @@ +package org.dromara.platform.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.platform.domain.bo.ContractTypeBo; +import org.dromara.platform.domain.vo.ContractTypeVo; +import org.dromara.platform.domain.ContractType; +import org.dromara.platform.mapper.ContractTypeMapper; +import org.dromara.platform.service.IContractTypeService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 合同类别-类别Service业务层处理 + * + * @author gejunhao + * @date 2025-04-08 + */ +@RequiredArgsConstructor +@Service +public class ContractTypeServiceImpl implements IContractTypeService { + + private final ContractTypeMapper baseMapper; + + /** + * 查询合同类别-类别 + * + * @param id 主键 + * @return 合同类别-类别 + */ + @Override + public ContractTypeVo queryById(String id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询合同类别-类别列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 合同类别-类别分页列表 + */ + @Override + public TableDataInfo queryPageList(ContractTypeBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的合同类别-类别列表 + * + * @param bo 查询条件 + * @return 合同类别-类别列表 + */ + @Override + public List queryList(ContractTypeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ContractTypeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTypeName()), ContractType::getTypeName, bo.getTypeName()); + lqw.eq(bo.getStatus() != null, ContractType::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增合同类别-类别 + * + * @param bo 合同类别-类别 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(ContractTypeBo bo) { + ContractType add = MapstructUtils.convert(bo, ContractType.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改合同类别-类别 + * + * @param bo 合同类别-类别 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(ContractTypeBo bo) { + ContractType update = MapstructUtils.convert(bo, ContractType.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ContractType entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除合同类别-类别信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java index 6c104f1..801e83d 100644 --- a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentInfoServiceImpl.java @@ -72,7 +72,7 @@ public class DocumentInfoServiceImpl implements IDocumentInfoService { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), DocumentInfo::getDocumentName, bo.getDocumentName()); - lqw.eq(StringUtils.isNotBlank(bo.getDistrictType()), DocumentInfo::getDistrictType, bo.getDistrictType()); + lqw.eq(StringUtils.isNotBlank(bo.getType()), DocumentInfo::getType, bo.getType()); lqw.eq(StringUtils.isNotBlank(bo.getAttachment()), DocumentInfo::getAttachment, bo.getAttachment()); lqw.eq(bo.getStatus() != null, DocumentInfo::getStatus, bo.getStatus()); return lqw; diff --git a/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentTypeServiceImpl.java b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentTypeServiceImpl.java new file mode 100644 index 0000000..934c9e1 --- /dev/null +++ b/ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/DocumentTypeServiceImpl.java @@ -0,0 +1,130 @@ +package org.dromara.platform.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.platform.domain.bo.DocumentTypeBo; +import org.dromara.platform.domain.vo.DocumentTypeVo; +import org.dromara.platform.domain.DocumentType; +import org.dromara.platform.mapper.DocumentTypeMapper; +import org.dromara.platform.service.IDocumentTypeService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 文件类别-类别Service业务层处理 + * + * @author gejunhao + * @date 2025-04-08 + */ +@RequiredArgsConstructor +@Service +public class DocumentTypeServiceImpl implements IDocumentTypeService { + + private final DocumentTypeMapper baseMapper; + + /** + * 查询文件类别-类别 + * + * @param id 主键 + * @return 文件类别-类别 + */ + @Override + public DocumentTypeVo queryById(String id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询文件类别-类别列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 文件类别-类别分页列表 + */ + @Override + public TableDataInfo queryPageList(DocumentTypeBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的文件类别-类别列表 + * + * @param bo 查询条件 + * @return 文件类别-类别列表 + */ + @Override + public List queryList(DocumentTypeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(DocumentTypeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getTypeName()), DocumentType::getTypeName, bo.getTypeName()); + lqw.eq(bo.getStatus() != null, DocumentType::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增文件类别-类别 + * + * @param bo 文件类别-类别 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(DocumentTypeBo bo) { + DocumentType add = MapstructUtils.convert(bo, DocumentType.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改文件类别-类别 + * + * @param bo 文件类别-类别 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(DocumentTypeBo bo) { + DocumentType update = MapstructUtils.convert(bo, DocumentType.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(DocumentType entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除文件类别-类别信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +}