Merge remote-tracking branch 'origin/master'

# 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.java
master
魔神煜修罗皇 2 years ago
commit c2ddcf6b33
  1. 1
      pom.xml
  2. 2
      psdc-admin/src/main/resources/logback.xml
  3. 15
      psdc-business/src/main/java/com/psdc/entity/PsdcControlLog.java
  4. 36
      psdc-business/src/main/java/com/psdc/entity/vo/DeviceStatusVo.java
  5. 15
      psdc-business/src/main/java/com/psdc/mapper/PsdcControlLogMapper.java
  6. 17
      psdc-business/src/main/java/com/psdc/mapper/PsdcDeviceMapper.java
  7. 47
      psdc-business/src/main/java/com/psdc/service/IPsdcControlLogService.java
  8. 33
      psdc-business/src/main/java/com/psdc/service/IPsdcDeviceService.java
  9. 69
      psdc-business/src/main/java/com/psdc/service/impl/PsdcControlLogServiceImpl.java
  10. 78
      psdc-business/src/main/java/com/psdc/service/impl/PsdcDeviceServiceImpl.java
  11. 48
      psdc-business/src/main/resources/mapper/business/PsdcControlLogMapper.xml
  12. 65
      psdc-business/src/main/resources/mapper/business/PsdcDeviceMapper.xml
  13. 25
      psdc-common/src/main/java/com/psdc/exception/ControlException.java
  14. 7
      psdc-quartz/pom.xml
  15. 3
      psdc-ui/src/App.vue
  16. 0
      psdc-ui/src/api/control/timer.js
  17. BIN
      psdc-ui/src/assets/images/1.png
  18. BIN
      psdc-ui/src/assets/images/5.png
  19. BIN
      psdc-ui/src/assets/images/6.png
  20. BIN
      psdc-ui/src/assets/images/bg.png
  21. BIN
      psdc-ui/src/assets/images/headtitle.png
  22. BIN
      psdc-ui/src/assets/images/line.png
  23. BIN
      psdc-ui/src/assets/images/mainbox.png
  24. BIN
      psdc-ui/src/assets/images/wrapperbox.png
  25. BIN
      psdc-ui/src/assets/images/wrappertitle.png
  26. 10
      psdc-ui/src/router/index.js
  27. 16
      psdc-ui/src/views/analyse/nhfx/index.vue
  28. 16
      psdc-ui/src/views/analyse/nhtj/index.vue
  29. 113
      psdc-ui/src/views/bigview/index.vue
  30. 16
      psdc-ui/src/views/control/manual/index.vue
  31. 16
      psdc-ui/src/views/control/timer/index.vue
  32. 2
      psdc-ui/src/views/emonitor/db/index.vue
  33. 16
      psdc-ui/src/views/emonitor/drgl/index.vue
  34. 16
      psdc-ui/src/views/emonitor/frdl/index.vue
  35. 16
      psdc-ui/src/views/emonitor/kqyrb/index.vue
  36. 16
      psdc-ui/src/views/emonitor/sp/index.vue
  37. 16
      psdc-ui/src/views/emonitor/wdcgq/index.vue
  38. 16
      psdc-ui/src/views/emonitor/xrgl/index.vue
  39. 2
      psdc-ui/src/views/error/404.vue
  40. 16
      psdc-ui/src/views/system/cl/index.vue
  41. 16
      psdc-ui/src/views/system/tactics/index.vue
  42. 5
      psdc-web/pom.xml
  43. 66
      psdc-web/src/main/java/com/psdc/controller/control/ManualControl.java

@ -159,6 +159,7 @@
<module>psdc-common</module> <module>psdc-common</module>
<module>psdc-admin</module> <module>psdc-admin</module>
<module>psdc-business</module> <module>psdc-business</module>
<module>psdc-quartz</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>

@ -72,7 +72,7 @@
</appender> </appender>
<!-- 系统模块日志级别控制 --> <!-- 系统模块日志级别控制 -->
<logger name="com.example" level="info" /> <logger name="com.psdc" level="info" />
<!-- Spring日志级别控制 --> <!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" /> <logger name="org.springframework" level="warn" />

@ -48,6 +48,10 @@ public class PsdcControlLog implements Serializable {
* 控制结果1-控制中2-控制成功3-控制失败 * 控制结果1-控制中2-控制成功3-控制失败
*/ */
private Integer controlResult; private Integer controlResult;
/**
* 控制结果描述
*/
private String controlContext;
/** /**
* 创建者 * 创建者
*/ */
@ -64,4 +68,15 @@ public class PsdcControlLog implements Serializable {
* 更新时间 * 更新时间
*/ */
private String updateTime; private String updateTime;
public PsdcControlLog(Integer deviceId, String deviceName, String deviceSn, String controlKey, String controlValue, Integer controlResult,String controlContext, String createBy) {
this.deviceId = deviceId;
this.deviceName = deviceName;
this.deviceSn = deviceSn;
this.controlKey = controlKey;
this.controlValue = controlValue;
this.controlResult = controlResult;
this.controlContext = controlContext;
this.createBy = createBy;
}
} }

@ -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 ;
}

@ -1,11 +1,13 @@
package com.psdc.mapper; package com.psdc.mapper;
import com.psdc.entity.PsdcControlLog; import com.psdc.entity.PsdcControlLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.List; import java.util.List;
@Mapper
public interface PsdcControlLogMapper{ public interface PsdcControlLogMapper{
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
@ -14,14 +16,13 @@ public interface PsdcControlLogMapper{
* @return 实例对象 * @return 实例对象
*/ */
PsdcControlLog queryById(Integer controlLogId); PsdcControlLog queryById(Integer controlLogId);
/** /**
* 分页查询指定行数据 * 分页查询控制日志
* * @param psdcControlLog
* @param psdcControlLog 查询条件
* @param pageable 分页对象
* @return 对象列表
*/ */
List<PsdcControlLog> queryAllByLimit(PsdcControlLog psdcControlLog, @Param("pageable") Pageable pageable); List<PsdcControlLog> queryControlLogList(PsdcControlLog psdcControlLog);
/** /**
* 统计总行数 * 统计总行数
* *
@ -50,4 +51,6 @@ public interface PsdcControlLogMapper{
* @return 影响行数 * @return 影响行数
*/ */
int deleteById(Integer controlLogId); int deleteById(Integer controlLogId);
} }

@ -6,7 +6,7 @@ import com.psdc.entity.PsdcDevice;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository; import org.springframework.security.access.method.P;
/** /**
@ -66,4 +66,19 @@ public interface PsdcDeviceMapper{
* @return 影响行数 * @return 影响行数
*/ */
int deleteById(Integer deviceId); int deleteById(Integer deviceId);
/**
* 根据用户id查询设备
* @param userId
* @return
*/
List<PsdcDevice> queryByUserId(Long userId);
/**
* 根据设备id修改设备状态
* @param deviceId
* @return
*/
int updateDevRunStatusByDevId(@Param(value = "deviceId") Integer deviceId,
@Param(value = "runStatus") Integer runStatus);
} }

@ -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);
}

@ -1,7 +1,9 @@
package com.psdc.service; package com.psdc.service;
import com.psdc.entity.PsdcDevice; import com.psdc.entity.PsdcDevice;
import org.springframework.data.domain.PageRequest; import com.psdc.entity.vo.DeviceStatusVo;
import java.util.List;
public interface IPsdcDeviceService { public interface IPsdcDeviceService {
@ -13,6 +15,18 @@ public interface IPsdcDeviceService {
*/ */
PsdcDevice queryById(Integer deviceId); PsdcDevice queryById(Integer deviceId);
/**
* 根据用户id查询设备列表
* @return
*/
List<PsdcDevice> queryByUserId();
/**
* 查询所有设备状态
* @return
*/
List<DeviceStatusVo> queryDeviceStatus();
/** /**
* 新增数据 * 新增数据
* *
@ -20,6 +34,7 @@ public interface IPsdcDeviceService {
* @return 实例对象 * @return 实例对象
*/ */
PsdcDevice insert(PsdcDevice psdcDevice); PsdcDevice insert(PsdcDevice psdcDevice);
/** /**
* 更新数据 * 更新数据
* *
@ -35,4 +50,20 @@ public interface IPsdcDeviceService {
*/ */
boolean deleteById(Integer deviceId); boolean deleteById(Integer deviceId);
/**
* 更新设备状态
* @param deviceId
* @param runStatus
* @return
*/
int updateDeviceRunStatus(Integer deviceId,Integer runStatus);
/**
* 控制设备启动停止
* @param deviceId
* @param runStatus
* @return
*/
int controlDeviceStartAndStop(Integer deviceId,Integer runStatus);
} }

@ -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);
}
}

@ -1,18 +1,31 @@
package com.psdc.service.impl; package com.psdc.service.impl;
import com.psdc.entity.PsdcControlLog;
import com.psdc.entity.PsdcDevice; import com.psdc.entity.PsdcDevice;
import com.psdc.entity.vo.DeviceStatusVo;
import com.psdc.exception.ControlException;
import com.psdc.mapper.PsdcControlLogMapper;
import com.psdc.mapper.PsdcDeviceMapper; import com.psdc.mapper.PsdcDeviceMapper;
import com.psdc.service.IPsdcDeviceService; import com.psdc.service.IPsdcDeviceService;
import com.psdc.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
@Slf4j
public class PsdcDeviceServiceImpl implements IPsdcDeviceService{ public class PsdcDeviceServiceImpl implements IPsdcDeviceService{
@Autowired @Autowired
private PsdcDeviceMapper psdcDeviceMapper; private PsdcDeviceMapper psdcDeviceMapper;
@Autowired
private PsdcControlLogMapper psdcControlLogMapper;
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
@ -23,6 +36,23 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService{
return psdcDeviceMapper.queryById(deviceId); return psdcDeviceMapper.queryById(deviceId);
} }
/**
* 根据用户id查询设备列表
* @return
*/
public List<PsdcDevice> queryByUserId(){
return psdcDeviceMapper.queryByUserId(SecurityUtils.getUserId());
}
public List<DeviceStatusVo> queryDeviceStatus(){
List<PsdcDevice> psdcDevices = psdcDeviceMapper.queryByUserId(SecurityUtils.getUserId());
return psdcDevices.stream().map(psdcDevice -> {
DeviceStatusVo deviceStatusVo = new DeviceStatusVo();
BeanUtils.copyProperties(psdcDevice, deviceStatusVo);
return deviceStatusVo;
}).collect(Collectors.toList());
}
/** /**
* 新增数据 * 新增数据
* *
@ -55,4 +85,48 @@ public class PsdcDeviceServiceImpl implements IPsdcDeviceService{
int total = psdcDeviceMapper.deleteById(deviceId); int total = psdcDeviceMapper.deleteById(deviceId);
return total > 0; return total > 0;
} }
/**
* 更新设备状态
* @param deviceId
* @param runStatus
* @return
*/
@Override
public int updateDeviceRunStatus(Integer deviceId, Integer runStatus) {
return psdcDeviceMapper.updateDevRunStatusByDevId(deviceId,runStatus);
}
/**
* 控制设备启动停止
* @param deviceId
* @param runStatus
* @return
*/
@Override
public int controlDeviceStartAndStop(Integer deviceId, Integer runStatus) {
String s = "";
if(runStatus == 1){
s = "启动";
} else if ( runStatus == 2 ) {
s = "停止";
}
log.info("设备id:{}",deviceId);
PsdcDevice psdcDevice = psdcDeviceMapper.queryById(deviceId);
if(psdcDevice == null){
psdcControlLogMapper.insert(new PsdcControlLog(deviceId,null,null,"设备启停",s,2,"未找到该设备",SecurityUtils.getUsername()));
throw new ControlException("控制失败,未找到该设备");
}
//TODO 发送MQTT指令
// psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),"设备启停",s,2,"等待终端响应超时",SecurityUtils.getUsername()));
//发送成功
psdcControlLogMapper.insert(new PsdcControlLog(deviceId,psdcDevice.getDeviceName(),psdcDevice.getDeviceSn(),"设备启停",s,2,"控制成功",SecurityUtils.getUsername()));
return psdcDeviceMapper.updateDevRunStatusByDevId(deviceId,runStatus);
}
} }

@ -9,6 +9,7 @@
<result property="controlKey" column="control_key"/> <result property="controlKey" column="control_key"/>
<result property="controlValue" column="control_value"/> <result property="controlValue" column="control_value"/>
<result property="controlResult" column="control_result"/> <result property="controlResult" column="control_result"/>
<result property="controlContext" column="control_context"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
@ -17,16 +18,26 @@
<!-- 通过ID查询单条数据 --> <!-- 通过ID查询单条数据 -->
<select id="queryById" resultMap="PsdcControlLogMap"> <select id="queryById" resultMap="PsdcControlLogMap">
select select control_log_id,
control_log_id,device_id,device_name,device_sn,control_key,control_value,control_result,create_by,create_time,update_by,update_time device_id,
device_name,
device_sn,
control_key,
control_value,
control_result,
control_context,
create_by,
create_time,
update_by,
update_time
from psdc_control_log from psdc_control_log
where control_log_id = #{controlLogId} where control_log_id = #{controlLogId}
</select> </select>
<!--分页查询指定行数据--> <!--分页查询指定行数据-->
<select id="queryAllByLimit" resultMap="PsdcControlLogMap"> <select id="queryControlLogList" parameterType="com.psdc.entity.PsdcControlLog" resultMap="PsdcControlLogMap">
select select
control_log_id,device_id,device_name,device_sn,control_key,control_value,control_result,create_by,create_time,update_by,update_time control_log_id,device_id,device_name,device_sn,control_key,control_value,control_result,control_context,create_by,create_time,update_by,update_time
from psdc_control_log from psdc_control_log
<where> <where>
<if test="controlLogId != null and controlLogId != ''"> <if test="controlLogId != null and controlLogId != ''">
@ -50,6 +61,9 @@
<if test="controlResult != null and controlResult != ''"> <if test="controlResult != null and controlResult != ''">
and control_result = #{controlResult} and control_result = #{controlResult}
</if> </if>
<if test="controlContext != null and controlContext != ''">
and control_context = #{controlContext}
</if>
<if test="createBy != null and createBy != ''"> <if test="createBy != null and createBy != ''">
and create_by = #{createBy} and create_by = #{createBy}
</if> </if>
@ -63,7 +77,6 @@
and update_time = #{updateTime} and update_time = #{updateTime}
</if> </if>
</where> </where>
limit #{pageable.offset}, #{pageable.pageSize}
</select> </select>
<!--统计总行数--> <!--统计总行数-->
@ -92,6 +105,9 @@
<if test="controlResult != null and controlResult != ''"> <if test="controlResult != null and controlResult != ''">
and control_result = #{controlResult} and control_result = #{controlResult}
</if> </if>
<if test="controlContext != null and controlContext != ''">
and control_context = #{controlContext}
</if>
<if test="createBy != null and createBy != ''"> <if test="createBy != null and createBy != ''">
and create_by = #{createBy} and create_by = #{createBy}
</if> </if>
@ -109,17 +125,10 @@
<!--新增数据--> <!--新增数据-->
<insert id="insert"> <insert id="insert">
insert into psdc_control_log(control_log_id,device_id,device_name,device_sn,control_key,control_value,control_result,create_by,create_time,update_by,update_time) insert into psdc_control_log(device_id, device_name, device_sn, control_key, control_value, control_result,control_context,
values (#{controlLogId},#{deviceId},#{deviceName},#{deviceSn},#{controlKey},#{controlValue},#{controlResult},#{createBy},#{createTime},#{updateBy},#{updateTime}) create_by, create_time, update_by, update_time)
</insert> values (#{deviceId}, #{deviceName}, #{deviceSn}, #{controlKey}, #{controlValue}, #{controlResult},#{controlContext}, #{createBy},
sysdate(), #{updateBy}, #{updateTime})
<!-- 批量新增数据 -->
<insert id="insertBatch" >
insert into psdc_control_log(control_log_id,device_id,device_name,device_sn,control_key,control_value,control_result,create_by,create_time,update_by,update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.controlLogId},#{entity.deviceId},#{entity.deviceName},#{entity.deviceSn},#{entity.controlKey},#{entity.controlValue},#{entity.controlResult},#{entity.createBy},#{entity.createTime},#{entity.updateBy},#{entity.updateTime})
</foreach>
</insert> </insert>
@ -148,6 +157,9 @@
<if test="controlResult != null and controlResult != ''"> <if test="controlResult != null and controlResult != ''">
control_result = #{controlResult}, control_result = #{controlResult},
</if> </if>
<if test="controlContext != null and controlContext != ''">
and control_context = #{controlContext}
</if>
<if test="createBy != null and createBy != ''"> <if test="createBy != null and createBy != ''">
create_by = #{createBy}, create_by = #{createBy},
</if> </if>
@ -166,6 +178,8 @@
<!--通过主键删除--> <!--通过主键删除-->
<delete id="deleteById"> <delete id="deleteById">
delete from psdc_control_log where control_log_id = #{controlLogId} delete
from psdc_control_log
where control_log_id = #{controlLogId}
</delete> </delete>
</mapper> </mapper>

@ -21,11 +21,24 @@
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<!-- 通过ID查询单条数据 --> <!-- 通过ID查询单条数据 -->
<select id="queryById" resultMap="PsdcDeviceMap"> <select id="queryById" resultMap="PsdcDeviceMap">
select select device_id,
device_id,user_id,device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,photo_url,create_by,create_time,update_by,update_time user_id,
device_type,
device_sn,
device_name,
hard_version,
soft_version,
device_address,
start_time,
device_status,
device_runstatus,
photo_url,
create_by,
create_time,
update_by,
update_time
from psdc_device from psdc_device
where device_id = #{deviceId} where device_id = #{deviceId}
</select> </select>
@ -42,10 +55,31 @@
</where> </where>
</select> </select>
<select id="queryByUserId" resultMap="PsdcDeviceMap">
select device_id,
user_id,
device_type,
device_sn,
device_name,
hard_version,
soft_version,
device_address,
start_time,
device_status,
device_runstatus,
photo_url,
create_by,
create_time,
update_by,
update_time
from psdc_device
where user_id = #{userId}
</select>
<!--分页查询指定行数据--> <!--分页查询指定行数据-->
<select id="queryAllByLimit" resultMap="PsdcDeviceMap"> <select id="queryAllByLimit" resultMap="PsdcDeviceMap">
select select
device_id,user_id,device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,photo_url,create_by,create_time,update_by,update_time device_id,user_id,device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,device_runstatus,photo_url,create_by,create_time,update_by,update_time
from psdc_device from psdc_device
<where> <where>
<if test="deviceId != null and deviceId != ''"> <if test="deviceId != null and deviceId != ''">
@ -78,6 +112,9 @@
<if test="deviceStatus != null and deviceStatus != ''"> <if test="deviceStatus != null and deviceStatus != ''">
and device_status = #{deviceStatus} and device_status = #{deviceStatus}
</if> </if>
<if test="deviceRunstatus != null and deviceRunstatus != ''">
and device_runstatus = #{deviceRunstatus}
</if>
<if test="photoUrl != null and photoUrl != ''"> <if test="photoUrl != null and photoUrl != ''">
and photo_url = #{photoUrl} and photo_url = #{photoUrl}
</if> </if>
@ -132,6 +169,9 @@
<if test="deviceStatus != null and deviceStatus != ''"> <if test="deviceStatus != null and deviceStatus != ''">
and device_status = #{deviceStatus} and device_status = #{deviceStatus}
</if> </if>
<if test="deviceRunstatus != null and deviceRunstatus != ''">
and device_runstatus = #{deviceRunstatus}
</if>
<if test="photoUrl != null and photoUrl != ''"> <if test="photoUrl != null and photoUrl != ''">
and photo_url = #{photoUrl} and photo_url = #{photoUrl}
</if> </if>
@ -152,8 +192,12 @@
<!--新增数据--> <!--新增数据-->
<insert id="insert"> <insert id="insert">
insert into psdc_device(user_id,device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,photo_url,create_by,create_time,update_by,update_time) insert into psdc_device(user_id, device_type, device_sn, device_name, hard_version, soft_version,
values (#{userId},#{deviceType},#{deviceSn},#{deviceName},#{hardVersion},#{softVersion},#{deviceAddress},#{startTime},#{deviceStatus},#{photoUrl},#{createBy},#{createTime},#{updateBy},#{updateTime}) device_address, start_time, device_status, device_runstatus, photo_url, create_by,
create_time, update_by, update_time)
values (#{userId}, #{deviceType}, #{deviceSn}, #{deviceName}, #{hardVersion}, #{softVersion}, #{deviceAddress},
#{startTime}, #{deviceStatus}, #{deviceRunstatus}, #{photoUrl}, #{createBy}, #{createTime}, #{updateBy},
#{updateTime})
</insert> </insert>
<!-- 更新数据 --> <!-- 更新数据 -->
@ -190,6 +234,9 @@
<if test="deviceStatus != null and deviceStatus != ''"> <if test="deviceStatus != null and deviceStatus != ''">
device_status = #{deviceStatus}, device_status = #{deviceStatus},
</if> </if>
<if test="deviceRunstatus != null and deviceRunstatus != ''">
and device_runstatus = #{deviceRunstatus}
</if>
<if test="photoUrl != null and photoUrl != ''"> <if test="photoUrl != null and photoUrl != ''">
photo_url = #{photoUrl}, photo_url = #{photoUrl},
</if> </if>
@ -213,4 +260,10 @@
<delete id="deleteById"> <delete id="deleteById">
delete from psdc_device where device_id = #{deviceId} delete from psdc_device where device_id = #{deviceId}
</delete> </delete>
<update id="updateDevRunStatusByDevId">
update psdc_device set device_runstatus = #{runStatus} where device_id = #{deviceId}
</update>
</mapper> </mapper>

@ -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);
}
}

@ -3,20 +3,23 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>psdc</artifactId>
<groupId>com.psdc</groupId> <groupId>com.psdc</groupId>
<artifactId>psdc</artifactId>
<version>0.0.1</version> <version>0.0.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>psdc-quartz</artifactId> <artifactId>psdc-quartz</artifactId>
<description> <description>
quartz定时任务 quartz定时任务
</description> </description>
<dependencies> <dependencies>
<!-- 定时任务 --> <!-- 定时任务 -->
<dependency> <dependency>
<groupId>org.quartz-scheduler</groupId> <groupId>org.quartz-scheduler</groupId>

@ -20,6 +20,9 @@ onMounted(() => {
padding: 0; padding: 0;
box-sizing:border-box; box-sizing:border-box;
} }
h2{
margin: 0;
}
body{ body{
color: #f3ffff; color: #f3ffff;
font-size: 14px; font-size: 14px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

@ -59,15 +59,13 @@ export const constantRoutes = [
}, },
{ {
path: '', path: '',
component: Layout,
redirect: '/index',
children: [ children: [
{ {
path: '/index', path: 'bigview',
component: () => import('@/views/index'), component: () => import('@/views/bigview/index'),
name: 'Index', name: 'bigview',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '首页', icon: 'dashboard', affix: true }
} },
] ]
}, },
{ {

@ -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> <template>
<div class="app-container home"> <div class="app-container home">
<h1>首页</h1> <h1>电表</h1>
</div> </div>
</template> </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>

@ -17,7 +17,7 @@
<div class="bullshit__info"> <div class="bullshit__info">
对不起您正在寻找的页面不存在尝试检查URL的错误然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容 对不起您正在寻找的页面不存在尝试检查URL的错误然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容
</div> </div>
<router-link to="/controller" class="bullshit__return-home"> <router-link to="/control/manual" class="bullshit__return-home">
返回首页 返回首页
</router-link> </router-link>
</div> </div>

@ -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>

@ -32,6 +32,11 @@
<version>0.0.1</version> <version>0.0.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.psdc</groupId>
<artifactId>psdc-business</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies> </dependencies>

@ -1,32 +1,70 @@
package com.psdc.controller.control; 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.AjaxResult;
import com.psdc.core.domain.R;
import com.psdc.core.domain.entity.SysRole;
import com.psdc.core.domain.entity.SysUser; 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.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.Map;
@RestController @RestController
@RequestMapping("/control/manual") @RequestMapping("/control/manual")
public class ManualControl { public class ManualControl extends BaseController {
@Autowired
private IPsdcDeviceService psdcDeviceService;
@PreAuthorize("@ss.hasPermi('control:user:query')") @Autowired
@GetMapping("/deviceList") private IPsdcControlLogService psdcControlLogService;
public AjaxResult getControlDeviceList() {
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);
}
} }

Loading…
Cancel
Save