档案借阅申请,档案分类
parent
c4bb8252a8
commit
c4e102b6c7
@ -0,0 +1,65 @@
|
||||
-- 新增 借阅申请表
|
||||
CREATE TABLE `lyr-one`.`archives_borrow_apply` (
|
||||
`id` bigint(20) NOT NULL COMMENT '借阅id',
|
||||
`borrow_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅申请编码',
|
||||
`borrow_state` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅申请状态 0:已通过 1驳回',
|
||||
`reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅事由',
|
||||
`describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅描述',
|
||||
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '借阅人id',
|
||||
`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅人名称',
|
||||
`dept_id` bigint(11) NULL DEFAULT NULL COMMENT '借阅部门id',
|
||||
`dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅部门名称',
|
||||
`return_time` datetime NULL DEFAULT NULL COMMENT '预计归还日期',
|
||||
`way` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '借阅方式 0:外接 1:现场查阅',
|
||||
`media` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '档案介质',
|
||||
`company_id` bigint(20) NULL DEFAULT NULL COMMENT '业务实体id',
|
||||
`company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '业务实体名称',
|
||||
`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户编号',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '描述',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改日期',
|
||||
`deleted` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '逻辑删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '档案借阅申请表' ROW_FORMAT = Dynamic;
|
||||
|
||||
|
||||
INSERT INTO `lyr-one`.`system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '借阅', '', 1, 0, 0, '/borrow', 'component', NULL, NULL, 0, b'1', b'1', b'1', '', '2023-09-13 15:27:06', '', '2023-09-13 15:27:16', b'0');
|
||||
SET @menuId = LAST_INSERT_ID();
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '借阅申请', 'borrow:apply:list', 2, 1, @menuId, 'apply', 'education', 'borrow/apply/index', 'apply', 0, b'1', b'1', b'1', '', '2023-09-13 15:29:48', '', '2023-09-13 15:29:48', b'0');
|
||||
SET @menuId2 = LAST_INSERT_ID();
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '新增借阅申请', 'archives:borrowAapply:create', 3, 1, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 15:36:56', '', '2023-09-13 15:36:56', b'0');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '导出借阅申请', 'archives:borrowAapply:export', 3, 2, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 15:37:31', '', '2023-09-13 15:37:31', b'0');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '修改借阅申请', 'archives:borrowAapply:update', 3, 3, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 15:39:24', '', '2023-09-13 15:39:24', b'0');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('删除借阅申请', 'archives:borrowAapply:delete', 3, 4, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 15:39:53', '', '2023-09-13 16:08:02', b'1');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '删除借阅申请', 'archives:borrowAapply:delete', 3, 4, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 16:08:23', '', '2023-09-13 16:08:23', b'0');
|
||||
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '借阅历史记录', 'borrow:record:list', 2, 2, @menuId, 'record', 'table', 'borrow/record/index', 'record', 0, b'1', b'1', b'1', '', '2023-09-13 16:09:53', '', '2023-09-13 16:12:09', b'0');
|
||||
|
||||
|
||||
-- 新增档案分类表
|
||||
CREATE TABLE `lyr-one`.`setting_file_category` (
|
||||
`id` bigint(20) NOT NULL COMMENT 'id',
|
||||
`category_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '档案类型编码',
|
||||
`parent_id` bigint(20) NULL DEFAULT NULL COMMENT '档案类型父id',
|
||||
`type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型名称',
|
||||
`catalog_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目录号',
|
||||
`two_catalog_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '二级类别号',
|
||||
`custody_time` datetime NULL DEFAULT NULL COMMENT '保管期限',
|
||||
`state` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '启用状态 0启用 1禁用',
|
||||
`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '住户编号',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改日期',
|
||||
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '制单人',
|
||||
`deleted` tinyint(1) NULL DEFAULT NULL COMMENT '逻辑删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '档案分类表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- 查询档案设置id进行赋值
|
||||
SELECT `id` INTO @menuId FROM system_menu WHERE `name` = '档案设置';
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '档案分类', '', 2, 4, @menuId, 'fileCategory', '#', 'setting/fileCategory/index', 'fileCategory', 0, b'1', b'1', b'1', '', '2023-09-13 16:59:36', '', '2023-09-13 17:05:30', b'0');
|
||||
SET @menuId2 = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '档案分类创建', 'setting:file-category:create', 3, 1, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 17:14:06', '', '2023-09-13 17:14:44', b'0');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('档案分类导出', 'setting:file-category:export', 3, 2, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 17:14:35', '', '2023-09-13 17:14:35', b'0');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '档案类型删除', 'setting:file-category:delete', 3, 3, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 17:15:04', '', '2023-09-13 17:15:04', b'0');
|
||||
INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '档案类型修改', 'setting:file-category:update', 3, 4, @menuId2, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-09-13 17:15:24', '', '2023-09-13 17:15:24', b'0');
|
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.setting.controller.admin.filecategory;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo.*;
|
||||
import cn.iocoder.yudao.module.setting.dal.dataobject.filecategory.FileCategoryDO;
|
||||
import cn.iocoder.yudao.module.setting.convert.filecategory.FileCategoryConvert;
|
||||
import cn.iocoder.yudao.module.setting.service.filecategory.FileCategoryService;
|
||||
|
||||
@Tag(name = "管理后台 - 档案分类")
|
||||
@RestController
|
||||
@RequestMapping("/setting/file-category")
|
||||
@Validated
|
||||
public class FileCategoryController {
|
||||
|
||||
@Resource
|
||||
private FileCategoryService fileCategoryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建档案分类")
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:create')")
|
||||
public CommonResult<Long> createFileCategory(@Valid @RequestBody FileCategoryCreateReqVO createReqVO) {
|
||||
return success(fileCategoryService.createFileCategory(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新档案分类")
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:update')")
|
||||
public CommonResult<Boolean> updateFileCategory(@Valid @RequestBody FileCategoryUpdateReqVO updateReqVO) {
|
||||
fileCategoryService.updateFileCategory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除档案分类")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:delete')")
|
||||
public CommonResult<Boolean> deleteFileCategory(@RequestParam("id") Long id) {
|
||||
fileCategoryService.deleteFileCategory(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得档案分类")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:query')")
|
||||
public CommonResult<FileCategoryRespVO> getFileCategory(@RequestParam("id") Long id) {
|
||||
FileCategoryDO fileCategory = fileCategoryService.getFileCategory(id);
|
||||
return success(FileCategoryConvert.INSTANCE.convert(fileCategory));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得档案分类列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:query')")
|
||||
public CommonResult<List<FileCategoryRespVO>> getFileCategoryList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<FileCategoryDO> list = fileCategoryService.getFileCategoryList(ids);
|
||||
return success(FileCategoryConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得档案分类分页")
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:query')")
|
||||
public CommonResult<PageResult<FileCategoryRespVO>> getFileCategoryPage(@Valid FileCategoryPageReqVO pageVO) {
|
||||
PageResult<FileCategoryDO> pageResult = fileCategoryService.getFileCategoryPage(pageVO);
|
||||
return success(FileCategoryConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出档案分类 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('setting:file-category:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFileCategoryExcel(@Valid FileCategoryExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<FileCategoryDO> list = fileCategoryService.getFileCategoryList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<FileCategoryExcelVO> datas = FileCategoryConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "档案分类.xls", "数据", FileCategoryExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 档案分类创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileCategoryCreateReqVO extends FileCategoryBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 档案分类 Excel VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class FileCategoryExcelVO {
|
||||
|
||||
@ExcelProperty("tenant_id create_time update_time create_by deleted ")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("档案类型编码")
|
||||
private String categoryCode;
|
||||
|
||||
@ExcelProperty("档案类型父id")
|
||||
private Long parentId;
|
||||
|
||||
@ExcelProperty("类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ExcelProperty("目录号")
|
||||
private String catalogNumber;
|
||||
|
||||
@ExcelProperty("二级类别号")
|
||||
private String twoCatalogNumber;
|
||||
|
||||
@ExcelProperty("保管期限")
|
||||
private LocalDateTime custodyTime;
|
||||
|
||||
@ExcelProperty("启用状态 0启用 1禁用")
|
||||
private Boolean state;
|
||||
|
||||
@ExcelProperty("创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ExcelProperty("制单人")
|
||||
private String createBy;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 档案分类分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileCategoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "档案类型编码")
|
||||
private String categoryCode;
|
||||
|
||||
@Schema(description = "档案类型父id", example = "23289")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "类型名称", example = "张三")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "目录号")
|
||||
private String catalogNumber;
|
||||
|
||||
@Schema(description = "二级类别号")
|
||||
private String twoCatalogNumber;
|
||||
|
||||
@Schema(description = "保管期限")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] custodyTime;
|
||||
|
||||
@Schema(description = "启用状态 0启用 1禁用")
|
||||
private Boolean state;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "制单人")
|
||||
private String createBy;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 档案分类 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileCategoryRespVO extends FileCategoryBaseVO {
|
||||
|
||||
@Schema(description = "tenant_id create_time update_time create_by deleted ", requiredMode = Schema.RequiredMode.REQUIRED, example = "19533")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建日期")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 档案分类更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileCategoryUpdateReqVO extends FileCategoryBaseVO {
|
||||
|
||||
@Schema(description = "tenant_id create_time update_time create_by deleted ", requiredMode = Schema.RequiredMode.REQUIRED, example = "19533")
|
||||
@NotNull(message = "tenant_id create_time update_time create_by deleted 不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.setting.convert.filecategory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo.*;
|
||||
import cn.iocoder.yudao.module.setting.dal.dataobject.filecategory.FileCategoryDO;
|
||||
|
||||
/**
|
||||
* 档案分类 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface FileCategoryConvert {
|
||||
|
||||
FileCategoryConvert INSTANCE = Mappers.getMapper(FileCategoryConvert.class);
|
||||
|
||||
FileCategoryDO convert(FileCategoryCreateReqVO bean);
|
||||
|
||||
FileCategoryDO convert(FileCategoryUpdateReqVO bean);
|
||||
|
||||
FileCategoryRespVO convert(FileCategoryDO bean);
|
||||
|
||||
List<FileCategoryRespVO> convertList(List<FileCategoryDO> list);
|
||||
|
||||
PageResult<FileCategoryRespVO> convertPage(PageResult<FileCategoryDO> page);
|
||||
|
||||
List<FileCategoryExcelVO> convertList02(List<FileCategoryDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.setting.dal.dataobject.filecategory;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 档案分类 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("setting_file_category")
|
||||
@KeySequence("setting_file_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FileCategoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* tenant_id create_time update_time create_by deleted
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 档案类型编码
|
||||
*/
|
||||
private String categoryCode;
|
||||
/**
|
||||
* 档案类型父id
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
/**
|
||||
* 目录号
|
||||
*/
|
||||
private String catalogNumber;
|
||||
/**
|
||||
* 二级类别号
|
||||
*/
|
||||
private String twoCatalogNumber;
|
||||
/**
|
||||
* 保管期限
|
||||
*/
|
||||
private LocalDateTime custodyTime;
|
||||
/**
|
||||
* 启用状态 0启用 1禁用
|
||||
*/
|
||||
private Boolean state;
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.setting.dal.mysql.filecategory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.setting.dal.dataobject.filecategory.FileCategoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo.*;
|
||||
|
||||
/**
|
||||
* 档案分类 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface FileCategoryMapper extends BaseMapperX<FileCategoryDO> {
|
||||
|
||||
default PageResult<FileCategoryDO> selectPage(FileCategoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FileCategoryDO>()
|
||||
.eqIfPresent(FileCategoryDO::getCategoryCode, reqVO.getCategoryCode())
|
||||
.eqIfPresent(FileCategoryDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(FileCategoryDO::getTypeName, reqVO.getTypeName())
|
||||
.eqIfPresent(FileCategoryDO::getCatalogNumber, reqVO.getCatalogNumber())
|
||||
.eqIfPresent(FileCategoryDO::getTwoCatalogNumber, reqVO.getTwoCatalogNumber())
|
||||
.betweenIfPresent(FileCategoryDO::getCustodyTime, reqVO.getCustodyTime())
|
||||
.eqIfPresent(FileCategoryDO::getState, reqVO.getState())
|
||||
.betweenIfPresent(FileCategoryDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(FileCategoryDO::getCreateBy, reqVO.getCreateBy())
|
||||
.orderByDesc(FileCategoryDO::getId));
|
||||
}
|
||||
|
||||
default List<FileCategoryDO> selectList(FileCategoryExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<FileCategoryDO>()
|
||||
.eqIfPresent(FileCategoryDO::getCategoryCode, reqVO.getCategoryCode())
|
||||
.eqIfPresent(FileCategoryDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(FileCategoryDO::getTypeName, reqVO.getTypeName())
|
||||
.eqIfPresent(FileCategoryDO::getCatalogNumber, reqVO.getCatalogNumber())
|
||||
.eqIfPresent(FileCategoryDO::getTwoCatalogNumber, reqVO.getTwoCatalogNumber())
|
||||
.betweenIfPresent(FileCategoryDO::getCustodyTime, reqVO.getCustodyTime())
|
||||
.eqIfPresent(FileCategoryDO::getState, reqVO.getState())
|
||||
.betweenIfPresent(FileCategoryDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(FileCategoryDO::getCreateBy, reqVO.getCreateBy())
|
||||
.orderByDesc(FileCategoryDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.setting.service.filecategory;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo.*;
|
||||
import cn.iocoder.yudao.module.setting.dal.dataobject.filecategory.FileCategoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 档案分类 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface FileCategoryService {
|
||||
|
||||
/**
|
||||
* 创建档案分类
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFileCategory(@Valid FileCategoryCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新档案分类
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFileCategory(@Valid FileCategoryUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除档案分类
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFileCategory(Long id);
|
||||
|
||||
/**
|
||||
* 获得档案分类
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 档案分类
|
||||
*/
|
||||
FileCategoryDO getFileCategory(Long id);
|
||||
|
||||
/**
|
||||
* 获得档案分类列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 档案分类列表
|
||||
*/
|
||||
List<FileCategoryDO> getFileCategoryList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得档案分类分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 档案分类分页
|
||||
*/
|
||||
PageResult<FileCategoryDO> getFileCategoryPage(FileCategoryPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得档案分类列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 档案分类列表
|
||||
*/
|
||||
List<FileCategoryDO> getFileCategoryList(FileCategoryExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package cn.iocoder.yudao.module.setting.service.filecategory;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.setting.controller.admin.filecategory.vo.*;
|
||||
import cn.iocoder.yudao.module.setting.dal.dataobject.filecategory.FileCategoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.setting.convert.filecategory.FileCategoryConvert;
|
||||
import cn.iocoder.yudao.module.setting.dal.mysql.filecategory.FileCategoryMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.setting.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 档案分类 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FileCategoryServiceImpl implements FileCategoryService {
|
||||
|
||||
@Resource
|
||||
private FileCategoryMapper fileCategoryMapper;
|
||||
|
||||
@Override
|
||||
public Long createFileCategory(FileCategoryCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
FileCategoryDO fileCategory = FileCategoryConvert.INSTANCE.convert(createReqVO);
|
||||
fileCategoryMapper.insert(fileCategory);
|
||||
// 返回
|
||||
return fileCategory.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFileCategory(FileCategoryUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateFileCategoryExists(updateReqVO.getId());
|
||||
// 更新
|
||||
FileCategoryDO updateObj = FileCategoryConvert.INSTANCE.convert(updateReqVO);
|
||||
fileCategoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFileCategory(Long id) {
|
||||
// 校验存在
|
||||
validateFileCategoryExists(id);
|
||||
// 删除
|
||||
fileCategoryMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFileCategoryExists(Long id) {
|
||||
if (fileCategoryMapper.selectById(id) == null) {
|
||||
throw exception(FILE_CATEGORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileCategoryDO getFileCategory(Long id) {
|
||||
return fileCategoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileCategoryDO> getFileCategoryList(Collection<Long> ids) {
|
||||
return fileCategoryMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FileCategoryDO> getFileCategoryPage(FileCategoryPageReqVO pageReqVO) {
|
||||
return fileCategoryMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileCategoryDO> getFileCategoryList(FileCategoryExportReqVO exportReqVO) {
|
||||
return fileCategoryMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue