|
|
|
@ -13,10 +13,7 @@ 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.PhotoAndLineAndChannelDto;
|
|
|
|
|
import com.shxy.xymanager_common.dto.PhotoParamsDto;
|
|
|
|
|
import com.shxy.xymanager_common.dto.PhotoTimeResultDto;
|
|
|
|
|
import com.shxy.xymanager_common.dto.TerminalPhotoScheduleDto;
|
|
|
|
|
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;
|
|
|
|
@ -313,40 +310,58 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<TerminalPhotosModel> getPhotoBanner(PageVo vo) {
|
|
|
|
|
TerminalPhotosModel model = new TerminalPhotosModel();
|
|
|
|
|
|
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
List<PhotoAndLineAndChannelDto> list = terminalPhotoDao.selectPhotos();
|
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
|
if (empty) {
|
|
|
|
|
model.setList(new ArrayList<>());
|
|
|
|
|
} else {
|
|
|
|
|
List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
|
|
|
|
|
for (PhotoAndLineAndChannelDto item : list) {
|
|
|
|
|
TerminalPhotosModel.PhotosBean photoBean = new TerminalPhotosModel.PhotosBean();
|
|
|
|
|
photoBean.setTermid(item.getTermid());
|
|
|
|
|
photoBean.setDisplayname(item.getDisplayname());
|
|
|
|
|
photoBean.setLineid(item.getLineid());
|
|
|
|
|
photoBean.setLinename(item.getLinename());
|
|
|
|
|
photoBean.setChannelid(item.getChannelid());
|
|
|
|
|
photoBean.setChannnelname(item.getChannnelname());
|
|
|
|
|
photoBean.setOrginalid(item.getOrginalid());
|
|
|
|
|
photoBean.setMediatype(item.getMediatype());
|
|
|
|
|
photoBean.setPresetId(item.getPresetId());
|
|
|
|
|
photoBean.setPath(photoaddress + item.getPath());
|
|
|
|
|
if (item.getMediatype() == 0) {
|
|
|
|
|
photoBean.setPath(photoaddress + item.getPath());
|
|
|
|
|
} else {
|
|
|
|
|
photoBean.setPath(videoaddress + item.getPath());
|
|
|
|
|
|
|
|
|
|
List<ChannelAndTermDto> list = terminalsDao.selectChannelAndTermList(CommonStatus.EFFECTIVE.value());
|
|
|
|
|
|
|
|
|
|
List<Integer> termidlist = new ArrayList<>();
|
|
|
|
|
for (ChannelAndTermDto item : list) {
|
|
|
|
|
Integer termid = item.getTermid();
|
|
|
|
|
termidlist.add(termid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Lines> lines = linesDao.selectLineByDyId(null, CommonStatus.EFFECTIVE.value());
|
|
|
|
|
|
|
|
|
|
List<TermAndChannelLatestPhotoMapperDto> list2 = terminalPhotoDao.selectTermAndChannelLatestPhotoList(termidlist);
|
|
|
|
|
List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
|
|
|
|
|
for (ChannelAndTermDto item : list) {
|
|
|
|
|
for (int y = 0; y < list2.size(); y++) {
|
|
|
|
|
TermAndChannelLatestPhotoMapperDto item2 = list2.get(y);
|
|
|
|
|
if (item.getTermid().intValue() == item2.getTermid().intValue() && item.getChannelid().intValue() == item2.getChannelid().intValue()) {
|
|
|
|
|
TerminalPhotosModel.PhotosBean photosBean = new TerminalPhotosModel.PhotosBean();
|
|
|
|
|
photosBean.setTermid(item.getTermid());
|
|
|
|
|
photosBean.setLineid(item.getLineid());
|
|
|
|
|
photosBean.setChannnelname(item.getChannelname());
|
|
|
|
|
photosBean.setChannelid(item.getChannelid());
|
|
|
|
|
photosBean.setDisplayname(item.getDisplayname());
|
|
|
|
|
photosBean.setPath(item2.getPath());
|
|
|
|
|
|
|
|
|
|
BigInteger recvtime = MyDateUtils.TimeSecond2MillSecond(item2.getRecvTime().longValue());
|
|
|
|
|
photosBean.setRecvTime(MyDateUtils.date(recvtime.longValue()));
|
|
|
|
|
|
|
|
|
|
BigInteger phototime = MyDateUtils.TimeSecond2MillSecond(item2.getPhotoTime().longValue());
|
|
|
|
|
photosBean.setPhotoTime(MyDateUtils.date(phototime.longValue()));
|
|
|
|
|
|
|
|
|
|
photosBean.setMediatype(item2.getMediatype());
|
|
|
|
|
photosBean.setOrginalid(item2.getOrginalid());
|
|
|
|
|
photosBean.setPresetId(item2.getPresetId());
|
|
|
|
|
|
|
|
|
|
for (int z = 0; z < lines.size(); z++) {
|
|
|
|
|
Lines lines1 = lines.get(z);
|
|
|
|
|
if (item.getLineid() == lines1.getId()) {
|
|
|
|
|
photosBean.setLinename(lines1.getName());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
beans.add(photosBean);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
BigInteger phototime = MyDateUtils.TimeSecond2MillSecond(item.getPhotoTime().longValue());
|
|
|
|
|
photoBean.setPhotoTime(MyDateUtils.date(phototime.longValue()));
|
|
|
|
|
BigInteger rectime = MyDateUtils.TimeSecond2MillSecond(item.getRecvTime().longValue());
|
|
|
|
|
photoBean.setRecvTime(MyDateUtils.date(rectime.longValue()));
|
|
|
|
|
beans.add(photoBean);
|
|
|
|
|
}
|
|
|
|
|
model.setList(beans);
|
|
|
|
|
}
|
|
|
|
|
model.setList(beans);
|
|
|
|
|
PageInfo pageData = PageUtils.getPageData(list);
|
|
|
|
|
int currentpage = pageData.getPageNum();
|
|
|
|
|
model.setCurrentpage(currentpage);
|
|
|
|
@ -357,7 +372,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
model.setPagesize(pageSize);
|
|
|
|
|
int pages = pageData.getPages();
|
|
|
|
|
model.setTotalpage(pages);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Asserts.success(model);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -397,7 +416,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<TerminalStatusGetModel> getPhotoQueryParam(ReturnedPhotoParamsGetVo vo) {
|
|
|
|
|
TerminalStatusGetModel model = new TerminalStatusGetModel();
|
|
|
|
|
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --cmdid="+vo.getCmdId() +"\t" +"--clientid=10 --reqid="+Constants.REQUEST_ID+"\t" +"--flag=0 --rf=7 --channel=" + vo.getChannelId();
|
|
|
|
|
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --cmdid=" + vo.getCmdId() + "\t" + "--clientid=10 --reqid=" + Constants.REQUEST_ID + "\t" + "--flag=0 --rf=7 --channel=" + vo.getChannelId();
|
|
|
|
|
ProcessExecUtils.exec(cmd);
|
|
|
|
|
model.setRequestId(Constants.REQUEST_ID.addAndGet(1));
|
|
|
|
|
/* TerminalPhotosParamsModel model = new TerminalPhotosParamsModel();
|
|
|
|
@ -411,10 +430,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<Integer> addOrUpdatePhotoParams(PhotoParamsVo vo) {
|
|
|
|
|
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --clientid=10 --cmdid=" + vo.getCmdId() + "\t" + "--color=" + vo.getColor() + "\t" + "--resolution=" + vo.getResolution() + "\t"
|
|
|
|
|
+ "--luminance=" + vo.getLuminance() + "\t" + "-contrast=" + vo.getContrast() + "\t" + "--saturation=" + vo.getSaturation() + "\t" + "--channel=" + vo.getChannelId();
|
|
|
|
|
+ "--luminance=" + vo.getLuminance() + "\t" + "-contrast=" + vo.getContrast() + "\t" + "--saturation=" + vo.getSaturation() + "\t" + "--channel=" + vo.getChannelId();
|
|
|
|
|
ProcessExecUtils.exec(cmd);
|
|
|
|
|
return Asserts.success(Constants.REQUEST_ID.addAndGet(1));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<TerminalPhotosParamsModel> getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo) {
|
|
|
|
|