liuguijing 2 years ago
commit c606c354ba

@ -0,0 +1,74 @@
package com.shxy.xymanager_admin.controller;
import com.shxy.xymanager_common.annotation.Log;
import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.GetModel;
import com.shxy.xymanager_common.model.TerminalVideoParamsModel;
import com.shxy.xymanager_common.vo.PhotoParamsVo;
import com.shxy.xymanager_common.vo.VideoParamsVo;
import com.shxy.xymanager_service.service.TerminalVideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "视频接口", tags = "视频接口相关")
@RestController
@Slf4j
public class TerminalVideoController extends BaseController {
@Autowired
TerminalVideoService terminalVideoService;
@ApiOperation(value = "视频参数设置", notes = "视频参数设置接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/updateVideoParam")
@Log(title = "视频参数设置", type = "查询")
public ResponseReult<String> updateVideoParam(@RequestBody @Validated VideoParamsVo vo) {
ServiceBody<String> serviceBody = terminalVideoService.updateVideoParam(vo);
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("/videoParamGet")
@Log(title = "视频参数查询触发", type = "查询")
public ResponseReult<GetModel> videoParamGet(@RequestBody @Validated VideoParamsVo vo) {
ServiceBody<GetModel> serviceBody = terminalVideoService.videoParamGet(vo);
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("/selectVideoParam")
@Log(title = "视频参数查询", type = "查询")
public ResponseReult<TerminalVideoParamsModel> selectVideoParam(@RequestParam("requestId") Integer requestId) {
ServiceBody<TerminalVideoParamsModel> serviceBody = terminalVideoService.selectVideoParam(requestId);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -2,7 +2,9 @@ package com.shxy.xymanager_common.constant;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
@ -10,14 +12,31 @@ import java.util.concurrent.atomic.AtomicInteger;
* *
* @author xzg * @author xzg
*/ */
@Component
public class Constants public class Constants
{ {
@Value("${cma.server}") @Value("${cma.server}")
private static String server; public String cmServer;
@Value("${cma.port}") @Value("${cma.port}")
public int cmaPort;
private static String server;
private static int port; private static int port;
public static String CMD = "";
@PostConstruct
private void init(){
server = cmServer;
port = cmaPort;
CMD = "/usr/local/bin/xympadmn --server="+server+"\t" +"--port="+port+"\t" +"--act=";
}
/** /**
@ -176,6 +195,5 @@ public class Constants
*/ */
public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis()/1000)); public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis()/1000));
public static String CMD = "/usr/local/bin/xympadmn --server="+server+"\t" +"--port="+port+"\t" +"--act=";
} }

@ -63,5 +63,8 @@ public class TerminalPhotoListModel implements Serializable {
@ApiModelProperty(value = "拍照方式", example = "123456") @ApiModelProperty(value = "拍照方式", example = "123456")
private Integer manualRequest; private Integer manualRequest;
@ApiModelProperty(value = "拍照类型", example = "123456")
private Integer mediaType;
} }
} }

@ -56,7 +56,7 @@ public class TerminalPhotoSelectListModel implements Serializable {
private BigInteger orginalid; private BigInteger orginalid;
@ApiModelProperty(value = "图片类型", example = "123456") @ApiModelProperty(value = "图片类型", example = "123456")
private Integer mediatype; private Integer mediaType;
@ApiModelProperty(value = "拍照时间", example = "123456") @ApiModelProperty(value = "拍照时间", example = "123456")
private Date photoTime; private Date photoTime;

@ -0,0 +1,23 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
*
*/
@Data
@ApiModel(value = "视频参数对象", description = "视频参数对象信息")
public class TerminalVideoParamsModel implements Serializable {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Short channel;
}

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@Data @Data
@ApiModel(value = "通道对象", description = "通道对象描述") @ApiModel(value = "添加通道对象", description = "添加通道对象描述")
public class TerminalChannelVo { public class TerminalChannelVo {
@NotNull(message = "装置列表不能缺少") @NotNull(message = "装置列表不能缺少")

@ -5,13 +5,14 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data @Data
@ApiModel(value = "修改杆塔对象", description = "修改杆塔对象描述") @ApiModel(value = "修改杆塔对象", description = "修改杆塔对象描述")
public class UpdateTowerVo { public class UpdateTowerVo {
@ApiModelProperty(value = "杆塔编号", example = "123456") @ApiModelProperty(value = "杆塔编号", example = "123456")
@NotBlank(message = "杆塔编号不能缺少") @NotNull(message = "杆塔编号不能缺少")
private Integer id; private Integer id;
@ApiModelProperty(value = "杆塔名称", example = "名称名称") @ApiModelProperty(value = "杆塔名称", example = "名称名称")
@ -19,7 +20,7 @@ public class UpdateTowerVo {
private String name; private String name;
@ApiModelProperty(value = "线路编号", example = "单位") @ApiModelProperty(value = "线路编号", example = "单位")
@NotBlank(message = "线路编号不能缺少") @NotNull(message = "线路编号不能缺少")
private Integer lineId; private Integer lineId;

@ -0,0 +1,25 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "视频控制参数对象", description = "视频控制参数对象")
public class VideoParamsVo {
@ApiModelProperty(value = "装置编号", example = "123456")
private String cmdId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer channel;
@ApiModelProperty(value = "不知道是啥", example = "123456")
private Integer format;
@ApiModelProperty(value = "不知道是啥", example = "123456")
private Integer time;
}

@ -5,6 +5,8 @@ import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper; import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.vo.TerminalChannelVo;
import com.shxy.xymanager_common.vo.UpdateTerminalChannelVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
@ -32,4 +34,8 @@ public interface TerminalChannelsDao {
int deleteList(@Param("list") List<TerminalChannels> list,@Param("status") Integer status,@Param("updateat") Date update); int deleteList(@Param("list") List<TerminalChannels> list,@Param("status") Integer status,@Param("updateat") Date update);
int selectChannelCount(List<TerminalChannelVo.ChannelItem> list);
int selectChannelCountById(UpdateTerminalChannelVo vo);
} }

@ -32,7 +32,7 @@ public interface TerminalPhotoDao {
int updateByPrimaryKey(TerminalPhoto record); int updateByPrimaryKey(TerminalPhoto record);
BigInteger getLatestPhoto(@Param("termId") Integer termId); TerminalPhoto getLatestPhoto(@Param("termId") Integer termId);
List<PhotoAndLineAndChannelDto> selectPhotos(); List<PhotoAndLineAndChannelDto> selectPhotos();

@ -60,6 +60,29 @@
where status = #{status} where status = #{status}
</select> </select>
<select id="selectChannelCount" parameterType="com.shxy.xymanager_common.vo.TerminalChannelVo" resultType="java.lang.Integer">
select
count(1)
from terminal_channels
where
id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.id}
</foreach> or
channel_name in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.channelname}
</foreach>
</select>
<select id="selectChannelCountById" parameterType="com.shxy.xymanager_common.vo.UpdateTerminalChannelVo" resultType="java.lang.Integer">
select
count(1)
from terminal_channels
where
id = #{id} and channel_name = #{channelname}
</select>
<select id="selectAllChannelList" resultMap="BaseResultMap"> <select id="selectAllChannelList" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
@ -81,6 +104,7 @@
<if test="termid != null"> <if test="termid != null">
and x.term_id = #{termid} and x.term_id = #{termid}
</if> </if>
order by x.create_time asc
</select> </select>
<select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap"> <select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap">
SELECT SELECT

@ -117,9 +117,9 @@
GROUP BY term_id , channel_id GROUP BY term_id , channel_id
</select> </select>
<select id="getLatestPhoto" resultType="java.math.BigInteger"> <select id="getLatestPhoto" resultMap="BaseResultMap">
select select
recv_time photoTime <include refid="Base_Column_List"/>
from terminal_photos from terminal_photos
where term_id = #{termId} where term_id = #{termId}
order by recv_time desc limit 1 order by recv_time desc limit 1

@ -47,7 +47,7 @@
y.span as span y.span as span
from terminal_schedule x, from terminal_schedule x,
terminal_schedule_rule y terminal_schedule_rule y
where y.schedule_id = x.id and x.status = #{status} where y.schedule_id = x.id and x.status = #{status} order by x.create_time desc
</select> </select>
<select id="selectSingle" resultMap="ScheduleAndRule"> <select id="selectSingle" resultMap="ScheduleAndRule">

@ -108,20 +108,11 @@
</delete> </delete>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule"> <update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
update terminal_schedule_rule update terminal_schedule
<set> <set>
<if test="data.name != null"> <if test="data.name != null">
name = #{data.name,jdbcType=VARCHAR}, name = #{data.name,jdbcType=VARCHAR},
</if> </if>
<if test="data.startTime != null">
start_time = #{data.startTime,jdbcType=TIME},
</if>
<if test="data.endTime != null">
end_time = #{data.endTime,jdbcType=TIME},
</if>
<if test="data.span != null">
span = #{data.span,jdbcType=INTEGER},
</if>
<if test="data.remark != null"> <if test="data.remark != null">
remark = #{data.remark,jdbcType=VARCHAR}, remark = #{data.remark,jdbcType=VARCHAR},
</if> </if>

@ -108,6 +108,7 @@
left join tower c on a.tower_id = c.id) left join tower c on a.tower_id = c.id)
left join terminal_channel_mapper d on a.id = d.term_id) left join terminal_channel_mapper d on a.id = d.term_id)
left join terminal_channels e on d.channel_id = e.id) left join terminal_channels e on d.channel_id = e.id)
order by a.create_time desc
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">

@ -3,6 +3,7 @@ package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto; import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto;
@ -22,8 +23,11 @@ import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_service.service.TerminalChannelService; import com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -51,7 +55,13 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
public ServiceBody<String> addChannelList(TerminalChannelVo vo) { public ServiceBody<String> addChannelList(TerminalChannelVo vo) {
List<TerminalChannels> list = BeanUtil.copyToList(vo.getList(), TerminalChannels.class, CopyOptions.create().ignoreCase()); List<TerminalChannels> list = BeanUtil.copyToList(vo.getList(), TerminalChannels.class, CopyOptions.create().ignoreCase());
Date date = new Date(); Date date = new Date();
int count = terminalChannelsDao.selectChannelCount(vo.getList());
if(count>0){
return Asserts.error("通道重复");
}
int i = terminalChannelsDao.insertList(list, CommonStatus.EFFECTIVE.value(), date, date); int i = terminalChannelsDao.insertList(list, CommonStatus.EFFECTIVE.value(), date, date);
if (i != 0) { if (i != 0) {
return Asserts.success("录入成功"); return Asserts.success("录入成功");
} else { } else {
@ -67,6 +77,10 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
*/ */
@Override @Override
public ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo) { public ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo) {
int count = terminalChannelsDao.selectChannelCountById(vo);
if(count>0){
return Asserts.success("通道重复");
}
TerminalChannels bean = new TerminalChannels(); TerminalChannels bean = new TerminalChannels();
BeanUtil.copyProperties(vo, bean, CopyOptions.create().ignoreCase()); BeanUtil.copyProperties(vo, bean, CopyOptions.create().ignoreCase());
int i = terminalChannelsDao.updateByPrimaryKeySelective(bean, new Date()); int i = terminalChannelsDao.updateByPrimaryKeySelective(bean, new Date());
@ -154,6 +168,7 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
public ServiceBody<TerminalChannelMapperListModel> getChannelByTermid(TerminalIdVo vo) { public ServiceBody<TerminalChannelMapperListModel> getChannelByTermid(TerminalIdVo vo) {
TerminalChannelMapperListModel model = new TerminalChannelMapperListModel(); TerminalChannelMapperListModel model = new TerminalChannelMapperListModel();
List<TermChannelAndMapperDto> list = terminalChannelsDao.selectByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value()); List<TermChannelAndMapperDto> list = terminalChannelsDao.selectByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value());
log.info("通道查出数据:{}", JSON.toJSONString(list));
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
@ -165,6 +180,7 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
if (!BeanUtil.isEmpty(terminalStatus)) { if (!BeanUtil.isEmpty(terminalStatus)) {
model.setGpsstatus(terminalStatus.getGpsStatus()); model.setGpsstatus(terminalStatus.getGpsStatus());
} }
log.info("通道查出返回数据:{}", JSON.toJSONString(model));
return Asserts.success(model); return Asserts.success(model);
} }

@ -107,11 +107,12 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setChannelId(item.getChannelId()); photoBean.setChannelId(item.getChannelId());
photoBean.setFileSize(item.getFileSize()); photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight()); photoBean.setHeight(item.getHeight());
photoBean.setMediaType(item.getMediaType());
if (item.getMediaType() == 0) { if (item.getMediaType() == 0) {
photoBean.setPath(photoaddress + item.getPath()); photoBean.setPath(photoaddress + item.getPath());
} else { } else {
photoBean.setPath(videoaddress + item.getPath()); photoBean.setPath(videoaddress + item.getPath());
if (item.getThumb() != null) { if (StringUtils.isNotBlank(item.getThumb())) {
photoBean.setThumb(videoaddress + item.getThumb()); photoBean.setThumb(videoaddress + item.getThumb());
} }
} }
@ -179,7 +180,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setChannelid(terminalChannels.getId()); photoBean.setChannelid(terminalChannels.getId());
photoBean.setChannnelname(terminalChannels.getChannelName()); photoBean.setChannnelname(terminalChannels.getChannelName());
} }
photoBean.setMediatype(item.getMediaType()); photoBean.setMediaType(item.getMediaType());
photoBean.setOrginalid(item.getOrginalId()); photoBean.setOrginalid(item.getOrginalId());
// photoBean.setPath(photoaddress + item.getPath()); // photoBean.setPath(photoaddress + item.getPath());
if (item.getMediaType() == 0) { if (item.getMediaType() == 0) {
@ -294,9 +295,14 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override @Override
public ServiceBody<Boolean> getReturnedPhoto(ReturnedPhotoVo vo) { public ServiceBody<Boolean> getReturnedPhoto(ReturnedPhotoVo vo) {
Boolean hasNew = false; Boolean hasNew = false;
BigInteger photoTime = terminalPhotoDao.getLatestPhoto(vo.getTermId()); TerminalPhoto photo = terminalPhotoDao.getLatestPhoto(vo.getTermId());
BigInteger localPhotoTime = MyDateUtils.TimeMillSecond2Second(vo.getPhotoTime()); BigInteger localPhotoTime = MyDateUtils.TimeMillSecond2Second(vo.getPhotoTime());
hasNew = photoTime.compareTo(localPhotoTime) < 0 ? false : true; hasNew = photo.getRecvTime().compareTo(localPhotoTime) < 0 ? false : true;
if(hasNew){
if(!StringUtils.isNotBlank(photo.getThumb())){
hasNew=false;
}
}
return Asserts.success(hasNew); return Asserts.success(hasNew);
} }
@ -458,19 +464,21 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
JSONObject resultObj = JSONObject.parseObject(result); JSONObject resultObj = JSONObject.parseObject(result);
if (null != resultObj.get("groupData")) { if (null != resultObj.get("groupData")) {
List<PhotoTimeResultDto> resultDtoList = JSONArray.parseArray(resultObj.get("groupData").toString(), PhotoTimeResultDto.class); List<PhotoTimeResultDto> resultDtoList = JSONArray.parseArray(resultObj.get("groupData").toString(), PhotoTimeResultDto.class);
List<String> resultList = Lists.newArrayList(); if(CollectionUtil.isNotEmpty(resultDtoList)) {
String startTimeStr = resultDtoList.get(0).getHour() + ":" + resultDtoList.get(0).getMinute() + ":00"; List<String> resultList = Lists.newArrayList();
String endTimeStr = resultDtoList.get(1).getHour() + ":" + resultDtoList.get(1).getMinute() + ":00"; String startTimeStr = resultDtoList.get(0).getHour() + ":" + resultDtoList.get(0).getMinute() + ":00";
Date startTime = DateUtil.parseTime(startTimeStr); String endTimeStr = resultDtoList.get(1).getHour() + ":" + resultDtoList.get(1).getMinute() + ":00";
Date endTime = DateUtil.parseTime(endTimeStr); Date startTime = DateUtil.parseTime(startTimeStr);
Integer span = resultDtoList.get(2).getHour() * 60 + resultDtoList.get(2).getMinute(); Date endTime = DateUtil.parseTime(endTimeStr);
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span); Integer span = resultDtoList.get(2).getHour() * 60 + resultDtoList.get(2).getMinute();
for (DateTime data : dateTimes) { List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
String dateTime = DateUtil.formatTime(data); for (DateTime data : dateTimes) {
resultList.add(dateTime); String dateTime = DateUtil.formatTime(data);
resultList.add(dateTime);
}
model.setList(resultList);
model.setIsNew(true);
} }
model.setList(resultList);
model.setIsNew(true);
} }
} else { } else {
TerminalAndChannelIdVo idVo = new TerminalAndChannelIdVo(); TerminalAndChannelIdVo idVo = new TerminalAndChannelIdVo();

@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.sql.Time; import java.sql.Time;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

@ -0,0 +1,70 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
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 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.*;
import com.shxy.xymanager_common.entity.Lines;
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.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.vo.*;
import com.shxy.xymanager_dao.dao.LinesDao;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import com.shxy.xymanager_service.service.TerminalVideoService;
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 java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
*
*/
@Service
@Slf4j
public class TerminalVideoServiceImpl implements TerminalVideoService {
@Override
public ServiceBody<String> updateVideoParam(VideoParamsVo vo) {
String cmd = Constants.CMD+"videoparams --flag=1 --preset=255 --cmdid="+vo.getCmdId()+ "\t"+ "--channel=" + vo.getChannel()+ "\t"+ "--format=" +
vo.getFormat()+ "\t"+ "--time=" +vo.getTime();
ProcessExecUtils.exec(cmd);
return Asserts.success("修改完成");
}
@Override
public ServiceBody<GetModel> videoParamGet(VideoParamsVo vo) {
return null;
}
@Override
public ServiceBody<TerminalVideoParamsModel> selectVideoParam(Integer requestId) {
return null;
}
}

@ -58,7 +58,7 @@ public interface TerminalPhotoService {
ServiceBody<TerminalPhotosModel> getPhotoBanner(PageVo vo); ServiceBody<TerminalPhotosModel> getPhotoBanner(PageVo vo);
/** /**
* *
* *
* @return * @return
*/ */

@ -0,0 +1,30 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.vo.*;
import java.util.Date;
/**
*
*
* @author CY
*/
public interface TerminalVideoService {
/**
*
*
* @return
*/
ServiceBody<String> updateVideoParam(VideoParamsVo vo);
ServiceBody<GetModel> videoParamGet(VideoParamsVo vo);
ServiceBody<TerminalVideoParamsModel> selectVideoParam(Integer requestId);
}
Loading…
Cancel
Save