电子档案-财务档案

new
zk 1 year ago
parent b1978bb176
commit 4087537f2f

@ -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 OraclePostgreSQLSQLServer @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');

@ -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", "资产档案");

@ -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<RecordDO> 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);
}
}
}
}

@ -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<TurnOverMapper, Turn
private ElectronicEmployeeMapper electronicEmployeeMapper;
@Resource
private ElectronicCustomerComplaintMapper electronicCustomerComplaintMapper;
@Resource
private ElectronicFinanceMapper electronicFinanceMapper;
@Resource
private AttachmentService attachmentService;
@Resource
@ -397,6 +403,25 @@ public class TurnOverServiceImpl extends MPJBaseServiceImpl<TurnOverMapper, Turn
}
}
}
//财务档案
if (fileType.equals(ArchivesTypeEnum.ELECTRONI_FINANCE.getValue())) {
ElectronicFinanceExportReqVO electronicFinancialExportReqVO = new ElectronicFinanceExportReqVO();
electronicFinancialExportReqVO.setRecordId(recordId);
List<ElectronicFinanceDO> 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";

@ -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, "财务档案不存在");
}

@ -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<Long> createFinance(@Valid @RequestBody ElectronicFinanceCreateReqVO createReqVO) {
return success(financeService.createFinance(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新财务档案")
@PreAuthorize("@ss.hasPermission('electronic:finance:update')")
public CommonResult<Boolean> 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<Boolean> 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<ElectronicFinanceRespVO> 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<List<ElectronicFinanceRespVO>> getFinanceList(@RequestParam("ids") Collection<Long> ids) {
List<ElectronicFinanceDO> list = financeService.getFinanceList(ids);
return success(ElectronicFinanceConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得财务档案分页")
@PreAuthorize("@ss.hasPermission('electronic:finance:query')")
public CommonResult<PageResult<ElectronicFinanceRespVO>> getFinancePage(@Valid ElectronicFinancePageReqVO pageVO) {
PageResult<ElectronicFinanceDO> 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<ElectronicFinanceDO> list = financeService.getFinanceList(exportReqVO);
// 导出 Excel
List<ElectronicFinanceExcelVO> datas = ElectronicFinanceConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "财务档案.xls", "数据", ElectronicFinanceExcelVO.class, datas);
}
}

@ -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;
}

@ -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 {
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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;
}

@ -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<ElectronicFinanceRespVO> convertList(List<ElectronicFinanceDO> list);
PageResult<ElectronicFinanceRespVO> convertPage(PageResult<ElectronicFinanceDO> page);
List<ElectronicFinanceExcelVO> convertList02(List<ElectronicFinanceDO> list);
}

@ -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;
}

@ -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<ElectronicFinanceDO> {
default PageResult<ElectronicFinanceDO> selectPage(ElectronicFinancePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ElectronicFinanceDO>()
.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<ElectronicFinanceDO> selectList(ElectronicFinanceExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ElectronicFinanceDO>()
.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));
}
}

@ -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<ElectronicFinanceDO> getFinanceList(Collection<Long> ids);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<ElectronicFinanceDO> getFinancePage(ElectronicFinancePageReqVO pageReqVO);
/**
* , Excel
*
* @param exportReqVO
* @return
*/
List<ElectronicFinanceDO> getFinanceList(ElectronicFinanceExportReqVO exportReqVO);
}

@ -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<ElectronicFinanceDO> getFinanceList(Collection<Long> ids) {
return financeMapper.selectBatchIds(ids);
}
@Override
public PageResult<ElectronicFinanceDO> getFinancePage(ElectronicFinancePageReqVO pageReqVO) {
return financeMapper.selectPage(pageReqVO);
}
@Override
public List<ElectronicFinanceDO> getFinanceList(ElectronicFinanceExportReqVO exportReqVO) {
return financeMapper.selectList(exportReqVO);
}
}

@ -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;
}
}

@ -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.ea.dal.mysql.electronicfinance.ElectronicFinanceMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save