|
|
@ -39,10 +39,11 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ArchivesType create(ArchivesTypeDTO archivesTypeDTO) { |
|
|
|
public void create(ArchivesTypeDTO archivesTypeDTO) { |
|
|
|
//#生成表名称 |
|
|
|
String tableName = "tb_"; |
|
|
|
ArchivesType archivesType = archivesTypeMapper.toEntity(archivesTypeDTO); |
|
|
|
List<ArchivesType> artChilder= archivesType.getChildren(); |
|
|
|
List<ArchivesType> archivesType1 = archivesTypeRepository.findByCnName(archivesType.getCnName()); |
|
|
|
if (archivesType1.size() == 0) { |
|
|
|
|
|
|
@ -63,8 +64,7 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
|
} |
|
|
|
//如果模板类型为案卷 |
|
|
|
if (item.getIsType() == 3) { |
|
|
|
ArchivesType ar = createTemplateRoot(archivesTypeDTO.getPid(),cnName, item); |
|
|
|
createInChive(ar.getId(), cnName, item.getChildren()); |
|
|
|
createArchives(archivesTypeDTO.getPid(),cnName, artChilder); |
|
|
|
} |
|
|
|
//如果是文件级 |
|
|
|
if (item.getIsType() == 5){ |
|
|
@ -84,7 +84,6 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return archivesType; |
|
|
|
} |
|
|
|
|
|
|
|
tableName += DateUtils.getNowDateTime(); |
|
|
@ -96,8 +95,6 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|
|
|
} else { |
|
|
|
throw new BaseException("门类名称不能重复"); |
|
|
|
} |
|
|
|
|
|
|
|
return archivesType; |
|
|
|
} |
|
|
|
|
|
|
|
private ArchivesType createTemplateRoot(String pid,String cnName, ArchivesType item) { |
|
|
|