|
@ -6,25 +6,19 @@ 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.utils.DateUtils; |
|
|
|
|
|
import com.storeroom.utils.StringUtils; |
|
|
import com.storeroom.utils.StringUtils; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
|
import org.hibernate.Session; |
|
|
|
|
|
import org.hibernate.SessionFactory; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate; |
|
|
import org.springframework.jdbc.core.JdbcTemplate; |
|
|
import org.springframework.jdbc.datasource.DataSourceUtils; |
|
|
import org.springframework.jdbc.datasource.DataSourceUtils; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.persistence.EntityManager; |
|
|
|
|
|
import javax.persistence.PersistenceContext; |
|
|
|
|
|
|
|
|
|
|
|
import javax.sql.DataSource; |
|
|
import javax.sql.DataSource; |
|
|
import java.sql.Connection; |
|
|
import java.sql.Connection; |
|
|
import java.sql.DatabaseMetaData; |
|
|
|
|
|
import java.sql.ResultSet; |
|
|
import java.sql.ResultSet; |
|
|
import java.sql.SQLException; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
@ -49,14 +43,21 @@ public class DynamicTableImpl implements DynamicTableService { |
|
|
String fileTableName = "file_"+tableName; |
|
|
String fileTableName = "file_"+tableName; |
|
|
integerList.add(1); |
|
|
integerList.add(1); |
|
|
integerList.add(2); |
|
|
integerList.add(2); |
|
|
|
|
|
|
|
|
|
|
|
//先查询类型1和2的数据字段 |
|
|
List<FieldVO> fieldList = queryList(integerList); |
|
|
List<FieldVO> fieldList = queryList(integerList); |
|
|
|
|
|
//插入数据 |
|
|
DynamicInsert(fieldList, archiveTypeId); |
|
|
DynamicInsert(fieldList, archiveTypeId); |
|
|
|
|
|
//生成表和表名创建表名 |
|
|
DynamicCreateFileTable(fieldList, tableName); |
|
|
DynamicCreateFileTable(fieldList, tableName); |
|
|
|
|
|
//清楚数组 |
|
|
integerList.clear(); |
|
|
integerList.clear(); |
|
|
|
|
|
//查询类型为3的字段 |
|
|
integerList.add(3); |
|
|
integerList.add(3); |
|
|
|
|
|
//生成数组 |
|
|
List<FieldVO> fileList = queryList(integerList); |
|
|
List<FieldVO> fileList = queryList(integerList); |
|
|
|
|
|
//插入数据 |
|
|
DynamicInsert(fileList, archiveTypeId); |
|
|
DynamicInsert(fileList, archiveTypeId); |
|
|
|
|
|
//创建表和生成文件表名 |
|
|
DynamicCreateFileTable(fileList, fileTableName); |
|
|
DynamicCreateFileTable(fileList, fileTableName); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|