From 6995cfddc3e439fd6e148279d8f7cf7de7e5e9e1 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 2 Aug 2022 11:07:57 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8):=20=E9=A9=B1=E5=8A=A8=E6=96=87=E4=BB=B6=E9=87=8D?= =?UTF-8?q?=E5=90=8D=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/service/datasource/DriverService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/src/main/java/io/dataease/service/datasource/DriverService.java b/backend/src/main/java/io/dataease/service/datasource/DriverService.java index 69be3ad455..a0fd534fdd 100644 --- a/backend/src/main/java/io/dataease/service/datasource/DriverService.java +++ b/backend/src/main/java/io/dataease/service/datasource/DriverService.java @@ -135,6 +135,13 @@ public class DriverService { deDriverDetails.setVersion(version); deDriverDetails.setFileName(filename); deDriverDetails.setDriverClass(String.join(",", jdbcList)); + + DeDriverDetailsExample deDriverDetailsExample = new DeDriverDetailsExample(); + deDriverDetailsExample.createCriteria().andDeDriverIdEqualTo(driverId).andFileNameEqualTo(filename); + if(CollectionUtil.isNotEmpty(deDriverDetailsMapper.selectByExample(deDriverDetailsExample))){ + throw new Exception("A file with the same name already exists:" + filename); + } + deDriverDetailsMapper.insert(deDriverDetails); SysLogDTO sysLogDTO = DeLogUtils.buildLog(SysLogConstants.OPERATE_TYPE.UPLOADFILE, SysLogConstants.SOURCE_TYPE.DRIVER_FILE, deDriverDetails.getId(), driverId, null, null); DeLogUtils.save(sysLogDTO); From d2b481c00205fb1897dfc4b4a761042b6012f940 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 2 Aug 2022 11:41:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/provider/datasource/ApiProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java index e09e82f343..cc99027538 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java @@ -142,7 +142,7 @@ public class ApiProvider extends Provider { switch (apiDefinition.getMethod()) { case "GET": - response = HttpClientUtil.get(apiDefinition.getUrl(), httpClientConfig); + response = HttpClientUtil.get(apiDefinition.getUrl().trim(), httpClientConfig); break; case "POST": if (apiDefinitionRequest.getBody().get("type") == null) { From 809d2d8683cf06a37745db5a4777f7e44069e754 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 2 Aug 2022 17:06:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=AE=BE=E7=BD=AE):=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=96=87=E4=BB=B6=E6=B2=A1=E6=9C=89=E5=8F=8D?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/SysParam/MapSetting/MapSettingLeft.vue | 9 +++++++-- .../views/system/SysParam/MapSetting/MapSettingRight.vue | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue b/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue index a98d018b98..203da13b9b 100644 --- a/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue +++ b/frontend/src/views/system/SysParam/MapSetting/MapSettingLeft.vue @@ -149,8 +149,13 @@ export default { type: 'warning' }).then(() => { removeMap(param).then(res => { - this.$emit('refresh-tree') - this.$success(this.$t('commons.delete_success')) + this.$store.dispatch('map/setGeo', { + key: param.code, + value: null + }).then(() => { + this.$emit('refresh-tree') + this.$success(this.$t('commons.delete_success')) + }) }) }).catch(() => { this.$info(this.$t('commons.delete_cancel')) diff --git a/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue b/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue index ae6a8613bd..ad024cf0f5 100644 --- a/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue +++ b/frontend/src/views/system/SysParam/MapSetting/MapSettingRight.vue @@ -131,7 +131,7 @@ export default { }, data() { return { - formInline: { pCode: '' }, + formInline: { pCode: '', fileName: '' }, loading: false, rules: { pCode: [ @@ -227,7 +227,7 @@ export default { return true }, uploadMapFile(file) { - this.formInline.fileName = file.file.name + this.$set(this.formInline, 'fileName', file.file.name) this.formInline.file = file.file }, removeFile() { From eabbf9a609334e9c555f1a10585dde3e6100f0c4 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 2 Aug 2022 17:17:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=BA=90):=20?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=20api=20=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/datasource/ApiProvider.java | 20 +++++++++++-------- .../system/datasource/DsConfiguration.vue | 1 - .../src/views/system/datasource/DsForm.vue | 6 +++++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java index cc99027538..cf7c55f97d 100644 --- a/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java +++ b/backend/src/main/java/io/dataease/provider/datasource/ApiProvider.java @@ -318,27 +318,31 @@ public class ApiProvider extends Provider { } static void mergeValue(JSONObject field, ApiDefinition apiDefinition, JSONObject item) { - JSONArray array = field.getJSONArray("value"); if (array != null && item.getString("value") != null && array.size() < apiDefinition.getPreviewNum()) { array.add(item.getJSONArray("value").get(0).toString()); field.put("value", array); } if(CollectionUtils.isNotEmpty(field.getJSONArray("children"))&& CollectionUtils.isNotEmpty(item.getJSONArray("children"))){ - JSONArray objectChildren = field.getJSONArray("children"); - JSONArray jsonArrayChildren = new JSONArray(); + JSONArray fieldChildren = field.getJSONArray("children"); JSONArray itemChildren = item.getJSONArray("children"); - for (Object objectChild : objectChildren) { - JSONObject jsonObject = JSONObject.parseObject(objectChild.toString()); + + JSONArray fieldArrayChildren = new JSONArray(); + for (Object fieldChild : fieldChildren) { + JSONObject jsonObject = JSONObject.parseObject(fieldChild.toString()); + JSONObject find = null; for (Object itemChild : itemChildren) { JSONObject itemObject = JSONObject.parseObject(itemChild.toString()); if(jsonObject.getString("jsonPath").equals(itemObject.getString("jsonPath"))){ - mergeValue(jsonObject, apiDefinition, itemObject); - jsonArrayChildren.add(jsonObject); + find = itemObject; } } + if(find != null){ + mergeValue(jsonObject, apiDefinition, find); + } + fieldArrayChildren.add(jsonObject); } - field.put("children", jsonArrayChildren); + field.put("children", fieldArrayChildren); } } diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index 016b6fea30..c1c0b02a60 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -932,7 +932,6 @@ export default { return; } this.$refs.apiItem.validate((valid) => { - console.log(valid) if (valid) { const data = JSON.parse(JSON.stringify(this.apiItem)); this.loading = true; diff --git a/frontend/src/views/system/datasource/DsForm.vue b/frontend/src/views/system/datasource/DsForm.vue index fb22d33b04..0a7db4318d 100644 --- a/frontend/src/views/system/datasource/DsForm.vue +++ b/frontend/src/views/system/datasource/DsForm.vue @@ -316,7 +316,11 @@ export default { this.form = JSON.parse(JSON.stringify(row)) this.originConfiguration = this.form.configuration if (row.type === 'api') { - + this.originConfiguration = JSON.parse(JSON.stringify(this.form.apiConfiguration)) + this.originConfiguration.forEach(item => { + delete item.status + }) + this.originConfiguration = JSON.stringify(this.originConfiguration) } else { this.form.configuration = JSON.parse(this.form.configuration) }