Commit 770e2ea2 authored by 赵啸非's avatar 赵啸非

修改提交分辨率更新

parent dce848eb
...@@ -149,13 +149,13 @@ public class DeviceReq implements Serializable { ...@@ -149,13 +149,13 @@ public class DeviceReq implements Serializable {
/** /**
* 设备宽度 * 设备宽度
*/ */
private Double width; private String width;
/** /**
* 设备高度 * 设备高度
*/ */
private Double height; private String height;
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -433,8 +433,8 @@ public class DeviceApiController { ...@@ -433,8 +433,8 @@ public class DeviceApiController {
ApiResp<DeviceResp> rsp = new ApiResp<>(); ApiResp<DeviceResp> rsp = new ApiResp<>();
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue()); rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
DeviceResp deviceResp = new DeviceResp(); DeviceResp deviceResp = new DeviceResp();
Double width = req.getWidth(); String width = req.getWidth();
Double height = req.getHeight(); String height = req.getHeight();
try { try {
...@@ -570,12 +570,10 @@ public class DeviceApiController { ...@@ -570,12 +570,10 @@ public class DeviceApiController {
return JSON.toJSONString(rsp); return JSON.toJSONString(rsp);
} }
private void checkAndUpdateImageRe(Double width, Double height, ProductEntity productEntity, DeviceEntity deviceEntity) { private void checkAndUpdateImageRe(String width, String height, ProductEntity productEntity, DeviceEntity deviceEntity) {
if (!ObjectUtils.isEmpty(width) if (!ObjectUtils.isEmpty(width)
&& !ObjectUtils.isEmpty(height) && !ObjectUtils.isEmpty(height)
&& ObjectUtils.isEmpty(deviceEntity.getResolution())) { && ObjectUtils.isEmpty(deviceEntity.getResolution())) {
deviceEntity.setWidth(width);
deviceEntity.setHeight(height);
deviceEntity.setResolution(width + "x" + height); deviceEntity.setResolution(width + "x" + height);
deviceEntity.setResolutionValue(width + "x" + height); deviceEntity.setResolutionValue(width + "x" + height);
...@@ -591,7 +589,7 @@ public class DeviceApiController { ...@@ -591,7 +589,7 @@ public class DeviceApiController {
//没有资源 根据宽和高存在 找一个相近的资源。 //没有资源 根据宽和高存在 找一个相近的资源。
if (!ObjectUtils.isEmpty(width) && !ObjectUtils.isEmpty(height)) { if (!ObjectUtils.isEmpty(width) && !ObjectUtils.isEmpty(height)) {
//根据分辨率 自适应设置分辨率 //根据分辨率 自适应设置分辨率
double div = NumberUtil.div(width, height, 2); double div = NumberUtil.div(Double.parseDouble(width), Double.parseDouble(height), 2);
if (div >= 1.3 && div <= 5.0) { if (div >= 1.3 && div <= 5.0) {
deviceEntity.setResolutionValue(ImageReEnum.RE_1920X1080.getDesc()); deviceEntity.setResolutionValue(ImageReEnum.RE_1920X1080.getDesc());
deviceEntity.setResolution(ImageReEnum.RE_1920X1080.getDesc()); deviceEntity.setResolution(ImageReEnum.RE_1920X1080.getDesc());
......
...@@ -51,16 +51,7 @@ public class DeviceVo extends BaseEntityLong { ...@@ -51,16 +51,7 @@ public class DeviceVo extends BaseEntityLong {
private List <Integer> deviceStatusList; private List <Integer> deviceStatusList;
/**
* 设备宽度
*/
private Double width;
/**
* 设备高度
*/
private Double height;
......
...@@ -49,7 +49,7 @@ public class SendThirdPartyThread extends AbstractThread { ...@@ -49,7 +49,7 @@ public class SendThirdPartyThread extends AbstractThread {
@Override @Override
protected void process() { protected void process() {
log.info("SendThirdPartyThread process"); // log.info("SendThirdPartyThread process");
List<DeviceReq> deviceMsgReqs = new ArrayList<>(); List<DeviceReq> deviceMsgReqs = new ArrayList<>();
while (true) { while (true) {
DeviceReq deviceReq = cacheService.lpop(KEY_DEVICE_THIRDPARTY_QUEUE, DeviceReq.class); DeviceReq deviceReq = cacheService.lpop(KEY_DEVICE_THIRDPARTY_QUEUE, DeviceReq.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment