提交 718585f3 authored 作者: taojinlong's avatar taojinlong

fix: excel 替换、追加不生效

上级 fcc74303
...@@ -53,6 +53,7 @@ import org.slf4j.Logger; ...@@ -53,6 +53,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -146,6 +147,7 @@ public class DataSetTableService { ...@@ -146,6 +147,7 @@ public class DataSetTableService {
} }
} }
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@DeCleaner(value = DePermissionType.DATASET, key = "sceneId") @DeCleaner(value = DePermissionType.DATASET, key = "sceneId")
public void saveExcel(DataSetTableRequest datasetTable) throws Exception { public void saveExcel(DataSetTableRequest datasetTable) throws Exception {
List<String> datasetIdList = new ArrayList<>(); List<String> datasetIdList = new ArrayList<>();
...@@ -357,7 +359,7 @@ public class DataSetTableService { ...@@ -357,7 +359,7 @@ public class DataSetTableService {
public List<DatasetTable> list(List<String> datasetIds) { public List<DatasetTable> list(List<String> datasetIds) {
DatasetTableExample example = new DatasetTableExample(); DatasetTableExample example = new DatasetTableExample();
example.createCriteria().andIdIn(datasetIds); example.createCriteria().andIdIn(datasetIds);
return datasetTableMapper.selectByExample(example); return datasetTableMapper.selectByExampleWithBLOBs(example);
} }
public List<DataSetTableDTO> listAndGroup(DataSetTableRequest dataSetTableRequest) { public List<DataSetTableDTO> listAndGroup(DataSetTableRequest dataSetTableRequest) {
......
...@@ -432,7 +432,8 @@ public class ExtractDataService { ...@@ -432,7 +432,8 @@ public class ExtractDataService {
} }
private void extractApiData(DatasetTable datasetTable, Datasource datasource, List<DatasetTableField> datasetTableFields, String extractType) throws Exception { private void extractApiData(DatasetTable datasetTable, Datasource datasource, List<DatasetTableField> datasetTableFields, String extractType) throws Exception {
List<ApiDefinition> lists = new Gson().fromJson(datasource.getConfiguration(), new TypeToken<ArrayList<ApiDefinition>>(){}.getType()); List<ApiDefinition> lists = new Gson().fromJson(datasource.getConfiguration(), new TypeToken<ArrayList<ApiDefinition>>() {
}.getType());
lists = lists.stream().filter(item -> item.getName().equalsIgnoreCase(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable())).collect(Collectors.toList()); lists = lists.stream().filter(item -> item.getName().equalsIgnoreCase(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(lists)) { if (CollectionUtils.isEmpty(lists)) {
throw new Exception("未找到API数据表"); throw new Exception("未找到API数据表");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论