#位置信息增加当前设备任务执行情况
This commit is contained in:
@@ -272,6 +272,14 @@ public class DeviceController extends BaseController {
|
||||
return getDataTable(deviceService.getSiteList(getLoginUser(), device));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表 分配页面
|
||||
*/
|
||||
@GetMapping("/getDeviceBySpiltCode")
|
||||
public AjaxResult getDeviceBySpiltCode(@RequestParam String code) {
|
||||
return AjaxResult.success(deviceService.getDeviceBySpiltCode(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表 分配页面
|
||||
*/
|
||||
|
||||
@@ -152,8 +152,10 @@ public class HostComputerController extends BaseController {
|
||||
try {
|
||||
WebRouteStatusMessageDTO dto = new WebRouteStatusMessageDTO();
|
||||
String deviceId = deviceSessionManager.getDeviceByTaskId(taskId);
|
||||
log.debug("sendMessage: taskId={}, deviceId={}", taskId, deviceId);
|
||||
List<NettyDevice> controlMasters = deviceSessionManager
|
||||
.getAllSlaveControl(deviceId);
|
||||
log.debug("sendMessage: controlMasters={}", JsonUtils.toJsonString(controlMasters));
|
||||
dto.setData(data);
|
||||
dto.setDeviceId(deviceId);
|
||||
dto.setTaskId(taskId);
|
||||
@@ -162,9 +164,9 @@ public class HostComputerController extends BaseController {
|
||||
for (NettyDevice x : controlMasters) {
|
||||
try {
|
||||
websocketMesDispather.dispather(x.getConnectorId(), JsonUtils.toJsonString(dto));
|
||||
log.info("位置数据websocket推送成功: connectorId={}, taskId={}", x.getConnectorId(), taskId);
|
||||
log.info("sendMessage推送成功: connectorId={}, taskId={}", x.getConnectorId(), taskId);
|
||||
} catch (Exception e) {
|
||||
log.error("位置数据websocket推送失败: connectorId={}, error={}", x.getConnectorId(),
|
||||
log.error("sendMessage推送失败: connectorId={}, error={}", x.getConnectorId(),
|
||||
e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
|
||||
|
||||
/**
|
||||
* 根据设备编号查询设备
|
||||
*
|
||||
@@ -25,7 +24,6 @@ public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
*/
|
||||
public Device selectDeviceBySerialNumber(String serialNumber);
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
@@ -34,7 +32,6 @@ public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
*/
|
||||
public List<Device> selectDeviceList(Device device);
|
||||
|
||||
|
||||
/**
|
||||
* 根据产品ID查询产品下所有设备的编号
|
||||
*
|
||||
@@ -66,7 +63,6 @@ public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
*/
|
||||
public int updateDevice(Device device);
|
||||
|
||||
|
||||
/**
|
||||
* 重置设备状态
|
||||
*
|
||||
@@ -74,7 +70,6 @@ public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
*/
|
||||
public int resetDeviceStatus(String deviceNum);
|
||||
|
||||
|
||||
/**
|
||||
* 根据产品ID获取产品下所有编号
|
||||
*
|
||||
@@ -91,4 +86,6 @@ public interface DeviceMapper extends BaseMapperX<Device> {
|
||||
*/
|
||||
public List<String> selectSerialNumbersByProductId(@Param("productId") Long productId);
|
||||
|
||||
public Device selectDeviceBySpiltCode(@Param("code") String code);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,10 +16,8 @@ import java.util.List;
|
||||
*/
|
||||
public interface IDeviceService {
|
||||
|
||||
|
||||
public AjaxResult updateDeviceBySelf(Device device);
|
||||
|
||||
|
||||
public Device insertDeviceBySelf(Device device);
|
||||
|
||||
/**
|
||||
@@ -30,7 +28,6 @@ public interface IDeviceService {
|
||||
*/
|
||||
public Device selectDeviceBySerialNumber(String serialNumber);
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
@@ -39,7 +36,6 @@ public interface IDeviceService {
|
||||
*/
|
||||
public List<Device> selectDeviceList(Device device);
|
||||
|
||||
|
||||
/**
|
||||
* 根据产品ID查询产品下所有设备的编号
|
||||
*
|
||||
@@ -55,7 +51,6 @@ public interface IDeviceService {
|
||||
*/
|
||||
public int selectDeviceCountByProductId(Long productId);
|
||||
|
||||
|
||||
/**
|
||||
* 重置设备状态
|
||||
*
|
||||
@@ -63,7 +58,6 @@ public interface IDeviceService {
|
||||
*/
|
||||
public int resetDeviceStatus(String deviceNum);
|
||||
|
||||
|
||||
/**
|
||||
* 根据产品ID获取产品下所有编号
|
||||
*
|
||||
@@ -72,7 +66,6 @@ public interface IDeviceService {
|
||||
*/
|
||||
public String[] getDeviceNumsByProductId(Long productId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询产品下所有设备,返回设备编号
|
||||
*
|
||||
@@ -81,17 +74,16 @@ public interface IDeviceService {
|
||||
*/
|
||||
public List<String> selectSerialNumbersByProductId(Long productId);
|
||||
|
||||
|
||||
public boolean bind(DeviceBindDTO bindDTO, String username);
|
||||
|
||||
|
||||
public boolean unbind(DeviceBindDTO bindDTO, String username);
|
||||
|
||||
|
||||
public List<Device> getSiteList(LoginUser loginUser, Device device);
|
||||
|
||||
public List<Device> getDeviceList(LoginUser loginUser, Device device);
|
||||
|
||||
public Device getDeviceBySpiltCode(String code);
|
||||
|
||||
public boolean paramModifyAuth(DeviceParamAuthDTO dto);
|
||||
|
||||
public boolean hasPermission(String deviceId);
|
||||
|
||||
@@ -440,4 +440,9 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Device getDeviceBySpiltCode(String code) {
|
||||
return deviceMapper.selectDeviceBySpiltCode(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -504,4 +504,9 @@
|
||||
#{deviceId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectDeviceBySpiltCode" parameterType="String" resultMap="DeviceResult">
|
||||
<include refid="selectDeviceVo"/>
|
||||
where device_name like concat('%', #{code}, '%')
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user