|
@ -5,9 +5,11 @@ import com.storeroom.modules.common.ArchivesTypeEnum; |
|
|
import com.storeroom.modules.dictionary.domain.ArchivesType; |
|
|
import com.storeroom.modules.dictionary.domain.ArchivesType; |
|
|
import com.storeroom.modules.dictionary.repository.ArchivesDictionaryRepository; |
|
|
import com.storeroom.modules.dictionary.repository.ArchivesDictionaryRepository; |
|
|
import com.storeroom.modules.dictionary.repository.ArchivesTypeRepository; |
|
|
import com.storeroom.modules.dictionary.repository.ArchivesTypeRepository; |
|
|
|
|
|
import com.storeroom.modules.dictionary.service.ArchivesNoSettingService; |
|
|
import com.storeroom.modules.dictionary.service.ArchivesTypeService; |
|
|
import com.storeroom.modules.dictionary.service.ArchivesTypeService; |
|
|
import com.storeroom.modules.dictionary.service.DynamicTableService; |
|
|
import com.storeroom.modules.dictionary.service.DynamicTableService; |
|
|
import com.storeroom.modules.dictionary.service.dto.ArcTypeSmallDTO; |
|
|
import com.storeroom.modules.dictionary.service.dto.ArcTypeSmallDTO; |
|
|
|
|
|
import com.storeroom.modules.dictionary.service.dto.ArchivesNoSettingDTO; |
|
|
import com.storeroom.modules.dictionary.service.dto.ArchivesTypeDTO; |
|
|
import com.storeroom.modules.dictionary.service.dto.ArchivesTypeDTO; |
|
|
import com.storeroom.modules.dictionary.service.mapstruct.ArchivesTypeMapper; |
|
|
import com.storeroom.modules.dictionary.service.mapstruct.ArchivesTypeMapper; |
|
|
import com.storeroom.utils.DateUtils; |
|
|
import com.storeroom.utils.DateUtils; |
|
@ -35,6 +37,7 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
private final ArchivesTypeRepository archivesTypeRepository; |
|
|
private final ArchivesTypeRepository archivesTypeRepository; |
|
|
private final DynamicTableService dynamicTableService; |
|
|
private final DynamicTableService dynamicTableService; |
|
|
private final ArchivesDictionaryRepository archivesDictionaryRepository; |
|
|
private final ArchivesDictionaryRepository archivesDictionaryRepository; |
|
|
|
|
|
private final ArchivesNoSettingService archivesNoSettingService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -59,7 +62,21 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
archivesType.getChildren().forEach(item -> { |
|
|
archivesType.getChildren().forEach(item -> { |
|
|
//如果模板类型为项目 |
|
|
//如果模板类型为项目 |
|
|
if (item.getIsType() == 2) { |
|
|
if (item.getIsType() == 2) { |
|
|
|
|
|
|
|
|
ArchivesType ar = createTemplateRoot(archivesTypeDTO.getPid(), cnName, item); |
|
|
ArchivesType ar = createTemplateRoot(archivesTypeDTO.getPid(), cnName, item); |
|
|
|
|
|
List<ArchivesNoSettingDTO> archivesNoSettingDTOList = archivesNoSettingService.findByCategoryId(item.getId()); |
|
|
|
|
|
Set<ArchivesNoSettingDTO> archivesNoSettingDTOSet = new HashSet<>(); |
|
|
|
|
|
archivesNoSettingDTOList.forEach(value -> { |
|
|
|
|
|
ArchivesNoSettingDTO dto = new ArchivesNoSettingDTO(); |
|
|
|
|
|
dto.setFieldName(value.getFieldName()); |
|
|
|
|
|
dto.setFieldCnName(value.getFieldCnName()); |
|
|
|
|
|
dto.setConnector(value.getConnector()); |
|
|
|
|
|
dto.setDictionaryId(value.getDictionaryId()); |
|
|
|
|
|
dto.setCategoryId(ar.getId()); |
|
|
|
|
|
dto.setSequence(value.getSequence()); |
|
|
|
|
|
archivesNoSettingDTOSet.add(dto); |
|
|
|
|
|
}); |
|
|
|
|
|
archivesNoSettingService.createTemplateData(archivesNoSettingDTOSet); |
|
|
createArchives(ar.getId(), cnName, item.getChildren()); |
|
|
createArchives(ar.getId(), cnName, item.getChildren()); |
|
|
} |
|
|
} |
|
|
//如果模板类型为案卷 |
|
|
//如果模板类型为案卷 |
|
@ -75,11 +92,25 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
arcProject.setIsType(item.getIsType()); |
|
|
arcProject.setIsType(item.getIsType()); |
|
|
arcProject.setPid(archivesTypeDTO.getPid()); |
|
|
arcProject.setPid(archivesTypeDTO.getPid()); |
|
|
arcProject.setCategorySeq(item.getCategorySeq()); |
|
|
arcProject.setCategorySeq(item.getCategorySeq()); |
|
|
arcProject.setCnName(cnName); |
|
|
|
|
|
|
|
|
arcProject.setCnName(cnName + "文件级"); |
|
|
arcProject.setRemark(item.getRemark()); |
|
|
arcProject.setRemark(item.getRemark()); |
|
|
arcProject.setEnName(tableName1); |
|
|
arcProject.setEnName(tableName1); |
|
|
arcProject.setTypeMetic(item.isTypeMetic()); |
|
|
arcProject.setTypeMetic(item.isTypeMetic()); |
|
|
dynamicTableService.DynamicCreate(arcProject.getIsType(), arcProject.getId(), tableName1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ArchivesNoSettingDTO> archivesNoSettingDTOList = archivesNoSettingService.findByCategoryId(item.getId()); |
|
|
|
|
|
Set<ArchivesNoSettingDTO> archivesNoSettingDTOSet = new HashSet<>(); |
|
|
|
|
|
archivesNoSettingDTOList.forEach(value -> { |
|
|
|
|
|
ArchivesNoSettingDTO dto = new ArchivesNoSettingDTO(); |
|
|
|
|
|
dto.setFieldName(value.getFieldName()); |
|
|
|
|
|
dto.setFieldCnName(value.getFieldCnName()); |
|
|
|
|
|
dto.setConnector(value.getConnector()); |
|
|
|
|
|
dto.setDictionaryId(value.getDictionaryId()); |
|
|
|
|
|
dto.setCategoryId(arcProject.getId()); |
|
|
|
|
|
dto.setSequence(value.getSequence()); |
|
|
|
|
|
archivesNoSettingDTOSet.add(dto); |
|
|
|
|
|
}); |
|
|
|
|
|
archivesNoSettingService.createTemplateData(archivesNoSettingDTOSet); |
|
|
|
|
|
dynamicTableService.DynamicTemplateTable(arcProject.getId(), item.getId(), item.getIsType(), tableName1); |
|
|
archivesTypeRepository.save(arcProject); |
|
|
archivesTypeRepository.save(arcProject); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -123,6 +154,7 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
private void createArchives(String pid, String cnName, List<ArchivesType> archivesType) { |
|
|
private void createArchives(String pid, String cnName, List<ArchivesType> archivesType) { |
|
|
String tableName = "tb_"; |
|
|
String tableName = "tb_"; |
|
|
for (ArchivesType arc : archivesType) { |
|
|
for (ArchivesType arc : archivesType) { |
|
|
|
|
|
|
|
|
//如果还有子集菜单 |
|
|
//如果还有子集菜单 |
|
|
if (arc.getChildren().size() != 0) { |
|
|
if (arc.getChildren().size() != 0) { |
|
|
ArchivesType archivesType1 = new ArchivesType(); |
|
|
ArchivesType archivesType1 = new ArchivesType(); |
|
@ -137,6 +169,19 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
archivesType1.setTypeMetic(arc.isTypeMetic()); |
|
|
archivesType1.setTypeMetic(arc.isTypeMetic()); |
|
|
archivesType1.setEnName(tableName); |
|
|
archivesType1.setEnName(tableName); |
|
|
archivesTypeRepository.save(archivesType1); |
|
|
archivesTypeRepository.save(archivesType1); |
|
|
|
|
|
List<ArchivesNoSettingDTO> archivesNoSettingDTOList = archivesNoSettingService.findByCategoryId(arc.getId()); |
|
|
|
|
|
Set<ArchivesNoSettingDTO> archivesNoSettingDTOSet = new HashSet<>(); |
|
|
|
|
|
archivesNoSettingDTOList.forEach(value -> { |
|
|
|
|
|
ArchivesNoSettingDTO dto = new ArchivesNoSettingDTO(); |
|
|
|
|
|
dto.setFieldName(value.getFieldName()); |
|
|
|
|
|
dto.setFieldCnName(value.getFieldCnName()); |
|
|
|
|
|
dto.setConnector(value.getConnector()); |
|
|
|
|
|
dto.setDictionaryId(value.getDictionaryId()); |
|
|
|
|
|
dto.setCategoryId(archivesType1.getId()); |
|
|
|
|
|
dto.setSequence(value.getSequence()); |
|
|
|
|
|
archivesNoSettingDTOSet.add(dto); |
|
|
|
|
|
}); |
|
|
|
|
|
archivesNoSettingService.createTemplateData(archivesNoSettingDTOSet); |
|
|
dynamicTableService.DynamicTemplateTable(archivesType1.getId(), arc.getId(), arc.getIsType(), tableName); |
|
|
dynamicTableService.DynamicTemplateTable(archivesType1.getId(), arc.getId(), arc.getIsType(), tableName); |
|
|
createInChive(archivesType1.getId(), cnName, arc.getChildren()); |
|
|
createInChive(archivesType1.getId(), cnName, arc.getChildren()); |
|
|
} |
|
|
} |
|
@ -149,6 +194,7 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
private void createInChive(String pid, String cnName, List<ArchivesType> archivesType) { |
|
|
private void createInChive(String pid, String cnName, List<ArchivesType> archivesType) { |
|
|
String tableName = "tb_"; |
|
|
String tableName = "tb_"; |
|
|
for (ArchivesType arc : archivesType) { |
|
|
for (ArchivesType arc : archivesType) { |
|
|
|
|
|
|
|
|
//如果还有子集菜单 |
|
|
//如果还有子集菜单 |
|
|
ArchivesType archivesType1 = new ArchivesType(); |
|
|
ArchivesType archivesType1 = new ArchivesType(); |
|
|
tableName += DateUtils.getNowDateTime(); |
|
|
tableName += DateUtils.getNowDateTime(); |
|
@ -161,6 +207,19 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
archivesType1.setCategorySeq(arc.getCategorySeq()); |
|
|
archivesType1.setCategorySeq(arc.getCategorySeq()); |
|
|
archivesType1.setTypeMetic(arc.isTypeMetic()); |
|
|
archivesType1.setTypeMetic(arc.isTypeMetic()); |
|
|
archivesType1.setEnName(tableName); |
|
|
archivesType1.setEnName(tableName); |
|
|
|
|
|
List<ArchivesNoSettingDTO> archivesNoSettingDTOList = archivesNoSettingService.findByCategoryId(arc.getId()); |
|
|
|
|
|
Set<ArchivesNoSettingDTO> archivesNoSettingDTOSet = new HashSet<>(); |
|
|
|
|
|
archivesNoSettingDTOList.forEach(value -> { |
|
|
|
|
|
ArchivesNoSettingDTO dto = new ArchivesNoSettingDTO(); |
|
|
|
|
|
dto.setFieldName(value.getFieldName()); |
|
|
|
|
|
dto.setFieldCnName(value.getFieldCnName()); |
|
|
|
|
|
dto.setConnector(value.getConnector()); |
|
|
|
|
|
dto.setDictionaryId(value.getDictionaryId()); |
|
|
|
|
|
dto.setCategoryId(archivesType1.getId()); |
|
|
|
|
|
dto.setSequence(value.getSequence()); |
|
|
|
|
|
archivesNoSettingDTOSet.add(dto); |
|
|
|
|
|
}); |
|
|
|
|
|
archivesNoSettingService.createTemplateData(archivesNoSettingDTOSet); |
|
|
dynamicTableService.DynamicTemplateTable(archivesType1.getId(), arc.getId(), arc.getIsType(), tableName); |
|
|
dynamicTableService.DynamicTemplateTable(archivesType1.getId(), arc.getId(), arc.getIsType(), tableName); |
|
|
archivesTypeRepository.save(archivesType1); |
|
|
archivesTypeRepository.save(archivesType1); |
|
|
} |
|
|
} |
|
|