|
|
@@ -441,6 +441,7 @@ public class ProjectService {
|
|
|
throw new BusinessException("所属主设备id错误!");
|
|
|
}
|
|
|
kwsDevice.setInstallTime(localDateTime);
|
|
|
+ kwsDevice.setRelated(1);
|
|
|
kwsDevice.setRelevanceLevel(level);
|
|
|
kwsDevice.setUpdateTime(LocalDateTime.now());
|
|
|
kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
@@ -452,6 +453,7 @@ public class ProjectService {
|
|
|
.eq(KwsDevice::getId, id)
|
|
|
.set(KwsDevice::getRelevanceLevel, level)
|
|
|
.set(KwsDevice::getInstallTime, localDateTime)
|
|
|
+ .set(KwsDevice::getRelated, 1)
|
|
|
.set(KwsDevice::getDeviceCode, deviceCode)
|
|
|
.set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
|
|
|
.set(KwsDevice::getOnline, 1)
|
|
|
@@ -471,7 +473,9 @@ public class ProjectService {
|
|
|
public PageRes deviceBindSelect(DeviceQuery deviceQuery, HttpServletRequest request) {
|
|
|
HeaderData headerData = commonService.getHeaderData(request);
|
|
|
PageHelper.startPage(deviceQuery.getPage(), deviceQuery.getPageSize());
|
|
|
- List<ProjectDeviceVO> list = projectMapper.selectNotBindDeviceList(deviceQuery, headerData);
|
|
|
+ //查询设备与项目没有绑定的数据
|
|
|
+// List<ProjectDeviceVO> list = projectMapper.selectNotBindDeviceList(deviceQuery, headerData);
|
|
|
+ List<ProjectDeviceVO> list = projectMapper.selectNotBindProjectDeviceAll(deviceQuery, headerData);
|
|
|
PageInfo<ProjectDeviceVO> info = new PageInfo<>(list);
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageRes.build(info, list);
|
|
|
@@ -1807,11 +1811,13 @@ public class ProjectService {
|
|
|
throw new BusinessException("所属主设备id错误!");
|
|
|
}
|
|
|
kwsDevice.setAlias(alias);
|
|
|
+ kwsDevice.setRelated(1);
|
|
|
kwsDevice.setInstallTime(localDateTime);
|
|
|
kwsDevice.setRelevanceLevel(level);
|
|
|
kwsDevice.setUpdateTime(LocalDateTime.now());
|
|
|
kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
level = "2";
|
|
|
+ deviceMapper.updateById(kwsDevice);
|
|
|
}
|
|
|
KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(id);
|
|
|
deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
|
|
|
@@ -1820,6 +1826,7 @@ public class ProjectService {
|
|
|
.set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
|
|
|
.set(KwsDevice::getInstallTime, localDateTime)
|
|
|
.set(KwsDevice::getOnline, 1)
|
|
|
+ .set(KwsDevice::getRelated, 1)
|
|
|
.set(KwsDevice::getAlias, bindDevice.getAlias() == null ? kwsDevice.getName() : bindDevice.getAlias())
|
|
|
.set(KwsDevice::getUpdateTime, LocalDateTime.now())
|
|
|
.set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()))
|