diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java index c87ba18..8081564 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java @@ -113,8 +113,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { if (item.getMediaType() == 0) { photoBean.setPath(photoaddress + item.getPath()); } else { + photoBean.setPath(videoaddress + item.getPath()); - photoBean.setThumb(videoaddress + item.getThumb()); + if (item.getThumb() != null) { + photoBean.setThumb(videoaddress + item.getThumb()); + } } photoBean.setId(item.getId()); photoBean.setTermId(item.getTermId()); @@ -328,38 +331,39 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { List list2 = terminalPhotoDao.selectTermAndChannelLatestPhotoList(termidlist); List beans = new ArrayList<>(); for (ChannelAndTermDto item : list) { + 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()); + for (int z = 0; z < lines.size(); z++) { + Lines lines1 = lines.get(z); + if (item.getLineid() == lines1.getId()) { + photosBean.setLinename(lines1.getName()); + break; + } + } 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()); + if (item2.getMediatype().intValue() == 0) { + photosBean.setPath(photoaddress + item2.getPath()); + } else { + photosBean.setPath(videoaddress + item2.getPath()); + } 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; } } + beans.add(photosBean); } model.setList(beans); PageInfo pageData = PageUtils.getPageData(list); @@ -372,11 +376,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { model.setPagesize(pageSize); int pages = pageData.getPages(); model.setTotalpage(pages); - - return Asserts.success(model); - - } @Override @@ -416,7 +416,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody 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(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); @@ -431,10 +431,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody 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("设置成功"); - } + } @Override public ServiceBody getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo) { @@ -484,7 +484,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) { CmaBackModel model = new CmaBackModel(); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=schedule --cmdid=" +vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--clientid=10 --flag=0 --rf=7 --channel="+vo.getChannel(); + String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=schedule --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--clientid=10 --flag=0 --rf=7 --channel=" + vo.getChannel(); ProcessExecUtils.exec(cmd); Integer requestId = Integer.parseInt(Constants.REQUEST_ID.toString()); model.setRequestId(requestId);