From 10844941b55eb23841e1e33410d8ac80dfe843c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8A=9B?= Date: Tue, 7 Jun 2022 14:35:26 +0800 Subject: [PATCH] commit code --- .../modules/common/ArchivesListToMap.java | 94 ++++++------- .../dictionary/domain/ArchivesDictionary.java | 13 +- .../repository/ArchivesTypeRepository.java | 8 +- .../dto/ArchivesTypeQueryCriteria.java | 18 +++ .../service/impl/ArchivesDictionaryImpl.java | 23 +++- .../service/impl/ArchivesTypeServiceImpl.java | 43 ++---- .../service/impl/DynamicTableImpl.java | 123 ++++++++++++------ .../mapstruct/ArchivesDictionaryMapper.java | 12 ++ archives/src/test/java/ArchivesTypeTest.java | 26 ---- system/src/main/resources/application.yml | 1 + .../src/test/java/TestOnlineUserService.java | 20 +++ 11 files changed, 233 insertions(+), 148 deletions(-) create mode 100644 archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesTypeQueryCriteria.java create mode 100644 archives/src/main/java/com/storeroom/modules/dictionary/service/mapstruct/ArchivesDictionaryMapper.java delete mode 100644 archives/src/test/java/ArchivesTypeTest.java diff --git a/archives/src/main/java/com/storeroom/modules/common/ArchivesListToMap.java b/archives/src/main/java/com/storeroom/modules/common/ArchivesListToMap.java index d015e7d..f8bcf9c 100644 --- a/archives/src/main/java/com/storeroom/modules/common/ArchivesListToMap.java +++ b/archives/src/main/java/com/storeroom/modules/common/ArchivesListToMap.java @@ -15,54 +15,54 @@ import java.util.Map; public class ArchivesListToMap { - public static String getMaps(List lists, String tableName) { +// public static String getMaps(List lists, String tableName) { +// +// StringBuilder stringBuilder = new StringBuilder("create table " + tableName + "(id varchar(100) primary key not null,"); +// +// List> maps = new ArrayList>(); +// for (Object obj : lists) { +// Class c = obj.getClass(); +// Field[] f = c.getDeclaredFields(); +// Map map = new HashMap(); +// for (Field fie : f) { +// try { +// fie.setAccessible(true); +// String s = fie.getName(); +// map.put(fie.getName(), fie.get(obj)); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// //获取父类的私有属性 +// for (Field fie : c.getSuperclass().getDeclaredFields()) { +// try { +// fie.setAccessible(true);//取消语言访问检查 +// map.put(fie.getName(), fie.get(obj));//获取私有变量值 +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } +// maps.add(map); +// } +// List> list = maps; +// for (int i = 0; i < list.size(); i++) { +// stringBuilder.append(list.get(i).get("fieldName")); +// stringBuilder.append(" "); +// stringBuilder.append(list.get(i).get("isDataTypeDetails")); +// stringBuilder.append("("); +// stringBuilder.append(list.get(i).get("isColumnLength")); +// stringBuilder.append(")"); +// if (list.size() - 1 != i) { +// stringBuilder.append(","); +// } +// if (list.size() - 1 == i) { +// stringBuilder.append(")"); +// } +// } +// return stringBuilder.toString(); +// } - StringBuilder stringBuilder = new StringBuilder("create table " + tableName + "(id varchar(100) primary key not null,"); - - List> maps = new ArrayList>(); - for (Object obj : lists) { - Class c = obj.getClass(); - Field[] f = c.getDeclaredFields(); - Map map = new HashMap(); - for (Field fie : f) { - try { - fie.setAccessible(true); - String s = fie.getName(); - map.put(fie.getName(), fie.get(obj)); - } catch (Exception e) { - e.printStackTrace(); - } - } - //获取父类的私有属性 - for (Field fie : c.getSuperclass().getDeclaredFields()) { - try { - fie.setAccessible(true);//取消语言访问检查 - map.put(fie.getName(), fie.get(obj));//获取私有变量值 - } catch (Exception e) { - e.printStackTrace(); - } - } - maps.add(map); - } - List> list = maps; - for (int i = 0; i < list.size(); i++) { - stringBuilder.append(list.get(i).get("fieldName")); - stringBuilder.append(" "); - stringBuilder.append(list.get(i).get("isDataTypeDetails")); - stringBuilder.append("("); - stringBuilder.append(list.get(i).get("isColumnLength")); - stringBuilder.append(")"); - if (list.size() - 1 != i) { - stringBuilder.append(","); - } - if (list.size() - 1 == i) { - stringBuilder.append(")"); - } - } - return stringBuilder.toString(); - } - - public static List> getMapList(List list){ + public static List> getMaps(List list){ List> maps = new ArrayList>(); for (Object obj : list) { diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/domain/ArchivesDictionary.java b/archives/src/main/java/com/storeroom/modules/dictionary/domain/ArchivesDictionary.java index 3406704..b3137fc 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/domain/ArchivesDictionary.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/domain/ArchivesDictionary.java @@ -21,7 +21,6 @@ public class ArchivesDictionary extends BaseEntity implements Serializable { @Id @Column(name = "id") @NotNull(groups = Update.class) - @GeneratedValue(strategy = GenerationType.IDENTITY) @ApiModelProperty(value = "ID", hidden = true) private String id; @@ -141,9 +140,13 @@ public class ArchivesDictionary extends BaseEntity implements Serializable { @ApiModelProperty(value = "显示格式") private String displayformatType; - @Column(name = "displayformat_width") + @Column(name = "edit_length") + @ApiModelProperty(value = "编辑长度") + private Integer editLength; + + @Column(name = "display_length") @ApiModelProperty(value = "显示长度") - private Integer displayformatWidth; + private Integer displayLength; @Override @@ -151,11 +154,11 @@ public class ArchivesDictionary extends BaseEntity implements Serializable { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ArchivesDictionary that = (ArchivesDictionary) 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); + 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(editLength, that.editLength) && Objects.equals(displayLength, that.displayLength); } @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); + 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, editLength, displayLength); } } diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesTypeRepository.java b/archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesTypeRepository.java index 523516b..bfb5bdc 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesTypeRepository.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesTypeRepository.java @@ -3,6 +3,12 @@ package com.storeroom.modules.dictionary.repository; import com.storeroom.modules.dictionary.domain.ArchivesType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; -public interface ArchivesTypeRepository extends JpaRepository, JpaSpecificationExecutor { +import java.util.List; + +public interface ArchivesTypeRepository extends JpaRepository, JpaSpecificationExecutor { + + List findByCnName(String cn); } diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesTypeQueryCriteria.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesTypeQueryCriteria.java new file mode 100644 index 0000000..65f4c6b --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/dto/ArchivesTypeQueryCriteria.java @@ -0,0 +1,18 @@ +package com.storeroom.modules.dictionary.service.dto; + + +import com.storeroom.annotaion.DataPermission; +import com.storeroom.annotaion.Query; +import lombok.Data; + +@Data +@DataPermission(fieldName = "id") +public class ArchivesTypeQueryCriteria { + + @Query(type = Query.Type.INNER_LIKE) + private String cnName; + + @Query(type = Query.Type.INNER_LIKE) + private String enName; + +} diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesDictionaryImpl.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesDictionaryImpl.java index 5cdb547..961fe3f 100644 --- a/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesDictionaryImpl.java +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesDictionaryImpl.java @@ -1,19 +1,38 @@ package com.storeroom.modules.dictionary.service.impl; +import com.storeroom.modules.dictionary.domain.ArchivesDictionary; +import com.storeroom.modules.dictionary.repository.ArchivesDictionaryRepository; import com.storeroom.modules.dictionary.service.ArchivesDictionaryService; import com.storeroom.modules.dictionary.service.dto.ArchivesDictionaryDTO; +import com.storeroom.modules.dictionary.service.mapstruct.ArchivesDictionaryMapper; +import com.storeroom.utils.NanoIdUtils; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; @Service +@RequiredArgsConstructor public class ArchivesDictionaryImpl implements ArchivesDictionaryService { + private final ArchivesDictionaryRepository archivesDictionaryRepository; + private final ArchivesDictionaryMapper archivesDictionaryMapper; + @Override + @Transactional(rollbackFor = Exception.class) public void saveAll(List list) { - - + List list1=new ArrayList<>(); + for (ArchivesDictionaryDTO o : list) { + + ArchivesDictionary a = archivesDictionaryMapper.toEntity(o); + a.setId(NanoIdUtils.randomNanoId()); + //this.archivesDictionaryRepository.saveAndFlush(a); + list1.add(a); + } + archivesDictionaryRepository.saveAll(list1); } } 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 540c5fd..079f04c 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 @@ -1,12 +1,10 @@ package com.storeroom.modules.dictionary.service.impl; -import com.storeroom.modules.common.ArchivesListToMap; +import com.storeroom.exception.BaseException; import com.storeroom.modules.dictionary.domain.ArchivesType; -import com.storeroom.modules.dictionary.domain.vo.FieldVO; import com.storeroom.modules.dictionary.repository.ArchivesTypeRepository; import com.storeroom.modules.dictionary.service.ArchivesTypeService; import com.storeroom.modules.dictionary.service.DynamicTableService; -import com.storeroom.modules.dictionary.service.FieldService; import com.storeroom.modules.dictionary.service.dto.ArchivesTypeDTO; import com.storeroom.modules.dictionary.service.mapstruct.ArchivesTypeMapper; import com.storeroom.utils.DateUtils; @@ -14,17 +12,12 @@ import com.storeroom.utils.NanoIdUtils; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; + import java.util.List; -import java.util.Map; @Service @@ -33,8 +26,6 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { private final ArchivesTypeMapper archivesTypeMapper; - private final FieldService fieldService; - private final JdbcTemplate jdbcTemplate; private final ArchivesTypeRepository archivesTypeRepository; private final DynamicTableService dynamicTableService; @@ -48,27 +39,19 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService { @Override @Transactional(rollbackFor = Exception.class) public void create(ArchivesTypeDTO archivesTypeDTO) { - ArchivesType archivesType = archivesTypeMapper.toEntity(archivesTypeDTO); - //注入nonaid - archivesType.setId(NanoIdUtils.randomNanoId()); - archivesTypeRepository.save(archivesType); - dynamicTableService.DynamicCreate(archivesType.getIsType(),archivesType.getId()); + List archivesType1 = archivesTypeRepository.findByCnName(archivesType.getCnName()); + if (archivesType1 == null) { + tableName += DateUtils.getNowDateTime(); + archivesType.setId(NanoIdUtils.randomNanoId()); + archivesType.setEnName(tableName); + archivesTypeRepository.save(archivesType); + dynamicTableService.DynamicCreate(archivesType.getIsType(), archivesType.getId()); + } else { + throw new BaseException("门类名称不能重复"); + } - } -// public void dynamicSystemTable(Integer type) { -// tableName += DateUtils.getNowDateTime(); -// List list = fieldService.findGroupType(type); -// if (!list.isEmpty()) { -// String sqlstr = ArchivesListToMap.getMaps(list, tableName); -// jdbcTemplate.execute(sqlstr); -// } -// } -// -// public void dynameicTemplateTable(Integer type) { -// fileTableName += DateUtils.getNowDateTime(); -// -// } + } } 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 1a39c42..29307ae 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 @@ -1,12 +1,18 @@ package com.storeroom.modules.dictionary.service.impl; +import com.storeroom.exception.BaseException; +import com.storeroom.modules.common.ArchivesListToMap; import com.storeroom.modules.dictionary.domain.vo.FieldVO; import com.storeroom.modules.dictionary.service.ArchivesDictionaryService; import com.storeroom.modules.dictionary.service.DynamicTableService; import com.storeroom.modules.dictionary.service.FieldService; import com.storeroom.modules.dictionary.service.dto.ArchivesDictionaryDTO; import com.storeroom.modules.dictionary.service.dto.FieldDTO; +import com.storeroom.utils.DateUtils; +import com.storeroom.utils.NanoIdUtils; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -20,54 +26,97 @@ public class DynamicTableImpl implements DynamicTableService { private final FieldService fieldService; private final ArchivesDictionaryService archivesDictionaryService; - private ArchivesDictionaryDTO archivesDictionaryDTO; + 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) { - // if (type == 1 || type == 2){ List integerList = new ArrayList<>(); - integerList.add(1); - integerList.add(2); - integerList.add(3); - - //获取基础字典表数据 - List list = fieldService.findGroupType(integerList); - List newList = new ArrayList<>(); - - if (!list.isEmpty()) { - for (FieldVO j : list) { - j.setCategoryId(archiveTypeId); - archivesDictionaryDTO.setFieldName(j.getFieldName()); - archivesDictionaryDTO.setFieldCnName(j.getFieldCnName()); - archivesDictionaryDTO.setIsDefaultValue(j.getIsDefaultValue()); - archivesDictionaryDTO.setCategoryId(archiveTypeId); - archivesDictionaryDTO.setIsDataType(j.getIsDataType()); - archivesDictionaryDTO.setIsDataTypeDetails(j.getIsDataTypeDetails()); - archivesDictionaryDTO.setIsColumnLength(j.getIsColumnLength()); - archivesDictionaryDTO.setIsSequence(j.getIsSequence()); - archivesDictionaryDTO.setIsType(j.getIsType()); - archivesDictionaryDTO.setIsSystem(j.getIsSystem()); - newList.add(archivesDictionaryDTO); - //archivesDictionaryDTO.setIsDataType(); - } - archivesDictionaryService.saveAll(newList); - - - // archivesDictionaryService.saveAll(); - //根据基础字典表创建数据 - // DynamicSQLTable.CreateTable(ArchivesListToMap.getMapList(newList)); + if (type == 4 || type == 5) { + integerList.add(1); + integerList.add(2); + + List fieldList = queryList(integerList); + DynamicInsert(fieldList, archiveTypeId); + DynamicCreateFileTable(fieldList, tableName); + integerList.clear(); + integerList.add(3); + List fileList = queryList(integerList); + DynamicInsert(fileList, archiveTypeId); + DynamicCreateFileTable(fileList, fileTableName); + + } else { + integerList.add(1); + integerList.add(2); + List fieldList = fieldService.findGroupType(integerList); + DynamicInsert(fieldList, archiveTypeId); + DynamicCreateFileTable(fieldList, tableName); } - // } - } + } - public void DynamicInsert(List list) { + /** + * 查询字典字段 + * + * @param type / + * @return / + */ + private List queryList(List type) { + List list = fieldService.findGroupType(type); + return list; + } + /** + * 插入档案字典表数据 + * + * @param list + * @param archiveTypeId + */ + private void DynamicInsert(List list, String archiveTypeId) { + List newList = new ArrayList<>(); + ArchivesDictionaryDTO archivesDictionaryDTO = new ArchivesDictionaryDTO(); + for (FieldVO j : list) { + j.setCategoryId(archiveTypeId); + archivesDictionaryDTO.setFieldName(j.getFieldName()); + archivesDictionaryDTO.setFieldCnName(j.getFieldCnName()); + archivesDictionaryDTO.setIsDefaultValue(j.getIsDefaultValue()); + archivesDictionaryDTO.setCategoryId(archiveTypeId); + archivesDictionaryDTO.setIsDataType(j.getIsDataType()); + archivesDictionaryDTO.setIsDataTypeDetails(j.getIsDataTypeDetails()); + archivesDictionaryDTO.setIsColumnLength(j.getIsColumnLength()); + archivesDictionaryDTO.setIsSequence(j.getIsSequence()); + archivesDictionaryDTO.setIsType(j.getIsType()); + archivesDictionaryDTO.setIsSystem(j.getIsSystem()); + newList.add(archivesDictionaryDTO); + } + archivesDictionaryService.saveAll(newList); } - private void DynamicCreateFileTable(List list) { - + private void DynamicCreateFileTable(List list, String tableName) { + tableName += DateUtils.getNowDateTime(); + List> maps = ArchivesListToMap.getMaps(list); + StringBuilder stringBuilder = new StringBuilder("create table " + tableName + " (id varchar(100) primary key,"); + for (int i = 0; i < maps.size(); i++) { + stringBuilder.append(maps.get(i).get("fieldName")); + stringBuilder.append(" "); + stringBuilder.append(maps.get(i).get("isDataTypeDetails")); + stringBuilder.append("("); + stringBuilder.append(maps.get(i).get("isColumnLength")); + stringBuilder.append(")"); + if (maps.size() - 1 != i) { + stringBuilder.append(","); + } + if (maps.size() - 1 == i) { + stringBuilder.append(")"); + } + } + jdbcTemplate.execute(stringBuilder.toString()); } } diff --git a/archives/src/main/java/com/storeroom/modules/dictionary/service/mapstruct/ArchivesDictionaryMapper.java b/archives/src/main/java/com/storeroom/modules/dictionary/service/mapstruct/ArchivesDictionaryMapper.java new file mode 100644 index 0000000..1389bfc --- /dev/null +++ b/archives/src/main/java/com/storeroom/modules/dictionary/service/mapstruct/ArchivesDictionaryMapper.java @@ -0,0 +1,12 @@ +package com.storeroom.modules.dictionary.service.mapstruct; + + +import com.storeroom.base.BaseMapper; +import com.storeroom.modules.dictionary.domain.ArchivesDictionary; +import com.storeroom.modules.dictionary.service.dto.ArchivesDictionaryDTO; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ArchivesDictionaryMapper extends BaseMapper { +} diff --git a/archives/src/test/java/ArchivesTypeTest.java b/archives/src/test/java/ArchivesTypeTest.java deleted file mode 100644 index 1ab0eff..0000000 --- a/archives/src/test/java/ArchivesTypeTest.java +++ /dev/null @@ -1,26 +0,0 @@ -import com.storeroom.modules.dictionary.domain.Field; -import com.storeroom.modules.dictionary.domain.vo.FieldVO; -import com.storeroom.modules.dictionary.service.FieldService; -import lombok.RequiredArgsConstructor; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.ArrayList; -import java.util.List; - -@SpringBootTest -public class ArchivesTypeTest { - -// @Autowired -// private FieldService fieldService; - -// @Test -// public void dynamicSystemTableTest() { -// List list = new ArrayList<>(); -// list.add(1); -// list.add(2); -// List vo = fieldService.findGroupType(list); -// System.out.println(vo); -// } -} diff --git a/system/src/main/resources/application.yml b/system/src/main/resources/application.yml index 0f76595..3c1f751 100644 --- a/system/src/main/resources/application.yml +++ b/system/src/main/resources/application.yml @@ -22,6 +22,7 @@ spring: hibernate: ddl-auto: none open-in-view: true + show-sql: true redis: #数据库索引 diff --git a/system/src/test/java/TestOnlineUserService.java b/system/src/test/java/TestOnlineUserService.java index 1fd4e2b..d596682 100644 --- a/system/src/test/java/TestOnlineUserService.java +++ b/system/src/test/java/TestOnlineUserService.java @@ -1,7 +1,15 @@ +import com.storeroom.AppRun; +import com.storeroom.modules.dictionary.domain.vo.FieldVO; +import com.storeroom.modules.dictionary.service.FieldService; import com.storeroom.modules.security.service.OnlineUserService; import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.List; + public class TestOnlineUserService { @@ -15,4 +23,16 @@ public class TestOnlineUserService { } } + +// @Autowired +// private FieldService fieldService; +// +// @Test +// public void dynamicSystemTableTest() { +// List list = new ArrayList<>(); +// list.add(1); +// list.add(2); +// List vo = fieldService.findGroupType(list); +// System.out.println(vo); +// } }