Merge remote-tracking branch 'origin/main'

new
commit a8222838cc

@ -0,0 +1,27 @@
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'contract_type', 0, NULL, '', '2023-09-27 14:47:57', '', '2023-09-27 14:48:10', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '1', 'contract_type', 0, 'default', '', NULL, '', '2023-09-27 14:57:34', '', '2023-09-27 14:57:34', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '2', 'contract_type', 0, 'default', '', NULL, '', '2023-09-27 14:57:42', '', '2023-09-27 14:57:42', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '3', 'contract_type', 0, 'default', '', NULL, '', '2023-09-27 14:57:55', '', '2023-09-27 14:57:55', b'0');
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'contract_status', 0, NULL, '', '2023-09-27 14:48:17', '', '2023-09-27 14:48:17', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '1', 'contract_status', 0, 'default', '', NULL, '', '2023-09-27 15:03:53', '', '2023-09-27 15:03:53', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '2', 'contract_status', 0, 'default', '', NULL, '', '2023-09-27 15:04:01', '', '2023-09-27 15:04:21', b'0');
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'handle_result', 0, NULL, '', '2023-09-27 14:48:30', '', '2023-09-27 14:48:30', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '1', 'handle_result', 0, 'default', '', NULL, '', '2023-09-27 15:04:52', '', '2023-09-27 15:04:52', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '2', 'handle_result', 0, 'default', '', NULL, '', '2023-09-27 15:04:56', '', '2023-09-27 15:04:56', b'0');
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'borrow_status', 0, NULL, '', '2023-09-27 14:48:41', '', '2023-09-27 14:48:41', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '1', 'borrow_status', 0, 'default', '', NULL, '', '2023-09-27 15:05:09', '', '2023-09-27 15:05:09', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1323, 0, '', '2', 'borrow_status', 0, 'default', '', NULL, '', '2023-09-27 15:05:15', '', '2023-09-27 15:05:15', b'0');
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'business_type', 0, NULL, '', '2023-10-12 14:08:20', '', '2023-10-12 14:08:20', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '', 'business_type', 0, 'primary', '', NULL, '', '2023-10-12 14:09:20', '', '2023-10-12 15:48:15', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '', 'business_type', 0, 'primary', '', NULL, '', '2023-10-12 14:09:42', '', '2023-10-12 15:48:19', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '', 'business_type', 0, 'primary', '', NULL, '', '2023-10-12 15:48:34', '', '2023-10-12 15:48:34', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '', 'business_type', 0, 'primary', '', NULL, '', '2023-10-12 15:48:55', '', '2023-10-12 15:48:55', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '', 'business_type', 0, 'primary', '', NULL, '', '2023-10-12 15:49:14', '', '2023-10-12 15:49:14', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 0, '', '', 'business_type', 0, 'primary', '', NULL, '', '2023-10-12 15:49:25', '', '2023-10-12 15:49:25', b'0');
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'cherks', 0, NULL, '', '2023-10-13 15:47:12', '', '2023-10-13 15:47:12', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 1, '', '0', 'cherks', 0, 'success', '', NULL, '', '2023-10-13 15:47:35', '', '2023-10-13 15:48:05', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 2, '', '1', 'cherks', 0, 'danger', '', NULL, '', '2023-10-13 15:47:53', '', '2023-10-13 15:48:08', b'0');
INSERT INTO `lyr-one`.`system_dict_type`(`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (NULL, '', 'complaint_type', 0, NULL, '', '2023-10-13 16:31:27', '', '2023-10-13 16:31:27', b'0', '1970-01-01 00:00:00');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 1, '', '1', 'complaint_type', 0, 'danger', '', NULL, '', '2023-10-13 16:33:21', '', '2023-10-13 16:34:10', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 2, '', '2', 'complaint_type', 0, 'warning', '', NULL, '', '2023-10-13 16:33:55', '', '2023-10-13 16:33:55', b'0');
INSERT INTO `lyr-one`.`system_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (NULL, 3, '', '3', 'complaint_type', 0, 'success', '', NULL, '', '2023-10-13 16:34:06', '', '2023-10-13 16:34:06', b'0');

@ -0,0 +1,106 @@
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50717
Source Host : localhost:3306
Source Schema : lyr-one
Target Server Type : MySQL
Target Server Version : 50717
File Encoding : 65001
Date: 13/10/2023 09:51:58
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for ea_electronic_attachment
-- ----------------------------
DROP TABLE IF EXISTS `ea_electronic_attachment`;
CREATE TABLE `ea_electronic_attachment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '',
`business_id` bigint(20) NOT NULL COMMENT 'id',
`business_type` varchar(30) NOT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
`updater` varchar(64) DEFAULT NULL COMMENT '',
`update_time` datetime DEFAULT NULL COMMENT '',
`create_by` varchar(20) DEFAULT NULL COMMENT '',
`creator` varchar(20) DEFAULT NULL COMMENT '',
`company_id` bigint(20) DEFAULT NULL COMMENT 'id',
`company` varchar(30) DEFAULT NULL COMMENT '',
`del_status` varchar(2) DEFAULT '0' COMMENT '',
`suffix` varchar(10) DEFAULT NULL COMMENT '',
`file_url` varchar(255) DEFAULT NULL COMMENT '',
`file_ap` varchar(255) DEFAULT NULL COMMENT '',
`flow_code` varchar(40) DEFAULT NULL COMMENT '',
`user_id` bigint(20) DEFAULT NULL COMMENT 'id',
`deleted` bit(1) DEFAULT b'0' COMMENT '',
`note` varchar(255) DEFAULT NULL COMMENT '',
`dept_id` bigint(20) DEFAULT NULL COMMENT 'id',
`dept_name` varchar(30) DEFAULT NULL COMMENT '',
`tenant_id` bigint(20) NOT NULL COMMENT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='';
-- SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'', '', 2, 0, 2379,
'electronic-attachment', '', 'ea/electronicAttachment/index', 0, 'ElectronicAttachment'
);
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'ea:electronic-attachment:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'ea:electronic-attachment:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'ea:electronic-attachment:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'ea:electronic-attachment:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'ea:electronic-attachment:export', 3, 5, @parentId,
'', '', '', 0
);

@ -12,4 +12,5 @@ public interface ErrorCodeConstants {
ErrorCode ELECTRONIC_CONSULTATION_NOT_EXISTS = new ErrorCode(300013, "咨询档案不存在"); ErrorCode ELECTRONIC_CONSULTATION_NOT_EXISTS = new ErrorCode(300013, "咨询档案不存在");
ErrorCode ELECTRONIC_CUSTOMER_COMPLAINT_NOT_EXISTS = new ErrorCode(300014, "客诉档案不存在"); ErrorCode ELECTRONIC_CUSTOMER_COMPLAINT_NOT_EXISTS = new ErrorCode(300014, "客诉档案不存在");
ErrorCode ELECTRONIC_OTHER_NOT_EXISTS = new ErrorCode(300015, "其他档案不存在"); ErrorCode ELECTRONIC_OTHER_NOT_EXISTS = new ErrorCode(300015, "其他档案不存在");
ErrorCode ELECTRONIC_ATTACHMENT_NOT_EXISTS = new ErrorCode(300016, "电子档案附件不存在");
} }

@ -23,6 +23,12 @@
<version>1.7.3-snapshot</version> <version>1.7.3-snapshot</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-infra-biz</artifactId>
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -0,0 +1,121 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment;
import cn.hutool.core.io.IoUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.*;
import cn.iocoder.yudao.module.ea.convert.electronicattachment.ElectronicAttachmentConvert;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicattachment.ElectronicAttachmentDO;
import cn.iocoder.yudao.module.ea.service.electronicattachment.ElectronicAttachmentService;
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Tag(name = "管理后台 - 电子档案附件")
@RestController
@RequestMapping("/ea/electronic-attachment")
@Validated
public class ElectronicAttachmentController {
@Resource
private ElectronicAttachmentService electronicAttachmentService;
@Resource
private FileService fileService;
@PostMapping("/create")
@Operation(summary = "创建电子档案附件")
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:create')")
public CommonResult<Long> createElectronicAttachment(@Valid @RequestBody ElectronicAttachmentCreateReqVO createReqVO) {
return success(electronicAttachmentService.createElectronicAttachment(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新电子档案附件")
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:update')")
public CommonResult<Boolean> updateElectronicAttachment(@Valid @RequestBody ElectronicAttachmentUpdateReqVO updateReqVO) {
electronicAttachmentService.updateElectronicAttachment(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除电子档案附件")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:delete')")
public CommonResult<Boolean> deleteElectronicAttachment(@RequestParam("id") Long id) {
electronicAttachmentService.deleteElectronicAttachment(id);
return success(true);
}
@PostMapping("/upload")
@Operation(summary = "上传电子档案附件")
@Parameter(name = "multipartFile", description = "文件", required = true)
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:create')")
public CommonResult<FileDO> upload(@RequestParam("multipartFile") MultipartFile multipartFile) throws IOException {
String fileUrl = fileService.createFile(multipartFile.getOriginalFilename(), null, IoUtil.readBytes(multipartFile.getInputStream()));
FilePageReqVO pageReqVO = new FilePageReqVO();
String lastSegment = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
pageReqVO.setPath(lastSegment);
PageResult<FileDO> filePage = fileService.getFilePage(pageReqVO);
return success(filePage.getList().get(0));
}
@GetMapping("/get")
@Operation(summary = "获得电子档案附件")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:query')")
public CommonResult<ElectronicAttachmentRespVO> getElectronicAttachment(@RequestParam("id") Long id) {
ElectronicAttachmentDO electronicAttachment = electronicAttachmentService.getElectronicAttachment(id);
return success(ElectronicAttachmentConvert.INSTANCE.convert(electronicAttachment));
}
@GetMapping("/list")
@Operation(summary = "获得电子档案附件列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:query')")
public CommonResult<List<ElectronicAttachmentRespVO>> getElectronicAttachmentList(@RequestParam("ids") Collection<Long> ids) {
List<ElectronicAttachmentDO> list = electronicAttachmentService.getElectronicAttachmentList(ids);
return success(ElectronicAttachmentConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得电子档案附件分页")
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:query')")
public CommonResult<PageResult<ElectronicAttachmentRespVO>> getElectronicAttachmentPage(@Valid ElectronicAttachmentPageReqVO pageVO) {
PageResult<ElectronicAttachmentDO> pageResult = electronicAttachmentService.getElectronicAttachmentPage(pageVO);
return success(ElectronicAttachmentConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出电子档案附件 Excel")
@PreAuthorize("@ss.hasPermission('ea:electronic-attachment:export')")
@OperateLog(type = EXPORT)
public void exportElectronicAttachmentExcel(@Valid ElectronicAttachmentExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ElectronicAttachmentDO> list = electronicAttachmentService.getElectronicAttachmentList(exportReqVO);
// 导出 Excel
List<ElectronicAttachmentExcelVO> datas = ElectronicAttachmentConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "电子档案附件.xls", "数据", ElectronicAttachmentExcelVO.class, datas);
}
}

@ -0,0 +1,59 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ElectronicAttachmentBaseVO {
@Schema(description = "业务id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23183")
@NotNull(message = "业务id不能为空")
private Long businessId;
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "业务类型不能为空")
private String businessType;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "业务实体id", example = "23467")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "删除状态", example = "2")
private String delStatus;
@Schema(description = "文件后缀")
private String suffix;
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
private String fileUrl;
@Schema(description = "绝对路径")
private String fileAp;
@Schema(description = "流程号")
private String flowCode;
@Schema(description = "用户id", example = "4434")
private Long userId;
@Schema(description = "摘要")
private String note;
@Schema(description = "所属部门id", example = "14022")
private Long deptId;
@Schema(description = "所属部门", example = "芋艿")
private String deptName;
}

@ -0,0 +1,14 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.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 ElectronicAttachmentCreateReqVO extends ElectronicAttachmentBaseVO {
}

@ -0,0 +1,67 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class ElectronicAttachmentExcelVO {
@ExcelProperty("主键")
private Long id;
@ExcelProperty("业务id")
private Long businessId;
@ExcelProperty("业务类型")
private String businessType;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("制单人")
private String createBy;
@ExcelProperty("业务实体id")
private Long companyId;
@ExcelProperty("业务实体")
private String company;
@ExcelProperty("删除状态")
private String delStatus;
@ExcelProperty("文件后缀")
private String suffix;
@ExcelProperty("文件地址")
private String fileUrl;
@ExcelProperty("绝对路径")
private String fileAp;
@ExcelProperty("流程号")
private String flowCode;
@ExcelProperty("用户id")
private Long userId;
@ExcelProperty("摘要")
private String note;
@ExcelProperty("所属部门id")
private Long deptId;
@ExcelProperty("所属部门")
private String deptName;
}

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.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参数和 ElectronicAttachmentPageReqVO 是一致的")
@Data
public class ElectronicAttachmentExportReqVO {
@Schema(description = "业务id", example = "23183")
private Long businessId;
@Schema(description = "业务类型", example = "1")
private String businessType;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "业务实体id", example = "23467")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "删除状态", example = "2")
private String delStatus;
@Schema(description = "文件后缀")
private String suffix;
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
private String fileUrl;
@Schema(description = "绝对路径")
private String fileAp;
@Schema(description = "流程号")
private String flowCode;
@Schema(description = "用户id", example = "4434")
private Long userId;
@Schema(description = "摘要")
private String note;
@Schema(description = "所属部门id", example = "14022")
private Long deptId;
@Schema(description = "所属部门", example = "芋艿")
private String deptName;
}

@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.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 ElectronicAttachmentPageReqVO extends PageParam {
@Schema(description = "业务id", example = "23183")
private Long businessId;
@Schema(description = "业务类型", example = "1")
private String businessType;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "制单人")
private String createBy;
@Schema(description = "业务实体id", example = "23467")
private Long companyId;
@Schema(description = "业务实体")
private String company;
@Schema(description = "删除状态", example = "2")
private String delStatus;
@Schema(description = "文件后缀")
private String suffix;
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
private String fileUrl;
@Schema(description = "绝对路径")
private String fileAp;
@Schema(description = "流程号")
private String flowCode;
@Schema(description = "用户id", example = "4434")
private Long userId;
@Schema(description = "摘要")
private String note;
@Schema(description = "所属部门id", example = "14022")
private Long deptId;
@Schema(description = "所属部门", example = "芋艿")
private String deptName;
}

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.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 ElectronicAttachmentRespVO extends ElectronicAttachmentBaseVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23298")
private Long id;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.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 ElectronicAttachmentUpdateReqVO extends ElectronicAttachmentBaseVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23298")
@NotNull(message = "主键不能为空")
private Long id;
}

@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.ea.convert.electronicattachment;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentCreateReqVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentExcelVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentRespVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentUpdateReqVO;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicattachment.ElectronicAttachmentDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* Convert
*
* @author
*/
@Mapper
public interface ElectronicAttachmentConvert {
ElectronicAttachmentConvert INSTANCE = Mappers.getMapper(ElectronicAttachmentConvert.class);
ElectronicAttachmentDO convert(ElectronicAttachmentCreateReqVO bean);
ElectronicAttachmentDO convert(ElectronicAttachmentUpdateReqVO bean);
ElectronicAttachmentRespVO convert(ElectronicAttachmentDO bean);
List<ElectronicAttachmentRespVO> convertList(List<ElectronicAttachmentDO> list);
PageResult<ElectronicAttachmentRespVO> convertPage(PageResult<ElectronicAttachmentDO> page);
List<ElectronicAttachmentExcelVO> convertList02(List<ElectronicAttachmentDO> list);
}

@ -0,0 +1,87 @@
package cn.iocoder.yudao.module.ea.dal.dataobject.electronicattachment;
import lombok.*;
import java.util.*;
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("ea_electronic_attachment")
@KeySequence("ea_electronic_attachment_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ElectronicAttachmentDO extends BaseDO {
/**
*
*/
@TableId
private Long id;
/**
* id
*/
private Long businessId;
/**
*
*/
private String businessType;
/**
*
*/
private String createBy;
/**
* id
*/
private Long companyId;
/**
*
*/
private String company;
/**
*
*/
private String delStatus;
/**
*
*/
private String suffix;
/**
*
*/
private String fileUrl;
/**
*
*/
private String fileAp;
/**
*
*/
private String flowCode;
/**
* id
*/
private Long userId;
/**
*
*/
private String note;
/**
* id
*/
private Long deptId;
/**
*
*/
private String deptName;
}

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.ea.dal.mysql.electronicattachment;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentExportReqVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentPageReqVO;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicattachment.ElectronicAttachmentDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author
*/
@Mapper
public interface ElectronicAttachmentMapper extends BaseMapperX<ElectronicAttachmentDO> {
default PageResult<ElectronicAttachmentDO> selectPage(ElectronicAttachmentPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ElectronicAttachmentDO>()
.eqIfPresent(ElectronicAttachmentDO::getBusinessId, reqVO.getBusinessId())
.eqIfPresent(ElectronicAttachmentDO::getBusinessType, reqVO.getBusinessType())
.betweenIfPresent(ElectronicAttachmentDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ElectronicAttachmentDO::getCreateBy, reqVO.getCreateBy())
.eqIfPresent(ElectronicAttachmentDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(ElectronicAttachmentDO::getCompany, reqVO.getCompany())
.eqIfPresent(ElectronicAttachmentDO::getDelStatus, reqVO.getDelStatus())
.eqIfPresent(ElectronicAttachmentDO::getSuffix, reqVO.getSuffix())
.eqIfPresent(ElectronicAttachmentDO::getFileUrl, reqVO.getFileUrl())
.eqIfPresent(ElectronicAttachmentDO::getFileAp, reqVO.getFileAp())
.eqIfPresent(ElectronicAttachmentDO::getFlowCode, reqVO.getFlowCode())
.eqIfPresent(ElectronicAttachmentDO::getUserId, reqVO.getUserId())
.eqIfPresent(ElectronicAttachmentDO::getNote, reqVO.getNote())
.eqIfPresent(ElectronicAttachmentDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(ElectronicAttachmentDO::getDeptName, reqVO.getDeptName())
.orderByDesc(ElectronicAttachmentDO::getId));
}
default List<ElectronicAttachmentDO> selectList(ElectronicAttachmentExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ElectronicAttachmentDO>()
.eqIfPresent(ElectronicAttachmentDO::getBusinessId, reqVO.getBusinessId())
.eqIfPresent(ElectronicAttachmentDO::getBusinessType, reqVO.getBusinessType())
.betweenIfPresent(ElectronicAttachmentDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ElectronicAttachmentDO::getCreateBy, reqVO.getCreateBy())
.eqIfPresent(ElectronicAttachmentDO::getCompanyId, reqVO.getCompanyId())
.eqIfPresent(ElectronicAttachmentDO::getCompany, reqVO.getCompany())
.eqIfPresent(ElectronicAttachmentDO::getDelStatus, reqVO.getDelStatus())
.eqIfPresent(ElectronicAttachmentDO::getSuffix, reqVO.getSuffix())
.eqIfPresent(ElectronicAttachmentDO::getFileUrl, reqVO.getFileUrl())
.eqIfPresent(ElectronicAttachmentDO::getFileAp, reqVO.getFileAp())
.eqIfPresent(ElectronicAttachmentDO::getFlowCode, reqVO.getFlowCode())
.eqIfPresent(ElectronicAttachmentDO::getUserId, reqVO.getUserId())
.eqIfPresent(ElectronicAttachmentDO::getNote, reqVO.getNote())
.eqIfPresent(ElectronicAttachmentDO::getDeptId, reqVO.getDeptId())
.likeIfPresent(ElectronicAttachmentDO::getDeptName, reqVO.getDeptName())
.orderByDesc(ElectronicAttachmentDO::getId));
}
}

@ -0,0 +1,70 @@
package cn.iocoder.yudao.module.ea.service.electronicattachment;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.*;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicattachment.ElectronicAttachmentDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* Service
*
* @author
*/
public interface ElectronicAttachmentService {
/**
*
*
* @param createReqVO
* @return
*/
Long createElectronicAttachment(@Valid ElectronicAttachmentCreateReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateElectronicAttachment(@Valid ElectronicAttachmentUpdateReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteElectronicAttachment(Long id);
/**
*
*
* @param id
* @return
*/
ElectronicAttachmentDO getElectronicAttachment(Long id);
/**
*
*
* @param ids
* @return
*/
List<ElectronicAttachmentDO> getElectronicAttachmentList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ElectronicAttachmentDO> getElectronicAttachmentPage(ElectronicAttachmentPageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ElectronicAttachmentDO> getElectronicAttachmentList(ElectronicAttachmentExportReqVO exportReqVO);
}

@ -0,0 +1,85 @@
package cn.iocoder.yudao.module.ea.service.electronicattachment;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentCreateReqVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentExportReqVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentPageReqVO;
import cn.iocoder.yudao.module.ea.controller.admin.electronicattachment.vo.ElectronicAttachmentUpdateReqVO;
import cn.iocoder.yudao.module.ea.convert.electronicattachment.ElectronicAttachmentConvert;
import cn.iocoder.yudao.module.ea.dal.dataobject.electronicattachment.ElectronicAttachmentDO;
import cn.iocoder.yudao.module.ea.dal.mysql.electronicattachment.ElectronicAttachmentMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.ELECTRONIC_ATTACHMENT_NOT_EXISTS;
/**
* Service
*
* @author
*/
@Service
@Validated
public class ElectronicAttachmentServiceImpl implements ElectronicAttachmentService {
@Resource
private ElectronicAttachmentMapper electronicAttachmentMapper;
@Override
public Long createElectronicAttachment(ElectronicAttachmentCreateReqVO createReqVO) {
// 插入
ElectronicAttachmentDO electronicAttachment = ElectronicAttachmentConvert.INSTANCE.convert(createReqVO);
electronicAttachmentMapper.insert(electronicAttachment);
// 返回
return electronicAttachment.getId();
}
@Override
public void updateElectronicAttachment(ElectronicAttachmentUpdateReqVO updateReqVO) {
// 校验存在
validateElectronicAttachmentExists(updateReqVO.getId());
// 更新
ElectronicAttachmentDO updateObj = ElectronicAttachmentConvert.INSTANCE.convert(updateReqVO);
electronicAttachmentMapper.updateById(updateObj);
}
@Override
public void deleteElectronicAttachment(Long id) {
// 校验存在
validateElectronicAttachmentExists(id);
// 删除
electronicAttachmentMapper.deleteById(id);
}
private void validateElectronicAttachmentExists(Long id) {
if (electronicAttachmentMapper.selectById(id) == null) {
throw exception(ELECTRONIC_ATTACHMENT_NOT_EXISTS);
}
}
@Override
public ElectronicAttachmentDO getElectronicAttachment(Long id) {
return electronicAttachmentMapper.selectById(id);
}
@Override
public List<ElectronicAttachmentDO> getElectronicAttachmentList(Collection<Long> ids) {
return electronicAttachmentMapper.selectBatchIds(ids);
}
@Override
public PageResult<ElectronicAttachmentDO> getElectronicAttachmentPage(ElectronicAttachmentPageReqVO pageReqVO) {
return electronicAttachmentMapper.selectPage(pageReqVO);
}
@Override
public List<ElectronicAttachmentDO> getElectronicAttachmentList(ElectronicAttachmentExportReqVO exportReqVO) {
return electronicAttachmentMapper.selectList(exportReqVO);
}
}
Loading…
Cancel
Save