#20230510 欣影管理平台装置信息查询代码

master
18616268358 2 years ago
parent d0e22f05da
commit 68cf2a5b52

@ -10,13 +10,13 @@ public class TermChannelCoordinateDto {
private Integer pathId;
private Integer x1;
private float x1;
private Integer x2;
private float x2;
private Integer y2;
private float y2;
private Integer y1;
private float y1;
}

@ -9,6 +9,8 @@ public class TerminalChannelsDto implements Serializable {
private Integer id;
private Integer photoId;
private String name;
private String path;

@ -48,7 +48,7 @@ public class TerminalsAndLineAndChannelDto implements Serializable {
private Integer height;
private Integer color;
private String color;
private Short boderWidth;

@ -1,10 +1,12 @@
package com.shxy.xymanager_common.entity;
import com.shxy.xymanager_common.dto.TermChannelCoordinateDto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@Data
public class TerminalPhoto implements Serializable {
@ -36,6 +38,16 @@ public class TerminalPhoto implements Serializable {
private Date createTime;
private Integer markWidth;
private Integer markHeight;
private String color;
private Short boderWidth;
private List<TermChannelCoordinateDto> lineList;
private static final long serialVersionUID = 1L;
}

@ -1,5 +1,6 @@
package com.shxy.xymanager_common.model;
import com.shxy.xymanager_common.dto.TermChannelCoordinateDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -66,5 +67,19 @@ public class TerminalPhotoListModel implements Serializable {
@ApiModelProperty(value = "拍照类型", example = "123456")
private Integer mediaType;
@ApiModelProperty(value = "绘制宽度", example = "123456")
private Integer markWidth;
@ApiModelProperty(value = "绘制高度", example = "123456")
private Integer markHeight;
@ApiModelProperty(value = "颜色", example = "123456")
private String color;
private Short boderWidth;
@ApiModelProperty(value = "坐标", example = "123456")
private List<TermChannelCoordinateDto> list;
}
}

@ -30,7 +30,7 @@ public class PhotoMarkVo {
@NotNull(message = "线条颜色不能缺少")
@ApiModelProperty(value = "线条颜色", example = "213")
private Integer color;
private String color;
@NotNull(message = "线条宽度不能缺少")
@ApiModelProperty(value = "线条宽度", example = "213")
@ -39,6 +39,9 @@ public class PhotoMarkVo {
@ApiModelProperty(value = "绘制编号", example = "213")
private Integer id;
@ApiModelProperty(value = "照片编号", example = "213")
private Integer photoId;
@ApiModelProperty(value = "绘制编号", example = "213")
private Date createTime;
@ -51,12 +54,12 @@ public class PhotoMarkVo {
@ApiModelProperty(value = "线段ID", example = "213")
private Integer markId;
@ApiModelProperty(value = "线段起始坐标x", example = "213")
private Integer x1;
private float x1;
@ApiModelProperty(value = "线段结束坐标x", example = "213")
private Integer x2;
private float x2;
@ApiModelProperty(value = "线段起始坐标y", example = "213")
private Integer y1;
private float y1;
@ApiModelProperty(value = "线段结束坐标y", example = "213")
private Integer y2;
private float y2;
}
}

@ -7,7 +7,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "图片采集参数对象", description = "图片采集参数对象")
@ApiModel(value = "图片对象", description = "图片采集参数对象")
public class PhotoParamsVo{
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;

@ -60,4 +60,7 @@ public interface TerminalPhotoDao {
void updatePhotoMark(PhotoMarkVo vo);
void updatePhotoMarkId(PhotoMarkVo vo);
}

@ -45,17 +45,58 @@
<result column="recv_time" jdbcType="BIGINT" property="recvTime"/>
<result column="path" jdbcType="VARCHAR" property="path"/>
</resultMap>
<resultMap id="PhotoResultMap" type="com.shxy.xymanager_common.entity.TerminalPhoto">
<id column="id" jdbcType="BIGINT" property="id"/>
<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"/>
<result column="photo_time" jdbcType="BIGINT" property="photoTime"/>
<result column="recv_time" jdbcType="BIGINT" property="recvTime"/>
<result column="path" jdbcType="VARCHAR" property="path"/>
<result column="thumb" jdbcType="VARCHAR" property="thumb"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="width" jdbcType="INTEGER" property="markWidth"/>
<result column="height" jdbcType="INTEGER" property="markHeight"/>
<result column="color" jdbcType="VARCHAR" property="color"/>
<result column="boder_width" jdbcType="SMALLINT" property="boderWidth"/>
<collection property="lineList" javaType="list" ofType="com.shxy.xymanager_common.dto.TermChannelCoordinateDto">
<result column="x1" jdbcType="FLOAT" property="x1"/>
<result column="x2" jdbcType="FLOAT" property="x2"/>
<result column="y1" jdbcType="FLOAT" property="y1"/>
<result column="y2" jdbcType="FLOAT" property="y2"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id,orginal_id, media_type,preset_id, width, height, file_size, photo_time, recv_time,
path, thumb,create_time
</sql>
<select id="selectPhotoList" resultMap="BaseResultMap">
<select id="selectPhotoList" resultMap="PhotoResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where term_id = #{terminalid} and photo_time between #{starttime} and #{endtime}
tp.id as id, tp.term_id as term_id, tp.channel_id as channel_id,tp.orginal_id as orginal_id,
tp.media_type as media_type,tp.preset_id as preset_id, tp.width as width, tp.height as height,
tp.file_size as file_size, tp.photo_time as photo_time, tp.recv_time as recv_time,
tp.path as path, tp.thumb as thumb,tp.create_time as create_time,
tpm.width as width,
tpm.height as height,
tpm.color as color,
tpm.boder_width as boder_width,
tpm.id as mark_id,
tpmp.id as path_id,
tpmp.x1 as x1,
tpmp.x2 as x2,
tpmp.y1 as y1,
tpmp.y2 as y2
from terminal_photos tp left join terminal_photo_marks tpm on tp.mark_id = tpm.id
left join terminal_photo_mark_paths tpmp on tpmp.mark_id = tpm.id
where tp.term_id = #{terminalid} and photo_time between #{starttime} and #{endtime}
<if test="channelid != null and channelid.size>0">
and channel_id in
and tp.channel_id in
<foreach collection="channelid" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
@ -397,7 +438,18 @@
where id = #{id}
</update>
<delete id="deleteById">
<update id="updatePhotoMarkId" parameterType="com.shxy.xymanager_common.vo.PhotoMarkVo">
update `terminal_photos`
<set>
<if test="id != null">
mark_id = #{id,jdbcType=VARCHAR},
</if>
</set>
where id = #{photoId}
</update>
<delete id="deleteByMarkId">
delete from terminal_photo_mark_paths
where mark_id = #{markId}
</delete>

@ -43,19 +43,20 @@
<result column="width" jdbcType="INTEGER" property="width"/>
<result column="mark_id" jdbcType="INTEGER" property="markId"/>
<result column="height" jdbcType="INTEGER" property="height"/>
<result column="color" jdbcType="INTEGER" property="color"/>
<result column="color" jdbcType="VARCHAR" property="color"/>
<result column="boder_width" jdbcType="SMALLINT" property="boderWidth"/>
<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="path" jdbcType="VARCHAR" property="path"/>
<result column="photoId" jdbcType="VARCHAR" property="photoId"/>
</collection>
<collection property="lineList" javaType="list" ofType="com.shxy.xymanager_common.dto.TermChannelCoordinateDto">
<result column="path_id" jdbcType="INTEGER" property="pathId"/>
<result column="x1" jdbcType="INTEGER" property="x1"/>
<result column="x2" jdbcType="INTEGER" property="x2"/>
<result column="y1" jdbcType="INTEGER" property="y1"/>
<result column="y2" jdbcType="INTEGER" property="y2"/>
<result column="x1" jdbcType="FLOAT" property="x1"/>
<result column="x2" jdbcType="FLOAT" property="x2"/>
<result column="y1" jdbcType="FLOAT" property="y1"/>
<result column="y2" jdbcType="FLOAT" property="y2"/>
</collection>
</resultMap>
@ -163,7 +164,8 @@
tpmp.x2 as x2,
tpmp.y1 as y1,
tpmp.y2 as y2,
tp.path as path
tp.path as path,
tp.id as photoId
from
(((((((terminals a left join `lines` b on a.line_id = b.id )
left join tower c on a.tower_id = c.id)
@ -173,9 +175,9 @@
left join terminal_photo_mark_paths tpmp on tpmp.mark_id = tpm.id)
left join
(
SELECT path,term_id,channel_id
SELECT path,term_id,channel_id,id
from terminal_photos
where id in (select max(id) from terminal_photos where media_type =1 GROUP BY term_id,channel_id)
where id in (select max(id) from terminal_photos where media_type =0 GROUP BY term_id,channel_id)
) tp on tp.channel_id = e.id and tp.term_id = a.id )
WHERE a.status = 1
order by a.create_time desc

@ -21,7 +21,8 @@ public class CustomSecurityConfig implements WebMvcConfigurer {
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(this.jwtInterceptor)
.excludePathPatterns("/swagger-ui.html")
.excludePathPatterns("/*")
.excludePathPatterns("/api/login")
.excludePathPatterns("/login")
.excludePathPatterns("/doc.html")
.excludePathPatterns("/swagger-resources/**")
.excludePathPatterns("/*/api-docs")

@ -1,9 +1,6 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import com.github.pagehelper.PageInfo;
@ -11,12 +8,10 @@ import com.google.common.collect.Lists;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.SysUser;
import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.dto.TerminalsAndLineAndChannelDto;
import com.shxy.xymanager_common.entity.UserSession;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.SysUserModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.RsaUtils;
@ -37,8 +32,10 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import java.math.BigInteger;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**

@ -124,6 +124,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setPhotoTime(MyDateUtils.date(phototime.longValue()));
BigInteger rectime = MyDateUtils.TimeSecond2MillSecond(item.getRecvTime().longValue());
photoBean.setRecvTime(MyDateUtils.date(rectime.longValue()));
photoBean.setColor(item.getColor());
photoBean.setBoderWidth(item.getBoderWidth());
photoBean.setMarkHeight(item.getMarkHeight());
photoBean.setMarkWidth(item.getMarkWidth());
photoBean.setList(item.getLineList());
beans.add(photoBean);
}
model.setList(beans);

@ -84,9 +84,13 @@ public class TerminalServiceImpl implements TerminalService {
model.setList(new ArrayList<>());
} else {
list.forEach(var->{
var.getList().stream().forEach(line->{
line.setPath(photoaddress+line.getPath());
});
if(CollectionUtil.isNotEmpty(var.getList())) {
var.getList().stream().forEach(line -> {
if (StringUtils.isNotBlank(line.getPath())) {
line.setPath(photoaddress + line.getPath());
}
});
}
});
List<TerminalListModel.TerminalBean> beans = BeanUtil.copyToList(list, TerminalListModel.TerminalBean.class, CopyOptions.create().ignoreCase());
model.setList(beans);
@ -322,23 +326,22 @@ public class TerminalServiceImpl implements TerminalService {
@Override
@Transactional
public ServiceBody<String> updateCoordinate(PhotoMarkVo vo) {
int result;
int result = 0;
Date date = new Date();
vo.setCreateTime(date);
if(null!=vo.getId()) {
terminalPhotoDao.deleteByMarkId(vo.getId());
terminalPhotoDao.updatePhotoMark(vo);
result = terminalPhotoDao.addPhotoMarkPath(vo.getList(),vo.getId());
}else{
terminalPhotoDao.addPhotoMark(vo);
result = terminalPhotoDao.addPhotoMarkPath(vo.getList(),vo.getId());
}
if(result>0){
return Asserts.success("保存成功");
if(CollectionUtil.isNotEmpty(vo.getList())) {
result = terminalPhotoDao.addPhotoMarkPath(vo.getList(), vo.getId());
}
return Asserts.error("保存失败");
terminalPhotoDao.updatePhotoMarkId(vo);
return Asserts.success("保存成功");
}
}

Loading…
Cancel
Save