设备传感器指标最大最小值设置

This commit is contained in:
sxu 2025-06-18 17:06:02 +08:00
parent 82b3bf8fea
commit 2e8e200963
5 changed files with 27 additions and 3 deletions

View File

@ -9,14 +9,11 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.bonus.common.log.annotation.SysLog; 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.domain.KitchenDeviceSensorMetric;
import com.bonus.canteen.core.kitchen.service.IKitchenDeviceSensorMetricService; import com.bonus.canteen.core.kitchen.service.IKitchenDeviceSensorMetricService;
import com.bonus.common.core.web.controller.BaseController; 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));
}
/** /**
* 删除厨房设备衡量指标设置 * 删除厨房设备衡量指标设置
*/ */

View File

@ -51,6 +51,8 @@ public interface KitchenDeviceSensorMetricMapper {
*/ */
public int updateKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric); public int updateKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric);
public int rollbackKitchenDeviceSensorMetricByMeasureIds(Long[] measureIds);
/** /**
* 删除厨房设备衡量指标设置 * 删除厨房设备衡量指标设置
* *

View File

@ -46,6 +46,8 @@ public interface IKitchenDeviceSensorMetricService {
public int batchUpdateKitchenDeviceSensorMetric(List<KitchenDeviceSensorMetric> list); public int batchUpdateKitchenDeviceSensorMetric(List<KitchenDeviceSensorMetric> list);
public int rollbackKitchenDeviceSensorMetricByMeasureIds(Long[] measureIds);
/** /**
* 批量删除厨房设备衡量指标设置 * 批量删除厨房设备衡量指标设置
* *

View File

@ -107,6 +107,11 @@ public class KitchenDeviceSensorMetricServiceImpl implements IKitchenDeviceSenso
} }
} }
@Override
public int rollbackKitchenDeviceSensorMetricByMeasureIds(Long[] measureIds) {
return kitchenDeviceSensorMetricMapper.rollbackKitchenDeviceSensorMetricByMeasureIds(measureIds);
}
/** /**
* 批量删除厨房设备衡量指标设置 * 批量删除厨房设备衡量指标设置
* *

View File

@ -95,6 +95,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where measure_id = #{measureId} where measure_id = #{measureId}
</update> </update>
<update id="rollbackKitchenDeviceSensorMetricByMeasureIds" parameterType="String">
update kitchen_device_sensor_metric
set measure_min_value = default_min_value, measure_max_value = default_max_value
where measure_id in
<foreach item="measureId" collection="array" open="(" separator="," close=")">
#{measureId}
</foreach>
</update>
<delete id="deleteKitchenDeviceSensorMetricByMeasureId" parameterType="Long"> <delete id="deleteKitchenDeviceSensorMetricByMeasureId" parameterType="Long">
delete from kitchen_device_sensor_metric where measure_id = #{measureId} delete from kitchen_device_sensor_metric where measure_id = #{measureId}
</delete> </delete>