From 3b0516a2959e25576e4f3fda697a3b025d06c8c9 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 24 六月 2025 14:09:07 +0800 Subject: [PATCH] 每日录像可用指标添加日志,修改大屏为查看当前月平均 --- ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java | 39 ++++++++++++++++++++++++++------------- 1 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java index 8f6248c..21359bf 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java @@ -1,8 +1,11 @@ package com.ycl.platform.controller; import annotation.Log; +import com.ycl.exception.job.TaskException; import com.ycl.platform.domain.entity.CheckTemplate; +import com.ycl.platform.domain.entity.CheckTemplateRule; import com.ycl.platform.domain.query.CheckTemplateQuery; +import com.ycl.platform.service.ICheckTemplateRuleService; import com.ycl.platform.service.ICheckTemplateService; import com.ycl.system.AjaxResult; import com.ycl.system.Result; @@ -10,6 +13,7 @@ import com.ycl.system.page.TableDataInfo; import enumeration.BusinessType; import io.swagger.annotations.ApiOperation; +import org.quartz.SchedulerException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -30,6 +34,8 @@ @Autowired private ICheckTemplateService checkTemplateService; + @Autowired + private ICheckTemplateRuleService checkTemplateRuleService; /** * 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */ @@ -57,10 +63,9 @@ * 鏂板鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:add')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.INSERT) + @Log(title = "鏂板鑰冩牳妯℃澘", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody @Validated CheckTemplateQuery checkTemplateDTO) - { + public AjaxResult add(@RequestBody @Validated CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { return toAjax(checkTemplateService.insertCheckTemplate(checkTemplateDTO)); } @@ -69,10 +74,9 @@ * 澶嶅埗鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:copy')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.INSERT) + @Log(title = "澶嶅埗鑰冩牳妯℃澘", businessType = BusinessType.INSERT) @PostMapping("/copy") - public AjaxResult copy(@RequestBody CheckTemplateQuery checkTemplateDTO) - { + public AjaxResult copy(@RequestBody CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { return toAjax(checkTemplateService.copyCheckTemplate(checkTemplateDTO)); } @@ -80,21 +84,30 @@ * 淇敼鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:edit')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.UPDATE) + @Log(title = "淇敼鑰冩牳妯℃澘", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody CheckTemplateQuery checkTemplateDTO) - { - return toAjax(checkTemplateService.updateCheckTemplate(checkTemplateDTO)); + public AjaxResult edit(@RequestBody CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { + return checkTemplateService.updateCheckTemplate(checkTemplateDTO); } + /** + * 淇敼鑰冩牳妯℃澘鏉冮噸 + */ + @PreAuthorize("@ss.hasPermi('check:template:edit')") + @Log(title = "淇敼鑰冩牳妯℃澘鏉冮噸", businessType = BusinessType.UPDATE) + @PutMapping("/weight") + public AjaxResult editWeight(@RequestBody CheckTemplateRule checkTemplateRule) + { + + return toAjax(checkTemplateRuleService.updateCheckTemplateRule(checkTemplateRule)); + } /** * 鍒犻櫎鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:remove')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.DELETE) + @Log(title = "鍒犻櫎鑰冩牳妯℃澘", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") - public AjaxResult remove(@PathVariable String id) - { + public AjaxResult remove(@PathVariable String id) throws SchedulerException { return toAjax(checkTemplateService.deleteCheckTemplateById(Integer.parseInt(id))); } -- Gitblit v1.8.0