档案借阅申请,档案分类

new
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');

@ -40,7 +40,7 @@ public class BorrowApplyController {
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建档案借阅申请") @Operation(summary = "创建档案借阅申请")
@PreAuthorize("@ss.hasPermission('archives:borrow-apply:create')") @PreAuthorize("@ss.hasPermission('archives:borrow-apply:create')")
public CommonResult<Integer> createBorrowApply(@Valid @RequestBody BorrowApplyCreateReqVO createReqVO) { public CommonResult<Long> createBorrowApply(@Valid @RequestBody BorrowApplyCreateReqVO createReqVO) {
return success(borrowApplyService.createBorrowApply(createReqVO)); return success(borrowApplyService.createBorrowApply(createReqVO));
} }
@ -56,7 +56,7 @@ public class BorrowApplyController {
@Operation(summary = "删除档案借阅申请") @Operation(summary = "删除档案借阅申请")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('archives:borrow-apply:delete')") @PreAuthorize("@ss.hasPermission('archives:borrow-apply:delete')")
public CommonResult<Boolean> deleteBorrowApply(@RequestParam("id") Integer id) { public CommonResult<Boolean> deleteBorrowApply(@RequestParam("id") Long id) {
borrowApplyService.deleteBorrowApply(id); borrowApplyService.deleteBorrowApply(id);
return success(true); return success(true);
} }
@ -65,7 +65,7 @@ public class BorrowApplyController {
@Operation(summary = "获得档案借阅申请") @Operation(summary = "获得档案借阅申请")
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('archives:borrow-apply:query')") @PreAuthorize("@ss.hasPermission('archives:borrow-apply:query')")
public CommonResult<BorrowApplyRespVO> getBorrowApply(@RequestParam("id") Integer id) { public CommonResult<BorrowApplyRespVO> getBorrowApply(@RequestParam("id") Long id) {
BorrowApplyDO borrowApply = borrowApplyService.getBorrowApply(id); BorrowApplyDO borrowApply = borrowApplyService.getBorrowApply(id);
return success(BorrowApplyConvert.INSTANCE.convert(borrowApply)); return success(BorrowApplyConvert.INSTANCE.convert(borrowApply));
} }
@ -74,7 +74,7 @@ public class BorrowApplyController {
@Operation(summary = "获得档案借阅申请列表") @Operation(summary = "获得档案借阅申请列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('archives:borrow-apply:query')") @PreAuthorize("@ss.hasPermission('archives:borrow-apply:query')")
public CommonResult<List<BorrowApplyRespVO>> getBorrowApplyList(@RequestParam("ids") Collection<Integer> ids) { public CommonResult<List<BorrowApplyRespVO>> getBorrowApplyList(@RequestParam("ids") Collection<Long> ids) {
List<BorrowApplyDO> list = borrowApplyService.getBorrowApplyList(ids); List<BorrowApplyDO> list = borrowApplyService.getBorrowApplyList(ids);
return success(BorrowApplyConvert.INSTANCE.convertList(list)); return success(BorrowApplyConvert.INSTANCE.convertList(list));
} }

@ -22,7 +22,7 @@ public class BorrowApplyBaseVO {
private String borrowCode; private String borrowCode;
@Schema(description = "借阅申请状态 0:已通过 1驳回") @Schema(description = "借阅申请状态 0:已通过 1驳回")
private Boolean borrowState; private String borrowState;
@Schema(description = "借阅事由", example = "不好") @Schema(description = "借阅事由", example = "不好")
private String reason; private String reason;
@ -31,13 +31,13 @@ public class BorrowApplyBaseVO {
private String describe; private String describe;
@Schema(description = "借阅人id", example = "6652") @Schema(description = "借阅人id", example = "6652")
private Integer userId; private Long userId;
@Schema(description = "借阅人名称", example = "李四") @Schema(description = "借阅人名称", example = "李四")
private String userName; private String userName;
@Schema(description = "借阅部门id", example = "29611") @Schema(description = "借阅部门id", example = "29611")
private Integer deptId; private Long deptId;
@Schema(description = "借阅部门名称", example = "张三") @Schema(description = "借阅部门名称", example = "张三")
private String deptName; private String deptName;
@ -47,10 +47,10 @@ public class BorrowApplyBaseVO {
private LocalDateTime returnTime; private LocalDateTime returnTime;
@Schema(description = "借阅方式 0:外接 1:现场查阅") @Schema(description = "借阅方式 0:外接 1:现场查阅")
private Boolean way; private String way;
@Schema(description = "档案介质") @Schema(description = "档案介质")
private Boolean media; private String media;
@Schema(description = "业务实体id", example = "23211") @Schema(description = "业务实体id", example = "23211")
private Long companyId; private Long companyId;

@ -18,13 +18,13 @@ import com.alibaba.excel.annotation.ExcelProperty;
public class BorrowApplyExcelVO { public class BorrowApplyExcelVO {
@ExcelProperty("借阅id") @ExcelProperty("借阅id")
private Integer id; private Long id;
@ExcelProperty("借阅申请编码") @ExcelProperty("借阅申请编码")
private String borrowCode; private String borrowCode;
@ExcelProperty("借阅申请状态 0:已通过 1驳回") @ExcelProperty("借阅申请状态 0:已通过 1驳回")
private Boolean borrowState; private String borrowState;
@ExcelProperty("借阅事由") @ExcelProperty("借阅事由")
private String reason; private String reason;
@ -33,13 +33,13 @@ public class BorrowApplyExcelVO {
private String describe; private String describe;
@ExcelProperty("借阅人id") @ExcelProperty("借阅人id")
private Integer userId; private Long userId;
@ExcelProperty("借阅人名称") @ExcelProperty("借阅人名称")
private String userName; private String userName;
@ExcelProperty("借阅部门id") @ExcelProperty("借阅部门id")
private Integer deptId; private Long deptId;
@ExcelProperty("借阅部门名称") @ExcelProperty("借阅部门名称")
private String deptName; private String deptName;
@ -48,10 +48,10 @@ public class BorrowApplyExcelVO {
private LocalDateTime returnTime; private LocalDateTime returnTime;
@ExcelProperty("借阅方式 0:外接 1:现场查阅") @ExcelProperty("借阅方式 0:外接 1:现场查阅")
private Boolean way; private String way;
@ExcelProperty("档案介质") @ExcelProperty("档案介质")
private Boolean media; private String media;
@ExcelProperty("业务实体id") @ExcelProperty("业务实体id")
private Long companyId; private Long companyId;

@ -17,7 +17,7 @@ public class BorrowApplyExportReqVO {
private String borrowCode; private String borrowCode;
@Schema(description = "借阅申请状态 0:已通过 1驳回") @Schema(description = "借阅申请状态 0:已通过 1驳回")
private Boolean borrowState; private String borrowState;
@Schema(description = "借阅事由", example = "不好") @Schema(description = "借阅事由", example = "不好")
private String reason; private String reason;
@ -26,13 +26,13 @@ public class BorrowApplyExportReqVO {
private String describe; private String describe;
@Schema(description = "借阅人id", example = "6652") @Schema(description = "借阅人id", example = "6652")
private Integer userId; private Long userId;
@Schema(description = "借阅人名称", example = "李四") @Schema(description = "借阅人名称", example = "李四")
private String userName; private String userName;
@Schema(description = "借阅部门id", example = "29611") @Schema(description = "借阅部门id", example = "29611")
private Integer deptId; private Long deptId;
@Schema(description = "借阅部门名称", example = "张三") @Schema(description = "借阅部门名称", example = "张三")
private String deptName; private String deptName;
@ -42,10 +42,10 @@ public class BorrowApplyExportReqVO {
private LocalDateTime[] returnTime; private LocalDateTime[] returnTime;
@Schema(description = "借阅方式 0:外接 1:现场查阅") @Schema(description = "借阅方式 0:外接 1:现场查阅")
private Boolean way; private String way;
@Schema(description = "档案介质") @Schema(description = "档案介质")
private Boolean media; private String media;
@Schema(description = "业务实体id", example = "23211") @Schema(description = "业务实体id", example = "23211")
private Long companyId; private Long companyId;

@ -19,7 +19,7 @@ public class BorrowApplyPageReqVO extends PageParam {
private String borrowCode; private String borrowCode;
@Schema(description = "借阅申请状态 0:已通过 1驳回") @Schema(description = "借阅申请状态 0:已通过 1驳回")
private Boolean borrowState; private String borrowState;
@Schema(description = "借阅事由", example = "不好") @Schema(description = "借阅事由", example = "不好")
private String reason; private String reason;
@ -28,13 +28,13 @@ public class BorrowApplyPageReqVO extends PageParam {
private String describe; private String describe;
@Schema(description = "借阅人id", example = "6652") @Schema(description = "借阅人id", example = "6652")
private Integer userId; private Long userId;
@Schema(description = "借阅人名称", example = "李四") @Schema(description = "借阅人名称", example = "李四")
private String userName; private String userName;
@Schema(description = "借阅部门id", example = "29611") @Schema(description = "借阅部门id", example = "29611")
private Integer deptId; private Long deptId;
@Schema(description = "借阅部门名称", example = "张三") @Schema(description = "借阅部门名称", example = "张三")
private String deptName; private String deptName;
@ -44,10 +44,10 @@ public class BorrowApplyPageReqVO extends PageParam {
private LocalDateTime[] returnTime; private LocalDateTime[] returnTime;
@Schema(description = "借阅方式 0:外接 1:现场查阅") @Schema(description = "借阅方式 0:外接 1:现场查阅")
private Boolean way; private String way;
@Schema(description = "档案介质") @Schema(description = "档案介质")
private Boolean media; private String media;
@Schema(description = "业务实体id", example = "23211") @Schema(description = "业务实体id", example = "23211")
private Long companyId; private Long companyId;

@ -11,7 +11,7 @@ import java.time.LocalDateTime;
public class BorrowApplyRespVO extends BorrowApplyBaseVO { public class BorrowApplyRespVO extends BorrowApplyBaseVO {
@Schema(description = "借阅id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8595") @Schema(description = "借阅id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8595")
private Integer id; private Long id;
@Schema(description = "创建日期") @Schema(description = "创建日期")
private LocalDateTime createTime; private LocalDateTime createTime;

@ -13,6 +13,6 @@ public class BorrowApplyUpdateReqVO extends BorrowApplyBaseVO {
@Schema(description = "借阅id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8595") @Schema(description = "借阅id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8595")
@NotNull(message = "借阅id不能为空") @NotNull(message = "借阅id不能为空")
private Integer id; private Long id;
} }

@ -27,7 +27,7 @@ public class BorrowApplyDO extends BaseDO {
* id * id
*/ */
@TableId @TableId
private Integer id; private Long id;
/** /**
* *
*/ */
@ -35,7 +35,7 @@ public class BorrowApplyDO extends BaseDO {
/** /**
* 0: 1 * 0: 1
*/ */
private Boolean borrowState; private String borrowState;
/** /**
* *
*/ */
@ -47,7 +47,7 @@ public class BorrowApplyDO extends BaseDO {
/** /**
* id * id
*/ */
private Integer userId; private Long userId;
/** /**
* *
*/ */
@ -55,7 +55,7 @@ public class BorrowApplyDO extends BaseDO {
/** /**
* id * id
*/ */
private Integer deptId; private Long deptId;
/** /**
* *
*/ */
@ -67,11 +67,11 @@ public class BorrowApplyDO extends BaseDO {
/** /**
* 0: 1: * 0: 1:
*/ */
private Boolean way; private String way;
/** /**
* *
*/ */
private Boolean media; private String media;
/** /**
* id * id
*/ */

@ -19,7 +19,7 @@ public interface BorrowApplyService {
* @param createReqVO * @param createReqVO
* @return * @return
*/ */
Integer createBorrowApply(@Valid BorrowApplyCreateReqVO createReqVO); Long createBorrowApply(@Valid BorrowApplyCreateReqVO createReqVO);
/** /**
* *
@ -33,7 +33,7 @@ public interface BorrowApplyService {
* *
* @param id * @param id
*/ */
void deleteBorrowApply(Integer id); void deleteBorrowApply(Long id);
/** /**
* *
@ -41,7 +41,7 @@ public interface BorrowApplyService {
* @param id * @param id
* @return * @return
*/ */
BorrowApplyDO getBorrowApply(Integer id); BorrowApplyDO getBorrowApply(Long id);
/** /**
* *
@ -49,7 +49,7 @@ public interface BorrowApplyService {
* @param ids * @param ids
* @return * @return
*/ */
List<BorrowApplyDO> getBorrowApplyList(Collection<Integer> ids); List<BorrowApplyDO> getBorrowApplyList(Collection<Long> ids);
/** /**
* *

@ -28,7 +28,7 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
private BorrowApplyMapper borrowApplyMapper; private BorrowApplyMapper borrowApplyMapper;
@Override @Override
public Integer createBorrowApply(BorrowApplyCreateReqVO createReqVO) { public Long createBorrowApply(BorrowApplyCreateReqVO createReqVO) {
// 插入 // 插入
BorrowApplyDO borrowApply = BorrowApplyConvert.INSTANCE.convert(createReqVO); BorrowApplyDO borrowApply = BorrowApplyConvert.INSTANCE.convert(createReqVO);
borrowApplyMapper.insert(borrowApply); borrowApplyMapper.insert(borrowApply);
@ -46,26 +46,26 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
} }
@Override @Override
public void deleteBorrowApply(Integer id) { public void deleteBorrowApply(Long id) {
// 校验存在 // 校验存在
validateBorrowApplyExists(id); validateBorrowApplyExists(id);
// 删除 // 删除
borrowApplyMapper.deleteById(id); borrowApplyMapper.deleteById(id);
} }
private void validateBorrowApplyExists(Integer id) { private void validateBorrowApplyExists(Long id) {
if (borrowApplyMapper.selectById(id) == null) { if (borrowApplyMapper.selectById(id) == null) {
throw exception(BORROW_APPLY_NOT_EXISTS); throw exception(BORROW_APPLY_NOT_EXISTS);
} }
} }
@Override @Override
public BorrowApplyDO getBorrowApply(Integer id) { public BorrowApplyDO getBorrowApply(Long id) {
return borrowApplyMapper.selectById(id); return borrowApplyMapper.selectById(id);
} }
@Override @Override
public List<BorrowApplyDO> getBorrowApplyList(Collection<Integer> ids) { public List<BorrowApplyDO> getBorrowApplyList(Collection<Long> ids) {
return borrowApplyMapper.selectBatchIds(ids); return borrowApplyMapper.selectBatchIds(ids);
} }

@ -6,4 +6,6 @@ public interface ErrorCodeConstants {
ErrorCode DEPOT_CABINET_NOT_EXISTS = new ErrorCode(300100, "档案柜管理不存在"); ErrorCode DEPOT_CABINET_NOT_EXISTS = new ErrorCode(300100, "档案柜管理不存在");
ErrorCode DEPOT_NOT_EXISTS = new ErrorCode(400100, "库房管理不存在"); ErrorCode DEPOT_NOT_EXISTS = new ErrorCode(400100, "库房管理不存在");
ErrorCode FILE_CATEGORY_NOT_EXISTS = new ErrorCode(400200, "档案分类不存在");
} }

@ -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,46 @@
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 javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class FileCategoryBaseVO {
@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 = "制单人")
private String createBy;
}

@ -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,45 @@
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 java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 档案分类 Excel 导出 Request VO参数和 FileCategoryPageReqVO 是一致的")
@Data
public class FileCategoryExportReqVO {
@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,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);
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.setting.dal.mysql.filecategory.FileCategoryMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save