diff --git a/sql/electronic_finance20231108zk.sql b/sql/electronic_finance20231108zk.sql new file mode 100644 index 00000000..c7e261ab --- /dev/null +++ b/sql/electronic_finance20231108zk.sql @@ -0,0 +1,89 @@ +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- 财务档案 for electronic_finance +-- ---------------------------- +DROP TABLE IF EXISTS `electronic_finance`; +CREATE TABLE `electronic_finance` +( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `create_by` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '制单人', + `company_id` bigint DEFAULT NULL COMMENT '业务实体id', + `company` varchar(30) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '业务实体', + `user_id` bigint DEFAULT NULL COMMENT '用户id', + `dept_id` bigint DEFAULT NULL COMMENT '所属部门id', + `dept_name` varchar(30) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '所属部门', + `account` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付账户', + `project` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目', + `Invoice_number` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '收据/发票号码', + `price` decimal(20, 2) DEFAULT NULL COMMENT '金额', + `status` varchar(2) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '状态', + `position` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '纸档位置', + `cherks` int DEFAULT NULL COMMENT '完整性', + `record_id` bigint DEFAULT NULL COMMENT '归档id', + `trade_type` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '交易类型', + `pay_type` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '支付方式', + `file_status` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '归档状态', + `contract_attachment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '附件', + `remarks` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `creator` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建者', + `updater` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新者', + `create_time` datetime DEFAULT NULL COMMENT '创建日期', + `update_time` datetime DEFAULT NULL COMMENT '更新日期', + `trade_date` datetime DEFAULT NULL COMMENT '交易日期', + `record_time` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '归档日期', + `tenant_id` bigint NOT NULL COMMENT '租户编号', + `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `IX_electronic_finance_tenant_id` (`tenant_id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci + ROW_FORMAT = DYNAMIC COMMENT ='财务档案'; + +-- 查询电子档案菜单id +SELECT `id` +INTO @menuId +FROM `system_menu` +WHERE `name` = '电子档案'; + +-- 菜单 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status, component_name) +VALUES ('财务档案', '', 2, 0, @menuId, + 'electronic-finance', 'clipboard', 'ea/electronicFinance/index', 0, 'ElectronicFinance'); + +-- 按钮父菜单ID +-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('财务档案查询', 'electronic:finance:query', 3, 1, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('财务档案创建', 'electronic:finance:create', 3, 2, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('财务档案更新', 'electronic:finance:update', 3, 3, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('财务档案删除', 'electronic:finance:delete', 3, 4, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('财务档案导出', 'electronic:finance:export', 3, 5, @parentId, + '', '', '', 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, '10', '财务档案', 'electronic_finance', 'archives_file_type', '0', 'default', '', NULL, '', + '2023-11-08 15:13:50', '', '2023-11-08 15:14:08', b'0'); + diff --git a/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ArchivesTypeEnum.java b/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ArchivesTypeEnum.java index 221e7013..bc98a914 100644 --- a/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ArchivesTypeEnum.java +++ b/yudao-module-archives/yudao-module-archives-api/src/main/java/cn/iocoder/yudao/module/archives/enums/ArchivesTypeEnum.java @@ -19,6 +19,7 @@ public enum ArchivesTypeEnum { ELECTRONI_CUSTOMER_COMPLAINT("electronic_customer_complaint", "客诉档案"), ELECTRONI_CONTRACTS("electronic_contracts", "合同档案"), ELECTRONI_CONSULTATION("electronic_consultation", "咨询档案"), + ELECTRONI_FINANCE("electronic_finance","财务档案"), ELECTRONI_ASSETS("electronic_assets", "资产档案"); diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java index c4f2580f..fb7f0c0e 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordServiceImpl.java @@ -1,5 +1,8 @@ package cn.iocoder.yudao.module.archives.service.record; +import java.math.BigDecimal; +import java.time.LocalDateTime; + import cn.iocoder.yudao.framework.common.util.string.StringUtils; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRule; @@ -22,11 +25,13 @@ import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.Electron import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; import cn.iocoder.yudao.module.ea.dal.mysql.electronicassets.ElectronicAssetsMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electronicconsultation.ElectronicConsultationMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electroniccontracts.ElectronicContractsMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electroniccustomercomplaint.ElectronicCustomerComplaintMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee.ElectronicEmployeeMapper; +import cn.iocoder.yudao.module.ea.dal.mysql.electronicfinance.ElectronicFinanceMapper; import cn.iocoder.yudao.module.setting.dal.dataobject.depot.DepotDO; import cn.iocoder.yudao.module.setting.dal.dataobject.depotcabinet.DepotCabinetDO; import cn.iocoder.yudao.module.setting.dal.dataobject.organization.OrganizationDO; @@ -98,6 +103,9 @@ public class RecordServiceImpl implements RecordService { @Resource private ElectronicCustomerComplaintMapper electronicCustomerComplaintMapper; + @Resource + private ElectronicFinanceMapper electronicFinanceMapper; + @Override public Long createRecord(RecordCreateReqVO createReqVO) { @@ -203,7 +211,7 @@ public class RecordServiceImpl implements RecordService { @Override public PageResult getRecordPage(RecordPageReqVO pageReqVO) { // 这里加入authenticate字段区分是归档台账的调用接口还是鉴定调用接口 鉴定接口只查询未鉴定的归档台账 - if (StringUtils.isNotNull(pageReqVO.getAuthenticate())){//查询列表 + if (StringUtils.isNotNull(pageReqVO.getAuthenticate())) {//查询列表 return recordMapper.selectPageAuthenticate(pageReqVO); } return recordMapper.selectPage(pageReqVO);//查询历史 @@ -276,7 +284,7 @@ public class RecordServiceImpl implements RecordService { electronicContractsDO.setRecordId(recordId); electronicContractsDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); //如果已归档设置完整性为完整 - if (electronicContractsDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){ + if (electronicContractsDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())) { electronicContractsDO.setCherks(Integer.valueOf(AccountingStatusEnum.COMPLETE.getValue())); } electronicContractsMapper.updateById(electronicContractsDO); @@ -290,7 +298,7 @@ public class RecordServiceImpl implements RecordService { electronicConsultationDO.setRecordId(recordId); electronicConsultationDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); //如果已归档设置完整性为完整 - if (electronicConsultationDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){ + if (electronicConsultationDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())) { electronicConsultationDO.setCherks(Integer.valueOf(AccountingStatusEnum.COMPLETE.getValue())); } electronicConsultationMapper.updateById(electronicConsultationDO); @@ -304,7 +312,7 @@ public class RecordServiceImpl implements RecordService { electronicEmployeeDO.setRecordId(recordId); electronicEmployeeDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); //如果已归档设置完整性为完整 - if (electronicEmployeeDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){ + if (electronicEmployeeDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())) { electronicEmployeeDO.setCherks(Integer.valueOf(AccountingStatusEnum.COMPLETE.getValue())); } electronicEmployeeMapper.updateById(electronicEmployeeDO); @@ -320,6 +328,17 @@ public class RecordServiceImpl implements RecordService { electronicCustomerComplaintMapper.updateById(electronicCustomerComplaintDO); } } + //财务档案归档 + if (recordType.equals(ArchivesTypeEnum.ELECTRONI_FINANCE.getValue())) { + for (Long id : ids) { + ElectronicFinanceDO electronicFinanceDO = new ElectronicFinanceDO(); + electronicFinanceDO.setId(id); + electronicFinanceDO.setRecordId(recordId); + electronicFinanceDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + electronicFinanceDO.setCherks(Integer.valueOf(AccountingStatusEnum.COMPLETE.getValue())); + electronicFinanceMapper.updateById(electronicFinanceDO); + } + } } } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java index aa59990a..ee8b47a8 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/turnover/TurnOverServiceImpl.java @@ -46,16 +46,19 @@ import cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo.Ele import cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo.ElectronicContractsExportReqVO; import cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo.ElectronicCustomerComplaintExportReqVO; import cn.iocoder.yudao.module.ea.controller.admin.electronicemployee.vo.ElectronicEmployeeExportReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExportReqVO; import cn.iocoder.yudao.module.ea.dal.dataobject.electronicassets.ElectronicAssetsDO; import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.ElectronicConsultationDO; import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; import cn.iocoder.yudao.module.ea.dal.dataobject.electronicemployee.ElectronicEmployeeDO; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; import cn.iocoder.yudao.module.ea.dal.mysql.electronicassets.ElectronicAssetsMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electronicconsultation.ElectronicConsultationMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electroniccontracts.ElectronicContractsMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electroniccustomercomplaint.ElectronicCustomerComplaintMapper; import cn.iocoder.yudao.module.ea.dal.mysql.electronicemployee.ElectronicEmployeeMapper; +import cn.iocoder.yudao.module.ea.dal.mysql.electronicfinance.ElectronicFinanceMapper; 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; @@ -126,6 +129,9 @@ public class TurnOverServiceImpl extends MPJBaseServiceImpl electronicFinancialDOS = electronicFinanceMapper.selectList(electronicFinancialExportReqVO); + for (ElectronicFinanceDO ef:electronicFinancialDOS) { + try{ + //财务档案文件夹 + String financePath = folderCaseNum + "/" + ef.getInvoiceNumber(); + FileUtil.mkdir(financePath); + //财务档案xml + String financeXmlPath = financePath + "/" + ef.getInvoiceNumber() + ".xml"; + String financePathStr = JsonToXml.jsonToXml(JSON.toJSONString(ef)); + FileUtil.writeString(financePathStr, financeXmlPath, CharsetUtil.CHARSET_UTF_8); + }catch (Exception e){ + log.error(e.getMessage()); + } + } + } //打包zip String zipFilePath = zipFolderStr + "/" + UUID.randomUUID() + ".zip"; diff --git a/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java b/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java index 9e7a21c4..27838fe9 100644 --- a/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java +++ b/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java @@ -13,4 +13,5 @@ public interface ErrorCodeConstants { ErrorCode ELECTRONIC_CUSTOMER_COMPLAINT_NOT_EXISTS = new ErrorCode(300014, "客诉档案不存在"); ErrorCode ELECTRONIC_OTHER_NOT_EXISTS = new ErrorCode(300015, "其他档案不存在"); ErrorCode ELECTRONIC_ATTACHMENT_NOT_EXISTS = new ErrorCode(300016, "电子档案附件不存在"); + ErrorCode FINANCE_NOT_EXISTS = new ErrorCode(300017, "财务档案不存在"); } diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/ElectronicFinanceController.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/ElectronicFinanceController.java new file mode 100644 index 00000000..9a507c20 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/ElectronicFinanceController.java @@ -0,0 +1,99 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance; + +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.electronicfinance.vo.*; +import cn.iocoder.yudao.module.ea.convert.electronicfinance.ElectronicFinanceConvert; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; +import cn.iocoder.yudao.module.ea.service.electronicfinance.ElectronicFinanceService; +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 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("/electronic/finance") +@Validated +public class ElectronicFinanceController { + + @Resource + private ElectronicFinanceService financeService; + + @PostMapping("/create") + @Operation(summary = "创建财务档案") + @PreAuthorize("@ss.hasPermission('electronic:finance:create')") + public CommonResult createFinance(@Valid @RequestBody ElectronicFinanceCreateReqVO createReqVO) { + return success(financeService.createFinance(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新财务档案") + @PreAuthorize("@ss.hasPermission('electronic:finance:update')") + public CommonResult updateFinance(@Valid @RequestBody ElectronicFinanceUpdateReqVO updateReqVO) { + financeService.updateFinance(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除财务档案") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('electronic:finance:delete')") + public CommonResult deleteFinance(@RequestParam("id") Long[] id) { + financeService.deleteFinance(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得财务档案") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('electronic:finance:query')") + public CommonResult getFinance(@RequestParam("id") Long id) { + ElectronicFinanceDO finance = financeService.getFinance(id); + return success(ElectronicFinanceConvert.INSTANCE.convert(finance)); + } + + @GetMapping("/list") + @Operation(summary = "获得财务档案列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('electronic:finance:query')") + public CommonResult> getFinanceList(@RequestParam("ids") Collection ids) { + List list = financeService.getFinanceList(ids); + return success(ElectronicFinanceConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得财务档案分页") + @PreAuthorize("@ss.hasPermission('electronic:finance:query')") + public CommonResult> getFinancePage(@Valid ElectronicFinancePageReqVO pageVO) { + PageResult pageResult = financeService.getFinancePage(pageVO); + return success(ElectronicFinanceConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出财务档案 Excel") + @PreAuthorize("@ss.hasPermission('electronic:finance:export')") + @OperateLog(type = EXPORT) + public void exportFinanceExcel(@Valid ElectronicFinanceExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = financeService.getFinanceList(exportReqVO); + // 导出 Excel + List datas = ElectronicFinanceConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "财务档案.xls", "数据", ElectronicFinanceExcelVO.class, datas); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceBaseVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceBaseVO.java new file mode 100644 index 00000000..733a5228 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceBaseVO.java @@ -0,0 +1,88 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; + +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 ElectronicFinanceBaseVO { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "业务实体id", example = "17856") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "用户id", example = "16066") + private Long userId; + + @Schema(description = "所属部门id", example = "13607") + private Long deptId; + + @Schema(description = "所属部门", example = "芋艿") + private String deptName; + + @Schema(description = "支付账户", example = "5498") + private String account; + + @Schema(description = "项目") + private String project; + + @Schema(description = "收据/发票号码") + private String invoiceNumber; + + @Schema(description = "金额", example = "23497") + private BigDecimal price; + + @Schema(description = "状态") + private String status; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档id") + private Long recordId; + + @Schema(description = "交易类型") + private String tradeType; + + @Schema(description = "支付方式") + private String payType; + + @Schema(description = "归档状态") + private String fileStatus; + + @Schema(description = "附件") + private String contractAttachment; + + @Schema(description = "备注") + private String remarks; + + @Schema(description = "交易日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime tradeDate; + + @Schema(description = "归档日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String recordTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceCreateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceCreateReqVO.java new file mode 100644 index 00000000..35577f57 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceCreateReqVO.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo; + +import lombok.*; + +import java.time.LocalDateTime; +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 ElectronicFinanceCreateReqVO extends ElectronicFinanceBaseVO { +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceExcelVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceExcelVO.java new file mode 100644 index 00000000..785ddab9 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceExcelVO.java @@ -0,0 +1,99 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; +import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; +import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; + + +/** + * 财务档案 Excel VO + * + * @author 芋道源码 + */ +@Data +public class ElectronicFinanceExcelVO { + + @ExcelProperty("主键") + private Long id; + + @ExcelProperty("制单人") + private String createBy; + + @ExcelProperty("业务实体id") + private Long companyId; + + @ExcelProperty("业务实体") + private String company; + + @ExcelProperty("用户id") + private Long userId; + + @ExcelProperty("所属部门id") + private Long deptId; + + @ExcelProperty("所属部门") + private String deptName; + + @ExcelProperty("支付账户") + private String account; + + @ExcelProperty("项目") + private String project; + + @ExcelProperty("收据/发票号码") + private String invoiceNumber; + + @ExcelProperty("金额") + private BigDecimal price; + + @ExcelProperty(value = "状态", converter = DictConvert.class) + @DictFormat("contract_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private String status; + + @ExcelProperty("纸档位置") + private String position; + + @ExcelProperty(value = "完整性", converter = DictConvert.class) + @DictFormat("cherks") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private Integer cherks; + + @ExcelProperty("归档id") + private Long recordId; + + @ExcelProperty(value = "交易类型", converter = DictConvert.class) + @DictFormat("trade_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private String tradeType; + + @ExcelProperty(value = "支付方式", converter = DictConvert.class) + @DictFormat("pay_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private String payType; + + @ExcelProperty(value = "归档状态", converter = DictConvert.class) + @DictFormat("archives_file_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 + private String fileStatus; + + @ExcelProperty("附件") + private String contractAttachment; + + @ExcelProperty("备注") + private String remarks; + + @ExcelProperty("创建日期") + private LocalDateTime createTime; + + @ExcelProperty("交易日期") + private LocalDateTime tradeDate; + + @ExcelProperty("归档日期") + private String recordTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceExportReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceExportReqVO.java new file mode 100644 index 00000000..b82ff130 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceExportReqVO.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDate; +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,参数和 ElectronicFinancePageReqVO 是一致的") +@Data +public class ElectronicFinanceExportReqVO { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "业务实体id", example = "17856") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "用户id", example = "16066") + private Long userId; + + @Schema(description = "所属部门id", example = "13607") + private Long deptId; + + @Schema(description = "所属部门", example = "芋艿") + private String deptName; + + @Schema(description = "支付账户", example = "5498") + private String account; + + @Schema(description = "项目") + private String project; + + @Schema(description = "收据/发票号码") + private String invoiceNumber; + + @Schema(description = "金额", example = "23497") + private BigDecimal price; + + @Schema(description = "状态") + private String status; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档id") + private Long recordId; + + @Schema(description = "交易类型") + private String tradeType; + + @Schema(description = "支付方式") + private String payType; + + @Schema(description = "归档状态") + private String fileStatus; + + @ExcelProperty("附件") + private String contractAttachment; + + @Schema(description = "备注") + private String remarks; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "交易日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] tradeDate; + + @Schema(description = "归档日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinancePageReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinancePageReqVO.java new file mode 100644 index 00000000..8861cbb2 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinancePageReqVO.java @@ -0,0 +1,91 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +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 ElectronicFinancePageReqVO extends PageParam { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "业务实体id", example = "17856") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "用户id", example = "16066") + private Long userId; + + @Schema(description = "所属部门id", example = "13607") + private Long deptId; + + @Schema(description = "所属部门", example = "芋艿") + private String deptName; + + @Schema(description = "支付账户", example = "5498") + private String account; + + @Schema(description = "项目") + private String project; + + @Schema(description = "收据/发票号码") + private String invoiceNumber; + + @Schema(description = "金额", example = "23497") + private BigDecimal price; + + @Schema(description = "状态") + private String status; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档id") + private Long recordId; + + @Schema(description = "交易类型") + private String tradeType; + + @Schema(description = "支付方式") + private String payType; + + @Schema(description = "归档状态") + private String fileStatus; + + @ExcelProperty("附件") + private String contractAttachment; + + @Schema(description = "备注") + private String remarks; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "交易日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] tradeDate; + + @Schema(description = "归档日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceRespVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceRespVO.java new file mode 100644 index 00000000..fdf5d69e --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceRespVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +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 = "管理后台 - 财务档案 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicFinanceRespVO extends ElectronicFinanceBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6066") + private Long id; + + @Schema(description = "创建日期") + private LocalDateTime createTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceUpdateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceUpdateReqVO.java new file mode 100644 index 00000000..e3471548 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicfinance/vo/ElectronicFinanceUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.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 ElectronicFinanceUpdateReqVO extends ElectronicFinanceBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6066") + @NotNull(message = "主键不能为空") + private Long id; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicfinance/ElectronicFinanceConvert.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicfinance/ElectronicFinanceConvert.java new file mode 100644 index 00000000..66ecdcf4 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicfinance/ElectronicFinanceConvert.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.ea.convert.electronicfinance; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceCreateReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExcelVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceRespVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceUpdateReqVO; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * 财务档案 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicFinanceConvert { + + ElectronicFinanceConvert INSTANCE = Mappers.getMapper(ElectronicFinanceConvert.class); + + ElectronicFinanceDO convert(ElectronicFinanceCreateReqVO bean); + + ElectronicFinanceDO convert(ElectronicFinanceUpdateReqVO bean); + + ElectronicFinanceRespVO convert(ElectronicFinanceDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicfinance/ElectronicFinanceDO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicfinance/ElectronicFinanceDO.java new file mode 100644 index 00000000..0c9c52dc --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicfinance/ElectronicFinanceDO.java @@ -0,0 +1,129 @@ +package cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance; + +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDate; +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("electronic_finance") +@KeySequence("electronic_finance_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ElectronicFinanceDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 制单人 + */ + private String createBy; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体 + */ + private String company; + /** + * 用户id + */ + private Long userId; + /** + * 所属部门id + */ + private Long deptId; + /** + * 所属部门 + */ + private String deptName; + /** + * 支付账户 + */ + private String account; + /** + * 项目 + */ + private String project; + /** + * 收据/发票号码 + */ + private String invoiceNumber; + /** + * 金额 + */ + private BigDecimal price; + /** + * 状态 + * + * 枚举 + */ + private String status; + /** + * 纸档位置 + */ + private String position; + /** + * 完整性 + * + * 枚举 + */ + private Integer cherks; + /** + * 归档id + */ + private Long recordId; + /** + * 交易类型 + * + * 枚举 + */ + private String tradeType; + /** + * 支付方式 + * + * 枚举 + */ + private String payType; + /** + * 归档状态 + * + * 枚举 + */ + private String fileStatus; + /** + * 备注 + */ + private String remarks; + /** + * 交易日期 + */ + private LocalDateTime tradeDate; + /** + * 归档日期 + */ + private String recordTime; + + /** + * 附件 + */ + private String contractAttachment; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicfinance/ElectronicFinanceMapper.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicfinance/ElectronicFinanceMapper.java new file mode 100644 index 00000000..956b9cac --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicfinance/ElectronicFinanceMapper.java @@ -0,0 +1,73 @@ +package cn.iocoder.yudao.module.ea.dal.mysql.electronicfinance; + +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.electronicfinance.vo.ElectronicFinanceExportReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinancePageReqVO; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 财务档案 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicFinanceMapper extends BaseMapperX { + + default PageResult selectPage(ElectronicFinancePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ElectronicFinanceDO::getCreateBy, reqVO.getCreateBy()) + .eqIfPresent(ElectronicFinanceDO::getCompanyId, reqVO.getCompanyId()) + .likeIfPresent(ElectronicFinanceDO::getCompany, reqVO.getCompany()) + .eqIfPresent(ElectronicFinanceDO::getUserId, reqVO.getUserId()) + .eqIfPresent(ElectronicFinanceDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(ElectronicFinanceDO::getDeptName, reqVO.getDeptName()) + .likeIfPresent(ElectronicFinanceDO::getAccount, reqVO.getAccount()) + .likeIfPresent(ElectronicFinanceDO::getProject, reqVO.getProject()) + .likeIfPresent(ElectronicFinanceDO::getInvoiceNumber, reqVO.getInvoiceNumber()) + .eqIfPresent(ElectronicFinanceDO::getPrice, reqVO.getPrice()) + .eqIfPresent(ElectronicFinanceDO::getStatus, reqVO.getStatus()) + .eqIfPresent(ElectronicFinanceDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicFinanceDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicFinanceDO::getRecordId, reqVO.getRecordId()) + .eqIfPresent(ElectronicFinanceDO::getTradeType, reqVO.getTradeType()) + .eqIfPresent(ElectronicFinanceDO::getPayType, reqVO.getPayType()) + .eqIfPresent(ElectronicFinanceDO::getFileStatus, reqVO.getFileStatus()) + .eqIfPresent(ElectronicFinanceDO::getRemarks, reqVO.getRemarks()) + .betweenIfPresent(ElectronicFinanceDO::getCreateTime, reqVO.getCreateTime()) + .betweenIfPresent(ElectronicFinanceDO::getTradeDate, reqVO.getTradeDate()) + .betweenIfPresent(ElectronicFinanceDO::getRecordTime, reqVO.getRecordTime()) + .orderByDesc(ElectronicFinanceDO::getId)); + } + + default List selectList(ElectronicFinanceExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ElectronicFinanceDO::getCreateBy, reqVO.getCreateBy()) + .eqIfPresent(ElectronicFinanceDO::getCompanyId, reqVO.getCompanyId()) + .likeIfPresent(ElectronicFinanceDO::getCompany, reqVO.getCompany()) + .eqIfPresent(ElectronicFinanceDO::getUserId, reqVO.getUserId()) + .eqIfPresent(ElectronicFinanceDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(ElectronicFinanceDO::getDeptName, reqVO.getDeptName()) + .likeIfPresent(ElectronicFinanceDO::getAccount, reqVO.getAccount()) + .likeIfPresent(ElectronicFinanceDO::getProject, reqVO.getProject()) + .likeIfPresent(ElectronicFinanceDO::getInvoiceNumber, reqVO.getInvoiceNumber()) + .eqIfPresent(ElectronicFinanceDO::getPrice, reqVO.getPrice()) + .eqIfPresent(ElectronicFinanceDO::getStatus, reqVO.getStatus()) + .eqIfPresent(ElectronicFinanceDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicFinanceDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicFinanceDO::getRecordId, reqVO.getRecordId()) + .eqIfPresent(ElectronicFinanceDO::getTradeType, reqVO.getTradeType()) + .eqIfPresent(ElectronicFinanceDO::getPayType, reqVO.getPayType()) + .eqIfPresent(ElectronicFinanceDO::getFileStatus, reqVO.getFileStatus()) + .eqIfPresent(ElectronicFinanceDO::getRemarks, reqVO.getRemarks()) + .betweenIfPresent(ElectronicFinanceDO::getCreateTime, reqVO.getCreateTime()) + .betweenIfPresent(ElectronicFinanceDO::getTradeDate, reqVO.getTradeDate()) + .betweenIfPresent(ElectronicFinanceDO::getRecordTime, reqVO.getRecordTime()) + .orderByDesc(ElectronicFinanceDO::getId)); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicfinance/ElectronicFinanceService.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicfinance/ElectronicFinanceService.java new file mode 100644 index 00000000..2b00d46b --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicfinance/ElectronicFinanceService.java @@ -0,0 +1,74 @@ +package cn.iocoder.yudao.module.ea.service.electronicfinance; + +import java.util.*; +import javax.validation.*; + +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceCreateReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExportReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinancePageReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceUpdateReqVO; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 财务档案 Service 接口 + * + * @author 芋道源码 + */ +public interface ElectronicFinanceService { + + /** + * 创建财务档案 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createFinance(@Valid ElectronicFinanceCreateReqVO createReqVO); + + /** + * 更新财务档案 + * + * @param updateReqVO 更新信息 + */ + void updateFinance(@Valid ElectronicFinanceUpdateReqVO updateReqVO); + + /** + * 删除财务档案 + * + * @param id 编号 + */ + void deleteFinance(Long[] id); + + /** + * 获得财务档案 + * + * @param id 编号 + * @return 财务档案 + */ + ElectronicFinanceDO getFinance(Long id); + + /** + * 获得财务档案列表 + * + * @param ids 编号 + * @return 财务档案列表 + */ + List getFinanceList(Collection ids); + + /** + * 获得财务档案分页 + * + * @param pageReqVO 分页查询 + * @return 财务档案分页 + */ + PageResult getFinancePage(ElectronicFinancePageReqVO pageReqVO); + + /** + * 获得财务档案列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 财务档案列表 + */ + List getFinanceList(ElectronicFinanceExportReqVO exportReqVO); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicfinance/ElectronicFinanceServiceImpl.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicfinance/ElectronicFinanceServiceImpl.java new file mode 100644 index 00000000..a76cf837 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicfinance/ElectronicFinanceServiceImpl.java @@ -0,0 +1,84 @@ +package cn.iocoder.yudao.module.ea.service.electronicfinance; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceCreateReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceExportReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinancePageReqVO; +import cn.iocoder.yudao.module.ea.controller.admin.electronicfinance.vo.ElectronicFinanceUpdateReqVO; +import cn.iocoder.yudao.module.ea.convert.electronicfinance.ElectronicFinanceConvert; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicfinance.ElectronicFinanceDO; +import cn.iocoder.yudao.module.ea.dal.mysql.electronicfinance.ElectronicFinanceMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.Arrays; +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.FINANCE_NOT_EXISTS; + +/** + * 财务档案 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ElectronicFinanceServiceImpl implements ElectronicFinanceService { + + @Resource + private ElectronicFinanceMapper financeMapper; + + @Override + public Long createFinance(ElectronicFinanceCreateReqVO createReqVO) { + // 插入 + ElectronicFinanceDO finance = ElectronicFinanceConvert.INSTANCE.convert(createReqVO); + financeMapper.insert(finance); + // 返回 + return finance.getId(); + } + + @Override + public void updateFinance(ElectronicFinanceUpdateReqVO updateReqVO) { + // 校验存在 + validateFinanceExists(updateReqVO.getId()); + // 更新 + ElectronicFinanceDO updateObj = ElectronicFinanceConvert.INSTANCE.convert(updateReqVO); + financeMapper.updateById(updateObj); + } + + @Override + public void deleteFinance(Long[] id) { + // 删除 + financeMapper.deleteBatchIds(Arrays.asList(id)); + } + + private void validateFinanceExists(Long id) { + if (financeMapper.selectById(id) == null) { + throw exception(FINANCE_NOT_EXISTS); + } + } + + @Override + public ElectronicFinanceDO getFinance(Long id) { + return financeMapper.selectById(id); + } + + @Override + public List getFinanceList(Collection ids) { + return financeMapper.selectBatchIds(ids); + } + + @Override + public PageResult getFinancePage(ElectronicFinancePageReqVO pageReqVO) { + return financeMapper.selectPage(pageReqVO); + } + + @Override + public List getFinanceList(ElectronicFinanceExportReqVO exportReqVO) { + return financeMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java deleted file mode 100644 index 1fcfaf3a..00000000 --- a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/utils/enums/BorrowStatusEnum.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.iocoder.yudao.module.ea.utils.enums; - -import com.baomidou.mybatisplus.annotation.EnumValue; -import com.fasterxml.jackson.annotation.JsonValue; -import lombok.Getter; - -/** - * author: zk - * date: 2023/9/22 - * description: 借阅状态枚举 - * @author HP - */ -@Getter -public enum BorrowStatusEnum { - /** - * 借阅状态枚举 - */ - BORROWSTATUS_TRUE("true", "1"), - BORROWSTATUS_FALSE("false", "0") - ; - - @JsonValue - private final String status; - - /** - * 获取转换后的状态 - */ - @EnumValue - private final String isStatus; - - BorrowStatusEnum(String status, String isStatus) { - this.status = status; - this.isStatus = isStatus; - } -} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicfinance/ElectronicFinanceMapper.xml b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicfinance/ElectronicFinanceMapper.xml new file mode 100644 index 00000000..154a7100 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicfinance/ElectronicFinanceMapper.xml @@ -0,0 +1,12 @@ + + + + + + +