liuguijing 2 years ago
commit 1faf50fce4

@ -6,10 +6,7 @@ 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.entity.TerminalPhoto;
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.vo.*;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import io.swagger.annotations.Api;
@ -127,4 +124,30 @@ public class TerminalPhotoController extends BaseController {
}
}
@ApiOperation(value = "图像采集参数列表查询", notes = "图像采集参数列表查询", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getPhotoQueryParamList")
@Log(title = "图像采集参数列表查询", type = "查询")
public ResponseReult<TerminalPhotosParamsModel> getPhotoQueryParamList(@RequestBody @Validated PageVo vo) {
ServiceBody<TerminalPhotosParamsModel> serviceBody = terminalPhotoService.getPhotoQueryParamList(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("/updatePhotoParam")
@Log(title = "图像采集参数设置", type = "查询")
public ResponseReult<String> updatePhotoParam(@RequestBody @Validated PhotoParamsVo vo) {
ServiceBody<String> serviceBody = terminalPhotoService.updatePhotoParams(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -0,0 +1,22 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
@Data
public class PhotoParamsDto {
private Integer termId;
private Integer channelId;
private Integer color;
private Integer resolution;
private Integer luminance;
private Integer saturation;
private String cmdId;
}

@ -0,0 +1,56 @@
package com.shxy.xymanager_common.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
@ApiModel(value = "图片轮询列表对象", description = "图片轮询列表对象信息")
public class TerminalPhotosParamsModel implements Serializable {
@ApiModelProperty(value = "总记录数", example = "120")
private long total;
@ApiModelProperty(value = "总页数", example = "120")
private int totalpage;
@ApiModelProperty(value = "当前页", example = "1")
private int currentpage;
@ApiModelProperty(value = "每页记录数", example = "1")
private int pagesize;
@ApiModelProperty(value = "照片对象", example = "[]")
private List<PhotoParamsBean> list;
@Data
public static class PhotoParamsBean {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer channelId;
@ApiModelProperty(value = "色彩选择0 为黑白1 为彩色", example = "123456")
private Integer color;
@ApiModelProperty(value = "自定义图像分辨率", example = "123456")
private Integer resolution;
@ApiModelProperty(value = "亮度取值范围1100", example = "123456")
private Integer luminance;
@ApiModelProperty(value = "对比度取值范围1100", example = "123456")
private Integer contrast;
@ApiModelProperty(value = "饱和度取值范围1100", example = "123456")
private Integer saturation;
@ApiModelProperty(value = "心跳上送周期", example = "123456")
private String cmdId;
}
}

@ -0,0 +1,37 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "图片采集参数对象", description = "图片采集参数对象")
public class PhotoParamsVo extends PageVo{
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer channelId;
@ApiModelProperty(value = "色彩选择0 为黑白1 为彩色", example = "123456")
private Integer color;
@ApiModelProperty(value = "自定义图像分辨率", example = "123456")
private Integer resolution;
@ApiModelProperty(value = "亮度取值范围1100", example = "123456")
private Integer luminance;
@ApiModelProperty(value = "对比度取值范围1100", example = "123456")
private Integer contrast;
@ApiModelProperty(value = "饱和度取值范围1100", example = "123456")
private Integer saturation;
@ApiModelProperty(value = "心跳上送周期", example = "123456")
private String cmdId;
}

@ -0,0 +1,17 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "查询图片采集参数对象", description = "查询图片采集参数对象")
public class PhotoQueryVo extends PageVo{
@NotNull(message = "不能传入空值")
@ApiModelProperty(value = "装置ID", required = true, example = "A0001")
private Integer termId;
}

@ -1,6 +1,7 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.PhotoAndLineAndChannelDto;
import com.shxy.xymanager_common.dto.PhotoParamsDto;
import com.shxy.xymanager_common.dto.TerminalPhotoScheduleDto;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.vo.TerminalPhotoTimeVo;
@ -36,4 +37,6 @@ public interface TerminalPhotoDao {
List<TerminalPhotoScheduleDto> selectPhotoSchedule(TerminalPhotoTimeVo vo);
List<PhotoParamsDto> selectPhotoParams();
}

@ -251,4 +251,16 @@
create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectPhotoParams" resultType="com.shxy.xymanager_common.dto.PhotoParamsDto">
select
tip.term_id termId,
tip.channel_id channelId,
tip.color color,
tip.resolution resolution,
tip.luminance luminance,
tip.saturation saturation,
t.cmdid cmdId
from terminal_img_params tip left join terminals t on tip.term_id = t.id
</select>
</mapper>

@ -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("更新失败");
}
}

@ -2,10 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalPhoto;
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.vo.*;
import java.util.Date;
@ -66,4 +63,13 @@ public interface TerminalPhotoService {
*/
ServiceBody<Boolean> getPhotoTime(TerminalPhotoTimeVo vo);
/**
*
*
* @return
*/
ServiceBody<TerminalPhotosParamsModel> getPhotoQueryParamList(PageVo vo);
ServiceBody<String> updatePhotoParams(PhotoParamsVo vo);
}

Loading…
Cancel
Save