From 5db39a226504b4dcd3716b6420e68a013513fc4a Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Thu, 20 Jun 2024 06:21:20 +0800 Subject: [PATCH] =?UTF-8?q?1078-=E5=AE=8C=E5=96=84=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E5=9B=BD=E6=A0=87=E9=80=9A=E9=81=93=E9=A1=B5=E9=9D=A2=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/JT1078TerminalController.java | 8 + .../iot/vmp/jt1078/dao/JTChannelMapper.java | 149 +++++++++++++++++- .../vmp/jt1078/service/Ijt1078Service.java | 2 + .../service/impl/jt1078ServiceImpl.java | 4 + ...TChannelGBParams.vue => JTChannelEdit.vue} | 92 +++++++---- web_src/src/components/JTChannelList.vue | 38 ++--- web_src/src/router/index.js | 11 ++ 7 files changed, 251 insertions(+), 53 deletions(-) rename web_src/src/components/{JTChannelGBParams.vue => JTChannelEdit.vue} (86%) diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078TerminalController.java b/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078TerminalController.java index ac0a5dcf6..6f27df398 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078TerminalController.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078TerminalController.java @@ -89,6 +89,14 @@ public class JT1078TerminalController { return service.getChannelList(page, count, deviceId, query); } + @Operation(summary = "1078-查询单个部标通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) + @Parameter(name = "id", description = "通道数据库ID", required = true) + @GetMapping("/channel/one") + public JTChannel getChannel(Integer id) { + assert id != null; + return service.getChannelByDbId(id); + } + @Operation(summary = "1078-更新通道", security = @SecurityRequirement(name = JwtUtils.HEADER)) @Parameter(name = "channel", description = "通道", required = true) @PostMapping("/channel/update") diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/dao/JTChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/jt1078/dao/JTChannelMapper.java index 331c4095b..555a899c7 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/dao/JTChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/dao/JTChannelMapper.java @@ -29,17 +29,108 @@ public interface JTChannelMapper { ", has_audio=#{hasAudio}" + ", name=#{name}" + ", channel_id=#{channelId}" + + ", gb_manufacturer=#{gbManufacturer}" + + ", gb_model=#{gbModel}" + + ", gb_civil_code=#{gbCivilCode}" + + ", gb_block=#{gbBlock}" + + ", gb_address=#{gbAddress}" + + ", gb_parental=#{gbParental}" + + ", gb_parent_id=#{gbParentId}" + + ", gb_register_way=#{gbRegisterWay}" + + ", gb_security_level_code=#{gbSecurityLevelCode}" + + ", gb_secrecy=#{gbSecrecy}" + + ", gb_ip_address=#{gbIpAddress}" + + ", gb_port=#{gbPort}" + + ", gb_password=#{gbPassword}" + + ", gb_status=#{gbStatus}" + + ", gb_longitude=#{gbLongitude}" + + ", gb_latitude=#{gbLatitude}" + + ", gb_business_group_id=#{gbBusinessGroupId}" + + ", gb_ptz_type=#{gbPtzType}" + + ", gb_photoelectric_imaging_typ=#{gbPhotoelectricImagingTyp}" + + ", gb_capture_position_type=#{gbCapturePositionType}" + + ", gb_room_type=#{gbRoomType}" + + ", gb_supply_light_type=#{gbSupplyLightType}" + + ", gb_direction_type=#{gbDirectionType}" + + ", gb_resolution=#{gbResolution}" + + ", gb_stream_number_list=#{gbStreamNumberList}" + + ", gb_download_speed=#{gbDownloadSpeed}" + + ", gb_svc_space_support_mod=#{gbSvcSpaceSupportMod}" + + ", gb_svc_time_support_mode=#{gbSvcTimeSupportMode}" + + ", gb_ssvc_ratio_support_list=#{gbSsvcRatioSupportList}" + + ", gb_mobile_device_type=#{gbMobileDeviceType}" + + ", gb_horizontal_field_angle=#{gbHorizontalFieldAngle}" + + ", gb_vertical_field_angle=#{gbVerticalFieldAngle}" + + ", gb_max_view_distance=#{gbMaxViewDistance}" + + ", gb_grassroots_code=#{gbGrassrootsCode}" + + ", gb_po_type=#{gbPoType}" + + ", gb_po_common_name=#{gbPoCommonName}" + + ", gb_mac=#{gbMac}" + + ", gb_function_type=#{gbFunctionType}" + + ", gb_encode_type=#{gbEncodeType}" + + ", gb_install_time=#{gbInstallTime}" + + ", gb_management_unit=#{gbManagementUnit}" + + ", gb_contact_info=#{gbContactInfo}" + + ", gb_record_save_days=#{gbRecordSaveDays}" + + ", gb_industrial_classification=#{gbIndustrialClassification}" + "WHERE id=#{id}"+ " "}) void update(JTChannel channel); - @Insert("INSERT INTO wvp_jt_channel (" + + @Insert(value = {" "}) void add(JTChannel channel); @Delete("delete from wvp_jt_channel where id = #{id}") @@ -62,4 +199,12 @@ public interface JTChannelMapper { " "}) JTChannel getChannel(@Param("terminalDbId") int terminalDbId, @Param("channelId") Integer channelId); + @Select(value = {" "}) + JTChannel getChannelByDbId(@Param("id") Integer id); } diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java index 31f1d862c..c0092d46b 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java @@ -133,4 +133,6 @@ public interface Ijt1078Service { JTDevice getDeviceById(Integer deviceId); void updateDevicePosition(String phoneNumber, Double longitude, Double latitude); + + JTChannel getChannelByDbId(Integer id); } diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java index 7c58f9aa4..90a2992e9 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java @@ -1188,4 +1188,8 @@ public class jt1078ServiceImpl implements Ijt1078Service { jtDeviceMapper.batchUpdateDevicePosition(devices); } + @Override + public JTChannel getChannelByDbId(Integer id) { + return jtChannelMapper.getChannelByDbId(id); + } } diff --git a/web_src/src/components/JTChannelGBParams.vue b/web_src/src/components/JTChannelEdit.vue similarity index 86% rename from web_src/src/components/JTChannelGBParams.vue rename to web_src/src/components/JTChannelEdit.vue index 00754388a..e1ca3eb46 100755 --- a/web_src/src/components/JTChannelGBParams.vue +++ b/web_src/src/components/JTChannelEdit.vue @@ -4,7 +4,7 @@
- 国标通道参数 + 通道编辑
@@ -14,12 +14,21 @@
- 通讯参数 - - + 部标通道参数 + + + + + + + + + 国标通道参数 + + - + @@ -184,7 +193,7 @@ - + @@ -195,7 +204,7 @@ - + @@ -249,18 +258,15 @@ export default { }, data() { return { - phoneNumber: this.$route.params.phoneNumber, form: { - collisionAlarmParams: {}, - illegalDrivingPeriods: {}, - cameraTimer: {}, + id: this.$route.params.id, + terminalDbId: this.$route.params.terminalDbId }, version: 3, rules: { deviceId: [{ required: true, message: "请输入设备编号", trigger: "blur" }] }, winHeight: window.innerHeight - 200, - beforeUrl: "/jtDeviceList", isLoading: false, loadSnap: {}, }; @@ -271,35 +277,55 @@ export default { }, methods: { initData: function () { - this.isLoading = true; - this.$axios({ - method: 'get', - url: `/api/jt1078/config`, - params: { - phoneNumber: this.phoneNumber - } - }).then((res)=> { - this.isLoading = false; - console.log(res) - this.form = res.data.data; - }).cache((e)=>{ - this.isLoading = false; - }); + console.log(this.form.id) + if (this.form.id) { + this.isLoading = true; + this.$axios({ + method: 'get', + url: `/api/jt1078/terminal/channel/one`, + params: { + id: this.form.id + } + }).then((res)=> { + this.isLoading = false; + if (res.data.data) { + this.form = res.data.data; + } + }).cache((e)=>{ + this.isLoading = false; + }); + }else { + isLoading = false; + } }, onSubmit: function () { + console.log("onSubmit"); + let isEdit = typeof (this.form.id) !== "undefined" this.$axios({ method: 'post', - url: `/api/jt1078/set-config`, - data: { - phoneNumber: this.phoneNumber, - config: this.form + url:`/api/jt1078/terminal/channel/${isEdit?'update':'add'}/`, + params: this.form + }).then((res) => { + console.log(res.data) + if (res.data.code === 0) { + this.$message({ + showClose: true, + message: "保存成功", + type: "success", + }); + }else { + this.$message({ + showClose: true, + message: res.data.msg, + type: "error", + }); } - }).then(function (res) { - console.log(JSON.stringify(res)); + }).catch(function (error) { + console.log(error); }); }, showDevice: function () { - this.$router.push(this.beforeUrl) + window.history.go(-1) }, } }; diff --git a/web_src/src/components/JTChannelList.vue b/web_src/src/components/JTChannelList.vue index f06fa71a0..3da54e38b 100755 --- a/web_src/src/components/JTChannelList.vue +++ b/web_src/src/components/JTChannelList.vue @@ -306,27 +306,29 @@ export default { this.initData(); }, add: function () { - this.$refs.channelEdit.openDialog(null, this.deviceId, () => { - this.$refs.channelEdit.close(); - this.$message({ - showClose: true, - message: "添加成功", - type: "success", - }); - setTimeout(this.getList, 200) - }) + // this.$refs.channelEdit.openDialog(null, this.deviceId, () => { + // this.$refs.channelEdit.close(); + // this.$message({ + // showClose: true, + // message: "添加成功", + // type: "success", + // }); + // setTimeout(this.getList, 200) + // }) + this.$router.push(`/jtChannelEdit/${this.device.id}`); }, // 编辑 handleEdit(row) { - this.$refs.channelEdit.openDialog(row, this.deviceId, () => { - this.$refs.channelEdit.close(); - this.$message({ - showClose: true, - message: "修改成功", - type: "success", - }); - setTimeout(this.getList, 200) - }) + // this.$refs.channelEdit.openDialog(row, this.deviceId, () => { + // this.$refs.channelEdit.close(); + // this.$message({ + // showClose: true, + // message: "修改成功", + // type: "success", + // }); + // setTimeout(this.getList, 200) + // }) + this.$router.push(`/jtChannelEdit/${this.device.id}/${row.id}`); } } }; diff --git a/web_src/src/router/index.js b/web_src/src/router/index.js index 83be4d9ae..36851fecd 100755 --- a/web_src/src/router/index.js +++ b/web_src/src/router/index.js @@ -7,6 +7,7 @@ import deviceList from '../components/DeviceList.vue' import jtDeviceList from '../components/JTDeviceList.vue' import jtChannelList from '../components/JTChannelList.vue' import jtRecordDetail from '../components/JTRecordDetail.vue' +import jtChannelEdit from '../components/JTChannelEdit.vue' import jtDeviceParams from '../components/JTDeviceParam.vue' import channelList from '../components/channelList.vue' import gbRecordDetail from '../components/GBRecordDetail.vue' @@ -93,6 +94,16 @@ export default new VueRouter({ name: 'jtDeviceParams', component: jtDeviceParams, }, + { + path: '/jtChannelEdit/:terminalDbId/:id', + name: 'jtChannelEditUpdate', + component: jtChannelEdit, + }, + { + path: '/jtChannelEdit/:terminalDbId/', + name: 'jtChannelEditAdd', + component: jtChannelEdit, + }, { path: '/parentPlatformList/:count/:page', name: 'parentPlatformList',