|
|
@ -1,11 +1,15 @@ |
|
|
|
package com.storeroom.modules.archives.service.impl; |
|
|
|
|
|
|
|
import com.storeroom.modules.archives.domain.ArchivesCase; |
|
|
|
import com.storeroom.modules.archives.domain.ArchivesCaseCartoning; |
|
|
|
import com.storeroom.modules.archives.domain.ArchivesSummary; |
|
|
|
import com.storeroom.modules.archives.repository.ArchivesCaseCartoningRepository; |
|
|
|
import com.storeroom.modules.archives.repository.ArchivesCaseRepository; |
|
|
|
import com.storeroom.modules.archives.repository.ArchivesSummaryRepository; |
|
|
|
import com.storeroom.modules.archives.service.ArchivesCaseService; |
|
|
|
import com.storeroom.modules.archives.service.dto.CaseDTO; |
|
|
|
import com.storeroom.modules.dictionary.domain.ArchivesType; |
|
|
|
import com.storeroom.modules.dictionary.repository.ArchivesTypeRepository; |
|
|
|
import com.storeroom.utils.NanoIdUtils; |
|
|
|
import com.storeroom.utils.PageUtil; |
|
|
|
import com.storeroom.utils.StringUtils; |
|
|
@ -17,6 +21,10 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.persistence.EntityManager; |
|
|
|
import javax.persistence.PersistenceContext; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
@ -25,6 +33,9 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { |
|
|
|
|
|
|
|
private final ArchivesCaseRepository caseRepository; |
|
|
|
private final ArchivesSummaryRepository archivesSummaryRepository; |
|
|
|
private final ArchivesTypeRepository archivesTypeRepository; |
|
|
|
private final ArchivesCaseCartoningRepository archivesCaseCartoningRepository; |
|
|
|
|
|
|
|
@PersistenceContext |
|
|
|
EntityManager entityManager; |
|
|
|
|
|
|
@ -118,4 +129,22 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { |
|
|
|
Page<ArchivesCase> pageCase = caseRepository.initCartoningList(caseName,tid,barcode,caseType,page); |
|
|
|
return PageUtil.toPage(pageCase); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object cartoning(List<ArchivesCaseCartoning> dtos) { |
|
|
|
Set<String> caseIds = new HashSet<>(); |
|
|
|
// Map<String,Integer> |
|
|
|
dtos = archivesCaseCartoningRepository.saveAllAndFlush(dtos); |
|
|
|
Integer caseType = 0; |
|
|
|
for(ArchivesCaseCartoning archivesCaseCartoning:dtos){ |
|
|
|
caseIds.add(archivesCaseCartoning.getCaseId()); |
|
|
|
//判断档案是案卷还是文件 |
|
|
|
ArchivesType archivesType = archivesTypeRepository.findById(archivesCaseCartoning.getCategoryId()).get(); |
|
|
|
caseType = archivesType.getIsType() == 4 ? 2 : archivesType.getIsType() == 5 ? 1 : 0; |
|
|
|
} |
|
|
|
for (String caseId:caseIds){ |
|
|
|
|
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |