实时查询首页照片

hunan
liuguijing 2 years ago
parent 481e8af7c5
commit d31e24ecce

@ -7,9 +7,9 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.DyListModel;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TestVo;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_service.service.DyLevelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -18,14 +18,11 @@ import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(value = "电压等级接口", tags = "电压等级接口描述")
@RestController
@ -61,12 +58,13 @@ public class DyLevelController 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("/gettest")
@Log(title = "测试测试", type = "查询")
public ResponseReult<String> gettest(@RequestBody List<TestVo> vo) {
ServiceBody<String> serviceBody = dyLevelService.gettest(vo);
@RequestMapping("/getTowerAndPhotoList")
@Log(title = "根据电压或者线路获取所有杆塔和最新照片", type = "查询")
public ResponseReult<TerminalPhotosModel> getLastTowerList(@RequestHeader HttpHeaders headers, @RequestBody LastTowerVo vo) {
String requestIp = HeaderUtil.getRequestIp(headers);
ServiceBody<TerminalPhotosModel> serviceBody = dyLevelService.getLastTowerList(requestIp,vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -7,7 +7,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.*;
import com.shxy.xymanager_common.util.HeaderUtil;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.OpenService;
import com.shxy.xymanager_service.service.TerminalPhotoService;

@ -6,7 +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.*;
import com.shxy.xymanager_common.util.HeaderUtil;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalAlarmService;
import io.swagger.annotations.Api;

@ -6,7 +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.*;
import com.shxy.xymanager_common.util.HeaderUtil;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalService;
import io.swagger.annotations.Api;

@ -6,7 +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.*;
import com.shxy.xymanager_common.util.HeaderUtil;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import io.swagger.annotations.Api;
@ -166,7 +166,6 @@ 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")

@ -4,7 +4,7 @@ import lombok.Data;
@Data
public class DyLineAndTowertDto {
public class DyLineAndTowertDto {
private Integer dyId;

@ -73,5 +73,8 @@ public class TerminalPhotoSelectListModel implements Serializable {
@ApiModelProperty(value = "照片路径", example = "123456")
private String path;
@ApiModelProperty(value = "视频缩略图", example = "123456")
private String thumb;
}
}

@ -76,5 +76,8 @@ public class TerminalPhotosModel implements Serializable {
@ApiModelProperty(value = "照片路径", example = "123456")
private String path;
@ApiModelProperty(value = "视频缩略图", example = "123456")
private String thumb;
}
}

@ -1,94 +0,0 @@
package com.shxy.xymanager_common.util;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.math.BigInteger;
/**
*
*
* @author cy
*/
@Slf4j
@Component
public class TerminalUtils {
private static Integer hearttime;
private static String photoaddress;
private static String videoaddress;
@Value("${heart.time}")
public void setHearttime(Integer time) {
TerminalUtils.hearttime = time;
}
@Value("${photo.address}")
public void setPhotoaddress(String photoaddress) {
TerminalUtils.photoaddress = photoaddress;
}
@Value("${video.address}")
public void setVideoaddress(String videoaddress) {
TerminalUtils.videoaddress = videoaddress;
}
/**
* 线
*
* @param lastHeartbeat
*/
public static boolean judgeTerminalStatus(BigInteger lastHeartbeat) {
if (lastHeartbeat == null) {
return false;
}
long time = MyDateUtils.TimeSecond2MillSecond(lastHeartbeat.longValue());
DateTime date = MyDateUtils.date(time);
long between = MyDateUtils.between(MyDateUtils.getNowDate(), date, DateUnit.MINUTE);
if (between > hearttime) {
return false;
} else {
return true;
}
}
/**
*
*/
public static String getPhotoPath(Integer mediaType, String requestIp, String path) {
if (mediaType != null) {
if (mediaType.intValue() == 0) {
return requestIp + photoaddress + path;
} else if (mediaType == 1) {
return requestIp + videoaddress + path;
} else {
return "";
}
} else {
return "";
}
}
/**
*
*/
public static String getThumbPhotoPath(Integer mediaType, String requestIp, String path) {
if (mediaType.intValue() == 0) {
if (StringUtils.isNotBlank(path)) {
return requestIp + videoaddress + path;
} else {
return "";
}
} else {
return "";
}
}
}

@ -1,4 +1,4 @@
package com.shxy.xymanager_common.util;
package com.shxy.xymanager_common.util.xinyin;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;

@ -1,5 +1,6 @@
package com.shxy.xymanager_common.util;
package com.shxy.xymanager_common.util.xinyin;
import com.shxy.xymanager_common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import java.io.BufferedReader;

@ -1,4 +1,4 @@
package com.shxy.xymanager_common.util;
package com.shxy.xymanager_common.util.xinyin;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateField;
@ -9,6 +9,8 @@ import com.shxy.xymanager_common.dto.PhotoTimeResultDto;
import com.shxy.xymanager_common.dto.ScheduleDetailsDto;
import com.shxy.xymanager_common.entity.ScheduleDetails;
import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.XyNumberUtils;
import com.shxy.xymanager_common.vo.ScheduleRuleVo;
import java.sql.Time;

@ -0,0 +1,333 @@
package com.shxy.xymanager_common.util.xinyin;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
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.TerminalPhoto;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.model.TerminalPhotoSelectListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
*
* @author cy
*/
@Slf4j
@Component
public class TerminalUtils {
private static Integer hearttime;
private static String photoaddress;
private static String videoaddress;
@Value("${heart.time}")
public void setHearttime(Integer time) {
TerminalUtils.hearttime = time;
}
@Value("${photo.address}")
public void setPhotoaddress(String photoaddress) {
TerminalUtils.photoaddress = photoaddress;
}
@Value("${video.address}")
public void setVideoaddress(String videoaddress) {
TerminalUtils.videoaddress = videoaddress;
}
/**
* 线
*
* @param lastHeartbeat
*/
public static boolean judgeTerminalStatus(BigInteger lastHeartbeat) {
if (lastHeartbeat == null) {
return false;
}
long time = MyDateUtils.TimeSecond2MillSecond(lastHeartbeat.longValue());
DateTime date = MyDateUtils.date(time);
long between = MyDateUtils.between(MyDateUtils.getNowDate(), date, DateUnit.MINUTE);
if (between > hearttime) {
return false;
} else {
return true;
}
}
/**
*
*/
public static String getPhotoPath(Integer mediaType, String requestIp, String path) {
if (mediaType != null) {
if (mediaType.intValue() == 0) {
return requestIp + photoaddress + path;
} else if (mediaType == 1) {
return requestIp + videoaddress + path;
} else {
return "";
}
} else {
return "";
}
}
/**
*
*/
public static String getThumbPhotoPath(Integer mediaType, String requestIp, String path) {
if (mediaType.intValue() == 0) {
if (StringUtils.isNotBlank(path)) {
return requestIp + videoaddress + path;
} else {
return "";
}
} else {
return "";
}
}
/**
*
*
* @param requestIp
* @param list
* @param lineMap
* @param termchannelMapMap
* @param terminalMap
* @param termchannelMap
* @param towerMap
* @param photoList
* @return
*/
public static List<TerminalPhotosModel.PhotosBean> setPhotoList(String requestIp, List<TerminalChannelMapper> list, Map<Integer, LineAndDyNameDto> lineMap, Map<String, TerminalChannelMapper> termchannelMapMap, Map<Integer, Terminals> terminalMap, Map<Integer, TerminalChannels> termchannelMap, Map<Integer, TowerDto> towerMap, List<TerminalPhoto> photoList) {
List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
for (TerminalChannelMapper item : list) {
TerminalPhotosModel.PhotosBean photosBean = new TerminalPhotosModel.PhotosBean();
Integer termid = item.getTermId();
Integer channelid = item.getChannelId();
BigInteger photoId = item.getPhotoId();
Integer lineid = null;
photosBean.setTermid(termid);
Terminals terminals = terminalMap.get(termid);
if (terminals != null) {
lineid = terminals.getLineid();
photosBean.setLineid(lineid);
photosBean.setDisplayname(terminals.getDisplayName());
photosBean.setCmdid(terminals.getCmdid());
Integer towerid = terminals.getTowerid();
TowerDto towerDto = towerMap.get(towerid);
if (towerDto != null) {
photosBean.setTowername(towerDto.getName());
photosBean.setAddress(towerDto.getAddress());
}
}
photosBean.setChannelid(channelid);
photosBean.setChannnelname(termchannelMap.get(channelid).getChannelName());
if (termchannelMapMap != null) {
TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termid + "#" + channelid);
if (terminalChannelMapper != null) {
photosBean.setAlias(terminalChannelMapper.getAlias());
} else {
photosBean.setAlias("");
}
} else {
photosBean.setAlias("");
}
if (lineid != null) {
LineAndDyNameDto lineAndDyNameDto = lineMap.get(lineid);
if (lineAndDyNameDto != null) {
photosBean.setLinename(lineAndDyNameDto.getName());
} else {
photosBean.setLinename("");
}
}
for (int y = 0; y < photoList.size(); y++) {
TerminalPhoto terminalPhoto = photoList.get(y);
if (BeanUtil.isNotEmpty(terminalPhoto)) {
if (terminalPhoto.getId() != null) {
if (terminalPhoto.getId().longValue() == photoId.longValue()) {
Integer mediatype = terminalPhoto.getMediaType();
if (mediatype != null && (mediatype.intValue() == 0 || mediatype.intValue() == 1)) {
photosBean.setPath(terminalPhoto.getPath());
long recvtime = MyDateUtils.TimeSecond2MillSecond(terminalPhoto.getRecvTime().longValue());
photosBean.setRecvTime(MyDateUtils.date(recvtime));
long phototime = MyDateUtils.TimeSecond2MillSecond(terminalPhoto.getPhotoTime().longValue());
photosBean.setPhotoTime(MyDateUtils.date(phototime));
photosBean.setMediatype(mediatype);
String thumbPhotoPath = TerminalUtils.getThumbPhotoPath(mediatype, requestIp, terminalPhoto.getThumb());
if (StringUtils.isNotBlank(thumbPhotoPath)) {
photosBean.setThumb(thumbPhotoPath);
}
String photoPath = TerminalUtils.getPhotoPath(mediatype, requestIp, terminalPhoto.getPath());
photosBean.setPath(photoPath);
photosBean.setOrginalid(terminalPhoto.getOrginalId());
photosBean.setPresetId(terminalPhoto.getPresetId());
}
break;
}
}
}
}
beans.add(photosBean);
}
return beans;
}
/**
* ()
*
* @param requestIp
* @param list
* @param lineMap
* @param termchannelMapMap
* @param terminalMap
* @param termchannelMap
* @param towerMap
* @param photoList
* @return
*/
public static List<TerminalPhotosModel.PhotosBean> setTowerPhotoList(String requestIp, List<TerminalChannelMapper> list, Map<Integer, LineAndDyNameDto> lineMap, Map<String, TerminalChannelMapper> termchannelMapMap, Map<Integer, Terminals> terminalMap, Map<Integer, TerminalChannels> termchannelMap, Map<Integer, TowerDto> towerMap, List<TerminalPhoto> photoList) {
List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
for (TerminalChannelMapper item : list) {
TerminalPhotosModel.PhotosBean photosBean = new TerminalPhotosModel.PhotosBean();
Integer termid = item.getTermId();
Integer channelid = item.getChannelId();
BigInteger photoId = item.getPhotoId();
Integer lineid = null;
photosBean.setTermid(termid);
Terminals terminals = terminalMap.get(termid);
if (terminals != null) {
lineid = terminals.getLineid();
photosBean.setLineid(lineid);
photosBean.setDisplayname(terminals.getDisplayName());
photosBean.setCmdid(terminals.getCmdid());
Integer towerid = terminals.getTowerid();
TowerDto towerDto = towerMap.get(towerid);
if (towerDto != null) {
photosBean.setTowername(towerDto.getName());
photosBean.setAddress(towerDto.getAddress());
}
}
photosBean.setChannelid(channelid);
if (termchannelMap != null) {
TerminalChannels terminalChannels = termchannelMap.get(channelid);
if (terminalChannels != null) {
photosBean.setChannnelname(terminalChannels.getChannelName());
}
}
if (termchannelMapMap != null) {
TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termid + "#" + channelid);
if (terminalChannelMapper != null) {
photosBean.setAlias(terminalChannelMapper.getAlias());
} else {
photosBean.setAlias("");
}
} else {
photosBean.setAlias("");
}
if (lineid != null) {
LineAndDyNameDto lineAndDyNameDto = lineMap.get(lineid);
if (lineAndDyNameDto != null) {
photosBean.setLinename(lineAndDyNameDto.getName());
} else {
photosBean.setLinename("");
}
}
if (photoId == null) {
photosBean.setPath(null);
} else {
for (int y = 0; y < photoList.size(); y++) {
TerminalPhoto terminalPhoto = photoList.get(y);
if (BeanUtil.isNotEmpty(terminalPhoto)) {
if (terminalPhoto.getId() != null) {
if (terminalPhoto.getId().longValue() == photoId.longValue()) {
Integer mediatype = terminalPhoto.getMediaType();
if (mediatype != null && (mediatype.intValue() == 0 || mediatype.intValue() == 1)) {
photosBean.setPath(terminalPhoto.getPath());
long recvtime = MyDateUtils.TimeSecond2MillSecond(terminalPhoto.getRecvTime().longValue());
photosBean.setRecvTime(MyDateUtils.date(recvtime));
long phototime = MyDateUtils.TimeSecond2MillSecond(terminalPhoto.getPhotoTime().longValue());
photosBean.setPhotoTime(MyDateUtils.date(phototime));
photosBean.setMediatype(mediatype);
String thumbPhotoPath = TerminalUtils.getThumbPhotoPath(mediatype, requestIp, terminalPhoto.getThumb());
if (StringUtils.isNotBlank(thumbPhotoPath)) {
photosBean.setThumb(thumbPhotoPath);
}
String photoPath = TerminalUtils.getPhotoPath(mediatype, requestIp, terminalPhoto.getPath());
photosBean.setPath(photoPath);
photosBean.setOrginalid(terminalPhoto.getOrginalId());
photosBean.setPresetId(terminalPhoto.getPresetId());
}
break;
}
}
}
}
}
beans.add(photosBean);
}
return beans;
}
public static List<TerminalPhotoSelectListModel.PhotoBean> fdsa(String requestIp, List<TerminalPhoto> list, Map<Integer, Terminals> terminalMap, Map<Integer, LineAndDyNameDto> lineMap, Map<Integer, TerminalChannels> termchannelMap, Map<String, TerminalChannelMapper> termchannelMapMap) {
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
for (TerminalPhoto item : list) {
TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean();
photoBean.setTermid(item.getTermId());
Terminals terminals = terminalMap.get(item.getTermId());
if (!BeanUtil.isEmpty(terminals)) {
Integer mediaType = item.getMediaType();
if (mediaType != null && (mediaType.intValue() == 0 || mediaType.intValue() == 1)) {
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());
String photoPath = TerminalUtils.getPhotoPath(mediaType, requestIp, item.getPath());
photoBean.setPath(photoPath);
String thumbPhotoPath = TerminalUtils.getThumbPhotoPath(item.getMediaType(), requestIp, item.getThumb());
if (StringUtils.isNotBlank(thumbPhotoPath)) {
photoBean.setThumb(thumbPhotoPath);
}
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);
}
}
}
return beans;
}
}

@ -0,0 +1,24 @@
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 LastTowerVo {
@ApiModelProperty(value = "编号", example = "电压编号 线路编号")
private Integer id;
@ApiModelProperty(value = "查询类型", example = "1--电压 2--线路 ")
private Integer type;
@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;
}

@ -19,8 +19,8 @@ public class TerminalAndChannelIdAndTimeVo {
private Integer terminalid;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455")
private List<Integer> channelid;
@ApiModelProperty(value = "通道编号", example = "-1---全部")
private Integer channelid;
@NotNull(message = "查询时间不能缺少")
@ApiModelProperty(value = "查询时间", example = "123455")

@ -1,19 +0,0 @@
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 TestVo {
private String deviceld;
private String alarmDate;
private String alarmType;
private String message;
private String picurl;
private String companyld;
}

@ -1,12 +1,10 @@
package com.shxy.xymanager_dao.dao;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.dto.DyAndLineAndTowerAndTermDto;
import com.shxy.xymanager_common.dto.DyLineAndTerminalNoHeartDto;
import com.shxy.xymanager_common.dto.DyLineAndTerminalWithHeartDto;
import com.shxy.xymanager_common.dto.DyLineAndTowertDto;
import com.shxy.xymanager_common.entity.DyLevel;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -15,7 +13,7 @@ public interface DyLevelDao {
List<DyAndLineAndTowerAndTermDto> selectDyAndLineAndTowerAnTermList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("termid") Integer termid, @Param("search") String search, @Param("status") Integer status);
List<DyLineAndTowertDto> selectDyAndLineAndTowerList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("search") String search);
List<DyLineAndTowertDto> selectDyAndLineAndTowerList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid);
int deleteByPrimaryKey(Integer id);

@ -1,7 +1,6 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalChannelMapper;
import com.shxy.xymanager_common.entity.TerminalChannels;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
@ -17,6 +16,8 @@ public interface TerminalChannelMapperDao {
int insertList(@Param("list") List<TerminalChannelMapper> record, @Param("createat") Date create, @Param("updateat") Date update);
List<TerminalChannelMapper> selectTermAndMapByTowerId(@Param("status") Integer status, @Param("towerlist") List<Integer> towerlist);
List<TerminalChannelMapper> selectByTermid(Integer id);
TerminalChannelMapper selectByPrimaryKey(Integer id);

@ -13,7 +13,7 @@ import java.util.List;
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> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") Integer channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
List<TerminalPhoto> selectPhotoListByOrginIdAndTermList(@Param("list") List<TerminalImgAlarmsDto> list);

@ -18,8 +18,6 @@ public interface TerminalsDao {
Terminals selectById(@Param("id") Integer id, @Param("status") Integer status);
List<ChannelAndTermDto> selectChannelAndTermList(@Param("status") Integer status);
List<TerminalsAndStatusDto> selectTermAndStatusList(@Param("status") Integer status, @Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("search") String search);
Terminals selectByCmdid(@Param("cmdid") String cmdid, @Param("status") Integer status);

@ -84,8 +84,8 @@
<result column="line_name" jdbcType="VARCHAR" property="lineName"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="dy_level_id" jdbcType="INTEGER" property="dyLevelId"/>
<result column="term_id" jdbcType="INTEGER" property="towerId"/>
<result column="cmdid" jdbcType="VARCHAR" property="towerName"/>
<result column="tower_id" jdbcType="INTEGER" property="towerId"/>
<result column="tower_name" jdbcType="VARCHAR" property="towerName"/>
</resultMap>
<sql id="Base_Column_List">
@ -105,7 +105,6 @@
where status = #{status}
</select>
<select id="selectDyAndLineAndTowerAnTermList" resultMap="DyAndLineAndTowerAnTermMap">
select
a.id as id,
@ -145,7 +144,6 @@
</where>
</select>
<select id="selectDyAndLineAndTowerList" resultMap="DyAndLineAndTowerMap">
select
a.id as dyid,
@ -170,9 +168,6 @@
<if test="towerid != null">
and c.id = #{towerid}
</if>
<if test="search != null">
and ( b.name like "%"#{search}"%" or c.name like "%"#{search}"%")
</if>
</where>
</select>

@ -49,6 +49,26 @@
from terminal_channel_mapper
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectTermAndMapByTowerId" resultMap="BaseResultMap">
select
a.id as term_id,
b.channel_id as channel_id,
b.photo_id as photo_id,
b.photo_time as photo_time,
b.alias as alias
from (terminals a left join
terminal_channel_mapper b on a.id = b.term_id)
where a.status = #{status}
<if test="towerlist != null and towerlist.size>0">
and a.tower_id in
<foreach collection="towerlist" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</select>
<delete id="deleteByTermId" parameterType="java.lang.Integer">
delete from terminal_channel_mapper
where term_id = #{id}

@ -103,11 +103,8 @@
<if test="terminalid != null">
and term_id = #{terminalid}
</if>
<if test="channelid != null and channelid.size > 0">
and channel_id in
<foreach collection="channelid" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="channelid != null">
and channel_id = #{channelid}
</if>
order by photo_time desc
</select>

@ -105,20 +105,6 @@
</select>
<select id="selectChannelAndTermList" resultMap="ChannelAndTerm">
select
a.id as term_id,
a.line_id as line_id,
a.cmdid as cmdid,
a.display_name as display_name,
b.channel_id as channel_id,
c.channel_name as channel_name
from ((terminals a left join
terminal_channel_mapper b on a.id = b.term_id) left join
terminal_channels c on b.channel_id = c.id)
where a.status = #{status}
</select>
<select id="selectTermAndStatusList" resultMap="TermAndStatusMap">
select
d.id as id,

@ -3,29 +3,32 @@ 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 cn.hutool.core.date.DateUnit;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalWithHeartDto;
import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.dto.TerminalsWithHeart;
import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.DyListModel;
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.TerminalUtils;
import com.shxy.xymanager_common.vo.TestVo;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_dao.dao.DyLevelDao;
import com.shxy.xymanager_dao.dao.TerminalChannelMapperDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.DyLevelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
@ -37,6 +40,15 @@ public class DyLevelServiceImpl implements DyLevelService {
@Autowired
DyLevelDao dyLevelDao;
@Autowired
TerminalChannelMapperDao terminalChannelMapperDao;
@Autowired
TerminalPhotoDao terminalPhotoDao;
@Autowired
CacheService cacheService;
/**
* 线
*
@ -97,9 +109,70 @@ public class DyLevelServiceImpl implements DyLevelService {
return Asserts.success(model);
}
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> gettest(List<TestVo> vo) {
log.info(vo.toString());
return Asserts.success("success");
public ServiceBody<TerminalPhotosModel> getLastTowerList(String requestIp, LastTowerVo vo) {
TerminalPhotosModel model = new TerminalPhotosModel();
Integer id = vo.getId();
Integer type = vo.getType();
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
List<DyLineAndTowertDto> dtos = new ArrayList<>();
if (type == 1) {
dtos = dyLevelDao.selectDyAndLineAndTowerList(id, null, null);
} else {
dtos = dyLevelDao.selectDyAndLineAndTowerList(null, id, null);
}
if (CollectionUtil.isEmpty(dtos)) {
model.setList(new ArrayList<>());
} else {
ArrayList<Integer> towerlist = new ArrayList<>();
for (DyLineAndTowertDto item : dtos) {
Integer towerId = item.getTowerId();
towerlist.add(towerId);
}
if (CollectionUtil.isEmpty(towerlist)) {
model.setList(new ArrayList<>());
} else {
PageUtils.SetPage(pageindex, pagesize);
List<TerminalChannelMapper> list = terminalChannelMapperDao.selectTermAndMapByTowerId(CommonStatus.EFFECTIVE.value(), towerlist);
List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
if (CollectionUtil.isNotEmpty(list)) {
ArrayList<BigInteger> photolist = new ArrayList<>();
for (TerminalChannelMapper item : list) {
photolist.add(item.getPhotoId());
}
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap();
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap();
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
List<TerminalPhoto> photoList = terminalPhotoDao.selectPhotosByIdList(photolist);
beans = TerminalUtils.setTowerPhotoList(requestIp, list, lineMap, termchannelMapMap, terminalMap, termchannelMap, towerMap, photoList);
}
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);
}
}

@ -2,9 +2,7 @@ package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONObject;
import com.shxy.xymanager_common.constant.UuidUtils;
import com.shxy.xymanager_common.dto.TerminalsWithHeart;
@ -14,8 +12,8 @@ import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.TerminalUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
import com.shxy.xymanager_common.vo.OpenCmdidVo;
import com.shxy.xymanager_common.vo.OpenDeviceCaptureVo;
import com.shxy.xymanager_common.vo.UserLoginVo;

@ -3,19 +3,17 @@ package com.shxy.xymanager_service.impl;
import com.alibaba.fastjson.JSONObject;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.PhotoParamsDto;
import com.shxy.xymanager_common.dto.UpperComputerInfoDto;
import com.shxy.xymanager_common.entity.TerminalParams;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.SystemConfigReqVo;
import com.shxy.xymanager_common.vo.SystemConfigVo;
import com.shxy.xymanager_common.vo.TerminalUpperComputerVo;
import com.shxy.xymanager_dao.dao.RequestResultsDao;
import com.shxy.xymanager_dao.dao.SystemConfigDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_service.service.SystemConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;

@ -6,12 +6,10 @@ import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.entity.Resolution;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.ResolutionModel;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.TerminalUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.VoiceCtrlVo;
import com.shxy.xymanager_dao.dao.TerminalResolutionDao;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TermSetService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@ -13,7 +13,7 @@ import com.shxy.xymanager_common.model.TerminalAlarmListModel;
import com.shxy.xymanager_common.model.TerminalImgAlarmParamsModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.TerminalUtils;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
import com.shxy.xymanager_common.vo.TerminalAlarmIdVo;
import com.shxy.xymanager_common.vo.TerminalAlarmSelectVo;
import com.shxy.xymanager_common.vo.UpdateTerminalAlarmParamsVo;
@ -22,11 +22,9 @@ import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.TerminalAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigInteger;
import java.sql.Struct;
import java.util.*;

@ -17,20 +17,15 @@ 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;
import com.shxy.xymanager_common.util.TerminalUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@ -1,41 +1,24 @@
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.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.TerminalInfoDto;
import com.shxy.xymanager_common.entity.TerminalPositions;
import com.shxy.xymanager_common.entity.TerminalStatus;
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.*;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalPositionsDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.interaction.Cma;
import com.shxy.xymanager_service.service.TerminalGpsService;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**

@ -6,7 +6,6 @@ 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 cn.hutool.setting.SettingUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
@ -20,18 +19,19 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.*;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
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.CacheService;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.util.*;
@ -89,11 +89,12 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
DateTime enddateTime = MyDateUtils.endOfDay(time);
long start = MyDateUtils.TimeMillSecond2Second(begindateTime);
long end = MyDateUtils.TimeMillSecond2Second(enddateTime);
boolean empty1 = CollectionUtil.isEmpty(vo.getChannelid());
List<TerminalPhoto> list = new ArrayList<>();
if (!empty1) {
list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(), BigInteger.valueOf(start), BigInteger.valueOf(end));
Integer channelid = vo.getChannelid();
if (channelid == -1) {
channelid = null;
}
List<TerminalPhoto> list = new ArrayList<>();
list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), channelid, BigInteger.valueOf(start), BigInteger.valueOf(end));
boolean empty = CollectionUtil.isEmpty(list);
model.setTime(vo.getTime());
model.setNum(list.size());
@ -222,34 +223,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap();
Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap();
for (TerminalPhoto item : list) {
TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean();
photoBean.setTermid(item.getTermId());
Terminals terminals = terminalMap.get(item.getTermId());
if (!BeanUtil.isEmpty(terminals)) {
Integer mediaType = item.getMediaType();
if (mediaType != null && (mediaType.intValue() == 0 || mediaType.intValue() == 1)) {
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());
String photoPath = TerminalUtils.getPhotoPath(mediaType, requestIp, item.getPath());
photoBean.setPath(photoPath);
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);
}
}
}
beans = TerminalUtils.fdsa(requestIp, list, terminalMap, lineMap, termchannelMap, termchannelMapMap);
model.setList(beans);
}
}
@ -266,6 +240,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
return Asserts.success(model);
}
/**
*
*
@ -396,92 +371,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
* @param vo
* @return
*/
// @Override
// public ServiceBody<TerminalPhotosModel> getPhotoBanner(String requestIp, PageVo vo) {
// TerminalPhotosModel model = new TerminalPhotosModel();
//
// int pageindex = vo.getPageindex();
// int pagesize = vo.getPagesize();
// PageUtils.SetPage(pageindex, pagesize);
//
// List<ChannelAndTermDto> list = terminalsDao.selectChannelAndTermList(CommonStatus.EFFECTIVE.value());
// List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
//
// if (!CollectionUtil.isEmpty(list)) {
// Map<Integer, LineAndDyNameDto> lineMap = XyCache.lineMap;
// Map<String, TerminalChannelMapper> termchannelMapMap = XyCache.termchannelMapMap;
// List<Integer> termidlist = new ArrayList<>();
// for (ChannelAndTermDto item : list) {
// Integer termid = item.getTermid();
// termidlist.add(termid);
// }
// List<TermAndChannelLatestPhotoMapperDto> list2 = terminalPhotoDao.selectTermAndChannelLatestPhotoList(termidlist);
// for (ChannelAndTermDto item : list) {
// TerminalPhotosModel.PhotosBean photosBean = new TerminalPhotosModel.PhotosBean();
// Integer termid = item.getTermid();
// Integer channelid = item.getChannelid();
//
// photosBean.setTermid(termid);
// photosBean.setLineid(item.getLineid());
// photosBean.setChannnelname(item.getChannelname());
// if (termchannelMapMap != null) {
// TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termid + "#" + channelid);
// if (terminalChannelMapper != null) {
// photosBean.setAlias(terminalChannelMapper.getAlias());
// } else {
// photosBean.setAlias("");
// }
// } else {
// photosBean.setAlias("");
// }
// photosBean.setChannelid(channelid);
// photosBean.setDisplayname(item.getDisplayname());
//
// LineAndDyNameDto lineAndDyNameDto = lineMap.get(item.getLineid());
// if (lineAndDyNameDto != null) {
// photosBean.setLinename(lineAndDyNameDto.getName());
// } else {
// photosBean.setLinename("");
// }
//
// for (int y = 0; y < list2.size(); y++) {
// TermAndChannelLatestPhotoMapperDto item2 = list2.get(y);
// if (termid.intValue() == item2.getTermid().intValue() && item.getChannelid().intValue() == item2.getChannelid().intValue()) {
// Integer mediatype = item2.getMediatype();
// if (mediatype != null && (mediatype.intValue() == 0 || mediatype.intValue() == 1)) {
// photosBean.setPath(item2.getPath());
// long recvtime = MyDateUtils.TimeSecond2MillSecond(item2.getRecvTime().longValue());
// photosBean.setRecvTime(MyDateUtils.date(recvtime));
// long phototime = MyDateUtils.TimeSecond2MillSecond(item2.getPhotoTime().longValue());
// photosBean.setPhotoTime(MyDateUtils.date(phototime));
// photosBean.setMediatype(mediatype);
// if (mediatype.intValue() == 0) {
// photosBean.setPath(requestIp + photoaddress + item2.getPath());
// } else {
// photosBean.setPath(requestIp + videoaddress + item2.getPath());
// }
// photosBean.setOrginalid(item2.getOrginalid());
// photosBean.setPresetId(item2.getPresetId());
// }
// break;
// }
// }
// beans.add(photosBean);
// }
// }
// 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);
// }
@Override
public ServiceBody<TerminalPhotosModel> getPhotoBanner(String requestIp, PageVo vo) {
TerminalPhotosModel model = new TerminalPhotosModel();
@ -506,68 +395,8 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
List<TerminalPhoto> photoList = terminalPhotoDao.selectPhotosByIdList(photolist);
for (TerminalChannelMapper item : list) {
TerminalPhotosModel.PhotosBean photosBean = new TerminalPhotosModel.PhotosBean();
Integer termid = item.getTermId();
Integer channelid = item.getChannelId();
BigInteger photoId = item.getPhotoId();
Integer lineid = null;
photosBean.setTermid(termid);
Terminals terminals = terminalMap.get(termid);
if (terminals != null) {
lineid = terminals.getLineid();
photosBean.setLineid(lineid);
photosBean.setDisplayname(terminals.getDisplayName());
photosBean.setCmdid(terminals.getCmdid());
Integer towerid = terminals.getTowerid();
TowerDto towerDto = towerMap.get(towerid);
if (towerDto != null) {
photosBean.setTowername(towerDto.getName());
photosBean.setAddress(towerDto.getAddress());
}
}
photosBean.setChannelid(channelid);
photosBean.setChannnelname(termchannelMap.get(channelid).getChannelName());
beans = TerminalUtils.setPhotoList(requestIp, list, lineMap, termchannelMapMap, terminalMap, termchannelMap, towerMap, photoList);
if (termchannelMapMap != null) {
TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termid + "#" + channelid);
if (terminalChannelMapper != null) {
photosBean.setAlias(terminalChannelMapper.getAlias());
} else {
photosBean.setAlias("");
}
} else {
photosBean.setAlias("");
}
if (lineid != null) {
LineAndDyNameDto lineAndDyNameDto = lineMap.get(lineid);
if (lineAndDyNameDto != null) {
photosBean.setLinename(lineAndDyNameDto.getName());
} else {
photosBean.setLinename("");
}
}
for (int y = 0; y < photoList.size(); y++) {
TerminalPhoto terminalPhoto = photoList.get(y);
if (terminalPhoto.getId().longValue() == photoId.longValue()) {
Integer mediatype = terminalPhoto.getMediaType();
if (mediatype != null && (mediatype.intValue() == 0 || mediatype.intValue() == 1)) {
photosBean.setPath(terminalPhoto.getPath());
long recvtime = MyDateUtils.TimeSecond2MillSecond(terminalPhoto.getRecvTime().longValue());
photosBean.setRecvTime(MyDateUtils.date(recvtime));
long phototime = MyDateUtils.TimeSecond2MillSecond(terminalPhoto.getPhotoTime().longValue());
photosBean.setPhotoTime(MyDateUtils.date(phototime));
photosBean.setMediatype(mediatype);
String photoPath = TerminalUtils.getPhotoPath(mediatype, requestIp, terminalPhoto.getPath());
photosBean.setPath(photoPath);
photosBean.setOrginalid(terminalPhoto.getOrginalId());
photosBean.setPresetId(terminalPhoto.getPresetId());
}
break;
}
}
beans.add(photosBean);
}
}
model.setList(beans);
PageInfo pageData = PageUtils.getPageData(list);
@ -694,34 +523,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap();
Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap();
for (TerminalPhoto item : list) {
TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean();
photoBean.setTermid(item.getTermId());
Terminals terminals = terminalMap.get(item.getTermId());
if (!BeanUtil.isEmpty(terminals)) {
Integer mediaType = item.getMediaType();
if (mediaType != null && (mediaType.intValue() == 0 || mediaType.intValue() == 1)) {
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());
String photoPath = TerminalUtils.getPhotoPath(mediaType, requestIp, item.getPath());
photoBean.setPath(photoPath);
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);
}
}
}
beans = TerminalUtils.fdsa(requestIp, list, terminalMap, lineMap, termchannelMap, termchannelMapMap);
model.setList(beans);
}
PageInfo pageData = PageUtils.getPageData(list);

@ -8,7 +8,6 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.ChannelAndTermDto;
@ -21,6 +20,8 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.*;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.ScheduleListUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
@ -30,8 +31,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@ -19,12 +19,11 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.util.TerminalUtils;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
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.CacheService;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
@ -33,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;

@ -5,11 +5,10 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.RequestResultsDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_service.service.TerminalVideoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@ -1,10 +1,11 @@
package com.shxy.xymanager_service.service;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.DyListModel;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TestVo;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.vo.LastTowerVo;
import java.util.List;
@ -30,5 +31,11 @@ public interface DyLevelService {
ServiceBody<DyListModel> getdyList();
ServiceBody<String> gettest(List<TestVo> vo);
/**
* 线
*
* @param vo
* @return
*/
ServiceBody<TerminalPhotosModel> getLastTowerList(String requestIp, LastTowerVo vo);
}

Loading…
Cancel
Save