From 3b21a4d4c1b20f075eb40073aff30b9298421275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BF=8A=E6=9D=B0?= <9463626+zhou-junjiezjj@user.noreply.gitee.com> Date: Fri, 28 Jul 2023 09:44:35 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E5=8C=BA=E5=9F=9F=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/rest/DeviceDbitemController.java | 2 +- .../service/impl/DeviceServiceImpl.java | 32 ++++++-------- .../nl/acs/device/wql/Qdevice_query_002.wql | 8 +++- acs/nladmin-ui/src/views/acs/device/index.vue | 43 +++++++++++++++++-- 4 files changed, 60 insertions(+), 25 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceDbitemController.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceDbitemController.java index 46925e5..4c3f622 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceDbitemController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceDbitemController.java @@ -25,7 +25,7 @@ import java.util.Map; @RestController @RequiredArgsConstructor @Api(tags = "设备采集项管理") -@RequestMapping("/api/deviceDbitem") +@RequestMapping("Dbitem") public class DeviceDbitemController { private final DeviceDbitemService deviceDbitemService; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index ba548e9..3eea3af 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -78,15 +78,20 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial @Override public Map queryAll(Map whereJson, Pageable page) { logger.info("Hello World"); - HashMap param = new HashMap(); param.put("flag", "01"); if (whereJson.get("blurry") != null) { param.put("blurry", "%" + whereJson.get("blurry") + "%"); } - param.put("device_type", whereJson.get("device_type")); + if (whereJson.get("region") != null) { + param.put("region", whereJson.get("region")); + } + if (whereJson.get("device_type") != null) { + param.put("device_type", whereJson.get("device_type")); + } JSONObject json = WQL.getWO("Qdevice_query_002").addParamMap(param).pageQuery(WqlUtil.getHttpContext(page), "is_config asc,seq_num desc,update_time desc"); return json; + } @Override @@ -269,25 +274,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial @Override public void download(List all, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); - for (DeviceDto device : all) { Map map = new LinkedHashMap<>(); - map.put("生产厂家", device.getManufacturer()); - map.put("厂家电话", device.getManufacturer_phone()); - map.put("opcServer标识", device.getOpc_server_id()); - map.put("opcPlc标识", device.getOpc_plc_id()); - map.put("是否启用", device.getIs_active()); - map.put("是否删除", device.getIs_delete()); - map.put("创建者", device.getCreate_by()); - map.put("创建时间", device.getCreate_time()); - map.put("修改者", device.getUpdate_by()); - map.put("修改时间", device.getUpdate_time()); - map.put("设备编码", device.getDevice_code()); - map.put("设备名字", device.getDevice_name()); - map.put("设备类型", device.getDevice_type()); - map.put("是否配置", device.getIs_config()); - map.put("备注", device.getRemark()); + map.put("device_code",null); + map.put("device_name",null); + map.put("device_type",null); + map.put("is_config",null); + map.put("is_route",null); + map.put("region",null); list.add(map); - } FileUtil.downloadExcel(list, response); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/Qdevice_query_002.wql b/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/Qdevice_query_002.wql index 221da57..57817df 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/Qdevice_query_002.wql +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/wql/Qdevice_query_002.wql @@ -23,6 +23,7 @@ 输入.methods_code TYPEAS s_string 输入.methods_id TYPEAS s_string 输入.blurry TYPEAS s_string + 输入.region TYPEAS s_string [临时表] --这边列出来的临时表就会在运行期动态创建 @@ -60,9 +61,12 @@ OPTION 输入.blurry <> "" ( d.device_code LIKE 输入.blurry or d.device_name LIKE 输入.blurry) ENDOPTION + OPTION 输入.region <> "" + d.region = 输入.region + ENDOPTION OPTION 输入.device_type <> "" d.device_type = 输入.device_type - ENDOPTION + ENDOPTION ENDSELECT ENDPAGEQUERY ENDIF @@ -134,4 +138,4 @@ address.methods_id = 输入.methods_id ENDOPTION ENDSELECT - ENDIF \ No newline at end of file + ENDIF diff --git a/acs/nladmin-ui/src/views/acs/device/index.vue b/acs/nladmin-ui/src/views/acs/device/index.vue index fa87c1e..24fb48d 100644 --- a/acs/nladmin-ui/src/views/acs/device/index.vue +++ b/acs/nladmin-ui/src/views/acs/device/index.vue @@ -26,9 +26,29 @@ > + + + + 导出模型 { + get('region').then(data => { this.regions = data.content }) }) @@ -257,6 +284,16 @@ export default { }).catch(err => { console.log(err.response.data.message) }) + }, + downloadMethod() { + this.beforeInit() + this.downloadLoading = true + download(this.url + 'api/device/download', this.params).then(result => { + downloadFile(result, this.title + '数据', 'xlsx') + this.downloadLoading = false + }).catch(() => { + this.downloadLoading = false + }) } } }