物联设备去掉设备维度,损坏改成更换设备
This commit is contained in:
parent
adb3848b52
commit
ac8507ca37
|
|
@ -12,7 +12,6 @@ public class DevicePreviewMqDto {
|
||||||
private String nuId;
|
private String nuId;
|
||||||
private String nuName;
|
private String nuName;
|
||||||
private String batchNo;
|
private String batchNo;
|
||||||
private String dimension;
|
|
||||||
private String sn;
|
private String sn;
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
private String deviceType;
|
private String deviceType;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ public class DeviceBindLog implements Serializable {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String nuId;
|
private String nuId;
|
||||||
private String nuName;
|
private String nuName;
|
||||||
private String dimension;
|
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
@Dict(dicCode = "tplink_device_type")
|
@Dict(dicCode = "tplink_device_type")
|
||||||
private String deviceType;
|
private String deviceType;
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,13 @@ public class DeviceManager implements Serializable {
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String nuId;
|
|
||||||
@Excel(name = "批次", width = 15)
|
@Excel(name = "批次", width = 15)
|
||||||
private String batchNo;//批次号
|
private String batchNo;//批次号
|
||||||
|
@Excel(name = "区域编码", width = 15)
|
||||||
|
private String nuId;
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Excel(name = "区域名称", width = 15)
|
||||||
|
private String nuName;
|
||||||
@Excel(name = "设备名称", width = 15)
|
@Excel(name = "设备名称", width = 15)
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
@Excel(name = "设备类型", width = 15, dicCode = "tplink_device_type")
|
@Excel(name = "设备类型", width = 15, dicCode = "tplink_device_type")
|
||||||
|
|
@ -35,13 +39,8 @@ public class DeviceManager implements Serializable {
|
||||||
private String deviceModel;
|
private String deviceModel;
|
||||||
@Excel(name = "生产厂家", width = 15)
|
@Excel(name = "生产厂家", width = 15)
|
||||||
private String factory;
|
private String factory;
|
||||||
@Excel(name = "设备维度", width = 15)
|
|
||||||
private String dimension;
|
|
||||||
@Excel(name = "设备标识", width = 15)
|
@Excel(name = "设备标识", width = 15)
|
||||||
private String sn;
|
private String sn;
|
||||||
@TableField(exist = false)
|
|
||||||
@Excel(name = "区域", width = 15)
|
|
||||||
private String nuName;
|
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,6 @@ public class DeviceManagerHz implements Serializable {
|
||||||
private String deviceModel;
|
private String deviceModel;
|
||||||
@Excel(name = "生产厂家", width = 15)
|
@Excel(name = "生产厂家", width = 15)
|
||||||
private String factory;
|
private String factory;
|
||||||
@Excel(name = "设备维度", width = 15)
|
|
||||||
private String dimension;
|
|
||||||
private String sn;
|
private String sn;
|
||||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
a.batch_no,
|
a.batch_no,
|
||||||
a.nu_id,
|
a.nu_id,
|
||||||
c.nu_name,
|
c.nu_name,
|
||||||
a.dimension,
|
|
||||||
a.device_name,
|
a.device_name,
|
||||||
a.device_type,
|
a.device_type,
|
||||||
a.device_model,
|
a.device_model,
|
||||||
|
|
@ -54,19 +53,19 @@
|
||||||
<if test="params.nuName != null and params.nuName != ''">
|
<if test="params.nuName != null and params.nuName != ''">
|
||||||
AND (
|
AND (
|
||||||
c.nu_name LIKE concat('%',#{params.nuName},'%')
|
c.nu_name LIKE concat('%',#{params.nuName},'%')
|
||||||
or a.dimension LIKE concat('%',#{params.nuName},'%')
|
|
||||||
or a.batch_no LIKE concat('%',#{params.nuName},'%')
|
or a.batch_no LIKE concat('%',#{params.nuName},'%')
|
||||||
or dict.item_text LIKE concat('%',#{params.nuName},'%')
|
or dict.item_text LIKE concat('%',#{params.nuName},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
order by a.create_time desc,a.dimension asc,a.device_type asc ,a.device_model asc ,a.sn asc
|
order by a.create_time desc,a.device_type asc ,a.device_model asc ,a.sn asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findAllPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.manager.entity.DeviceManager">
|
<select id="findAllPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.manager.entity.DeviceManager">
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
|
a.nu_id,
|
||||||
|
c.nu_name,
|
||||||
a.batch_no,
|
a.batch_no,
|
||||||
a.dimension,
|
|
||||||
a.device_name,
|
a.device_name,
|
||||||
a.device_type,
|
a.device_type,
|
||||||
a.device_model,
|
a.device_model,
|
||||||
|
|
@ -78,24 +77,21 @@
|
||||||
a.device_status,
|
a.device_status,
|
||||||
a.yw_id
|
a.yw_id
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
|
left join nu_base_info c on a.nu_id = c.nu_id
|
||||||
where ifnull(a.device_status,'') != '损坏'
|
where ifnull(a.device_status,'') != '损坏'
|
||||||
<if test="params.dimension != null and params.dimension != ''">
|
|
||||||
AND a.dimension = #{params.dimension}
|
|
||||||
</if>
|
|
||||||
<if test="params.deviceType != null and params.deviceType != ''">
|
<if test="params.deviceType != null and params.deviceType != ''">
|
||||||
AND a.device_type = #{params.deviceType}
|
AND a.device_type = #{params.deviceType}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.batchNo != null and params.batchNo != ''">
|
<if test="params.batchNo != null and params.batchNo != ''">
|
||||||
AND a.batch_no = #{params.batchNo}
|
AND a.batch_no = #{params.batchNo}
|
||||||
</if>
|
</if>
|
||||||
order by a.create_time desc,a.dimension asc,a.device_type asc ,a.device_model asc ,a.sn asc
|
order by a.create_time desc,a.device_type asc ,a.device_model asc ,a.sn asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findBySn" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.manager.entity.DeviceManager">
|
<select id="findBySn" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.manager.entity.DeviceManager">
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
a.batch_no,
|
a.batch_no,
|
||||||
a.dimension,
|
|
||||||
a.device_name,
|
a.device_name,
|
||||||
a.device_type,
|
a.device_type,
|
||||||
a.device_model,
|
a.device_model,
|
||||||
|
|
@ -114,7 +110,6 @@
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
a.batch_no,
|
a.batch_no,
|
||||||
a.dimension,
|
|
||||||
a.device_name,
|
a.device_name,
|
||||||
a.device_type,
|
a.device_type,
|
||||||
a.device_model,
|
a.device_model,
|
||||||
|
|
@ -136,7 +131,6 @@
|
||||||
id,
|
id,
|
||||||
nu_id,
|
nu_id,
|
||||||
nu_name,
|
nu_name,
|
||||||
dimension,
|
|
||||||
device_name,
|
device_name,
|
||||||
device_type,
|
device_type,
|
||||||
device_model,
|
device_model,
|
||||||
|
|
@ -147,9 +141,6 @@
|
||||||
remarks
|
remarks
|
||||||
from nu_iot_device_bind_log
|
from nu_iot_device_bind_log
|
||||||
<where>
|
<where>
|
||||||
<if test="params.dimension != null and params.dimension != ''">
|
|
||||||
AND dimension = #{params.dimension}
|
|
||||||
</if>
|
|
||||||
<if test="params.deviceType != null and params.deviceType != ''">
|
<if test="params.deviceType != null and params.deviceType != ''">
|
||||||
AND device_type = #{params.deviceType}
|
AND device_type = #{params.deviceType}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -164,7 +155,6 @@
|
||||||
insert into nu_iot_device_bind_log(
|
insert into nu_iot_device_bind_log(
|
||||||
nu_id,
|
nu_id,
|
||||||
nu_name,
|
nu_name,
|
||||||
dimension,
|
|
||||||
device_name,
|
device_name,
|
||||||
device_type,
|
device_type,
|
||||||
device_model,
|
device_model,
|
||||||
|
|
@ -176,7 +166,6 @@
|
||||||
)values(
|
)values(
|
||||||
#{nuId},
|
#{nuId},
|
||||||
#{nuName},
|
#{nuName},
|
||||||
#{dimension},
|
|
||||||
#{deviceName},
|
#{deviceName},
|
||||||
#{deviceType},
|
#{deviceType},
|
||||||
#{deviceModel},
|
#{deviceModel},
|
||||||
|
|
@ -196,23 +185,23 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="exportDeviceExcel" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.manager.entity.DeviceManager">
|
<select id="exportDeviceExcel" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.manager.entity.DeviceManager">
|
||||||
select a.batch_no,a.device_name,a.device_type,a.device_model,a.factory,a.dimension,a.sn,c.nu_name,a.remarks
|
select a.batch_no,a.device_name,a.device_type,a.device_model,a.factory,a.sn,a.nu_id,c.nu_name,a.remarks
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_base_info c on a.nu_id = c.nu_id
|
left join nu_base_info c on a.nu_id = c.nu_id
|
||||||
where ifnull(a.device_status,'') != '损坏'
|
where ifnull(a.device_status,'') != '损坏'
|
||||||
order by a.batch_no,a.dimension,a.device_name
|
order by a.batch_no,a.device_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="exportDeviceHzExcel" parameterType="com.nu.modules.manager.entity.DeviceManagerHz" resultType="com.nu.modules.manager.entity.DeviceManagerHz">
|
<select id="exportDeviceHzExcel" parameterType="com.nu.modules.manager.entity.DeviceManagerHz" resultType="com.nu.modules.manager.entity.DeviceManagerHz">
|
||||||
select batch_no,device_name,device_type,device_model,factory,dimension,count(*) as hz
|
select batch_no,device_name,device_type,device_model,factory,count(*) as hz
|
||||||
from nu_iot_device_preview
|
from nu_iot_device_preview
|
||||||
where ifnull(device_status,'') != '损坏'
|
where ifnull(device_status,'') != '损坏'
|
||||||
group by batch_no,device_name,device_type,device_model,factory,dimension
|
group by batch_no,device_name,device_type,device_model,factory
|
||||||
order by batch_no,dimension,factory,device_type,device_model,device_name
|
order by batch_no,factory,device_type,device_model,device_name
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="cameraInfoList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
<select id="cameraInfoList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||||
select a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.device_status,b.device_index
|
select a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.device_status,b.device_index
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
inner join nu_iot_tplink_camera b on a.sn = b.mac
|
inner join nu_iot_tplink_camera b on a.sn = b.mac
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
|
|
@ -221,7 +210,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findCameraInfoUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
<select id="findCameraInfoUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tplink.camera.entity.CameraInfo">
|
||||||
select a.id,a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.device_status,b.device_index
|
select a.id,a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.device_status,b.device_index
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_iot_tplink_camera b on a.sn = b.mac
|
left join nu_iot_tplink_camera b on a.sn = b.mac
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
|
|
@ -230,7 +219,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="waterMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
<select id="waterMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
||||||
select a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.cid,b.address,b.water_value
|
select a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.cid,b.address,b.water_value
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
inner join nu_iot_tq_water_meter b on a.sn = b.cid
|
inner join nu_iot_tq_water_meter b on a.sn = b.cid
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
|
|
@ -239,7 +228,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findWaterMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
<select id="findWaterMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.water.entity.WaterMeter">
|
||||||
select a.id,a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.cid,b.address,b.water_value
|
select a.id,a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.cid,b.address,b.water_value
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_iot_tq_water_meter b on a.sn = b.cid
|
left join nu_iot_tq_water_meter b on a.sn = b.cid
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
|
|
@ -248,7 +237,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="electricityMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
<select id="electricityMeterList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
||||||
select a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.ele_value
|
select a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.ele_value
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
inner join nu_iot_ds_electricity_meter b on a.sn = b.sn
|
inner join nu_iot_ds_electricity_meter b on a.sn = b.sn
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
|
|
@ -257,7 +246,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findElectricityMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
<select id="findElectricityMeterUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.tq.electricity.entity.ElectricityMeter">
|
||||||
select a.id,a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.ele_value
|
select a.id,a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.relay_state,b.ele_value
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_iot_ds_electricity_meter b on a.sn = b.sn
|
left join nu_iot_ds_electricity_meter b on a.sn = b.sn
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
|
|
@ -266,7 +255,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="humidDeviceList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
<select id="humidDeviceList" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
||||||
select a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.status,b.temperature,b.humidity
|
select a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.status,b.temperature,b.humidity
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
inner join nu_iot_yiweilian_humid_device b on a.sn = b.sn
|
inner join nu_iot_yiweilian_humid_device b on a.sn = b.sn
|
||||||
where a.nu_id = #{nuId}
|
where a.nu_id = #{nuId}
|
||||||
|
|
@ -275,7 +264,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findHumidDeviceUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
<select id="findHumidDeviceUnbindPage" parameterType="com.nu.modules.manager.entity.DeviceManager" resultType="com.nu.modules.yiweilian.humid.entity.HumidDevice">
|
||||||
select a.id,a.batch_no,a.nu_id,a.dimension,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.status,b.temperature,b.humidity
|
select a.id,a.batch_no,a.nu_id,a.sn,a.device_type,a.device_model,a.device_status as maintainStatus,b.status,b.temperature,b.humidity
|
||||||
from nu_iot_device_preview a
|
from nu_iot_device_preview a
|
||||||
left join nu_iot_yiweilian_humid_device b on a.sn = b.sn
|
left join nu_iot_yiweilian_humid_device b on a.sn = b.sn
|
||||||
where a.nu_id is null
|
where a.nu_id is null
|
||||||
|
|
@ -300,7 +289,6 @@
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
a.batch_no,
|
a.batch_no,
|
||||||
a.dimension,
|
|
||||||
a.device_name,
|
a.device_name,
|
||||||
a.device_type,
|
a.device_type,
|
||||||
a.device_model,
|
a.device_model,
|
||||||
|
|
@ -338,9 +326,6 @@
|
||||||
where a.sn is not null
|
where a.sn is not null
|
||||||
and a.nu_id is null
|
and a.nu_id is null
|
||||||
and ifnull(a.device_status,'') != '损坏'
|
and ifnull(a.device_status,'') != '损坏'
|
||||||
<if test="params.dimension != null and params.dimension != ''">
|
|
||||||
AND a.dimension = #{params.dimension}
|
|
||||||
</if>
|
|
||||||
<if test="params.deviceType != null and params.deviceType != ''">
|
<if test="params.deviceType != null and params.deviceType != ''">
|
||||||
AND a.device_type = #{params.deviceType}
|
AND a.device_type = #{params.deviceType}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -350,7 +335,7 @@
|
||||||
<if test="params.id != null and params.id != ''">
|
<if test="params.id != null and params.id != ''">
|
||||||
AND a.id != #{params.id}
|
AND a.id != #{params.id}
|
||||||
</if>
|
</if>
|
||||||
order by a.batch_no,a.dimension,a.device_type,a.device_model,a.sn
|
order by a.batch_no,a.device_type,a.device_model,a.sn
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -86,9 +86,7 @@ public class DeviceManagerServiceImpl extends ServiceImpl<DeviceManagerMapper, D
|
||||||
if(!deviceBindLog.getOptType().equals("损坏")){
|
if(!deviceBindLog.getOptType().equals("损坏")){
|
||||||
deviceManager.setDeviceStatus("已绑定");
|
deviceManager.setDeviceStatus("已绑定");
|
||||||
}
|
}
|
||||||
if(deviceBindLog.getDimension().equals("区域维度")){
|
|
||||||
deviceManager.setNuId(deviceBindLog.getNuId());
|
deviceManager.setNuId(deviceBindLog.getNuId());
|
||||||
}
|
|
||||||
baseMapper.updateById(deviceManager);
|
baseMapper.updateById(deviceManager);
|
||||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||||
String orgCode = deptInfo.getString("code");
|
String orgCode = deptInfo.getString("code");
|
||||||
|
|
@ -102,16 +100,12 @@ public class DeviceManagerServiceImpl extends ServiceImpl<DeviceManagerMapper, D
|
||||||
if(deviceBindLog.getOptType().equals("损坏")){
|
if(deviceBindLog.getOptType().equals("损坏")){
|
||||||
if(deviceBindLog.getNewId()!=null){
|
if(deviceBindLog.getNewId()!=null){
|
||||||
//更新新数据状态为绑定,如区域维度给定nuId
|
//更新新数据状态为绑定,如区域维度给定nuId
|
||||||
if(deviceBindLog.getDimension().equals("区域维度")){
|
|
||||||
deviceManager.setNuId(deviceBindLog.getNuId());
|
deviceManager.setNuId(deviceBindLog.getNuId());
|
||||||
}
|
|
||||||
QueryWrapper<DeviceManager> qw = new QueryWrapper<>();
|
QueryWrapper<DeviceManager> qw = new QueryWrapper<>();
|
||||||
qw.eq("id",deviceBindLog.getNewId());
|
qw.eq("id",deviceBindLog.getNewId());
|
||||||
DeviceManager entity = this.getOne(qw);
|
DeviceManager entity = this.getOne(qw);
|
||||||
if(deviceBindLog.getDimension().equals("区域维度")){
|
|
||||||
entity.setNuId(deviceBindLog.getNuId());
|
entity.setNuId(deviceBindLog.getNuId());
|
||||||
entity.setNuName(deviceBindLog.getNuName());
|
entity.setNuName(deviceBindLog.getNuName());
|
||||||
}
|
|
||||||
entity.setDeviceStatus("已绑定");
|
entity.setDeviceStatus("已绑定");
|
||||||
baseMapper.updateById(entity);
|
baseMapper.updateById(entity);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,18 +157,12 @@ public class IotSyncBizMQListener {
|
||||||
DeviceManager dm = deviceManagerService.findBySn(deviceManager);
|
DeviceManager dm = deviceManagerService.findBySn(deviceManager);
|
||||||
if(dm!=null){
|
if(dm!=null){
|
||||||
deviceManager.setDeviceStatus("未绑定");
|
deviceManager.setDeviceStatus("未绑定");
|
||||||
if(dm.getDimension().equals("机构维度")){
|
|
||||||
deviceManager.setDeviceStatus("已绑定");
|
|
||||||
}
|
|
||||||
deviceManagerService.editPreviewStatusBySn(deviceManager);
|
deviceManagerService.editPreviewStatusBySn(deviceManager);
|
||||||
}else{
|
}else{
|
||||||
DeviceManager snEmpty = deviceManagerService.findOneByType(deviceManager);
|
DeviceManager snEmpty = deviceManagerService.findOneByType(deviceManager);
|
||||||
if(snEmpty!=null){
|
if(snEmpty!=null){
|
||||||
deviceManager.setId(snEmpty.getId());
|
deviceManager.setId(snEmpty.getId());
|
||||||
deviceManager.setDeviceStatus("未绑定");
|
deviceManager.setDeviceStatus("未绑定");
|
||||||
if(snEmpty.getDimension().equals("机构维度")){
|
|
||||||
deviceManager.setDeviceStatus("已绑定");
|
|
||||||
}
|
|
||||||
deviceManagerService.updateById(deviceManager);
|
deviceManagerService.updateById(deviceManager);
|
||||||
|
|
||||||
deviceManager.setYwId(snEmpty.getYwId());
|
deviceManager.setYwId(snEmpty.getYwId());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue