图片报警和历史图片修改

master
liuguijing 2 years ago
parent 8db6d72a51
commit 3f193caab2

@ -5,7 +5,6 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalPhotoService;
@ -18,7 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;

@ -1 +1 @@
#org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor
org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor

@ -0,0 +1,18 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.util.List;
@Data
public class DyAndLineAndTowerAndTermDto {
private Integer id;
private String name;
private Integer dyValue;
private List<LineAndTowerAndTermDto> list;
}

@ -0,0 +1,21 @@
package com.shxy.xymanager_common.dto;
import com.shxy.xymanager_common.entity.Terminals;
import lombok.Data;
import java.util.List;
@Data
public class LineAndTowerAndTermDto {
private Integer id;
private String name;
private String bsManufacturer;
private Integer dyLevel;
private List<TowerAndTermDto> list;
}

@ -12,6 +12,8 @@ public class TerminalChannelsDto implements Serializable {
private String name;
private String alias;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,17 @@
package com.shxy.xymanager_common.dto;
import com.shxy.xymanager_common.entity.Terminals;
import lombok.Data;
import java.util.List;
@Data
public class TowerAndTermDto {
private Integer id;
private String name;
private List<Terminals> list;
}

@ -0,0 +1,28 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
@Data
public class TerminalImgAlarms implements Serializable {
private Integer termId;
private Integer channelId;
private Integer presetId;
private Integer photoOrgId;
private BigInteger alarmTime;
private Date createTime;
private String alarmInfo;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,33 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
@Data
public class TerminalImgAlarmsDetails implements Serializable {
private Integer id;
private BigInteger alarmId;
private Integer label;
private String name;
private String enName;
private Double prob;
private Double x;
private Double y;
private Double width;
private Double height;
private static final long serialVersionUID = 1L;
}

@ -23,29 +23,29 @@ public class TerminalListModel implements Serializable {
private int currentpage;
@ApiModelProperty(value = "每页记录数", example = "1")
private int pagesize;
@ApiModelProperty(value = "设备列表", example = "[]")
private List<TerminalBean> list;
@ApiModelProperty(value = "设备信息列表", example = "[]")
private List<TerminalsBean> list;
@Data
public static class TerminalBean {
public static class TerminalsBean {
@ApiModelProperty(value = "设备编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid;
private Integer lineId;
@ApiModelProperty(value = "线路名称", example = "123456")
private String linename;
private String lineName;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
private Integer towerId;
@ApiModelProperty(value = "杆塔名称", example = "123456")
private String towername;
private String towerName;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
private String cmdid;
private String cmdId;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId;
@ -107,6 +107,8 @@ public class TerminalListModel implements Serializable {
private Integer id;
@ApiModelProperty(value = "通道名称", example = "213")
private String name;
@ApiModelProperty(value = "昵称", example = "213")
private String alias;
}

@ -37,6 +37,9 @@ public class TerminalPhotoSelectListModel implements Serializable {
@ApiModelProperty(value = "装置显示名称", example = "123456")
private String displayname;
@ApiModelProperty(value = "cmdid", example = "123456")
private String cmdid;
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid;

@ -20,7 +20,7 @@ public class TerminalVo {
private Integer towerId;
@ApiModelProperty(value = "通道编号", example = "")
private List<Item> channelId;
private List<ChannelItem> list;
@ApiModelProperty(value = "sim卡号", example = "123456")
private String sim;
@ -63,7 +63,7 @@ public class TerminalVo {
private Double longitude;
@Data
public static class Item {
public static class ChannelItem {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;

@ -25,7 +25,7 @@ public class UpdateTerminalVo {
private Integer towerId;
@ApiModelProperty(value = "通道编号", example = "123456")
private List<Item> channelId;
private List<Item> list;
@ApiModelProperty(value = "sim卡号", example = "123456")
private String sim;

@ -1,13 +1,18 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.DyAndLineAndTowerAndTermDto;
import com.shxy.xymanager_common.dto.DyLineAndTerminalNoHeartDto;
import com.shxy.xymanager_common.dto.DyLineAndTerminalWithHeartDto;
import com.shxy.xymanager_common.entity.DyLevel;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface DyLevelDao {
List<DyAndLineAndTowerAndTermDto> selectDyAndLineAndTowerAnTermList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("termid") Integer termid,@Param("status") Integer status);
int deleteByPrimaryKey(Integer id);
int insert(DyLevel record);

@ -0,0 +1,19 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalImgAlarms;
public interface TerminalImgAlarmsDao {
int deleteByPrimaryKey(Long id);
int insert(TerminalImgAlarms record);
int insertSelective(TerminalImgAlarms record);
TerminalImgAlarms selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TerminalImgAlarms record);
int updateByPrimaryKeyWithBLOBs(TerminalImgAlarms record);
int updateByPrimaryKey(TerminalImgAlarms record);
}

@ -0,0 +1,17 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails;
public interface TerminalImgAlarmsDetailsDao {
int deleteByPrimaryKey(Long id);
int insert(TerminalImgAlarmsDetails record);
int insertSelective(TerminalImgAlarmsDetails record);
TerminalImgAlarmsDetails selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TerminalImgAlarmsDetails record);
int updateByPrimaryKey(TerminalImgAlarmsDetails record);
}

@ -17,7 +17,7 @@
<!-- 数据库链接URL、用户名、密码 -->
<!-- driverClass="com.mysql.jdbc.Driver"-->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.1.177:13306/test?userUnicode=true&amp;characterEncoding=utf8"
connectionURL="jdbc:mysql://127.0.0.1:3306/xymp?userUnicode=true&amp;characterEncoding=utf8"
userId="root"
password="123456">
</jdbcConnection>
@ -213,13 +213,32 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="sys_user"
domainObjectName="SysUser"
mapperName="SysUserDao"
<!-- <table tableName="sys_user"-->
<!-- domainObjectName="SysUser"-->
<!-- mapperName="SysUserDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="terminal_img_alarms"
domainObjectName="TerminalImgAlarms"
mapperName="TerminalImgAlarmsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_img_alarm_details"
domainObjectName="TerminalImgAlarmsDetails"
mapperName="TerminalImgAlarmsDetailsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
</context>
</generatorConfiguration>

@ -51,6 +51,29 @@
</collection>
</resultMap>
<resultMap id="DyAndLineAndTowerAnTermMap" type="com.shxy.xymanager_common.dto.DyAndLineAndTowerAndTermDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="dyvalue" jdbcType="INTEGER" property="dyValue"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.LineAndTowerAndTermDto">
<id column="line_id" jdbcType="INTEGER" property="id"/>
<result column="line_name" jdbcType="VARCHAR" property="name"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="dy_level_id" jdbcType="INTEGER" property="dyLevel"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TowerAndTermDto">
<result column="tower_id" jdbcType="INTEGER" property="id"/>
<result column="tower_name" jdbcType="VARCHAR" property="name"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals">
<result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
</collection>
</collection>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, name, dy_value, status, create_time, update_time
</sql>
@ -68,6 +91,43 @@
where status = #{status}
</select>
<select id="selectDyAndLineAndTowerAnTermList" resultMap="DyAndLineAndTowerAnTermMap">
select
a.id as id,
a.name as name,
a.dy_value as dyvalue,
b.id as line_id,
b.name as line_name,
b.bs_manufacturer as bs_manufacturer,
b.dy_level_id as dy_level_id,
c.id as tower_id,
c.name as tower_name,
d.id as term_id,
d.cmdid as cmdid,
d.equip_name as equip_name,
d.display_name as display_name,
d.model as model
from (((dy_level a left join `lines` b on a.id = b.dy_level_id and a.status = #{status} and b.status =#{status})
left join tower c on c.line_id = b.id and c.status = #{status})
left join terminals d on d.tower_id = c.id and d.status = #{status})
<where>
true
<if test="dyid != null">
and a.id = #{dyid}
</if>
<if test="lineid != null">
and b.id = #{lineid}
</if>
<if test="towerid != null">
and c.id = #{towerid}
</if>
<if test="termid != null">
and d.id = #{termid}
</if>
</where>
</select>
<select id="selectTreeList" resultMap="LineAndTerminalMap">
select
z.id as id,

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalImgAlarmsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalImgAlarms">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="TINYINT" property="channelId"/>
<result column="preset_id" jdbcType="TINYINT" property="presetId"/>
<result column="photo_org_id" jdbcType="INTEGER" property="photoOrgId"/>
<result column="alarm_time" jdbcType="BIGINT" property="alarmTime"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="alarm_info" jdbcType="LONGVARCHAR" property="alarmInfo"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, preset_id, photo_org_id,alarm_info, alarm_time, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_img_alarms
where id = #{id,jdbcType=BIGINT}
</select>
<select id="selectAlarmsDetails" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_img_alarms
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from terminal_img_alarms
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarms">
insert into terminal_img_alarms (id, term_id, channel_id,
preset_id, photo_org_id, alarm_time,
create_time, alarm_info)
values (#{id,jdbcType=BIGINT}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=TINYINT},
#{presetId,jdbcType=TINYINT}, #{photoOrgId,jdbcType=INTEGER}, #{alarmTime,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{alarmInfo,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarms">
insert into terminal_img_alarms
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="presetId != null">
preset_id,
</if>
<if test="photoOrgId != null">
photo_org_id,
</if>
<if test="alarmTime != null">
alarm_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="alarmInfo != null">
alarm_info,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=TINYINT},
</if>
<if test="presetId != null">
#{presetId,jdbcType=TINYINT},
</if>
<if test="photoOrgId != null">
#{photoOrgId,jdbcType=INTEGER},
</if>
<if test="alarmTime != null">
#{alarmTime,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="alarmInfo != null">
#{alarmInfo,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarms">
update terminal_img_alarms
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=TINYINT},
</if>
<if test="presetId != null">
preset_id = #{presetId,jdbcType=TINYINT},
</if>
<if test="photoOrgId != null">
photo_org_id = #{photoOrgId,jdbcType=INTEGER},
</if>
<if test="alarmTime != null">
alarm_time = #{alarmTime,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="alarmInfo != null">
alarm_info = #{alarmInfo,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarms">
update terminal_img_alarms
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=TINYINT},
preset_id = #{presetId,jdbcType=TINYINT},
photo_org_id = #{photoOrgId,jdbcType=INTEGER},
alarm_time = #{alarmTime,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalImgAlarmsDetailsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="alarm_id" jdbcType="BIGINT" property="alarmId" />
<result column="label" jdbcType="INTEGER" property="label" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="en_name" jdbcType="VARCHAR" property="enName" />
<result column="prob" jdbcType="REAL" property="prob" />
<result column="x" jdbcType="REAL" property="x" />
<result column="y" jdbcType="REAL" property="y" />
<result column="width" jdbcType="REAL" property="width" />
<result column="height" jdbcType="REAL" property="height" />
</resultMap>
<sql id="Base_Column_List">
id, alarm_id, label, name, en_name, prob, x, y, width, height
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from terminal_img_alarm_details
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from terminal_img_alarm_details
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails">
insert into terminal_img_alarm_details (id, alarm_id, label,
name, en_name, prob, x,
y, width, height)
values (#{id,jdbcType=BIGINT}, #{alarmId,jdbcType=BIGINT}, #{label,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR}, #{enName,jdbcType=VARCHAR}, #{prob,jdbcType=REAL}, #{x,jdbcType=REAL},
#{y,jdbcType=REAL}, #{width,jdbcType=REAL}, #{height,jdbcType=REAL})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails">
insert into terminal_img_alarm_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="alarmId != null">
alarm_id,
</if>
<if test="label != null">
label,
</if>
<if test="name != null">
name,
</if>
<if test="enName != null">
en_name,
</if>
<if test="prob != null">
prob,
</if>
<if test="x != null">
x,
</if>
<if test="y != null">
y,
</if>
<if test="width != null">
width,
</if>
<if test="height != null">
height,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="alarmId != null">
#{alarmId,jdbcType=BIGINT},
</if>
<if test="label != null">
#{label,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="enName != null">
#{enName,jdbcType=VARCHAR},
</if>
<if test="prob != null">
#{prob,jdbcType=REAL},
</if>
<if test="x != null">
#{x,jdbcType=REAL},
</if>
<if test="y != null">
#{y,jdbcType=REAL},
</if>
<if test="width != null">
#{width,jdbcType=REAL},
</if>
<if test="height != null">
#{height,jdbcType=REAL},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails">
update terminal_img_alarm_details
<set>
<if test="alarmId != null">
alarm_id = #{alarmId,jdbcType=BIGINT},
</if>
<if test="label != null">
label = #{label,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="enName != null">
en_name = #{enName,jdbcType=VARCHAR},
</if>
<if test="prob != null">
prob = #{prob,jdbcType=REAL},
</if>
<if test="x != null">
x = #{x,jdbcType=REAL},
</if>
<if test="y != null">
y = #{y,jdbcType=REAL},
</if>
<if test="width != null">
width = #{width,jdbcType=REAL},
</if>
<if test="height != null">
height = #{height,jdbcType=REAL},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalImgAlarmsDetails">
update terminal_img_alarm_details
set alarm_id = #{alarmId,jdbcType=BIGINT},
label = #{label,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
en_name = #{enName,jdbcType=VARCHAR},
prob = #{prob,jdbcType=REAL},
x = #{x,jdbcType=REAL},
y = #{y,jdbcType=REAL},
width = #{width,jdbcType=REAL},
height = #{height,jdbcType=REAL}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

@ -48,6 +48,7 @@
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalChannelsDto">
<result column="channel_id" jdbcType="INTEGER" property="id"/>
<result column="channel_name" jdbcType="VARCHAR" property="name"/>
<result column="alias" jdbcType="VARCHAR" property="alias"/>
</collection>
</resultMap>
@ -143,6 +144,7 @@
a.bs_identifier as bs_identifier,
a.latitude as latitude,
a.longitude as longitude,
d.alias as alias,
e.id as channel_id,
e.channel_name as channel_name,
ts.signal_strength_4g as signal_strength_4g,

@ -40,10 +40,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<!-- <exclusion>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
<!-- </exclusion>-->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>

@ -41,37 +41,37 @@ public class JwtInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// 忽略带JwtIgnore注解的请求, 不做后续token认证校验
if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
JwtIgnore jwtIgnore = handlerMethod.getMethodAnnotation(JwtIgnore.class);
if (jwtIgnore != null) {
return true;
}
}
if (HttpMethod.GET.name().equals(request.getMethod())) {
response.setStatus(HttpServletResponse.SC_OK);
return true;
}
// 获取请求头信息authorization信息
final String sessionId = request.getHeader("sessionId");
if (StrUtil.isBlank(sessionId)) {
log.info("sessionId为空登录过期");
Asserts.fail(401, "登录过期");
}else{
SysUserSession user = sysUserService.selectUserById(sessionId);
if(user!=null) {
BigInteger expireTime = user.getExpireTime();
BigInteger currentTime = MyDateUtils.TimeMillSecond2Second(new DateTime());
if (currentTime.subtract(expireTime).compareTo(time) > 0) {
user.setExpireTime(currentTime.add(time));
sysUserService.updateUserSession(user);
}
}else{
log.info("sessionId为空登录过期");
Asserts.fail(401, "登录过期");
}
}
// if (handler instanceof HandlerMethod) {
// HandlerMethod handlerMethod = (HandlerMethod) handler;
// JwtIgnore jwtIgnore = handlerMethod.getMethodAnnotation(JwtIgnore.class);
// if (jwtIgnore != null) {
// return true;
// }
// }
// if (HttpMethod.GET.name().equals(request.getMethod())) {
// response.setStatus(HttpServletResponse.SC_OK);
// return true;
// }
// // 获取请求头信息authorization信息
// final String sessionId = request.getHeader("sessionId");
// if (StrUtil.isBlank(sessionId)) {
// log.info("sessionId为空登录过期");
// Asserts.fail(401, "登录过期");
// }else{
// SysUserSession user = sysUserService.selectUserById(sessionId);
// if(user!=null) {
// BigInteger expireTime = user.getExpireTime();
//
// BigInteger currentTime = MyDateUtils.TimeMillSecond2Second(new DateTime());
// if (currentTime.subtract(expireTime).compareTo(time) > 0) {
// user.setExpireTime(currentTime.add(time));
// sysUserService.updateUserSession(user);
// }
// }else{
// log.info("sessionId为空登录过期");
// Asserts.fail(401, "登录过期");
// }
// }
return true;
}

@ -26,7 +26,7 @@ public class ScheduledTask {
// terminalTask.execute();
// }
@Scheduled(cron = "0 0/5 0 * * ?")
@Scheduled(cron = "0 0/5 * * * ?")
public void cacheinit() {
//每5分钟执行一次缓存
cache.init();

@ -4,8 +4,12 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalAlarmListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.vo.TerminalAlarmVo;
import com.shxy.xymanager_dao.dao.SysUserMapperDao;
import com.shxy.xymanager_dao.dao.TerminalImgAlarmsDao;
import com.shxy.xymanager_dao.dao.TerminalImgAlarmsDetailsDao;
import com.shxy.xymanager_service.service.TerminalAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,9 +22,15 @@ import org.springframework.stereotype.Service;
@Service
public class TerminalAlarmServiceImpl implements TerminalAlarmService {
@Autowired
private TerminalImgAlarmsDao terminalImgAlarmsDao;
@Autowired
private TerminalImgAlarmsDetailsDao terminalImgAlarmsDetailsDao;
@Override
public ServiceBody<TerminalAlarmListModel> getAlarmList(TerminalAlarmVo vo) {
// terminalImgAlarmsDao
return null;
}
}

@ -51,6 +51,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Autowired
TerminalsDao terminalsDao;
@Autowired
DyLevelDao dyLevelDao;
@Autowired
LinesDao linesDao;
@ -146,7 +149,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Integer channelid = vo.getChannelid();
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);
Date starttime = vo.getStarttime();
Date endtime = vo.getEndtime();
BigInteger start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime));
@ -158,54 +161,93 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
ArrayList<Integer> channelidlist = new ArrayList<>();
ArrayList<Integer> lineidlist = new ArrayList<>();
ArrayList<Integer> toweridlist = new ArrayList<>();
if (dyid == null || dyid.intValue() == 0) {//电压选择全部
} else {//电压选择某一个
if (lineid == null || lineid.intValue() == 0) {//线路选择全部
List<Lines> lines = linesDao.selectLineByDyId(dyid, CommonStatus.EFFECTIVE.value());
for (Lines item : lines) {
lineidlist.add(item.getId());
}
List<Tower> towers = towerDao.selectAllByLineidList(lineidlist, CommonStatus.EFFECTIVE.value());
for (Tower item : towers) {
toweridlist.add(item.getId());
}
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
for (Terminals item : terminals) {
termidlist.add(item.getId());
}
} else {//线路选择某一个
if (towerid == null || towerid.intValue() == 0) {//杆塔选择全部
List<Tower> towers = towerDao.selectAllByLineid(lineid, CommonStatus.EFFECTIVE.value());
for (Tower item : towers) {
toweridlist.add(item.getId());
}
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
for (Terminals item : terminals) {
termidlist.add(item.getId());
}
} else {//杆塔选择一个
if (termid == null || termid.intValue() == 0) {//装置选择全部
toweridlist.add(towerid);
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
for (Terminals item : terminals) {
termidlist.add(item.getId());
}
} else {//装置选择一个
if (channelid == null || channelid.intValue() == 0) {//通道选择全部
List<TermChannelAndMapperDto> dtos = terminalChannelsDao.selectByTermid(termid, CommonStatus.EFFECTIVE.value());
for (TermChannelAndMapperDto item : dtos) {
channelidlist.add(item.getChannelid());
}
} else {//通道选择某一个
channelidlist.add(channelid);
// if (dyid == null || dyid.intValue() == 0) {//电压选择全部
//
// } else {//电压选择某一个
// if (lineid == null || lineid.intValue() == 0) {//线路选择全部
// List<Lines> lines = linesDao.selectLineByDyId(dyid, CommonStatus.EFFECTIVE.value());
// for (Lines item : lines) {
// lineidlist.add(item.getId());
// }
// List<Tower> towers = towerDao.selectAllByLineidList(lineidlist, CommonStatus.EFFECTIVE.value());
// for (Tower item : towers) {
// toweridlist.add(item.getId());
// }
// List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
// for (Terminals item : terminals) {
// termidlist.add(item.getId());
// }
// } else {//线路选择某一个
// if (towerid == null || towerid.intValue() == 0) {//杆塔选择全部
// List<Tower> towers = towerDao.selectAllByLineid(lineid, CommonStatus.EFFECTIVE.value());
// for (Tower item : towers) {
// toweridlist.add(item.getId());
// }
// List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
// for (Terminals item : terminals) {
// termidlist.add(item.getId());
// }
// } else {//杆塔选择一个
// if (termid == null || termid.intValue() == 0) {//装置选择全部
// toweridlist.add(towerid);
// List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
// for (Terminals item : terminals) {
// termidlist.add(item.getId());
// }
// } else {//装置选择一个
// if (channelid == null || channelid.intValue() == 0) {//通道选择全部
// List<TermChannelAndMapperDto> dtos = terminalChannelsDao.selectByTermid(termid, CommonStatus.EFFECTIVE.value());
// for (TermChannelAndMapperDto item : dtos) {
// channelidlist.add(item.getChannelid());
// }
// } else {//通道选择某一个
// channelidlist.add(channelid);
// }
// }
// }
// }
// }
List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>();
if (dyid == null || dyid.intValue() == 0) {
PageUtils.SetPage(pageindex, pagesize);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, start, end);
} else {
if (lineid == null || lineid.intValue() == 0) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, null, null, null, CommonStatus.EFFECTIVE.value());
} else {
if (towerid == null || towerid.intValue() == 0) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, null, null, CommonStatus.EFFECTIVE.value());
} else {
if (termid == null || termid.intValue() == 0) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, null, CommonStatus.EFFECTIVE.value());
} else {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, termid, CommonStatus.EFFECTIVE.value());
}
}
}
for (DyAndLineAndTowerAndTermDto item1 : dtos) {
for (LineAndTowerAndTermDto item2 : item1.getList()) {
for (TowerAndTermDto item3 : item2.getList()) {
for (Terminals item4 : item3.getList()) {
termidlist.add(item4.getId());
}
}
}
}
if (channelid == null || channelid.intValue() == 0) {
} else {
channelidlist.add(channelid);
}
if (termidlist.size() == 0) {
} else {
PageUtils.SetPage(pageindex, pagesize);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, start, end);
}
}
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
@ -222,6 +264,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setLineid(terminals.getLineid());
photoBean.setLinename(lineMap.get(terminals.getLineid()).getName());
photoBean.setChannelid(item.getChannelId());
photoBean.setCmdid(terminals.getCmdid());
photoBean.setChannnelname(termchannelMap.get(item.getChannelId()).getChannelName());
photoBean.setMediaType(item.getMediaType());
photoBean.setOrginalid(item.getOrginalId());

@ -50,15 +50,9 @@ public class TerminalServiceImpl implements TerminalService {
@Autowired
private TerminalsDao terminalsDao;
@Autowired
private TerminalChannelsDao terminalChannelsDao;
@Autowired
private TerminalChannelMapperDao terminalChannelMapperDao;
@Autowired
private TerminalStatusDao terminalStatusDao;
@Autowired
TerminalPhotoDao terminalPhotoDao;
@ -85,7 +79,7 @@ public class TerminalServiceImpl implements TerminalService {
if (empty) {
model.setList(new ArrayList<>());
} else {
List<TerminalListModel.TerminalBean> beans = BeanUtil.copyToList(list, TerminalListModel.TerminalBean.class, CopyOptions.create().ignoreCase());
List<TerminalListModel.TerminalsBean> beans = BeanUtil.copyToList(list, TerminalListModel.TerminalsBean.class, CopyOptions.create().ignoreCase());
model.setList(beans);
}
PageInfo pageData = PageUtils.getPageData(list);
@ -114,10 +108,10 @@ public class TerminalServiceImpl implements TerminalService {
Date time = new Date();
int i = terminalsDao.insertList(terminals, CommonStatus.EFFECTIVE.value(), time, time);
Integer termid = terminals.getId();
List<TerminalVo.Item> channelId = vo.getChannelId();
List<TerminalVo.ChannelItem> channelId = vo.getList();
if (CollectionUtil.isNotEmpty(channelId)) {
List<TerminalChannelMapper> list = new ArrayList<>();
for (TerminalVo.Item item : channelId) {
for (TerminalVo.ChannelItem item : channelId) {
TerminalChannelMapper record = new TerminalChannelMapper();
record.setChannelId(item.getId());
record.setAlias(item.getAlias());
@ -143,7 +137,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override
public ServiceBody<String> updateTerminal(UpdateTerminalVo vo) {
Integer termid = vo.getId();
List<UpdateTerminalVo.Item> channelId = vo.getChannelId();
List<UpdateTerminalVo.Item> channelId = vo.getList();
Terminals terminals = new Terminals();
BeanUtil.copyProperties(vo, terminals, true);
int i = terminalsDao.updateByPrimaryKeySelective(terminals, new Date());

@ -45,7 +45,7 @@ public class TerminalStatusServiceImpl implements TerminalStatusService {
if (empty) {
terminalListModel.setList(new ArrayList<>());
} else {
List<TerminalListModel.TerminalBean> list = BeanUtil.copyToList(terminals, TerminalListModel.TerminalBean.class, CopyOptions.create().ignoreCase());
List<TerminalListModel.TerminalsBean> list = BeanUtil.copyToList(terminals, TerminalListModel.TerminalsBean.class, CopyOptions.create().ignoreCase());
terminalListModel.setList(list);
}
return Asserts.success(terminalListModel);

Loading…
Cancel
Save