From 3d929972d9841230b63614016155da1e41f3ddd5 Mon Sep 17 00:00:00 2001 From: liux <963924687@qq.com> Date: Thu, 19 Jun 2025 11:06:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B=E3=80=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AE=BE=E5=A4=87=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E5=92=8C=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../houqin/constant/DeviceTypeEnum.java | 12 +++++++ .../KitchenDeviceInfoController.java | 23 +++++++++++- .../controller/KitchenHomePageController.java | 17 +++++++-- .../core/kitchen/dto/IndexHomePageDTO.java | 20 +++++++++++ .../kitchen/dto/KitchenDeviceListDTO.java | 2 +- .../mapper/KitchenDeviceInfoMapper.java | 2 ++ .../service/IKitchenDeviceInfoService.java | 5 +++ .../service/IKitchenHomePageService.java | 3 ++ .../impl/KitchenDeviceInfoServiceImpl.java | 32 ++++++++++++++++- .../impl/KitchenHomePageerviceImpl.java | 16 +++++++++ .../impl/KitchenStaffInfoServiceImpl.java | 14 ++++---- .../core/kitchen/vo/IndexAlarmLogCountVO.java | 21 +++++++++++ .../kitchen/vo/IndexDeviceStatusCountVO.java | 19 ++++++++++ .../kitchen/vo/IndexEmployeeViolationVO.java | 21 +++++++++++ .../kitchen/vo/IndexEnvironmentaAlarm.java | 20 +++++++++++ .../kitchen/vo/IndexEnvironmentalWarning.java | 22 ++++++++++++ .../vo/IndexHealthCertificateCountVO.java | 20 +++++++++++ .../vo/IndexHomePageInformationVO.java | 36 +++++++++++++++++++ .../kitchen/vo/IndexSampleRetentionCount.java | 19 ++++++++++ .../kitchen/KitchenDeviceInfoMapper.xml | 25 +++++++++++++ .../kitchen/KitchenDeviceUsageMapper.xml | 11 +++--- 21 files changed, 342 insertions(+), 18 deletions(-) create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/IndexHomePageDTO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexAlarmLogCountVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexDeviceStatusCountVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEmployeeViolationVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentaAlarm.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentalWarning.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHealthCertificateCountVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHomePageInformationVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexSampleRetentionCount.java diff --git a/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DeviceTypeEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DeviceTypeEnum.java index 2e62d96..ad1c511 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DeviceTypeEnum.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/houqin/constant/DeviceTypeEnum.java @@ -2,6 +2,10 @@ package com.bonus.common.houqin.constant; import lombok.Generated; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public enum DeviceTypeEnum { OTHER(0, "其他"), CAMERA(1, "摄像头"), @@ -48,6 +52,14 @@ public enum DeviceTypeEnum { this.value = value; } + public static Map toMap() { + return Stream.of(DeviceTypeEnum.values()) + .collect(Collectors.toMap( + DeviceTypeEnum::getKey, + DeviceTypeEnum::getValue + )); + } + public Integer getKey() { return this.key; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceInfoController.java index 80e3a79..df3feab 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenDeviceInfoController.java @@ -45,7 +45,6 @@ public class KitchenDeviceInfoController extends BaseController { * 查询厨房设备基础信息列表 */ @ApiOperation(value = "查询厨房设备基础信息列表") - //@RequiresPermissions("kitchen:info:list") @GetMapping("/list") public TableDataInfo list(KitchenDeviceListDTO kitchenDeviceInfo) { startPage(); @@ -53,6 +52,28 @@ public class KitchenDeviceInfoController extends BaseController { return getDataTable(list); } + @ApiOperation(value = "查询厨房设备基础信息列表") + @GetMapping("/select") + public AjaxResult select(KitchenDeviceListDTO kitchenDeviceInfo) { + try{ + List list = kitchenDeviceInfoService.selectKitchenDeviceInfoSelect(kitchenDeviceInfo); + return success(list); + }catch (Exception e) { + return error(e.getMessage()); + } + } + + @ApiOperation(value = "查询厨房设备基础信息列表") + //@RequiresPermissions("kitchen:info:list") + @GetMapping("/deviceType") + public AjaxResult deviceType() { + try{ + return success(kitchenDeviceInfoService.deviceType()); + }catch (Exception e) { + return error(e.getMessage()); + } + } + /** * 导出厨房设备基础信息列表 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenHomePageController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenHomePageController.java index fb82b03..0b7a1b6 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenHomePageController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/controller/KitchenHomePageController.java @@ -1,13 +1,18 @@ package com.bonus.canteen.core.kitchen.controller; +import com.bonus.canteen.core.kitchen.dto.IndexHomePageDTO; import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO; +import com.bonus.canteen.core.kitchen.service.IKitchenHomePageService; +import com.bonus.canteen.core.kitchen.vo.IndexHomePageInformationVO; import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO; import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.page.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.List; /** @@ -21,13 +26,19 @@ import java.util.List; @RequestMapping("/kitchen_home_page") public class KitchenHomePageController extends BaseController { + @Resource + private IKitchenHomePageService kitchenHomePageService; @ApiOperation(value = "获取首页信息") - //@RequiresPermissions("kitchen:info:list") @GetMapping("/information") - public TableDataInfo list(KitchenDeviceListDTO kitchenDeviceInfo) { + public AjaxResult list(IndexHomePageDTO indexHomePageDTO) { + try { + IndexHomePageInformationVO indexHomePageInformationVO = kitchenHomePageService.getIndexHomePageInformation(indexHomePageDTO); + return success(indexHomePageInformationVO); + } catch (Exception e) { + return error(e.getMessage()); + } - return null; } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/IndexHomePageDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/IndexHomePageDTO.java new file mode 100644 index 0000000..d14fc17 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/IndexHomePageDTO.java @@ -0,0 +1,20 @@ +package com.bonus.canteen.core.kitchen.dto; + +import lombok.Data; +import lombok.ToString; + +import java.time.LocalDateTime; + +/** + * @author xliu + * @date 2025/6/18 17:51 + */ +@Data +@ToString +public class IndexHomePageDTO { + + private LocalDateTime startTime; // 当前时间 + + private LocalDateTime endTime; // 厨房名称 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/KitchenDeviceListDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/KitchenDeviceListDTO.java index fe7eedc..71d13f6 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/KitchenDeviceListDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/dto/KitchenDeviceListDTO.java @@ -40,7 +40,7 @@ public class KitchenDeviceListDTO { /** 设备类型(1-摄像头 2-传感器 3-门禁 4-仪表 5-仪器, 参考DeviceTypeEnum) */ @ApiModelProperty(value = "设备类型(1-摄像头 2-传感器 3-门禁 4-仪表 5-仪器, 参考DeviceTypeEnum)") - private Integer deviceType; + private Integer deviceType = 0; /** 设备类型 */ @ApiModelProperty(value = "设备类型") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceInfoMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceInfoMapper.java index ce3c8fe..c535dff 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceInfoMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/mapper/KitchenDeviceInfoMapper.java @@ -22,6 +22,8 @@ public interface KitchenDeviceInfoMapper extends BaseMapper { */ public KitchenDeviceListVO selectKitchenDeviceInfoByDeviceId(Long deviceId); + + public KitchenDeviceInfo selectKitchenDeviceInfoByDeviceIdk(Long deviceId); /** * 查询厨房设备基础信息列表 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceInfoService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceInfoService.java index 7c5cf85..0324d42 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceInfoService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenDeviceInfoService.java @@ -1,6 +1,7 @@ package com.bonus.canteen.core.kitchen.service; import java.util.List; +import java.util.Map; import com.baomidou.mybatisplus.extension.service.IService; import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo; @@ -61,4 +62,8 @@ public interface IKitchenDeviceInfoService extends IService { * @return 结果 */ public int deleteKitchenDeviceInfoByDeviceId(Long deviceId); + + List selectKitchenDeviceInfoSelect(KitchenDeviceListDTO kitchenDeviceInfo); + + Map deviceType(); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenHomePageService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenHomePageService.java index 555cd7d..14a3a4c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenHomePageService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/IKitchenHomePageService.java @@ -2,7 +2,9 @@ package com.bonus.canteen.core.kitchen.service; import com.baomidou.mybatisplus.extension.service.IService; import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo; +import com.bonus.canteen.core.kitchen.dto.IndexHomePageDTO; import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO; +import com.bonus.canteen.core.kitchen.vo.IndexHomePageInformationVO; import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO; import java.util.List; @@ -15,4 +17,5 @@ import java.util.List; */ public interface IKitchenHomePageService{ + IndexHomePageInformationVO getIndexHomePageInformation(IndexHomePageDTO indexHomePageDTO); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java index 8feeb5a..d7eb05a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java @@ -2,7 +2,8 @@ package com.bonus.canteen.core.kitchen.service.impl; import java.io.IOException; import java.net.InetAddress; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -11,6 +12,9 @@ import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO; import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.houqin.constant.DelFlagEnum; +import com.bonus.common.houqin.constant.DeviceTypeEnum; import org.hibernate.validator.internal.util.StringHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -196,4 +200,30 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpl selectKitchenDeviceInfoSelect(KitchenDeviceListDTO kitchenDeviceInfo) { + return kitchenDeviceInfoMapper.selectList( + Wrappers.lambdaQuery() + .like(StringUtils.isNotEmpty(kitchenDeviceInfo.getDeviceName()), KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName()) + .like(StringUtils.isNotEmpty(kitchenDeviceInfo.getDeviceNo()), KitchenDeviceInfo::getDeviceNo, kitchenDeviceInfo.getDeviceNo()) + .like(StringUtils.isNotEmpty(kitchenDeviceInfo.getDeviceSn()), KitchenDeviceInfo::getDeviceSn, kitchenDeviceInfo.getDeviceSn()) + .eq(kitchenDeviceInfo.getDeviceType() != 0, KitchenDeviceInfo::getDeviceType, kitchenDeviceInfo.getDeviceType()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_TRUE.key()) // 仅查询未删除的设备 + ); + } + + @Override + public Map deviceType() { + Map deviceMap = DeviceTypeEnum.toMap(); + String [] stringArray = new String[]{"摄像头","门禁","留样秤","留样柜","温湿度传感器","烟雾检测传感器","水表","电表","智能称重货架","智能厨余秤"}; + // 将 stringArray 转为 Set 便于快速查找 + Set validValues = new HashSet<>(Arrays.asList(stringArray)); + // 使用 Stream 过滤,只保留 value 存在于 validValues 中的条目 + Map filteredMap = deviceMap.entrySet().stream() + .filter(entry -> validValues.contains(entry.getValue())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + return filteredMap; + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java index b3b0f57..83b6cc4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java @@ -3,14 +3,17 @@ package com.bonus.canteen.core.kitchen.service.impl; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo; +import com.bonus.canteen.core.kitchen.dto.IndexHomePageDTO; import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO; import com.bonus.canteen.core.kitchen.mapper.KitchenDeviceInfoMapper; import com.bonus.canteen.core.kitchen.mapper.KitchenHomePageMapper; import com.bonus.canteen.core.kitchen.service.IKitchenDeviceInfoService; import com.bonus.canteen.core.kitchen.service.IKitchenHomePageService; +import com.bonus.canteen.core.kitchen.vo.IndexHomePageInformationVO; import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.houqin.constant.DelFlagEnum; import org.hibernate.validator.internal.util.StringHelper; import org.springframework.stereotype.Service; @@ -30,5 +33,18 @@ public class KitchenHomePageerviceImpl implements IKitchenHomePageService { @Resource private KitchenHomePageMapper kitchenHomePageMapper; + @Resource + private KitchenDeviceInfoMapper kitchenDeviceInfoMapper; + + @Override + public IndexHomePageInformationVO getIndexHomePageInformation(IndexHomePageDTO indexHomePageDTO) { + Long deviceInfoCount = kitchenDeviceInfoMapper.selectCount( + Wrappers.lambdaQuery() + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) + ); + + System.err.println("设备总数: " + deviceInfoCount); + return null; + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenStaffInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenStaffInfoServiceImpl.java index df81776..de9a779 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenStaffInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenStaffInfoServiceImpl.java @@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.Transactional; /** * 厨房员工资料Service业务层处理 - * + * * @author xsheng * @date 2025-06-16 */ @@ -49,7 +49,7 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService { /** * 查询厨房员工资料 - * + * * @param staffId 厨房员工资料主键 * @return 厨房员工资料 */ @@ -79,7 +79,7 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService { /** * 查询厨房员工资料列表 - * + * * @param kitchenStaffInfo 厨房员工资料 * @return 厨房员工资料 */ @@ -99,7 +99,7 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService { /** * 新增厨房员工资料 - * + * * @param kitchenStaffInfo 厨房员工资料 * @return 结果 */ @@ -119,7 +119,7 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService { /** * 修改厨房员工资料 - * + * * @param kitchenStaffInfo 厨房员工资料 * @return 结果 */ @@ -153,7 +153,7 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService { /** * 批量删除厨房员工资料 - * + * * @param staffIds 需要删除的厨房员工资料主键 * @return 结果 */ @@ -164,7 +164,7 @@ public class KitchenStaffInfoServiceImpl implements IKitchenStaffInfoService { /** * 删除厨房员工资料信息 - * + * * @param staffId 厨房员工资料主键 * @return 结果 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexAlarmLogCountVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexAlarmLogCountVO.java new file mode 100644 index 0000000..63c909e --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexAlarmLogCountVO.java @@ -0,0 +1,21 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * 告警日志统计信息 + * @author xliu + * @date 2025/6/18 17:11 + */ +@Data +@ToString +public class IndexAlarmLogCountVO { + + private Integer environmentalAlarmCount; // 环境告警记录 + + private Integer accessControlAlarmCount; // 门禁告警记录 + + private Integer monitoringAlarmCount; // 监控告警记录 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexDeviceStatusCountVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexDeviceStatusCountVO.java new file mode 100644 index 0000000..a28d69d --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexDeviceStatusCountVO.java @@ -0,0 +1,19 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * 设备状态统计信息 + * @author xliu + * @date 2025/6/18 17:17 + */ +@Data +@ToString +public class IndexDeviceStatusCountVO { + + private Integer normalCount; // 正常设备总数 + + private Integer offlineCount; // 离线设备总数 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEmployeeViolationVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEmployeeViolationVO.java new file mode 100644 index 0000000..9234f08 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEmployeeViolationVO.java @@ -0,0 +1,21 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * 员工违规统计信息 + * @author xliu + * @date 2025/6/18 17:31 + */ +@Data +@ToString +public class IndexEmployeeViolationVO { + + private Integer callUpCount; // 打电话 + private Integer smokeCount; // 抽烟 + private Integer withoutGlovesCount; // 未带手套 + private Integer withoutKitchenCapCount; // 未戴厨房帽 + private Integer withoutMaskCount; // 未带口罩 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentaAlarm.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentaAlarm.java new file mode 100644 index 0000000..c4f00be --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentaAlarm.java @@ -0,0 +1,20 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * @author xliu + * @date 2025/6/18 17:47 + */ +@Data +@ToString +public class IndexEnvironmentaAlarm { + + private Integer personRushCount; // 未授权人进入 + private Integer personLeavingCount; // 动火离人 + private Integer findAnimalsCount; // 发现老鼠 + private Integer wasteCount; // 垃圾桶未加盖 + + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentalWarning.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentalWarning.java new file mode 100644 index 0000000..7c280ad --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexEnvironmentalWarning.java @@ -0,0 +1,22 @@ +package com.bonus.canteen.core.kitchen.vo; + +import io.swagger.models.auth.In; +import lombok.Data; +import lombok.ToString; + +/** + * 环境预警 + * @author xliu + * @date 2025/6/18 17:41 + */ +@Data +@ToString +public class IndexEnvironmentalWarning { + + private Integer temperatureHighCount; // 温度过高总数 + private Integer temperatureLowCount; // 温度过低总数 + private Integer humidityHighCount; // 湿度过高总数 + private Integer humidityLowCount; // 湿度过低总数 + private Integer smokeHighCount; // 烟雾浓度过高总数 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHealthCertificateCountVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHealthCertificateCountVO.java new file mode 100644 index 0000000..4692558 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHealthCertificateCountVO.java @@ -0,0 +1,20 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * 健康证统计信息 + * @author xliu + * @date 2025/6/18 17:09 + */ +@Data +@ToString +public class IndexHealthCertificateCountVO { + + private Integer normalCount; // 正常证总数 + private Integer lackCount; // 缺失总数 + private Integer adventCount; // 临期总数 + private Integer expireCount; // 过期总数 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHomePageInformationVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHomePageInformationVO.java new file mode 100644 index 0000000..f45662d --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexHomePageInformationVO.java @@ -0,0 +1,36 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * @author xliu + * @date 2025/6/18 17:04 + */ +@Data +@ToString +public class IndexHomePageInformationVO { + + private Integer staffCount; // 员工总数 + + private Integer deviceCount; // 设备总数 + + private Integer todayWarningCount; // 今日预警 + + private Integer historicalWarningCount; // 历史预警 + + private IndexHealthCertificateCountVO healthCertificateCount; // 健康证统计信息 + + private IndexAlarmLogCountVO alarmLog; // 告警日志信息 + + private IndexDeviceStatusCountVO deviceStatus; // 设备状态信息 + + private IndexSampleRetentionCount sampleRetention; // 留样机数据统计信息 + + private IndexEmployeeViolationVO employeeViolation; // 员工违规统计信息 + + private IndexEnvironmentalWarning environmentalWarning; // 环境预警统计信息 + + private IndexEnvironmentaAlarm environmentalAlarm; // 环境告警信息 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexSampleRetentionCount.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexSampleRetentionCount.java new file mode 100644 index 0000000..b6bd895 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/vo/IndexSampleRetentionCount.java @@ -0,0 +1,19 @@ +package com.bonus.canteen.core.kitchen.vo; + +import lombok.Data; +import lombok.ToString; + +/** + * 留样机数据统计 + * @author xliu + * @date 2025/6/18 17:19 + */ +@Data +@ToString +public class IndexSampleRetentionCount { + + private Integer retentionCount; // 正常留样总数 + + private Integer unRetentionCount; // 缺失留样总数 + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceInfoMapper.xml index 9378aba..c9b2cde 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceInfoMapper.xml @@ -3,6 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + @@ -23,6 +24,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + SELECT device_id, @@ -51,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN v_area_canteen vac on vac.vAreaId = kit.area_id and vac.vCanteenId = kit.canteen_id + + + insert into kitchen_device_info diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceUsageMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceUsageMapper.xml index 7141f83..1a0e2c6 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceUsageMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenDeviceUsageMapper.xml @@ -27,11 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" device_type, area_id, canteen_id, - CASE - WHEN kdu.work_state = 1 THEN '工作中' - WHEN kdu.work_state = 0 THEN '离线' - ELSE '未知状态' - END as work_state, + work_state, + + + + + start_use_time, end_use_time, use_time,