From 889be8a259e08b0269f5e37c32d51d112af55f64 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 14 Nov 2024 15:25:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=B9=B3=E5=8F=B0=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../websocket/constant/WebSocketEvent.java | 3 + .../api/monitor/externalPlatformOffline.js | 53 +++ .../monitor/externalPlatformOffline/index.vue | 302 ++++++++++++++++++ ...DcExternalPlatformHeartbeatController.java | 17 + .../DcExternalPlatformOfflineController.java | 94 ++++++ .../domain/DcExternalPlatformOffline.java | 83 +++++ .../DcExternalPlatformHeartbeatMapper.java | 5 + .../DcExternalPlatformOfflineMapper.java | 63 ++++ .../IDcExternalPlatformHeartbeatService.java | 11 + .../IDcExternalPlatformOfflineService.java | 61 ++++ ...cExternalPlatformHeartbeatServiceImpl.java | 31 +- .../DcExternalPlatformOfflineServiceImpl.java | 93 ++++++ .../DcExternalPlatformHeartbeatMapper.xml | 16 +- .../DcExternalPlatformOfflineMapper.xml | 73 +++++ 14 files changed, 903 insertions(+), 2 deletions(-) create mode 100644 ruoyi-ui/src/api/monitor/externalPlatformOffline.js create mode 100644 ruoyi-ui/src/views/monitor/externalPlatformOffline/index.vue create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformOfflineController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformOffline.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformOfflineMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformOfflineService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformOfflineServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcExternalPlatformOfflineMapper.xml diff --git a/ruoyi-common/src/main/java/com/zc/common/core/websocket/constant/WebSocketEvent.java b/ruoyi-common/src/main/java/com/zc/common/core/websocket/constant/WebSocketEvent.java index aa4cced4..d2ee9bad 100644 --- a/ruoyi-common/src/main/java/com/zc/common/core/websocket/constant/WebSocketEvent.java +++ b/ruoyi-common/src/main/java/com/zc/common/core/websocket/constant/WebSocketEvent.java @@ -22,4 +22,7 @@ public class WebSocketEvent { //设备离线记录 public static final String DEVICE_OFFLINE_RECORD = "deviceOfflineRecord"; + //外部平台离线记录 + public static final String EXTERNAL_PLATFORM_OFFLINE = "externalPlatformOffline"; + } diff --git a/ruoyi-ui/src/api/monitor/externalPlatformOffline.js b/ruoyi-ui/src/api/monitor/externalPlatformOffline.js new file mode 100644 index 00000000..176f9990 --- /dev/null +++ b/ruoyi-ui/src/api/monitor/externalPlatformOffline.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询外部平台离线记录列表 +export function listExternalPlatformOffline(query) { + return request({ + url: '/externalPlatformOffline/list', + method: 'get', + params: query + }) +} + +// 查询外部平台离线记录详细 +export function getExternalPlatformOffline(id) { + return request({ + url: '/externalPlatformOffline/' + id, + method: 'get' + }) +} + +// 新增外部平台离线记录 +export function addExternalPlatformOffline(data) { + return request({ + url: '/externalPlatformOffline', + method: 'post', + data: data + }) +} + +// 修改外部平台离线记录 +export function updateExternalPlatformOffline(data) { + return request({ + url: '/externalPlatformOffline', + method: 'put', + data: data + }) +} + +// 删除外部平台离线记录 +export function delExternalPlatformOffline(id) { + return request({ + url: '/externalPlatformOffline/' + id, + method: 'delete' + }) +} + +// 导出外部平台离线记录 +export function exportExternalPlatformOffline(query) { + return request({ + url: '/externalPlatformOffline/export', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/views/monitor/externalPlatformOffline/index.vue b/ruoyi-ui/src/views/monitor/externalPlatformOffline/index.vue new file mode 100644 index 00000000..831e3b66 --- /dev/null +++ b/ruoyi-ui/src/views/monitor/externalPlatformOffline/index.vue @@ -0,0 +1,302 @@ + + + diff --git a/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformHeartbeatController.java b/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformHeartbeatController.java index 42757f02..2487d3f8 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformHeartbeatController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformHeartbeatController.java @@ -11,10 +11,14 @@ import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.ip.IpUtils; import com.zc.business.domain.DcExternalPlatformHeartbeat; +import com.zc.business.domain.DcExternalPlatformOffline; import com.zc.business.enums.UniversalEnum; import com.zc.business.service.IDcExternalPlatformHeartbeatService; +import com.zc.business.service.IDcExternalPlatformOfflineService; import com.zc.common.core.httpclient.OkHttp; import com.zc.common.core.httpclient.exception.HttpException; +import com.zc.common.core.websocket.WebSocketService; +import com.zc.common.core.websocket.constant.WebSocketEvent; import okhttp3.Response; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.security.access.prepost.PreAuthorize; @@ -46,6 +50,8 @@ public class DcExternalPlatformHeartbeatController extends BaseController { @Autowired private IDcExternalPlatformHeartbeatService dcExternalPlatformHeartbeatService; + @Autowired + private IDcExternalPlatformOfflineService dcExternalPlatformOfflineService; /** * 查询外部平台心跳日志列表 @@ -127,5 +133,16 @@ public class DcExternalPlatformHeartbeatController extends BaseController } } + List offlineList = dcExternalPlatformHeartbeatService.selectOfflineList(); + if (offlineList != null){ + for (DcExternalPlatformOffline dcExternalPlatformOffline : offlineList) { + int i = dcExternalPlatformHeartbeatService.selectRepeatRecord(dcExternalPlatformOffline.getType()); + if (i == 0){ + dcExternalPlatformOfflineService.insertDcExternalPlatformOffline(dcExternalPlatformOffline); + WebSocketService.broadcast(WebSocketEvent.EXTERNAL_PLATFORM_OFFLINE, dcExternalPlatformOffline); + } + } + } + } } diff --git a/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformOfflineController.java b/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformOfflineController.java new file mode 100644 index 00000000..fb1d486a --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformOfflineController.java @@ -0,0 +1,94 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcExternalPlatformOffline; +import com.zc.business.service.IDcExternalPlatformOfflineService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 外部平台离线记录Controller + * + * @author ruoyi + * @date 2024-11-14 + */ +@RestController +@RequestMapping("/externalPlatformOffline") +public class DcExternalPlatformOfflineController extends BaseController +{ + @Autowired + private IDcExternalPlatformOfflineService dcExternalPlatformOfflineService; + + /** + * 查询外部平台离线记录列表 + */ + @GetMapping("/list") + public TableDataInfo list(DcExternalPlatformOffline dcExternalPlatformOffline) + { + startPage(); + List list = dcExternalPlatformOfflineService.selectDcExternalPlatformOfflineList(dcExternalPlatformOffline); + return getDataTable(list); + } + + /** + * 导出外部平台离线记录列表 + */ + @PostMapping("/export") + public void export(HttpServletResponse response, DcExternalPlatformOffline dcExternalPlatformOffline) + { + List list = dcExternalPlatformOfflineService.selectDcExternalPlatformOfflineList(dcExternalPlatformOffline); + ExcelUtil util = new ExcelUtil<>(DcExternalPlatformOffline.class); + util.exportExcel(response, list, "外部平台离线记录数据"); + } + + /** + * 获取外部平台离线记录详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcExternalPlatformOfflineService.selectDcExternalPlatformOfflineById(id)); + } + + /** + * 新增外部平台离线记录 + */ + @PostMapping + public AjaxResult add(@RequestBody DcExternalPlatformOffline dcExternalPlatformOffline) + { + return toAjax(dcExternalPlatformOfflineService.insertDcExternalPlatformOffline(dcExternalPlatformOffline)); + } + + /** + * 修改外部平台离线记录 + */ + @PutMapping + public AjaxResult edit(@RequestBody DcExternalPlatformOffline dcExternalPlatformOffline) + { + return toAjax(dcExternalPlatformOfflineService.updateDcExternalPlatformOffline(dcExternalPlatformOffline)); + } + + /** + * 删除外部平台离线记录 + */ + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcExternalPlatformOfflineService.deleteDcExternalPlatformOfflineByIds(ids)); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformOffline.java b/zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformOffline.java new file mode 100644 index 00000000..9d15fb4d --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformOffline.java @@ -0,0 +1,83 @@ +package com.zc.business.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 外部平台离线记录对象 dc_external_platform_offline + * + * @author ruoyi + * @date 2024-11-14 + */ +public class DcExternalPlatformOffline extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 平台类型(1gis+bim 2数字孪生 3收费运营 4桥梁监测 5光纤) */ + @Excel(name = "平台类型",readConverterExp = "1=GIS+BIM,2=数字孪生,3=收费运营,4=桥梁监测,5=光纤监测") + private String type; + + /** 离线时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @Excel(name = "离线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date offlineTime; + + /** 结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setOfflineTime(Date offlineTime) + { + this.offlineTime = offlineTime; + } + + public Date getOfflineTime() + { + return offlineTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("type", getType()) + .append("offlineTime", getOfflineTime()) + .append("endTime", getEndTime()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformHeartbeatMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformHeartbeatMapper.java index fb97973c..8a236f39 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformHeartbeatMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformHeartbeatMapper.java @@ -1,6 +1,7 @@ package com.zc.business.mapper; import com.zc.business.domain.DcExternalPlatformHeartbeat; +import com.zc.business.domain.DcExternalPlatformOffline; import java.util.List; @@ -59,4 +60,8 @@ public interface DcExternalPlatformHeartbeatMapper * @return 结果 */ int deleteDcExternalPlatformHeartbeatByIds(Long[] ids); + + List selectOfflineList(); + + int selectRepeatRecord(String type); } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformOfflineMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformOfflineMapper.java new file mode 100644 index 00000000..23caffea --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformOfflineMapper.java @@ -0,0 +1,63 @@ +package com.zc.business.mapper; + +import java.util.List; +import com.zc.business.domain.DcExternalPlatformOffline; + +/** + * 外部平台离线记录Mapper接口 + * + * @author ruoyi + * @date 2024-11-14 + */ +public interface DcExternalPlatformOfflineMapper +{ + /** + * 查询外部平台离线记录 + * + * @param id 外部平台离线记录主键 + * @return 外部平台离线记录 + */ + public DcExternalPlatformOffline selectDcExternalPlatformOfflineById(Long id); + + /** + * 查询外部平台离线记录列表 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 外部平台离线记录集合 + */ + List selectDcExternalPlatformOfflineList(DcExternalPlatformOffline dcExternalPlatformOffline); + + /** + * 新增外部平台离线记录 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 结果 + */ + int insertDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); + + /** + * 修改外部平台离线记录 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 结果 + */ + int updateDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); + + /** + * 删除外部平台离线记录 + * + * @param id 外部平台离线记录主键 + * @return 结果 + */ + int deleteDcExternalPlatformOfflineById(Long id); + + /** + * 批量删除外部平台离线记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDcExternalPlatformOfflineByIds(Long[] ids); + + int updateEndTimeByType(String type); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformHeartbeatService.java b/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformHeartbeatService.java index 6026b893..f78f1c83 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformHeartbeatService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformHeartbeatService.java @@ -1,6 +1,7 @@ package com.zc.business.service; import com.zc.business.domain.DcExternalPlatformHeartbeat; +import com.zc.business.domain.DcExternalPlatformOffline; import java.util.List; @@ -59,4 +60,14 @@ public interface IDcExternalPlatformHeartbeatService * @return 结果 */ int deleteDcExternalPlatformHeartbeatById(Long id); + + /** + * 查询外部平台心跳超过5分钟的 + * + * @param + * @return 结果 + */ + List selectOfflineList(); + + int selectRepeatRecord(String type); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformOfflineService.java b/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformOfflineService.java new file mode 100644 index 00000000..717bb67a --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformOfflineService.java @@ -0,0 +1,61 @@ +package com.zc.business.service; + +import java.util.List; +import com.zc.business.domain.DcExternalPlatformOffline; + +/** + * 外部平台离线记录Service接口 + * + * @author ruoyi + * @date 2024-11-14 + */ +public interface IDcExternalPlatformOfflineService +{ + /** + * 查询外部平台离线记录 + * + * @param id 外部平台离线记录主键 + * @return 外部平台离线记录 + */ + public DcExternalPlatformOffline selectDcExternalPlatformOfflineById(Long id); + + /** + * 查询外部平台离线记录列表 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 外部平台离线记录集合 + */ + List selectDcExternalPlatformOfflineList(DcExternalPlatformOffline dcExternalPlatformOffline); + + /** + * 新增外部平台离线记录 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 结果 + */ + int insertDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); + + /** + * 修改外部平台离线记录 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 结果 + */ + int updateDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); + + /** + * 批量删除外部平台离线记录 + * + * @param ids 需要删除的外部平台离线记录主键集合 + * @return 结果 + */ + int deleteDcExternalPlatformOfflineByIds(Long[] ids); + + /** + * 删除外部平台离线记录信息 + * + * @param id 外部平台离线记录主键 + * @return 结果 + */ + int deleteDcExternalPlatformOfflineById(Long id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformHeartbeatServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformHeartbeatServiceImpl.java index 18509311..e7b526af 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformHeartbeatServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformHeartbeatServiceImpl.java @@ -3,7 +3,9 @@ package com.zc.business.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.zc.business.domain.DcExternalPlatformHeartbeat; +import com.zc.business.domain.DcExternalPlatformOffline; import com.zc.business.mapper.DcExternalPlatformHeartbeatMapper; +import com.zc.business.mapper.DcExternalPlatformOfflineMapper; import com.zc.business.service.IDcExternalPlatformHeartbeatService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,6 +21,8 @@ public class DcExternalPlatformHeartbeatServiceImpl implements IDcExternalPlatfo { @Autowired private DcExternalPlatformHeartbeatMapper dcExternalPlatformHeartbeatMapper; + @Autowired + private DcExternalPlatformOfflineMapper dcExternalPlatformOfflineMapper; /** * 查询外部平台心跳日志 @@ -54,7 +58,14 @@ public class DcExternalPlatformHeartbeatServiceImpl implements IDcExternalPlatfo public int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) { dcExternalPlatformHeartbeat.setCreateTime(DateUtils.getNowDate()); - return dcExternalPlatformHeartbeatMapper.insertDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat); + int i = dcExternalPlatformHeartbeatMapper.insertDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat); + + int rows = selectRepeatRecord(dcExternalPlatformHeartbeat.getType()); + if (rows > 0){ + dcExternalPlatformOfflineMapper.updateEndTimeByType(dcExternalPlatformHeartbeat.getType()); + } + + return i; } /** @@ -92,4 +103,22 @@ public class DcExternalPlatformHeartbeatServiceImpl implements IDcExternalPlatfo { return dcExternalPlatformHeartbeatMapper.deleteDcExternalPlatformHeartbeatById(id); } + + /** + * 查询外部平台心跳超过5分钟的 + * + * @param + * @return 结果 + */ + @Override + public List selectOfflineList() + { + return dcExternalPlatformHeartbeatMapper.selectOfflineList(); + } + + + @Override + public int selectRepeatRecord(String type){ + return dcExternalPlatformHeartbeatMapper.selectRepeatRecord(type); + } } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformOfflineServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformOfflineServiceImpl.java new file mode 100644 index 00000000..f4fe7a15 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformOfflineServiceImpl.java @@ -0,0 +1,93 @@ +package com.zc.business.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zc.business.mapper.DcExternalPlatformOfflineMapper; +import com.zc.business.domain.DcExternalPlatformOffline; +import com.zc.business.service.IDcExternalPlatformOfflineService; + +/** + * 外部平台离线记录Service业务层处理 + * + * @author ruoyi + * @date 2024-11-14 + */ +@Service +public class DcExternalPlatformOfflineServiceImpl implements IDcExternalPlatformOfflineService +{ + @Autowired + private DcExternalPlatformOfflineMapper dcExternalPlatformOfflineMapper; + + /** + * 查询外部平台离线记录 + * + * @param id 外部平台离线记录主键 + * @return 外部平台离线记录 + */ + @Override + public DcExternalPlatformOffline selectDcExternalPlatformOfflineById(Long id) + { + return dcExternalPlatformOfflineMapper.selectDcExternalPlatformOfflineById(id); + } + + /** + * 查询外部平台离线记录列表 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 外部平台离线记录 + */ + @Override + public List selectDcExternalPlatformOfflineList(DcExternalPlatformOffline dcExternalPlatformOffline) + { + return dcExternalPlatformOfflineMapper.selectDcExternalPlatformOfflineList(dcExternalPlatformOffline); + } + + /** + * 新增外部平台离线记录 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 结果 + */ + @Override + public int insertDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline) + { + return dcExternalPlatformOfflineMapper.insertDcExternalPlatformOffline(dcExternalPlatformOffline); + } + + /** + * 修改外部平台离线记录 + * + * @param dcExternalPlatformOffline 外部平台离线记录 + * @return 结果 + */ + @Override + public int updateDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline) + { + return dcExternalPlatformOfflineMapper.updateDcExternalPlatformOffline(dcExternalPlatformOffline); + } + + /** + * 批量删除外部平台离线记录 + * + * @param ids 需要删除的外部平台离线记录主键 + * @return 结果 + */ + @Override + public int deleteDcExternalPlatformOfflineByIds(Long[] ids) + { + return dcExternalPlatformOfflineMapper.deleteDcExternalPlatformOfflineByIds(ids); + } + + /** + * 删除外部平台离线记录信息 + * + * @param id 外部平台离线记录主键 + * @return 结果 + */ + @Override + public int deleteDcExternalPlatformOfflineById(Long id) + { + return dcExternalPlatformOfflineMapper.deleteDcExternalPlatformOfflineById(id); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml b/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml index edf9f02c..5d79248e 100644 --- a/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml @@ -28,7 +28,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + + + insert into dc_external_platform_heartbeat diff --git a/zc-business/src/main/resources/mapper/business/DcExternalPlatformOfflineMapper.xml b/zc-business/src/main/resources/mapper/business/DcExternalPlatformOfflineMapper.xml new file mode 100644 index 00000000..7a5f7907 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcExternalPlatformOfflineMapper.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + select id, type, offline_time, end_time from dc_external_platform_offline + + + + + + + + insert into dc_external_platform_offline + + type, + offline_time, + end_time, + + + #{type}, + #{offlineTime}, + #{endTime}, + + + + + update dc_external_platform_offline + + type = #{type}, + offline_time = #{offlineTime}, + end_time = #{endTime}, + + where id = #{id} + + + update dc_external_platform_offline set end_time = now() + where isnull(end_time) and type = #{type} + + + + delete from dc_external_platform_offline where id = #{id} + + + + delete from dc_external_platform_offline where id in + + #{id} + + + \ No newline at end of file