全局划线参数修改 表名修改 告警图片优化 杆塔顺序修改

master
liuguijing 2 years ago
parent d03730cf7a
commit 8f9b69211c

@ -0,0 +1,55 @@
package com.shxy.xymanager_admin.controller;
import com.shxy.xymanager_common.annotation.Log;
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_service.service.GloablParamsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "全局参数设置接口", tags = "全局参数设置接口相关")
@RestController
@Slf4j
public class GloableParamsController extends BaseController {
@Autowired
GloablParamsService gloableParamsService;
@ApiOperation(value = "查询图片绘制开关状态", notes = "查询图片绘制开关状态接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getMarkEnableStatus")
@Log(title = "新增杆塔", type = "查询")
public ResponseReult<Integer> getMarkEnableStatus() {
ServiceBody<Integer> serviceBody = gloableParamsService.getMarkEnableStatus();
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@ApiOperation(value = "新增杆塔", notes = "新增杆塔接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/updateMarkEnableStatus")
@Log(title = "新增杆塔", type = "查询")
public ResponseReult<String> updateMarkEnableStatus(@RequestParam("status") Integer status) {
ServiceBody<String> serviceBody = gloableParamsService.updateMarkEnableStatus(status);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -10,7 +10,7 @@ import com.shxy.xymanager_common.model.AllTowerListModel;
import com.shxy.xymanager_common.model.TowerListModel;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TowerIdVo;
import com.shxy.xymanager_common.vo.TowerVo;
import com.shxy.xymanager_common.vo.TowersVo;
import com.shxy.xymanager_common.vo.UpdateTowerVo;
import com.shxy.xymanager_service.service.TowerService;
import io.swagger.annotations.Api;
@ -38,7 +38,7 @@ public class TowerController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addTower")
@Log(title = "新增杆塔", type = "查询")
public ResponseReult<String> addTower(@RequestBody @Validated TowerVo vo) {
public ResponseReult<String> addTower(@RequestBody @Validated TowersVo vo) {
ServiceBody<String> serviceBody = towerService.addTower(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
@ -64,7 +64,7 @@ public class TowerController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTowerInfo")
@Log(title = "获取杆塔", type = "查询")
public ResponseReult<TowerDto> getTowerInfo(@RequestParam("id")Integer id) {
public ResponseReult<TowerDto> getTowerInfo(@RequestParam("id") Integer id) {
ServiceBody<TowerDto> serviceBody = towerService.getTowerInfo(id);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
@ -113,5 +113,4 @@ public class TowerController extends BaseController {
}
}

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

@ -14,6 +14,10 @@ public class TowerDto implements Serializable {
private String lineName;
private Integer order;
private Integer status;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,22 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class GlobalParams implements Serializable {
private Integer id;
private String paramName;
private String paramValue;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -1,14 +0,0 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class Tower implements Serializable {
private Integer id;
private String name;
private Integer lineId;
}

@ -0,0 +1,20 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class Towers implements Serializable {
private Integer id;
private String name;
private Integer lineId;
private Integer order;
private Integer status;
private Date createTime;
private Date updateTime;
}

@ -0,0 +1,27 @@
package com.shxy.xymanager_common.enums;
/**
*
* "ImgMark"
*
* @author
*/
public enum GloableParamsType {
ImgMark("img_mark");
private String name;
GloableParamsType(String name) {
this.name = name;
}
@Override
public String toString() {
return this.name;
}
public String value() {
return this.name;
}
}

@ -32,5 +32,8 @@ public class AllTowerListModel implements Serializable {
@ApiModelProperty(value = "线路编号", example = "123456")
private String lineName;
@ApiModelProperty(value = "杆塔排序", example = "123456")
private Integer order;
}
}

@ -44,4 +44,7 @@ public class PhotoMarkModel implements Serializable {
@ApiModelProperty(value = "通道编号和名称", example = "213")
private List<TermChannelCoordinateDto> list;
@ApiModelProperty(value = "", example = "0--关 1---开启")
private Integer markEnable;
}

@ -41,6 +41,9 @@ public class TowerListModel implements Serializable {
@ApiModelProperty(value = "线路编号", example = "123456")
private String lineName;
@ApiModelProperty(value = "杆塔排序", example = "123456")
private Integer order;
}

@ -4,31 +4,34 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel(value = "杆塔对象", description = "杆塔对象描述")
public class TowerVo {
public class TowersVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "杆塔对象数组", required = true, example = "A0001")
private List<TowerVo.TowerItem> list;
private List<TowersVo.TowerItem> list;
@Data
public static class TowerItem {
@ApiModelProperty(value = "线路编号", example = "123456")
@NotBlank(message = "线路编号不能缺少")
@NotNull(message = "线路编号不能缺少")
private Integer lineId;
@ApiModelProperty(value = "杆塔名称", example = "12345678")
@NotBlank(message = "杆塔名称")
private String name;
}
@ApiModelProperty(value = "杆塔排序顺序", example = "12345678")
@NotNull(message = "杆塔排序顺序")
private Integer order;
}
}

@ -23,6 +23,9 @@ public class UpdateTowerVo {
@NotNull(message = "线路编号不能缺少")
private Integer lineId;
@ApiModelProperty(value = "排序", example = "单位")
@NotNull(message = "排序")
private Integer order;
}

@ -0,0 +1,25 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.GlobalParams;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface GlobalParamsDao {
int deleteByPrimaryKey(Long id);
int insert(GlobalParams record);
int insertSelective(GlobalParams record);
GlobalParams selectByPrimaryKey(Long id);
List<GlobalParams> selectAll();
int updateByPrimaryKeySelective(GlobalParams record);
int updateByPrimaryKey(GlobalParams record);
int updateByParamName(@Param("data") GlobalParams record, @Param("updatetime") Date updatetime);
}

@ -15,7 +15,7 @@ public interface TerminalPhotoDao {
List<TerminalPhoto> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") List<Integer> channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
List<TerminalPhoto> selectPhotoListByOrginIdList(@Param("orginidlist") List<BigInteger> orginidlist);
List<TerminalPhoto> selectPhotoListByOrginIdAndTermList(@Param("list") List<TerminalImgAlarmsDto> list);
List<TerminalPhoto> selectPhotoListByTermList(@Param("terminalidlist") List<Integer> terminalid, @Param("channelidlist") List<Integer> channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);

@ -1,7 +1,7 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.Tower;
import com.shxy.xymanager_common.entity.Towers;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@ -10,17 +10,17 @@ import java.util.List;
public interface TowerDao {
int addTower(@Param("list") List<Tower> towerLst, @Param("date")Date date);
int addTower(@Param("list") List<Towers> towersLst, @Param("status") Integer status, @Param("date") Date date);
List<TowerDto> selectAll(@Param("status") Integer status);
List<TowerDto> selectAll(@Param("status") Integer status);
List<Tower> selectAllByLineid(@Param("lineid") Integer id,@Param("status") Integer status);
List<Towers> selectAllByLineid(@Param("lineid") Integer id, @Param("status") Integer status);
List<Tower> selectAllByLineidList(@Param("lineidlist") List<Integer> id,@Param("status") Integer status);
List<Towers> selectAllByLineidList(@Param("lineidlist") List<Integer> id, @Param("status") Integer status);
int deleteById(@Param("list") List<Tower> record, @Param("status") Integer status, @Param("update") Date update);
int deleteById(@Param("list") List<Towers> record, @Param("status") Integer status, @Param("update") Date update);
int updateByPrimaryKeySelective(@Param("data") Tower record, @Param("update") Date update);
int updateByPrimaryKeySelective(@Param("data") Towers record, @Param("update") Date update);
TowerDto getInfoByPrimaryKey(@Param("id") Integer id, @Param("status") Integer status);
TowerDto getInfoByPrimaryKey(@Param("id") Integer id, @Param("status") Integer status);
}

@ -237,9 +237,17 @@
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="terminal_img_alarm_params"
domainObjectName="TerminalImgAlarmParams"
mapperName="TerminalImgAlarmParamsDao"
<!-- <table tableName="terminal_img_alarm_params"-->
<!-- domainObjectName="TerminalImgAlarmParams"-->
<!-- mapperName="TerminalImgAlarmParamsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="global_params"
domainObjectName="GlobalParams"
mapperName="GlobalParamsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->

@ -109,7 +109,7 @@
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 towers 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
@ -147,7 +147,7 @@
f.last_heartbeat as last_heartbeat
from ((((dy_level z left join `lines` x on z.id = x.dy_level_id and x.status = #{status} and z.status = #{status})
left join terminals y on x.id = y.line_id and y.status = #{status})
left join tower t on y.tower_id = t.id)
left join towers t on y.tower_id = t.id)
left join terminal_status f on f.term_id = y.id)
</select>

@ -0,0 +1,108 @@
<?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.GlobalParamsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.GlobalParams">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="param_name" jdbcType="VARCHAR" property="paramName"/>
<result column="param_value" jdbcType="VARCHAR" property="paramValue"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, param_name, param_value, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from global_params
where id = #{id,jdbcType=BIGINT}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from global_params
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from global_params
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
insert into global_params (id, param_name, param_value,
create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{paramName,jdbcType=VARCHAR}, #{paramValue,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
insert into global_params
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="paramName != null">
param_name,
</if>
<if test="paramValue != null">
param_value,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="paramName != null">
#{paramName,jdbcType=VARCHAR},
</if>
<if test="paramValue != null">
#{paramValue,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
update global_params
<set>
<if test="paramName != null">
param_name = #{paramName,jdbcType=VARCHAR},
</if>
<if test="paramValue != null">
param_value = #{paramValue,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
update global_params
set param_name = #{paramName,jdbcType=VARCHAR},
param_value = #{paramValue,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByParamName" parameterType="com.shxy.xymanager_common.entity.GlobalParams">
update global_params
set
param_value = #{data.paramValue},
update_time = #{updatetime}
where param_name = #{data.paramName}
</update>
</mapper>

@ -17,21 +17,21 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user
from sys_users
where uid = #{uid,jdbcType=INTEGER}
</select>
<select id="selectByUserName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user
from sys_users
where user_name = #{username}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_user
delete from sys_users
where uid = #{uid,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.SysUser">
insert into sys_user (uid, user_name, status,
insert into sys_users (uid, user_name, status,
nick_name, password, role,
create_time, update_time)
values (#{uid,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
@ -39,7 +39,7 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.SysUser">
insert into sys_user
insert into sys_users
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
uid,
@ -94,7 +94,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.SysUser">
update sys_user
update sys_users
<set>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
@ -121,7 +121,7 @@
where uid = #{uid,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.SysUser">
update sys_user
update sys_users
set user_name = #{userName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
nick_name = #{nickName,jdbcType=VARCHAR},

@ -25,11 +25,11 @@
user_name,
`status`
FROM
sys_user u
sys_users u
</sql>
<select id="selectByUserAccount" resultMap="SysUserResult">
SELECT * FROM sys_user WHERE user_name = #{userName}
SELECT * FROM sys_users WHERE user_name = #{userName}
</select>
<select id="selectPages" resultMap="SysUserResult">
@ -41,7 +41,7 @@
</select>
<select id="checkUserNameUnique" parameterType="String" resultType="java.lang.Integer">
select count(1) from sys_user where user_name = #{userName}
select count(1) from sys_users where user_name = #{userName}
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
@ -60,11 +60,11 @@
</select>
<update id="resetUserPwd">
update sys_user set password = #{password} where user_name = #{userName}
update sys_users set password = #{password} where user_name = #{userName}
</update>
<insert id="addUser" parameterType="com.shxy.xymanager_common.bean.SysUser">
insert into sys_user(user_name,nick_name,password,role,create_time)
insert into sys_users(user_name,nick_name,password,role,create_time)
values(#{userName},#{userName},#{password},#{role},#{createTime})
</insert>
@ -89,7 +89,7 @@
</update>
<update id="updateById" parameterType="com.shxy.xymanager_common.bean.SysUser">
update `sys_user`
update `sys_users`
<set>
<if test="userName!= null">
user_name = #{userName},
@ -111,7 +111,7 @@
</update>
<update id="deleteUserById" parameterType="java.lang.String">
update `sys_user`
update `sys_users`
set status = 0
where uid = #{userId}
</update>
@ -129,7 +129,7 @@
nick_name as nickName,
create_time as createTime,
role
from sys_user
from sys_users
WHERE status = #{status}
order by create_time desc
</select>

@ -111,16 +111,24 @@
</if>
order by photo_time desc
</select>
<select id="selectPhotoListByOrginIdList" resultMap="BaseResultMap">
<select id="selectPhotoListByOrginIdAndTermList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
<if test="orginidlist != null and orginidlist.size > 0">
where orginal_id in
<foreach collection="orginidlist" item="item" index="index" open="(" close=")" separator=",">
#{item}
<if test="list != null and list.size > 0">
where
<foreach collection="list" item="item" index="index" separator="or">
(
<if test="item.photoOrgId != null">
orginal_id = #{item.photoOrgId}
</if>
<if test="item.termId != null ">
and term_id = #{item.termId}
</if>
)
</foreach>
</if>
</select>
<select id="selectPhotoListByTermList" resultMap="BaseResultMap">
select

@ -154,7 +154,7 @@
ts.last_heartbeat as last_heartbeat
from
(((((terminals a left join `lines` b on a.line_id = b.id )
left join tower c on a.tower_id = c.id)
left join towers c on a.tower_id = c.id)
left join terminal_channel_mapper d on a.id = d.term_id)
left join terminal_channels e on d.channel_id = e.id)
left join terminal_status ts on ts.term_id = a.id)

@ -1,14 +1,18 @@
<?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.TowerDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.Tower">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.Towers">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="line_id" jdbcType="INTEGER" property="lineId"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="order" jdbcType="INTEGER" property="order"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, name, line_id
id, name, line_id,status,order
</sql>
<select id="selectAll" resultType="com.shxy.xymanager_common.dto.TowerDto">
@ -16,27 +20,30 @@
t.id as id,
t.name as name,
l.id as lineId,
l.name as lineName
from tower t,
l.name as lineName,
t.order as `order`,
t.status as status
from towers t,
`lines` l
where t.line_id = l.id and t.status = #{status,jdbcType=INTEGER} order by t.create_time desc
where t.line_id = l.id and t.status = #{status,jdbcType=INTEGER} order by t.`order` asc
</select>
<select id="selectAllByLineid" resultType="com.shxy.xymanager_common.entity.Tower">
<select id="selectAllByLineid" resultType="com.shxy.xymanager_common.entity.Towers">
select
id, name, line_id
from tower
id, name, line_id,`order`,status
from towers
where status = #{status}
<if test="lineid != null">
and line_id = #{lineid}
</if>
order by `order` asc
</select>
<select id="selectAllByLineidList" resultType="com.shxy.xymanager_common.entity.Tower">
<select id="selectAllByLineidList" resultType="com.shxy.xymanager_common.entity.Towers">
select
id, name, line_id
from tower
id, name, line_id,`order`,status
from towers
where status = #{status}
<if test="lineidlist != null and lineidlist.size>0">
and line_id in
@ -44,6 +51,7 @@
#{item}
</foreach>
</if>
order by `order` asc
</select>
<select id="getInfoByPrimaryKey" resultType="com.shxy.xymanager_common.dto.TowerDto">
@ -51,25 +59,27 @@
t.id as id,
t.name as name,
l.id as lineId,
l.name as lineName
from tower t,
l.name as lineName,
t.order as `order`,
t.status as status
from towers t,
`lines` l
where t.line_id = l.id and t.status = #{status,jdbcType=INTEGER} and t.id = #{id,jdbcType=INTEGER}
order by t.`order` asc
</select>
<insert id="addTower" parameterType="java.util.List">
insert into `tower`
(name,line_id,create_time,update_time)
insert into `towers`
(name,line_id,status,`order`,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.name},#{item.lineId},#{date},#{date})
(#{item.name},#{item.lineId},#{status},#{item.order},#{date},#{date})
</foreach>
</insert>
<update id="deleteById">
update `tower`
update `towers`
set status = #{status},
update_time = #{update}
where id in
@ -78,8 +88,8 @@
</foreach>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.Tower">
update `tower`
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.Towers">
update `towers`
<set>
<if test="data.name != null">
name = #{data.name,jdbcType=VARCHAR},
@ -87,6 +97,10 @@
<if test="data.lineId != null">
line_id = #{data.lineId,jdbcType=INTEGER},
</if>
<if test="data.order != null">
`order` = #{data.order},
</if>
update_time = #{update}
</set>
where id = #{data.id}
</update>

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

@ -2,10 +2,7 @@ package com.shxy.xymanager_service.cache;
import com.shxy.xymanager_common.dto.LineAndDyNameDto;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalImgAlarmParams;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_dao.dao.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -28,6 +25,8 @@ public class XyCache {
//告警类型
public static Map<Integer, TerminalImgAlarmParams> alarmParamMap = new HashMap<Integer, TerminalImgAlarmParams>();
public static Map<String, String> globalParams = new HashMap<String, String>();
@Autowired
private LinesDao linesDao;
@Autowired
@ -40,6 +39,8 @@ public class XyCache {
private TerminalChannelMapperDao terminalChannelMapperDao;
@Autowired
private TerminalImgAlarmParamsDao terminalImgAlarmParamsDao;
@Autowired
private GlobalParamsDao globalParamsDao;
@PostConstruct
public void init() {
@ -51,6 +52,7 @@ public class XyCache {
termchannelMap.clear();
termchannelMapMap.clear();
alarmParamMap.clear();
globalParams.clear();
List<LineAndDyNameDto> lineAndDyNameDtos = linesDao.selectAll(CommonStatus.EFFECTIVE.value());
for (LineAndDyNameDto lineitem : lineAndDyNameDtos) {
@ -83,6 +85,11 @@ public class XyCache {
alarmParamMap.put(item.getLabel(), item);
}
List<GlobalParams> globalParamslist = globalParamsDao.selectAll();
for (GlobalParams item : globalParamslist) {
globalParams.put(item.getParamName(), item.getParamValue());
}
}
@PreDestroy

@ -0,0 +1,59 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.GlobalParams;
import com.shxy.xymanager_common.enums.GloableParamsType;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_dao.dao.GlobalParamsDao;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.GloablParamsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map;
/**
*
*/
@Service
@Slf4j
public class GloablParamsServiceImpl implements GloablParamsService {
@Autowired
GlobalParamsDao globalParamsDao;
/**
*
*
* @return
*/
@Override
public ServiceBody<Integer> getMarkEnableStatus() {
Map<String, String> globalParams = XyCache.globalParams;
String s = globalParams.get(GloableParamsType.ImgMark.value());
Integer integer = Integer.valueOf(s);
return Asserts.success(integer);
}
/**
*
*
* @return
*/
@Override
public ServiceBody<String> updateMarkEnableStatus(Integer status) {
GlobalParams record = new GlobalParams();
record.setParamName(GloableParamsType.ImgMark.value());
record.setParamValue(String.valueOf(status));
int i = globalParamsDao.updateByParamName(record, new Date());
if (i != 0) {
XyCache.globalParams.put(GloableParamsType.ImgMark.value(), String.valueOf(status));
return Asserts.success("修改成功");
} else {
return Asserts.error("修改失败");
}
}
}

@ -10,7 +10,7 @@ import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.entity.Tower;
import com.shxy.xymanager_common.entity.Towers;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.LineAndGtAndChannelListModel;
@ -165,7 +165,7 @@ public class LineServiceImpl implements LineService {
}
} else if (type == 3) {
if (id != null) {
List<Tower> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value());
List<Towers> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value());
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
} else if (type == 4) {
@ -211,7 +211,7 @@ public class LineServiceImpl implements LineService {
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
} else {
if (id != null) {
List<Tower> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value());
List<Towers> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value());
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
}

@ -73,7 +73,7 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
Integer label = vo.getLabel();
List<TerminalImgAlarmParams> labellist = new ArrayList<>();
Map<Integer, TerminalImgAlarmParams> alarmParamMap = XyCache.alarmParamMap;
if (label != null && label == -1) {
if (label == null || label == -1) {
alarmParamMap.forEach((key, value) -> {
labellist.add(value);
});
@ -124,14 +124,14 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
Map<String, TerminalChannelMapper> termchannelMapMap = XyCache.termchannelMapMap;
ArrayList<BigInteger> originidlist = new ArrayList<>();
for (TerminalImgAlarmsDto item : list) {
originidlist.add(item.getPhotoOrgId());
}
List<TerminalPhoto> alarmphotolist = terminalPhotoDao.selectPhotoListByOrginIdList(originidlist);
Map<BigInteger, TerminalPhoto> map = new HashMap<>();
// ArrayList<BigInteger> originidlist = new ArrayList<>();
// for (TerminalImgAlarmsDto item : list) {
// originidlist.add(item.getPhotoOrgId());
// }
List<TerminalPhoto> alarmphotolist = terminalPhotoDao.selectPhotoListByOrginIdAndTermList(list);
Map<String, TerminalPhoto> map = new HashMap<>();
for (TerminalPhoto item : alarmphotolist) {
map.put(item.getOrginalId(), item);
map.put(item.getTermId() + "#" + item.getOrginalId(), item);
}
// List<TerminalAlarmListModel.AlarmBean> alarmBeans = BeanUtil.copyToList(list, TerminalAlarmListModel.AlarmBean.class, CopyOptions.create().ignoreCase());
@ -169,7 +169,7 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
alarmBean.setPresetId(item.getPresetId());
alarmBean.setPhotoOrgId(item.getPhotoOrgId());
if (map != null) {
TerminalPhoto terminalPhoto = map.get(item.getPhotoOrgId());
TerminalPhoto terminalPhoto = map.get(item.getTermId() + "#" + item.getPhotoOrgId());
if (terminalPhoto != null) {
String path = terminalPhoto.getPath();
Integer mediaType = terminalPhoto.getMediaType();

@ -12,9 +12,11 @@ import com.shxy.xymanager_common.dto.DyLineAndTerminalNoHeartDto;
import com.shxy.xymanager_common.dto.PhotoMarkDto;
import com.shxy.xymanager_common.dto.TerminalInfoDto;
import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto;
import com.shxy.xymanager_common.entity.GlobalParams;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.enums.GloableParamsType;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils;
@ -23,6 +25,7 @@ import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@ -37,6 +40,7 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
@ -366,7 +370,11 @@ public class TerminalServiceImpl implements TerminalService {
@Override
public ServiceBody<PhotoMarkModel> getCoordinate(MarkReqVo vo) {
Map<String, String> globalParams = XyCache.globalParams;
String s = globalParams.get(GloableParamsType.ImgMark.value());
Integer integer = Integer.valueOf(s);
PhotoMarkModel model = new PhotoMarkModel();
model.setMarkEnable(integer);
PhotoMarkDto dto = null;
if (vo.getNeedPic() == 0) {
dto = terminalPhotoDao.selectPhotoMark(vo);

@ -6,15 +6,15 @@ import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.Tower;
import com.shxy.xymanager_common.entity.Towers;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.AllTowerListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TowerListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TowerDao;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TowerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -38,10 +38,10 @@ public class TowerServiceImpl implements TowerService {
private TowerDao towerDao;
@Override
public ServiceBody addTower(TowerVo vo) {
List<Tower> towerLst = BeanUtil.copyToList(vo.getList(), Tower.class, CopyOptions.create().ignoreCase());
public ServiceBody addTower(TowersVo vo) {
List<Towers> towersLst = BeanUtil.copyToList(vo.getList(), Towers.class, CopyOptions.create().ignoreCase());
Date date = new Date();
int i = towerDao.addTower(towerLst, date);
int i = towerDao.addTower(towersLst,CommonStatus.EFFECTIVE.value(), date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
@ -80,7 +80,7 @@ public class TowerServiceImpl implements TowerService {
@Override
public ServiceBody<String> deleteTower(TowerIdVo vo) {
List<Tower> lines = BeanUtil.copyToList(vo.getList(), Tower.class);
List<Towers> lines = BeanUtil.copyToList(vo.getList(), Towers.class);
Date date = new Date();
int i = towerDao.deleteById(lines, CommonStatus.DELETE.value(), date);
if (i != 0) {
@ -92,9 +92,9 @@ public class TowerServiceImpl implements TowerService {
@Override
public ServiceBody<String> updateTower(UpdateTowerVo vo) {
Tower tower = new Tower();
BeanUtil.copyProperties(vo, tower, true);
int i = towerDao.updateByPrimaryKeySelective(tower, new Date());
Towers towers = new Towers();
BeanUtil.copyProperties(vo, towers, true);
int i = towerDao.updateByPrimaryKeySelective(towers, new Date());
if (i != 0) {
return Asserts.success("修改成功");
} else {

@ -0,0 +1,28 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
/**
*
*
* @author jingjing
*/
public interface GloablParamsService {
/**
*
*
* @return
*/
ServiceBody<Integer> getMarkEnableStatus();
/**
*
*
* @return
*/
ServiceBody<String> updateMarkEnableStatus(Integer status);
}

@ -19,7 +19,7 @@ public interface TowerService {
*
* @return
*/
ServiceBody addTower(TowerVo vo);
ServiceBody addTower(TowersVo vo);
/**
*

Loading…
Cancel
Save