欣影管理平台装置通道表修改

jni
liuguijing 2 years ago
parent 8bf7f8f27c
commit b0d47bb571

Binary file not shown.

@ -84,7 +84,6 @@ public class ChannelController extends BaseController {
}
}
@ApiOperation(value = "根据装置号获取通道接口", notes = "根据装置号获取通道接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getChannelByTermid")

@ -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.model.TerminalListModel;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateTerminalVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -81,4 +78,19 @@ public class TerminalController extends BaseController {
}
}
@ApiOperation(value = "装置复位", notes = "装置复位接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/resetTerminal")
@Log(title = "装置复位", type = "修改")
public ResponseReult<String> resetTerminal(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<String> serviceBody = terminalService.resetTerminal(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -0,0 +1,58 @@
package com.shxy.xymanager_admin.controller;
import com.shxy.xymanager_common.annotation.Log;
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.TerminalGpsModel;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TerminalGpsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "设备GPS接口", tags = "设备GPS接口相关")
@RestController
@Slf4j
public class TerminalGPSController extends BaseController {
@Autowired
TerminalGpsService terminalGpsService;
@ApiOperation(value = "开启关闭GPS", notes = "开启关闭GPS接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/setTermGPS")
@Log(title = "开启关闭GPS", type = "修改")
public ResponseReult<String> setTermGPS(@RequestBody @Validated TerminalIdAndGpsVo vo) {
ServiceBody<String> serviceBody = terminalGpsService.setTermGPS(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@ApiOperation(value = "获取GPS位置", notes = "获取GPS位置接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTermGPS")
@Log(title = "获取GPS位置", type = "修改")
public ResponseReult<TerminalGpsModel> getTermGPS(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<TerminalGpsModel> serviceBody = terminalGpsService.getTermGPS(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -1,12 +1,16 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
@Data
public class TerminalStatus implements Serializable {
private Integer termId;
private Date lastHeartbeat;
private BigInteger lastHeartbeat;
private Short lastFrameNo;
@ -22,6 +26,8 @@ public class TerminalStatus implements Serializable {
private Integer workingTime;
private Integer gpsStatus;
private Byte connectionState;
private Byte signalStrength4g;
@ -32,137 +38,10 @@ public class TerminalStatus implements Serializable {
private Byte remainingRom;
private Date startTime;
private BigInteger bootTime;
private Date updateTime;
private BigInteger updateTime;
private static final long serialVersionUID = 1L;
public Integer getTermId() {
return termId;
}
public void setTermId(Integer termId) {
this.termId = termId;
}
public Date getLastHeartbeat() {
return lastHeartbeat;
}
public void setLastHeartbeat(Date lastHeartbeat) {
this.lastHeartbeat = lastHeartbeat;
}
public Short getLastFrameNo() {
return lastFrameNo;
}
public void setLastFrameNo(Short lastFrameNo) {
this.lastFrameNo = lastFrameNo;
}
public Float getBatteryVoltage() {
return batteryVoltage;
}
public void setBatteryVoltage(Float batteryVoltage) {
this.batteryVoltage = batteryVoltage;
}
public Float getOpTemperature() {
return opTemperature;
}
public void setOpTemperature(Float opTemperature) {
this.opTemperature = opTemperature;
}
public Float getBatteryCapacity() {
return batteryCapacity;
}
public void setBatteryCapacity(Float batteryCapacity) {
this.batteryCapacity = batteryCapacity;
}
public Byte getFloatingCharge() {
return floatingCharge;
}
public void setFloatingCharge(Byte floatingCharge) {
this.floatingCharge = floatingCharge;
}
public Integer getTotalWorkingTime() {
return totalWorkingTime;
}
public void setTotalWorkingTime(Integer totalWorkingTime) {
this.totalWorkingTime = totalWorkingTime;
}
public Integer getWorkingTime() {
return workingTime;
}
public void setWorkingTime(Integer workingTime) {
this.workingTime = workingTime;
}
public Byte getConnectionState() {
return connectionState;
}
public void setConnectionState(Byte connectionState) {
this.connectionState = connectionState;
}
public Byte getSignalStrength4g() {
return signalStrength4g;
}
public void setSignalStrength4g(Byte signalStrength4g) {
this.signalStrength4g = signalStrength4g;
}
public Byte getSignalStrength2g() {
return signalStrength2g;
}
public void setSignalStrength2g(Byte signalStrength2g) {
this.signalStrength2g = signalStrength2g;
}
public Byte getRemainingRam() {
return remainingRam;
}
public void setRemainingRam(Byte remainingRam) {
this.remainingRam = remainingRam;
}
public Byte getRemainingRom() {
return remainingRom;
}
public void setRemainingRom(Byte remainingRom) {
this.remainingRom = remainingRom;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

@ -15,6 +15,8 @@ import java.util.List;
@ApiModel(value = "通道关联表和通道列表", description = "通道列表信息")
public class TerminalChannelMapperListModel implements Serializable {
@ApiModelProperty(value = "gps开关", example = "0--关闭 1--开启")
private Integer gpsstatus;
@ApiModelProperty(value = "通道关联表和通道列表对象", example = "[]")
private List<ChannelBean> list;

@ -0,0 +1,29 @@
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;
/**
* GPS
*/
@Data
@ApiModel(value = "装置GPS信息对象", description = "装置GPS信息")
public class TerminalGpsModel implements Serializable {
@ApiModelProperty(value = "装置编号", example = "123456")
private Integer termid;
@ApiModelProperty(value = "半径", example = "123456")
private double radius;
@ApiModelProperty(value = "纬度", example = "123456")
private double latitude;
@ApiModelProperty(value = "经度", example = "123456")
private double longitude;
}

@ -0,0 +1,16 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "装置编号和开启关闭gps对象", description = "装置编号和开启关闭gps对象描述")
public class TerminalIdAndGpsVo {
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer termid;
@ApiModelProperty(value = "开启关闭", example = "0--关闭 1--开启")
private Integer gpsstatus;
}

@ -1,40 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalStatusDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalStatus">
<id column="term_id" jdbcType="INTEGER" property="termId" />
<result column="last_heartbeat" jdbcType="TIMESTAMP" property="lastHeartbeat" />
<result column="last_frame_no" jdbcType="SMALLINT" property="lastFrameNo" />
<result column="battery_voltage" jdbcType="REAL" property="batteryVoltage" />
<result column="op_temperature" jdbcType="REAL" property="opTemperature" />
<result column="battery_capacity" jdbcType="REAL" property="batteryCapacity" />
<result column="floating_charge" jdbcType="TINYINT" property="floatingCharge" />
<result column="total_working_time" jdbcType="INTEGER" property="totalWorkingTime" />
<result column="working_time" jdbcType="INTEGER" property="workingTime" />
<result column="connection_state" jdbcType="TINYINT" property="connectionState" />
<result column="signal_strength_4g" jdbcType="TINYINT" property="signalStrength4g" />
<result column="signal_strength_2g" jdbcType="TINYINT" property="signalStrength2g" />
<result column="remaining_ram" jdbcType="TINYINT" property="remainingRam" />
<result column="remaining_rom" jdbcType="TINYINT" property="remainingRom" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalStatus">
<id column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/>
<result column="last_frame_no" jdbcType="SMALLINT" property="lastFrameNo"/>
<result column="battery_voltage" jdbcType="REAL" property="batteryVoltage"/>
<result column="op_temperature" jdbcType="REAL" property="opTemperature"/>
<result column="battery_capacity" jdbcType="REAL" property="batteryCapacity"/>
<result column="floating_charge" jdbcType="TINYINT" property="floatingCharge"/>
<result column="total_working_time" jdbcType="INTEGER" property="totalWorkingTime"/>
<result column="working_time" jdbcType="INTEGER" property="workingTime"/>
<result column="gps_status" jdbcType="INTEGER" property="gpsStatus"/>
<result column="connection_state" jdbcType="TINYINT" property="connectionState"/>
<result column="signal_strength_4g" jdbcType="TINYINT" property="signalStrength4g"/>
<result column="signal_strength_2g" jdbcType="TINYINT" property="signalStrength2g"/>
<result column="remaining_ram" jdbcType="TINYINT" property="remainingRam"/>
<result column="remaining_rom" jdbcType="TINYINT" property="remainingRom"/>
<result column="boot_time" jdbcType="BIGINT" property="bootTime"/>
<result column="rs_update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
term_id, last_heartbeat, last_frame_no, battery_voltage, op_temperature, battery_capacity,
floating_charge, total_working_time, working_time, connection_state, signal_strength_4g,
signal_strength_2g, remaining_ram, remaining_rom, start_time, update_time
floating_charge, total_working_time, working_time, gps_status,connection_state, signal_strength_4g,
signal_strength_2g, remaining_ram, remaining_rom, boot_time, rs_update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from terminal_status
where term_id = #{termId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_status
where term_id = #{termId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_status
where term_id = #{termId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status (term_id, last_heartbeat, last_frame_no,
battery_voltage, op_temperature, battery_capacity,
floating_charge, total_working_time, working_time,
@ -48,161 +49,164 @@
#{remainingRam,jdbcType=TINYINT}, #{remainingRom,jdbcType=TINYINT}, #{startTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="termId != null">
term_id,
</if>
<if test="lastHeartbeat != null">
last_heartbeat,
</if>
<if test="lastFrameNo != null">
last_frame_no,
</if>
<if test="batteryVoltage != null">
battery_voltage,
</if>
<if test="opTemperature != null">
op_temperature,
</if>
<if test="batteryCapacity != null">
battery_capacity,
</if>
<if test="floatingCharge != null">
floating_charge,
</if>
<if test="totalWorkingTime != null">
total_working_time,
</if>
<if test="workingTime != null">
working_time,
</if>
<if test="connectionState != null">
connection_state,
</if>
<if test="signalStrength4g != null">
signal_strength_4g,
</if>
<if test="signalStrength2g != null">
signal_strength_2g,
</if>
<if test="remainingRam != null">
remaining_ram,
</if>
<if test="remainingRom != null">
remaining_rom,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="lastHeartbeat != null">
#{lastHeartbeat,jdbcType=TIMESTAMP},
</if>
<if test="lastFrameNo != null">
#{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
#{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
#{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
#{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
#{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
#{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
#{workingTime,jdbcType=INTEGER},
</if>
<if test="connectionState != null">
#{connectionState,jdbcType=TINYINT},
</if>
<if test="signalStrength4g != null">
#{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
#{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
#{remainingRam,jdbcType=TINYINT},
</if>
<if test="remainingRom != null">
#{remainingRom,jdbcType=TINYINT},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
update terminal_status
<set>
<if test="lastHeartbeat != null">
last_heartbeat = #{lastHeartbeat,jdbcType=TIMESTAMP},
</if>
<if test="lastFrameNo != null">
last_frame_no = #{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
battery_voltage = #{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
op_temperature = #{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
battery_capacity = #{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
floating_charge = #{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
total_working_time = #{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
working_time = #{workingTime,jdbcType=INTEGER},
</if>
<if test="connectionState != null">
connection_state = #{connectionState,jdbcType=TINYINT},
</if>
<if test="signalStrength4g != null">
signal_strength_4g = #{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
signal_strength_2g = #{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
remaining_ram = #{remainingRam,jdbcType=TINYINT},
</if>
<if test="remainingRom != null">
remaining_rom = #{remainingRom,jdbcType=TINYINT},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where term_id = #{termId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
insert into terminal_status
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="termId != null">
term_id,
</if>
<if test="lastHeartbeat != null">
last_heartbeat,
</if>
<if test="lastFrameNo != null">
last_frame_no,
</if>
<if test="batteryVoltage != null">
battery_voltage,
</if>
<if test="opTemperature != null">
op_temperature,
</if>
<if test="batteryCapacity != null">
battery_capacity,
</if>
<if test="floatingCharge != null">
floating_charge,
</if>
<if test="totalWorkingTime != null">
total_working_time,
</if>
<if test="workingTime != null">
working_time,
</if>
<if test="connectionState != null">
connection_state,
</if>
<if test="signalStrength4g != null">
signal_strength_4g,
</if>
<if test="signalStrength2g != null">
signal_strength_2g,
</if>
<if test="remainingRam != null">
remaining_ram,
</if>
<if test="remainingRom != null">
remaining_rom,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="lastHeartbeat != null">
#{lastHeartbeat,jdbcType=TIMESTAMP},
</if>
<if test="lastFrameNo != null">
#{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
#{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
#{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
#{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
#{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
#{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
#{workingTime,jdbcType=INTEGER},
</if>
<if test="connectionState != null">
#{connectionState,jdbcType=TINYINT},
</if>
<if test="signalStrength4g != null">
#{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
#{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
#{remainingRam,jdbcType=TINYINT},
</if>
<if test="remainingRom != null">
#{remainingRom,jdbcType=TINYINT},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
update terminal_status
<set>
<if test="lastHeartbeat != null">
last_heartbeat = #{lastHeartbeat,jdbcType=TIMESTAMP},
</if>
<if test="lastFrameNo != null">
last_frame_no = #{lastFrameNo,jdbcType=SMALLINT},
</if>
<if test="batteryVoltage != null">
battery_voltage = #{batteryVoltage,jdbcType=REAL},
</if>
<if test="opTemperature != null">
op_temperature = #{opTemperature,jdbcType=REAL},
</if>
<if test="batteryCapacity != null">
battery_capacity = #{batteryCapacity,jdbcType=REAL},
</if>
<if test="floatingCharge != null">
floating_charge = #{floatingCharge,jdbcType=TINYINT},
</if>
<if test="totalWorkingTime != null">
total_working_time = #{totalWorkingTime,jdbcType=INTEGER},
</if>
<if test="workingTime != null">
working_time = #{workingTime,jdbcType=INTEGER},
</if>
<if test="gpsStatus != null">
gps_status = #{gpsStatus},
</if>
<if test="connectionState != null">
connection_state = #{connectionState,jdbcType=TINYINT},
</if>
<if test="signalStrength4g != null">
signal_strength_4g = #{signalStrength4g,jdbcType=TINYINT},
</if>
<if test="signalStrength2g != null">
signal_strength_2g = #{signalStrength2g,jdbcType=TINYINT},
</if>
<if test="remainingRam != null">
remaining_ram = #{remainingRam,jdbcType=TINYINT},
</if>
<if test="remainingRom != null">
remaining_rom = #{remainingRom,jdbcType=TINYINT},
</if>
<if test="bootTime != null">
boot_time = #{bootTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
rs_update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where term_id = #{termId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalStatus">
update terminal_status
set last_heartbeat = #{lastHeartbeat,jdbcType=TIMESTAMP},
last_frame_no = #{lastFrameNo,jdbcType=SMALLINT},

@ -9,6 +9,7 @@ import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel;
@ -17,6 +18,7 @@ import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,6 +38,9 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
@Autowired
TerminalChannelsDao terminalChannelsDao;
@Autowired
TerminalStatusDao terminalStatusDao;
/**
*
*
@ -63,7 +68,7 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
@Override
public ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo) {
TerminalChannels bean = new TerminalChannels();
BeanUtil.copyProperties(vo, bean,CopyOptions.create().ignoreCase());
BeanUtil.copyProperties(vo, bean, CopyOptions.create().ignoreCase());
int i = terminalChannelsDao.updateByPrimaryKeySelective(bean, new Date());
if (i != 0) {
return Asserts.success("修改成功");
@ -73,7 +78,6 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
}
/**
*
* @param vo
* @return
*/
@ -138,6 +142,10 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
List<TerminalChannelMapperListModel.ChannelBean> channelBeans = BeanUtil.copyToList(list, TerminalChannelMapperListModel.ChannelBean.class, CopyOptions.create().ignoreCase());
model.setList(channelBeans);
}
TerminalStatus terminalStatus = terminalStatusDao.selectByPrimaryKey(vo.getTermid());
if (!BeanUtil.isEmpty(terminalStatus)) {
model.setGpsstatus(terminalStatus.getGpsStatus());
}
return Asserts.success(model);
}

@ -0,0 +1,104 @@
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 com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalStatus;
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.TerminalGpsModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.interaction.Cma;
import com.shxy.xymanager_service.service.TerminalGpsService;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Gps
*
* @author
*/
@Slf4j
@Service
public class TerminalGpsServiceImpl implements TerminalGpsService {
@Autowired
private TerminalStatusDao terminalStatusDao;
// @Autowired
// private Cma cma;
/**
* Gps
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> setTermGPS(TerminalIdAndGpsVo vo) {
// Cma cma = new Cma("47.96.238.157", 6891);
boolean set = true;
Integer status;
Integer gpsstatus = vo.getGpsstatus();
if (gpsstatus == 0) {
// set = cma.turnOnGps(vo.getTermid().toString());
status = CommonStatus.EFFECTIVE.value();
} else {
// set = cma.turnOffGps(vo.getTermid().toString());
status = CommonStatus.DELETE.value();
}
if (set) {
TerminalStatus record = new TerminalStatus();
record.setTermId(vo.getTermid());
record.setGpsStatus(status);
int i = terminalStatusDao.updateByPrimaryKeySelective(record);
if (i != 0) {
return Asserts.success("操作成功");
} else {
return Asserts.error("操作成功,数据库修改失败");
}
} else {
return Asserts.error("操作失败");
}
}
/**
* GPS
* @param vo
* @return
*/
@Override
public ServiceBody<TerminalGpsModel> getTermGPS(TerminalIdVo vo) {
TerminalGpsModel model = new TerminalGpsModel();
// Cma cma = new Cma("47.96.238.157", 6891);
// boolean b = cma.requestGpsInfo(vo.getTermid().toString());
model.setLatitude(300);
model.setLongitude(200);
model.setTermid(vo.getTermid());
model.setRadius(10);
boolean b = true;
if (b) {
return Asserts.success(model);
} else {
return Asserts.error("操作失败");
}
}
}

@ -56,7 +56,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight());
photoBean.setManualRequest(item.getManualRequest());
photoBean.setPath("http://47.96.238.157/image/"+item.getPath());
photoBean.setPath("http://47.96.238.157/photos/"+item.getPath());
photoBean.setId(item.getId());
photoBean.setTermId(item.getTermId());
photoBean.setWidth(item.getWidth());

@ -5,19 +5,21 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalStatus;
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.TerminalListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalStatusDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.interaction.Cma;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -35,6 +37,12 @@ public class TerminalServiceImpl implements TerminalService {
@Autowired
private TerminalsDao terminalsDao;
@Autowired
private TerminalStatusDao terminalStatusDao;
// @Autowired
// private Cma cma;
/**
*
*
@ -118,7 +126,6 @@ public class TerminalServiceImpl implements TerminalService {
terminals.setId(item.getTermid());
list.add(terminals);
}
// List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list, CommonStatus.DELETE.value(), new Date());
if (i != 0) {
@ -128,5 +135,25 @@ public class TerminalServiceImpl implements TerminalService {
}
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> resetTerminal(TerminalIdVo vo) {
Cma cma = new Cma("47.96.238.157", 6891);
boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01);
if (reset) {
return Asserts.success("删除成功");
} else {
return Asserts.error("装置复位成功");
}
}
}

@ -0,0 +1,30 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalGpsModel;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.*;
/**
* Gps
*
* @author
*/
public interface TerminalGpsService {
/**
*
* GPS
* @param vo
* @return
*/
ServiceBody<String> setTermGPS(TerminalIdAndGpsVo vo);
/**
* GPS
* @param vo
* @return
*/
ServiceBody<TerminalGpsModel> getTermGPS(TerminalIdVo vo);
}

@ -2,10 +2,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateTerminalVo;
import com.shxy.xymanager_common.vo.*;
/**
*
@ -36,11 +33,19 @@ public interface TerminalService {
ServiceBody<String> updateTerminal(UpdateTerminalVo vo);
/**
*
*
*
* @param vo
* @return
*/
ServiceBody<String> deleteTerminal(TerminalIdListVo vo);
/**
*
*
* @param vo
* @return
*/
ServiceBody<String> resetTerminal(TerminalIdVo vo);
}

Loading…
Cancel
Save