diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index e84c0325..f77fdbf9 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -142,6 +142,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/license/identityCode", "/license/authentication").anonymous() // 扫码报警 .antMatchers( "/codeScanningAlarm/**").anonymous() + //外部平台心跳日志 + .antMatchers( "/externalPlatform/heartbeat").anonymous() // 第三方、小程序、APP //.antMatchers("/api/**").anonymous() diff --git a/ruoyi-ui/src/api/monitor/heartbeat.js b/ruoyi-ui/src/api/monitor/heartbeat.js new file mode 100644 index 00000000..73937e88 --- /dev/null +++ b/ruoyi-ui/src/api/monitor/heartbeat.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询外部平台心跳日志列表 +export function listHeartbeat(query) { + return request({ + url: '/externalPlatform/heartbeat/list', + method: 'get', + params: query + }) +} + +// 查询外部平台心跳日志详细 +export function getHeartbeat(id) { + return request({ + url: '/externalPlatform/heartbeat/' + id, + method: 'get' + }) +} + +// 新增外部平台心跳日志 +export function addHeartbeat(data) { + return request({ + url: '/externalPlatform/heartbeat', + method: 'post', + data: data + }) +} + +// 修改外部平台心跳日志 +export function updateHeartbeat(data) { + return request({ + url: '/externalPlatform/heartbeat', + method: 'put', + data: data + }) +} + +// 删除外部平台心跳日志 +export function delHeartbeat(id) { + return request({ + url: '/externalPlatform/heartbeat/' + id, + method: 'delete' + }) +} + +// 导出外部平台心跳日志 +export function exportHeartbeat(query) { + return request({ + url: '/externalPlatform/heartbeat/export', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/views/monitor/heartbeat/index.vue b/ruoyi-ui/src/views/monitor/heartbeat/index.vue new file mode 100644 index 00000000..06514bbd --- /dev/null +++ b/ruoyi-ui/src/views/monitor/heartbeat/index.vue @@ -0,0 +1,280 @@ + + + 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 new file mode 100644 index 00000000..50d2b6d3 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcExternalPlatformHeartbeatController.java @@ -0,0 +1,98 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.ServletUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.zc.business.domain.DcExternalPlatformHeartbeat; +import com.zc.business.service.IDcExternalPlatformHeartbeatService; +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.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 外部平台心跳日志Controller + * + * @author ruoyi + * @date 2024-10-24 + */ +@RestController +@RequestMapping("/externalPlatform/heartbeat") +public class DcExternalPlatformHeartbeatController extends BaseController +{ + @Autowired + private IDcExternalPlatformHeartbeatService dcExternalPlatformHeartbeatService; + + /** + * 查询外部平台心跳日志列表 + */ + @GetMapping("/list") + public TableDataInfo list(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + startPage(); + List list = dcExternalPlatformHeartbeatService.selectDcExternalPlatformHeartbeatList(dcExternalPlatformHeartbeat); + return getDataTable(list); + } + + /** + * 导出外部平台心跳日志列表 + */ + @PostMapping("/export") + public void export(HttpServletResponse response, DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + List list = dcExternalPlatformHeartbeatService.selectDcExternalPlatformHeartbeatList(dcExternalPlatformHeartbeat); + ExcelUtil util = new ExcelUtil<>(DcExternalPlatformHeartbeat.class); + util.exportExcel(response, list, "外部平台心跳日志数据"); + } + + /** + * 获取外部平台心跳日志详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcExternalPlatformHeartbeatService.selectDcExternalPlatformHeartbeatById(id)); + } + + /** + * 新增外部平台心跳日志 + */ + @PostMapping + public AjaxResult add(@RequestBody DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + dcExternalPlatformHeartbeat.setIp(IpUtils.getIpAddr(ServletUtils.getRequest()));; + return toAjax(dcExternalPlatformHeartbeatService.insertDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat)); + } + + /** + * 修改外部平台心跳日志 + */ + @PutMapping + public AjaxResult edit(@RequestBody DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + return toAjax(dcExternalPlatformHeartbeatService.updateDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat)); + } + + /** + * 删除外部平台心跳日志 + */ + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcExternalPlatformHeartbeatService.deleteDcExternalPlatformHeartbeatByIds(ids)); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformHeartbeat.java b/zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformHeartbeat.java new file mode 100644 index 00000000..ae83204a --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcExternalPlatformHeartbeat.java @@ -0,0 +1,101 @@ +package com.zc.business.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +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; + +import java.util.Date; + +/** + * 外部平台心跳日志对象 dc_external_platform_heartbeat + * + * @author ruoyi + * @date 2024-10-24 + */ +public class DcExternalPlatformHeartbeat +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + 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", type = Excel.Type.EXPORT) + private Date createTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + /** 心跳ip*/ + private String ip; + + 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 Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("type", getType()) + .append("createTime", getCreateTime()) + .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 new file mode 100644 index 00000000..fb97973c --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcExternalPlatformHeartbeatMapper.java @@ -0,0 +1,62 @@ +package com.zc.business.mapper; + +import com.zc.business.domain.DcExternalPlatformHeartbeat; + +import java.util.List; + +/** + * 外部平台心跳日志Mapper接口 + * + * @author ruoyi + * @date 2024-10-24 + */ +public interface DcExternalPlatformHeartbeatMapper +{ + /** + * 查询外部平台心跳日志 + * + * @param id 外部平台心跳日志主键 + * @return 外部平台心跳日志 + */ + public DcExternalPlatformHeartbeat selectDcExternalPlatformHeartbeatById(Long id); + + /** + * 查询外部平台心跳日志列表 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 外部平台心跳日志集合 + */ + List selectDcExternalPlatformHeartbeatList(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); + + /** + * 新增外部平台心跳日志 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 结果 + */ + int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); + + /** + * 修改外部平台心跳日志 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 结果 + */ + int updateDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); + + /** + * 删除外部平台心跳日志 + * + * @param id 外部平台心跳日志主键 + * @return 结果 + */ + int deleteDcExternalPlatformHeartbeatById(Long id); + + /** + * 批量删除外部平台心跳日志 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDcExternalPlatformHeartbeatByIds(Long[] ids); +} 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 new file mode 100644 index 00000000..6026b893 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcExternalPlatformHeartbeatService.java @@ -0,0 +1,62 @@ +package com.zc.business.service; + +import com.zc.business.domain.DcExternalPlatformHeartbeat; + +import java.util.List; + +/** + * 外部平台心跳日志Service接口 + * + * @author ruoyi + * @date 2024-10-24 + */ +public interface IDcExternalPlatformHeartbeatService +{ + /** + * 查询外部平台心跳日志 + * + * @param id 外部平台心跳日志主键 + * @return 外部平台心跳日志 + */ + public DcExternalPlatformHeartbeat selectDcExternalPlatformHeartbeatById(Long id); + + /** + * 查询外部平台心跳日志列表 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 外部平台心跳日志集合 + */ + List selectDcExternalPlatformHeartbeatList(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); + + /** + * 新增外部平台心跳日志 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 结果 + */ + int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); + + /** + * 修改外部平台心跳日志 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 结果 + */ + int updateDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); + + /** + * 批量删除外部平台心跳日志 + * + * @param ids 需要删除的外部平台心跳日志主键集合 + * @return 结果 + */ + int deleteDcExternalPlatformHeartbeatByIds(Long[] ids); + + /** + * 删除外部平台心跳日志信息 + * + * @param id 外部平台心跳日志主键 + * @return 结果 + */ + int deleteDcExternalPlatformHeartbeatById(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 new file mode 100644 index 00000000..18509311 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcExternalPlatformHeartbeatServiceImpl.java @@ -0,0 +1,95 @@ +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.mapper.DcExternalPlatformHeartbeatMapper; +import com.zc.business.service.IDcExternalPlatformHeartbeatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 外部平台心跳日志Service业务层处理 + * + * @author ruoyi + * @date 2024-10-24 + */ +@Service +public class DcExternalPlatformHeartbeatServiceImpl implements IDcExternalPlatformHeartbeatService +{ + @Autowired + private DcExternalPlatformHeartbeatMapper dcExternalPlatformHeartbeatMapper; + + /** + * 查询外部平台心跳日志 + * + * @param id 外部平台心跳日志主键 + * @return 外部平台心跳日志 + */ + @Override + public DcExternalPlatformHeartbeat selectDcExternalPlatformHeartbeatById(Long id) + { + return dcExternalPlatformHeartbeatMapper.selectDcExternalPlatformHeartbeatById(id); + } + + /** + * 查询外部平台心跳日志列表 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 外部平台心跳日志 + */ + @Override + public List selectDcExternalPlatformHeartbeatList(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + return dcExternalPlatformHeartbeatMapper.selectDcExternalPlatformHeartbeatList(dcExternalPlatformHeartbeat); + } + + /** + * 新增外部平台心跳日志 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 结果 + */ + @Override + public int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + dcExternalPlatformHeartbeat.setCreateTime(DateUtils.getNowDate()); + return dcExternalPlatformHeartbeatMapper.insertDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat); + } + + /** + * 修改外部平台心跳日志 + * + * @param dcExternalPlatformHeartbeat 外部平台心跳日志 + * @return 结果 + */ + @Override + public int updateDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) + { + return dcExternalPlatformHeartbeatMapper.updateDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat); + } + + /** + * 批量删除外部平台心跳日志 + * + * @param ids 需要删除的外部平台心跳日志主键 + * @return 结果 + */ + @Override + public int deleteDcExternalPlatformHeartbeatByIds(Long[] ids) + { + return dcExternalPlatformHeartbeatMapper.deleteDcExternalPlatformHeartbeatByIds(ids); + } + + /** + * 删除外部平台心跳日志信息 + * + * @param id 外部平台心跳日志主键 + * @return 结果 + */ + @Override + public int deleteDcExternalPlatformHeartbeatById(Long id) + { + return dcExternalPlatformHeartbeatMapper.deleteDcExternalPlatformHeartbeatById(id); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml b/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml new file mode 100644 index 00000000..edf9f02c --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcExternalPlatformHeartbeatMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + select id, type, create_time from dc_external_platform_heartbeat + + + + + + + + insert into dc_external_platform_heartbeat + + type, + create_time, + ip, + + + #{type}, + #{createTime}, + #{ip}, + + + + + update dc_external_platform_heartbeat + + type = #{type}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dc_external_platform_heartbeat where id = #{id} + + + + delete from dc_external_platform_heartbeat where id in + + #{id} + + + \ No newline at end of file