删除装置接口修改

dev
liuguijing 2 years ago
parent 8fca3fa257
commit b2df421a4b

@ -26,9 +26,9 @@ public class TerminalStatus implements Serializable {
private Byte floatingCharge;
private Integer totalWorkingTime;
private BigInteger totalWorkingTime;
private Integer workingTime;
private BigInteger workingTime;
private Integer gpsStatus;

@ -24,13 +24,13 @@ public class TerminalStatusInfoModel implements Serializable {
private Float batteryVoltage;
@ApiModelProperty(value = "本次连续工作时间(小时)", example = "12345678")
private Integer workingTime;
private BigInteger workingTime;
@ApiModelProperty(value = "浮充状态:充电 放电", example = "12345678")
private Byte floatingCharge;
@ApiModelProperty(value = "工作总时间(小时)", example = "名称名称")
private Integer totalWorkingTime;
private BigInteger totalWorkingTime;
@ApiModelProperty(value = "网络连接状态 ", example = "名称名称")
private Integer connectionState;

@ -4,13 +4,22 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "装置编号数组", description = "装置编号数组描述")
public class TerminalIdListVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "装置对象数组", required = true, example = "A0001")
private List<TerminalIdVo> list;
@Min(value = 0, message = "开关标志最小为0")
@Max(value = 1, message = "开关标志最大为1")
@ApiModelProperty(value = "开关标志", required = true, example = "0---关闭 1---打开")
private Integer type;
}

@ -11,8 +11,8 @@
<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="total_working_time" jdbcType="BIGINT" property="totalWorkingTime"/>
<result column="working_time" jdbcType="BIGINT" 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"/>

@ -292,6 +292,16 @@ public class TerminalServiceImpl implements TerminalService {
*/
@Override
public ServiceBody<String> deleteTerminal(TerminalIdListVo vo) {
Integer type = vo.getType();
if (type == null) {
type = CommonStatus.DELETE.value();
} else {
if (type == 0) {
type = CommonStatus.DELETE.value();
} else {
type = CommonStatus.EFFECTIVE.value();
}
}
ArrayList<Terminals> list = new ArrayList<>();
List<TerminalIdVo> beans = vo.getList();
for (TerminalIdVo item : beans) {
@ -299,7 +309,7 @@ public class TerminalServiceImpl implements TerminalService {
terminals.setId(item.getTermid());
list.add(terminals);
}
int i = terminalsDao.deleteById(list, CommonStatus.DELETE.value(), new Date());
int i = terminalsDao.deleteById(list, type, new Date());
cacheService.updateTerminalMap();
if (i != 0) {
return Asserts.success("删除成功");

Loading…
Cancel
Save