|
@ -9,6 +9,7 @@ import com.storeroom.modules.dictionary.service.ArchivesDictionaryService; |
|
|
import com.storeroom.modules.dictionary.service.DynamicTableService; |
|
|
import com.storeroom.modules.dictionary.service.DynamicTableService; |
|
|
import com.storeroom.modules.dictionary.service.FieldService; |
|
|
import com.storeroom.modules.dictionary.service.FieldService; |
|
|
import com.storeroom.modules.dictionary.service.dto.ArchivesDictionaryDTO; |
|
|
import com.storeroom.modules.dictionary.service.dto.ArchivesDictionaryDTO; |
|
|
|
|
|
import com.storeroom.modules.dictionary.service.mapstruct.ArchivesDictionaryMapper; |
|
|
import com.storeroom.utils.NanoIdUtils; |
|
|
import com.storeroom.utils.NanoIdUtils; |
|
|
import com.storeroom.utils.StringUtils; |
|
|
import com.storeroom.utils.StringUtils; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
@ -36,6 +37,7 @@ public class DynamicTableImpl implements DynamicTableService { |
|
|
private final ArchivesDictionaryService archivesDictionaryService; |
|
|
private final ArchivesDictionaryService archivesDictionaryService; |
|
|
private final JdbcTemplate jdbcTemplate; |
|
|
private final JdbcTemplate jdbcTemplate; |
|
|
private final DataSource dataSource; |
|
|
private final DataSource dataSource; |
|
|
|
|
|
private final ArchivesDictionaryMapper archivesDictionaryMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -111,7 +113,7 @@ public class DynamicTableImpl implements DynamicTableService { |
|
|
fieldVOList.add(fieldVO); |
|
|
fieldVOList.add(fieldVO); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
DynamicInsert(fieldVOList, arcTypeId); |
|
|
|
|
|
|
|
|
DynamicInsertTemplateTable(arcList, arcTypeId); |
|
|
DynamicCreateFileTable(fieldVOList, tableName); |
|
|
DynamicCreateFileTable(fieldVOList, tableName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -191,10 +193,52 @@ public class DynamicTableImpl implements DynamicTableService { |
|
|
newList.add(archivesDictionaryDTO); |
|
|
newList.add(archivesDictionaryDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
archivesDictionaryService.saveAll(newList); |
|
|
archivesDictionaryService.saveAll(newList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 插入模板数据 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void DynamicInsertTemplateTable(List<ArchivesDictionary> archivesDictionaryList, String archiveTypeId) { |
|
|
|
|
|
List<ArchivesDictionary> newList = new ArrayList<>(); |
|
|
|
|
|
archivesDictionaryList.forEach(item -> { |
|
|
|
|
|
ArchivesDictionary archivesDictionary=new ArchivesDictionary(); |
|
|
|
|
|
archivesDictionary.setCategoryId(archiveTypeId); |
|
|
|
|
|
archivesDictionary.setDictionaryConfigId(item.getDictionaryConfigId()); |
|
|
|
|
|
archivesDictionary.setFieldName(item.getFieldName()); |
|
|
|
|
|
archivesDictionary.setFieldCnName(item.getFieldCnName()); |
|
|
|
|
|
archivesDictionary.setIsDefaultValue(item.getIsDefaultValue()); |
|
|
|
|
|
archivesDictionary.setIsInputClass(item.getIsInputClass()); |
|
|
|
|
|
archivesDictionary.setIsDataType(item.getIsDataType()); |
|
|
|
|
|
archivesDictionary.setIsDataTypeDetails(item.getIsDataTypeDetails()); |
|
|
|
|
|
archivesDictionary.setIsColumnLength(item.getIsColumnLength()); |
|
|
|
|
|
archivesDictionary.setIsColumnType(item.getIsColumnType()); |
|
|
|
|
|
archivesDictionary.setIsSequence(item.getIsSequence()); |
|
|
|
|
|
archivesDictionary.setIsType(item.getIsType()); |
|
|
|
|
|
archivesDictionary.setIsSystem(item.getIsSystem()); |
|
|
|
|
|
archivesDictionary.setIsLine(item.getIsLine()); |
|
|
|
|
|
archivesDictionary.setIsInput(item.getIsInput()); |
|
|
|
|
|
archivesDictionary.setIsRequired(item.getIsRequired()); |
|
|
|
|
|
archivesDictionary.setIsAutomatic(item.getIsAutomatic()); |
|
|
|
|
|
archivesDictionary.setIsAdd(item.getIsAdd()); |
|
|
|
|
|
archivesDictionary.setIsSearch(item.getIsSearch()); |
|
|
|
|
|
archivesDictionary.setIsInherit(item.getIsInherit()); |
|
|
|
|
|
archivesDictionary.setIsFilling(item.getIsFilling()); |
|
|
|
|
|
archivesDictionary.setFillingDigit(item.getFillingDigit()); |
|
|
|
|
|
archivesDictionary.setIsRepeat(item.getIsRepeat()); |
|
|
|
|
|
archivesDictionary.setIsDisplay(item.getIsDisplay()); |
|
|
|
|
|
archivesDictionary.setDisplayOrder(item.getDisplayOrder()); |
|
|
|
|
|
archivesDictionary.setDisplayOrderBy(item.getDisplayOrderBy()); |
|
|
|
|
|
archivesDictionary.setIsDisplayformat(item.getIsDisplayformat()); |
|
|
|
|
|
archivesDictionary.setDisplayformatType(item.getDisplayformatType()); |
|
|
|
|
|
archivesDictionary.setEditLength(item.getEditLength()); |
|
|
|
|
|
archivesDictionary.setDisplayLength(item.getDisplayLength()); |
|
|
|
|
|
archivesDictionary.setQueue(item.getQueue()); |
|
|
|
|
|
newList.add(archivesDictionary); |
|
|
|
|
|
}); |
|
|
|
|
|
archivesDictionaryService.saveAll(archivesDictionaryMapper.toDto(newList)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void DynamicCreateFileTable(List<FieldVO> list, String tableName) { |
|
|
private void DynamicCreateFileTable(List<FieldVO> list, String tableName) { |
|
|
|
|
|
|
|
|