liuguijing 2 years ago
commit 8001f881c4

@ -55,12 +55,12 @@ public class TerminalGPSController extends BaseController {
}
}
@ApiOperation(value = "轮询获取GPS位置", notes = "获取GPS位置接口", httpMethod = "POST")
@ApiOperation(value = "获取GPS位置触发", notes = "获取GPS位置触发接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTermGPSPosition")
@Log(title = "轮询获取GPS位置", type = "查询")
public ResponseReult<TerminalGpsModel> getReturnedTermGPS(@RequestBody @Validated TerminalGpsVo vo) {
ServiceBody<TerminalGpsModel> serviceBody = terminalGpsService.getReturnedGPS(vo);
@Log(title = "获取GPS位置触发", type = "查询")
public ResponseReult<Integer> getReturnedTermGPS(@RequestBody @Validated TerminalGpsVo vo) {
ServiceBody<Integer> serviceBody = terminalGpsService.getReturnedGPS(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -21,7 +21,7 @@ public class TerminalPhotosParamsModel implements Serializable {
private Integer termId;
@ApiModelProperty(value = "通道编号", example = "123456")
private Integer channelId;
private Short channel;
@ApiModelProperty(value = "色彩选择0 为黑白1 为彩色", example = "123456")
private Integer color;

@ -14,6 +14,10 @@ public class ReturnedPhotoParamsVo {
@ApiModelProperty(value = "装置id", required = true, example = "A0001")
private Integer termId;
@NotNull(message = "通道")
@ApiModelProperty(value = "通道", required = true, example = "A0001")
private Short channelId;
@ApiModelProperty(value = "手动拍照时间", required = true, example = "A0001")
private Integer requestId;

@ -14,4 +14,7 @@ public class TerminalGpsVo {
@ApiModelProperty(value = "查询时间", example = "123455")
private DateTime queryTime;
@ApiModelProperty(value = "装置ID", example = "123455")
private String cmdId;
}

@ -5,6 +5,7 @@ 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.PhotoParamsVo;
import com.shxy.xymanager_common.vo.ReturnedPhotoParamsVo;
import com.shxy.xymanager_common.vo.TerminalPhotoTimeVo;
import com.shxy.xymanager_common.vo.TerminalReqPhotoTimeVo;
import org.apache.ibatis.annotations.Param;
@ -39,7 +40,7 @@ public interface TerminalPhotoDao {
List<TerminalPhotoScheduleDto> selectPhotoSchedule(TerminalPhotoTimeVo vo);
PhotoParamsDto selectPhotoParams(Integer termId);
PhotoParamsDto selectPhotoParams(ReturnedPhotoParamsVo vo);
String selectCmdIdById(Integer termId);

@ -263,7 +263,7 @@
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectPhotoParams" resultType="com.shxy.xymanager_common.dto.PhotoParamsDto">
<select id="selectPhotoParams" resultType="com.shxy.xymanager_common.vo.ReturnedPhotoParamsVo">
select
tip.term_id termId,
tip.color color,
@ -272,7 +272,7 @@
tip.saturation saturation,
t.cmdid cmdId
from terminal_img_params tip left join terminals t on tip.term_id = t.id
where tip.term_id = #{termId,jdbcType=INTEGER}
where tip.term_id = #{termId,jdbcType=INTEGER} and tip.channel_id = #{channelId,jdbcType=INTEGER}
</select>
<select id="selectCmdIdById" resultType="java.lang.Integer">

@ -42,7 +42,7 @@ public class SystemConfigServiceImpl implements SystemConfigService {
model.setHeartBeatTime(beatHeartTime);
String globalTime = systemConfigDao.getGlobalTime(Constants.GLOBAL_TIME);
model.setGlobalTime(Integer.parseInt(globalTime));*/
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --act=sampling --flag=0 --cmdid="+cmdId+ "\t"+"--reqid="+Constants.REQUEST_ID;
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);
Constants.REQUEST_ID.addAndGet(1);
return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString()));

@ -123,7 +123,8 @@ public class TerminalGpsServiceImpl implements TerminalGpsService {
}
@Override
public ServiceBody<TerminalGpsModel> getReturnedGPS(TerminalGpsVo vo) {
public ServiceBody<Integer> getReturnedGPS(TerminalGpsVo vo) {
String cmd = "/usr/local/bin/xympadmn --server=127.0.0.1 --port=6891 --clientid=10 --act=gpsinfo --cmdid="+vo.getCmdId();
BigInteger updatedTime = terminalPositionsDao.getUpdateTime(vo.getTermid());
BigInteger queryTime = MyDateUtils.TimeMillSecond2Second(vo.getQueryTime());
Boolean hasNew =updatedTime.compareTo(queryTime)<0?false:true;

@ -410,7 +410,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Integer result = terminalPhotoDao.updateOrInsertParams(vo);
if (result>0) {
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" + "--reqid=" + Constants.REQUEST_ID;
+ "--luminance=" + vo.getLuminance() + "\t" + "-contrast=" + vo.getContrast() + "\t" + "--saturation=" + vo.getSaturation()+ "\t" + "--reqid=" + Constants.REQUEST_ID+ "\t" + "--channel=" + vo.getChannelId();
ProcessExecUtils.exec(cmd);
return Asserts.success(Constants.REQUEST_ID.addAndGet(1));
}
@ -426,7 +426,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
JSONObject resultObj = JSONObject.parseObject(result);
model = JSONObject.parseObject(resultObj.get("groupData").toString(), TerminalPhotosParamsModel.class);
}else{
PhotoParamsDto dto= terminalPhotoDao.selectPhotoParams(vo.getTermId());
PhotoParamsDto dto= terminalPhotoDao.selectPhotoParams(vo);
if(dto!=null) {
BeanUtils.copyProperties(dto, model);
}

@ -26,6 +26,6 @@ public interface TerminalGpsService {
*/
ServiceBody<TerminalGpsModel> getTermGPS(TerminalIdVo vo);
ServiceBody<TerminalGpsModel> getReturnedGPS(TerminalGpsVo vo);
ServiceBody<Integer> getReturnedGPS(TerminalGpsVo vo);
}

Loading…
Cancel
Save