From 1050a759d47d8d0087bd5b9241db04890d5f542a Mon Sep 17 00:00:00 2001
From: jjLv <1981429112@qq.com>
Date: Wed, 30 Apr 2025 17:17:54 +0800
Subject: [PATCH 01/11] =?UTF-8?q?=E5=8F=8C=E5=B1=8F=E6=B6=88=E8=B4=B9?=
=?UTF-8?q?=E6=9C=BA=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E3=80=81=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/ParamSettingController.java | 42 +++++++++++++++++++
.../device/mapper/ParamSettingMapper.java | 9 ++++
.../device/service/ParamSettingService.java | 9 ++++
.../service/impl/ParamSettingServiceImpl.java | 22 ++++++++++
.../core/device/vo/ParamSettingVO.java | 37 ++++++++++++++++
.../mapper/device/ParamSettingMapper.xml | 33 +++++++++++++++
6 files changed, 152 insertions(+)
create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/ParamSettingController.java
create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/mapper/ParamSettingMapper.java
create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/ParamSettingService.java
create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/impl/ParamSettingServiceImpl.java
create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/vo/ParamSettingVO.java
create mode 100644 bonus-modules/bonus-smart-canteen/src/main/resources/mapper/device/ParamSettingMapper.xml
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/ParamSettingController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/ParamSettingController.java
new file mode 100644
index 0000000..f425356
--- /dev/null
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/controller/ParamSettingController.java
@@ -0,0 +1,42 @@
+package com.bonus.canteen.core.device.controller;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.db.handler.StringHandler;
+import com.bonus.canteen.core.device.service.ParamSettingService;
+import com.bonus.canteen.core.device.vo.ParamSettingVO;
+import com.bonus.common.core.exception.ServiceException;
+import com.bonus.common.core.web.controller.BaseController;
+import com.bonus.common.core.web.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.codehaus.groovy.tools.StringHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+@Api(tags = "后台-参数设置")
+@RestController
+@RequestMapping("/paramSetting")
+public class ParamSettingController extends BaseController {
+
+ @Autowired
+ private ParamSettingService service;
+
+ @ApiOperation("更新参数设置")
+ @PostMapping({"/update"})
+ public AjaxResult updateDevice(@RequestBody @Valid ParamSettingVO dto) {
+ if (ObjectUtil.isNull(dto.getId()) || ObjectUtil.isEmpty(dto.getId())){
+ throw new ServiceException("参数id不能为空");
+ }
+ this.service.update(dto);
+ return AjaxResult.success();
+ }
+
+ @ApiOperation(value = "获取参数")
+ @PostMapping(value = "/getInfo")
+ public AjaxResult getInfo() {
+ return success(service.getInfo());
+ }
+
+}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/mapper/ParamSettingMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/mapper/ParamSettingMapper.java
new file mode 100644
index 0000000..9187fcb
--- /dev/null
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/mapper/ParamSettingMapper.java
@@ -0,0 +1,9 @@
+package com.bonus.canteen.core.device.mapper;
+
+import com.bonus.canteen.core.device.vo.ParamSettingVO;
+
+public interface ParamSettingMapper {
+ void update(ParamSettingVO dto);
+
+ ParamSettingVO getInfo();
+}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/ParamSettingService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/ParamSettingService.java
new file mode 100644
index 0000000..240648d
--- /dev/null
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/ParamSettingService.java
@@ -0,0 +1,9 @@
+package com.bonus.canteen.core.device.service;
+
+import com.bonus.canteen.core.device.vo.ParamSettingVO;
+
+public interface ParamSettingService {
+ void update(ParamSettingVO dto);
+
+ ParamSettingVO getInfo();
+}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/impl/ParamSettingServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/impl/ParamSettingServiceImpl.java
new file mode 100644
index 0000000..7e9d2fa
--- /dev/null
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/service/impl/ParamSettingServiceImpl.java
@@ -0,0 +1,22 @@
+package com.bonus.canteen.core.device.service.impl;
+
+import com.bonus.canteen.core.device.mapper.ParamSettingMapper;
+import com.bonus.canteen.core.device.service.ParamSettingService;
+import com.bonus.canteen.core.device.vo.ParamSettingVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ParamSettingServiceImpl implements ParamSettingService {
+ @Autowired
+ private ParamSettingMapper mapper;
+ @Override
+ public void update(ParamSettingVO dto) {
+ mapper.update(dto);
+ }
+
+ @Override
+ public ParamSettingVO getInfo() {
+ return mapper.getInfo();
+ }
+}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/vo/ParamSettingVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/vo/ParamSettingVO.java
new file mode 100644
index 0000000..df01239
--- /dev/null
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/device/vo/ParamSettingVO.java
@@ -0,0 +1,37 @@
+package com.bonus.canteen.core.device.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.hibernate.validator.constraints.NotBlank;
+
+@Data
+public class ParamSettingVO {
+ @ApiModelProperty("参数id")
+ private Integer id;
+ @ApiModelProperty("IP地址")
+ @NotBlank(message = "IP地址不能为空")
+ private String ipAddress;
+ @ApiModelProperty("人脸识别通过率")
+ @NotBlank(message = "人脸识别通过率不能为空")
+ private String facePassRate;
+ @ApiModelProperty("MQTT地址")
+ @NotBlank(message = "MQTT地址不能为空")
+ private String mqttAddress;
+ @ApiModelProperty("MQTT用户名")
+ @NotBlank(message = "MQTT用户名不能为空")
+ private String mqttUserName;
+ @ApiModelProperty("MQTT密码")
+ @NotBlank(message = "MQTT密码不能为空")
+ private String mqttPassword;
+ @ApiModelProperty("APP_ID")
+ @NotBlank(message = "人脸引擎APP_ID不能为空")
+ private String appId;
+ @ApiModelProperty("APP_KEY")
+ @NotBlank(message = "人脸引擎APP_KEY不能为空")
+ private String appKey;
+ @ApiModelProperty("PHOTO_PREFIXES")
+ @NotBlank(message = "照片前缀不能为空")
+ private String photoPrefixes;
+ @ApiModelProperty("version")
+ private String version;
+}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/device/ParamSettingMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/device/ParamSettingMapper.xml
new file mode 100644
index 0000000..e93de56
--- /dev/null
+++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/device/ParamSettingMapper.xml
@@ -0,0 +1,33 @@
+
+
+
+
+ update param_setting
+ set ip_address = #{ipAddress},
+ face_pass_rate = #{facePassRate},
+ mqtt_address = #{mqttAddress},
+ mqtt_user_name = #{mqttUserName},
+ mqtt_pass_word = #{mqttPassword},
+ app_id = #{appId},
+ app_key = #{appKey},
+ photo_prefixes = #{photoPrefixes},
+ version = #{version} + 1
+ where id = #{id}
+
+
+
From 4873c9107b95b5cc465e08e0c644d42703635e92 Mon Sep 17 00:00:00 2001
From: sxu <602087911@qq.com>
Date: Mon, 5 May 2025 11:22:18 +0800
Subject: [PATCH 02/11] =?UTF-8?q?=E9=A3=9F=E5=A0=82=E5=90=AB=E6=A1=A3?=
=?UTF-8?q?=E5=8F=A3=E4=B8=8D=E8=83=BD=E5=88=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../canteen/core/alloc/mapper/AllocStallMapper.java | 2 ++
.../core/alloc/service/impl/AllocCanteenServiceImpl.java | 7 +++++++
.../src/main/resources/mapper/alloc/AllocStallMapper.xml | 9 +++++++++
3 files changed, 18 insertions(+)
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocStallMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocStallMapper.java
index 922d0b4..7a42ef1 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocStallMapper.java
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocStallMapper.java
@@ -62,6 +62,8 @@ public interface AllocStallMapper {
*/
public int deleteAllocStallByStallIds(Long[] stallIds);
+ public int selectAllocStallCountByCanteenIds(Long[] canteenIds);
+
public int deleteMealtimeByStallId(Long stallId);
public List selectMealtimeByStallId(Long stallId);
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java
index 40a912d..51dd96b 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bonus.canteen.core.alloc.domain.*;
import com.bonus.canteen.core.alloc.mapper.AllocCanteenMapper;
+import com.bonus.canteen.core.alloc.mapper.AllocStallMapper;
import com.bonus.canteen.core.utils.BnsConstants;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
@@ -28,6 +29,8 @@ import com.bonus.canteen.core.alloc.service.IAllocCanteenService;
public class AllocCanteenServiceImpl implements IAllocCanteenService {
@Autowired
private AllocCanteenMapper allocCanteenMapper;
+ @Autowired
+ private AllocStallMapper allocStallMapper;
/**
* 查询食堂信息
@@ -103,6 +106,10 @@ public class AllocCanteenServiceImpl implements IAllocCanteenService {
*/
@Override
public int deleteAllocCanteenByCanteenIds(Long[] canteenIds) {
+ int count = allocStallMapper.selectAllocStallCountByCanteenIds(canteenIds);
+ if (count > 0) {
+ throw new ServiceException("食堂含有档口信息,不能删除");
+ }
return allocCanteenMapper.deleteAllocCanteenByCanteenIds(canteenIds);
}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml
index 0c9da8d..15d181b 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml
+++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml
@@ -191,6 +191,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
delete from alloc_stall_mealtime where stall_id = #{stallId}
From 8322745260bddc7104e9ed4e44cbc81070b6735c Mon Sep 17 00:00:00 2001
From: sxu <602087911@qq.com>
Date: Mon, 5 May 2025 11:32:05 +0800
Subject: [PATCH 03/11] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=90=AB=E9=A3=9F?=
=?UTF-8?q?=E5=A0=82=E4=B8=8D=E8=83=BD=E5=88=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../canteen/core/alloc/mapper/AllocCanteenMapper.java | 2 ++
.../core/alloc/service/impl/AllocAreaServiceImpl.java | 8 ++++++++
.../main/resources/mapper/alloc/AllocCanteenMapper.xml | 9 +++++++++
.../src/main/resources/mapper/alloc/AllocStallMapper.xml | 2 +-
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenMapper.java
index 40ba2b6..daa92bc 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenMapper.java
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/mapper/AllocCanteenMapper.java
@@ -59,4 +59,6 @@ public interface AllocCanteenMapper {
* @return 结果
*/
public int deleteAllocCanteenByCanteenIds(Long[] canteenIds);
+
+ public int selectAllocCanteenCountByAreaIds(Long[] areaIds);
}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java
index ba220b8..4b147cc 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java
+++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocAreaServiceImpl.java
@@ -5,6 +5,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
+
+import com.bonus.canteen.core.alloc.mapper.AllocCanteenMapper;
import com.bonus.canteen.core.common.domain.TreeSelect;
import com.bonus.canteen.core.alloc.mapper.AllocAreaMapper;
import com.bonus.common.core.exception.ServiceException;
@@ -25,6 +27,8 @@ import com.bonus.canteen.core.alloc.service.IAllocAreaService;
public class AllocAreaServiceImpl implements IAllocAreaService {
@Autowired
private AllocAreaMapper allocAreaMapper;
+ @Autowired
+ private AllocCanteenMapper allocCanteenMapper;
@Override
public List selectAreaTreeList(AllocArea area) {
@@ -104,6 +108,10 @@ public class AllocAreaServiceImpl implements IAllocAreaService {
*/
@Override
public int deleteAllocAreaByAreaIds(Long[] areaIds) {
+ int count = allocCanteenMapper.selectAllocCanteenCountByAreaIds(areaIds);
+ if (count > 0) {
+ throw new ServiceException("区域含有食堂信息,不能删除");
+ }
return allocAreaMapper.deleteAllocAreaByAreaIds(areaIds);
}
diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenMapper.xml
index 81b7277..4fb3f70 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenMapper.xml
+++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenMapper.xml
@@ -172,4 +172,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{canteenId}
+
+
diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml
index 15d181b..f32277d 100644
--- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml
+++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocStallMapper.xml
@@ -194,7 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-
+
+
+