diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/DynamicTableService.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/DynamicTableService.java index d61e7d0..a751da5 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/service/DynamicTableService.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/DynamicTableService.java @@ -11,7 +11,7 @@ public interface DynamicTableService { /* * 生成表 */ - void DynamicCreate(Integer type,String archiveTypeId); + void DynamicCreate(Integer type,String archiveTypeId,String tableName); diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesDictionaryDTO.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesDictionaryDTO.java index bfc7724..0583155 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesDictionaryDTO.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesDictionaryDTO.java @@ -68,18 +68,8 @@ public class ArchivesDictionaryDTO extends BaseDTO implements Serializable { private String displayformatType; - private Integer displayformatWidth; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - ArchivesDictionaryDTO that = (ArchivesDictionaryDTO) o; - return Objects.equals(id, that.id) && Objects.equals(categoryId, that.categoryId) && Objects.equals(sysDictionaryId, that.sysDictionaryId) && Objects.equals(fieldName, that.fieldName) && Objects.equals(fieldCnName, that.fieldCnName) && Objects.equals(isDefaultValue, that.isDefaultValue) && Objects.equals(isInputClass, that.isInputClass) && Objects.equals(isDataType, that.isDataType) && Objects.equals(isDataTypeDetails, that.isDataTypeDetails) && Objects.equals(isColumnLength, that.isColumnLength) && Objects.equals(isColumnType, that.isColumnType) && Objects.equals(isSequence, that.isSequence) && Objects.equals(isType, that.isType) && Objects.equals(isSystem, that.isSystem) && Objects.equals(isLine, that.isLine) && Objects.equals(isInput, that.isInput) && Objects.equals(isRequired, that.isRequired) && Objects.equals(isAutomatic, that.isAutomatic) && Objects.equals(isAdd, that.isAdd) && Objects.equals(isSearch, that.isSearch) && Objects.equals(isInherit, that.isInherit) && Objects.equals(isFilling, that.isFilling) && Objects.equals(fillingDigit, that.fillingDigit) && Objects.equals(isRepeat, that.isRepeat) && Objects.equals(isDisplay, that.isDisplay) && Objects.equals(displayOrder, that.displayOrder) && Objects.equals(isDisplayformat, that.isDisplayformat) && Objects.equals(displayformatType, that.displayformatType) && Objects.equals(displayformatWidth, that.displayformatWidth); - } - - @Override - public int hashCode() { - return Objects.hash(id, categoryId, sysDictionaryId, fieldName, fieldCnName, isDefaultValue, isInputClass, isDataType, isDataTypeDetails, isColumnLength, isColumnType, isSequence, isType, isSystem, isLine, isInput, isRequired, isAutomatic, isAdd, isSearch, isInherit, isFilling, fillingDigit, isRepeat, isDisplay, displayOrder, isDisplayformat, displayformatType, displayformatWidth); - } + private Integer editLength; + + private Integer displayLength; + } diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesTypeServiceImpl.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesTypeServiceImpl.java index 079f04c..c1d33c6 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesTypeServiceImpl.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesTypeServiceImpl.java @@ -32,26 +32,20 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { @Value("${table-template.archive}") private String tableName; - @Value("${table-template.file}") - private String fileTableName; - @Override @Transactional(rollbackFor = Exception.class) public void create(ArchivesTypeDTO archivesTypeDTO) { ArchivesType archivesType = archivesTypeMapper.toEntity(archivesTypeDTO); List archivesType1 = archivesTypeRepository.findByCnName(archivesType.getCnName()); - if (archivesType1 == null) { + if (archivesType1.size() == 0) { tableName += DateUtils.getNowDateTime(); archivesType.setId(NanoIdUtils.randomNanoId()); archivesType.setEnName(tableName); archivesTypeRepository.save(archivesType); - dynamicTableService.DynamicCreate(archivesType.getIsType(), archivesType.getId()); + dynamicTableService.DynamicCreate(archivesType.getIsType(), archivesType.getId(), tableName); } else { throw new BaseException("门类名称不能重复"); } - - } - } diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DynamicTableImpl.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DynamicTableImpl.java index 29307ae..c73c9fd 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DynamicTableImpl.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DynamicTableImpl.java @@ -28,15 +28,13 @@ public class DynamicTableImpl implements DynamicTableService { private final ArchivesDictionaryService archivesDictionaryService; private final JdbcTemplate jdbcTemplate; - @Value("${table-template.archive}") - private String tableName; @Value("${table-template.file}") private String fileTableName; @Override - public void DynamicCreate(Integer type, String archiveTypeId) { + public void DynamicCreate(Integer type, String archiveTypeId,String tableName) { List integerList = new ArrayList<>(); if (type == 4 || type == 5) { integerList.add(1);