增加告警分类修改 优化告警列表查询 优化主动拍照

master
liuguijing 2 years ago
parent e2fb29ed11
commit d03730cf7a

@ -8,7 +8,6 @@ import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TermSetService;
import com.shxy.xymanager_service.service.TerminalChannelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;

@ -33,7 +33,7 @@ public class TerminalAlarmController extends BaseController {
@RequestMapping("/getTerminalAlarmList")
@Log(title = "获取告警列表", type = "查询")
public ResponseReult<TerminalAlarmListModel> getTerminalAlarmList(@RequestBody @Validated TerminalAlarmSelectVo vo) {
ServiceBody<TerminalAlarmListModel> serviceBody = terminalAlarmService.getAlarmList(vo);
ServiceBody<TerminalAlarmListModel> serviceBody = terminalAlarmService.getTerminalAlarmList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
@ -69,17 +69,17 @@ public class TerminalAlarmController extends BaseController {
}
// @ApiOperation(value = "修改告警分类列表", notes = "修改告警分类列表", httpMethod = "POST")
// @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
// @RequestMapping("/getAlarmTypeList")
// @Log(title = "修改告警分类列表", type = "修改")
// public ResponseReult<TerminalImgAlarmParamsModel> updateAlarmTypeList() {
// ServiceBody<TerminalImgAlarmParamsModel> serviceBody = terminalAlarmService.getAlarmTypeList();
// 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("/updateAlarmTypeList")
@Log(title = "修改告警分类列表", type = "修改")
public ResponseReult<String> updateAlarmTypeList(@RequestBody @Validated UpdateTerminalAlarmParamsVo vo) {
ServiceBody<String> serviceBody = terminalAlarmService.updateAlarmTypeList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -43,13 +43,12 @@ public class TerminalPhotoController extends BaseController {
}
}
@ApiOperation(value = "获取最新图片", notes = "获取最新图片接口", httpMethod = "POST")
@ApiOperation(value = "主动拍照", notes = "主动拍照接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getLatestPhoto")
@Log(title = "获取最新图片", type = "查询")
@Log(title = "主动拍照", type = "查询")
public ResponseReult<Date> getLatestPhoto(@RequestBody @Validated TerminalPhotoVo vo) {
ServiceBody<Date> latestPhoto = terminalPhotoService.getLatestPhoto(vo);
ServiceBody<Date> serviceBody = latestPhoto;
ServiceBody<Date> serviceBody = terminalPhotoService.getLatestPhoto(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
@ -176,4 +175,17 @@ public class TerminalPhotoController extends BaseController {
}
@ApiOperation(value = "历史图片", notes = "历史图片接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getHistoryList")
@Log(title = "历史图片", type = "查询")
public ResponseReult<TerminalPhotoSelectListModel> getHistoryList(@RequestBody @Validated TermIdAndChannelIdVo vo) {
ServiceBody<TerminalPhotoSelectListModel> serviceBody = terminalPhotoService.getHistoryList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -0,0 +1,55 @@
package com.shxy.xymanager_admin.test;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mysql.cj.xdevapi.JsonArray;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
public class Testbatch {
private static Connection con;
public static void main(String[] args) throws Exception {
String driver = "com.mysql.jdbc.Driver";
//这里我的数据库是cgjr
String url = "jdbc:mysql://47.96.238.157:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8";
String user = "xymp";
String password = "Xymp@2023";
try {
Class.forName(driver);
con = DriverManager.getConnection(url, user, password);
if (!con.isClosed()) {
System.out.println("数据库连接成功");
}
String sql = "insert into terminal_img_alarms (term_id,channel_id,preset_id,photo_org_id,alarm_time,alarm_info,create_time) values(?,?,?,?,?,?,?)";
PreparedStatement preparedStatement = con.prepareStatement(sql);
Date date = new Date(1686118807);
for (int i = 0; i < 10; i++) {
preparedStatement.setInt(1, 10002);
preparedStatement.setInt(2, 1);
preparedStatement.setInt(3, 255);
preparedStatement.setLong(4, 1962967140);
preparedStatement.setLong(5, 1686118807);
preparedStatement.setString(6, "{info}");
preparedStatement.setDate(7, date);
preparedStatement.addBatch();
}
preparedStatement.executeBatch();
con.commit();
} catch (ClassNotFoundException e) {
System.out.println("数据库驱动没有安装");
} catch (SQLException e) {
System.out.println("数据库连接失败");
} catch (Exception e) {
e.printStackTrace();
} finally {
con.close();
}
}
}

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

@ -2,7 +2,7 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://127.0.0.1:3306/xymp?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource

@ -0,0 +1,26 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
@Data
@ApiModel(value = "装置编号和通道编号对象", description = "装置编号和通道编号对象")
public class TermIdAndChannelIdVo {
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelId;
@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;
}

@ -15,13 +15,13 @@ import java.util.Date;
public class TerminalAlarmSelectVo {
@ApiModelProperty(value = "电压编号", example = "123455")
private Integer dyid;
private Integer dyId;
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer lineid;
private Integer lineId;
@ApiModelProperty(value = "杆塔编号", example = "123455")
private Integer towerid;
private Integer towerId;
@ApiModelProperty(value = "告警类型", example = "123455")
private Integer label;

@ -5,15 +5,17 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel(value = "最近图片请求参数", description = "最近图片请求参数")
public class TerminalPhotoVo {
// @NotNull(message = "装置列表不能缺少")
// @ApiModelProperty(value = "装置通道编号列表", example = "123455")
// private String cmdid;
@NotNull(message = "装置列表不能缺少")
@ApiModelProperty(value = "装置通道编号列表", example = "123455")
private String cmdid;
@NotNull(message = "装置编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer termId;
@NotNull(message = "通道号")
@ApiModelProperty(value = "通道号", example = "123455")

@ -0,0 +1,31 @@
package com.shxy.xymanager_common.vo;
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 UpdateTerminalAlarmParamsVo implements Serializable {
@ApiModelProperty(value = "修改告警类型列表", example = "[]")
private List<AlarmParamBean> list;
@Data
public static class AlarmParamBean {
@ApiModelProperty(value = "编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "告警编号", example = "123456")
private Integer label;
@ApiModelProperty(value = "告警名称", example = "123456")
private String name;
@ApiModelProperty(value = "可信度", example = "123456")
private Float prob;
}
private static final long serialVersionUID = 1L;
}

@ -1,10 +1,13 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalImgAlarmParams;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TerminalImgAlarmParamsDao {
int deleteByPrimaryKey(Integer id);
int insert(TerminalImgAlarmParams record);
@ -17,5 +20,7 @@ public interface TerminalImgAlarmParamsDao {
int updateByPrimaryKeySelective(TerminalImgAlarmParams record);
int updateList(@Param("list") List<TerminalImgAlarmParams> record, @Param("updateTime") Date updateTime);
int updateByPrimaryKey(TerminalImgAlarmParams record);
}

@ -1,11 +1,11 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.TerminalImgAlarmsDto;
import com.shxy.xymanager_common.entity.TerminalImgAlarmParams;
import com.shxy.xymanager_common.entity.TerminalImgAlarms;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
public interface TerminalImgAlarmsDao {
@ -17,7 +17,7 @@ public interface TerminalImgAlarmsDao {
TerminalImgAlarms selectByPrimaryKey(Long id);
List<TerminalImgAlarmsDto> selectAlarmsDetails(@Param("terminalidlist") List<Integer> termidlist, @Param("label") Integer label,@Param("prob") Float prob, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
List<TerminalImgAlarmsDto> selectAlarmsDetails(@Param("terminalidlist") List<Integer> termidlist, @Param("labellist") List<TerminalImgAlarmParams> labellist, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
int updateByPrimaryKeySelective(TerminalImgAlarms record);

@ -33,13 +33,14 @@ public interface TerminalPhotoDao {
TerminalPhoto getLatestPhoto(@Param("termId") Integer termId);
List<TerminalPhoto> getLatestPhotoByTermidAndChannelid(@Param("termId") Integer termId,@Param("channelId") Integer channelId);
List<PhotoAndLineAndChannelDto> selectPhotos();
List<TermAndChannelLatestPhotoMapperDto> selectTermAndChannelLatestPhotoList(@Param("list") List<Integer> list);
List<TerminalPhoto> selectPhotoListForOpen(@Param("termId") Integer terminalid,@Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
List<TerminalPhotoScheduleDto> selectPhotoSchedule(TerminalPhotoTimeVo vo);
PhotoParamsDto selectPhotoParams(ReturnedPhotoParamsVo vo);

@ -108,4 +108,13 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateList">
<foreach collection="list" index="index" item="item" separator=";">
update terminal_img_alarm_params
set
prob = #{item.prob}
where id = #{item.id}
</foreach>
</update>
</mapper>

@ -67,11 +67,18 @@
#{item}
</foreach>
</if>
<if test="label != null">
and label = #{label}
<if test="labellist != null and labellist.size > 0">
and
<foreach collection="labellist" item="item" index="index" separator="or">
(
<if test="item.label != null">
label = #{item.label}
</if>
<if test="prob != null and prob lte 100">
and prob >= #{prob}
<if test="item.prob != null and item.prob lte 100">
and prob >= #{item.prob}
</if>
)
</foreach>
</if>
order by a.alarm_time desc
</select>

@ -204,6 +204,14 @@
order by recv_time desc limit 1
</select>
<select id="getLatestPhotoByTermidAndChannelid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where term_id = #{termId} and channel_id = #{channelId}
order by recv_time desc
</select>
<select id="selectPhotoListForOpen" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>

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

@ -51,6 +51,7 @@ public class XyCache {
termchannelMap.clear();
termchannelMapMap.clear();
alarmParamMap.clear();
List<LineAndDyNameDto> lineAndDyNameDtos = linesDao.selectAll(CommonStatus.EFFECTIVE.value());
for (LineAndDyNameDto lineitem : lineAndDyNameDtos) {
lineMap.put(lineitem.getId(), lineitem);

@ -14,6 +14,7 @@ import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.vo.TerminalAlarmIdVo;
import com.shxy.xymanager_common.vo.TerminalAlarmSelectVo;
import com.shxy.xymanager_common.vo.UpdateTerminalAlarmParamsVo;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TerminalAlarmService;
@ -63,23 +64,22 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
private String videoaddress;
@Override
public ServiceBody<TerminalAlarmListModel> getAlarmList(TerminalAlarmSelectVo vo) {
public ServiceBody<TerminalAlarmListModel> getTerminalAlarmList(TerminalAlarmSelectVo vo) {
TerminalAlarmListModel model = new TerminalAlarmListModel();
Integer dyid = vo.getDyid();
Integer lineid = vo.getLineid();
Integer towerid = vo.getTowerid();
Integer dyid = vo.getDyId();
Integer lineid = vo.getLineId();
Integer towerid = vo.getTowerId();
Integer label = vo.getLabel();
Float prob = null;
List<TerminalImgAlarmParams> labellist = new ArrayList<>();
Map<Integer, TerminalImgAlarmParams> alarmParamMap = XyCache.alarmParamMap;
if (label != null && label == -1) {
label = null;
prob = null;
alarmParamMap.forEach((key, value) -> {
labellist.add(value);
});
} else {
Map<Integer, TerminalImgAlarmParams> alarmParamMap = XyCache.alarmParamMap;
TerminalImgAlarmParams terminalImgAlarmParams = alarmParamMap.get(label);
if (terminalImgAlarmParams != null) {
prob = terminalImgAlarmParams.getProb();
}
labellist.add(terminalImgAlarmParams);
}
Date starttime = vo.getStarttime();
@ -93,7 +93,7 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
List<Integer> termidlist = new ArrayList<>();
if (dyid == null || dyid.intValue() == 0) {
PageUtils.SetPage(pageindex, pagesize);
list = terminalImgAlarmsDao.selectAlarmsDetails(null, label, prob, BigInteger.valueOf(start), BigInteger.valueOf(end));
list = terminalImgAlarmsDao.selectAlarmsDetails(null, labellist, BigInteger.valueOf(start), BigInteger.valueOf(end));
} else {
if (lineid == null || lineid.intValue() == 0) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, null, null, null, CommonStatus.EFFECTIVE.value());
@ -114,7 +114,7 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
}
}
PageUtils.SetPage(pageindex, pagesize);
list = terminalImgAlarmsDao.selectAlarmsDetails(termidlist, label, prob, BigInteger.valueOf(start), BigInteger.valueOf(end));
list = terminalImgAlarmsDao.selectAlarmsDetails(termidlist, labellist, BigInteger.valueOf(start), BigInteger.valueOf(end));
}
if (CollectionUtil.isNotEmpty(list)) {
@ -264,26 +264,38 @@ public class TerminalAlarmServiceImpl implements TerminalAlarmService {
}
// /**
// * 获取告警分类列表
// *
// * @return
// */
// @Override
// public ServiceBody<TerminalImgAlarmParamsModel> updateAlarmTypeList() {
// TerminalImgAlarmParamsModel model = new TerminalImgAlarmParamsModel();
// ArrayList<TerminalImgAlarmParamsModel.AlarmBean> list = new ArrayList<>();
// Map<Integer, TerminalImgAlarmParams> beans = XyCache.alarmParamMap;
// beans.forEach((key, value) -> {
// TerminalImgAlarmParamsModel.AlarmBean alarmBean = new TerminalImgAlarmParamsModel.AlarmBean();
// alarmBean.setId(value.getId());
// alarmBean.setLabel(value.getLabel());
// alarmBean.setName(value.getName());
// alarmBean.setProb(value.getProb());
// list.add(alarmBean);
// });
// model.setList(list);
// return Asserts.success(model);
// }
/**
*
*
* @return
*/
@Override
public ServiceBody<String> updateAlarmTypeList(UpdateTerminalAlarmParamsVo vo) {
List<UpdateTerminalAlarmParamsVo.AlarmParamBean> list = vo.getList();
if (CollectionUtil.isEmpty(list)) {
return Asserts.error("数据不能为空");
}
ArrayList<TerminalImgAlarmParams> record = new ArrayList<>();
for (UpdateTerminalAlarmParamsVo.AlarmParamBean item : list) {
TerminalImgAlarmParams params = new TerminalImgAlarmParams();
params.setId(item.getId());
params.setLabel(item.getLabel());
params.setProb(item.getProb());
params.setName(item.getName());
record.add(params);
}
int i = terminalImgAlarmParamsDao.updateList(record, new Date());
Map<Integer, TerminalImgAlarmParams> alarmParamMap = new HashMap<>();
List<TerminalImgAlarmParams> terminalImgAlarmParams = terminalImgAlarmParamsDao.selectAll();
for (TerminalImgAlarmParams item : terminalImgAlarmParams) {
alarmParamMap.put(item.getLabel(), item);
}
XyCache.alarmParamMap = alarmParamMap;
if (i != 0) {
return Asserts.success("修改成功");
} else {
return Asserts.error("修改失败");
}
}
}

@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
@ -32,6 +33,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.util.*;
@ -351,9 +354,17 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override
public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) {
DateTime now = DateTime.now();
// String cmd = Constants.CMD + "capture --cmdid=" + vo.getCmdid() + " --channel=" + vo.getChannel() + " --preset=255 --type=" + vo.getCaptureType();
String cmd = CmaUtil.takePic(vo.getCmdid(), vo.getChannel(), vo.getCaptureType());
Integer termId = vo.getTermId();
Map<Integer, Terminals> terminalMap = XyCache.terminalMap;
Terminals terminals = terminalMap.get(termId);
String cmdid = null;
if (terminals != null) {
cmdid = terminals.getCmdid();
}
if (StrUtil.isNotEmpty(cmdid)) {
String cmd = CmaUtil.takePic(cmdid, vo.getChannel(), vo.getCaptureType());
ProcessExecUtils.exec(cmd);
}
return Asserts.success(now);
}
@ -374,7 +385,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
} else {
hasNew = false;
}
return Asserts.success(hasNew);
}
@ -588,5 +598,72 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
return Asserts.success(model);
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<TerminalPhotoSelectListModel> getHistoryList(TermIdAndChannelIdVo vo) {
TerminalPhotoSelectListModel model = new TerminalPhotoSelectListModel();
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
Integer termId = vo.getTermId();
Integer channelId = vo.getChannelId();
int pagesize = vo.getPagesize();
int pageindex = vo.getPageindex();
PageUtils.SetPage(pageindex, pagesize);
List<TerminalPhoto> list = terminalPhotoDao.getLatestPhotoByTermidAndChannelid(termId, channelId);
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
Map<Integer, Terminals> terminalMap = XyCache.terminalMap;
Map<Integer, LineAndDyNameDto> lineMap = XyCache.lineMap;
Map<Integer, TerminalChannels> termchannelMap = XyCache.termchannelMap;
Map<String, TerminalChannelMapper> termchannelMapMap = XyCache.termchannelMapMap;
for (TerminalPhoto item : list) {
TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean();
photoBean.setTermid(item.getTermId());
Terminals terminals = terminalMap.get(item.getTermId());
if (!BeanUtil.isEmpty(terminals)) {
photoBean.setDisplayname(terminals.getDisplayName());
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.setAlias(termchannelMapMap.get(item.getTermId() + "#" + item.getChannelId()).getAlias());
photoBean.setMediaType(item.getMediaType());
photoBean.setOrginalid(item.getOrginalId());
if (item.getMediaType() == 0) {
photoBean.setPath(photoaddress + item.getPath());
} else {
photoBean.setPath(videoaddress + item.getPath());
}
photoBean.setPresetId(item.getPresetId());
long phototime = MyDateUtils.TimeSecond2MillSecond(item.getPhotoTime().longValue());
photoBean.setPhotoTime(MyDateUtils.date(phototime));
long rectime = MyDateUtils.TimeSecond2MillSecond(item.getRecvTime().longValue());
photoBean.setRecvTime(MyDateUtils.date(rectime));
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);
}
}

@ -16,7 +16,7 @@ public interface TerminalAlarmService {
*
* @return
*/
ServiceBody<TerminalAlarmListModel> getAlarmList(TerminalAlarmSelectVo vo);
ServiceBody<TerminalAlarmListModel> getTerminalAlarmList(TerminalAlarmSelectVo vo);
/**
*
@ -32,4 +32,11 @@ public interface TerminalAlarmService {
*/
ServiceBody<TerminalImgAlarmParamsModel> getAlarmTypeList();
/**
*
*
* @return
*/
ServiceBody<String> updateAlarmTypeList(UpdateTerminalAlarmParamsVo vo);
}

@ -73,11 +73,15 @@ public interface TerminalPhotoService {
ServiceBody<TerminalPhotosParamsModel> getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo);
ServiceBody<TerminalScheduleRuleTimeListModel> selectPhotoTime(TerminalReqPhotoTimeVo vo);
ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo);
/**
*
* @param vo
* @return
*/
ServiceBody<TerminalPhotoSelectListModel> getHistoryList(TermIdAndChannelIdVo vo);
}

Loading…
Cancel
Save