From 2e8e20096349ff6a9dc862fa9d3096f1f51a8aa0 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 18 Jun 2025 17:06:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E6=9C=80=E5=A4=A7=E6=9C=80=E5=B0=8F=E5=80=BC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KitchenDeviceSensorMetricController.java | 12 +++++++++--- .../mapper/KitchenDeviceSensorMetricMapper.java | 2 ++ .../service/IKitchenDeviceSensorMetricService.java | 2 ++ .../impl/KitchenDeviceSensorMetricServiceImpl.java | 5 +++++ .../kitchen/KitchenDeviceSensorMetricMapper.xml | 9 +++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceSensorMetricController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceSensorMetricController.java index 62bf9fb..eb8b28c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceSensorMetricController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceSensorMetricController.java @@ -9,14 +9,11 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.bonus.common.log.annotation.SysLog; -import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.canteen.core.kitchen.domain.KitchenDeviceSensorMetric; import com.bonus.canteen.core.kitchen.service.IKitchenDeviceSensorMetricService; import com.bonus.common.core.web.controller.BaseController; @@ -131,6 +128,15 @@ public class KitchenDeviceSensorMetricController extends BaseController { } } + @ApiOperation(value = "批量回滚厨房设备衡量指标设置") + //@PreventRepeatSubmit + //@RequiresPermissions("kitchen:metric:remove") + @SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.DELETE, logType = 1,module = "厨房管理->批量回滚厨房设备衡量指标设置") + @PostMapping("/rollback/{measureIds}") + public AjaxResult rollback(@PathVariable Long[] measureIds) { + return toAjax(kitchenDeviceSensorMetricService.rollbackKitchenDeviceSensorMetricByMeasureIds(measureIds)); + } + /** * 删除厨房设备衡量指标设置 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceSensorMetricMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceSensorMetricMapper.java index 9e7e19a..0b30add 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceSensorMetricMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceSensorMetricMapper.java @@ -51,6 +51,8 @@ public interface KitchenDeviceSensorMetricMapper { */ public int updateKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric); + public int rollbackKitchenDeviceSensorMetricByMeasureIds(Long[] measureIds); + /** * 删除厨房设备衡量指标设置 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceSensorMetricService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceSensorMetricService.java index 9652fa8..c915923 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceSensorMetricService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceSensorMetricService.java @@ -46,6 +46,8 @@ public interface IKitchenDeviceSensorMetricService { public int batchUpdateKitchenDeviceSensorMetric(List list); + public int rollbackKitchenDeviceSensorMetricByMeasureIds(Long[] measureIds); + /** * 批量删除厨房设备衡量指标设置 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceSensorMetricServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceSensorMetricServiceImpl.java index 5cc6727..0c318a8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceSensorMetricServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceSensorMetricServiceImpl.java @@ -107,6 +107,11 @@ public class KitchenDeviceSensorMetricServiceImpl implements IKitchenDeviceSenso } } + @Override + public int rollbackKitchenDeviceSensorMetricByMeasureIds(Long[] measureIds) { + return kitchenDeviceSensorMetricMapper.rollbackKitchenDeviceSensorMetricByMeasureIds(measureIds); + } + /** * 批量删除厨房设备衡量指标设置 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceSensorMetricMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceSensorMetricMapper.xml index ce56053..4f4a4ff 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceSensorMetricMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceSensorMetricMapper.xml @@ -95,6 +95,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where measure_id = #{measureId} + + update kitchen_device_sensor_metric + set measure_min_value = default_min_value, measure_max_value = default_max_value + where measure_id in + + #{measureId} + + + delete from kitchen_device_sensor_metric where measure_id = #{measureId}