diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSetmonitorthresholdvalueController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSetmonitorthresholdvalueController.java index 29aa5a2..ff3b7b9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSetmonitorthresholdvalueController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TSetmonitorthresholdvalueController.java @@ -25,14 +25,13 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 仪阈值设置信息Controller - * + * * @author wenjy * @date 2021-01-28 */ @Controller @RequestMapping("/system/SetMonitorThresholdValue") -public class TSetmonitorthresholdvalueController extends BaseController -{ +public class TSetmonitorthresholdvalueController extends BaseController { private String prefix = "system/SetMonitorThresholdValue"; @Autowired @@ -43,10 +42,9 @@ public class TSetmonitorthresholdvalueController extends BaseController @RequiresPermissions("system:SetMonitorThresholdValue:view") @GetMapping() - public String SetMonitorThresholdValue(@RequestParam("id") int id) - { + public String SetMonitorThresholdValue(@RequestParam("id") int id) { String url = ""; - switch (id){ + switch (id) { case 2: url = "/SetMonitorThresholdValueDnb"; break; @@ -78,30 +76,43 @@ public class TSetmonitorthresholdvalueController extends BaseController @RequiresPermissions("system:SetMonitorThresholdValue:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) - { + public TableDataInfo list(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) { startPage(); List list = new ArrayList<>(); - if(StringUtils.isNotEmpty(tSetmonitorthresholdvalue.getMonitorId())){ + if (StringUtils.isNotEmpty(tSetmonitorthresholdvalue.getMonitorId())) { T_Monitor t_monitor = new T_Monitor(); t_monitor.setMonitorId(tSetmonitorthresholdvalue.getMonitorId()); T_Monitor monitor = monitorService.selectT_MonitorList(t_monitor).get(0); - switch (monitor.getGrade()){ + switch (monitor.getGrade()) { case 2: - list = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(new TSetmonitorthresholdvalueDTO(null,tSetmonitorthresholdvalue.getMonitorId(),tSetmonitorthresholdvalue.getDeleted())); + list = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(new TSetmonitorthresholdvalueDTO(null, tSetmonitorthresholdvalue.getMonitorId(), tSetmonitorthresholdvalue.getDeleted())); break; case 3: - list = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(new TSetmonitorthresholdvalueDTO(tSetmonitorthresholdvalue.getMonitorId(),null,tSetmonitorthresholdvalue.getDeleted())); + list = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(new TSetmonitorthresholdvalueDTO(tSetmonitorthresholdvalue.getMonitorId(), null, tSetmonitorthresholdvalue.getDeleted())); break; default: break; } - return getDataTable(list); + } else { + TSetmonitorthresholdvalueDTO tSetmonitorthresholdvalueDTO = new TSetmonitorthresholdvalueDTO(); + tSetmonitorthresholdvalueDTO.setMonitorType(tSetmonitorthresholdvalue.getMonitorType()); + tSetmonitorthresholdvalueDTO.setDeleted(tSetmonitorthresholdvalue.getDeleted()); + list = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(tSetmonitorthresholdvalueDTO); } - TSetmonitorthresholdvalueDTO tSetmonitorthresholdvalueDTO = new TSetmonitorthresholdvalueDTO(); - tSetmonitorthresholdvalueDTO.setMonitorType(tSetmonitorthresholdvalue.getMonitorType()); - tSetmonitorthresholdvalueDTO.setDeleted(tSetmonitorthresholdvalue.getDeleted()); - return getDataTable(tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(tSetmonitorthresholdvalueDTO)); + for (int i = 0; i < list.size(); i++) { + TSetmonitorthresholdvalueDTO dto = list.get(i); + if (StringUtils.isNull(dto.getObjId())) { + tSetmonitorthresholdvalueService.insertTSetmonitorthresholdvalue(new TSetmonitorthresholdvalue(tSetmonitorthresholdvalue.getMonitorId(), tSetmonitorthresholdvalue.getMonitorType())); + TSetmonitorthresholdvalueDTO selectDto = new TSetmonitorthresholdvalueDTO(); + selectDto.setMonitorId(tSetmonitorthresholdvalue.getMonitorId()); + selectDto.setMonitorType(tSetmonitorthresholdvalue.getMonitorType()); + List dtoList = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueDTOList(selectDto); + if (!dtoList.isEmpty()) { + list.set(i, dtoList.get(0)); + } + } + } + return getDataTable(list); } /** @@ -111,8 +122,7 @@ public class TSetmonitorthresholdvalueController extends BaseController @Log(title = "仪阈值设置信息", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) - { + public AjaxResult export(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) { List list = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueList(tSetmonitorthresholdvalue); ExcelUtil util = new ExcelUtil(TSetmonitorthresholdvalue.class); return util.exportExcel(list, "SetMonitorThresholdValue"); @@ -122,8 +132,7 @@ public class TSetmonitorthresholdvalueController extends BaseController * 新增仪阈值设置信息 */ @GetMapping("/add") - public String add() - { + public String add() { return prefix + "/add"; } @@ -134,8 +143,7 @@ public class TSetmonitorthresholdvalueController extends BaseController @Log(title = "仪阈值设置信息", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) - { + public AjaxResult addSave(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) { return toAjax(tSetmonitorthresholdvalueService.insertTSetmonitorthresholdvalue(tSetmonitorthresholdvalue)); } @@ -143,23 +151,22 @@ public class TSetmonitorthresholdvalueController extends BaseController * 修改仪阈值设置信息 */ @GetMapping("/edit/{objId}") - public String edit(@PathVariable("objId") Long objId, ModelMap mmap) - { + public String edit(@PathVariable("objId") Long objId, ModelMap mmap) { String url = ""; TSetmonitorthresholdvalue tSetmonitorthresholdvalue = tSetmonitorthresholdvalueService.selectTSetmonitorthresholdvalueById(objId); mmap.put("tSetmonitorthresholdvalue", tSetmonitorthresholdvalue); - switch (tSetmonitorthresholdvalue.getMonitorType()){ + switch (tSetmonitorthresholdvalue.getMonitorType()) { case 2: - url ="/Dnbedit"; + url = "/Dnbedit"; break; case 16: - url ="/Tempedit"; + url = "/Tempedit"; break; case 20: - url ="/VibrationEdit"; + url = "/VibrationEdit"; break; case 30: - url ="/ArrayEdit"; + url = "/ArrayEdit"; break; } return prefix + url; @@ -172,8 +179,7 @@ public class TSetmonitorthresholdvalueController extends BaseController @Log(title = "仪阈值设置信息", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) - { + public AjaxResult editSave(TSetmonitorthresholdvalue tSetmonitorthresholdvalue) { tSetmonitorthresholdvalue.setUpdateBy(ShiroUtils.getSysUser().getUserName()); tSetmonitorthresholdvalue.setUpdateTime(new Date()); return toAjax(tSetmonitorthresholdvalueService.updateTSetmonitorthresholdvalue(tSetmonitorthresholdvalue)); @@ -184,10 +190,9 @@ public class TSetmonitorthresholdvalueController extends BaseController */ @RequiresPermissions("system:SetMonitorThresholdValue:remove") @Log(title = "仪阈值设置信息", businessType = BusinessType.DELETE) - @PostMapping( "/remove") + @PostMapping("/remove") @ResponseBody - public AjaxResult remove(String ids) - { + public AjaxResult remove(String ids) { return toAjax(tSetmonitorthresholdvalueService.deleteTSetmonitorthresholdvalueByIds(ids)); } } diff --git a/ruoyi-admin/src/main/resources/templates/system/SetMonitorThresholdValue/SetMonitorThresholdValueVibration.html b/ruoyi-admin/src/main/resources/templates/system/SetMonitorThresholdValue/SetMonitorThresholdValueVibration.html new file mode 100644 index 0000000..5e8ad0a --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/SetMonitorThresholdValue/SetMonitorThresholdValueVibration.html @@ -0,0 +1,323 @@ + + + + + + + + + + +
+
+
+
+ 测控点信息 +
+
+ + + + +
+ +
+
+
+
+
+
+ +
+
+
+
+
+ + +
+ +
+
+
+ + +
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/SetMonitorThresholdValue/VibrationEdit.html b/ruoyi-admin/src/main/resources/templates/system/SetMonitorThresholdValue/VibrationEdit.html new file mode 100644 index 0000000..0857527 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/SetMonitorThresholdValue/VibrationEdit.html @@ -0,0 +1,191 @@ + + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/TSetmonitorthresholdvalueMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TSetmonitorthresholdvalueMapper.xml index ee5a0ff..b47063d 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TSetmonitorthresholdvalueMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TSetmonitorthresholdvalueMapper.xml @@ -116,7 +116,39 @@ - select t2.*, t1.p_monitorId, t1.monitorName + select t2.objId, + t2.temperatureMax, + t2.tMaxIdea, + t2.temperatureMin, + t2.tMinIdea, + t2.humidityMax, + t2.hMaxIdea, + t2.humidityMin, + t2.hMinIdea, + t2.illuminanceMax, + t2.iMaxIdea, + t2.illuminanceMin, + t2.iMinIdea, + t2.iAMax, + t2.iAMin, + t2.iBMax, + t2.iBMin, + t2.iCMax, + t2.iCMin, + t2.vAMax, + t2.vAMin, + t2.vBMax, + t2.vBMin, + t2.vCMax, + t2.vCMin, + t2.create_by, + t2.create_time, + t2.update_by, + t2.update_time, + t2.monitorType, + t2.deleted, + t1.monitorId, + t1.monitorName from T_Monitor t1 left join T_SetMonitorThresholdValue t2 on t1.monitorId = t2.monitorId @@ -138,7 +170,6 @@ and (t1.monitorId = #{p_monitor} or t1.p_monitorId = #{p_monitor}) and t2.monitorType = #{monitorType} and t2.deleted = #{deleted} -