fix: relocate cwos-portal decompiled output to correct path; remove nested directory

Former-commit-id: dc30d42a8c55ed8b2382a41dc2434233fbed9930
This commit is contained in:
反编译工作区
2026-04-29 12:09:48 +08:00
parent ea8e492076
commit e8672a3c7b
1759 changed files with 547735 additions and 280 deletions
@@ -0,0 +1,14 @@
package cn.cloudwalk.elevator.device.dao;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
public interface AcsDeviceTaskDao {
Integer insert(AcsDeviceTaskAddDto paramAcsDeviceTaskAddDto);
Integer updateBingDevices(AcsDeviceTaskAddDto paramAcsDeviceTaskAddDto);
Integer updateIsStop(AcsDeviceTaskAddDto paramAcsDeviceTaskAddDto);
AcsDeviceTaskDTO getById(String paramString);
}
@@ -0,0 +1,46 @@
package cn.cloudwalk.elevator.device.dao;
import cn.cloudwalk.cloud.exception.DataAccessException;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceAddDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceEditDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryByIdDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
import java.util.List;
public interface AcsElevatorDeviceDao {
Integer add(AcsElevatorDeviceAddDTO paramAcsElevatorDeviceAddDTO) throws DataAccessException;
Integer edit(AcsElevatorDeviceEditDTO paramAcsElevatorDeviceEditDTO) throws DataAccessException;
Integer delete(List<String> paramList) throws DataAccessException;
CloudwalkPageAble<AcsElevatorDeviceResultDTO> page(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO,
CloudwalkPageInfo paramCloudwalkPageInfo) throws DataAccessException;
List<AcsElevatorDeviceResultDTO> listByZoneId(AcsElevatorDeviceListDto paramAcsElevatorDeviceListDto)
throws DataAccessException;
List<AcsElevatorDeviceResultDTO> listByZoneIds(AcsElevatorDeviceListDto paramAcsElevatorDeviceListDto)
throws DataAccessException;
List<AcsElevatorDeviceResultDTO> listBuBuildingId(
AcsElevatorDeviceListByBuildingIdDto paramAcsElevatorDeviceListByBuildingIdDto) throws DataAccessException;
List<AcsElevatorDeviceResultDTO> get(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO)
throws ServiceException;
AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdDTO paramAcsElevatorDeviceQueryByIdDTO)
throws ServiceException;
AcsElevatorDeviceResultDTO getByDeciveCode(String paramString) throws ServiceException;
String getBuildingId(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO) throws ServiceException;
String getBusinessId(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO) throws ServiceException;
}
@@ -0,0 +1,9 @@
package cn.cloudwalk.elevator.device.dao;
import cn.cloudwalk.cloud.exception.ServiceException;
public interface DeviceImageStoreDao {
Boolean save(String paramString1, String paramString2) throws ServiceException;
String getByBuildingId(String paramString) throws ServiceException;
}
@@ -0,0 +1,98 @@
package cn.cloudwalk.elevator.device.dto;
import java.io.Serializable;
import java.util.List;
public class AcsDeviceQueryDTO implements Serializable {
private static final long serialVersionUID = -9107652629099620576L;
private String id;
private List<String> ids;
private String businessId;
private String deviceId;
private List<String> deviceIds;
private String deviceCode;
private String parentDeviceId;
private List<String> parentDeviceIds;
private Integer openStatus;
private Integer queryParent;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public List<String> getIds() {
return this.ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<String> getDeviceIds() {
return this.deviceIds;
}
public void setDeviceIds(List<String> deviceIds) {
this.deviceIds = deviceIds;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getParentDeviceId() {
return this.parentDeviceId;
}
public void setParentDeviceId(String parentDeviceId) {
this.parentDeviceId = parentDeviceId;
}
public List<String> getParentDeviceIds() {
return this.parentDeviceIds;
}
public void setParentDeviceIds(List<String> parentDeviceIds) {
this.parentDeviceIds = parentDeviceIds;
}
public Integer getQueryParent() {
return this.queryParent;
}
public void setQueryParent(Integer queryParent) {
this.queryParent = queryParent;
}
public Integer getOpenStatus() {
return this.openStatus;
}
public void setOpenStatus(Integer openStatus) {
this.openStatus = openStatus;
}
}
@@ -0,0 +1,71 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsDeviceResultDTO extends CloudwalkBaseTimes implements Serializable {
private static final long serialVersionUID = 6868258119634367362L;
private String id;
private String businessId;
private String deviceId;
private String deviceCode;
private String parentDeviceId;
private String imageStoreId;
private Integer openStatus;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getParentDeviceId() {
return this.parentDeviceId;
}
public void setParentDeviceId(String parentDeviceId) {
this.parentDeviceId = parentDeviceId;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public Integer getOpenStatus() {
return this.openStatus;
}
public void setOpenStatus(Integer openStatus) {
this.openStatus = openStatus;
}
}
@@ -0,0 +1,35 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsDeviceTaskAddDto extends CloudwalkBaseTimes implements Serializable {
private static final long serialVersionUID = 6909321999650444051L;
private Integer allDevices;
private Integer bindDevices;
private Integer isStop;
public Integer getAllDevices() {
return this.allDevices;
}
public void setAllDevices(Integer allDevices) {
this.allDevices = allDevices;
}
public Integer getBindDevices() {
return this.bindDevices;
}
public void setBindDevices(Integer bindDevices) {
this.bindDevices = bindDevices;
}
public Integer getIsStop() {
return this.isStop;
}
public void setIsStop(Integer isStop) {
this.isStop = isStop;
}
}
@@ -0,0 +1,43 @@
package cn.cloudwalk.elevator.device.dto;
import java.io.Serializable;
public class AcsDeviceTaskDTO implements Serializable {
private static final long serialVersionUID = -3746361327881264974L;
private String id;
private Integer allDevices;
private Integer bindDevices;
private Integer isStop;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public Integer getAllDevices() {
return this.allDevices;
}
public void setAllDevices(Integer allDevices) {
this.allDevices = allDevices;
}
public Integer getBindDevices() {
return this.bindDevices;
}
public void setBindDevices(Integer bindDevices) {
this.bindDevices = bindDevices;
}
public Integer getIsStop() {
return this.isStop;
}
public void setIsStop(Integer isStop) {
this.isStop = isStop;
}
}
@@ -0,0 +1,151 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsElevatorDeviceAddDTO extends CloudwalkBaseTimes implements Serializable {
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
private Integer deleteFlag;
private String areaId;
private String elevatorFloorIdList;
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getDeleteFlag() {
return this.deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String toString() {
return "AcsElevatorDeviceAddDTO{businessId='" + this.businessId + '\'' + ", deviceId='" + this.deviceId + '\''
+ ", deviceCode='" + this.deviceCode + '\'' + ", deviceName='" + this.deviceName + '\''
+ ", deviceTypeName='" + this.deviceTypeName + '\'' + ", elevatorFloorList='" + this.elevatorFloorList
+ '\'' + ", currentFloorId='" + this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\''
+ ", currentBuilding='" + this.currentBuilding + '\'' + ", areaName='" + this.areaName + '\'' + ", status="
+ this.status + ", deleteFlag=" + this.deleteFlag + '}';
}
}
@@ -0,0 +1,77 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsElevatorDeviceEditDTO extends CloudwalkBaseTimes implements Serializable {
private static final long serialVersionUID = 885170301572808321L;
private String elevatorFloorList;
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaId;
private String elevatorFloorIdList;
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String toString() {
return "AcsElevatorDeciveEditDTO{elevatorFloorList='" + this.elevatorFloorList + '\'' + ", currentFloorId='"
+ this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\'' + ", currentBuilding='"
+ this.currentBuilding + '\'' + ", currentBuildingId='" + this.currentBuildingId + '\'' + '}';
}
}
@@ -0,0 +1,58 @@
package cn.cloudwalk.elevator.device.dto;
import java.io.Serializable;
public class AcsElevatorDeviceListByBuildingIdDto implements Serializable {
private String businessId;
private String currentBuildingId;
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsElevatorDeviceListByBuildingIdDto))
return false;
AcsElevatorDeviceListByBuildingIdDto other = (AcsElevatorDeviceListByBuildingIdDto)o;
if (!other.canEqual(this))
return false;
Object this$businessId = getBusinessId(), other$businessId = other.getBusinessId();
if ((this$businessId == null) ? (other$businessId != null) : !this$businessId.equals(other$businessId))
return false;
Object this$currentBuildingId = getCurrentBuildingId(), other$currentBuildingId = other.getCurrentBuildingId();
return !((this$currentBuildingId == null) ? (other$currentBuildingId != null)
: !this$currentBuildingId.equals(other$currentBuildingId));
}
protected boolean canEqual(Object other) {
return other instanceof AcsElevatorDeviceListByBuildingIdDto;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $businessId = getBusinessId();
result = result * 59 + (($businessId == null) ? 43 : $businessId.hashCode());
Object $currentBuildingId = getCurrentBuildingId();
return result * 59 + (($currentBuildingId == null) ? 43 : $currentBuildingId.hashCode());
}
public String toString() {
return "AcsElevatorDeviceListByBuildingIdDto(businessId=" + getBusinessId() + ", currentBuildingId="
+ getCurrentBuildingId() + ")";
}
public String getBusinessId() {
return this.businessId;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
}
@@ -0,0 +1,35 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import java.util.List;
public class AcsElevatorDeviceListDto extends CloudwalkBaseTimes implements Serializable {
private String businessId;
private String currentFloorId;
private List<String> currentFloorIds;
public List<String> getCurrentFloorIds() {
return this.currentFloorIds;
}
public void setCurrentFloorIds(List<String> currentFloorIds) {
this.currentFloorIds = currentFloorIds;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
}
@@ -0,0 +1,208 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsElevatorDeviceListResultDto extends CloudwalkBaseTimes implements Serializable {
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsElevatorDeviceListResultDto))
return false;
AcsElevatorDeviceListResultDto other = (AcsElevatorDeviceListResultDto)o;
if (!other.canEqual(this))
return false;
Object this$businessId = getBusinessId(), other$businessId = other.getBusinessId();
if ((this$businessId == null) ? (other$businessId != null) : !this$businessId.equals(other$businessId))
return false;
Object this$deviceId = getDeviceId(), other$deviceId = other.getDeviceId();
if ((this$deviceId == null) ? (other$deviceId != null) : !this$deviceId.equals(other$deviceId))
return false;
Object this$deviceCode = getDeviceCode(), other$deviceCode = other.getDeviceCode();
if ((this$deviceCode == null) ? (other$deviceCode != null) : !this$deviceCode.equals(other$deviceCode))
return false;
Object this$deviceName = getDeviceName(), other$deviceName = other.getDeviceName();
if ((this$deviceName == null) ? (other$deviceName != null) : !this$deviceName.equals(other$deviceName))
return false;
Object this$deviceTypeName = getDeviceTypeName(), other$deviceTypeName = other.getDeviceTypeName();
if ((this$deviceTypeName == null) ? (other$deviceTypeName != null)
: !this$deviceTypeName.equals(other$deviceTypeName))
return false;
Object this$elevatorFloorList = getElevatorFloorList(), other$elevatorFloorList = other.getElevatorFloorList();
if ((this$elevatorFloorList == null) ? (other$elevatorFloorList != null)
: !this$elevatorFloorList.equals(other$elevatorFloorList))
return false;
Object this$currentFloorId = getCurrentFloorId(), other$currentFloorId = other.getCurrentFloorId();
if ((this$currentFloorId == null) ? (other$currentFloorId != null)
: !this$currentFloorId.equals(other$currentFloorId))
return false;
Object this$currentFloor = getCurrentFloor(), other$currentFloor = other.getCurrentFloor();
if ((this$currentFloor == null) ? (other$currentFloor != null) : !this$currentFloor.equals(other$currentFloor))
return false;
Object this$currentBuilding = getCurrentBuilding(), other$currentBuilding = other.getCurrentBuilding();
if ((this$currentBuilding == null) ? (other$currentBuilding != null)
: !this$currentBuilding.equals(other$currentBuilding))
return false;
Object this$currentBuildingId = getCurrentBuildingId(), other$currentBuildingId = other.getCurrentBuildingId();
if ((this$currentBuildingId == null) ? (other$currentBuildingId != null)
: !this$currentBuildingId.equals(other$currentBuildingId))
return false;
Object this$areaName = getAreaName(), other$areaName = other.getAreaName();
if ((this$areaName == null) ? (other$areaName != null) : !this$areaName.equals(other$areaName))
return false;
Object this$status = getStatus(), other$status = other.getStatus();
return !((this$status == null) ? (other$status != null) : !this$status.equals(other$status));
}
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
protected boolean canEqual(Object other) {
return other instanceof AcsElevatorDeviceListResultDto;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $businessId = getBusinessId();
result = result * 59 + (($businessId == null) ? 43 : $businessId.hashCode());
Object $deviceId = getDeviceId();
result = result * 59 + (($deviceId == null) ? 43 : $deviceId.hashCode());
Object $deviceCode = getDeviceCode();
result = result * 59 + (($deviceCode == null) ? 43 : $deviceCode.hashCode());
Object $deviceName = getDeviceName();
result = result * 59 + (($deviceName == null) ? 43 : $deviceName.hashCode());
Object $deviceTypeName = getDeviceTypeName();
result = result * 59 + (($deviceTypeName == null) ? 43 : $deviceTypeName.hashCode());
Object $elevatorFloorList = getElevatorFloorList();
result = result * 59 + (($elevatorFloorList == null) ? 43 : $elevatorFloorList.hashCode());
Object $currentFloorId = getCurrentFloorId();
result = result * 59 + (($currentFloorId == null) ? 43 : $currentFloorId.hashCode());
Object $currentFloor = getCurrentFloor();
result = result * 59 + (($currentFloor == null) ? 43 : $currentFloor.hashCode());
Object $currentBuilding = getCurrentBuilding();
result = result * 59 + (($currentBuilding == null) ? 43 : $currentBuilding.hashCode());
Object $currentBuildingId = getCurrentBuildingId();
result = result * 59 + (($currentBuildingId == null) ? 43 : $currentBuildingId.hashCode());
Object $areaName = getAreaName();
result = result * 59 + (($areaName == null) ? 43 : $areaName.hashCode());
Object $status = getStatus();
return result * 59 + (($status == null) ? 43 : $status.hashCode());
}
public String toString() {
return "AcsElevatorDeviceListResultDto(businessId=" + getBusinessId() + ", deviceId=" + getDeviceId()
+ ", deviceCode=" + getDeviceCode() + ", deviceName=" + getDeviceName() + ", deviceTypeName="
+ getDeviceTypeName() + ", elevatorFloorList=" + getElevatorFloorList() + ", currentFloorId="
+ getCurrentFloorId() + ", currentFloor=" + getCurrentFloor() + ", currentBuilding=" + getCurrentBuilding()
+ ", currentBuildingId=" + getCurrentBuildingId() + ", areaName=" + getAreaName() + ", status="
+ getStatus() + ")";
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
@@ -0,0 +1,16 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class AcsElevatorDeviceQueryByIdDTO extends CloudwalkBasePageForm implements Serializable {
private String id;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
}
@@ -0,0 +1,99 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import java.util.List;
public class AcsElevatorDeviceQueryDTO extends CloudwalkBaseTimes implements Serializable {
private static final long serialVersionUID = -761586737506722816L;
private String areaName;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private List<String> areaIds;
private String deviceId;
private String businessId;
private String ip;
private Integer status;
private Integer onlineStatus;
public String getIp() {
return this.ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getOnlineStatus() {
return this.onlineStatus;
}
public void setOnlineStatus(Integer onlineStatus) {
this.onlineStatus = onlineStatus;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<String> getAreaIds() {
return this.areaIds;
}
public void setAreaIds(List<String> areaIds) {
this.areaIds = areaIds;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
}
@@ -0,0 +1,235 @@
package cn.cloudwalk.elevator.device.dto;
public class AcsElevatorDeviceQueryFoDTO {
private String id;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
public void setId(String id) {
this.id = id;
}
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private String areaId;
private String elevatorFloorIdList;
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsElevatorDeviceQueryFoDTO))
return false;
AcsElevatorDeviceQueryFoDTO other = (AcsElevatorDeviceQueryFoDTO)o;
if (!other.canEqual(this))
return false;
Object this$id = getId(), other$id = other.getId();
if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id))
return false;
Object this$businessId = getBusinessId(), other$businessId = other.getBusinessId();
if ((this$businessId == null) ? (other$businessId != null) : !this$businessId.equals(other$businessId))
return false;
Object this$deviceId = getDeviceId(), other$deviceId = other.getDeviceId();
if ((this$deviceId == null) ? (other$deviceId != null) : !this$deviceId.equals(other$deviceId))
return false;
Object this$deviceCode = getDeviceCode(), other$deviceCode = other.getDeviceCode();
if ((this$deviceCode == null) ? (other$deviceCode != null) : !this$deviceCode.equals(other$deviceCode))
return false;
Object this$deviceName = getDeviceName(), other$deviceName = other.getDeviceName();
if ((this$deviceName == null) ? (other$deviceName != null) : !this$deviceName.equals(other$deviceName))
return false;
Object this$deviceTypeName = getDeviceTypeName(), other$deviceTypeName = other.getDeviceTypeName();
if ((this$deviceTypeName == null) ? (other$deviceTypeName != null)
: !this$deviceTypeName.equals(other$deviceTypeName))
return false;
Object this$elevatorFloorList = getElevatorFloorList(), other$elevatorFloorList = other.getElevatorFloorList();
if ((this$elevatorFloorList == null) ? (other$elevatorFloorList != null)
: !this$elevatorFloorList.equals(other$elevatorFloorList))
return false;
Object this$currentFloorId = getCurrentFloorId(), other$currentFloorId = other.getCurrentFloorId();
if ((this$currentFloorId == null) ? (other$currentFloorId != null)
: !this$currentFloorId.equals(other$currentFloorId))
return false;
Object this$currentFloor = getCurrentFloor(), other$currentFloor = other.getCurrentFloor();
if ((this$currentFloor == null) ? (other$currentFloor != null) : !this$currentFloor.equals(other$currentFloor))
return false;
Object this$currentBuilding = getCurrentBuilding(), other$currentBuilding = other.getCurrentBuilding();
if ((this$currentBuilding == null) ? (other$currentBuilding != null)
: !this$currentBuilding.equals(other$currentBuilding))
return false;
Object this$currentBuildingId = getCurrentBuildingId(), other$currentBuildingId = other.getCurrentBuildingId();
if ((this$currentBuildingId == null) ? (other$currentBuildingId != null)
: !this$currentBuildingId.equals(other$currentBuildingId))
return false;
Object this$areaName = getAreaName(), other$areaName = other.getAreaName();
if ((this$areaName == null) ? (other$areaName != null) : !this$areaName.equals(other$areaName))
return false;
Object this$areaId = getAreaId(), other$areaId = other.getAreaId();
if ((this$areaId == null) ? (other$areaId != null) : !this$areaId.equals(other$areaId))
return false;
Object this$elevatorFloorIdList = getElevatorFloorIdList(),
other$elevatorFloorIdList = other.getElevatorFloorIdList();
return !((this$elevatorFloorIdList == null) ? (other$elevatorFloorIdList != null)
: !this$elevatorFloorIdList.equals(other$elevatorFloorIdList));
}
protected boolean canEqual(Object other) {
return other instanceof AcsElevatorDeviceQueryFoDTO;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $id = getId();
result = result * 59 + (($id == null) ? 43 : $id.hashCode());
Object $businessId = getBusinessId();
result = result * 59 + (($businessId == null) ? 43 : $businessId.hashCode());
Object $deviceId = getDeviceId();
result = result * 59 + (($deviceId == null) ? 43 : $deviceId.hashCode());
Object $deviceCode = getDeviceCode();
result = result * 59 + (($deviceCode == null) ? 43 : $deviceCode.hashCode());
Object $deviceName = getDeviceName();
result = result * 59 + (($deviceName == null) ? 43 : $deviceName.hashCode());
Object $deviceTypeName = getDeviceTypeName();
result = result * 59 + (($deviceTypeName == null) ? 43 : $deviceTypeName.hashCode());
Object $elevatorFloorList = getElevatorFloorList();
result = result * 59 + (($elevatorFloorList == null) ? 43 : $elevatorFloorList.hashCode());
Object $currentFloorId = getCurrentFloorId();
result = result * 59 + (($currentFloorId == null) ? 43 : $currentFloorId.hashCode());
Object $currentFloor = getCurrentFloor();
result = result * 59 + (($currentFloor == null) ? 43 : $currentFloor.hashCode());
Object $currentBuilding = getCurrentBuilding();
result = result * 59 + (($currentBuilding == null) ? 43 : $currentBuilding.hashCode());
Object $currentBuildingId = getCurrentBuildingId();
result = result * 59 + (($currentBuildingId == null) ? 43 : $currentBuildingId.hashCode());
Object $areaName = getAreaName();
result = result * 59 + (($areaName == null) ? 43 : $areaName.hashCode());
Object $areaId = getAreaId();
result = result * 59 + (($areaId == null) ? 43 : $areaId.hashCode());
Object $elevatorFloorIdList = getElevatorFloorIdList();
return result * 59 + (($elevatorFloorIdList == null) ? 43 : $elevatorFloorIdList.hashCode());
}
public String toString() {
return "AcsElevatorDeviceQueryFoDTO(id=" + getId() + ", businessId=" + getBusinessId() + ", deviceId="
+ getDeviceId() + ", deviceCode=" + getDeviceCode() + ", deviceName=" + getDeviceName()
+ ", deviceTypeName=" + getDeviceTypeName() + ", elevatorFloorList=" + getElevatorFloorList()
+ ", currentFloorId=" + getCurrentFloorId() + ", currentFloor=" + getCurrentFloor() + ", currentBuilding="
+ getCurrentBuilding() + ", currentBuildingId=" + getCurrentBuildingId() + ", areaName=" + getAreaName()
+ ", areaId=" + getAreaId() + ", elevatorFloorIdList=" + getElevatorFloorIdList() + ")";
}
public String getId() {
return this.id;
}
public String getBusinessId() {
return this.businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public String getAreaName() {
return this.areaName;
}
public String getAreaId() {
return this.areaId;
}
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
}
@@ -0,0 +1,30 @@
package cn.cloudwalk.elevator.device.dto;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsElevatorDeviceQueryResultDTO extends CloudwalkBaseTimes implements Serializable {
private static final long serialVersionUID = -761586737506722816L;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private Integer status;
}
@@ -0,0 +1,323 @@
package cn.cloudwalk.elevator.device.dto;
public class AcsElevatorDeviceResultDTO {
private String id;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
public void setId(String id) {
this.id = id;
}
private String currentBuildingId;
private String areaName;
private String areaId;
private Integer status;
private String statusString;
private String elevatorFloorIdList;
private Long lastHeartbeatTime;
private String imageStoreId;
private String ip;
private Integer onlineStatus;
public void setIp(String ip) {
this.ip = ip;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsElevatorDeviceResultDTO))
return false;
AcsElevatorDeviceResultDTO other = (AcsElevatorDeviceResultDTO)o;
if (!other.canEqual(this))
return false;
Object this$id = getId(), other$id = other.getId();
if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id))
return false;
Object this$businessId = getBusinessId(), other$businessId = other.getBusinessId();
if ((this$businessId == null) ? (other$businessId != null) : !this$businessId.equals(other$businessId))
return false;
Object this$deviceId = getDeviceId(), other$deviceId = other.getDeviceId();
if ((this$deviceId == null) ? (other$deviceId != null) : !this$deviceId.equals(other$deviceId))
return false;
Object this$deviceCode = getDeviceCode(), other$deviceCode = other.getDeviceCode();
if ((this$deviceCode == null) ? (other$deviceCode != null) : !this$deviceCode.equals(other$deviceCode))
return false;
Object this$deviceName = getDeviceName(), other$deviceName = other.getDeviceName();
if ((this$deviceName == null) ? (other$deviceName != null) : !this$deviceName.equals(other$deviceName))
return false;
Object this$deviceTypeName = getDeviceTypeName(), other$deviceTypeName = other.getDeviceTypeName();
if ((this$deviceTypeName == null) ? (other$deviceTypeName != null)
: !this$deviceTypeName.equals(other$deviceTypeName))
return false;
Object this$elevatorFloorList = getElevatorFloorList(), other$elevatorFloorList = other.getElevatorFloorList();
if ((this$elevatorFloorList == null) ? (other$elevatorFloorList != null)
: !this$elevatorFloorList.equals(other$elevatorFloorList))
return false;
Object this$currentFloorId = getCurrentFloorId(), other$currentFloorId = other.getCurrentFloorId();
if ((this$currentFloorId == null) ? (other$currentFloorId != null)
: !this$currentFloorId.equals(other$currentFloorId))
return false;
Object this$currentFloor = getCurrentFloor(), other$currentFloor = other.getCurrentFloor();
if ((this$currentFloor == null) ? (other$currentFloor != null) : !this$currentFloor.equals(other$currentFloor))
return false;
Object this$currentBuilding = getCurrentBuilding(), other$currentBuilding = other.getCurrentBuilding();
if ((this$currentBuilding == null) ? (other$currentBuilding != null)
: !this$currentBuilding.equals(other$currentBuilding))
return false;
Object this$currentBuildingId = getCurrentBuildingId(), other$currentBuildingId = other.getCurrentBuildingId();
if ((this$currentBuildingId == null) ? (other$currentBuildingId != null)
: !this$currentBuildingId.equals(other$currentBuildingId))
return false;
Object this$areaName = getAreaName(), other$areaName = other.getAreaName();
if ((this$areaName == null) ? (other$areaName != null) : !this$areaName.equals(other$areaName))
return false;
Object this$areaId = getAreaId(), other$areaId = other.getAreaId();
if ((this$areaId == null) ? (other$areaId != null) : !this$areaId.equals(other$areaId))
return false;
Object this$status = getStatus(), other$status = other.getStatus();
if ((this$status == null) ? (other$status != null) : !this$status.equals(other$status))
return false;
Object this$statusString = getStatusString(), other$statusString = other.getStatusString();
if ((this$statusString == null) ? (other$statusString != null) : !this$statusString.equals(other$statusString))
return false;
Object this$elevatorFloorIdList = getElevatorFloorIdList(),
other$elevatorFloorIdList = other.getElevatorFloorIdList();
if ((this$elevatorFloorIdList == null) ? (other$elevatorFloorIdList != null)
: !this$elevatorFloorIdList.equals(other$elevatorFloorIdList))
return false;
Object this$lastHeartbeatTime = getLastHeartbeatTime(), other$lastHeartbeatTime = other.getLastHeartbeatTime();
if ((this$lastHeartbeatTime == null) ? (other$lastHeartbeatTime != null)
: !this$lastHeartbeatTime.equals(other$lastHeartbeatTime))
return false;
Object this$imageStoreId = getImageStoreId(), other$imageStoreId = other.getImageStoreId();
if ((this$imageStoreId == null) ? (other$imageStoreId != null) : !this$imageStoreId.equals(other$imageStoreId))
return false;
Object this$ip = getIp(), other$ip = other.getIp();
if ((this$ip == null) ? (other$ip != null) : !this$ip.equals(other$ip))
return false;
Object this$onlineStatus = getOnlineStatus(), other$onlineStatus = other.getOnlineStatus();
return !((this$onlineStatus == null) ? (other$onlineStatus != null)
: !this$onlineStatus.equals(other$onlineStatus));
}
protected boolean canEqual(Object other) {
return other instanceof AcsElevatorDeviceResultDTO;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $id = getId();
result = result * 59 + (($id == null) ? 43 : $id.hashCode());
Object $businessId = getBusinessId();
result = result * 59 + (($businessId == null) ? 43 : $businessId.hashCode());
Object $deviceId = getDeviceId();
result = result * 59 + (($deviceId == null) ? 43 : $deviceId.hashCode());
Object $deviceCode = getDeviceCode();
result = result * 59 + (($deviceCode == null) ? 43 : $deviceCode.hashCode());
Object $deviceName = getDeviceName();
result = result * 59 + (($deviceName == null) ? 43 : $deviceName.hashCode());
Object $deviceTypeName = getDeviceTypeName();
result = result * 59 + (($deviceTypeName == null) ? 43 : $deviceTypeName.hashCode());
Object $elevatorFloorList = getElevatorFloorList();
result = result * 59 + (($elevatorFloorList == null) ? 43 : $elevatorFloorList.hashCode());
Object $currentFloorId = getCurrentFloorId();
result = result * 59 + (($currentFloorId == null) ? 43 : $currentFloorId.hashCode());
Object $currentFloor = getCurrentFloor();
result = result * 59 + (($currentFloor == null) ? 43 : $currentFloor.hashCode());
Object $currentBuilding = getCurrentBuilding();
result = result * 59 + (($currentBuilding == null) ? 43 : $currentBuilding.hashCode());
Object $currentBuildingId = getCurrentBuildingId();
result = result * 59 + (($currentBuildingId == null) ? 43 : $currentBuildingId.hashCode());
Object $areaName = getAreaName();
result = result * 59 + (($areaName == null) ? 43 : $areaName.hashCode());
Object $areaId = getAreaId();
result = result * 59 + (($areaId == null) ? 43 : $areaId.hashCode());
Object $status = getStatus();
result = result * 59 + (($status == null) ? 43 : $status.hashCode());
Object $statusString = getStatusString();
result = result * 59 + (($statusString == null) ? 43 : $statusString.hashCode());
Object $elevatorFloorIdList = getElevatorFloorIdList();
result = result * 59 + (($elevatorFloorIdList == null) ? 43 : $elevatorFloorIdList.hashCode());
Object $lastHeartbeatTime = getLastHeartbeatTime();
result = result * 59 + (($lastHeartbeatTime == null) ? 43 : $lastHeartbeatTime.hashCode());
Object $imageStoreId = getImageStoreId();
result = result * 59 + (($imageStoreId == null) ? 43 : $imageStoreId.hashCode());
Object $ip = getIp();
result = result * 59 + (($ip == null) ? 43 : $ip.hashCode());
Object $onlineStatus = getOnlineStatus();
return result * 59 + (($onlineStatus == null) ? 43 : $onlineStatus.hashCode());
}
public String toString() {
return "AcsElevatorDeviceResultDTO(id=" + getId() + ", businessId=" + getBusinessId() + ", deviceId="
+ getDeviceId() + ", deviceCode=" + getDeviceCode() + ", deviceName=" + getDeviceName()
+ ", deviceTypeName=" + getDeviceTypeName() + ", elevatorFloorList=" + getElevatorFloorList()
+ ", currentFloorId=" + getCurrentFloorId() + ", currentFloor=" + getCurrentFloor() + ", currentBuilding="
+ getCurrentBuilding() + ", currentBuildingId=" + getCurrentBuildingId() + ", areaName=" + getAreaName()
+ ", areaId=" + getAreaId() + ", status=" + getStatus() + ", statusString=" + getStatusString()
+ ", elevatorFloorIdList=" + getElevatorFloorIdList() + ", lastHeartbeatTime=" + getLastHeartbeatTime()
+ ", imageStoreId=" + getImageStoreId() + ", ip=" + getIp() + ", onlineStatus=" + getOnlineStatus() + ")";
}
public String getId() {
return this.id;
}
public String getIp() {
return this.ip;
}
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getLastHeartbeatTime() {
return this.lastHeartbeatTime;
}
public void setLastHeartbeatTime(Long lastHeartbeatTime) {
this.lastHeartbeatTime = lastHeartbeatTime;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getStatusString() {
return this.statusString;
}
public void setStatusString(String statusString) {
this.statusString = statusString;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public Integer getOnlineStatus() {
return this.onlineStatus;
}
public void setOnlineStatus(Integer onlineStatus) {
this.onlineStatus = onlineStatus;
}
}
@@ -0,0 +1,30 @@
package cn.cloudwalk.elevator.device.impl;
import cn.cloudwalk.elevator.device.dao.AcsDeviceTaskDao;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
import cn.cloudwalk.elevator.device.mapper.AcsDeviceTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class AcsDeviceTaskDaoImpl implements AcsDeviceTaskDao {
@Autowired
private AcsDeviceTaskMapper acsDeviceTaskMapper;
public Integer insert(AcsDeviceTaskAddDto dto) {
return this.acsDeviceTaskMapper.insert(dto);
}
public Integer updateBingDevices(AcsDeviceTaskAddDto dto) {
return this.acsDeviceTaskMapper.updateBingDevices(dto);
}
public Integer updateIsStop(AcsDeviceTaskAddDto dto) {
return this.acsDeviceTaskMapper.updateIsStop(dto);
}
public AcsDeviceTaskDTO getById(String taskId) {
return this.acsDeviceTaskMapper.getById(taskId);
}
}
@@ -0,0 +1,282 @@
package cn.cloudwalk.elevator.device.impl;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.DataAccessException;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.common.AbstractAcsDeviceService;
import cn.cloudwalk.elevator.device.dao.AcsDeviceTaskDao;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
import cn.cloudwalk.elevator.device.param.AcsRestructureBindingParam;
import cn.cloudwalk.elevator.device.service.AcsDeviceTaskService;
import cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleDeleteDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleDeleteParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleNewParam;
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
import cn.cloudwalk.elevator.passrule.service.ImageRuleRefService;
import cn.cloudwalk.elevator.person.param.AcsPersonAddParam;
import cn.cloudwalk.elevator.person.param.AcsPersonDeleteParam;
import cn.cloudwalk.elevator.person.service.PersonRuleService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
/**
* 设备异步任务:推进绑定进度、按楼层增删人员/规则;{@code updateFloors} 在楼层维度使用有界线程池并行远程调用,并按 Future 完成顺序推进
* {@code bindDevices},与走查约定 §9 一致。
*/
@Service
public class AcsDeviceTaskServiceImpl extends AbstractAcsDeviceService implements AcsDeviceTaskService {
/** 单次并发执行的楼层数上限,与 {@code elevatorRemoteBoundedExecutor} 池容量配合,避免对下游突发压测。 */
private static final int UPDATE_FLOORS_FLOOR_PARALLEL = 6;
@Autowired
private PersonRuleService personRuleService;
@Autowired
private ImageRuleRefService imageRuleRefService;
@Resource
private AcsDeviceTaskDao acsDeviceTaskDao;
@Resource
private ImageRuleRefDao imageRuleRefDao;
@Autowired
@Qualifier("elevatorRemoteBoundedExecutor")
private ThreadPoolTaskExecutor elevatorRemoteBoundedExecutor;
@Async("updateFloorsExecutor")
public void updateFloors(AcsRestructureBindingParam param, List<AcsPassRuleImageResultDto> addFloors,
List<String> delFloorIds, CloudwalkCallContext context) throws ServiceException {
try {
if (!CollectionUtils.isEmpty(addFloors)) {
runAddFloorsInBoundedParallel(param, addFloors, context);
}
if (!CollectionUtils.isEmpty(delFloorIds)) {
List<AcsPassRuleImageResultDto> ruleList = this.imageRuleRefDao.listZoneInfoByIds(delFloorIds);
Map<String, String> ruleMap = new HashMap<>();
ruleList.forEach(rule -> ruleMap.put(rule.getZoneId(), rule.getZoneName()));
runDelFloorsInBoundedParallel(param, delFloorIds, ruleMap, context);
}
} catch (Exception e) {
this.logger.error("处理设备任务失败,失败原因:{}", e);
if (e instanceof ServiceException) {
throw (ServiceException)e;
}
throw new ServiceException(e.getMessage());
}
}
/**
* 约定 §3.5:楼层级有界并行发起远程调用;本方法内按原列表顺序 {@code get()} Future
* 与串行时一致地「每成功一层 → 重读任务行并 BIND_DEVICES+1」。
*/
private void runAddFloorsInBoundedParallel(AcsRestructureBindingParam param, List<AcsPassRuleImageResultDto> addFloors,
CloudwalkCallContext context) throws ServiceException {
for (int i = 0; i < addFloors.size(); i += UPDATE_FLOORS_FLOOR_PARALLEL) {
int end = Math.min(i + UPDATE_FLOORS_FLOOR_PARALLEL, addFloors.size());
List<Callable<Integer>> batch = new ArrayList<>();
for (int j = i; j < end; j++) {
final AcsPassRuleImageResultDto addFloor = addFloors.get(j);
batch.add(
() -> FeignThreadLocalUtil.callWithContext(context, () -> addOneFloorStep(addFloor, param, context)));
}
List<Future<Integer>> futures;
try {
futures = this.elevatorRemoteBoundedExecutor.getThreadPoolExecutor().invokeAll(batch);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ServiceException("76260540", "updateFloors 被中断");
}
for (Future<Integer> f : futures) {
int inc;
try {
inc = f.get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ServiceException("76260540", "updateFloors 被中断");
} catch (ExecutionException e) {
Throwable c = e.getCause();
if (c instanceof ServiceException) {
throw (ServiceException)c;
}
throw new ServiceException(c != null ? c.getMessage() : e.getMessage());
}
if (inc > 0) {
advanceBindProgressOne(param.getTaskId());
}
}
}
}
private void runDelFloorsInBoundedParallel(AcsRestructureBindingParam param, List<String> delFloorIds,
Map<String, String> ruleMap, CloudwalkCallContext context) throws ServiceException {
for (int i = 0; i < delFloorIds.size(); i += UPDATE_FLOORS_FLOOR_PARALLEL) {
int end = Math.min(i + UPDATE_FLOORS_FLOOR_PARALLEL, delFloorIds.size());
List<Callable<Integer>> batch = new ArrayList<>();
for (int j = i; j < end; j++) {
final String delFloorId = delFloorIds.get(j);
batch.add(
() -> FeignThreadLocalUtil.callWithContext(context, () -> delOneFloorStep(delFloorId, param, ruleMap, context)));
}
List<Future<Integer>> futures;
try {
futures = this.elevatorRemoteBoundedExecutor.getThreadPoolExecutor().invokeAll(batch);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ServiceException("76260540", "updateFloors 被中断");
}
for (Future<Integer> f : futures) {
int inc;
try {
inc = f.get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ServiceException("76260540", "updateFloors 被中断");
} catch (ExecutionException e) {
Throwable c = e.getCause();
if (c instanceof ServiceException) {
throw (ServiceException)c;
}
throw new ServiceException(c != null ? c.getMessage() : e.getMessage());
}
if (inc > 0) {
advanceBindProgressOne(param.getTaskId());
}
}
}
}
private void advanceBindProgressOne(String taskId) throws ServiceException {
AcsDeviceTaskDTO task = this.acsDeviceTaskDao.getById(taskId);
if (task == null) {
this.logger.error("updateFloors 任务不存在 taskId={}", taskId);
throw new ServiceException("设备任务不存在");
}
AcsDeviceTaskAddDto addDto = new AcsDeviceTaskAddDto();
addDto.setId(task.getId());
addDto.setBindDevices(Integer.valueOf(task.getBindDevices().intValue() + 1));
this.acsDeviceTaskDao.updateBingDevices(addDto);
}
/**
* @return 1 本层已执行远程步骤且应推进 bind 计数;0 任务已停止跳过
*/
private int addOneFloorStep(AcsPassRuleImageResultDto addFloor, AcsRestructureBindingParam param,
CloudwalkCallContext context) throws ServiceException {
AcsDeviceTaskDTO task = this.acsDeviceTaskDao.getById(param.getTaskId());
if (task == null) {
this.logger.error("updateFloors 任务不存在 taskId={}", param.getTaskId());
throw new ServiceException("设备任务不存在");
}
if (task.getIsStop().intValue() != 0) {
return 0;
}
if (!ObjectUtils.isEmpty(param.getPersonId())) {
AcsPersonAddParam addParam = new AcsPersonAddParam();
addParam.setPersonIds(Collections.singletonList(param.getPersonId()));
addParam.setParentId(param.getParentId());
addParam.setZoneId(addFloor.getZoneId());
addParam.setZoneName(addFloor.getZoneName());
CloudwalkResult<Boolean> addResult = this.personRuleService.add(addParam, context);
requireTaskStepSuccess(addResult, "personRuleService.add");
} else {
AcsPassRuleNewParam ruleParam = new AcsPassRuleNewParam();
ruleParam.setParentId(param.getParentId());
ruleParam.setZoneId(addFloor.getZoneId());
ruleParam.setZoneName(addFloor.getZoneName());
if (!ObjectUtils.isEmpty(param.getLabelId())) {
ruleParam.setIncludeLabels(Collections.singletonList(param.getLabelId()));
ruleParam.setRuleName(addFloor.getZoneName() + param.getLabelName());
}
if (!ObjectUtils.isEmpty(param.getOrgId())) {
ruleParam.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
ruleParam.setRuleName(addFloor.getZoneName() + param.getOrgName());
}
CloudwalkResult<Boolean> addRuleResult = this.imageRuleRefService.addOnlyRule(ruleParam, context);
requireTaskStepSuccess(addRuleResult, "imageRuleRefService.addOnlyRule");
}
return 1;
}
private int delOneFloorStep(String delFloorId, AcsRestructureBindingParam param, Map<String, String> ruleMap,
CloudwalkCallContext context) throws ServiceException {
AcsDeviceTaskDTO task = this.acsDeviceTaskDao.getById(param.getTaskId());
if (task == null) {
this.logger.error("updateFloors 任务不存在 taskId={}", param.getTaskId());
throw new ServiceException("设备任务不存在");
}
if (task.getIsStop().intValue() != 0) {
return 0;
}
if (!ObjectUtils.isEmpty(param.getPersonId())) {
AcsPersonDeleteParam delParam = new AcsPersonDeleteParam();
delParam.setParentId(param.getParentId());
delParam.setZoneId(delFloorId);
delParam.setPersonIds(Collections.singletonList(param.getPersonId()));
CloudwalkResult<Boolean> delResult = this.personRuleService.delete(delParam, context);
requireTaskStepSuccess(delResult, "personRuleService.delete");
} else {
String baseName = ruleMap.getOrDefault(delFloorId, "");
String ruleName = "";
if (!ObjectUtils.isEmpty(param.getLabelName())) {
ruleName = baseName + param.getLabelName();
}
if (!ObjectUtils.isEmpty(param.getOrgName())) {
ruleName = baseName + param.getOrgName();
}
String ruleId;
try {
ruleId = this.imageRuleRefDao.getByRuleName(ruleName, delFloorId);
} catch (DataAccessException e) {
this.logger.error("updateFloors getByRuleName 失败 delFloorId={} {}", delFloorId, e.getMessage());
throw new ServiceException("76260540", e.getMessage());
}
if (!ObjectUtils.isEmpty(ruleId)) {
AcsPassRuleDeleteParam deleteParam = new AcsPassRuleDeleteParam();
deleteParam.setIds(Collections.singletonList(ruleId));
deleteParam.setZoneId(delFloorId);
deleteParam.setParentId(param.getParentId());
CloudwalkResult<Boolean> delRuleResult = this.imageRuleRefService.delete(deleteParam, context);
requireTaskStepSuccess(delRuleResult, "imageRuleRefService.delete");
} else {
AcsPassRuleDeleteDto dto = new AcsPassRuleDeleteDto();
dto.setZoneId(delFloorId);
dto.setLabelId(param.getLabelId());
dto.setOrgId(param.getOrgId());
try {
this.imageRuleRefDao.deleteByOrgAndLabel(dto);
} catch (DataAccessException e) {
this.logger.error("updateFloors deleteByOrgAndLabel 失败 delFloorId={} {}", delFloorId, e.getMessage());
throw new ServiceException("76260540", e.getMessage());
}
}
}
return 1;
}
/**
* 约定 §2.2:异步任务内对业务服务返回的 {@link CloudwalkResult} 须校验成功后再推进进度(避免失败仍递增 bindDevices)。
*/
private void requireTaskStepSuccess(CloudwalkResult<?> result, String op) throws ServiceException {
if (result == null || !result.isSuccess()) {
String code = result != null ? result.getCode() : "76260540";
String msg = result != null ? result.getMessage() : op + " 返回为空";
this.logger.error("updateFloors 步骤失败 op={} code={} msg={}", op, code, msg);
throw new ServiceException(code, msg);
}
}
}
@@ -0,0 +1,121 @@
package cn.cloudwalk.elevator.device.impl;
import cn.cloudwalk.cloud.exception.DataAccessException;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceAddDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceEditDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryByIdDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
import cn.cloudwalk.elevator.device.mapper.AcsElevatorDeviceMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import java.util.List;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
@Repository
public class AcsElevatorDeviceDaoImpl implements AcsElevatorDeviceDao {
@Resource
private AcsElevatorDeviceMapper acsElevatorDeviceMapper;
protected final Logger logger = LoggerFactory.getLogger(getClass());
public Integer add(AcsElevatorDeviceAddDTO dto) throws DataAccessException {
try {
return Integer.valueOf(this.acsElevatorDeviceMapper.add(dto));
} catch (Exception e) {
this.logger.error("保存派梯设备信息失败,原因:", e);
throw new DataAccessException(e);
}
}
public Integer edit(AcsElevatorDeviceEditDTO dto) throws DataAccessException {
try {
return Integer.valueOf(this.acsElevatorDeviceMapper.edit(dto));
} catch (Exception e) {
this.logger.error("保存派梯设备信息失败,原因:", e);
throw new DataAccessException(e);
}
}
public Integer delete(List<String> ids) throws DataAccessException {
try {
return Integer.valueOf(this.acsElevatorDeviceMapper.delete(ids));
} catch (Exception e) {
this.logger.error("删除派梯设备信息失败,原因:", e);
throw new DataAccessException(e);
}
}
public CloudwalkPageAble<AcsElevatorDeviceResultDTO> page(AcsElevatorDeviceQueryDTO dto, CloudwalkPageInfo page)
throws DataAccessException {
try {
PageHelper.startPage(page.getCurrentPage(), page.getPageSize());
Page<AcsElevatorDeviceResultDTO> result =
(Page<AcsElevatorDeviceResultDTO>)this.acsElevatorDeviceMapper.page(dto);
return new CloudwalkPageAble(BeanCopyUtils.copy(result.getResult(), AcsElevatorDeviceResultDTO.class), page,
result.getTotal());
} catch (Exception e) {
this.logger.error("设备分页查询失败,原因:", e);
throw new DataAccessException(e);
}
}
public List<AcsElevatorDeviceResultDTO> listByZoneId(AcsElevatorDeviceListDto dto) throws DataAccessException {
try {
return this.acsElevatorDeviceMapper.listByZoneId(dto);
} catch (Exception e) {
this.logger.error("根据楼层id获取设备信息失败,原因:", e);
throw new DataAccessException(e);
}
}
public List<AcsElevatorDeviceResultDTO> listByZoneIds(AcsElevatorDeviceListDto dto) throws DataAccessException {
try {
return this.acsElevatorDeviceMapper.listByZoneIds(dto);
} catch (Exception e) {
this.logger.error("根据楼层id集合获取设备信息失败,原因:", e);
throw new DataAccessException(e);
}
}
public List<AcsElevatorDeviceResultDTO> listBuBuildingId(AcsElevatorDeviceListByBuildingIdDto dto)
throws DataAccessException {
try {
return this.acsElevatorDeviceMapper.listBuBuildingId(dto);
} catch (Exception e) {
this.logger.error("根据楼栋id获取设备信息失败,原因:", e);
throw new DataAccessException(e);
}
}
public List<AcsElevatorDeviceResultDTO> get(AcsElevatorDeviceQueryDTO dto) throws ServiceException {
return this.acsElevatorDeviceMapper.get(dto);
}
public AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdDTO dto) throws ServiceException {
return this.acsElevatorDeviceMapper.getById(dto);
}
public AcsElevatorDeviceResultDTO getByDeciveCode(String deviceCode) throws ServiceException {
AcsElevatorDeviceQueryDTO dto = new AcsElevatorDeviceQueryDTO();
dto.setDeviceCode(deviceCode);
return this.acsElevatorDeviceMapper.getByDeciveCode(dto);
}
public String getBuildingId(AcsElevatorDeviceQueryDTO dto) throws ServiceException {
return this.acsElevatorDeviceMapper.getBuildingId(dto);
}
public String getBusinessId(AcsElevatorDeviceQueryDTO dto) throws ServiceException {
return this.acsElevatorDeviceMapper.getBusinessId(dto);
}
}
@@ -0,0 +1,929 @@
package cn.cloudwalk.elevator.device.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceService;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreAddParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreDelParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonDetailParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.result.PersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService;
import cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.param.DeviceAreaTreeParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.result.AreaTreeResult;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.cacheable.AcsAreaTreeCacheableService;
import cn.cloudwalk.elevator.common.service.AcsApplicationService;
import cn.cloudwalk.elevator.device.dao.AcsDeviceTaskDao;
import cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao;
import cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceAddDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceEditDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryByIdDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryFoDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
import cn.cloudwalk.elevator.device.param.AcsDeviceQueryParam;
import cn.cloudwalk.elevator.device.param.AcsDeviceRestructureTaskParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceAddParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceEditParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceQueryByIdParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceQueryParam;
import cn.cloudwalk.elevator.device.param.AcsRestructureBindingParam;
import cn.cloudwalk.elevator.device.param.AcsRestructureQueryParam;
import cn.cloudwalk.elevator.device.result.AcsDeviceNewResult;
import cn.cloudwalk.elevator.device.result.AcsDeviceRestructureResult;
import cn.cloudwalk.elevator.device.result.AcsLabelElevatorResult;
import cn.cloudwalk.elevator.device.service.AcsDeviceTaskService;
import cn.cloudwalk.elevator.device.service.AcsElevatorDeviceService;
import cn.cloudwalk.elevator.device.setting.impl.AcsDeviceImageStoreAppBindServiceImpl;
import cn.cloudwalk.elevator.device.setting.param.DeviceImageStoreAppBindParam;
import cn.cloudwalk.elevator.device.setting.param.DeviceImageStoreAppUnbindParam;
import cn.cloudwalk.elevator.device.setting.service.AcsDeviceImageStoreAppBindService;
import cn.cloudwalk.elevator.passrule.dao.AcsPassRuleDao;
import cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleLabelResultDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto;
import cn.cloudwalk.elevator.passrule.impl.AbstractAcsPassService;
import cn.cloudwalk.elevator.passrule.service.AcsPassRuleService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import org.springframework.util.ObjectUtils;
@Repository
public class AcsElevatorDeviceServiceImpl extends AbstractAcsPassService implements AcsElevatorDeviceService {
@Value("${floor.building.id}")
private String floorBuildingId;
@Resource
private ImageStoreService imageStoreService;
@Resource
private AcsElevatorDeviceDao acsElevatorDeviceDao;
@Resource
private AcsPassRuleDao acsPassRuleDao;
@Resource
private ImageRuleRefDao imageRuleRefDao;
@Autowired
private AcsDeviceTaskService acsDeviceTaskService;
@Resource
private AcsDeviceTaskDao acsDeviceTaskDao;
@Resource
private DeviceImageStoreDao deviceImageStoreDao;
@Resource
private PersonService personService;
@Resource
private AcsDeviceImageStoreAppBindService acsDeviceImageStoreAppBindService;
@Resource
private AcsDeviceImageStoreAppBindServiceImpl acsDeviceImageStoreAppBindServiceImpl;
@Resource
private DeviceService deviceService;
@Autowired
private AcsApplicationService acsApplicationService;
@Resource
private AcsPassRuleService acsPassRuleService;
@Resource
private AcsAreaTreeCacheableService acsAreaTreeCacheableService;
protected final Logger logger = LoggerFactory.getLogger(getClass());
public Integer add(AcsElevatorDeviceAddParam param, CloudwalkCallContext context) throws ServiceException {
AcsElevatorDeviceAddDTO dto =
(AcsElevatorDeviceAddDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceAddDTO.class);
try {
Long createTime = Long.valueOf(System.currentTimeMillis());
dto.setCreateTime(createTime);
dto.setLastUpdateTime(createTime);
String currentBuildingId = dto.getCurrentBuildingId();
if (dto.getDeleteFlag() == null) {
dto.setDeleteFlag(Integer.valueOf(1));
}
if (StringUtils.isNotBlank(currentBuildingId)) {
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(currentBuildingId);
if (ObjectUtils.isEmpty(imageStoreId)) {
String bigImageStoreId = addImageStore(param, context);
this.deviceImageStoreDao.save(currentBuildingId, bigImageStoreId);
} else {
String applicationId =
this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId());
DeviceImageStoreAppBindParam bindParam = new DeviceImageStoreAppBindParam();
bindParam.setImageStoreId(imageStoreId);
bindParam.setDeviceId(param.getDeviceId());
bindParam.setApplicationId(applicationId);
this.acsDeviceImageStoreAppBindService.bindDeviceAndImageStore(bindParam, context);
}
}
return this.acsElevatorDeviceDao.add(dto);
} catch (Exception e) {
this.logger.error("保存派梯设备信息失败,原因:", e);
throw new ServiceException(e);
}
}
public Integer edit(AcsElevatorDeviceEditParam param, CloudwalkCallContext context) throws ServiceException {
AcsElevatorDeviceEditDTO dto =
(AcsElevatorDeviceEditDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceEditDTO.class);
try {
AcsElevatorDeviceQueryByIdDTO deviceQueryByIdDTO = new AcsElevatorDeviceQueryByIdDTO();
deviceQueryByIdDTO.setId(param.getId());
AcsElevatorDeviceResultDTO deviceResultDTO = this.acsElevatorDeviceDao.getById(deviceQueryByIdDTO);
String oldImageStoreId = this.deviceImageStoreDao.getByBuildingId(deviceResultDTO.getCurrentBuildingId());
if (deviceResultDTO != null && StringUtils.isNotBlank(deviceResultDTO.getCurrentFloorId())) {
if (!deviceResultDTO.getCurrentBuildingId().equals(param.getCurrentBuildingId())) {
String applicationId =
this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId());
DeviceImageStoreAppUnbindParam unbindParam = new DeviceImageStoreAppUnbindParam();
unbindParam.setApplicationId(applicationId);
unbindParam.setImageStoreId(oldImageStoreId);
unbindParam.setDeviceId(deviceResultDTO.getDeviceId());
unbindParam.setDeviceCode(deviceResultDTO.getDeviceCode());
this.acsDeviceImageStoreAppBindService.unbindAppImageStoreDeviceNotDeleteImage(unbindParam,
context);
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getCurrentBuildingId());
if (ObjectUtils.isEmpty(imageStoreId)) {
AcsElevatorDeviceAddParam addParam = (AcsElevatorDeviceAddParam)BeanCopyUtils
.copyProperties(param, AcsElevatorDeviceAddParam.class);
String bigImageStoreId = addImageStore(addParam, context);
this.deviceImageStoreDao.save(param.getCurrentBuildingId(), bigImageStoreId);
} else {
DeviceImageStoreAppBindParam bindParam = new DeviceImageStoreAppBindParam();
bindParam.setImageStoreId(imageStoreId);
bindParam.setDeviceId(deviceResultDTO.getDeviceId());
bindParam.setApplicationId(applicationId);
this.acsDeviceImageStoreAppBindService.bindDeviceAndImageStore(bindParam, context);
}
}
}
Long nowTime = Long.valueOf(System.currentTimeMillis());
dto.setLastUpdateTime(nowTime);
return this.acsElevatorDeviceDao.edit(dto);
} catch (Exception e) {
this.logger.error("更新派梯设备信息失败,原因:", e);
throw new ServiceException(e);
}
}
public Integer delete(List<String> ids, CloudwalkCallContext context) throws ServiceException {
try {
String applicationId = this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId());
for (String id : ids) {
AcsElevatorDeviceQueryByIdDTO byIdDTO = new AcsElevatorDeviceQueryByIdDTO();
byIdDTO.setId(id);
AcsElevatorDeviceResultDTO deviceResultDTO = this.acsElevatorDeviceDao.getById(byIdDTO);
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(deviceResultDTO.getCurrentBuildingId());
DeviceImageStoreAppUnbindParam unbindParam = new DeviceImageStoreAppUnbindParam();
unbindParam.setApplicationId(applicationId);
unbindParam.setImageStoreId(imageStoreId);
unbindParam.setDeviceId(deviceResultDTO.getDeviceId());
unbindParam.setDeviceCode(deviceResultDTO.getDeviceCode());
this.acsDeviceImageStoreAppBindService.unbindAppImageStoreDeviceNotDeleteImage(unbindParam, context);
}
int result = this.acsElevatorDeviceDao.delete(ids).intValue();
return Integer.valueOf(1);
} catch (Exception e) {
this.logger.error("更新派梯设备信息失败,原因:", e);
throw new ServiceException(e);
}
}
public String getBuildingId(AcsElevatorDeviceQueryParam param) throws ServiceException {
AcsElevatorDeviceQueryDTO dto =
(AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceQueryDTO.class);
return this.acsElevatorDeviceDao.getBuildingId(dto);
}
public String getBusinessId(AcsElevatorDeviceQueryParam param) throws ServiceException {
AcsElevatorDeviceQueryDTO dto =
(AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceQueryDTO.class);
return this.acsElevatorDeviceDao.getBusinessId(dto);
}
public CloudwalkResult<CloudwalkPageAble<AcsElevatorDeviceResultDTO>> get(AcsElevatorDeviceQueryParam param,
CloudwalkCallContext context) throws ServiceException {
AcsElevatorDeviceQueryDTO dto =
(AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceQueryDTO.class);
dto.setBusinessId(context.getCompany().getCompanyId());
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
try {
CloudwalkPageAble<AcsElevatorDeviceResultDTO> deviceList = this.acsElevatorDeviceDao.page(dto, page);
return CloudwalkResult.success(deviceList);
} catch (Exception e) {
this.logger.error("分页查询派梯设备失败,失败原因:", e);
throw new ServiceException("76260108", getMessage("76260108"));
}
}
public CloudwalkResult<CloudwalkPageAble<DeviceResult>> devicePage(AcsDeviceQueryParam param,
CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
try {
DeviceQueryParam queryParam = new DeviceQueryParam();
if (!ObjectUtils.isEmpty(param.getDeviceName())) {
queryParam.setDeviceName(param.getDeviceName());
}
if (!ObjectUtils.isEmpty(param.getAreaId())) {
queryParam.setAreaIds(Collections.singletonList(param.getAreaId()));
}
if (!ObjectUtils.isEmpty(param.getDeviceCategoryId())) {
queryParam.setDeviceTypeCategoryId(param.getDeviceCategoryId());
}
queryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<List<DeviceResult>> pageResult = this.deviceService.list(queryParam, context);
List<DeviceResult> result = new ArrayList<>();
if (!pageResult.isSuccess() || CollectionUtils.isEmpty((Collection)pageResult.getData())) {
return CloudwalkResult.success(new CloudwalkPageAble(result, pageInfo, 0L));
}
List<DeviceResult> deviceResult = deviceFilter((List<DeviceResult>)pageResult.getData(), context);
if (CollectionUtils.isEmpty(deviceResult)) {
return CloudwalkResult.success(new CloudwalkPageAble(result, pageInfo, 0L));
}
Map<String, String> areaMap = getAllAreaMap(context);
result =
page(convertDeviceNewResult(deviceResult, areaMap), pageInfo.getPageSize(), pageInfo.getCurrentPage());
return CloudwalkResult.success(new CloudwalkPageAble(result, pageInfo, deviceResult.size()));
} catch (Exception e) {
this.logger.error("分页查询设备异常,原因:", e);
throw new ServiceException(e);
}
}
public List<AcsElevatorDeviceQueryFoDTO> getFo(AcsElevatorDeviceQueryParam param) throws ServiceException {
AcsElevatorDeviceQueryDTO dto =
(AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceQueryDTO.class);
List<AcsElevatorDeviceResultDTO> deviceList = this.acsElevatorDeviceDao.get(dto);
List<AcsElevatorDeviceQueryFoDTO> deviceFoList = new ArrayList<>();
for (AcsElevatorDeviceResultDTO resultDTO : deviceList) {
AcsElevatorDeviceQueryFoDTO foDto =
(AcsElevatorDeviceQueryFoDTO)BeanCopyUtils.copyProperties(resultDTO, AcsElevatorDeviceQueryFoDTO.class);
deviceFoList.add(foDto);
}
return deviceFoList;
}
public AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdParam param, CloudwalkCallContext var2)
throws ServiceException {
AcsElevatorDeviceQueryByIdDTO dto =
(AcsElevatorDeviceQueryByIdDTO)BeanCopyUtils.copyProperties(param, AcsElevatorDeviceQueryByIdDTO.class);
AcsElevatorDeviceResultDTO resultDTO = this.acsElevatorDeviceDao.getById(dto);
if (resultDTO != null && StringUtils.isNotBlank(resultDTO.getDeviceId())) {
DeviceQueryParam deviceQueryParam = new DeviceQueryParam();
deviceQueryParam.setId(resultDTO.getId());
CloudwalkResult<List<DeviceResult>> result = this.deviceService.list(deviceQueryParam, var2);
List<DeviceResult> list = (List<DeviceResult>)result.getData();
if (list != null && list.size() > 0) {
DeviceResult deviceResult = list.get(0);
if (deviceResult != null) {
String id = deviceResult.getId();
Long lastHeartbeatTime = deviceResult.getLastHeartbeatTime();
String status = deviceResult.getOnlineStatus();
resultDTO.setStatusString(status);
resultDTO.setLastHeartbeatTime(lastHeartbeatTime);
}
}
}
return resultDTO;
}
public AcsElevatorDeviceResultDTO getByDeciveCode(String deviceCode) throws ServiceException {
return this.acsElevatorDeviceDao.getByDeciveCode(deviceCode);
}
public CloudwalkResult listUnbindFloors(AcsRestructureQueryParam param, CloudwalkCallContext context)
throws ServiceException {
try {
List<AcsPassRuleImageResultDto> floorList;
List<AcsDeviceRestructureResult> results = new ArrayList<>();
if (!ObjectUtils.isEmpty(param.getPersonId())) {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
dto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<PersonResult> detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getOrganizationIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
floorList = this.imageRuleRefDao.listByPersonInfo(dto);
} else {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty(param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty(param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
floorList = this.imageRuleRefDao.listByRestructure(dto);
}
List<String> floorIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(floorList)) {
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
}
AcsPassRuleQueryDto queryDto = new AcsPassRuleQueryDto();
queryDto.setZoneIds(floorIds);
return CloudwalkResult.success(this.imageRuleRefDao.listByNotZoneIds(queryDto));
} catch (Exception e) {
this.logger.error("查询未绑定的派梯楼层异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult listFloors(AcsRestructureQueryParam param, CloudwalkCallContext context)
throws ServiceException {
try {
List<AcsPassRuleImageResultDto> floorList, unBindFloors;
List<AcsDeviceRestructureResult> results = new ArrayList<>();
if (!ObjectUtils.isEmpty(param.getPersonId())) {
AcsPassRuleImageDto acsPassRuleImageDto = new AcsPassRuleImageDto();
acsPassRuleImageDto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<PersonResult> detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getLabelIds())) {
acsPassRuleImageDto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getOrganizationIds())) {
acsPassRuleImageDto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
floorList = this.imageRuleRefDao.listByPersonInfo(acsPassRuleImageDto);
} else {
AcsPassRuleImageDto acsPassRuleImageDto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty(param.getLabelId())) {
acsPassRuleImageDto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty(param.getOrgId())) {
acsPassRuleImageDto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
floorList = this.imageRuleRefDao.listByRestructure(acsPassRuleImageDto);
}
AcsElevatorDeviceListDto dto = new AcsElevatorDeviceListDto();
List<String> floorIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(floorList)) {
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
}
AcsPassRuleQueryDto queryDto = new AcsPassRuleQueryDto();
if (!ObjectUtils.isEmpty(param.getZoneId())) {
if (floorIds.contains(param.getZoneId())) {
return CloudwalkResult.success(results);
}
queryDto.setZoneId(param.getZoneId());
unBindFloors = this.imageRuleRefDao.listByNotZoneIds(queryDto);
} else {
queryDto.setZoneIds(floorIds);
unBindFloors = this.imageRuleRefDao.listByNotZoneIds(queryDto);
}
List<String> unBindFloorIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(unBindFloors)) {
unBindFloors.forEach(floor -> unBindFloorIds.add(floor.getZoneId()));
} else {
return CloudwalkResult.success(results);
}
if (!ObjectUtils.isEmpty(param.getZoneId())) {
dto.setCurrentFloorId(param.getZoneId());
} else {
dto.setCurrentFloorIds(unBindFloorIds);
}
List<AcsElevatorDeviceResultDTO> deviceList = this.acsElevatorDeviceDao.listByZoneIds(dto);
List<String> deviceIds = new ArrayList<>();
Map<String, DeviceResult> mapDevice = new HashMap<>();
if (!CollectionUtils.isEmpty(deviceList)) {
deviceList.forEach(device -> deviceIds.add(device.getDeviceId()));
DeviceQueryParam queryParam = new DeviceQueryParam();
queryParam.setBusinessId(context.getCompany().getCompanyId());
queryParam.setIds(deviceIds);
CloudwalkResult<List<DeviceResult>> resultList = this.deviceService.list(queryParam, context);
List<DeviceResult> list = (List<DeviceResult>)resultList.getData();
if (list != null && list.size() > 0) {
for (DeviceResult deviceResult : list) {
mapDevice.put(deviceResult.getId(), deviceResult);
}
}
}
for (AcsPassRuleImageResultDto floor : unBindFloors) {
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor.getZoneId());
result.setZoneName(floor.getZoneName());
if (!CollectionUtils.isEmpty(deviceList)) {
result.setParentId(((AcsElevatorDeviceResultDTO)deviceList.get(0)).getCurrentBuildingId());
} else {
result.setParentId(this.floorBuildingId);
}
String online = "";
String offline = "";
if (!CollectionUtils.isEmpty(deviceList)) {
for (int i = 0; i < deviceList.size(); i++) {
if (floor.getZoneId()
.equals(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getCurrentFloorId())) {
DeviceResult deviceResult =
mapDevice.get(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getDeviceId());
if (!ObjectUtils.isEmpty(deviceResult)) {
if ("2".equals(deviceResult.getOnlineStatus())) {
if ("".equals(online)) {
online = online + deviceResult.getDeviceName();
} else {
online = online + "," + deviceResult.getDeviceName();
}
} else if ("".equals(offline)) {
offline = offline + deviceResult.getDeviceName();
} else {
offline = offline + ',' + deviceResult.getDeviceName();
}
}
}
}
}
result.setOnlineDevices(online);
result.setOfflineDevices(offline);
results.add(result);
}
return CloudwalkResult.success(results);
} catch (Exception e) {
this.logger.error("查询未绑定的派梯楼层异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult listCondition(AcsRestructureQueryParam param, CloudwalkCallContext context)
throws ServiceException {
try {
List<AcsPassRuleImageResultDto> floorList;
List<AcsDeviceRestructureResult> results = new ArrayList<>();
if (!ObjectUtils.isEmpty(param.getBusinessId())) {
context.getCompany().setCompanyId(param.getBusinessId());
}
if (!ObjectUtils.isEmpty(param.getPersonId())) {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
dto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<PersonResult> detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getOrganizationIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
floorList = this.imageRuleRefDao.listByPersonInfo(dto);
} else {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty(param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty(param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
floorList = this.imageRuleRefDao.listByRestructure(dto);
}
if (!CollectionUtils.isEmpty(floorList)) {
AcsElevatorDeviceListDto dto = new AcsElevatorDeviceListDto();
List<String> floorIds = new ArrayList<>();
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
if (!ObjectUtils.isEmpty(param.getZoneId())) {
if (floorIds.contains(param.getZoneId())) {
dto.setCurrentFloorIds(Collections.singletonList(param.getZoneId()));
} else {
return CloudwalkResult.success(results);
}
} else {
dto.setCurrentFloorIds(floorIds);
}
List<AcsElevatorDeviceResultDTO> deviceList = this.acsElevatorDeviceDao.listByZoneIds(dto);
if (!CollectionUtils.isEmpty(deviceList)) {
List<String> deviceIds = new ArrayList<>();
deviceList.forEach(device -> deviceIds.add(device.getDeviceId()));
Map<String, DeviceResult> mapDevice = new HashMap<>();
DeviceQueryParam queryParam = new DeviceQueryParam();
queryParam.setBusinessId(context.getCompany().getCompanyId());
queryParam.setIds(deviceIds);
CloudwalkResult<List<DeviceResult>> resultList = this.deviceService.list(queryParam, context);
List<DeviceResult> list = (List<DeviceResult>)resultList.getData();
if (list != null && list.size() > 0) {
for (DeviceResult deviceResult : list) {
mapDevice.put(deviceResult.getId(), deviceResult);
}
}
for (AcsPassRuleImageResultDto floor : floorList) {
if (!ObjectUtils.isEmpty(param.getZoneId()) && !param.getZoneId().equals(floor.getZoneId())) {
continue;
}
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor.getZoneId());
result.setZoneName(floor.getZoneName());
result.setParentId(this.floorBuildingId);
String online = "";
String offline = "";
for (int i = 0; i < deviceList.size(); i++) {
if (floor.getZoneId()
.equals(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getCurrentFloorId())) {
DeviceResult deviceResult =
mapDevice.get(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getDeviceId());
result.setParentId(
((AcsElevatorDeviceResultDTO)deviceList.get(i)).getCurrentBuildingId());
if (!ObjectUtils.isEmpty(deviceResult)) {
if ("2".equals(deviceResult.getOnlineStatus())) {
if ("".equals(online)) {
online = online + deviceResult.getDeviceName();
} else {
online = online + "," + deviceResult.getDeviceName();
}
} else if ("".equals(offline)) {
offline = offline + deviceResult.getDeviceName();
} else {
offline = offline + ',' + deviceResult.getDeviceName();
}
}
}
}
result.setOnlineDevices(online);
result.setOfflineDevices(offline);
results.add(result);
}
} else if (!ObjectUtils.isEmpty(param.getZoneId())) {
for (AcsPassRuleImageResultDto floor : floorList) {
if (floor.getZoneId().equals(param.getZoneId())) {
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor.getZoneId());
result.setZoneName(floor.getZoneName());
result.setParentId(this.floorBuildingId);
results.add(result);
break;
}
}
} else {
for (AcsPassRuleImageResultDto floor : floorList) {
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor.getZoneId());
result.setZoneName(floor.getZoneName());
result.setParentId(this.floorBuildingId);
results.add(result);
}
}
}
return CloudwalkResult.success(results);
} catch (Exception e) {
this.logger.error("根据机构id、标签id、人员id查询派梯设备异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult listConditionByLabelIds(AcsRestructureQueryParam param, CloudwalkCallContext context)
throws ServiceException {
try {
List<AcsLabelElevatorResult> results = new ArrayList<>();
if (CollectionUtils.isEmpty(param.getLabelIds())) {
return CloudwalkResult.success(null);
}
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
dto.setIncludeLabels(param.getLabelIds());
List<AcsPassRuleLabelResultDto> floorList = this.imageRuleRefDao.listFloorsByRestructure(dto);
Map<String, List<AcsPassRuleLabelResultDto>> maps = new HashMap<>();
if (CollectionUtils.isEmpty(floorList)) {
for (String label : param.getLabelIds()) {
AcsLabelElevatorResult result = new AcsLabelElevatorResult();
result.setLabelId(label);
result.setDetails(null);
results.add(result);
}
} else {
for (AcsPassRuleLabelResultDto resultDto : floorList) {
List<AcsPassRuleLabelResultDto> dtos = maps.get(resultDto.getLabelId());
if (!CollectionUtils.isEmpty(dtos)) {
dtos.add(resultDto);
maps.put(resultDto.getLabelId(), dtos);
continue;
}
List<AcsPassRuleLabelResultDto> dtoList = new ArrayList<>();
dtoList.add(resultDto);
maps.put(resultDto.getLabelId(), dtoList);
}
for (String label : param.getLabelIds()) {
List<AcsPassRuleLabelResultDto> dtoList = maps.get(label);
AcsLabelElevatorResult result = new AcsLabelElevatorResult();
result.setLabelId(label);
if (!CollectionUtils.isEmpty(dtoList)) {
result.setDetails(dtoList);
} else {
result.setDetails(null);
}
results.add(result);
}
}
return CloudwalkResult.success(results);
} catch (Exception e) {
this.logger.error("根据标签id集合查询派梯楼层权限异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult<String> bindingFloors(AcsRestructureBindingParam param, CloudwalkCallContext context)
throws ServiceException {
try {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty(param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty(param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
List<AcsPassRuleImageResultDto> floorList = this.imageRuleRefDao.listByRestructure(dto);
List<String> floorIds = new ArrayList<>();
Map<String, AcsPassRuleImageResultDto> zoneMap = new HashMap<>();
for (AcsPassRuleImageResultDto resultDto : floorList) {
floorIds.add(resultDto.getZoneId());
zoneMap.put(resultDto.getZoneId(), resultDto);
}
List<AcsPassRuleImageResultDto> addFloors = new ArrayList<>();
List<String> delFloorIds = new ArrayList<>();
List<String> addFloorIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(floorList)) {
for (AcsPassRuleImageResultDto floor : floorList) {
if (!param.getZoneIds().contains(floor.getZoneId())) {
delFloorIds.add(floor.getZoneId());
}
}
for (String zoneId : param.getZoneIds()) {
if (!floorIds.contains(zoneId)) {
addFloorIds.add(zoneId);
}
}
if (!CollectionUtils.isEmpty(addFloorIds)) {
addFloors.addAll(this.imageRuleRefDao.listZoneInfoByIds(addFloorIds));
}
} else {
addFloors.addAll(this.imageRuleRefDao.listZoneInfoByIds(param.getZoneIds()));
}
if (!CollectionUtils.isEmpty(addFloors) || !CollectionUtils.isEmpty(delFloorIds)) {
String taskId = genUUID();
AcsDeviceTaskAddDto addDto = new AcsDeviceTaskAddDto();
addDto.setId(taskId);
addDto.setAllDevices(Integer.valueOf(addFloors.size() + delFloorIds.size()));
addDto.setBindDevices(Integer.valueOf(0));
addDto.setIsStop(Integer.valueOf(0));
this.acsDeviceTaskDao.insert(addDto);
param.setTaskId(taskId);
this.acsDeviceTaskService.updateFloors(param, addFloors, delFloorIds, context);
return CloudwalkResult.success(taskId);
}
return CloudwalkResult.success(null);
} catch (Exception e) {
this.logger.error("根据机构id、标签id、人员id查询派梯设备异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult<String> bindingPerson(AcsRestructureBindingParam param, CloudwalkCallContext context)
throws ServiceException {
try {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
dto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<PersonResult> detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty(((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
List<AcsPassRuleImageResultDto> floorList = this.imageRuleRefDao.listByPersonInfo(dto);
List<String> floorIds = new ArrayList<>();
Map<String, AcsPassRuleImageResultDto> zoneMap = new HashMap<>();
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
for (AcsPassRuleImageResultDto resultDto : floorList) {
floorIds.add(resultDto.getZoneId());
zoneMap.put(resultDto.getZoneId(), resultDto);
}
List<AcsPassRuleImageResultDto> addFloors = new ArrayList<>();
List<String> delFloorIds = new ArrayList<>();
List<String> addFloorIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(floorList)) {
for (AcsPassRuleImageResultDto floor : floorList) {
if (!param.getZoneIds().contains(floor.getZoneId())) {
delFloorIds.add(floor.getZoneId());
}
}
for (String zoneId : param.getZoneIds()) {
if (!floorIds.contains(zoneId)) {
addFloorIds.add(zoneId);
}
}
if (!CollectionUtils.isEmpty(addFloorIds)) {
addFloors.addAll(this.imageRuleRefDao.listZoneInfoByIds(addFloorIds));
}
} else {
addFloors.addAll(this.imageRuleRefDao.listZoneInfoByIds(param.getZoneIds()));
}
if (!CollectionUtils.isEmpty(addFloors) || !CollectionUtils.isEmpty(delFloorIds)) {
String taskId = genUUID();
AcsDeviceTaskAddDto addDto = new AcsDeviceTaskAddDto();
addDto.setId(taskId);
addDto.setAllDevices(Integer.valueOf(addFloors.size() + delFloorIds.size()));
addDto.setBindDevices(Integer.valueOf(0));
addDto.setIsStop(Integer.valueOf(0));
this.acsDeviceTaskDao.insert(addDto);
param.setTaskId(taskId);
this.acsDeviceTaskService.updateFloors(param, addFloors, delFloorIds, context);
return CloudwalkResult.success(taskId);
}
return CloudwalkResult.success(null);
} catch (Exception e) {
this.logger.error("根人员批量绑定派梯楼层异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult<AcsDeviceTaskDTO> getTask(AcsDeviceRestructureTaskParam param, CloudwalkCallContext context)
throws ServiceException {
try {
return CloudwalkResult.success(this.acsDeviceTaskDao.getById(param.getTaskId()));
} catch (Exception e) {
this.logger.error("根据任务id查询任务详情异常,原因:", e);
throw new ServiceException(e);
}
}
public CloudwalkResult<Boolean> setTaskStop(AcsDeviceRestructureTaskParam param, CloudwalkCallContext context)
throws ServiceException {
try {
AcsDeviceTaskAddDto dto = new AcsDeviceTaskAddDto();
dto.setId(param.getTaskId());
dto.setIsStop(Integer.valueOf(1));
this.acsDeviceTaskDao.updateIsStop(dto);
return CloudwalkResult.success(Boolean.valueOf(true));
} catch (Exception e) {
this.logger.error("编辑任务进程异常,原因:", e);
throw new ServiceException(e);
}
}
private String addImageStore(AcsElevatorDeviceAddParam param, CloudwalkCallContext context)
throws ServiceException {
ImageStoreAddParam imageStoreAddParam = new ImageStoreAddParam();
String applicationId = this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId());
imageStoreAddParam.setName(param.getCurrentBuilding() + "-默认图库");
imageStoreAddParam.setType(Short.valueOf((short)1));
imageStoreAddParam.setSourceApplicationId(applicationId);
imageStoreAddParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<String> imageStoreId = this.imageStoreService.add(imageStoreAddParam, context);
if (!imageStoreId.isSuccess()) {
this.logger.info("远程调用新增图库失败,原因:" + imageStoreId.getMessage());
throw new ServiceException(imageStoreId.getCode(), imageStoreId.getMessage());
}
this.logger.info("远程调用新增图库出参:imageStoreId=[{}]", imageStoreId.getData());
DeviceImageStoreAppBindParam appBindParam = new DeviceImageStoreAppBindParam();
appBindParam.setImageStoreId((String)imageStoreId.getData());
appBindParam.setApplicationId(applicationId);
this.acsDeviceImageStoreAppBindService.bindAppImageStoreDevice(appBindParam, context);
try {
DeviceImageStoreAppBindParam bindParam = new DeviceImageStoreAppBindParam();
bindParam.setImageStoreId((String)imageStoreId.getData());
bindParam.setDeviceId(param.getDeviceId());
bindParam.setApplicationId(applicationId);
this.acsDeviceImageStoreAppBindService.bindDeviceAndImageStore(bindParam, context);
} catch (ServiceException e) {
this.logger.error("图库关联失败,图库id={},原因:{}", imageStoreId.getData(), e.getMessage());
ImageStoreDelParam delParam = new ImageStoreDelParam();
delParam.setId((String)imageStoreId.getData());
delParam.setBusinessId(context.getCompany().getCompanyId());
this.logger.info("回滚删除图库开始,delParam={},context={}", JSONObject.toJSON(delParam),
JSONObject.toJSON(context));
CloudwalkResult<Boolean> deleteResult = this.imageStoreService.delete(delParam, context);
this.logger.info("删除图库:图库id={},结果:{}", imageStoreId, deleteResult.getMessage());
throw new ServiceException(e.getCode(), e.getMessage());
}
return (String)imageStoreId.getData();
}
private List<DeviceResult> deviceFilter(List<DeviceResult> pageResult, CloudwalkCallContext context)
throws ServiceException {
List<AcsDeviceNewResult> acsDeviceNewResults = getAcsDeviceIds(context);
List<String> acsDeviceIds = (List<String>)acsDeviceNewResults.stream().map(AcsDeviceNewResult::getDeviceId)
.collect(Collectors.toList());
List<String> deviceIds =
(List<String>)pageResult.stream().map(DeviceResult::getId).collect(Collectors.toList());
List<String> newList = CollectionUtils.removeList(deviceIds, acsDeviceIds);
List<DeviceResult> newDeviceResultList = new ArrayList<>();
Map<String, DeviceResult> deviceResultMap =
(Map<String, DeviceResult>)pageResult.stream().collect(Collectors.toMap(DeviceResult::getId, d -> d));
for (String id : newList) {
newDeviceResultList.add(deviceResultMap.get(id));
}
return newDeviceResultList;
}
private List<AcsDeviceNewResult> getAcsDeviceIds(CloudwalkCallContext context) throws ServiceException {
List<AcsElevatorDeviceResultDTO> acsDeviceList;
List<AcsDeviceNewResult> acsDeviceNewResultList = new ArrayList<>();
AcsElevatorDeviceQueryDTO dto = new AcsElevatorDeviceQueryDTO();
dto.setBusinessId(context.getCompany().getCompanyId());
try {
acsDeviceList = this.acsElevatorDeviceDao.get(dto);
} catch (ServiceException e) {
throw new ServiceException("76260007", getMessage("76260007"));
}
Map<String, String> areaMap = getAllAreaMap(context);
if (CollectionUtils.isNotEmpty(acsDeviceList)) {
List<String> deviceIds = (List<String>)acsDeviceList.stream().map(AcsElevatorDeviceResultDTO::getDeviceId)
.collect(Collectors.toList());
DeviceQueryParam queryParam = new DeviceQueryParam();
queryParam.setIds(deviceIds);
queryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<List<DeviceResult>> deviceResult = this.deviceService.list(queryParam, context);
if (deviceResult.isSuccess()) {
if (CollectionUtils.isNotEmpty((Collection)deviceResult.getData())) {
acsDeviceNewResultList =
convertDeviceNewResult((Collection<DeviceResult>)deviceResult.getData(), areaMap);
}
} else {
this.logger.error("查询设备信息列表失败,原因={}", deviceResult.getMessage());
throw new ServiceException("查询设备信息列表失败");
}
}
return acsDeviceNewResultList;
}
protected Map<String, String> getAllAreaMap(CloudwalkCallContext context) {
DeviceAreaTreeParam areaTreeParam = new DeviceAreaTreeParam();
areaTreeParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<List<AreaTreeResult>> areaTree = this.acsAreaTreeCacheableService.tree(areaTreeParam, context);
Map<String, String> areaMap = new HashMap<>();
getAreaMap((List<AreaTreeResult>)areaTree.getData(), areaMap);
return areaMap;
}
protected void getAreaMap(List<AreaTreeResult> areaTreeResultList, Map<String, String> areaMap) {
for (AreaTreeResult areaTree : areaTreeResultList) {
areaMap.put(areaTree.getId(), areaTree.getName());
if (areaTree.getChildren() != null) {
getAreaMap(areaTree.getChildren(), areaMap);
}
}
}
protected List<AcsDeviceNewResult> convertDeviceNewResult(Collection<DeviceResult> datas,
Map<String, String> areaMap) {
List<AcsDeviceNewResult> result = new ArrayList<>();
for (DeviceResult data : datas) {
AcsDeviceNewResult acsDeviceResult = new AcsDeviceNewResult();
BeanCopyUtils.copyProperties(data, acsDeviceResult);
acsDeviceResult.setId(data.getId());
acsDeviceResult.setDeviceId(data.getId());
acsDeviceResult.setDeviceStatus(Integer.valueOf(data.getStatus()));
acsDeviceResult.setDeviceOnlineStatus(Integer.valueOf(data.getOnlineStatus()));
acsDeviceResult.setAddress(getAddress(data));
acsDeviceResult.setAreaName(areaMap.get(data.getAreaId()));
result.add(acsDeviceResult);
}
return result;
}
protected String getAddress(DeviceResult data) {
StringBuffer sb = new StringBuffer();
if (StringUtils.isNotBlank(data.getDistrictMergeName())) {
sb.append(data.getDistrictMergeName());
}
if (StringUtils.isNotBlank(data.getAreaName())) {
sb.append(" ");
sb.append(data.getAreaName());
}
return sb.toString().trim();
}
private List<DeviceResult> page(List<AcsDeviceNewResult> dataList, int pageSize, int currentPage) {
List<DeviceResult> currentPageList = new ArrayList<>();
if (dataList != null && dataList.size() > 0) {
int currIdx = (currentPage > 1) ? ((currentPage - 1) * pageSize) : 0;
for (int i = 0; i < pageSize && i < dataList.size() - currIdx; i++) {
AcsDeviceNewResult data = dataList.get(currIdx + i);
DeviceResult deviceResult = (DeviceResult)BeanCopyUtils.copyProperties(data, DeviceResult.class);
currentPageList.add(deviceResult);
}
}
return currentPageList;
}
}
@@ -0,0 +1,21 @@
package cn.cloudwalk.elevator.device.impl;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao;
import cn.cloudwalk.elevator.device.mapper.DeviceImageStoreMapper;
import javax.annotation.Resource;
import org.springframework.stereotype.Repository;
@Repository
public class DeviceImageStoreDaoImpl implements DeviceImageStoreDao {
@Resource
private DeviceImageStoreMapper deviceImageStoreMapper;
public Boolean save(String buildingId, String imageStoreId) throws ServiceException {
return this.deviceImageStoreMapper.save(buildingId, imageStoreId);
}
public String getByBuildingId(String buildingId) throws ServiceException {
return this.deviceImageStoreMapper.getByBuildingId(buildingId);
}
}
@@ -0,0 +1,14 @@
package cn.cloudwalk.elevator.device.mapper;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
public interface AcsDeviceTaskMapper {
Integer insert(AcsDeviceTaskAddDto paramAcsDeviceTaskAddDto);
Integer updateBingDevices(AcsDeviceTaskAddDto paramAcsDeviceTaskAddDto);
Integer updateIsStop(AcsDeviceTaskAddDto paramAcsDeviceTaskAddDto);
AcsDeviceTaskDTO getById(String paramString);
}
@@ -0,0 +1,45 @@
<?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="cn.cloudwalk.elevator.device.mapper.AcsDeviceTaskMapper">
<resultMap id="resultMap" type="cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO">
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="ALL_DEVICES" jdbcType="TINYINT" property="allDevices" />
<result column="BIND_DEVICES" jdbcType="TINYINT" property="bindDevices" />
<result column="IS_STOP" jdbcType="TINYINT" property="isStop" />
</resultMap>
<insert id="insert" parameterType="cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto">
insert into it_acs_device_task (ID, ALL_DEVICES, BIND_DEVICES, IS_STOP)
values (#{id,jdbcType=VARCHAR}, #{allDevices,jdbcType=TINYINT}, #{bindDevices,jdbcType=TINYINT}, #{isStop,jdbcType=TINYINT})
</insert>
<update id="updateBingDevices">
update it_acs_device_task
<set>
BIND_DEVICES = #{bindDevices,jdbcType=TINYINT},
</set>
<where>
<if test="id != null and id != ''">
and ID = #{id,jdbcType=VARCHAR}
</if>
</where>
</update>
<update id="updateIsStop">
update it_acs_device_task
<set>
IS_STOP = #{isStop,jdbcType=TINYINT},
</set>
<where>
<if test="id != null and id != ''">
and ID = #{id,jdbcType=VARCHAR}
</if>
</where>
</update>
<select id="getById" resultMap="resultMap">
select ID, ALL_DEVICES, BIND_DEVICES,IS_STOP
from it_acs_device_task
WHERE ID = #{taskId,jdbcType=VARCHAR}
</select>
</mapper>
@@ -0,0 +1,37 @@
package cn.cloudwalk.elevator.device.mapper;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceAddDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceEditDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryByIdDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
import java.util.List;
public interface AcsElevatorDeviceMapper {
int add(AcsElevatorDeviceAddDTO paramAcsElevatorDeviceAddDTO);
int edit(AcsElevatorDeviceEditDTO paramAcsElevatorDeviceEditDTO);
int delete(List<String> paramList);
List<AcsElevatorDeviceResultDTO> listByZoneId(AcsElevatorDeviceListDto paramAcsElevatorDeviceListDto);
List<AcsElevatorDeviceResultDTO> listByZoneIds(AcsElevatorDeviceListDto paramAcsElevatorDeviceListDto);
List<AcsElevatorDeviceResultDTO> page(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO);
List<AcsElevatorDeviceResultDTO>
listBuBuildingId(AcsElevatorDeviceListByBuildingIdDto paramAcsElevatorDeviceListByBuildingIdDto);
List<AcsElevatorDeviceResultDTO> get(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO);
AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdDTO paramAcsElevatorDeviceQueryByIdDTO);
AcsElevatorDeviceResultDTO getByDeciveCode(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO);
String getBuildingId(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO);
String getBusinessId(AcsElevatorDeviceQueryDTO paramAcsElevatorDeviceQueryDTO);
}
@@ -0,0 +1,273 @@
<?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="cn.cloudwalk.elevator.device.mapper.AcsElevatorDeviceMapper">
<resultMap id="resultMap" type="cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO">
<result column="ID" property="id" jdbcType="VARCHAR" />
<result column="business_id" property="businessId" jdbcType="VARCHAR" />
<result column="device_id" property="deviceId" jdbcType="VARCHAR" />
<result column="device_name" property="deviceName" jdbcType="VARCHAR" />
<result column="device_code" property="deviceCode" jdbcType="VARCHAR" />
<result column="device_type_name" property="deviceTypeName" jdbcType="VARCHAR" />
<result column="area_name" property="areaName" jdbcType="VARCHAR" />
<result column="area_id" property="areaId" jdbcType="VARCHAR" />
<result column="current_building_id" property="currentBuildingId" jdbcType="VARCHAR" />
<result column="current_building" property="currentBuilding" jdbcType="VARCHAR" />
<result column="current_floor_id" property="currentFloorId" jdbcType="VARCHAR" />
<result column="current_floor" property="currentFloor" jdbcType="VARCHAR" />
<result column="elevator_floor_list" property="elevatorFloorList" jdbcType="VARCHAR" />
<result column="elevator_floor_id_list" property="elevatorFloorIdList" jdbcType="VARCHAR" />
<result column="IP" property="ip" jdbcType="VARCHAR" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="onlineStatus" property="onlineStatus" jdbcType="VARCHAR" />
<result column="LAST_HEARTBEAT_TIME" property="lastHeartbeatTime" jdbcType="VARCHAR" />
</resultMap>
<select id="get" parameterType="cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO" resultMap="resultMap">
select ID,business_id,device_id,device_name,device_code,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list
from elevator_device
<trim prefix="where" prefixOverrides="and|or">
<if test="businessId != null and businessId != ''">
and business_id = #{businessId, jdbcType=VARCHAR}
</if>
<if test="deviceName != null and deviceName != ''">
and device_name = #{deviceName, jdbcType=VARCHAR}
</if>
<if test="deviceTypeName != null and deviceTypeName != ''">
and device_type_name = #{deviceTypeName, jdbcType=VARCHAR}
</if>
<if test="areaName != null and deviceTypeName != ''">
and area_name = #{areaName, jdbcType=VARCHAR}
</if>
<if test="deviceId != null and deviceId != ''">
and device_id = #{deviceId, jdbcType=VARCHAR}
</if>
<if test="deviceCode != null and deviceCode != ''">
and device_code = #{deviceCode, jdbcType=VARCHAR}
</if>
<if test="areaIds != null and areaIds.size > 0">
and area_id in
<foreach item="item" collection="areaIds" separator="," open="(" close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
</trim>
order by ID desc
</select>
<select id="getById" parameterType="cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryByIdDTO"
resultMap="resultMap">
select ID,business_id,device_id,device_name,device_code,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list
from elevator_device
<trim prefix="where" prefixOverrides="and|or">
<if test="id != null and id != ''">
and ID = #{id, jdbcType=VARCHAR}
</if>
</trim>
</select>
<select id="getByDeciveCode" resultMap="resultMap">
select ID,business_id,device_id,device_name,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list
from elevator_device
<trim prefix="where" prefixOverrides="and|or">
<if test="deviceCode != null and deviceCode != ''">
and device_code = #{deviceCode, jdbcType=VARCHAR}
</if>
</trim>
</select>
<select id="listByZoneId" resultMap="resultMap">
SELECT ID,business_id,device_id,device_name,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list
FROM elevator_device
WHERE current_floor_id = #{currentFloorId, jdbcType=VARCHAR}
</select>
<select id="listByZoneIds" resultMap="resultMap">
SELECT ID,business_id,device_id,device_name,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list
FROM elevator_device
WHERE 1=1
<if test="currentFloorId != null and currentFloorId != ''">
and current_floor_id = #{currentFloorId, jdbcType=VARCHAR}
</if>
<if test="currentFloorIds != null and currentFloorIds.size > 0">
and current_floor_id in
<foreach item="item" collection="currentFloorIds" separator="," open="(" close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="page" parameterType="cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO" resultMap="resultMap">
select t1.ID,t1.business_id,device_id,t1.device_name,t1.device_code,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list,t3.IP, t2.STATUS,
t2.LAST_HEARTBEAT_TIME,
CASE
WHEN abs(t2.LAST_HEARTBEAT_TIME/1000 - UNIX_TIMESTAMP()) <![CDATA[ <= ]]> 300 THEN 2
ELSE 3
END AS onlineStatus
from elevator_device t1
left join `cwos_portal`.cw_ge_device t2 on t1.device_id = t2.ID
left join `cwos_portal`.cw_ge_device_camera t3 on t1.device_id = t3.GE_DEVICE_ID
<trim prefix="where" prefixOverrides="and|or">
<if test="businessId != null and businessId != ''">
and t1.business_id = #{businessId, jdbcType=VARCHAR}
</if>
<if test="deviceName != null and deviceName != ''">
and t1.device_name like concat('%', #{deviceName, jdbcType=VARCHAR}, '%')
</if>
<if test="deviceTypeName != null and deviceTypeName != ''">
and t1.device_type_name = #{deviceTypeName, jdbcType=VARCHAR}
</if>
<if test="areaName != null and deviceTypeName != ''">
and t1.area_name = #{areaName, jdbcType=VARCHAR}
</if>
<if test="deviceId != null and deviceId != ''">
and t1.device_id = #{deviceId, jdbcType=VARCHAR}
</if>
<if test="deviceCode != null and deviceCode != ''">
and t1.device_code like concat('%', #{deviceCode, jdbcType=VARCHAR}, '%')
</if>
<if test="areaIds != null and areaIds.size > 0">
and t1.area_id in
<foreach item="item" collection="areaIds" separator="," open="(" close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="ip != null and ip != ''">
and t3.IP like concat('%', #{ip, jdbcType=VARCHAR}, '%')
</if>
<if test="status != null">
and t2.STATUS = #{status}
</if>
<if test="onlineStatus != null">
<choose>
<when test="onlineStatus == 2">
and abs(t2.LAST_HEARTBEAT_TIME/1000 - UNIX_TIMESTAMP()) <![CDATA[ <= ]]> 300
</when>
<otherwise>
and abs(t2.LAST_HEARTBEAT_TIME/1000 - UNIX_TIMESTAMP()) <![CDATA[ > ]]> 300
</otherwise>
</choose>
</if>
</trim>
order by
CASE
WHEN t1.current_floor LIKE '%F' THEN SUBSTRING(t1.current_floor, 1, LENGTH(t1.current_floor) - 1) + 0
WHEN t1.current_floor LIKE '%MF' THEN SUBSTRING(t1.current_floor, 1, LENGTH(t1.current_floor) - 2) + 0
ELSE t1.current_floor + 0
END
</select>
<select id="listBuBuildingId" resultMap="resultMap">
SELECT ID,business_id,device_id,device_name,
device_type_name,area_name,area_id,current_building_id,current_building,current_floor_id,
current_floor,elevator_floor_list,elevator_floor_id_list
FROM elevator_device
WHERE current_building_id = #{currentBuildingId, jdbcType=VARCHAR}
and business_id = #{businessId, jdbcType=VARCHAR}
</select>
<insert id="add" parameterType="cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceAddDTO">
insert into elevator_device (ID, create_time, last_update_time, delete_flag,
device_id, device_name, device_code, device_type_name,
area_name, current_building_id, current_building, current_floor_id,
current_floor, elevator_floor_list, business_id, area_id,elevator_floor_id_list)
values (
#{id,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT},
#{lastUpdateTime,jdbcType=BIGINT},
#{deleteFlag,jdbcType=TINYINT},
#{deviceId,jdbcType=VARCHAR},
#{deviceName,jdbcType=VARCHAR},
#{deviceCode,jdbcType=VARCHAR},
#{deviceTypeName,jdbcType=VARCHAR},
#{areaName,jdbcType=VARCHAR},
#{currentBuildingId,jdbcType=VARCHAR},
#{currentBuilding,jdbcType=VARCHAR},
#{currentFloorId,jdbcType=VARCHAR},
#{currentFloor,jdbcType=VARCHAR},
#{elevatorFloorList,jdbcType=VARCHAR},
#{businessId,jdbcType=VARCHAR},
#{areaId,jdbcType=VARCHAR},
#{elevatorFloorIdList,jdbcType=VARCHAR}
)
</insert>
<update id="edit" parameterType="cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceEditDTO">
update elevator_device
<trim prefix="set" suffixOverrides=",">
<if test="lastUpdateTime != null">
last_update_time = #{lastUpdateTime, jdbcType=BIGINT},
</if>
<if test="elevatorFloorList != null">
elevator_floor_list = #{elevatorFloorList, jdbcType=VARCHAR},
</if>
<if test="currentFloorId != null and currentFloorId != ''">
current_floor_id = #{currentFloorId, jdbcType=VARCHAR},
</if>
<if test="currentFloor != null and currentFloor != ''">
current_floor = #{currentFloor, jdbcType=VARCHAR},
</if>
<if test="currentBuilding != null and currentBuilding != ''">
current_building = #{currentBuilding, jdbcType=VARCHAR},
</if>
<if test="currentBuildingId != null and currentBuildingId != ''">
current_building_id = #{currentBuildingId, jdbcType=VARCHAR},
</if>
<if test="currentBuildingId != null and currentBuildingId != ''">
area_id = #{areaId,jdbcType=VARCHAR},
</if>
<if test="elevatorFloorIdList != null and elevatorFloorIdList != ''">
elevator_floor_id_list = #{elevatorFloorIdList,jdbcType=VARCHAR},
</if>
</trim>
<where>
ID = #{id, jdbcType=VARCHAR}
</where>
</update>
<delete id="delete">
delete from elevator_device
where ID in
<foreach item="id" collection="list" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<select id="getBuildingId" resultType="java.lang.String">
select current_building_id
from elevator_device
<if test="deviceCode != null and deviceCode != ''">
where device_code = #{deviceCode,jdbcType=VARCHAR}
</if>
</select>
<select id="getBusinessId" resultType="java.lang.String">
select business_id
from elevator_device
<if test="deviceCode != null and deviceCode != ''">
where device_code = #{deviceCode,jdbcType=VARCHAR}
</if>
</select>
</mapper>
@@ -0,0 +1,9 @@
package cn.cloudwalk.elevator.device.mapper;
import org.apache.ibatis.annotations.Param;
public interface DeviceImageStoreMapper {
Boolean save(@Param("buildingId") String paramString1, @Param("imageStoreId") String paramString2);
String getByBuildingId(String paramString);
}
@@ -0,0 +1,17 @@
<?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="cn.cloudwalk.elevator.device.mapper.DeviceImageStoreMapper">
<insert id="save">
insert into device_image_store (building_id, image_store_id)
values (#{buildingId},
#{imageStoreId})
</insert>
<select id="getByBuildingId" resultType="java.lang.String">
select image_store_id
from device_image_store
where building_id = #{buildingId}
</select>
</mapper>
@@ -0,0 +1,6 @@
/**
* 设备域服务层:电梯设备查询/编辑、设备任务(含楼层变更)、设备侧设置与图库应用绑定等编排。
* <p>
* 同包名在 data 模块中承担 DAO/Mapper;此处仅放接口、入参出参与 {@code impl} 实现,表结构见 data 包说明。
*/
package cn.cloudwalk.elevator.device;
@@ -0,0 +1,34 @@
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class AcsDeviceQueryParam extends CloudwalkBasePageForm implements Serializable {
private String deviceName;
private String deviceCategoryId;
private String areaId;
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCategoryId() {
return this.deviceCategoryId;
}
public void setDeviceCategoryId(String deviceCategoryId) {
this.deviceCategoryId = deviceCategoryId;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
}
@@ -0,0 +1,43 @@
package cn.cloudwalk.elevator.device.param;
import java.io.Serializable;
public class AcsDeviceRestructureTaskParam implements Serializable {
private static final long serialVersionUID = -7349123760464380004L;
private String taskId;
public String toString() {
return "AcsDeviceRestructureTaskParam(taskId=" + getTaskId() + ")";
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $taskId = getTaskId();
return result * 59 + (($taskId == null) ? 43 : $taskId.hashCode());
}
protected boolean canEqual(Object other) {
return other instanceof AcsDeviceRestructureTaskParam;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsDeviceRestructureTaskParam))
return false;
AcsDeviceRestructureTaskParam other = (AcsDeviceRestructureTaskParam)o;
if (!other.canEqual(this))
return false;
Object this$taskId = getTaskId(), other$taskId = other.getTaskId();
return !((this$taskId == null) ? (other$taskId != null) : !this$taskId.equals(other$taskId));
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskId() {
return this.taskId;
}
}
@@ -0,0 +1,157 @@
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
public class AcsElevatorDeviceAddParam extends CloudwalkBaseTimes implements Serializable {
private String businessId;
@NotEmpty
private String deviceId;
@NotEmpty
private String deviceCode;
@NotNull
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
@NotNull
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
private Integer deleteFlag;
private String areaId;
private String elevatorFloorIdList;
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getDeleteFlag() {
return this.deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String toString() {
return "AcsElevatorDeviceAddDTO{businessId='" + this.businessId + '\'' + ", deviceId='" + this.deviceId + '\''
+ ", deviceCode='" + this.deviceCode + '\'' + ", deviceName='" + this.deviceName + '\''
+ ", deviceTypeName='" + this.deviceTypeName + '\'' + ", elevatorFloorList='" + this.elevatorFloorList
+ '\'' + ", currentFloorId='" + this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\''
+ ", currentBuilding='" + this.currentBuilding + '\'' + ", areaName='" + this.areaName + '\'' + ", status="
+ this.status + ", deleteFlag=" + this.deleteFlag + '}';
}
}
@@ -0,0 +1,123 @@
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
public class AcsElevatorDeviceEditParam extends CloudwalkBaseTimes implements Serializable {
private String elevatorFloorList;
@NotNull
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaId;
private String elevatorFloorIdList;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String toString() {
return "AcsElevatorDeviceAddDTO{, elevatorFloorList='" + this.elevatorFloorList + '\'' + ", currentFloorId='"
+ this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\'' + ", currentBuilding='"
+ this.currentBuilding + '\'' + '}';
}
}
@@ -0,0 +1,27 @@
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
public class AcsElevatorDeviceListParam extends CloudwalkBaseTimes implements Serializable {
private String businessId;
@NotNull
private String currentFloorId;
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
}
@@ -0,0 +1,16 @@
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class AcsElevatorDeviceQueryByIdParam extends CloudwalkBasePageForm implements Serializable {
private String id;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
}
@@ -0,0 +1,91 @@
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.NotNull;
public class AcsElevatorDeviceQueryParam extends CloudwalkBasePageForm implements Serializable {
@NotNull
private String deviceName;
private String deviceTypeName;
private String areaName;
private String deviceId;
private String deviceCode;
private List<String> areaIds;
private Integer status;
private Integer onlineStatus;
private String ip;
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getOnlineStatus() {
return this.onlineStatus;
}
public void setOnlineStatus(Integer onlineStatus) {
this.onlineStatus = onlineStatus;
}
public String getIp() {
return this.ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<String> getAreaIds() {
return this.areaIds;
}
public void setAreaIds(List<String> areaIds) {
this.areaIds = areaIds;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
}
@@ -0,0 +1,111 @@
package cn.cloudwalk.elevator.device.param;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class AcsRestructureBindingParam implements Serializable {
private String parentId;
private String orgId;
private String orgName;
private String labelId;
private String labelName;
private String personId;
private List<String> zoneIds;
private String taskId;
public void setParentId(String parentId) {
this.parentId = parentId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public void setLabelId(String labelId) {
this.labelId = labelId;
}
public void setLabelName(String labelName) {
this.labelName = labelName;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public void setZoneIds(List<String> zoneIds) {
this.zoneIds = zoneIds;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AcsRestructureBindingParam)) {
return false;
}
AcsRestructureBindingParam other = (AcsRestructureBindingParam)o;
if (!other.canEqual(this)) {
return false;
}
return Objects.equals(parentId, other.parentId) && Objects.equals(orgId, other.orgId)
&& Objects.equals(orgName, other.orgName) && Objects.equals(labelId, other.labelId)
&& Objects.equals(labelName, other.labelName) && Objects.equals(personId, other.personId)
&& Objects.equals(zoneIds, other.zoneIds) && Objects.equals(taskId, other.taskId);
}
protected boolean canEqual(Object other) {
return other instanceof AcsRestructureBindingParam;
}
public int hashCode() {
return Objects.hash(parentId, orgId, orgName, labelId, labelName, personId, zoneIds, taskId);
}
public String toString() {
return "AcsRestructureBindingParam(parentId=" + getParentId() + ", orgId=" + getOrgId() + ", orgName="
+ getOrgName() + ", labelId=" + getLabelId() + ", labelName=" + getLabelName() + ", personId="
+ getPersonId() + ", zoneIds=" + getZoneIds() + ", taskId=" + getTaskId() + ")";
}
public String getParentId() {
return this.parentId;
}
public String getOrgId() {
return this.orgId;
}
public String getOrgName() {
return this.orgName;
}
public String getLabelId() {
return this.labelId;
}
public String getLabelName() {
return this.labelName;
}
public String getPersonId() {
return this.personId;
}
public List<String> getZoneIds() {
return this.zoneIds;
}
public String getTaskId() {
return this.taskId;
}
}
@@ -0,0 +1,92 @@
package cn.cloudwalk.elevator.device.param;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class AcsRestructureQueryParam implements Serializable {
private String orgId;
private String labelId;
private List<String> labelIds;
private String personId;
private String zoneId;
private String businessId;
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public void setLabelId(String labelId) {
this.labelId = labelId;
}
public void setLabelIds(List<String> labelIds) {
this.labelIds = labelIds;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AcsRestructureQueryParam)) {
return false;
}
AcsRestructureQueryParam other = (AcsRestructureQueryParam)o;
if (!other.canEqual(this)) {
return false;
}
return Objects.equals(orgId, other.orgId) && Objects.equals(labelId, other.labelId)
&& Objects.equals(labelIds, other.labelIds) && Objects.equals(personId, other.personId)
&& Objects.equals(zoneId, other.zoneId) && Objects.equals(businessId, other.businessId);
}
protected boolean canEqual(Object other) {
return other instanceof AcsRestructureQueryParam;
}
public int hashCode() {
return Objects.hash(orgId, labelId, labelIds, personId, zoneId, businessId);
}
public String toString() {
return "AcsRestructureQueryParam(orgId=" + getOrgId() + ", labelId=" + getLabelId() + ", labelIds="
+ getLabelIds() + ", personId=" + getPersonId() + ", zoneId=" + getZoneId() + ", businessId="
+ getBusinessId() + ")";
}
public String getOrgId() {
return this.orgId;
}
public String getLabelId() {
return this.labelId;
}
public List<String> getLabelIds() {
return this.labelIds;
}
public String getPersonId() {
return this.personId;
}
public String getZoneId() {
return this.zoneId;
}
public String getBusinessId() {
return this.businessId;
}
}
@@ -0,0 +1,178 @@
package cn.cloudwalk.elevator.device.result;
import java.io.Serializable;
public class AcsDeviceNewResult implements Serializable {
private static final long serialVersionUID = -3535840233209237358L;
private String id;
private String deviceId;
private String deviceName;
private String deviceCode;
private String deviceTypeId;
private String deviceTypeCode;
private String deviceTypeName;
private Integer deviceStatus;
private Integer deviceOnlineStatus;
private String address;
private String imageStoreId;
private int identifyType;
private String areaId;
private String areaName;
private Long lastHeartbeatTime;
private Integer deviceOpenStatus;
private String deviceTypeCategoryId;
private String status;
private String onlineStatus;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceTypeId() {
return this.deviceTypeId;
}
public void setDeviceTypeId(String deviceTypeId) {
this.deviceTypeId = deviceTypeId;
}
public String getDeviceTypeCode() {
return this.deviceTypeCode;
}
public void setDeviceTypeCode(String deviceTypeCode) {
this.deviceTypeCode = deviceTypeCode;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public Integer getDeviceStatus() {
return this.deviceStatus;
}
public void setDeviceStatus(Integer deviceStatus) {
this.deviceStatus = deviceStatus;
}
public Integer getDeviceOnlineStatus() {
return this.deviceOnlineStatus;
}
public void setDeviceOnlineStatus(Integer deviceOnlineStatus) {
this.deviceOnlineStatus = deviceOnlineStatus;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public int getIdentifyType() {
return this.identifyType;
}
public void setIdentifyType(int identifyType) {
this.identifyType = identifyType;
}
public Long getLastHeartbeatTime() {
return this.lastHeartbeatTime;
}
public void setLastHeartbeatTime(Long lastHeartbeatTime) {
this.lastHeartbeatTime = lastHeartbeatTime;
}
public Integer getDeviceOpenStatus() {
return this.deviceOpenStatus;
}
public void setDeviceOpenStatus(Integer deviceOpenStatus) {
this.deviceOpenStatus = deviceOpenStatus;
}
public String getDeviceTypeCategoryId() {
return this.deviceTypeCategoryId;
}
public void setDeviceTypeCategoryId(String deviceTypeCategoryId) {
this.deviceTypeCategoryId = deviceTypeCategoryId;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getOnlineStatus() {
return this.onlineStatus;
}
public void setOnlineStatus(String onlineStatus) {
this.onlineStatus = onlineStatus;
}
}
@@ -0,0 +1,99 @@
package cn.cloudwalk.elevator.device.result;
public class AcsDeviceRestructureResult {
private String parentId;
private String zoneId;
private String zoneName;
private String onlineDevices;
private String offlineDevices;
public void setParentId(String parentId) {
this.parentId = parentId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public void setOnlineDevices(String onlineDevices) {
this.onlineDevices = onlineDevices;
}
public void setOfflineDevices(String offlineDevices) {
this.offlineDevices = offlineDevices;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsDeviceRestructureResult))
return false;
AcsDeviceRestructureResult other = (AcsDeviceRestructureResult)o;
if (!other.canEqual(this))
return false;
Object this$parentId = getParentId(), other$parentId = other.getParentId();
if ((this$parentId == null) ? (other$parentId != null) : !this$parentId.equals(other$parentId))
return false;
Object this$zoneId = getZoneId(), other$zoneId = other.getZoneId();
if ((this$zoneId == null) ? (other$zoneId != null) : !this$zoneId.equals(other$zoneId))
return false;
Object this$zoneName = getZoneName(), other$zoneName = other.getZoneName();
if ((this$zoneName == null) ? (other$zoneName != null) : !this$zoneName.equals(other$zoneName))
return false;
Object this$onlineDevices = getOnlineDevices(), other$onlineDevices = other.getOnlineDevices();
if ((this$onlineDevices == null) ? (other$onlineDevices != null)
: !this$onlineDevices.equals(other$onlineDevices))
return false;
Object this$offlineDevices = getOfflineDevices(), other$offlineDevices = other.getOfflineDevices();
return !((this$offlineDevices == null) ? (other$offlineDevices != null)
: !this$offlineDevices.equals(other$offlineDevices));
}
protected boolean canEqual(Object other) {
return other instanceof AcsDeviceRestructureResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $parentId = getParentId();
result = result * 59 + (($parentId == null) ? 43 : $parentId.hashCode());
Object $zoneId = getZoneId();
result = result * 59 + (($zoneId == null) ? 43 : $zoneId.hashCode());
Object $zoneName = getZoneName();
result = result * 59 + (($zoneName == null) ? 43 : $zoneName.hashCode());
Object $onlineDevices = getOnlineDevices();
result = result * 59 + (($onlineDevices == null) ? 43 : $onlineDevices.hashCode());
Object $offlineDevices = getOfflineDevices();
return result * 59 + (($offlineDevices == null) ? 43 : $offlineDevices.hashCode());
}
public String toString() {
return "AcsDeviceRestructureResult(parentId=" + getParentId() + ", zoneId=" + getZoneId() + ", zoneName="
+ getZoneName() + ", onlineDevices=" + getOnlineDevices() + ", offlineDevices=" + getOfflineDevices() + ")";
}
public String getParentId() {
return this.parentId;
}
public String getZoneId() {
return this.zoneId;
}
public String getZoneName() {
return this.zoneName;
}
public String getOnlineDevices() {
return this.onlineDevices;
}
public String getOfflineDevices() {
return this.offlineDevices;
}
}
@@ -0,0 +1,208 @@
package cn.cloudwalk.elevator.device.result;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
public class AcsElevatorDeviceListResult extends CloudwalkBaseTimes implements Serializable {
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public void setStatus(Integer status) {
this.status = status;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof AcsElevatorDeviceListResult))
return false;
AcsElevatorDeviceListResult other = (AcsElevatorDeviceListResult)o;
if (!other.canEqual(this))
return false;
Object this$businessId = getBusinessId(), other$businessId = other.getBusinessId();
if ((this$businessId == null) ? (other$businessId != null) : !this$businessId.equals(other$businessId))
return false;
Object this$deviceId = getDeviceId(), other$deviceId = other.getDeviceId();
if ((this$deviceId == null) ? (other$deviceId != null) : !this$deviceId.equals(other$deviceId))
return false;
Object this$deviceCode = getDeviceCode(), other$deviceCode = other.getDeviceCode();
if ((this$deviceCode == null) ? (other$deviceCode != null) : !this$deviceCode.equals(other$deviceCode))
return false;
Object this$deviceName = getDeviceName(), other$deviceName = other.getDeviceName();
if ((this$deviceName == null) ? (other$deviceName != null) : !this$deviceName.equals(other$deviceName))
return false;
Object this$deviceTypeName = getDeviceTypeName(), other$deviceTypeName = other.getDeviceTypeName();
if ((this$deviceTypeName == null) ? (other$deviceTypeName != null)
: !this$deviceTypeName.equals(other$deviceTypeName))
return false;
Object this$elevatorFloorList = getElevatorFloorList(), other$elevatorFloorList = other.getElevatorFloorList();
if ((this$elevatorFloorList == null) ? (other$elevatorFloorList != null)
: !this$elevatorFloorList.equals(other$elevatorFloorList))
return false;
Object this$currentFloorId = getCurrentFloorId(), other$currentFloorId = other.getCurrentFloorId();
if ((this$currentFloorId == null) ? (other$currentFloorId != null)
: !this$currentFloorId.equals(other$currentFloorId))
return false;
Object this$currentFloor = getCurrentFloor(), other$currentFloor = other.getCurrentFloor();
if ((this$currentFloor == null) ? (other$currentFloor != null) : !this$currentFloor.equals(other$currentFloor))
return false;
Object this$currentBuilding = getCurrentBuilding(), other$currentBuilding = other.getCurrentBuilding();
if ((this$currentBuilding == null) ? (other$currentBuilding != null)
: !this$currentBuilding.equals(other$currentBuilding))
return false;
Object this$currentBuildingId = getCurrentBuildingId(), other$currentBuildingId = other.getCurrentBuildingId();
if ((this$currentBuildingId == null) ? (other$currentBuildingId != null)
: !this$currentBuildingId.equals(other$currentBuildingId))
return false;
Object this$areaName = getAreaName(), other$areaName = other.getAreaName();
if ((this$areaName == null) ? (other$areaName != null) : !this$areaName.equals(other$areaName))
return false;
Object this$status = getStatus(), other$status = other.getStatus();
return !((this$status == null) ? (other$status != null) : !this$status.equals(other$status));
}
protected boolean canEqual(Object other) {
return other instanceof AcsElevatorDeviceListResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $businessId = getBusinessId();
result = result * 59 + (($businessId == null) ? 43 : $businessId.hashCode());
Object $deviceId = getDeviceId();
result = result * 59 + (($deviceId == null) ? 43 : $deviceId.hashCode());
Object $deviceCode = getDeviceCode();
result = result * 59 + (($deviceCode == null) ? 43 : $deviceCode.hashCode());
Object $deviceName = getDeviceName();
result = result * 59 + (($deviceName == null) ? 43 : $deviceName.hashCode());
Object $deviceTypeName = getDeviceTypeName();
result = result * 59 + (($deviceTypeName == null) ? 43 : $deviceTypeName.hashCode());
Object $elevatorFloorList = getElevatorFloorList();
result = result * 59 + (($elevatorFloorList == null) ? 43 : $elevatorFloorList.hashCode());
Object $currentFloorId = getCurrentFloorId();
result = result * 59 + (($currentFloorId == null) ? 43 : $currentFloorId.hashCode());
Object $currentFloor = getCurrentFloor();
result = result * 59 + (($currentFloor == null) ? 43 : $currentFloor.hashCode());
Object $currentBuilding = getCurrentBuilding();
result = result * 59 + (($currentBuilding == null) ? 43 : $currentBuilding.hashCode());
Object $currentBuildingId = getCurrentBuildingId();
result = result * 59 + (($currentBuildingId == null) ? 43 : $currentBuildingId.hashCode());
Object $areaName = getAreaName();
result = result * 59 + (($areaName == null) ? 43 : $areaName.hashCode());
Object $status = getStatus();
return result * 59 + (($status == null) ? 43 : $status.hashCode());
}
public String toString() {
return "AcsElevatorDeviceListResult(businessId=" + getBusinessId() + ", deviceId=" + getDeviceId()
+ ", deviceCode=" + getDeviceCode() + ", deviceName=" + getDeviceName() + ", deviceTypeName="
+ getDeviceTypeName() + ", elevatorFloorList=" + getElevatorFloorList() + ", currentFloorId="
+ getCurrentFloorId() + ", currentFloor=" + getCurrentFloor() + ", currentBuilding=" + getCurrentBuilding()
+ ", currentBuildingId=" + getCurrentBuildingId() + ", areaName=" + getAreaName() + ", status="
+ getStatus() + ")";
}
public String getBusinessId() {
return this.businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public String getAreaName() {
return this.areaName;
}
public Integer getStatus() {
return this.status;
}
}
@@ -0,0 +1,115 @@
package cn.cloudwalk.elevator.device.result;
import java.io.Serializable;
public class AcsElevatorDeviceResult implements Serializable {
private static final long serialVersionUID = -90554404684210529L;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
}
@@ -0,0 +1,52 @@
package cn.cloudwalk.elevator.device.result;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleLabelResultDto;
import java.util.List;
import java.util.Objects;
public class AcsLabelElevatorResult {
private String labelId;
private List<AcsPassRuleLabelResultDto> details;
public void setLabelId(String labelId) {
this.labelId = labelId;
}
public void setDetails(List<AcsPassRuleLabelResultDto> details) {
this.details = details;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AcsLabelElevatorResult)) {
return false;
}
AcsLabelElevatorResult other = (AcsLabelElevatorResult)o;
if (!other.canEqual(this)) {
return false;
}
return Objects.equals(labelId, other.labelId) && Objects.equals(details, other.details);
}
protected boolean canEqual(Object other) {
return other instanceof AcsLabelElevatorResult;
}
public int hashCode() {
return Objects.hash(labelId, details);
}
public String toString() {
return "AcsLabelElevatorResult(labelId=" + getLabelId() + ", details=" + getDetails() + ")";
}
public String getLabelId() {
return this.labelId;
}
public List<AcsPassRuleLabelResultDto> getDetails() {
return this.details;
}
}
@@ -0,0 +1,68 @@
package cn.cloudwalk.elevator.device.result;
public class KeyValueResult {
private String key;
private Long time;
private String keyA;
public void setKey(String key) {
this.key = key;
}
public void setTime(Long time) {
this.time = time;
}
public void setKeyA(String keyA) {
this.keyA = keyA;
}
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof KeyValueResult))
return false;
KeyValueResult other = (KeyValueResult)o;
if (!other.canEqual(this))
return false;
Object this$key = getKey(), other$key = other.getKey();
if ((this$key == null) ? (other$key != null) : !this$key.equals(other$key))
return false;
Object this$time = getTime(), other$time = other.getTime();
if ((this$time == null) ? (other$time != null) : !this$time.equals(other$time))
return false;
Object this$keyA = getKeyA(), other$keyA = other.getKeyA();
return !((this$keyA == null) ? (other$keyA != null) : !this$keyA.equals(other$keyA));
}
protected boolean canEqual(Object other) {
return other instanceof KeyValueResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $key = getKey();
result = result * 59 + (($key == null) ? 43 : $key.hashCode());
Object $time = getTime();
result = result * 59 + (($time == null) ? 43 : $time.hashCode());
Object $keyA = getKeyA();
return result * 59 + (($keyA == null) ? 43 : $keyA.hashCode());
}
public String toString() {
return "KeyValueResult(key=" + getKey() + ", time=" + getTime() + ", keyA=" + getKeyA() + ")";
}
public String getKey() {
return this.key;
}
public Long getTime() {
return this.time;
}
public String getKeyA() {
return this.keyA;
}
}
@@ -0,0 +1,13 @@
package cn.cloudwalk.elevator.device.service;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.elevator.device.param.AcsRestructureBindingParam;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto;
import java.util.List;
public interface AcsDeviceTaskService {
void updateFloors(AcsRestructureBindingParam paramAcsRestructureBindingParam,
List<AcsPassRuleImageResultDto> paramList, List<String> paramList1,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
}
@@ -0,0 +1,74 @@
package cn.cloudwalk.elevator.device.service;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryFoDTO;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
import cn.cloudwalk.elevator.device.param.AcsDeviceQueryParam;
import cn.cloudwalk.elevator.device.param.AcsDeviceRestructureTaskParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceAddParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceEditParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceQueryByIdParam;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceQueryParam;
import cn.cloudwalk.elevator.device.param.AcsRestructureBindingParam;
import cn.cloudwalk.elevator.device.param.AcsRestructureQueryParam;
import java.util.List;
public interface AcsElevatorDeviceService {
Integer add(AcsElevatorDeviceAddParam paramAcsElevatorDeviceAddParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
Integer edit(AcsElevatorDeviceEditParam paramAcsElevatorDeviceEditParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
Integer delete(List<String> paramList, CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
String getBuildingId(AcsElevatorDeviceQueryParam paramAcsElevatorDeviceQueryParam) throws ServiceException;
String getBusinessId(AcsElevatorDeviceQueryParam paramAcsElevatorDeviceQueryParam) throws ServiceException;
CloudwalkResult<CloudwalkPageAble<AcsElevatorDeviceResultDTO>> get(
AcsElevatorDeviceQueryParam paramAcsElevatorDeviceQueryParam, CloudwalkCallContext paramCloudwalkCallContext)
throws ServiceException;
CloudwalkResult<CloudwalkPageAble<DeviceResult>> devicePage(AcsDeviceQueryParam paramAcsDeviceQueryParam,
CloudwalkPageInfo paramCloudwalkPageInfo, CloudwalkCallContext paramCloudwalkCallContext)
throws ServiceException;
List<AcsElevatorDeviceQueryFoDTO> getFo(AcsElevatorDeviceQueryParam paramAcsElevatorDeviceQueryParam)
throws ServiceException;
AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdParam paramAcsElevatorDeviceQueryByIdParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
AcsElevatorDeviceResultDTO getByDeciveCode(String paramString) throws ServiceException;
CloudwalkResult listUnbindFloors(AcsRestructureQueryParam paramAcsRestructureQueryParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult listFloors(AcsRestructureQueryParam paramAcsRestructureQueryParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult listCondition(AcsRestructureQueryParam paramAcsRestructureQueryParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult listConditionByLabelIds(AcsRestructureQueryParam paramAcsRestructureQueryParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<String> bindingFloors(AcsRestructureBindingParam paramAcsRestructureBindingParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<String> bindingPerson(AcsRestructureBindingParam paramAcsRestructureBindingParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<AcsDeviceTaskDTO> getTask(AcsDeviceRestructureTaskParam paramAcsDeviceRestructureTaskParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<Boolean> setTaskStop(AcsDeviceRestructureTaskParam paramAcsDeviceRestructureTaskParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
}
@@ -0,0 +1,160 @@
package cn.cloudwalk.elevator.device.setting.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.application.param.ApplicationImageStoreAddParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.application.param.ApplicationImageStoreDelParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.application.service.ApplicationImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceImageStoreParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreDelParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreListResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.common.AbstractAcsDeviceService;
import cn.cloudwalk.elevator.device.setting.param.DeviceImageStoreAppBindParam;
import cn.cloudwalk.elevator.device.setting.param.DeviceImageStoreAppUnbindParam;
import cn.cloudwalk.elevator.device.setting.service.AcsDeviceImageStoreAppBindService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import java.util.Collections;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
@Service
public class AcsDeviceImageStoreAppBindServiceImpl extends AbstractAcsDeviceService
implements AcsDeviceImageStoreAppBindService {
@Resource
private ApplicationImageStoreService applicationImageStoreService;
@Resource
private DeviceImageStoreService deviceImageStoreService;
@Resource
private ImageStoreService imageStoreService;
public CloudwalkResult<Boolean> bindAppImageStoreDevice(DeviceImageStoreAppBindParam param,
CloudwalkCallContext context) throws ServiceException {
bindApplicationImageStore(param, context);
return CloudwalkResult.success(Boolean.valueOf(true));
}
public CloudwalkResult<Boolean> bindDeviceAndImageStore(DeviceImageStoreAppBindParam param,
CloudwalkCallContext context) throws ServiceException {
try {
bindDeviceImageStore(param, context);
} catch (ServiceException e) {
this.logger.error("设备图库关联失败,图库id={},原因:{}", param.getImageStoreId(), e.getMessage());
throw new ServiceException("设备图库关联失败");
}
return CloudwalkResult.success(Boolean.valueOf(true));
}
private void bindApplicationImageStore(DeviceImageStoreAppBindParam param, CloudwalkCallContext context)
throws ServiceException {
ApplicationImageStoreAddParam applicationImageStoreAddParam = new ApplicationImageStoreAddParam();
applicationImageStoreAddParam.setApplicationId(param.getApplicationId());
applicationImageStoreAddParam.setImageStoreId(param.getImageStoreId());
CloudwalkResult<Boolean> applicationImageStoreAddResult =
this.applicationImageStoreService.add(applicationImageStoreAddParam, context);
if (!applicationImageStoreAddResult.isSuccess()) {
this.logger.error("添加应用图库关联失败,原因:{}", applicationImageStoreAddResult.getMessage());
throw new ServiceException(applicationImageStoreAddResult.getCode(),
"添加应用图库关联失败,原因:" + applicationImageStoreAddResult.getMessage());
}
}
private void bindDeviceImageStore(DeviceImageStoreAppBindParam param, CloudwalkCallContext context)
throws ServiceException {
DeviceImageStoreParam imageStoreSaveParam = new DeviceImageStoreParam();
imageStoreSaveParam.setDeviceId(param.getDeviceId());
imageStoreSaveParam.setImageStoreId(param.getImageStoreId());
CloudwalkResult<Boolean> saveDeviceResult = this.deviceImageStoreService.add(imageStoreSaveParam, context);
if (!saveDeviceResult.isSuccess()) {
this.logger.error("绑定设备与图库失败,设备id={},图库id={},原因:{}",
new Object[] {param.getDeviceId(), param.getImageStoreId(), saveDeviceResult.getMessage()});
throw new ServiceException("绑定设备与图库失败");
}
}
public CloudwalkResult<Boolean> unbindAppImageStoreDevice(DeviceImageStoreAppUnbindParam param,
CloudwalkCallContext context) throws ServiceException {
deviceUnBindImageStore(context, param.getDeviceId(), param.getImageStoreId(), param.getDeviceCode());
applicationUnBindImageStore(param.getApplicationId(), param.getImageStoreId(), context);
List<ImageStoreListResult> imageStoreList =
getImageStoreResult(param.getImageStoreId(), param.getDeviceCode(), context);
if (!CollectionUtils.isEmpty(imageStoreList)) {
deleteImageStore(param.getImageStoreId(), context);
}
return CloudwalkResult.success(Boolean.valueOf(true));
}
public CloudwalkResult<Boolean> deleteImageStore(DeviceImageStoreAppUnbindParam param, CloudwalkCallContext context)
throws ServiceException {
applicationUnBindImageStore(param.getApplicationId(), param.getImageStoreId(), context);
deleteImageStore(param.getImageStoreId(), context);
return CloudwalkResult.success(Boolean.valueOf(true));
}
public CloudwalkResult<Boolean> unbindAppImageStoreDeviceNotDeleteImage(DeviceImageStoreAppUnbindParam param,
CloudwalkCallContext context) throws ServiceException {
deviceUnBindImageStore(context, param.getDeviceId(), param.getImageStoreId(), param.getDeviceCode());
return CloudwalkResult.success(Boolean.valueOf(true));
}
private List<ImageStoreListResult> getImageStoreResult(String imageStoreId, String deviceCode,
CloudwalkCallContext context) throws ServiceException {
ImageStoreQueryParam imageStoreQueryParam = new ImageStoreQueryParam();
imageStoreQueryParam.setIds(Collections.singletonList(imageStoreId));
imageStoreQueryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<List<ImageStoreListResult>> imageStoreList =
this.imageStoreService.list(imageStoreQueryParam, context);
if (!imageStoreList.isSuccess()) {
this.logger.error("查询设备图库失败,设备编号:{},图库id:{},原因:{}",
new Object[] {deviceCode, imageStoreId, imageStoreList.getMessage()});
throw new ServiceException("查询设备图库失败,设备编号:{}" + deviceCode);
}
return (List<ImageStoreListResult>)imageStoreList.getData();
}
private void deviceUnBindImageStore(CloudwalkCallContext context, String deviceId, String imageStoreId,
String deviceCode) throws ServiceException {
DeviceImageStoreParam deviceImageStoreParam = new DeviceImageStoreParam();
deviceImageStoreParam.setDeviceId(deviceId);
deviceImageStoreParam.setImageStoreId(imageStoreId);
CloudwalkResult<Boolean> deleteDeviceImageStoreResult =
this.deviceImageStoreService.delete(deviceImageStoreParam, context);
this.logger.info("删除设备图库关联:图库id={},结果:{}", imageStoreId, deleteDeviceImageStoreResult.getMessage());
if (!deleteDeviceImageStoreResult.isSuccess()) {
this.logger.error("删除设备图库关联失败,设备编号:{},图库id:{},原因:{}",
new Object[] {deviceCode, imageStoreId, deleteDeviceImageStoreResult.getMessage()});
throw new ServiceException("删除设备图库关联失败,设备编号:" + deviceCode);
}
}
private void deleteImageStore(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
ImageStoreDelParam imageStoreDelParam = new ImageStoreDelParam();
imageStoreDelParam.setId(imageStoreId);
imageStoreDelParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult<Boolean> deleteImageStoreResult = this.imageStoreService.delete(imageStoreDelParam, context);
if (!deleteImageStoreResult.isSuccess()) {
this.logger.error("删除图库失败,图库id:{},原因:{}", imageStoreId, deleteImageStoreResult.getMessage());
throw new ServiceException("删除图库失败");
}
}
public void applicationUnBindImageStore(String applicationId, String imageStoreId, CloudwalkCallContext context)
throws ServiceException {
ApplicationImageStoreDelParam applicationImageStoreDelParam = new ApplicationImageStoreDelParam();
applicationImageStoreDelParam.setApplicationId(applicationId);
applicationImageStoreDelParam.setImageStoreId(imageStoreId);
CloudwalkResult<Boolean> deleteApplicationImageStoreResult =
this.applicationImageStoreService.delete(applicationImageStoreDelParam, context);
this.logger.info("删除应用图库关联:图库id={},应用id={},结果:{}",
new Object[] {imageStoreId, applicationId, deleteApplicationImageStoreResult.getMessage()});
if (!deleteApplicationImageStoreResult.isSuccess()) {
this.logger.error("应用与图库解绑失败,应用id:{},图库id:{},原因:{}",
new Object[] {applicationId, imageStoreId, deleteApplicationImageStoreResult.getMessage()});
throw new ServiceException("应用与图库解绑失败");
}
}
}
@@ -0,0 +1,74 @@
package cn.cloudwalk.elevator.device.setting.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceSettingQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceSettingResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceSettingService;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.common.AbstractAcsDeviceService;
import cn.cloudwalk.elevator.device.setting.param.AcsDeviceTemperatureSettingParam;
import cn.cloudwalk.elevator.device.setting.result.AcsDeviceSettingResult;
import cn.cloudwalk.elevator.device.setting.result.AcsSettingAttr;
import cn.cloudwalk.elevator.device.setting.service.AcsDeviceSettingService;
import cn.cloudwalk.elevator.em.AcsDeviceSettingEnum;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AcsDeviceSettingServiceImpl extends AbstractAcsDeviceService implements AcsDeviceSettingService {
@Autowired
private DeviceSettingService deviceSettingService;
public CloudwalkResult<AcsDeviceSettingResult> getTemperatureSetting(AcsDeviceTemperatureSettingParam param,
CloudwalkCallContext context) throws ServiceException {
AcsDeviceSettingResult result = new AcsDeviceSettingResult();
result.setDeviceId(param.getDeviceId());
DeviceSettingQueryParam deviceSettingQueryParam = new DeviceSettingQueryParam();
deviceSettingQueryParam.setDeviceIds(Lists.newArrayList(param.getDeviceId()));
deviceSettingQueryParam.setHasDefault(Short.valueOf((short)0));
CloudwalkResult<List<DeviceSettingResult>> deviceSettingQueryResult =
this.deviceSettingService.query(deviceSettingQueryParam);
if (deviceSettingQueryResult.isSuccess()) {
if (CollectionUtils.isNotEmpty((Collection)deviceSettingQueryResult.getData())) {
DeviceSettingResult deviceSettingResult =
((List<DeviceSettingResult>)deviceSettingQueryResult.getData()).get(0);
List<DeviceSettingResult.DeviceSettings> settingResult = deviceSettingResult.getSettings();
if (CollectionUtils.isNotEmpty(settingResult)) {
List<AcsSettingAttr> acsSettingAttrs = new ArrayList<>();
recursionSettingAttr(acsSettingAttrs, settingResult);
List<AcsSettingAttr> attrs = (List<AcsSettingAttr>)acsSettingAttrs.stream()
.filter(s -> (AcsDeviceSettingEnum.TEMP_MIN.getCode().equals(s.getCode())
|| AcsDeviceSettingEnum.TEMP_STATE.getCode().equals(s.getCode())
|| AcsDeviceSettingEnum.TEMP_THRESHOLD.getCode().equals(s.getCode())))
.collect(Collectors.toList());
result.setAttrs(attrs);
}
}
return CloudwalkResult.success(result);
}
return CloudwalkResult.fail(deviceSettingQueryResult.getCode(), deviceSettingQueryResult.getMessage());
}
private void recursionSettingAttr(List<AcsSettingAttr> acsSettingAttrs,
List<DeviceSettingResult.DeviceSettings> deviceSettings) {
if (CollectionUtils.isNotEmpty(deviceSettings))
for (DeviceSettingResult.DeviceSettings deviceSetting : deviceSettings) {
AcsSettingAttr acsSettingAttr = new AcsSettingAttr();
acsSettingAttr.setName(deviceSetting.getSettingAttrName());
acsSettingAttr.setValue(deviceSetting.getSettingAttrValue());
acsSettingAttr.setRemark(deviceSetting.getSettingAttrRemark());
acsSettingAttr.setCode(deviceSetting.getSettingAttrCode());
acsSettingAttr.setId(deviceSetting.getId());
acsSettingAttr.setParentId(deviceSetting.getSettingParentId());
acsSettingAttrs.add(acsSettingAttr);
recursionSettingAttr(acsSettingAttrs, deviceSetting.getChild());
}
}
}
@@ -0,0 +1,17 @@
package cn.cloudwalk.elevator.device.setting.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsDeviceTemperatureSettingParam implements Serializable {
@NotBlank(message = "76260003")
private String deviceId;
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
@@ -0,0 +1,34 @@
package cn.cloudwalk.elevator.device.setting.param;
import java.io.Serializable;
public class DeviceImageStoreAppBindParam implements Serializable {
private static final long serialVersionUID = -5165610910023828727L;
private String applicationId;
private String imageStoreId;
private String deviceId;
public String getApplicationId() {
return this.applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
@@ -0,0 +1,42 @@
package cn.cloudwalk.elevator.device.setting.param;
import java.io.Serializable;
public class DeviceImageStoreAppUnbindParam implements Serializable {
private String applicationId;
private String imageStoreId;
private String deviceId;
private String deviceCode;
public String getApplicationId() {
return this.applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
}
@@ -0,0 +1,26 @@
package cn.cloudwalk.elevator.device.setting.result;
import java.io.Serializable;
import java.util.List;
public class AcsDeviceSettingResult implements Serializable {
private static final long serialVersionUID = -6934487366934322212L;
private String deviceId;
private List<AcsSettingAttr> attrs;
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<AcsSettingAttr> getAttrs() {
return this.attrs;
}
public void setAttrs(List<AcsSettingAttr> attrs) {
this.attrs = attrs;
}
}
@@ -0,0 +1,61 @@
package cn.cloudwalk.elevator.device.setting.result;
import java.io.Serializable;
public class AcsSettingAttr implements Serializable {
private static final long serialVersionUID = 1670487736253830287L;
private String name;
private String value;
private String remark;
private String code;
private String id;
private String parentId;
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
}
@@ -0,0 +1,26 @@
package cn.cloudwalk.elevator.device.setting.service;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.device.setting.param.DeviceImageStoreAppBindParam;
import cn.cloudwalk.elevator.device.setting.param.DeviceImageStoreAppUnbindParam;
public interface AcsDeviceImageStoreAppBindService {
CloudwalkResult<Boolean> bindAppImageStoreDevice(DeviceImageStoreAppBindParam paramDeviceImageStoreAppBindParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<Boolean> bindDeviceAndImageStore(DeviceImageStoreAppBindParam paramDeviceImageStoreAppBindParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<Boolean> unbindAppImageStoreDevice(
DeviceImageStoreAppUnbindParam paramDeviceImageStoreAppUnbindParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<Boolean> deleteImageStore(DeviceImageStoreAppUnbindParam paramDeviceImageStoreAppUnbindParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
CloudwalkResult<Boolean> unbindAppImageStoreDeviceNotDeleteImage(
DeviceImageStoreAppUnbindParam paramDeviceImageStoreAppUnbindParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
}
@@ -0,0 +1,13 @@
package cn.cloudwalk.elevator.device.setting.service;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.device.setting.param.AcsDeviceTemperatureSettingParam;
import cn.cloudwalk.elevator.device.setting.result.AcsDeviceSettingResult;
public interface AcsDeviceSettingService {
CloudwalkResult<AcsDeviceSettingResult> getTemperatureSetting(
AcsDeviceTemperatureSettingParam paramAcsDeviceTemperatureSettingParam,
CloudwalkCallContext paramCloudwalkCallContext) throws ServiceException;
}