From 1d2e2e251356997f07450a11ad5ff1b5d1d9f606 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Thu, 30 Oct 2025 11:19:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E8=AE=BE=E5=A4=87=E5=91=8A=E8=AD=A6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=81=E8=AE=BE=E5=A4=87=E5=AE=9E=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9F=A5=E7=9C=8B=E7=AD=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- intc-admin/pom.xml | 2 +- .../controller/CallNoticeController.java | 104 ++++++++ .../MapMessageWarnCallNoticeController.java | 104 ++++++++ .../controller/MessageWarnController.java | 104 ++++++++ .../com/intc/fishery/domain/CallNotice.java | 128 +++++++++ .../domain/MapMessageWarnCallNotice.java | 46 ++++ .../com/intc/fishery/domain/MessageWarn.java | 71 +++++ .../intc/fishery/domain/bo/CallNoticeBo.java | 132 ++++++++++ .../domain/bo/MapMessageWarnCallNoticeBo.java | 46 ++++ .../intc/fishery/domain/bo/MessageWarnBo.java | 75 ++++++ .../intc/fishery/domain/vo/CallNoticeVo.java | 196 ++++++++++++++ .../domain/vo/MapMessageWarnCallNoticeVo.java | 58 +++++ .../intc/fishery/domain/vo/MessageWarnVo.java | 121 +++++++++ .../intc/fishery/mapper/CallNoticeMapper.java | 15 ++ .../MapMessageWarnCallNoticeMapper.java | 15 ++ .../fishery/mapper/MessageWarnMapper.java | 15 ++ .../fishery/service/ICallNoticeService.java | 68 +++++ .../IMapMessageWarnCallNoticeService.java | 68 +++++ .../fishery/service/IMessageWarnService.java | 68 +++++ .../service/impl/CallNoticeServiceImpl.java | 243 ++++++++++++++++++ .../MapMessageWarnCallNoticeServiceImpl.java | 133 ++++++++++ .../service/impl/MessageWarnServiceImpl.java | 200 ++++++++++++++ .../mapper/fishery/CallNoticeMapper.xml | 6 + .../MapMessageWarnCallNoticeMapper.xml | 6 + .../mapper/fishery/MessageWarnMapper.xml | 6 + .../DeviceSensorDataController.java | 34 +++ .../tdengine/domain/DeviceSensorData.java | 33 +++ .../mapper/DeviceSensorDataMapper.java | 58 +++++ .../service/IDeviceSensorDataService.java | 37 +++ .../service/impl/DeviceSensorDataService.java | 54 ++++ .../tdengine/DeviceSensorDataMapper.xml | 65 +++++ 31 files changed, 2310 insertions(+), 1 deletion(-) create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/CallNoticeController.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MapMessageWarnCallNoticeController.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MessageWarnController.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/CallNotice.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MapMessageWarnCallNotice.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MessageWarn.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/CallNoticeBo.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MapMessageWarnCallNoticeBo.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MessageWarnBo.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/CallNoticeVo.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MapMessageWarnCallNoticeVo.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MessageWarnVo.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/CallNoticeMapper.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MapMessageWarnCallNoticeMapper.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MessageWarnMapper.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/ICallNoticeService.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMapMessageWarnCallNoticeService.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMessageWarnService.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/CallNoticeServiceImpl.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MapMessageWarnCallNoticeServiceImpl.java create mode 100644 intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MessageWarnServiceImpl.java create mode 100644 intc-modules/intc-fishery/src/main/resources/mapper/fishery/CallNoticeMapper.xml create mode 100644 intc-modules/intc-fishery/src/main/resources/mapper/fishery/MapMessageWarnCallNoticeMapper.xml create mode 100644 intc-modules/intc-fishery/src/main/resources/mapper/fishery/MessageWarnMapper.xml create mode 100644 intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/controller/DeviceSensorDataController.java create mode 100644 intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/domain/DeviceSensorData.java create mode 100644 intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/mapper/DeviceSensorDataMapper.java create mode 100644 intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/IDeviceSensorDataService.java create mode 100644 intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/impl/DeviceSensorDataService.java create mode 100644 intc-modules/intc-tdengine/src/main/resources/mapper/tdengine/DeviceSensorDataMapper.xml diff --git a/intc-admin/pom.xml b/intc-admin/pom.xml index 3e99ddd..99e51cd 100644 --- a/intc-admin/pom.xml +++ b/intc-admin/pom.xml @@ -92,7 +92,7 @@ intc-fishery ${revision} - + com.intc intc-tdengine diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/CallNoticeController.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/CallNoticeController.java new file mode 100644 index 0000000..756f930 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/CallNoticeController.java @@ -0,0 +1,104 @@ +package com.intc.fishery.controller; + +import java.util.List; +import com.intc.common.excel.utils.ExcelUtil; +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.intc.common.idempotent.annotation.RepeatSubmit; +import com.intc.common.log.annotation.Log; +import com.intc.common.web.core.BaseController; +import com.intc.common.mybatis.core.page.PageQuery; +import com.intc.common.core.domain.R; +import com.intc.common.core.validate.AddGroup; +import com.intc.common.core.validate.EditGroup; +import com.intc.common.log.enums.BusinessType; +import com.intc.fishery.domain.vo.CallNoticeVo; +import com.intc.fishery.domain.bo.CallNoticeBo; +import com.intc.fishery.service.ICallNoticeService; +import com.intc.common.mybatis.core.page.TableDataInfo; + +/** + * 告警电话通知记录 + * + * @author intc + * @date 2025-10-25 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fishery/callNotice") +public class CallNoticeController extends BaseController { + + private final ICallNoticeService callNoticeService; + + /** + * 查询告警电话通知记录列表 + */ + @SaCheckPermission("fishery:callNotice:list") + @GetMapping("/list") + public TableDataInfo list(CallNoticeBo bo, PageQuery pageQuery) { + return callNoticeService.queryPageList(bo, pageQuery); + } + + /** + * 导出告警电话通知记录列表 + */ + @SaCheckPermission("fishery:callNotice:export") + @Log(title = "告警电话通知记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(CallNoticeBo bo, HttpServletResponse response) { + List list = callNoticeService.queryList(bo); + ExcelUtil.exportExcel(list, "告警电话通知记录", CallNoticeVo.class, response); + } + + /** + * 获取告警电话通知记录详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fishery:callNotice:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(callNoticeService.queryById(id)); + } + + /** + * 新增告警电话通知记录 + */ + @SaCheckPermission("fishery:callNotice:add") + @Log(title = "告警电话通知记录", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody CallNoticeBo bo) { + return toAjax(callNoticeService.insertByBo(bo)); + } + + /** + * 修改告警电话通知记录 + */ + @SaCheckPermission("fishery:callNotice:edit") + @Log(title = "告警电话通知记录", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody CallNoticeBo bo) { + return toAjax(callNoticeService.updateByBo(bo)); + } + + /** + * 删除告警电话通知记录 + * + * @param ids 主键串 + */ + @SaCheckPermission("fishery:callNotice:remove") + @Log(title = "告警电话通知记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(callNoticeService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MapMessageWarnCallNoticeController.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MapMessageWarnCallNoticeController.java new file mode 100644 index 0000000..8e1e75b --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MapMessageWarnCallNoticeController.java @@ -0,0 +1,104 @@ +package com.intc.fishery.controller; + +import java.util.List; +import com.intc.common.excel.utils.ExcelUtil; +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.intc.common.idempotent.annotation.RepeatSubmit; +import com.intc.common.log.annotation.Log; +import com.intc.common.web.core.BaseController; +import com.intc.common.mybatis.core.page.PageQuery; +import com.intc.common.core.domain.R; +import com.intc.common.core.validate.AddGroup; +import com.intc.common.core.validate.EditGroup; +import com.intc.common.log.enums.BusinessType; +import com.intc.fishery.domain.vo.MapMessageWarnCallNoticeVo; +import com.intc.fishery.domain.bo.MapMessageWarnCallNoticeBo; +import com.intc.fishery.service.IMapMessageWarnCallNoticeService; +import com.intc.common.mybatis.core.page.TableDataInfo; + +/** + * 告警消息和电话告警通知关系表 + * + * @author intc + * @date 2025-10-25 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fishery/mapMessageWarnCallNotice") +public class MapMessageWarnCallNoticeController extends BaseController { + + private final IMapMessageWarnCallNoticeService mapMessageWarnCallNoticeService; + + /** + * 查询告警消息和电话告警通知关系表列表 + */ + @SaCheckPermission("fishery:mapMessageWarnCallNotice:list") + @GetMapping("/list") + public TableDataInfo list(MapMessageWarnCallNoticeBo bo, PageQuery pageQuery) { + return mapMessageWarnCallNoticeService.queryPageList(bo, pageQuery); + } + + /** + * 导出告警消息和电话告警通知关系表列表 + */ + @SaCheckPermission("fishery:mapMessageWarnCallNotice:export") + @Log(title = "告警消息和电话告警通知关系表", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(MapMessageWarnCallNoticeBo bo, HttpServletResponse response) { + List list = mapMessageWarnCallNoticeService.queryList(bo); + ExcelUtil.exportExcel(list, "告警消息和电话告警通知关系表", MapMessageWarnCallNoticeVo.class, response); + } + + /** + * 获取告警消息和电话告警通知关系表详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fishery:mapMessageWarnCallNotice:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(mapMessageWarnCallNoticeService.queryById(id)); + } + + /** + * 新增告警消息和电话告警通知关系表 + */ + @SaCheckPermission("fishery:mapMessageWarnCallNotice:add") + @Log(title = "告警消息和电话告警通知关系表", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody MapMessageWarnCallNoticeBo bo) { + return toAjax(mapMessageWarnCallNoticeService.insertByBo(bo)); + } + + /** + * 修改告警消息和电话告警通知关系表 + */ + @SaCheckPermission("fishery:mapMessageWarnCallNotice:edit") + @Log(title = "告警消息和电话告警通知关系表", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody MapMessageWarnCallNoticeBo bo) { + return toAjax(mapMessageWarnCallNoticeService.updateByBo(bo)); + } + + /** + * 删除告警消息和电话告警通知关系表 + * + * @param ids 主键串 + */ + @SaCheckPermission("fishery:mapMessageWarnCallNotice:remove") + @Log(title = "告警消息和电话告警通知关系表", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(mapMessageWarnCallNoticeService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MessageWarnController.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MessageWarnController.java new file mode 100644 index 0000000..039d670 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/controller/MessageWarnController.java @@ -0,0 +1,104 @@ +package com.intc.fishery.controller; + +import java.util.List; +import com.intc.common.excel.utils.ExcelUtil; +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.intc.common.idempotent.annotation.RepeatSubmit; +import com.intc.common.log.annotation.Log; +import com.intc.common.web.core.BaseController; +import com.intc.common.mybatis.core.page.PageQuery; +import com.intc.common.core.domain.R; +import com.intc.common.core.validate.AddGroup; +import com.intc.common.core.validate.EditGroup; +import com.intc.common.log.enums.BusinessType; +import com.intc.fishery.domain.vo.MessageWarnVo; +import com.intc.fishery.domain.bo.MessageWarnBo; +import com.intc.fishery.service.IMessageWarnService; +import com.intc.common.mybatis.core.page.TableDataInfo; + +/** + * 设备告警记录 + * + * @author intc + * @date 2025-10-25 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/fishery/messageWarn") +public class MessageWarnController extends BaseController { + + private final IMessageWarnService messageWarnService; + + /** + * 查询设备告警记录列表 + */ + @SaCheckPermission("fishery:messageWarn:list") + @GetMapping("/list") + public TableDataInfo list(MessageWarnBo bo, PageQuery pageQuery) { + return messageWarnService.queryPageList(bo, pageQuery); + } + + /** + * 导出设备告警记录列表 + */ + @SaCheckPermission("fishery:messageWarn:export") + @Log(title = "设备告警记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(MessageWarnBo bo, HttpServletResponse response) { + List list = messageWarnService.queryList(bo); + ExcelUtil.exportExcel(list, "设备告警记录", MessageWarnVo.class, response); + } + + /** + * 获取设备告警记录详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("fishery:messageWarn:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(messageWarnService.queryById(id)); + } + + /** + * 新增设备告警记录 + */ + @SaCheckPermission("fishery:messageWarn:add") + @Log(title = "设备告警记录", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody MessageWarnBo bo) { + return toAjax(messageWarnService.insertByBo(bo)); + } + + /** + * 修改设备告警记录 + */ + @SaCheckPermission("fishery:messageWarn:edit") + @Log(title = "设备告警记录", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody MessageWarnBo bo) { + return toAjax(messageWarnService.updateByBo(bo)); + } + + /** + * 删除设备告警记录 + * + * @param ids 主键串 + */ + @SaCheckPermission("fishery:messageWarn:remove") + @Log(title = "设备告警记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(messageWarnService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/CallNotice.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/CallNotice.java new file mode 100644 index 0000000..c71adb1 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/CallNotice.java @@ -0,0 +1,128 @@ +package com.intc.fishery.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.intc.common.tenant.core.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 告警电话通知记录对象 aqu_call_notice + * + * @author intc + * @date 2025-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("aqu_call_notice") +public class CallNotice extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @TableId(value = "id") + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 通知手机号 + */ + private String mobilePhone; + + /** + * 设备id + */ + private Long deviceId; + + /** + * 设定的呼叫时间 + */ + private Date callTime; + + /** + * 呼叫的CallId + */ + private String callId; + + /** + * 呼叫状态 + */ + private Integer callStatus; + + /** + * 主叫号码 + */ + private String caller; + + /** + * 通话时长 + */ + private String duration; + + /** + * 通话结束时间 + */ + private String endTime; + + /** + * 挂断方向 + */ + private String hangupDirection; + + /** + * 呼叫发起时间 + */ + private String originateTime; + + /** + * 扩展字段回传 + */ + private String outId; + + /** + * 被叫响铃时间 + */ + private String ringTime; + + /** + * 通话接通时间 + */ + private String startTime; + + /** + * 呼叫结果状态码 + */ + private String statusCode; + + /** + * 结果描述 + */ + private String statusMsg; + + /** + * 通话类型 + */ + private String tollType; + + /** + * 话单类型 + */ + private String voiceType; + + /** + * 塘口名称 + */ + private String pondName; + + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MapMessageWarnCallNotice.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MapMessageWarnCallNotice.java new file mode 100644 index 0000000..bcc175e --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MapMessageWarnCallNotice.java @@ -0,0 +1,46 @@ +package com.intc.fishery.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.intc.common.tenant.core.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 告警消息和电话告警通知关系表对象 aqu_map_message_warn_call_notice + * + * @author intc + * @date 2025-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("aqu_map_message_warn_call_notice") +public class MapMessageWarnCallNotice extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @TableId(value = "id") + private Long id; + + /** + * 告警消息Id + */ + private Long messageWarnId; + + /** + * 电话通知id + */ + private Long callNoticeId; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MessageWarn.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MessageWarn.java new file mode 100644 index 0000000..5a949e5 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/MessageWarn.java @@ -0,0 +1,71 @@ +package com.intc.fishery.domain; + +import com.baomidou.mybatisplus.annotation.*; +import com.intc.common.tenant.core.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 设备告警记录对象 aqu_message_warn + * + * @author intc + * @date 2025-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("aqu_message_warn") +public class MessageWarn extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @TableId(value = "id") + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 设备id + */ + private Long deviceId; + + /** + * 消息标题 + */ + private String title; + + /** + * 消息内容 + */ + private String message; + + /** + * 是否已读 + */ + private Integer isRead; + + /** + * 告警类型 + */ + private Integer warnType; + + /** + * 塘口名称 + */ + private String pondName; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/CallNoticeBo.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/CallNoticeBo.java new file mode 100644 index 0000000..5d96fca --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/CallNoticeBo.java @@ -0,0 +1,132 @@ +package com.intc.fishery.domain.bo; +import com.intc.common.core.validate.AddGroup; +import com.intc.common.core.validate.EditGroup; +import com.intc.fishery.domain.CallNotice; +import com.intc.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 告警电话通知记录业务对象 aqu_call_notice + * + * @author intc + * @date 2025-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = CallNotice.class, reverseConvertGenerate = false) +public class CallNoticeBo extends BaseEntity { + + /** + * 主键id + */ + @NotNull(message = "主键id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long userId; + + /** + * 通知手机号 + */ + @NotBlank(message = "通知手机号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String mobilePhone; + + /** + * 设备id + */ + @NotNull(message = "设备id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long deviceId; + + /** + * 设定的呼叫时间 + */ + @NotNull(message = "设定的呼叫时间不能为空", groups = { AddGroup.class, EditGroup.class }) + private Date callTime; + + /** + * 呼叫的CallId + */ + private String callId; + + /** + * 呼叫状态 + */ + @NotNull(message = "呼叫状态不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer callStatus; + + /** + * 主叫号码 + */ + private String caller; + + /** + * 通话时长 + */ + private String duration; + + /** + * 通话结束时间 + */ + private String endTime; + + /** + * 挂断方向 + */ + private String hangupDirection; + + /** + * 呼叫发起时间 + */ + private String originateTime; + + /** + * 扩展字段回传 + */ + private String outId; + + /** + * 被叫响铃时间 + */ + private String ringTime; + + /** + * 通话接通时间 + */ + private String startTime; + + /** + * 呼叫结果状态码 + */ + private String statusCode; + + /** + * 结果描述 + */ + private String statusMsg; + + /** + * 通话类型 + */ + private String tollType; + + /** + * 话单类型 + */ + private String voiceType; + + /** + * 塘口名称 + */ + @NotBlank(message = "塘口名称不能为空", groups = { AddGroup.class }) + private String pondName; + + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MapMessageWarnCallNoticeBo.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MapMessageWarnCallNoticeBo.java new file mode 100644 index 0000000..0baa693 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MapMessageWarnCallNoticeBo.java @@ -0,0 +1,46 @@ +package com.intc.fishery.domain.bo; +import com.intc.common.core.validate.AddGroup; +import com.intc.common.core.validate.EditGroup; +import com.intc.fishery.domain.MapMessageWarnCallNotice; +import com.intc.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 告警消息和电话告警通知关系表业务对象 aqu_map_message_warn_call_notice + * + * @author intc + * @date 2025-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = MapMessageWarnCallNotice.class, reverseConvertGenerate = false) +public class MapMessageWarnCallNoticeBo extends BaseEntity { + + /** + * 主键id + */ + @NotNull(message = "主键id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 告警消息Id + */ + @NotNull(message = "告警消息Id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long messageWarnId; + + /** + * 电话通知id + */ + @NotNull(message = "电话通知id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long callNoticeId; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MessageWarnBo.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MessageWarnBo.java new file mode 100644 index 0000000..649d2c6 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/bo/MessageWarnBo.java @@ -0,0 +1,75 @@ +package com.intc.fishery.domain.bo; +import com.intc.common.core.validate.AddGroup; +import com.intc.common.core.validate.EditGroup; +import com.intc.fishery.domain.MessageWarn; +import com.intc.common.mybatis.core.domain.BaseEntity; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 设备告警记录业务对象 aqu_message_warn + * + * @author intc + * @date 2025-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = MessageWarn.class, reverseConvertGenerate = false) +public class MessageWarnBo extends BaseEntity { + + /** + * 主键id + */ + @NotNull(message = "主键id不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 用户id + */ + @NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long userId; + + /** + * 设备id + */ + @NotNull(message = "设备id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long deviceId; + + /** + * 消息标题 + */ + @NotBlank(message = "消息标题不能为空", groups = { AddGroup.class, EditGroup.class }) + private String title; + + /** + * 消息内容 + */ + @NotBlank(message = "消息内容不能为空", groups = { AddGroup.class, EditGroup.class }) + private String message; + + /** + * 是否已读 + */ + @NotNull(message = "是否已读不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer isRead; + + /** + * 告警类型 + */ + @NotNull(message = "告警类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer warnType; + + /** + * 塘口名称 + */ + private String pondName; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/CallNoticeVo.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/CallNoticeVo.java new file mode 100644 index 0000000..e6ebdad --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/CallNoticeVo.java @@ -0,0 +1,196 @@ +package com.intc.fishery.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.intc.fishery.domain.CallNotice; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import com.intc.common.excel.annotation.ExcelDictFormat; +import com.intc.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 告警电话通知记录视图对象 aqu_call_notice + * + * @author intc + * @date 2025-10-25 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = CallNotice.class) +public class CallNoticeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @ExcelProperty(value = "主键id") + private Long id; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 通知手机号 + */ + @ExcelProperty(value = "通知手机号") + private String mobilePhone; + + /** + * 设备id + */ + @ExcelProperty(value = "设备id") + private Long deviceId; + + /** + * 呼叫状态 + */ + @ExcelProperty(value = "呼叫状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "call_status") + private Integer callStatus; + + /** + * 主叫号码 + */ + @ExcelProperty(value = "主叫号码") + private String caller; + + /** + * 通话时长 + */ + @ExcelProperty(value = "通话时长") + private String duration; + + /** + * 通话结束时间 + */ + @ExcelProperty(value = "通话结束时间") + private String endTime; + + /** + * 挂断方向 + */ + @ExcelProperty(value = "挂断方向") + private String hangupDirection; + + /** + * 呼叫发起时间 + */ + @ExcelProperty(value = "呼叫发起时间") + private String originateTime; + + /** + * 扩展字段回传 + */ + @ExcelProperty(value = "扩展字段回传") + private String outId; + + /** + * 被叫响铃时间 + */ + @ExcelProperty(value = "被叫响铃时间") + private String ringTime; + + /** + * 通话接通时间 + */ + @ExcelProperty(value = "通话接通时间") + private String startTime; + + /** + * 呼叫结果状态码 + */ + @ExcelProperty(value = "呼叫结果状态码") + private String statusCode; + + /** + * 设定的呼叫时间 + */ + private Date callTime; + + /** + * 结果描述 + */ + @ExcelProperty(value = "结果描述") + private String statusMsg; + + /** + * 通话类型 + */ + @ExcelProperty(value = "通话类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "toll_type") + private String tollType; + + /** + * 话单类型 + */ + @ExcelProperty(value = "话单类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "voice_type") + private String voiceType; + + private Date createTime; + + private Date updateTime; + + /** + * 用户名(关联查询) + */ + @ExcelProperty(value = "用户名") + private String userName; + + /** + * 用户手机号(关联查询) + */ + @ExcelProperty(value = "用户手机号") + private String userMobilePhone; + + /** + * 设备名称(关联查询) + */ + @ExcelProperty(value = "设备名称") + private String deviceName; + + /** + * 设备编号(关联查询) + */ + @ExcelProperty(value = "设备编号") + private String serialNum; + + /** + * 设备类型(关联查询) + */ + @ExcelProperty(value = "设备类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "aqu_device_type") + private Integer deviceType; + + /** + * 告警类型(关联查询) + */ + @ExcelProperty(value = "告警类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "warn_type") + private Integer warnType; + + /** + * 告警标题(关联查询) + */ + @ExcelProperty(value = "告警标题") + private String warnTitle; + + /** + * 告警内容(关联查询) + */ + @ExcelProperty(value = "告警内容") + private String warnMessage; +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MapMessageWarnCallNoticeVo.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MapMessageWarnCallNoticeVo.java new file mode 100644 index 0000000..fa729d8 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MapMessageWarnCallNoticeVo.java @@ -0,0 +1,58 @@ +package com.intc.fishery.domain.vo; + +import com.intc.fishery.domain.MapMessageWarnCallNotice; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import com.intc.common.excel.annotation.ExcelDictFormat; +import com.intc.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 告警消息和电话告警通知关系表视图对象 aqu_map_message_warn_call_notice + * + * @author intc + * @date 2025-10-25 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = MapMessageWarnCallNotice.class) +public class MapMessageWarnCallNoticeVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @ExcelProperty(value = "主键id") + private Long id; + + /** + * 告警消息Id + */ + @ExcelProperty(value = "告警消息Id") + private Long messageWarnId; + + /** + * 电话通知id + */ + @ExcelProperty(value = "电话通知id") + private Long callNoticeId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + private Date createTime; + + private Date updateTime; +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MessageWarnVo.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MessageWarnVo.java new file mode 100644 index 0000000..f589471 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/domain/vo/MessageWarnVo.java @@ -0,0 +1,121 @@ +package com.intc.fishery.domain.vo; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + +import com.intc.common.excel.annotation.ExcelDictFormat; +import com.intc.common.excel.convert.ExcelDictConvert; +import com.intc.fishery.domain.MessageWarn; + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + + + +/** + * 设备告警记录视图对象 aqu_message_warn + * + * @author intc + * @date 2025-10-25 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = MessageWarn.class) +public class MessageWarnVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + @ExcelProperty(value = "主键id") + private Long id; + + /** + * 用户id + */ + @ExcelProperty(value = "用户id") + private Long userId; + + /** + * 设备id + */ + @ExcelProperty(value = "设备id") + private Long deviceId; + + /** + * 消息标题 + */ + @ExcelProperty(value = "消息标题") + private String title; + + /** + * 消息内容 + */ + @ExcelProperty(value = "消息内容") + private String message; + + /** + * 是否已读 + */ + @ExcelProperty(value = "是否已读", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "yes_no") + private Integer isRead; + + /** + * 告警类型 + */ + @ExcelProperty(value = "告警类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "warn_type") + private Integer warnType; + + /** + * 塘口名称 + */ + @ExcelProperty(value = "塘口名称") + private String pondName; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + private Date createTime; + + private Date updateTime; + + /** + * 用户名(关联查询) + */ + @ExcelProperty(value = "用户名") + private String userName; + + /** + * 用户手机号(关联查询) + */ + @ExcelProperty(value = "用户手机号") + private String mobilePhone; + + /** + * 设备名称(关联查询) + */ + @ExcelProperty(value = "设备名称") + private String deviceName; + + /** + * 设备编号(关联查询) + */ + @ExcelProperty(value = "设备编号") + private String serialNum; + + /** + * 电话通知次数(统计查询) + */ + @ExcelProperty(value = "电话通知次数") + private Long callNoticeCount; +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/CallNoticeMapper.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/CallNoticeMapper.java new file mode 100644 index 0000000..c1ffad5 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/CallNoticeMapper.java @@ -0,0 +1,15 @@ +package com.intc.fishery.mapper; + +import com.intc.fishery.domain.CallNotice; +import com.intc.fishery.domain.vo.CallNoticeVo; +import com.intc.common.mybatis.core.mapper.BaseMapperPlusJoin; + +/** + * 告警电话通知记录Mapper接口 + * + * @author intc + * @date 2025-10-25 + */ +public interface CallNoticeMapper extends BaseMapperPlusJoin { + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MapMessageWarnCallNoticeMapper.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MapMessageWarnCallNoticeMapper.java new file mode 100644 index 0000000..d3f811a --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MapMessageWarnCallNoticeMapper.java @@ -0,0 +1,15 @@ +package com.intc.fishery.mapper; + +import com.intc.fishery.domain.MapMessageWarnCallNotice; +import com.intc.fishery.domain.vo.MapMessageWarnCallNoticeVo; +import com.intc.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 告警消息和电话告警通知关系表Mapper接口 + * + * @author intc + * @date 2025-10-25 + */ +public interface MapMessageWarnCallNoticeMapper extends BaseMapperPlus { + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MessageWarnMapper.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MessageWarnMapper.java new file mode 100644 index 0000000..37ae332 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/mapper/MessageWarnMapper.java @@ -0,0 +1,15 @@ +package com.intc.fishery.mapper; + +import com.intc.common.mybatis.core.mapper.BaseMapperPlusJoin; +import com.intc.fishery.domain.MessageWarn; +import com.intc.fishery.domain.vo.MessageWarnVo; + +/** + * 设备告警记录Mapper接口 + * + * @author intc + * @date 2025-10-25 + */ +public interface MessageWarnMapper extends BaseMapperPlusJoin { + +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/ICallNoticeService.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/ICallNoticeService.java new file mode 100644 index 0000000..4a1c35f --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/ICallNoticeService.java @@ -0,0 +1,68 @@ +package com.intc.fishery.service; + +import com.intc.fishery.domain.vo.CallNoticeVo; +import com.intc.fishery.domain.bo.CallNoticeBo; +import com.intc.common.mybatis.core.page.TableDataInfo; +import com.intc.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 告警电话通知记录Service接口 + * + * @author intc + * @date 2025-10-25 + */ +public interface ICallNoticeService { + + /** + * 查询告警电话通知记录 + * + * @param id 主键 + * @return 告警电话通知记录 + */ + CallNoticeVo queryById(Long id); + + /** + * 分页查询告警电话通知记录列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 告警电话通知记录分页列表 + */ + TableDataInfo queryPageList(CallNoticeBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的告警电话通知记录列表 + * + * @param bo 查询条件 + * @return 告警电话通知记录列表 + */ + List queryList(CallNoticeBo bo); + + /** + * 新增告警电话通知记录 + * + * @param bo 告警电话通知记录 + * @return 是否新增成功 + */ + Boolean insertByBo(CallNoticeBo bo); + + /** + * 修改告警电话通知记录 + * + * @param bo 告警电话通知记录 + * @return 是否修改成功 + */ + Boolean updateByBo(CallNoticeBo bo); + + /** + * 校验并批量删除告警电话通知记录信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMapMessageWarnCallNoticeService.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMapMessageWarnCallNoticeService.java new file mode 100644 index 0000000..db7bc2a --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMapMessageWarnCallNoticeService.java @@ -0,0 +1,68 @@ +package com.intc.fishery.service; + +import com.intc.fishery.domain.vo.MapMessageWarnCallNoticeVo; +import com.intc.fishery.domain.bo.MapMessageWarnCallNoticeBo; +import com.intc.common.mybatis.core.page.TableDataInfo; +import com.intc.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 告警消息和电话告警通知关系表Service接口 + * + * @author intc + * @date 2025-10-25 + */ +public interface IMapMessageWarnCallNoticeService { + + /** + * 查询告警消息和电话告警通知关系表 + * + * @param id 主键 + * @return 告警消息和电话告警通知关系表 + */ + MapMessageWarnCallNoticeVo queryById(Long id); + + /** + * 分页查询告警消息和电话告警通知关系表列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 告警消息和电话告警通知关系表分页列表 + */ + TableDataInfo queryPageList(MapMessageWarnCallNoticeBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的告警消息和电话告警通知关系表列表 + * + * @param bo 查询条件 + * @return 告警消息和电话告警通知关系表列表 + */ + List queryList(MapMessageWarnCallNoticeBo bo); + + /** + * 新增告警消息和电话告警通知关系表 + * + * @param bo 告警消息和电话告警通知关系表 + * @return 是否新增成功 + */ + Boolean insertByBo(MapMessageWarnCallNoticeBo bo); + + /** + * 修改告警消息和电话告警通知关系表 + * + * @param bo 告警消息和电话告警通知关系表 + * @return 是否修改成功 + */ + Boolean updateByBo(MapMessageWarnCallNoticeBo bo); + + /** + * 校验并批量删除告警消息和电话告警通知关系表信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMessageWarnService.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMessageWarnService.java new file mode 100644 index 0000000..2031cf2 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/IMessageWarnService.java @@ -0,0 +1,68 @@ +package com.intc.fishery.service; + +import com.intc.fishery.domain.vo.MessageWarnVo; +import com.intc.fishery.domain.bo.MessageWarnBo; +import com.intc.common.mybatis.core.page.TableDataInfo; +import com.intc.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 设备告警记录Service接口 + * + * @author intc + * @date 2025-10-25 + */ +public interface IMessageWarnService { + + /** + * 查询设备告警记录 + * + * @param id 主键 + * @return 设备告警记录 + */ + MessageWarnVo queryById(Long id); + + /** + * 分页查询设备告警记录列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 设备告警记录分页列表 + */ + TableDataInfo queryPageList(MessageWarnBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的设备告警记录列表 + * + * @param bo 查询条件 + * @return 设备告警记录列表 + */ + List queryList(MessageWarnBo bo); + + /** + * 新增设备告警记录 + * + * @param bo 设备告警记录 + * @return 是否新增成功 + */ + Boolean insertByBo(MessageWarnBo bo); + + /** + * 修改设备告警记录 + * + * @param bo 设备告警记录 + * @return 是否修改成功 + */ + Boolean updateByBo(MessageWarnBo bo); + + /** + * 校验并批量删除设备告警记录信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/CallNoticeServiceImpl.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/CallNoticeServiceImpl.java new file mode 100644 index 0000000..e35d5ac --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/CallNoticeServiceImpl.java @@ -0,0 +1,243 @@ +package com.intc.fishery.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.intc.common.core.utils.MapstructUtils; +import com.intc.common.core.utils.StringUtils; +import com.intc.common.mybatis.core.page.TableDataInfo; +import com.intc.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import com.intc.fishery.domain.bo.CallNoticeBo; +import com.intc.fishery.domain.vo.CallNoticeVo; +import com.intc.fishery.domain.CallNotice; +import com.intc.fishery.domain.AquUser; +import com.intc.fishery.domain.Device; +import com.intc.fishery.domain.MapMessageWarnCallNotice; +import com.intc.fishery.domain.MessageWarn; +import com.intc.fishery.mapper.CallNoticeMapper; +import com.intc.fishery.mapper.MapMessageWarnCallNoticeMapper; +import com.intc.fishery.service.ICallNoticeService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 告警电话通知记录Service业务层处理 + * + * @author intc + * @date 2025-10-25 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class CallNoticeServiceImpl implements ICallNoticeService { + + private final CallNoticeMapper baseMapper; + private final MapMessageWarnCallNoticeMapper mapMessageWarnCallNoticeMapper; + + /** + * 查询告警电话通知记录 + * + * @param id 主键 + * @return 告警电话通知记录 + */ + @Override + public CallNoticeVo queryById(Long id){ + MPJLambdaWrapper wrapper = new MPJLambdaWrapper() + .selectAll(CallNotice.class) + .selectAs(AquUser::getUserName, CallNoticeVo::getUserName) + .selectAs(AquUser::getMobilePhone, CallNoticeVo::getUserMobilePhone) + .selectAs(Device::getDeviceName, CallNoticeVo::getDeviceName) + .selectAs(Device::getSerialNum, CallNoticeVo::getSerialNum) + .selectAs(Device::getDeviceType, CallNoticeVo::getDeviceType) + .select("mw.warn_type AS warnType") + .select("mw.title AS warnTitle") + .select("mw.message AS warnMessage") + .leftJoin(AquUser.class, AquUser::getId, CallNotice::getUserId) + .leftJoin(Device.class, Device::getId, CallNotice::getDeviceId) + .leftJoin("aqu_map_message_warn_call_notice map ON map.call_notice_id = t.id") + .leftJoin("aqu_message_warn mw ON mw.id = map.message_warn_id") + .eq(CallNotice::getId, id); + return baseMapper.selectJoinOne(CallNoticeVo.class, wrapper); + } + + /** + * 分页查询告警电话通知记录列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 告警电话通知记录分页列表 + */ + @Override + public TableDataInfo queryPageList(CallNoticeBo bo, PageQuery pageQuery) { + MPJLambdaWrapper wrapper = buildJoinQueryWrapper(bo); + Page result = baseMapper.selectJoinPage(pageQuery.build(), CallNoticeVo.class, wrapper); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的告警电话通知记录列表 + * + * @param bo 查询条件 + * @return 告警电话通知记录列表 + */ + @Override + public List queryList(CallNoticeBo bo) { + MPJLambdaWrapper wrapper = buildJoinQueryWrapper(bo); + return baseMapper.selectJoinList(CallNoticeVo.class, wrapper); + } + + /** + * 构建关联查询条件 + * + * @param bo 查询条件 + * @return 关联查询Wrapper + */ + private MPJLambdaWrapper buildJoinQueryWrapper(CallNoticeBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper wrapper = new MPJLambdaWrapper() + .selectAll(CallNotice.class) + .selectAs(AquUser::getUserName, CallNoticeVo::getUserName) + .selectAs(AquUser::getMobilePhone, CallNoticeVo::getUserMobilePhone) + .selectAs(Device::getDeviceName, CallNoticeVo::getDeviceName) + .selectAs(Device::getSerialNum, CallNoticeVo::getSerialNum) + .selectAs(Device::getDeviceType, CallNoticeVo::getDeviceType) + .select("mw.warn_type AS warnType") + .select("mw.title AS warnTitle") + .select("mw.message AS warnMessage") + .leftJoin(AquUser.class, AquUser::getId, CallNotice::getUserId) + .leftJoin(Device.class, Device::getId, CallNotice::getDeviceId) + .leftJoin("aqu_map_message_warn_call_notice map ON map.call_notice_id = t.id") + .leftJoin("aqu_message_warn mw ON mw.id = map.message_warn_id") + .eq(bo.getUserId() != null, CallNotice::getUserId, bo.getUserId()) + .eq(bo.getCallStatus() != null, CallNotice::getCallStatus, bo.getCallStatus()) + .eq(StringUtils.isNotBlank(bo.getMobilePhone()), CallNotice::getMobilePhone, bo.getMobilePhone()) + .eq(bo.getDeviceId() != null, CallNotice::getDeviceId, bo.getDeviceId()) + .eq(StringUtils.isNotBlank(bo.getDuration()), CallNotice::getDuration, bo.getDuration()) + .eq(StringUtils.isNotBlank(bo.getEndTime()), CallNotice::getEndTime, bo.getEndTime()) + .eq(StringUtils.isNotBlank(bo.getHangupDirection()), CallNotice::getHangupDirection, bo.getHangupDirection()) + .eq(StringUtils.isNotBlank(bo.getTollType()), CallNotice::getTollType, bo.getTollType()) + .orderByDesc(CallNotice::getCallTime); + + // 处理额外的查询参数 + if (params != null && !params.isEmpty()) { + handleExtraParams(wrapper, params); + } + + return wrapper; + } + + /** + * 处理额外的查询参数 + * + * @param wrapper 查询包装器 + * @param params 额外参数 + */ + private void handleExtraParams(MPJLambdaWrapper wrapper, Map params) { + // 处理用户名或用户手机号模糊查询 + String userKeyword = (String) params.get("userKeyword"); + if (StringUtils.isNotBlank(userKeyword)) { + wrapper.and(w -> w.like(AquUser::getUserName, userKeyword) + .or() + .like(AquUser::getMobilePhone, userKeyword)); + } + + // 处理设备名称或设备编号模糊查询 + String deviceKeyword = (String) params.get("deviceKeyword"); + if (StringUtils.isNotBlank(deviceKeyword)) { + wrapper.and(w -> w.like(Device::getDeviceName, deviceKeyword) + .or() + .like(Device::getSerialNum, deviceKeyword)); + } + + // 处理设备类型精确查询 + Object deviceTypeObj = params.get("deviceType"); + if (deviceTypeObj != null) { + Integer deviceType = deviceTypeObj instanceof String ? + Integer.valueOf((String) deviceTypeObj) : (Integer) deviceTypeObj; + wrapper.eq(Device::getDeviceType, deviceType); + } + + // 处理告警类型精确查询 + Object warnTypeObj = params.get("warnType"); + if (warnTypeObj != null) { + Integer warnType = warnTypeObj instanceof String ? + Integer.valueOf((String) warnTypeObj) : (Integer) warnTypeObj; + wrapper.apply("mw.warn_type = {0}", warnType); + } + + // 处理告警ID精确查询 + Object messageWarnIdObj = params.get("messageWarnId"); + if (messageWarnIdObj != null) { + Long messageWarnId = messageWarnIdObj instanceof String ? + Long.valueOf((String) messageWarnIdObj) : (Long) messageWarnIdObj; + wrapper.eq("mw.id", messageWarnId); + } + } + + /** + * 新增告警电话通知记录 + * + * @param bo 告警电话通知记录 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(CallNoticeBo bo) { + CallNotice add = MapstructUtils.convert(bo, CallNotice.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改告警电话通知记录 + * + * @param bo 告警电话通知记录 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(CallNoticeBo bo) { + CallNotice update = MapstructUtils.convert(bo, CallNotice.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(CallNotice entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除告警电话通知记录信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + + // 先删除中间表的关联记录 + for (Long callNoticeId : ids) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + wrapper.eq(MapMessageWarnCallNotice::getCallNoticeId, callNoticeId); + mapMessageWarnCallNoticeMapper.delete(wrapper); + } + + // 再删除主表记录 + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MapMessageWarnCallNoticeServiceImpl.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MapMessageWarnCallNoticeServiceImpl.java new file mode 100644 index 0000000..653be4c --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MapMessageWarnCallNoticeServiceImpl.java @@ -0,0 +1,133 @@ +package com.intc.fishery.service.impl; + +import com.intc.common.core.utils.MapstructUtils; +import com.intc.common.core.utils.StringUtils; +import com.intc.common.mybatis.core.page.TableDataInfo; +import com.intc.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import com.intc.fishery.domain.bo.MapMessageWarnCallNoticeBo; +import com.intc.fishery.domain.vo.MapMessageWarnCallNoticeVo; +import com.intc.fishery.domain.MapMessageWarnCallNotice; +import com.intc.fishery.mapper.MapMessageWarnCallNoticeMapper; +import com.intc.fishery.service.IMapMessageWarnCallNoticeService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 告警消息和电话告警通知关系表Service业务层处理 + * + * @author intc + * @date 2025-10-25 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class MapMessageWarnCallNoticeServiceImpl implements IMapMessageWarnCallNoticeService { + + private final MapMessageWarnCallNoticeMapper baseMapper; + + /** + * 查询告警消息和电话告警通知关系表 + * + * @param id 主键 + * @return 告警消息和电话告警通知关系表 + */ + @Override + public MapMessageWarnCallNoticeVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询告警消息和电话告警通知关系表列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 告警消息和电话告警通知关系表分页列表 + */ + @Override + public TableDataInfo queryPageList(MapMessageWarnCallNoticeBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的告警消息和电话告警通知关系表列表 + * + * @param bo 查询条件 + * @return 告警消息和电话告警通知关系表列表 + */ + @Override + public List queryList(MapMessageWarnCallNoticeBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(MapMessageWarnCallNoticeBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(MapMessageWarnCallNotice::getId); + lqw.eq(bo.getMessageWarnId() != null, MapMessageWarnCallNotice::getMessageWarnId, bo.getMessageWarnId()); + lqw.eq(bo.getCallNoticeId() != null, MapMessageWarnCallNotice::getCallNoticeId, bo.getCallNoticeId()); + return lqw; + } + + /** + * 新增告警消息和电话告警通知关系表 + * + * @param bo 告警消息和电话告警通知关系表 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(MapMessageWarnCallNoticeBo bo) { + MapMessageWarnCallNotice add = MapstructUtils.convert(bo, MapMessageWarnCallNotice.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改告警消息和电话告警通知关系表 + * + * @param bo 告警消息和电话告警通知关系表 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(MapMessageWarnCallNoticeBo bo) { + MapMessageWarnCallNotice update = MapstructUtils.convert(bo, MapMessageWarnCallNotice.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(MapMessageWarnCallNotice entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除告警消息和电话告警通知关系表信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MessageWarnServiceImpl.java b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MessageWarnServiceImpl.java new file mode 100644 index 0000000..ad24df2 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/java/com/intc/fishery/service/impl/MessageWarnServiceImpl.java @@ -0,0 +1,200 @@ +package com.intc.fishery.service.impl; + +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.intc.common.core.utils.MapstructUtils; +import com.intc.common.core.utils.StringUtils; +import com.intc.common.mybatis.core.page.TableDataInfo; +import com.intc.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import com.intc.fishery.domain.bo.MessageWarnBo; +import com.intc.fishery.domain.vo.MessageWarnVo; +import com.intc.fishery.domain.MessageWarn; +import com.intc.fishery.domain.AquUser; +import com.intc.fishery.domain.Device; +import com.intc.fishery.domain.Pond; +import com.intc.fishery.mapper.MessageWarnMapper; +import com.intc.fishery.service.IMessageWarnService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 设备告警记录Service业务层处理 + * + * @author intc + * @date 2025-10-25 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class MessageWarnServiceImpl implements IMessageWarnService { + + private final MessageWarnMapper baseMapper; + + /** + * 查询设备告警记录 + * + * @param id 主键 + * @return 设备告警记录 + */ + @Override + public MessageWarnVo queryById(Long id){ + MPJLambdaWrapper wrapper = new MPJLambdaWrapper() + .selectAll(MessageWarn.class) + .selectAs(AquUser::getUserName, MessageWarnVo::getUserName) + .selectAs(AquUser::getMobilePhone, MessageWarnVo::getMobilePhone) + .selectAs(Device::getDeviceName, MessageWarnVo::getDeviceName) + .selectAs(Device::getSerialNum, MessageWarnVo::getSerialNum) + .selectAs(Pond::getPondName, MessageWarnVo::getPondName) + .select("(SELECT COUNT(*) FROM aqu_map_message_warn_call_notice map WHERE map.message_warn_id = t.id AND map.tenant_id = t.tenant_id) AS callNoticeCount") + .leftJoin(AquUser.class, AquUser::getId, MessageWarn::getUserId) + .leftJoin(Device.class, Device::getId, MessageWarn::getDeviceId) + .leftJoin(Pond.class, Pond::getId, Device::getPondId) + .eq(MessageWarn::getId, id); + return baseMapper.selectJoinOne(MessageWarnVo.class, wrapper); + } + + /** + * 分页查询设备告警记录列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 设备告警记录分页列表 + */ + @Override + public TableDataInfo queryPageList(MessageWarnBo bo, PageQuery pageQuery) { + MPJLambdaWrapper wrapper = buildJoinQueryWrapper(bo); + Page result = baseMapper.selectJoinPage(pageQuery.build(), MessageWarnVo.class, wrapper); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的设备告警记录列表 + * + * @param bo 查询条件 + * @return 设备告警记录列表 + */ + @Override + public List queryList(MessageWarnBo bo) { + MPJLambdaWrapper wrapper = buildJoinQueryWrapper(bo); + return baseMapper.selectJoinList(MessageWarnVo.class, wrapper); + } + + /** + * 构建关联查询条件 + * + * @param bo 查询条件 + * @return 关联查询Wrapper + */ + private MPJLambdaWrapper buildJoinQueryWrapper(MessageWarnBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper wrapper = new MPJLambdaWrapper() + .selectAll(MessageWarn.class) + .selectAs(AquUser::getUserName, MessageWarnVo::getUserName) + .selectAs(AquUser::getMobilePhone, MessageWarnVo::getMobilePhone) + .selectAs(Device::getDeviceName, MessageWarnVo::getDeviceName) + .selectAs(Device::getSerialNum, MessageWarnVo::getSerialNum) + .selectAs(Pond::getPondName, MessageWarnVo::getPondName) + .select("(SELECT COUNT(*) FROM aqu_map_message_warn_call_notice map WHERE map.message_warn_id = t.id AND map.tenant_id = t.tenant_id) AS callNoticeCount") + .leftJoin(AquUser.class, AquUser::getId, MessageWarn::getUserId) + .leftJoin(Device.class, Device::getId, MessageWarn::getDeviceId) + .leftJoin(Pond.class, Pond::getId, Device::getPondId) + .eq(bo.getUserId() != null, MessageWarn::getUserId, bo.getUserId()) + .eq(bo.getDeviceId() != null, MessageWarn::getDeviceId, bo.getDeviceId()) + .eq(StringUtils.isNotBlank(bo.getTitle()), MessageWarn::getTitle, bo.getTitle()) + .eq(StringUtils.isNotBlank(bo.getMessage()), MessageWarn::getMessage, bo.getMessage()) + .eq(bo.getIsRead() != null, MessageWarn::getIsRead, bo.getIsRead()) + .eq(bo.getWarnType() != null, MessageWarn::getWarnType, bo.getWarnType()) + .like(StringUtils.isNotBlank(bo.getPondName()), MessageWarn::getPondName, bo.getPondName()) + .orderByDesc(MessageWarn::getCreateTime); + + // 处理额外的查询参数 + if (params != null && !params.isEmpty()) { + handleExtraParams(wrapper, params); + } + + return wrapper; + } + + /** + * 处理额外的查询参数 + * + * @param wrapper 查询包装器 + * @param params 额外参数 + */ + private void handleExtraParams(MPJLambdaWrapper wrapper, Map params) { + // 处理用户名或用户手机号模糊查询 + String userKeyword = (String) params.get("userKeyword"); + if (StringUtils.isNotBlank(userKeyword)) { + wrapper.and(w -> w.like(AquUser::getUserName, userKeyword) + .or() + .like(AquUser::getMobilePhone, userKeyword)); + } + + // 处理设备名称或设备编号模糊查询 + String deviceKeyword = (String) params.get("deviceKeyword"); + if (StringUtils.isNotBlank(deviceKeyword)) { + wrapper.and(w -> w.like(Device::getDeviceName, deviceKeyword) + .or() + .like(Device::getSerialNum, deviceKeyword)); + } + } + + /** + * 新增设备告警记录 + * + * @param bo 设备告警记录 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(MessageWarnBo bo) { + MessageWarn add = MapstructUtils.convert(bo, MessageWarn.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改设备告警记录 + * + * @param bo 设备告警记录 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(MessageWarnBo bo) { + MessageWarn update = MapstructUtils.convert(bo, MessageWarn.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(MessageWarn entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除设备告警记录信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/intc-modules/intc-fishery/src/main/resources/mapper/fishery/CallNoticeMapper.xml b/intc-modules/intc-fishery/src/main/resources/mapper/fishery/CallNoticeMapper.xml new file mode 100644 index 0000000..eef36c2 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/resources/mapper/fishery/CallNoticeMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/intc-modules/intc-fishery/src/main/resources/mapper/fishery/MapMessageWarnCallNoticeMapper.xml b/intc-modules/intc-fishery/src/main/resources/mapper/fishery/MapMessageWarnCallNoticeMapper.xml new file mode 100644 index 0000000..c2633e3 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/resources/mapper/fishery/MapMessageWarnCallNoticeMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/intc-modules/intc-fishery/src/main/resources/mapper/fishery/MessageWarnMapper.xml b/intc-modules/intc-fishery/src/main/resources/mapper/fishery/MessageWarnMapper.xml new file mode 100644 index 0000000..72a4907 --- /dev/null +++ b/intc-modules/intc-fishery/src/main/resources/mapper/fishery/MessageWarnMapper.xml @@ -0,0 +1,6 @@ + + + + diff --git a/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/controller/DeviceSensorDataController.java b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/controller/DeviceSensorDataController.java new file mode 100644 index 0000000..2c4d377 --- /dev/null +++ b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/controller/DeviceSensorDataController.java @@ -0,0 +1,34 @@ +package com.intc.tdengine.controller; + + +import com.intc.common.web.core.BaseController; +import com.intc.tdengine.domain.DeviceSensorData; +import com.intc.tdengine.service.IDeviceSensorDataService; +import jakarta.annotation.Resource; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * TDEngines设备数据信息Controller + * + * @author Tianyongbao + * @date 2025-10-27 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/td/device") +public class DeviceSensorDataController extends BaseController +{ + @Resource + private IDeviceSensorDataService deviceSensorDataService; + + @GetMapping("/getHistoryData") + public List getHistoryData(@RequestParam("serialNum") String serialNum, @RequestParam("deviceId") Long deviceId, @RequestParam("mobilePhone") String mobilePhone, @RequestParam("deviceType") int deviceType, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) + { + return deviceSensorDataService.getHistoryDataList(serialNum,deviceId,mobilePhone,deviceType,startTime,endTime); + } +} diff --git a/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/domain/DeviceSensorData.java b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/domain/DeviceSensorData.java new file mode 100644 index 0000000..c6d36d1 --- /dev/null +++ b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/domain/DeviceSensorData.java @@ -0,0 +1,33 @@ +package com.intc.tdengine.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import java.time.LocalDateTime; +@Data +@NoArgsConstructor // 生成无参构造方法 +@AllArgsConstructor // 生成全参构造方法 +public class DeviceSensorData { + + // 测量字段(随时间变化的数值) + private LocalDateTime time; // 时序主键时间戳 + private LocalDateTime createTime; // 数据创建时间 + private double dissolvedOxygen; // 溶解氧 + private double temperature; // 温度 + private double saturability; // 饱和度 + private double ph; // pH值 + private double salinity; // 盐度 + private double treference; // 参考值(具体含义需结合业务) + private double tfluorescence; // 荧光值 + private double phaseDifference; // 相位差 + private double battery; // 电池电量 + + // 标签字段(元数据,不随时间频繁变化) + private String serialNum; // 设备序列号 + private long deviceId; // 设备ID(对应TDengine的BIGINT) + private long userId; // 用户ID(对应TDengine的BIGINT) + private String userName; // 用户名 + private String mobilePhone; // 手机号 + private String deviceName; // 设备名称 + private int deviceType; // 设备类型 +} diff --git a/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/mapper/DeviceSensorDataMapper.java b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/mapper/DeviceSensorDataMapper.java new file mode 100644 index 0000000..7efe2d3 --- /dev/null +++ b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/mapper/DeviceSensorDataMapper.java @@ -0,0 +1,58 @@ +package com.intc.tdengine.mapper; + +import com.intc.tdengine.domain.DeviceSensorData; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +@Mapper +public interface DeviceSensorDataMapper { + + /** + * 删除数据库 + * + * @return 结果 + */ + void dropDB(); + + /** + * 创建数据库 + * + * @return 结果 + */ + void createDB(); + + /** + * 创建超级表 + * + * @return 结果 + */ + void createSuperTable(); + + /** + * 创建子表 + * + * @param deviceSensorData 数据信息 + * @return 结果 + */ + void createTable(DeviceSensorData deviceSensorData); + + /** + * 批量插入数据 + * + * @param dataList 数据列表 + * @return 影响行数 + */ + int batchInsertDeviceSensorData(@Param("dataList") List dataList); + + /** + * 查询数据 + * + * @return 影响行数 + */ + List getHistoryDataList(@Param("serialNum") String serialNum,@Param("deviceId") Long deviceId,@Param("mobilePhone") String mobilePhone,@Param("deviceType") int deviceType,@Param("startTime") String startTime,@Param("endTime") String endTime); + +} diff --git a/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/IDeviceSensorDataService.java b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/IDeviceSensorDataService.java new file mode 100644 index 0000000..26dde71 --- /dev/null +++ b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/IDeviceSensorDataService.java @@ -0,0 +1,37 @@ +package com.intc.tdengine.service; + +import com.intc.tdengine.domain.DeviceSensorData; +import org.springframework.scheduling.annotation.Async; + +import java.util.List; + +/** + * @author YaphetS + */ +public interface IDeviceSensorDataService { + + + /** + * 创建子表 + * + * @param deviceSensorData 数据信息 + * @return 结果 + */ + void createTable(DeviceSensorData deviceSensorData); + + /** + * 批量插入数据 + * + * @param dataList 数据列表 + * @return 影响行数 + */ + @Async + public void batchInsertDeviceSensorData(List dataList); + + /** + * 查询数据 + * + * @return 影响行数 + */ + public List getHistoryDataList(String serialNum, Long deviceId, String mobilePhone, int deviceType, String startTime, String endTime); +} diff --git a/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/impl/DeviceSensorDataService.java b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/impl/DeviceSensorDataService.java new file mode 100644 index 0000000..819de7f --- /dev/null +++ b/intc-modules/intc-tdengine/src/main/java/com/intc/tdengine/service/impl/DeviceSensorDataService.java @@ -0,0 +1,54 @@ +package com.intc.tdengine.service.impl; + +import com.intc.tdengine.domain.DeviceSensorData; +import com.intc.tdengine.mapper.DeviceSensorDataMapper; +import com.intc.tdengine.service.IDeviceSensorDataService; +import jakarta.annotation.Resource; +import org.apache.ibatis.annotations.Param; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceSensorDataService implements IDeviceSensorDataService { + @Resource + private DeviceSensorDataMapper deviceSensorDataMapper; + + + /** + * 创建子表 + * + * @param deviceSensorData 数据信息 + * @return 结果 + */ + @Override + public void createTable(DeviceSensorData deviceSensorData) { + deviceSensorDataMapper.createTable(deviceSensorData); + } + + /** + * 批量插入数据 + * + * @param dataList 数据列表 + * @return 影响行数 + */ + @Override + public void batchInsertDeviceSensorData(List dataList) { + deviceSensorDataMapper.batchInsertDeviceSensorData(dataList); + } + + /** + * 查询数据 + * + * @return 影响行数 + */ + @Override + public List getHistoryDataList(String serialNum,Long deviceId, String mobilePhone, int deviceType,String startTime, String endTime) { + List list=new ArrayList<>(); + try { + list=deviceSensorDataMapper.getHistoryDataList(serialNum,deviceId,mobilePhone,deviceType,startTime,endTime); + }catch (Exception e){ + + } + return list; + } +} diff --git a/intc-modules/intc-tdengine/src/main/resources/mapper/tdengine/DeviceSensorDataMapper.xml b/intc-modules/intc-tdengine/src/main/resources/mapper/tdengine/DeviceSensorDataMapper.xml new file mode 100644 index 0000000..908ed59 --- /dev/null +++ b/intc-modules/intc-tdengine/src/main/resources/mapper/tdengine/DeviceSensorDataMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + drop database if exists fishery + + + + create database if not exists fishery + + + + create table if not exists + fishery.device_sensor_data(time timestamp,createTime timestamp, dissolvedOxygen double, temperature double , saturability double , ph double , salinity double , treference double , tfluorescence double , phaseDifference double , battery double) + tags( + tenant_id nchar(50), + serialNum nchar(100), + deviceId BIGINT, + userId BIGINT, + userName nchar(100), + mobilePhone nchar(20), + deviceName nchar(100), + deviceType int + ) + + + + + create table if not exists + + `fishery`.t_#{serialNum} + + using fishery.device_sensor_data + + tags(#{tenantId},#{serialNum},#{deviceId},#{userId},#{userName},#{mobilePhone},#{deviceName},#{deviceType}) + + + + insert into + + `fishery`.t_#{serialNum} + + using fishery.device_sensor_data + + tags(#{data.tenantId},#{data.serialNum},#{data.deviceId},#{data.userId},#{data.userName},#{data.mobilePhone},#{data.deviceName},#{data.deviceType}) + + (time, createTime, dissolvedOxygen, temperature, saturability, ph, salinity, treference, tfluorescence, phaseDifference, battery) values (#{data.time}, ${data.createTime}, ${data.dissolvedOxygen}, ${data.temperature}, ${data.saturability}, ${data.ph}, ${data.salinity}, ${data.treference}, ${data.tfluorescence}, ${data.phaseDifference}, ${data.battery}) + + + + +