From 293a3ec72268d51c23cb120402d1524344dfa101 Mon Sep 17 00:00:00 2001 From: JiilingLee <462362@qq.com> Date: Mon, 16 Oct 2023 13:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=92=E6=A1=A3=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao-module-archives-biz/pom.xml | 12 ++ .../admin/record/RecordController.java | 10 + .../service/record/RecordService.java | 9 + .../service/record/RecordServiceImpl.java | 184 +++++++++++++++--- 4 files changed, 192 insertions(+), 23 deletions(-) diff --git a/yudao-module-archives/yudao-module-archives-biz/pom.xml b/yudao-module-archives/yudao-module-archives-biz/pom.xml index e0e58a2e..9318b4cf 100644 --- a/yudao-module-archives/yudao-module-archives-biz/pom.xml +++ b/yudao-module-archives/yudao-module-archives-biz/pom.xml @@ -108,6 +108,18 @@ 1.7.3-snapshot compile + + cn.iocoder.boot + yudao-module-accounting-biz + 1.7.3-snapshot + compile + + + cn.iocoder.boot + yudao-module-ea-biz + 1.7.3-snapshot + compile + diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java index b0ac82be..2943656a 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/record/RecordController.java @@ -114,4 +114,14 @@ public class RecordController { ExcelUtils.write(response, "归档.xls", "数据", RecordExcelVO.class, datas); } + @PutMapping("/recordAssociation") + @Operation(summary = "批量归档对应档案") + @PreAuthorize("@ss.hasPermission('archives:record:update')") + public CommonResult recordAssociation(@RequestParam("ids") Long[] ids, + @RequestParam("recordId") Long recordId, + @RequestParam("recordType") String recordType) { + recordService.recordAssociation(ids,recordId,recordType); + return success(true); + } + } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java index a0162ea8..883ab94d 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/record/RecordService.java @@ -5,6 +5,7 @@ import javax.validation.*; import cn.iocoder.yudao.module.archives.controller.admin.record.vo.*; import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import org.springframework.web.bind.annotation.RequestParam; /** * 归档 Service 接口 @@ -67,4 +68,12 @@ public interface RecordService { */ List getRecordList(RecordExportReqVO exportReqVO); + /** + * 归档对应的档案类型 + * @param ids + * @param recordId + * @param recordType + */ + void recordAssociation(Long[] ids, Long recordId, String recordType); + } 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 fe74b545..81b89598 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 @@ -5,7 +5,27 @@ import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissi import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.accounting.controller.admin.voucher.vo.VoucherUpdateReqVO; +import cn.iocoder.yudao.module.accounting.dal.dataobject.accountingbook.AccountingBookDO; +import cn.iocoder.yudao.module.accounting.dal.dataobject.accountingreport.AccountingReportDO; +import cn.iocoder.yudao.module.accounting.dal.dataobject.other.OtherDO; +import cn.iocoder.yudao.module.accounting.dal.dataobject.voucher.VoucherDO; +import cn.iocoder.yudao.module.accounting.dal.mysql.accountingbook.AccountingBookMapper; +import cn.iocoder.yudao.module.accounting.dal.mysql.accountingreport.AccountingReportMapper; +import cn.iocoder.yudao.module.accounting.dal.mysql.other.OtherMapper; +import cn.iocoder.yudao.module.accounting.dal.mysql.voucher.VoucherMapper; +import cn.iocoder.yudao.module.accounting.enums.AccountingStatusEnum; import cn.iocoder.yudao.module.archives.controller.admin.common.CommonConstants; +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.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.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; @@ -19,10 +39,14 @@ import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.stereotype.Service; + import javax.annotation.Resource; + import org.springframework.validation.annotation.Validated; +import cn.iocoder.yudao.module.archives.enums.ArchivesTypeEnum; import java.util.*; + import cn.iocoder.yudao.module.archives.controller.admin.record.vo.*; import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -54,6 +78,25 @@ public class RecordServiceImpl implements RecordService { private DepotMapper depotMapper; @Resource private DepotCabinetMapper depotCabinetMapper; + @Resource + private VoucherMapper voucherMapper; + @Resource + private AccountingBookMapper accountingBookMapper; + @Resource + private OtherMapper otherMapper; + @Resource + private AccountingReportMapper accountingReportMapper; + @Resource + private ElectronicAssetsMapper electronicAssetsMapper; + @Resource + private ElectronicContractsMapper electronicContractsMapper; + @Resource + private ElectronicConsultationMapper electronicConsultationMapper; + @Resource + private ElectronicEmployeeMapper electronicEmployeeMapper; + @Resource + private ElectronicCustomerComplaintMapper electronicCustomerComplaintMapper; + @Override public Long createRecord(RecordCreateReqVO createReqVO) { @@ -67,7 +110,7 @@ public class RecordServiceImpl implements RecordService { //添加数据部门id,后续DataPermissionConfigurationRecord配置类中过滤数据 record.setDeptId(adminUserDO.getDeptId()); //业务实体 - if (record.getCompanyId() != null){ + if (record.getCompanyId() != null) { LambdaQueryWrapperX eq = new LambdaQueryWrapperX().eq(DeptDO::getId, adminUserDO.getDeptId()); DeptDO deptDO = deptMapper.selectOne(eq); record.setCompany(deptDO.getName()); @@ -81,18 +124,18 @@ public class RecordServiceImpl implements RecordService { OrganizationDO organizationDO = organizationMapper.selectById(organizationId); DepotDO depotDO = depotMapper.selectById(depotId); DepotCabinetDO depotCabinetDO = depotCabinetMapper.selectById(cabinetId); - String position=""; - if (organizationDO != null){ - position=position+organizationDO.getOrganizationName(); - if (depotDO != null){ - position=position+"/"+depotDO.getName(); - if (depotCabinetDO != null){ - position= position+"/"+depotCabinetDO.getName(); - }else { - position= position+"/默认档案柜"; + String position = ""; + if (organizationDO != null) { + position = position + organizationDO.getOrganizationName(); + if (depotDO != null) { + position = position + "/" + depotDO.getName(); + if (depotCabinetDO != null) { + position = position + "/" + depotCabinetDO.getName(); + } else { + position = position + "/默认档案柜"; } - }else { - position=position+"/默认库房/默认档案柜"; + } else { + position = position + "/默认库房/默认档案柜"; } } record.setSite(position); @@ -114,18 +157,18 @@ public class RecordServiceImpl implements RecordService { OrganizationDO organizationDO = organizationMapper.selectById(organizationId); DepotDO depotDO = depotMapper.selectById(depotId); DepotCabinetDO depotCabinetDO = depotCabinetMapper.selectById(cabinetId); - String position=""; - if (organizationDO != null){ - position=position+organizationDO.getOrganizationName(); - if (depotDO != null){ - position=position+"/"+depotDO.getName(); - if (depotCabinetDO != null){ - position= position+"/"+depotCabinetDO.getName(); - }else { - position= position+"/默认档案柜"; + String position = ""; + if (organizationDO != null) { + position = position + organizationDO.getOrganizationName(); + if (depotDO != null) { + position = position + "/" + depotDO.getName(); + if (depotCabinetDO != null) { + position = position + "/" + depotCabinetDO.getName(); + } else { + position = position + "/默认档案柜"; } - }else { - position=position+"/默认库房/默认档案柜"; + } else { + position = position + "/默认库房/默认档案柜"; } } updateObj.setSite(position); @@ -166,4 +209,99 @@ public class RecordServiceImpl implements RecordService { return recordMapper.selectList(exportReqVO); } + @Override + public void recordAssociation(Long[] ids, Long recordId, String recordType) { + //会计档案归档 + if (recordType.equals(ArchivesTypeEnum.ACCOUNTING_VOUCHER.getValue())) { + for (Long id : ids) { + VoucherDO voucherDO = new VoucherDO(); + voucherDO.setId(id); + voucherDO.setRecordId(recordId); + voucherDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + voucherMapper.updateById(voucherDO); + } + } + //会计账簿归档 + if (recordType.equals(ArchivesTypeEnum.ACCOUNTING_BOOK.getValue())) { + for (Long id : ids) { + AccountingBookDO accountingBookDO = new AccountingBookDO(); + accountingBookDO.setId(id); + accountingBookDO.setArchiveId(recordId); + accountingBookDO.setArchiveState(AccountingStatusEnum.LOGFILE.getValue()); + accountingBookMapper.updateById(accountingBookDO); + } + } + //会计其他资料归档 + if (recordType.equals(ArchivesTypeEnum.ACCOUNTING_OTHER.getValue())) { + for (Long id : ids) { + OtherDO otherDO = new OtherDO(); + otherDO.setId(id); + otherDO.setRecordId(recordId); + otherDO.setArchiveState(AccountingStatusEnum.LOGFILE.getValue()); + otherMapper.updateById(otherDO); + } + } + //会计报表归档 + if (recordType.equals(ArchivesTypeEnum.ACCOUNTING_REPORT.getValue())) { + for (Long id : ids) { + AccountingReportDO accountingReportDO = new AccountingReportDO(); + accountingReportDO.setId(id); + accountingReportDO.setArchiveId(recordId); + accountingReportDO.setArchiveState(AccountingStatusEnum.LOGFILE.getValue()); + accountingReportMapper.updateById(accountingReportDO); + } + } + //资产档案归档 + if (recordType.equals(ArchivesTypeEnum.ELECTRONI_ASSETS.getValue())) { + for (Long id : ids) { + ElectronicAssetsDO electronicAssetsDO = new ElectronicAssetsDO(); + electronicAssetsDO.setId(id); + electronicAssetsDO.setRecordId(recordId); + electronicAssetsDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + electronicAssetsMapper.updateById(electronicAssetsDO); + } + } + //合同档案归档 + if (recordType.equals(ArchivesTypeEnum.ELECTRONI_CONTRACTS.getValue())) { + for (Long id : ids) { + ElectronicContractsDO electronicContractsDO = new ElectronicContractsDO(); + electronicContractsDO.setId(id); + electronicContractsDO.setRecordId(recordId); + electronicContractsDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + electronicContractsMapper.updateById(electronicContractsDO); + } + } + //咨询档案归档 + if (recordType.equals(ArchivesTypeEnum.ELECTRONI_CONSULTATION.getValue())) { + for (Long id : ids) { + ElectronicConsultationDO electronicConsultationDO = new ElectronicConsultationDO(); + electronicConsultationDO.setId(id); + electronicConsultationDO.setRecordId(recordId); + electronicConsultationDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + electronicConsultationMapper.updateById(electronicConsultationDO); + } + } + //员工档案归档 + if (recordType.equals(ArchivesTypeEnum.ELECTRONI_EMPLOYEE.getValue())) { + for (Long id : ids) { + ElectronicEmployeeDO electronicEmployeeDO = new ElectronicEmployeeDO(); + electronicEmployeeDO.setId(id); + electronicEmployeeDO.setRecordId(recordId); + electronicEmployeeDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + electronicEmployeeMapper.updateById(electronicEmployeeDO); + } + } + //客诉档案归档 + if (recordType.equals(ArchivesTypeEnum.ELECTRONI_CUSTOMER_COMPLAINT.getValue())) { + for (Long id : ids) { + ElectronicCustomerComplaintDO electronicCustomerComplaintDO = new ElectronicCustomerComplaintDO(); + electronicCustomerComplaintDO.setId(id); + electronicCustomerComplaintDO.setRecordId(recordId); + electronicCustomerComplaintDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue()); + electronicCustomerComplaintMapper.updateById(electronicCustomerComplaintDO); + } + } + } + } +