Browse Source

commit code

master
刘力 3 years ago
parent
commit
20157ec120
  1. 21
      archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesDictionaryRepository.java
  2. 12
      archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DynamicTableImpl.java
  3. 9
      archives/src/test/java/ArchivesTypeTest.java

21
archives/src/main/java/com/storeroom/modules/dictionary/repository/ArchivesDictionaryRepository.java

@ -13,20 +13,19 @@ public interface ArchivesDictionaryRepository extends JpaRepository<ArchivesDict
value = "select field_name from archives_dictionary where category_id = ?1 and is_display is true order by is_displayorder asc")
List<String> findDisPlayField(String categoryId);
<<<<<<< HEAD
List<ArchivesDictionary> findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(String categoryId, boolean isInput);
@Query(value = "INSERT INTO yxk_storeroom.archives_dictionary(id,category_id,field_name,field_cn_name,dictionary_id,is_data_type,is_data_type_details,is_column_length,is_sequence,is_type,is_system VALUES ())", nativeQuery = true)
void insertData(String id,String categoryId,
String fieldName,String fieldCnName,
String isDefaultValue,Integer isDataType,
String isDataTypeDetails,String isColumnLength,
Integer isSequence,Integer isType,Integer isSystem);
=======
// @Query(value = "INSERT INTO yxk_storeroom.archives_dictionary(id,category_id,field_name,field_cn_name,dictionary_id,is_data_type,is_data_type_details,is_column_length,is_sequence,is_type,is_system VALUES ())", nativeQuery = true)
// void insertData(String id,String categoryId,
// String fieldName,String fieldCnName,
// String isDefaultValue,Integer isDataType,
// String isDataTypeDetails,String isColumnLength,
// Integer isSequence,Integer isType,Integer isSystem);
@Query(value = "from ArchivesDictionary where categoryId = ?1 and isDisplay = true order by isDisplayorder asc")
List<ArchivesDictionary> findDisPlay(String categoryId);
List<ArchivesDictionary> findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(String categoryId,boolean isInput);
>>>>>>> fa78bdc2fdf2d68321b9dcc6920bfce2ed1faa85
//
// List<ArchivesDictionary> findAllByCategoryIdAndIsInputOrderByIsSequenceAsc(String categoryId,boolean isInput);
}

12
archives/src/main/java/com/storeroom/modules/dictionary/service/impl/DynamicTableImpl.java

@ -41,9 +41,19 @@ public class DynamicTableImpl implements DynamicTableService {
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));

9
archives/src/test/java/ArchivesTypeTest.java

@ -3,21 +3,24 @@ 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<Integer> list = new ArrayList<>();
// list.add(1);
// list.add(2);
// List<FieldVO> vo = service.findGroupType(list);
// List<FieldVO> vo = fieldService.findGroupType(list);
// System.out.println(vo);
// }
}
Loading…
Cancel
Save