照片修改代码提交

jni
liuguijing 2 years ago
parent 7801cfd41f
commit 78b6bc3711

@ -115,12 +115,12 @@
<version>5.7.20</version>
</dependency>
<!--shiro-->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-starter</artifactId>
<version>1.11.0</version>
</dependency>
<!-- &lt;!&ndash;shiro&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.shiro</groupId>-->
<!-- <artifactId>shiro-spring-boot-starter</artifactId>-->
<!-- <version>1.11.0</version>-->
<!-- </dependency>-->
<!--JNA:调用本地dll-->

@ -18,6 +18,10 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;

@ -103,6 +103,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- &lt;!&ndash;shiro&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.shiro</groupId>-->
<!-- <artifactId>shiro-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
</dependencies>

@ -110,7 +110,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
if (item.getMediaType() == 0) {
photoBean.setPath(photoaddress + item.getPath());
} else {
photoBean.setPath(videoaddress + item.getPath());
if (item.getThumb() != null) {
photoBean.setThumb(videoaddress + item.getThumb());
@ -286,7 +285,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
public ServiceBody<Date> getLatestPhoto(TerminalPhotoVo vo) {
/* Cma cma = new Cma(server, port);*/
DateTime now = DateTime.now();
String cmd =Constants.CMD+"capture --cmdid=" + vo.getCmdid() + "\t" + "--channel=" + vo.getChannel() + "\t" + "--preset=255 --type=" + vo.getCaptureType();
String cmd = Constants.CMD + "capture --cmdid=" + vo.getCmdid() + "\t" + "--channel=" + vo.getChannel() + "\t" + "--preset=255 --type=" + vo.getCaptureType();
ProcessExecUtils.exec(cmd);
/* Boolean hasNew = cma.requestCapture(vo.getCmdid(), vo.getChannel(), vo.getPreset(), vo.getCaptureType());*/
return Asserts.success(now);
@ -316,52 +315,54 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
PageUtils.SetPage(pageindex, pagesize);
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) {
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;
}
if (!CollectionUtil.isEmpty(list)) {
List<Integer> termidlist = new ArrayList<>();
for (ChannelAndTermDto item : list) {
Integer termid = item.getTermid();
termidlist.add(termid);
}
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()) {
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());
List<Lines> lines = linesDao.selectLineByDyId(null, CommonStatus.EFFECTIVE.value());
List<TermAndChannelLatestPhotoMapperDto> list2 = terminalPhotoDao.selectTermAndChannelLatestPhotoList(termidlist);
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;
}
photosBean.setOrginalid(item2.getOrginalid());
photosBean.setPresetId(item2.getPresetId());
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()) {
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());
break;
}
}
beans.add(photosBean);
}
beans.add(photosBean);
}
model.setList(beans);
PageInfo pageData = PageUtils.getPageData(list);
int currentpage = pageData.getPageNum();
@ -401,7 +402,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
span1 = (short) 0;
span2 = span;
}
String cmd = Constants.CMD+"schedule --flag=1 --cmdid=" + dtoList.get(j).getCmid() + "\t" + "--channel=" + vo.getChannel() + "\t"
String cmd = Constants.CMD + "schedule --flag=1 --cmdid=" + dtoList.get(j).getCmid() + "\t" + "--channel=" + vo.getChannel() + "\t"
+ "--group=3 --hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t"
+ "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255";
ProcessExecUtils.exec(cmd);
@ -413,7 +414,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override
public ServiceBody<GetModel> getPhotoQueryParam(ReturnedPhotoParamsGetVo vo) {
GetModel model = new GetModel();
String cmd = Constants.CMD+"act=imgparams --cmdid=" + vo.getCmdId() + "\t" + "--clientid=10 --reqid=" + Constants.REQUEST_ID + "\t" + "--flag=0 --rf=7 --channel=" + vo.getChannelId();
String cmd = Constants.CMD + "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);
@ -427,7 +428,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override
public ServiceBody<String> addOrUpdatePhotoParams(PhotoParamsVo vo) {
String cmd = Constants.CMD+"imgparams --flag=1 --cmdid=" + vo.getCmdId() + "\t" + "--color=" + vo.getColor() + "\t" + "--resolution=" + vo.getResolution() + "\t"
String cmd = Constants.CMD + "imgparams --flag=1 --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();
ProcessExecUtils.exec(cmd);
return Asserts.success("设置成功");
@ -455,7 +456,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel();
if (StringUtils.isNotBlank(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<String> resultList = Lists.newArrayList();
String startTimeStr = resultDtoList.get(0).getHour() + ":" + resultDtoList.get(0).getMinute() + ":00";
@ -483,7 +484,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override
public ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) {
GetModel model = new GetModel();
String cmd = Constants.CMD+"schedule --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--clientid=10 --flag=0 --rf=7 --channel=" + vo.getChannel();
String cmd = Constants.CMD + "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);

Loading…
Cancel
Save