新增装置接口修改

jni
liuguijing 2 years ago
parent 5d7f3ce1d8
commit c681ebbb5c

@ -6,6 +6,7 @@ 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.model.DyLineTreeAndChannelListModel;
import com.shxy.xymanager_common.model.TerminalAllChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.vo.*;
@ -31,10 +32,10 @@ public class ChannelController extends BaseController {
TerminalChannelService terminalChannelService;
@ApiOperation(value = "获取所有通道列表", notes = "获取所有通道列表接口", httpMethod = "POST")
@ApiOperation(value = "获取所有通道列表分页", notes = "获取所有通道列表接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getChannelList")
@Log(title = "获取所有通道列表", type = "查询")
@Log(title = "获取所有通道列表分页", type = "查询")
public ResponseReult<TerminalChannelListModel> getChannelList(@RequestBody @Validated PageVo vo) {
ServiceBody<TerminalChannelListModel> serviceBody = terminalChannelService.getChannelList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
@ -44,6 +45,19 @@ public class ChannelController extends BaseController {
}
}
@ApiOperation(value = "获取所有通道列表", notes = "获取所有通道列表接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getAllChannelList")
@Log(title = "获取所有通道列表", type = "查询")
public ResponseReult<TerminalAllChannelListModel> getAllChannelList() {
ServiceBody<TerminalAllChannelListModel> serviceBody = terminalChannelService.getAllChannelList();
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("/addChannelList")

@ -8,11 +8,9 @@ import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.model.TerminalPhotoListForOpenModel;
import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.model.TerminalPhotoSelectListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_common.vo.TerminalAndTimeForOpenVo;
import com.shxy.xymanager_common.vo.TerminalPhotoVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -63,13 +61,12 @@ public class TerminalPhotoController extends BaseController {
}
}
@ApiOperation(value = "图片查询", notes = "图片查询接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getPhotoList")
@Log(title = "图片查询", type = "查询")
public ResponseReult<TerminalPhotoListModel> getPhotoList(@RequestBody @Validated TerminalAndChannelIdAndTimeVo vo) {
ServiceBody<TerminalPhotoListModel> serviceBody = terminalPhotoService.getTerminalPhotoList(vo);
public ResponseReult<TerminalPhotoSelectListModel> getPhotoList(@RequestBody @Validated TerminalPhotoSelectVo vo) {
ServiceBody<TerminalPhotoSelectListModel> serviceBody = terminalPhotoService.getPhotoList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -6,6 +6,7 @@ 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.dto.TowerDto;
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;
@ -33,7 +34,6 @@ public class TowerController extends BaseController {
@Autowired
TowerService towerService;
@ApiOperation(value = "新增杆塔", notes = "新增杆塔接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addTower")
@ -73,8 +73,6 @@ public class TowerController extends BaseController {
}
}
@ApiOperation(value = "删除杆塔", notes = "删除杆塔接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/deleteTower")
@ -101,7 +99,18 @@ public class TowerController extends BaseController {
}
}
@ApiOperation(value = "获取所有杆塔", notes = "获取所有杆塔", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getAllTower")
@Log(title = "获取所有杆塔", type = "查询")
public ResponseReult<AllTowerListModel> getAllTower() {
ServiceBody<AllTowerListModel> serviceBody = towerService.getAllTower();
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}

@ -16,6 +16,10 @@ public class TerminalPhoto implements Serializable {
private Integer presetId;
private BigInteger orginalId;
private Integer mediaType;
private Integer width;
private Integer height;

@ -0,0 +1,38 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "所有杆塔列表", description = "获取杆塔线路列表信息")
public class AllTowerListModel implements Serializable {
@ApiModelProperty(value = "所有杆塔列表", example = "[]")
private List<TowerBean> list;
@Data
public static class TowerBean {
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "杆塔名称", example = "AAAA")
private String name;
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineId;
@ApiModelProperty(value = "线路编号", example = "123456")
private String lineName;
}
}

@ -0,0 +1,38 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "通道列表", description = "通道列表信息")
public class TerminalAllChannelListModel implements Serializable {
@ApiModelProperty(value = "通道列表对象", example = "[]")
private List<ChannelBean> list;
@Data
public static class ChannelBean {
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "通道名称", example = "123456")
private String channelname;
@ApiModelProperty(value = "通道状态", example = "123456")
private Integer status;
@ApiModelProperty(value = "分辨率W", example = "123456")
private Integer maxResolutionWidth;
@ApiModelProperty(value = "分辨率H", example = "123456")
private Integer maxResolutionHeight;
}
}

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@ -17,10 +18,13 @@ public class TerminalPhotoListForOpenModel implements Serializable {
@ApiModelProperty(value = "总记录数", example = "120")
private long total;
@ApiModelProperty(value = "总页数", example = "120")
private int totalpage;
@ApiModelProperty(value = "当前页", example = "1")
private int currentpage;
@ApiModelProperty(value = "每页记录数", example = "1")
private int pagesize;
@ -30,38 +34,24 @@ public class TerminalPhotoListForOpenModel implements Serializable {
@Data
public static class PhotoBean {
@ApiModelProperty(value = "图片id", example = "12321")
private Long id;
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer channelId;
private String cmdid;
@ApiModelProperty(value = "预置位编号", example = "123456")
private Integer presetId;
@ApiModelProperty(value = "宽度", example = "123456")
private Integer width;
@ApiModelProperty(value = "高度", example = "123456")
private Integer height;
@ApiModelProperty(value = "图片编号", example = "123456")
private BigInteger orginalid;
@ApiModelProperty(value = "大小", example = "123456")
private Integer fileSize;
@ApiModelProperty(value = "图片类型", example = "123456")
private Integer mediatype;
@ApiModelProperty(value = "拍照时间", example = "123456")
private Date photoTime;
@ApiModelProperty(value = "接收时间", example = "123456")
private Date recvTime;
@ApiModelProperty(value = "照片路径", example = "123456")
private String path;
@ApiModelProperty(value = "拍照方式", example = "123456")
private Integer manualRequest;
}
}

@ -0,0 +1,53 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "图片查询列表对象", description = "图片查询列表对象信息")
public class TerminalPhotoSelectListModel implements Serializable {
@ApiModelProperty(value = "总记录数", example = "120")
private long total;
@ApiModelProperty(value = "总页数", example = "120")
private int totalpage;
@ApiModelProperty(value = "当前页", example = "1")
private int currentpage;
@ApiModelProperty(value = "每页记录数", example = "1")
private int pagesize;
@ApiModelProperty(value = "照片对象", example = "[]")
private List<PhotoBean> list;
@Data
public static class PhotoBean {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termid;
@ApiModelProperty(value = "预置位编号", example = "123456")
private Integer presetId;
@ApiModelProperty(value = "图片编号", example = "123456")
private BigInteger orginalid;
@ApiModelProperty(value = "图片类型", example = "123456")
private Integer mediatype;
@ApiModelProperty(value = "拍照时间", example = "123456")
private Date photoTime;
@ApiModelProperty(value = "照片路径", example = "123456")
private String path;
}
}

@ -10,6 +10,7 @@ import java.util.Date;
import java.util.List;
@Data
@Validated
@ApiModel(value = "装置和通道编号和查询时间", description = "装置和通道编号和查询时间描述")
public class TerminalAndChannelIdAndTimeVo {

@ -16,13 +16,13 @@ public class TerminalAndTimeForOpenVo {
@NotNull(message = "装置编号不能缺少")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer terminalid;
private String cmdid;
@NotEmpty(message = "查询开始时间不能缺少")
@NotNull(message = "查询开始时间不能缺少")
@ApiModelProperty(value = "查询开始时间", example = "123455")
private Date starttime;
@NotEmpty(message = "查询结束时间不能缺少")
@NotNull(message = "查询结束时间不能缺少")
@ApiModelProperty(value = "查询结束时间", example = "123455")
private Date endtime;

@ -0,0 +1,45 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@Data
@Validated
@ApiModel(value = "图片查询参数对象", description = "装置和通道编号和查询时间描述")
public class TerminalPhotoSelectVo {
@ApiModelProperty(value = "电压编号", example = "123455")
private Integer dyid;
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer lineid;
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer towerid;
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelid;
@NotNull(message = "查询时间不能缺少")
@ApiModelProperty(value = "查询时间", example = "123455")
private Date starttime;
@NotNull(message = "查询结束时间不能缺少")
@ApiModelProperty(value = "查询结束时间", example = "123455")
private Date endtime;
@Min(value = 1, message = "分页位置最小从1开始")
@ApiModelProperty(value = "分页位置从1开始", required = true, example = "1")
private int pageindex;
@Min(value = 1, message = "分页大小最小为1")
@ApiModelProperty(value = "分页大小", required = true, example = "1")
private int pagesize;
}

@ -12,57 +12,53 @@ import java.util.List;
@Data
@ApiModel(value = "装置信息对象", description = "设备信息对象描述")
public class TerminalVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "设备对象数组", example = "A0001")
private List<TerminalItem> list;
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid;
@Data
private static class TerminalItem {
@ApiModelProperty(value = "线路编号", example = "123456")
@NotBlank(message = "线路编号不能缺少")
private Integer lineid;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
@ApiModelProperty(value = "杆塔编号", example = "123456")
@NotBlank(message = "杆塔编号不能缺少")
private Integer towerid;
@ApiModelProperty(value = "通道编号", example = "123456")
private List<Integer> channelid;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少")
private String cmdid;
@ApiModelProperty(value = "sim卡号", example = "123456")
private String sim;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少")
private String cmdid;
@ApiModelProperty(value = "装置名称", example = "名称名称")
private String equipName;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId;
@ApiModelProperty(value = "显示名", example = "名称名称")
private String displayName;
@ApiModelProperty(value = "装置名称", example = "名称名称")
private String equipName;
@ApiModelProperty(value = "装置型号", example = "型号型号")
private String model;
@ApiModelProperty(value = "显示名", example = "名称名称")
private String displayName;
@ApiModelProperty(value = "装置基本信息版本号", example = "型号型号")
private String essentialInfoVersion;
@ApiModelProperty(value = "装置号", example = "型号型号")
private String model;
@ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台")
@NotBlank(message = "是否带云台不能缺少")
private Byte hasPan;
@ApiModelProperty(value = "装置基本信息版本号", example = "型号型号")
private String essentialInfoVersion;
@ApiModelProperty(value = "生产厂家", example = "生产厂家")
private String bsManufacturer;
@ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台")
private Byte hasPan;
@ApiModelProperty(value = "生产日期", example = "2022-06-12")
private Date bsProductionDate;
@ApiModelProperty(value = "生产厂家", example = "生产厂家")
private String bsManufacturer;
@ApiModelProperty(value = "出厂编号", example = "123456")
private String bsIdentifier;
@ApiModelProperty(value = "生产日期", example = "2022-06-12")
private Date bsProductionDate;
@ApiModelProperty(value = "纬度", example = "21321")
private Double latitude;
@ApiModelProperty(value = "出厂编号", example = "123456")
private String bsIdentifier;
@ApiModelProperty(value = "经度", example = "213")
private Double longitude;
}
@ApiModelProperty(value = "纬度", example = "21321")
private Double latitude;
@ApiModelProperty(value = "经度", example = "213")
private Double longitude;
}

@ -1,7 +1,10 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TerminalChannelMapperDao {
@ -11,6 +14,8 @@ public interface TerminalChannelMapperDao {
int insertSelective(TerminalChannelMapper record);
int insertList(@Param("list") List<TerminalChannelMapper> record, @Param("createat") Date create, @Param("updateat") Date update);
List<TerminalChannelMapper> selectByTermid(Integer id);
TerminalChannelMapper selectByPrimaryKey(Integer id);

@ -10,14 +10,17 @@ public interface TerminalsDao {
List<Terminals> selectAll(@Param("status") Integer status);
Terminals selectByCmdid(@Param("cmdid") String cmdid, @Param("status") Integer status);
int insertList(@Param("list") List<Terminals> record,@Param("status") Integer status,@Param("createat") Date create,@Param("updateat") Date update);
Terminals selectByToweridAndLineid(@Param("lineid") Integer lineid,@Param("towerid") Integer towerid, @Param("status") Integer status);
int deleteById(@Param("list") List<Terminals> record, @Param("status") Integer status,@Param("updateat") Date update);
int insertList(@Param("item") Terminals record, @Param("status") Integer status, @Param("createat") Date create, @Param("updateat") Date update);
int deleteById(@Param("list") List<Terminals> record, @Param("status") Integer status, @Param("updateat") Date update);
Terminals selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(@Param("data") Terminals record,@Param("updateat") Date update);
int updateByPrimaryKeySelective(@Param("data") Terminals record, @Param("updateat") Date update);
int updateByPrimaryKey(Terminals record);

@ -71,6 +71,18 @@
</if>
</trim>
</insert>
<insert id="insertList" parameterType="java.util.List">
insert into terminal_channel_mapper
(term_id, channel_id,
create_time, update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{createat},#{updateat})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalChannelMapper">
update terminal_channel_mapper
<set>

@ -6,6 +6,8 @@
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="preset_id" jdbcType="INTEGER" property="presetId"/>
<result column="orginal_id" jdbcType="INTEGER" property="orginalId"/>
<result column="media_type" jdbcType="INTEGER" property="mediaType"/>
<result column="width" jdbcType="INTEGER" property="width"/>
<result column="height" jdbcType="INTEGER" property="height"/>
<result column="file_size" jdbcType="INTEGER" property="fileSize"/>
@ -15,7 +17,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time,
id, term_id, channel_id,orginal_id, media_type,preset_id, width, height, file_size, photo_time, recv_time,
path, create_time
</sql>
<select id="selectPhotoList" resultMap="BaseResultMap">
@ -23,7 +25,7 @@
<include refid="Base_Column_List"/>
from terminal_photos
where term_id = #{terminalid} and photo_time between #{starttime} and #{endtime}
<if test="channelid != null">
<if test="channelid != null and channelid.size>0">
and channel_id in
<foreach collection="channelid" item="item" index="index" open="(" close=")" separator=",">
#{item}

@ -41,6 +41,18 @@
from terminals
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByCmdid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminals
where cmdid = #{cmdid} and status = #{status}
</select>
<select id="selectByToweridAndLineid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminals
where line_id = #{lineid} and tower_id = #{towerid} and status = #{status}
</select>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.Terminals">
insert into terminals
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -139,118 +151,114 @@
</trim>
</insert>
<insert id="insertList">
<insert id="insertList" useGeneratedKeys="true" keyProperty="item.id">
insert into terminals
<foreach collection="list" item="item" index="index" separator=",">
<if test="index == 0">
<trim prefix="(" suffix=") values " suffixOverrides=",">
<if test="#{item.lineid} != null">
line_id,
</if>
<if test="#{item.towerid} != null">
tower_id,
</if>
<if test="#{item.cmdid} != null">
cmdid,
</if>
<if test="#{item.orgId} != null">
org_id,
</if>
<if test="#{item.equipName} != null">
equip_name,
</if>
<if test="#{item.displayName} != null">
display_name,
</if>
<if test="#{item.model} != null">
model,
</if>
<if test="#{item.essentialInfoVersion} != null">
essential_info_version,
</if>
<if test="#{item.hasPan} != null">
has_pan,
</if>
<if test="#{item.bsManufacturer} != null">
bs_manufacturer,
</if>
<if test="#{item.bsProductionDate} != null">
bs_production_date,
</if>
<if test="#{item.bsIdentifier} != null">
bs_identifier,
</if>
<if test="#{item.latitude} != null">
latitude,
</if>
<if test="#{item.longitude} != null">
longitude,
</if>
<if test="#{status} != null">
status,
</if>
<if test="#{createat} != null">
create_time,
</if>
<if test="#{updateat} != null">
update_time,
</if>
</trim>
</if>
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="#{item.lineid} != null">
#{item.lineid},
</if>
<if test="#{item.towerid} != null">
#{item.towerid},
</if>
<if test="#{item.cmdid} != null">
#{item.cmdid},
</if>
<if test="#{item.orgId} != null">
#{item.orgId},
</if>
<if test="#{item.equipName} != null">
#{item.equipName},
</if>
<if test="#{item.displayName} != null">
#{item.displayName},
</if>
<if test="#{item.model} != null">
#{item.model},
</if>
<if test="#{item.essentialInfoVersion} != null">
#{item.essentialInfoVersion},
</if>
<if test="#{item.hasPan} != null">
#{item.hasPan},
</if>
<if test="#{item.bsManufacturer} != null">
#{item.bsManufacturer},
</if>
<if test="#{item.bsProductionDate} != null">
#{item.bsProductionDate},
</if>
<if test="#{item.bsIdentifier} != null">
#{item.bsIdentifier},
</if>
<if test="#{item.latitude} != null">
#{item.latitude},
</if>
<if test="#{item.longitude} != null">
#{item.longitude},
</if>
<if test="#{status} != null">
#{status},
</if>
<if test="#{createat} != null">
#{createat},
</if>
<if test="#{updateat} != null">
#{updateat},
</if>
</trim>
</foreach>
<trim prefix="(" suffix=") values " suffixOverrides=",">
<if test="#{item.lineid} != null">
line_id,
</if>
<if test="#{item.towerid} != null">
tower_id,
</if>
<if test="#{item.cmdid} != null">
cmdid,
</if>
<if test="#{item.orgId} != null">
org_id,
</if>
<if test="#{item.equipName} != null">
equip_name,
</if>
<if test="#{item.displayName} != null">
display_name,
</if>
<if test="#{item.model} != null">
model,
</if>
<if test="#{item.essentialInfoVersion} != null">
essential_info_version,
</if>
<if test="#{item.hasPan} != null">
has_pan,
</if>
<if test="#{item.bsManufacturer} != null">
bs_manufacturer,
</if>
<if test="#{item.bsProductionDate} != null">
bs_production_date,
</if>
<if test="#{item.bsIdentifier} != null">
bs_identifier,
</if>
<if test="#{item.latitude} != null">
latitude,
</if>
<if test="#{item.longitude} != null">
longitude,
</if>
<if test="#{status} != null">
status,
</if>
<if test="#{createat} != null">
create_time,
</if>
<if test="#{updateat} != null">
update_time,
</if>
</trim>
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="#{item.lineid} != null">
#{item.lineid},
</if>
<if test="#{item.towerid} != null">
#{item.towerid},
</if>
<if test="#{item.cmdid} != null">
#{item.cmdid},
</if>
<if test="#{item.orgId} != null">
#{item.orgId},
</if>
<if test="#{item.equipName} != null">
#{item.equipName},
</if>
<if test="#{item.displayName} != null">
#{item.displayName},
</if>
<if test="#{item.model} != null">
#{item.model},
</if>
<if test="#{item.essentialInfoVersion} != null">
#{item.essentialInfoVersion},
</if>
<if test="#{item.hasPan} != null">
#{item.hasPan},
</if>
<if test="#{item.bsManufacturer} != null">
#{item.bsManufacturer},
</if>
<if test="#{item.bsProductionDate} != null">
#{item.bsProductionDate},
</if>
<if test="#{item.bsIdentifier} != null">
#{item.bsIdentifier},
</if>
<if test="#{item.latitude} != null">
#{item.latitude},
</if>
<if test="#{item.longitude} != null">
#{item.longitude},
</if>
<if test="#{status} != null">
#{status},
</if>
<if test="#{createat} != null">
#{createat},
</if>
<if test="#{updateat} != null">
#{updateat},
</if>
</trim>
</insert>
<update id="deleteById">

@ -7,12 +7,12 @@ import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
import com.shxy.xymanager_common.model.TerminalAllChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.page.PageUtils;
@ -125,6 +125,24 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
return Asserts.success(model);
}
/**
*
* @return
*/
@Override
public ServiceBody<TerminalAllChannelListModel> getAllChannelList() {
TerminalAllChannelListModel model = new TerminalAllChannelListModel();
List<TerminalChannels> list = terminalChannelsDao.selectChannelList();
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<TerminalAllChannelListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalAllChannelListModel.ChannelBean.class, CopyOptions.create().ignoreCase());
model.setList(channelBeans);
}
return Asserts.success(model);
}
/**
*
*

@ -1,22 +1,24 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalPhotoListForOpenModel;
import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.model.TerminalPhotoSelectListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_common.vo.TerminalAndTimeForOpenVo;
import com.shxy.xymanager_common.vo.TerminalPhotoVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.interaction.Cma;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import lombok.extern.slf4j.Slf4j;
@ -25,6 +27,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@ -43,6 +46,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Autowired
TerminalPhotoDao terminalPhotoDao;
@Autowired
TerminalsDao terminalsDao;
@Value("${cma.server}")
private String server;
@ -100,6 +106,66 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
return Asserts.success(model);
}
/**
*
*/
@Override
public ServiceBody<TerminalPhotoSelectListModel> getPhotoList(TerminalPhotoSelectVo vo) {
TerminalPhotoSelectListModel model = new TerminalPhotoSelectListModel();
List<TerminalPhoto> list = new ArrayList<>();
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
Integer dyid = vo.getDyid();
Integer lineid = vo.getLineid();
Integer towerid = vo.getTowerid();
Integer channelid = vo.getChannelid();
if (BeanUtil.isEmpty(dyid) || BeanUtil.isEmpty(lineid) || BeanUtil.isEmpty(towerid) || BeanUtil.isEmpty(channelid)) {
model.setList(beans);
} else {
ArrayList<Integer> channelidlist = new ArrayList<>();
channelidlist.add(channelid);
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));
BigInteger end = MyDateUtils.TimeMillSecond2Second(DateTime.of(endtime));
Terminals terminals = terminalsDao.selectByToweridAndLineid(lineid, towerid, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(terminals)) {
return Asserts.error("没有该装置信息");
}
list = terminalPhotoDao.selectPhotoList(terminals.getId(), channelidlist, start, end);
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
for (TerminalPhoto item : list) {
TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean();
photoBean.setTermid(terminals.getId());
photoBean.setMediatype(item.getMediaType());
photoBean.setOrginalid(item.getOrginalId());
photoBean.setPath(photoaddress + item.getPath());
photoBean.setPresetId(item.getPresetId());
BigInteger phototime = MyDateUtils.TimeSecond2MillSecond(item.getPhotoTime().longValue());
photoBean.setPhotoTime(MyDateUtils.date(phototime.longValue()));
beans.add(photoBean);
}
model.setList(beans);
}
}
PageInfo pageData = PageUtils.getPageData(list);
int currentpage = pageData.getPageNum();
model.setCurrentpage(currentpage);
long total = pageData.getTotal();
model.setTotal(total);
int pageSize = pageData.getPageSize();
model.setPagesize(pageSize);
int pages = pageData.getPages();
model.setTotalpage(pages);
return Asserts.success(model);
}
/**
*
*
@ -108,6 +174,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
*/
@Override
public ServiceBody<TerminalPhotoListForOpenModel> getPhotoListForOpen(TerminalAndTimeForOpenVo vo) {
String cmdid = vo.getCmdid();
TerminalPhotoListForOpenModel model = new TerminalPhotoListForOpenModel();
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
@ -116,7 +183,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Date endtime = vo.getEndtime();
BigInteger start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime));
BigInteger end = MyDateUtils.TimeMillSecond2Second(DateTime.of(endtime));
List<TerminalPhoto> list = terminalPhotoDao.selectPhotoListForOpen(vo.getTerminalid(), start, end);
Terminals terminals = terminalsDao.selectByCmdid(cmdid, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(terminals)) {
return Asserts.error("没有该装置信息");
}
List<TerminalPhoto> list = terminalPhotoDao.selectPhotoListForOpen(terminals.getId(), start, end);
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
@ -124,18 +195,13 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
List<TerminalPhotoListForOpenModel.PhotoBean> beans = new ArrayList<>();
for (TerminalPhoto item : list) {
TerminalPhotoListForOpenModel.PhotoBean photoBean = new TerminalPhotoListForOpenModel.PhotoBean();
photoBean.setChannelId(item.getChannelId());
photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight());
photoBean.setCmdid(cmdid);
photoBean.setMediatype(item.getMediaType());
photoBean.setOrginalid(item.getOrginalId());
photoBean.setPath(photoaddress + item.getPath());
photoBean.setId(item.getId());
photoBean.setTermId(item.getTermId());
photoBean.setWidth(item.getWidth());
photoBean.setPresetId(item.getPresetId());
BigInteger phototime = MyDateUtils.TimeSecond2MillSecond(item.getPhotoTime().longValue());
photoBean.setPhotoTime(MyDateUtils.date(phototime.longValue()));
BigInteger rectime = MyDateUtils.TimeSecond2MillSecond(item.getRecvTime().longValue());
photoBean.setRecvTime(MyDateUtils.date(rectime.longValue()));
beans.add(photoBean);
}
model.setList(beans);
@ -162,25 +228,25 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
String result = "";
Boolean hasNew = false;
try {
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=capture --cmdid="+vo.getCmdid() +"\t" +"--channel="+ vo.getChannel() +"\t"+ "--preset=255 --type=0";
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=capture --cmdid=" + vo.getCmdid() + "\t" + "--channel=" + vo.getChannel() + "\t" + "--preset=255 --type=0";
Process ps = Runtime.getRuntime().exec(cmd);
log.info("传入cmd信息:{}",cmd);
log.info("传入cmd信息:{}", cmd);
BufferedReader reader = new BufferedReader(new InputStreamReader(ps.getInputStream()));
int sendToCode = ps.waitFor();
log.info("进程返回结果:{}",sendToCode);
log.info("进程返回结果:{}", sendToCode);
while ((line = reader.readLine()) != null) {
sb.append(line).append("\n");
}
result = sb.toString();
if(StringUtils.isNotBlank(result)){
log.info("查询最新图片结果:{}",result);
hasNew =true;
if (StringUtils.isNotBlank(result)) {
log.info("查询最新图片结果:{}", result);
hasNew = true;
}
} catch (IOException e) {
log.error("IOException",e);
log.error("IOException", e);
} catch (InterruptedException e) {
log.error("InterruptedException",e);
log.error("InterruptedException", e);
}
/* Boolean hasNew = cma.requestCapture(vo.getCmdid(), vo.getChannel(), vo.getPreset(), vo.getCaptureType());*/

@ -5,6 +5,7 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
@ -12,6 +13,8 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalChannelMapperDao;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.interaction.Cma;
@ -20,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -37,6 +41,12 @@ public class TerminalServiceImpl implements TerminalService {
@Autowired
private TerminalsDao terminalsDao;
@Autowired
private TerminalChannelsDao terminalChannelsDao;
@Autowired
private TerminalChannelMapperDao terminalChannelMapperDao;
@Autowired
private TerminalStatusDao terminalStatusDao;
@ -83,9 +93,23 @@ public class TerminalServiceImpl implements TerminalService {
*/
@Override
public ServiceBody<String> addTerminal(TerminalVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
Terminals terminals = new Terminals();
BeanUtil.copyProperties(vo, terminals, CopyOptions.create().ignoreCase());
Date time = new Date();
int i = terminalsDao.insertList(list, CommonStatus.EFFECTIVE.value(), time, time);
int i = terminalsDao.insertList(terminals, CommonStatus.EFFECTIVE.value(), time, time);
Integer termid = terminals.getId();
List<Integer> channelid = vo.getChannelid();
if (!BeanUtil.isEmpty(channelid) && channelid.size() > 0) {
List<TerminalChannelMapper> list = new ArrayList<>();
for (Integer id : channelid) {
TerminalChannelMapper record = new TerminalChannelMapper();
record.setChannelId(id);
record.setTermId(termid);
list.add(record);
}
Date date = new Date();
int i1 = terminalChannelMapperDao.insertList(list, date, date);
}
if (i != 0) {
return Asserts.success("录入成功");
} else {
@ -144,14 +168,14 @@ public class TerminalServiceImpl implements TerminalService {
*/
@Override
public ServiceBody<String> resetTerminal(TerminalIdVo vo) {
Cma cma = new Cma("47.96.238.157", 6891);
boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01);
if (reset) {
return Asserts.success("删除成功");
} else {
return Asserts.error("装置复位成功");
}
// Cma cma = new Cma("47.96.238.157", 6891);
// boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01);
// if (reset) {
return Asserts.success("删除成功");
// } else {
// return Asserts.error("装置复位成功");
// }
}

@ -52,24 +52,12 @@ public class TerminalStatusServiceImpl implements TerminalStatusService {
return Asserts.success(terminalListModel);
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> addTerminal(TerminalVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
Date date = new Date();
int i = terminalsDao.insertList(list, CommonStatus.EFFECTIVE.value(), date,date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
return Asserts.error("录入失败");
}
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
/**
*
*

@ -9,6 +9,8 @@ import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.Tower;
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.*;
@ -39,7 +41,7 @@ public class TowerServiceImpl implements TowerService {
public ServiceBody addTower(TowerVo vo) {
List<Tower> towerLst = BeanUtil.copyToList(vo.getList(), Tower.class, CopyOptions.create().ignoreCase());
Date date = new Date();
int i = towerDao.addTower(towerLst,date);
int i = towerDao.addTower(towerLst, date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
@ -102,8 +104,27 @@ public class TowerServiceImpl implements TowerService {
@Override
public ServiceBody<TowerDto> getTowerInfo(Integer id) {
TowerDto dto = towerDao.getInfoByPrimaryKey(id,CommonStatus.EFFECTIVE.value());
TowerDto dto = towerDao.getInfoByPrimaryKey(id, CommonStatus.EFFECTIVE.value());
return Asserts.success(dto);
}
/**
*
*
* @return
*/
@Override
public ServiceBody<AllTowerListModel> getAllTower() {
AllTowerListModel model = new AllTowerListModel();
List<TowerDto> list = towerDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<AllTowerListModel.TowerBean> towerBeans = BeanUtil.copyToList(list, AllTowerListModel.TowerBean.class);
model.setList(towerBeans);
}
return Asserts.success(model);
}
}

@ -2,6 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
import com.shxy.xymanager_common.model.TerminalAllChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.vo.*;
@ -35,11 +36,16 @@ public interface TerminalChannelService {
ServiceBody<String> deleteChannelList(TerminalChannelIdListVo vo);
/**
*
*
* @return
*/
ServiceBody<TerminalChannelListModel> getChannelList(PageVo vo); /**
*
*
* @return
*/
ServiceBody<TerminalChannelListModel> getChannelList(PageVo vo);
ServiceBody<TerminalAllChannelListModel> getAllChannelList();
/**
*

@ -4,11 +4,9 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.model.TerminalPhotoListForOpenModel;
import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.model.TerminalPhotoSelectListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_common.vo.TerminalAndTimeForOpenVo;
import com.shxy.xymanager_common.vo.TerminalPhotoVo;
import com.shxy.xymanager_common.vo.*;
/**
*
@ -23,6 +21,13 @@ public interface TerminalPhotoService {
*/
ServiceBody<TerminalPhotoListModel> getTerminalPhotoList(TerminalAndChannelIdAndTimeVo vo);
/**
*
* @param vo
* @return
*/
ServiceBody<TerminalPhotoSelectListModel> getPhotoList(TerminalPhotoSelectVo vo);
/**
* id
*

@ -2,6 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.model.AllTowerListModel;
import com.shxy.xymanager_common.model.TowerListModel;
import com.shxy.xymanager_common.vo.*;
@ -54,5 +55,12 @@ public interface TowerService {
*/
ServiceBody<TowerDto> getTowerInfo(Integer id);
/**
*
*
* @return
*/
ServiceBody<AllTowerListModel> getAllTower();
}

Loading…
Cancel
Save