diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java index 4d7c570..050f552 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/SystemConfigController.java @@ -5,6 +5,7 @@ import com.shxy.xymanager_common.base.BaseController; 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.model.CmaBackModel; import com.shxy.xymanager_common.model.SystemConfigModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel; import com.shxy.xymanager_common.vo.SystemConfigReqVo; @@ -36,8 +37,8 @@ public class SystemConfigController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/getSystemConfigGet") @Log(title = "获取全局配置触发接口", type = "查询") - public ResponseReult getSystemConfigGet(@RequestParam("id") String id) { - ServiceBody serviceBody = configService.getSystemConfig(id); + public ResponseReult getSystemConfigGet(@RequestParam("id") String id) { + ServiceBody serviceBody = configService.getSystemConfig(id); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java index a2ccb0c..07a763e 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java @@ -95,8 +95,8 @@ public class TerminalController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/getTerminalStatus") @Log(title = "获取装置运行状态触发", type = "修改") - public ResponseReult getTerminalStatus(@RequestParam("termId")Integer termId) { - ServiceBody serviceBody = terminalService.getTerminalStatus(termId); + public ResponseReult getTerminalStatus(@RequestParam("termId")Integer termId) { + ServiceBody serviceBody = terminalService.getTerminalStatus(termId); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java index 9613cb3..db7659e 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java @@ -76,8 +76,8 @@ public class TerminalPhotoController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/selectPhotoTimeGet") @Log(title = "拍照时间表查询触发", type = "查询") - public ResponseReult selectPhotoTimeGet(@RequestBody @Validated TerminalReqPhotoTimeVo vo) { - ServiceBody serviceBody = terminalPhotoService.selectPhotoTimeGet(vo); + public ResponseReult selectPhotoTimeGet(@RequestBody @Validated TerminalPhotoTimeGetVo vo) { + ServiceBody serviceBody = terminalPhotoService.selectPhotoTimeGet(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { @@ -181,8 +181,8 @@ public class TerminalPhotoController extends BaseController { @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @RequestMapping("/updatePhotoParam") @Log(title = "图像采集参数设置", type = "查询") - public ResponseReult addOrUpdatePhotoParams(@RequestBody @Validated PhotoParamsVo vo) { - ServiceBody serviceBody = terminalPhotoService.addOrUpdatePhotoParams(vo); + public ResponseReult addOrUpdatePhotoParams(@RequestBody @Validated PhotoParamsVo vo) { + ServiceBody serviceBody = terminalPhotoService.addOrUpdatePhotoParams(vo); if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java index 87abb0b..4af62ee 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/constant/Constants.java @@ -164,5 +164,5 @@ public class Constants /** * 调用JNI自增ID */ - public static AtomicInteger REQUEST_ID = new AtomicInteger(1); + public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis()/1000)); } \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/CmaBackModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/CmaBackModel.java new file mode 100644 index 0000000..980a94d --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/CmaBackModel.java @@ -0,0 +1,21 @@ +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.util.List; + +/** + * 所有杆塔列表 + */ +@Data +@ApiModel(value = "Cma返回信息", description = "Cma返回信息") +public class CmaBackModel implements Serializable { + + @ApiModelProperty(value = "请求ID", example = "1233") + private Integer requestId; + + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalModel.java index bae7cd5..8fd1fd1 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalModel.java @@ -45,7 +45,7 @@ public class TerminalModel implements Serializable { private BigInteger wsUpdateTime; @ApiModelProperty(value = "是否最新", example = "123456") - private Boolean isNew = false; + private Boolean isNew; } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalScheduleRuleTimeListModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalScheduleRuleTimeListModel.java index e073399..c8d0088 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalScheduleRuleTimeListModel.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalScheduleRuleTimeListModel.java @@ -20,6 +20,6 @@ public class TerminalScheduleRuleTimeListModel implements Serializable { @ApiModelProperty(value = "是否最新", example = "123456") - private Boolean isNew; + private Boolean isNew = false; } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusModel.java new file mode 100644 index 0000000..3bbc89d --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/TerminalStatusModel.java @@ -0,0 +1,21 @@ +package com.shxy.xymanager_common.model; + +import cn.hutool.core.date.DateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 装置状态获取对象 + */ +@Data +@ApiModel(value = "装置状态获取对象", description = "装置状态获取信息") +public class TerminalStatusModel implements Serializable { + + @ApiModelProperty(value = "请求时间", example = "123456") + private DateTime queryTime; + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeGetVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeGetVo.java new file mode 100644 index 0000000..e4d27ca --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeGetVo.java @@ -0,0 +1,23 @@ +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 TerminalPhotoTimeGetVo { + + @NotNull(message = "通道号") + @ApiModelProperty(value = "通道号", example = "123455") + private Short channel; + + @NotNull(message = "检测装置ID不能缺少") + @ApiModelProperty(value = "检测装置ID", example = "123455") + private String cmdId; + + + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeVo.java index 1fbbdda..86207f9 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalPhotoTimeVo.java @@ -7,7 +7,7 @@ import lombok.Data; import javax.validation.constraints.NotNull; @Data -@ApiModel(value = "拍照时间表请求参数", description = "拍照时间表请求参数") +@ApiModel(value = "拍照时间表参数", description = "拍照时间表参数") public class TerminalPhotoTimeVo { @NotNull(message = "通道号") diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalReqPhotoTimeVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalReqPhotoTimeVo.java index a323e24..b00cea9 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalReqPhotoTimeVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalReqPhotoTimeVo.java @@ -20,9 +20,9 @@ public class TerminalReqPhotoTimeVo { @NotNull(message = "检测装置ID不能缺少") @ApiModelProperty(value = "检测装置ID", example = "123455") - private Short cmdId; + private String cmdId; + - @ApiModelProperty(value = "请求ID", example = "123455") private Integer requestId; diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalStatusVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalStatusVo.java index 1c1a5df..fa57dc1 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalStatusVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalStatusVo.java @@ -1,5 +1,6 @@ package com.shxy.xymanager_common.vo; +import cn.hutool.core.date.DateTime; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -14,7 +15,7 @@ public class TerminalStatusVo { private Integer termId; - @ApiModelProperty(value = "请求Id", required = true, example = "A0001") - private Integer requestId; + @ApiModelProperty(value = "查询时间", required = true, example = "A0001") + private DateTime queryTime; } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java index f6b9727..28eb4ab 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/SystemConfigServiceImpl.java @@ -7,6 +7,7 @@ import com.shxy.xymanager_common.dto.PhotoParamsDto; import com.shxy.xymanager_common.dto.UpperComputerInfoDto; import com.shxy.xymanager_common.entity.TerminalParams; import com.shxy.xymanager_common.exception.Asserts; +import com.shxy.xymanager_common.model.CmaBackModel; import com.shxy.xymanager_common.model.SystemConfigModel; import com.shxy.xymanager_common.model.TerminalPhotosParamsModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel; @@ -39,16 +40,18 @@ public class SystemConfigServiceImpl implements SystemConfigService { @Override - public ServiceBody getSystemConfig(String cmdId) { + public ServiceBody getSystemConfig(String cmdId) { /* SystemConfigModel model = new SystemConfigModel(); Integer beatHeartTime = systemConfigDao.getTerminalParams(id); model.setHeartBeatTime(beatHeartTime); String globalTime = systemConfigDao.getGlobalTime(Constants.GLOBAL_TIME); model.setGlobalTime(Integer.parseInt(globalTime));*/ + CmaBackModel model = new CmaBackModel(); String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --clientid=10 --act=sampling --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID; ProcessExecUtils.exec(cmd); + model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); - return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); + return Asserts.success(model); } @Override @@ -59,20 +62,16 @@ public class SystemConfigServiceImpl implements SystemConfigService { systemConfigDao.updateSystemConfig(param); String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=sampling --cmdid="+vo.getCmdId()+ "\t"+ "--heartbeat=" + vo.getHeartBeatTime(); - Integer retCode = ProcessExecUtils.exec(cmd); - if(retCode==0){ - return Asserts.success("修改成功"); - } - return Asserts.error("修改失败"); + ProcessExecUtils.exec(cmd); + return Asserts.success("修改成功"); } @Override public ServiceBody getSystemConfigDetail(SystemConfigReqVo vo) { - String result = terminalPhotoDao.getRequestResult(5);//待修改 + String result = terminalPhotoDao.getRequestResult(vo.getRequestId());//待修改 SystemConfigModel model = new SystemConfigModel(); if(StringUtils.isNotBlank(result)) { - JSONObject resultObj = JSONObject.parseObject(result); - model = JSONObject.parseObject(resultObj.get("groupData").toString(), SystemConfigModel.class); + model = JSONObject.parseObject(result, SystemConfigModel.class); }else{ Integer beatHeartTime = systemConfigDao.getTerminalParams(Constants.GLOBAL_TIME); model.setHeartBeatTime(beatHeartTime); @@ -92,7 +91,7 @@ public class SystemConfigServiceImpl implements SystemConfigService { @Override public ServiceBody getUpperComputerInfo(TerminalUpperComputerVo vo) { - String result = terminalPhotoDao.getRequestResult(5);//待修改 + String result = terminalPhotoDao.getRequestResult(vo.getRequestId());//待修改 UpperComputerInfoModel model = new UpperComputerInfoModel(); if(StringUtils.isNotBlank(result)) { model = JSONObject.parseObject(result, UpperComputerInfoModel.class); 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 4b052a9..c87ba18 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 @@ -416,9 +416,10 @@ 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(Constants.REQUEST_ID.addAndGet(1)); + model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); + Constants.REQUEST_ID.addAndGet(1); /* TerminalPhotosParamsModel model = new TerminalPhotosParamsModel(); PhotoParamsDto dto= terminalPhotoDao.selectPhotoParams(termId); if(dto!=null) { @@ -428,16 +429,16 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { } @Override - public ServiceBody addOrUpdatePhotoParams(PhotoParamsVo vo) { + 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(Constants.REQUEST_ID.addAndGet(1)); - } + return Asserts.success("设置成功"); + } @Override public ServiceBody getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo) { - String result = terminalPhotoDao.getRequestResult(5);//待修改 + String result = terminalPhotoDao.getRequestResult(vo.getRequestId()); TerminalPhotosParamsModel model = new TerminalPhotosParamsModel(); if (StringUtils.isNotBlank(result)) { model = JSONObject.parseObject(result, TerminalPhotosParamsModel.class); @@ -453,7 +454,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { @Override public ServiceBody selectPhotoTime(TerminalReqPhotoTimeVo vo) { - String result = terminalPhotoDao.getRequestResult(5);//待修改 + String result = terminalPhotoDao.getRequestResult(vo.getRequestId());//待修改 TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel(); if (StringUtils.isNotBlank(result)) { JSONObject resultObj = JSONObject.parseObject(result); @@ -481,10 +482,14 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService { } @Override - public ServiceBody selectPhotoTimeGet(TerminalReqPhotoTimeVo vo) { - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=alarmMark --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID + "\t" + "--clientid=10--flag=1 --rf=7"; + 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(); ProcessExecUtils.exec(cmd); - return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); + Integer requestId = Integer.parseInt(Constants.REQUEST_ID.toString()); + model.setRequestId(requestId); + Constants.REQUEST_ID.addAndGet(1); + return Asserts.success(model); } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java index c09d31f..86aa601 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalServiceImpl.java @@ -202,21 +202,20 @@ public class TerminalServiceImpl implements TerminalService { @Override - public ServiceBody getTerminalStatus(Integer termId) { - TerminalStatusGetModel model = new TerminalStatusGetModel(); + public ServiceBody getTerminalStatus(Integer termId) { + TerminalStatusModel model = new TerminalStatusModel(); String cmdId = terminalsDao.getCmdIdByTermId(termId); - String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --flag=0 --act=runningstatus --clientid=10 --cmdid=" + cmdId + "\t" + "--reqid==" + Constants.REQUEST_ID; + String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --flag=0 --act=runningstatus --cmdid=" + cmdId; ProcessExecUtils.exec(cmd); /* TerminalModel model = new TerminalModel();*/ - model.setRequestId(Constants.REQUEST_ID.addAndGet(1)); - /* TerminalInfoDto dto = terminalsDao.getTerminalInfo(termId); - if (null != dto) { - BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(dto.getWsUpdateTime().longValue()); - BeanUtils.copyProperties(dto, model); + /* TerminalInfoDto dto = terminalsDao.getTerminalInfo(termId);*/ + /*if (null != dto) {*/ + /* BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(dto.getWsUpdateTime().longValue()); + BeanUtils.copyProperties(dto, model);*/ DateTime now = DateTime.now(); model.setQueryTime(now); - model.setWsUpdateTime(MyDateUtils.date(updatetime.longValue()).toString()); + /* model.setWsUpdateTime(MyDateUtils.date(updatetime.longValue()).toString()); }*/ return Asserts.success(model); @@ -224,18 +223,28 @@ public class TerminalServiceImpl implements TerminalService { @Override public ServiceBody getLastedTerminalStatus(TerminalStatusVo vo) { - String result = terminalPhotoDao.getRequestResult(5);//待修改 + /* String result = terminalPhotoDao.getRequestResult(5);//待修改 TerminalModel model = new TerminalModel(); if (StringUtils.isNotBlank(result)) { model = JSONObject.parseObject(result, TerminalModel.class); model.setIsNew(true); - } else { - TerminalInfoDto dto = terminalsDao.getTerminalInfo(vo.getTermId()); - if (dto != null) { + } else {*/ + TerminalModel model = new TerminalModel(); + TerminalInfoDto dto = terminalsDao.getTerminalInfo(vo.getTermId()); + Boolean hasNew = false; + if(null!=dto) { + BeanUtils.copyProperties(dto, model); + BigInteger wsUpdateTime = dto.getWsUpdateTime(); + BigInteger queryTime = MyDateUtils.TimeMillSecond2Second(vo.getQueryTime()); + hasNew = wsUpdateTime.compareTo(queryTime) < 0 ? false : true; + + } + model.setIsNew(hasNew); + /* if (dto != null) { BeanUtils.copyProperties(dto, model); } model.setWsUpdateTime(MyDateUtils.TimeSecond2MillSecond(dto.getWsUpdateTime().longValue())); - } + }*/ return Asserts.success(model); } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java index 718d58b..5472a5d 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/SystemConfigService.java @@ -1,6 +1,7 @@ package com.shxy.xymanager_service.service; import com.shxy.xymanager_common.bean.ServiceBody; +import com.shxy.xymanager_common.model.CmaBackModel; import com.shxy.xymanager_common.model.SystemConfigModel; import com.shxy.xymanager_common.model.UpperComputerInfoModel; import com.shxy.xymanager_common.vo.SystemConfigReqVo; @@ -20,7 +21,7 @@ public interface SystemConfigService { * * @return */ - ServiceBody getSystemConfig(String id); + ServiceBody getSystemConfig(String id); /** diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java index 35d177e..62e4450 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java @@ -71,14 +71,14 @@ public interface TerminalPhotoService { */ ServiceBody getPhotoQueryParam(ReturnedPhotoParamsGetVo vo); - ServiceBody addOrUpdatePhotoParams(PhotoParamsVo vo); + ServiceBody addOrUpdatePhotoParams(PhotoParamsVo vo); ServiceBody getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo); ServiceBody selectPhotoTime(TerminalReqPhotoTimeVo vo); - ServiceBody selectPhotoTimeGet(TerminalReqPhotoTimeVo vo); + ServiceBody selectPhotoTimeGet(TerminalPhotoTimeGetVo vo); diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java index b0d06b7..46117cd 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalService.java @@ -49,7 +49,7 @@ public interface TerminalService { ServiceBody resetTerminal(String cmId); - ServiceBody getTerminalStatus(Integer termId); + ServiceBody getTerminalStatus(Integer termId); ServiceBody getLastedTerminalStatus(TerminalStatusVo vo);