# Conflicts: # psdc-business/src/main/java/com/psdc/mapper/PsdcDeviceMapper.java # psdc-business/src/main/resources/mapper/business/PsdcDeviceMapper.xml # psdc-web/src/main/java/com/psdc/controller/control/ManualControl.javamaster
@ -0,0 +1,36 @@ |
||||
package com.psdc.entity.vo; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
@Component |
||||
public class DeviceStatusVo { |
||||
|
||||
/** |
||||
* 设备id |
||||
*/ |
||||
private Integer deviceId; |
||||
|
||||
/** |
||||
* 设备类型:1-监测设备,2-运行设备 |
||||
*/ |
||||
private Integer deviceType; |
||||
/** |
||||
* 设备名称 |
||||
*/ |
||||
private String deviceName; |
||||
/** |
||||
* 设备sn |
||||
*/ |
||||
private String deviceSn; |
||||
/** 图片地址 */ |
||||
private String photoUrl ; |
||||
/** 设备运行状态:1-开启,2-关闭 */ |
||||
private Integer deviceRunstatus ; |
||||
|
||||
} |
@ -0,0 +1,47 @@ |
||||
package com.psdc.service; |
||||
|
||||
import com.psdc.entity.PsdcControlLog; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 控制日志;(psdc_control_log)表服务接口 |
||||
* @date : 2023-5-9 |
||||
*/ |
||||
public interface IPsdcControlLogService { |
||||
/** |
||||
* 通过ID查询单条数据 |
||||
* |
||||
* @param controlLogId 主键 |
||||
* @return 实例对象 |
||||
*/ |
||||
PsdcControlLog queryById(Integer controlLogId); |
||||
|
||||
/** |
||||
* 新增数据 |
||||
* |
||||
* @param psdcControlLog 实例对象 |
||||
* @return 实例对象 |
||||
*/ |
||||
PsdcControlLog insert(PsdcControlLog psdcControlLog); |
||||
/** |
||||
* 更新数据 |
||||
* |
||||
* @param psdcControlLog 实例对象 |
||||
* @return 实例对象 |
||||
*/ |
||||
PsdcControlLog update(PsdcControlLog psdcControlLog); |
||||
/** |
||||
* 通过主键删除数据 |
||||
* |
||||
* @param controlLogId 主键 |
||||
* @return 是否成功 |
||||
*/ |
||||
boolean deleteById(Integer controlLogId); |
||||
|
||||
/** |
||||
* 分页查询控制日志 |
||||
* @param psdcControlLog |
||||
*/ |
||||
List<PsdcControlLog> query(PsdcControlLog psdcControlLog); |
||||
} |
@ -0,0 +1,69 @@ |
||||
package com.psdc.service.impl; |
||||
|
||||
import com.psdc.entity.PsdcControlLog; |
||||
import com.psdc.mapper.PsdcControlLogMapper; |
||||
import com.psdc.service.IPsdcControlLogService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 控制日志;(psdc_control_log)表服务实现类 |
||||
* @date : 2023-5-9 |
||||
*/ |
||||
@Service |
||||
public class PsdcControlLogServiceImpl implements IPsdcControlLogService { |
||||
@Autowired |
||||
private PsdcControlLogMapper psdcControlLogMapper; |
||||
|
||||
/** |
||||
* 通过ID查询单条数据 |
||||
* |
||||
* @param controlLogId 主键 |
||||
* @return 实例对象 |
||||
*/ |
||||
public PsdcControlLog queryById(Integer controlLogId){ |
||||
return psdcControlLogMapper.queryById(controlLogId); |
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 新增数据 |
||||
* |
||||
* @param psdcControlLog 实例对象 |
||||
* @return 实例对象 |
||||
*/ |
||||
public PsdcControlLog insert(PsdcControlLog psdcControlLog){ |
||||
psdcControlLogMapper.insert(psdcControlLog); |
||||
return psdcControlLog; |
||||
} |
||||
|
||||
/** |
||||
* 更新数据 |
||||
* |
||||
* @param psdcControlLog 实例对象 |
||||
* @return 实例对象 |
||||
*/ |
||||
public PsdcControlLog update(PsdcControlLog psdcControlLog){ |
||||
psdcControlLogMapper.update(psdcControlLog); |
||||
return queryById(psdcControlLog.getControlLogId()); |
||||
} |
||||
|
||||
/** |
||||
* 通过主键删除数据 |
||||
* |
||||
* @param controlLogId 主键 |
||||
* @return 是否成功 |
||||
*/ |
||||
public boolean deleteById(Integer controlLogId){ |
||||
int total = psdcControlLogMapper.deleteById(controlLogId); |
||||
return total > 0; |
||||
} |
||||
|
||||
@Override |
||||
public List<PsdcControlLog> query(PsdcControlLog psdcControlLog) { |
||||
return psdcControlLogMapper.queryControlLogList(psdcControlLog); |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.psdc.exception; |
||||
|
||||
public class ControlException extends RuntimeException{ |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public ControlException() { |
||||
super(); |
||||
} |
||||
|
||||
public ControlException(String message) { |
||||
super(message); |
||||
} |
||||
|
||||
public ControlException(String message, Throwable cause) { |
||||
super(message, cause); |
||||
} |
||||
|
||||
public ControlException(Throwable cause) { |
||||
super(cause); |
||||
} |
||||
|
||||
protected ControlException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { |
||||
super(message, cause, enableSuppression, writableStackTrace); |
||||
} |
||||
} |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 562 KiB |
After Width: | Height: | Size: 550 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.0 KiB |
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>能耗分析</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>能耗统计</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,113 @@ |
||||
<template> |
||||
<div class="home"> |
||||
<div class="header"> |
||||
<h2>电能替代分布式控制试验平台</h2> |
||||
<router-link :to="{path:'control/manual'}" tag="div" class="back">返回后台</router-link> |
||||
</div> |
||||
<div class="main"> |
||||
<div class="left"> |
||||
<div class="left_top"> |
||||
<div class="title">电磁锅炉</div> |
||||
</div> |
||||
<div class="left_bottom"></div> |
||||
</div> |
||||
<div class="middle"></div> |
||||
<div class="right"> |
||||
<div class="right_top"></div> |
||||
<div class="right_bottom"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.home{ |
||||
height: 100%; |
||||
background-image: url("../../assets/images/bg.png"); |
||||
background-size: 100% 100%; |
||||
.header{ |
||||
position: relative; |
||||
width: 100%; |
||||
height: 70px; |
||||
background-image: url("../../assets/images/headtitle.png"); |
||||
background-size: 100% 100%; |
||||
h2{ |
||||
font-size: 36px; |
||||
color: #AFEAFF; |
||||
font-weight: bold; |
||||
text-align: center; |
||||
line-height: 70px; |
||||
} |
||||
.back{ |
||||
position: absolute; |
||||
top: 5px; |
||||
right: 20px; |
||||
font-size: 16px; |
||||
color: #fff; |
||||
padding: 8px 15px; |
||||
background-color: #2c3e50; |
||||
} |
||||
} |
||||
.main{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
flex-wrap: nowrap; |
||||
padding: 0 20px; |
||||
width: 100%; |
||||
height: calc(100% - 70px); |
||||
.left{ |
||||
width: 24%; |
||||
height: 100%; |
||||
.left_top{ |
||||
width: 100%; |
||||
height: 49%; |
||||
border: 1px solid red; |
||||
margin-bottom: 4%; |
||||
} |
||||
.left_bottom{ |
||||
width: 100%; |
||||
height: 49%; |
||||
border: 1px solid red; |
||||
} |
||||
} |
||||
.middle{ |
||||
width: 50.5%; |
||||
height: 100%; |
||||
border: 1px solid red; |
||||
} |
||||
.right{ |
||||
width: 24%; |
||||
height: 100%; |
||||
.right_top{ |
||||
width: 100%; |
||||
height: 49%; |
||||
border: 1px solid red; |
||||
margin-bottom: 4%; |
||||
} |
||||
.right_bottom{ |
||||
width: 100%; |
||||
height: 49%; |
||||
border: 1px solid red; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.title{ |
||||
width: 45%; |
||||
height: 30px; |
||||
margin: 0 auto; |
||||
color: #19C3F4; |
||||
font-size: 18px; |
||||
font-weight: bold; |
||||
text-align: center; |
||||
background-image: url("../../assets/images/wrappertitle.png"); |
||||
background-size: 100% 100%; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>手动控制</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>定时控制</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -1,6 +1,6 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>首页</h1> |
||||
<h1>电表</h1> |
||||
</div> |
||||
</template> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>电热锅炉</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>发热电缆</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>空气源热泵</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>沙盘</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>温度传感器</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>蓄热锅炉</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>策略管理</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -0,0 +1,16 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>策略管理</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
@ -1,32 +1,70 @@ |
||||
package com.psdc.controller.control; |
||||
|
||||
import com.alibaba.fastjson2.JSONObject; |
||||
import com.psdc.core.controller.BaseController; |
||||
import com.psdc.core.domain.AjaxResult; |
||||
import com.psdc.core.domain.R; |
||||
import com.psdc.core.domain.entity.SysRole; |
||||
import com.psdc.core.domain.entity.SysUser; |
||||
import com.psdc.utils.StringUtils; |
||||
import com.psdc.core.page.TableDataInfo; |
||||
import com.psdc.domain.SysConfig; |
||||
import com.psdc.entity.PsdcControlLog; |
||||
import com.psdc.entity.vo.DeviceStatusVo; |
||||
import com.psdc.service.IPsdcControlLogService; |
||||
import com.psdc.service.IPsdcDeviceService; |
||||
import org.aspectj.weaver.loadtime.Aj; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.PathVariable; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
import java.util.Map; |
||||
|
||||
|
||||
@RestController |
||||
@RequestMapping("/control/manual") |
||||
public class ManualControl { |
||||
public class ManualControl extends BaseController { |
||||
|
||||
|
||||
@Autowired |
||||
private IPsdcDeviceService psdcDeviceService; |
||||
|
||||
@PreAuthorize("@ss.hasPermi('control:user:query')") |
||||
@GetMapping("/deviceList") |
||||
public AjaxResult getControlDeviceList() { |
||||
@Autowired |
||||
private IPsdcControlLogService psdcControlLogService; |
||||
|
||||
return null; |
||||
/** |
||||
* 查询设备状态列表 |
||||
* @return |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('control:manual:devlist')") |
||||
@GetMapping("/deviceStatusList") |
||||
public AjaxResult getControlDeviceList() { |
||||
List<DeviceStatusVo> deviceStatusVos = psdcDeviceService.queryDeviceStatus(); |
||||
return AjaxResult.success("设备状态列表",deviceStatusVos); |
||||
} |
||||
|
||||
/** |
||||
* 控制设备启停 |
||||
* @param jsonObject |
||||
* @return |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('control:manual:startstop')") |
||||
@PostMapping("/startAndStop") |
||||
public AjaxResult deviceStartAndStop(@RequestBody JSONObject jsonObject){ |
||||
int i = psdcDeviceService.controlDeviceStartAndStop(jsonObject.getInteger("deviceId"), jsonObject.getInteger("runStatus")); |
||||
if ( i == 1){ |
||||
return AjaxResult.success("控制成功"); |
||||
} else { |
||||
return AjaxResult.error("控制失败,请联系管理员"); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取调控日志列表 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('control:timer:controlLogList')") |
||||
@GetMapping("/controlLogList") |
||||
public TableDataInfo controlLogList(PsdcControlLog psdcControlLog) { |
||||
startPage(); |
||||
List<PsdcControlLog> list = psdcControlLogService.query(psdcControlLog); |
||||
return getDataTable(list); |
||||
} |
||||
} |
||||
|