diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java index 7e8c8de..1761c36 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.base; import java.util.Date; import java.util.List; +import java.util.UUID; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.domain.dto.BaseMonitorunitInfoDto; @@ -128,6 +129,7 @@ public class BaseMonitorunitInfoController extends BaseController @ResponseBody public AjaxResult addSave(BaseMonitorunitInfo baseMonitorunitInfo) { + baseMonitorunitInfo.setMonitorunitId(UUID.randomUUID().toString()); baseMonitorunitInfo.setCreateBy(ShiroUtils.getLoginName()); baseMonitorunitInfo.setCreateTime(new Date()); return toAjax(baseMonitorunitInfoService.insertBaseMonitorunitInfo(baseMonitorunitInfo)); @@ -174,11 +176,12 @@ public class BaseMonitorunitInfoController extends BaseController * 选择监控单元信息树 */ @GetMapping(value = { "/selectMonitorUnitInfoTree/{ObjId}", "/selectMonitorUnitInfoTree/" }) - public String selectMonitorUnitInfoTree(@PathVariable(value = "ObjId", required = false) Long ObjId, ModelMap mmap) + public String selectMonitorUnitInfoTree(@PathVariable(value = "ObjId", required = false) String ObjId, ModelMap mmap) { if (StringUtils.isNotNull(ObjId)) { - mmap.put("baseMonitorunitInfo", baseMonitorunitInfoService.selectBaseMonitorunitInfoByObjId(ObjId)); + /*mmap.put("baseMonitorunitInfo", baseMonitorunitInfoService.selectBaseMonitorunitInfoByObjId(ObjId));*/ + mmap.put("baseMonitorunitInfo",baseMonitorunitInfoService.selectBaseMonitorunitInfoList(new BaseMonitorunitInfo(ObjId)).get(0)); } return prefix + "/tree"; } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index abaf8f6..ed3ae52 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,12 +6,12 @@ spring: druid: # 主库数据源 master: -# url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 -# username: root -# password: Haiwei123456 - url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: root + password: Haiwei123456 +# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# username: root +# password: root # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 0c4df2b..d338a92 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -73,7 +73,7 @@ spring: redis: port: 6379 password: admin123 - host: 127.0.0.1 + host: 121.36.58.109 jedis: pool: max-active: 8 diff --git a/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html b/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html index 15c1933..becb988 100644 --- a/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/monitorUnitInfo/add.html @@ -8,20 +8,20 @@
-
+
- +
- +
@@ -31,7 +31,7 @@
- +