归档关联

new
JiilingLee 1 year ago
parent a8222838cc
commit 293a3ec722

@ -108,6 +108,18 @@
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-accounting-biz</artifactId>
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-ea-biz</artifactId>
<version>1.7.3-snapshot</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

@ -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<Boolean> recordAssociation(@RequestParam("ids") Long[] ids,
@RequestParam("recordId") Long recordId,
@RequestParam("recordType") String recordType) {
recordService.recordAssociation(ids,recordId,recordType);
return success(true);
}
}

@ -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<RecordDO> getRecordList(RecordExportReqVO exportReqVO);
/**
*
* @param ids
* @param recordId
* @param recordType
*/
void recordAssociation(Long[] ids, Long recordId, String recordType);
}

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

Loading…
Cancel
Save