|
|
|
@ -1,11 +1,14 @@
|
|
|
|
|
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.github.pagehelper.PageInfo;
|
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.dto.PhotoAndLineAndChannelDto;
|
|
|
|
|
import com.shxy.xymanager_common.dto.PhotoParamsDto;
|
|
|
|
|
import com.shxy.xymanager_common.dto.TerminalApkInfoDto;
|
|
|
|
|
import com.shxy.xymanager_common.dto.TerminalPhotoScheduleDto;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Lines;
|
|
|
|
|
import com.shxy.xymanager_common.entity.TerminalChannels;
|
|
|
|
@ -13,10 +16,7 @@ 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.TerminalPhotoListForOpenModel;
|
|
|
|
|
import com.shxy.xymanager_common.model.TerminalPhotoListModel;
|
|
|
|
|
import com.shxy.xymanager_common.model.TerminalPhotoSelectListModel;
|
|
|
|
|
import com.shxy.xymanager_common.model.TerminalPhotosModel;
|
|
|
|
|
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;
|
|
|
|
@ -354,4 +354,43 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
|
|
|
|
|
return Asserts.success(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<TerminalPhotosParamsModel> getPhotoQueryParamList(PageVo vo) {
|
|
|
|
|
TerminalPhotosParamsModel model = new TerminalPhotosParamsModel();
|
|
|
|
|
int pageindex = vo.getPageindex();
|
|
|
|
|
int pagesize = vo.getPagesize();
|
|
|
|
|
PageUtils.SetPage(pageindex, pagesize);
|
|
|
|
|
List<PhotoParamsDto> list= terminalPhotoDao.selectPhotoParams();
|
|
|
|
|
boolean empty = CollectionUtil.isEmpty(list);
|
|
|
|
|
if (empty) {
|
|
|
|
|
model.setList(new ArrayList<>());
|
|
|
|
|
} else {
|
|
|
|
|
List<TerminalPhotosParamsModel.PhotoParamsBean> beans = BeanUtil.copyToList(list, TerminalPhotosParamsModel.PhotoParamsBean.class, CopyOptions.create().ignoreCase());
|
|
|
|
|
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<String> updatePhotoParams(PhotoParamsVo vo) {
|
|
|
|
|
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=imgparams --cmdid="+vo.getCmdId() +"\t" +"--color=" +vo.getColor() +"\t" + "--resolution="+ vo.getResolution() +"\t"
|
|
|
|
|
+ "--luminance=" + vo.getLuminance() +"\t"+ "-contrast=" + vo.getContrast() +"\t"+ "--saturation=" + vo.getSaturation();
|
|
|
|
|
Integer recode = ProcessExecUtils.exec(cmd);
|
|
|
|
|
if(recode==0){
|
|
|
|
|
return Asserts.success("更新成功");
|
|
|
|
|
}
|
|
|
|
|
return Asserts.error("更新失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|