mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
fix: relocate cwos-portal decompiled output to correct path; remove nested directory
Former-commit-id: dc30d42a8c55ed8b2382a41dc2434233fbed9930
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
package cn.cloudwalk.client.davinci.portal.file.param.part;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/** 分片追加参数(与存储层 append 调用约定一致)。 */
|
||||
public class FilePartAppendParam<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String filePath;
|
||||
private Integer partNumber;
|
||||
private String uploadId;
|
||||
private T content;
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public Integer getPartNumber() {
|
||||
return partNumber;
|
||||
}
|
||||
|
||||
public void setPartNumber(Integer partNumber) {
|
||||
this.partNumber = partNumber;
|
||||
}
|
||||
|
||||
public String getUploadId() {
|
||||
return uploadId;
|
||||
}
|
||||
|
||||
public void setUploadId(String uploadId) {
|
||||
this.uploadId = uploadId;
|
||||
}
|
||||
|
||||
public T getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(T content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cn.cloudwalk.client.davinci.portal.file.param.part;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/** 分片结束参数(与 PartFinishDTO 字段对齐)。 */
|
||||
public class FilePartFinishParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String uploadId;
|
||||
private Long fileSize;
|
||||
private String filePath;
|
||||
private Integer returnType;
|
||||
|
||||
public String getUploadId() {
|
||||
return uploadId;
|
||||
}
|
||||
|
||||
public void setUploadId(String uploadId) {
|
||||
this.uploadId = uploadId;
|
||||
}
|
||||
|
||||
public Long getFileSize() {
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
public void setFileSize(Long fileSize) {
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public Integer getReturnType() {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
public void setReturnType(Integer returnType) {
|
||||
this.returnType = returnType;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.cloudwalk.client.davinci.portal.file.param.part;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/** 分片上传初始化参数(与 PartInitDTO 字段对齐,供 BeanCopy 与业务层使用)。 */
|
||||
public class FilePartInitParam implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String fileName;
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package cn.cloudwalk.client.davinci.portal.file.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/** 分片初始化/追加返回(与 PartInitResultDTO 字段对齐)。 */
|
||||
public class FilePartResult implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String filePath;
|
||||
private String uploadId;
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getUploadId() {
|
||||
return uploadId;
|
||||
}
|
||||
|
||||
public void setUploadId(String uploadId) {
|
||||
this.uploadId = uploadId;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package cn.cloudwalk.elevator;
|
||||
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionContextHolder;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionObject;
|
||||
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@Configuration
|
||||
public class AcsFeignConfiguration implements RequestInterceptor {
|
||||
protected final Logger logger = LoggerFactory.getLogger(AcsFeignConfiguration.class);
|
||||
@Autowired
|
||||
private CloudwalkSessionContextHolder cloudwalkSessionContextHolder;
|
||||
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
Map<String, String> map = FeignThreadLocalUtil.get();
|
||||
if (map != null && !map.isEmpty()) {
|
||||
requestTemplate.header("platformuserid", new String[] {map.get("platformuserid")});
|
||||
requestTemplate.header("loginid", new String[] {map.get("loginid")});
|
||||
requestTemplate.header("businessid", new String[] {map.get("businessid")});
|
||||
requestTemplate.header("username", new String[] {map.get("username")});
|
||||
requestTemplate.header("applicationid", new String[] {map.get("applicationid")});
|
||||
requestTemplate.header("authorization", new String[] {map.get("authorization")});
|
||||
this.logger.info("feign调用配置header参数, businessId={}, threadId={}",
|
||||
requestTemplate.headers().get("businessid"), Long.valueOf(Thread.currentThread().getId()));
|
||||
} else {
|
||||
Map<String, Collection<String>> headerMap = requestTemplate.headers();
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
if (!headerMap.containsKey("platformuserid")) {
|
||||
requestTemplate.header("platformuserid", new String[] {request.getHeader("platformuserid")});
|
||||
}
|
||||
if (!headerMap.containsKey("loginid")) {
|
||||
requestTemplate.header("loginid", new String[] {request.getHeader("loginid")});
|
||||
}
|
||||
if (!headerMap.containsKey("businessid")) {
|
||||
requestTemplate.header("businessid", new String[] {request.getHeader("businessid")});
|
||||
}
|
||||
if (!headerMap.containsKey("username")) {
|
||||
requestTemplate.header("username", new String[] {request.getHeader("username")});
|
||||
}
|
||||
if (!headerMap.containsKey("applicationid")) {
|
||||
requestTemplate.header("applicationid", new String[] {request.getHeader("applicationid")});
|
||||
}
|
||||
if (!headerMap.containsKey("authorization")) {
|
||||
requestTemplate.header("authorization", new String[] {request.getHeader("authorization")});
|
||||
}
|
||||
CloudwalkSessionObject session = this.cloudwalkSessionContextHolder.getSession();
|
||||
if (StringUtils.isBlank(request.getHeader("businessid")) && session != null) {
|
||||
requestTemplate.header("businessid", new String[] {session.getCompany().getCompanyId()});
|
||||
}
|
||||
if (StringUtils.isBlank(request.getHeader("applicationid")) && session != null)
|
||||
requestTemplate.header("applicationid", new String[] {session.getApplicationId()});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package cn.cloudwalk.elevator;
|
||||
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionContextHolder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/** 未扫描 {@code cn.cloudwalk.web} 时,等价于 LocaleConfiguration 中的 SessionHolder Bean。 */
|
||||
@Configuration
|
||||
public class CloudwalkSessionHolderConfiguration {
|
||||
|
||||
@Bean
|
||||
public CloudwalkSessionContextHolder cloudwalkSessionContextHolder() {
|
||||
return new CloudwalkSessionContextHolder();
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package cn.cloudwalk.elevator;
|
||||
|
||||
import cn.cloudwalk.event.EnableCloudwalkEvent;
|
||||
import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
@EnableCloudwalkEvent
|
||||
@EnableAsync
|
||||
@EnableCaching
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
@EnableFeignClients(basePackages = {"cn.cloudwalk.elevator", "cn.cloudwalk.rest.cwoscomponent"})
|
||||
@MapperScan({
|
||||
"cn.cloudwalk.elevator.record.dao",
|
||||
"cn.cloudwalk.elevator.device.dao",
|
||||
"cn.cloudwalk.elevator.passrule.dao",
|
||||
"cn.cloudwalk.elevator.person.dao",
|
||||
"cn.cloudwalk.elevator.codeElevatorArea.dao"
|
||||
})
|
||||
@SpringBootApplication(
|
||||
exclude = {PageHelperAutoConfiguration.class},
|
||||
scanBasePackages = {"cn.cloudwalk.elevator", "cn.cloudwalk.rest.cwoscomponent"})
|
||||
public class ElevatorApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ElevatorApplication.class, args);
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package cn.cloudwalk.elevator;
|
||||
|
||||
import cn.cloudwalk.elevator.util.DateUtils;
|
||||
import com.google.common.collect.Range;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
|
||||
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
|
||||
import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
|
||||
import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
public class YearlyShardingAlgorithm implements PreciseShardingAlgorithm<Long>, RangeShardingAlgorithm<Long> {
|
||||
public String doSharding(Collection<String> availableTargetNames, PreciseShardingValue<Long> shardingValue) {
|
||||
Long time = (Long)shardingValue.getValue();
|
||||
String suffix = DateUtils.formatDate(new Date(time.longValue()), "yyyy");
|
||||
String logicTableName = shardingValue.getLogicTableName();
|
||||
String actualTableName = logicTableName + "_" + suffix;
|
||||
if (!availableTargetNames.contains(actualTableName))
|
||||
;
|
||||
return actualTableName;
|
||||
}
|
||||
|
||||
public Collection<String> doSharding(Collection<String> availableTargetNames,
|
||||
RangeShardingValue<Long> shardingValue) {
|
||||
Collection<String> availables = new ArrayList<>();
|
||||
Range<Long> valueRange = shardingValue.getValueRange();
|
||||
if (!CollectionUtils.isEmpty(availableTargetNames)) {
|
||||
Integer lowerBoundYear = Integer.valueOf(-2147483648);
|
||||
Integer upperBoundYear = Integer.valueOf(2147483647);
|
||||
if (valueRange.hasLowerBound()) {
|
||||
lowerBoundYear = Integer.valueOf(Integer
|
||||
.parseInt(DateUtils.formatDate(new Date(((Long)valueRange.lowerEndpoint()).longValue()), "YYYY")));
|
||||
}
|
||||
if (valueRange.hasUpperBound()) {
|
||||
upperBoundYear = Integer.valueOf(Integer
|
||||
.parseInt(DateUtils.formatDate(new Date(((Long)valueRange.upperEndpoint()).longValue()), "YYYY")));
|
||||
}
|
||||
for (String targetTable : availableTargetNames) {
|
||||
Integer tableNameSuffix = Integer.valueOf(Integer.parseInt(
|
||||
targetTable.substring(targetTable.lastIndexOf('_') + 1, targetTable.lastIndexOf('_') + 5)));
|
||||
if (tableNameSuffix.compareTo(lowerBoundYear) < 0 || tableNameSuffix.compareTo(upperBoundYear) > 0) {
|
||||
continue;
|
||||
}
|
||||
availables.add(targetTable);
|
||||
}
|
||||
}
|
||||
return availables;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package cn.cloudwalk.elevator.annontation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 标记字段与达芬奇(Davinci)图片存储或展示相关的元信息。
|
||||
* <p>
|
||||
* 所在包名 {@code annontation} 为历史拼写,与既有引用保持一致,请勿单独重命名包路径。
|
||||
*/
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface DavinciPic {}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package cn.cloudwalk.elevator.cache;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@Configuration
|
||||
public class CacheOverrideConfig {
|
||||
public static final String CACHE_NAME_APPLICATIONIDS = "ACS_Applicationids";
|
||||
public static final String CACHE_NAME_ACS_DEVICE_TYPES = "ACS_DeviceTypesCache";
|
||||
public static final String CACHE_NAME_ACS_DEVICE_TYPE_FEATURES = "ACS_DeviceTypeFeaturesCache";
|
||||
public static final String CACHE_NAME_ACS_DEVICE_ATTRS = "ACS_DeviceAttrsCache";
|
||||
public static final String CACHE_NAME_ACS_RECORD_STATISTICS = "ACS_RecordStatisticsCache";
|
||||
public static final String CACHE_NAME_ACS_DEVICE_TREE = "ACS_DeviceTreeCache";
|
||||
public static final String CACHE_NAME_ACS_AREA_TREE = "ACS_AreaTreeCache";
|
||||
public static final String CACHE_KEY_APPLICATION_IDS_PREFIX = "acs_applicationIds:";
|
||||
public static final String CACHE_KEY_ACS_DEVICE_TYPES_PREFIX = "acs_deviceTypes:";
|
||||
public static final String CACHE_KEY_ACS_DEVICE_TYPE_FEATURES_PREFIX = "acs_deviceTypeFeatures:";
|
||||
public static final String CACHE_KEY_ACS_EXPORT_PREFIX = "acs_export_prefix:";
|
||||
public static final String CACHE_KEY_ACS_DEVICE_ATTRS_PREFIX = "acs_deviceAttrs:";
|
||||
public static final String CACHE_KEY_ACS_RECORD_STATISTICS_PREFIX = "acs_recordStatistics:";
|
||||
public static final String CACHE_KEY_ACS_DEVICE_TREE_PREFIX = "acs_deviceTreeCache";
|
||||
public static final String CACHE_KEY_ACS_AREA_TREE_PREFIX = "acs_areaTreeCache:";
|
||||
|
||||
@Primary
|
||||
@Bean({"redisTemplate"})
|
||||
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate();
|
||||
redisTemplate.setConnectionFactory(redisConnectionFactory);
|
||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||
objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
||||
jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
|
||||
redisTemplate.setValueSerializer((RedisSerializer)jackson2JsonRedisSerializer);
|
||||
redisTemplate.setKeySerializer((RedisSerializer)stringRedisSerializer);
|
||||
redisTemplate.afterPropertiesSet();
|
||||
return redisTemplate;
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package cn.cloudwalk.elevator.cacheable;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.param.DeviceAreaTreeParam;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.result.AreaTreeResult;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.service.SysettingAreaService;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AcsAreaTreeCacheableService {
|
||||
@Resource
|
||||
private SysettingAreaService sysettingAreaService;
|
||||
|
||||
@Cacheable(cacheNames = {"ACS_AreaTreeCache"},
|
||||
key = "T(cn.cloudwalk.elevator.cache.CacheOverrideConfig).CACHE_KEY_ACS_AREA_TREE_PREFIX + #param.businessId")
|
||||
public CloudwalkResult<List<AreaTreeResult>> tree(DeviceAreaTreeParam param, CloudwalkCallContext context) {
|
||||
return this.sysettingAreaService.tree(param, context);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.dao;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import java.util.List;
|
||||
|
||||
public interface AcsElevatorCodeDao {
|
||||
Integer insertNew(AcsElevatorCodeDTO paramAcsElevatorCodeDTO) throws ServiceException;
|
||||
|
||||
Integer updateOld(AcsElevatorCodeDTO paramAcsElevatorCodeDTO) throws ServiceException;
|
||||
|
||||
AcsElevatorCodeResultDTO get(AcsElevatorCodeDTO paramAcsElevatorCodeDTO);
|
||||
|
||||
AcsElevatorCodeResultDTO getFirstByParentId(String paramString);
|
||||
|
||||
List<AcsElevatorCodeResultDTO> listByZoneIds(List<String> zoneIds);
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.dto;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorCodeDTO extends CloudwalkBaseTimes implements Serializable {
|
||||
private String zoneId;
|
||||
private String code;
|
||||
private String parentId;
|
||||
private Integer isFirst;
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getIsFirst() {
|
||||
return this.isFirst;
|
||||
}
|
||||
|
||||
public void setIsFirst(Integer isFirst) {
|
||||
this.isFirst = isFirst;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.dto;
|
||||
|
||||
public class AcsElevatorCodeQueryDTO {
|
||||
private String zoneId;
|
||||
private String id;
|
||||
private String zoneName;
|
||||
private String zoneType;
|
||||
private String code;
|
||||
private Integer isFirst;
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getZoneName() {
|
||||
return this.zoneName;
|
||||
}
|
||||
|
||||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return this.zoneType;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getIsFirst() {
|
||||
return this.isFirst;
|
||||
}
|
||||
|
||||
public void setIsFirst(Integer isFirst) {
|
||||
this.isFirst = isFirst;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.dto;
|
||||
|
||||
public class AcsElevatorCodeResultDTO {
|
||||
private String zoneId;
|
||||
private String code;
|
||||
private Integer isFirst;
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getIsFirst() {
|
||||
return this.isFirst;
|
||||
}
|
||||
|
||||
public void setIsFirst(Integer isFirst) {
|
||||
this.isFirst = isFirst;
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.impl;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dao.AcsElevatorCodeDao;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.mapper.AcsElevatorCodeMapper;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class AcsElevatorCodeDaoImpl implements AcsElevatorCodeDao {
|
||||
@Resource
|
||||
private AcsElevatorCodeMapper acsElevatorCodeMapper;
|
||||
|
||||
public Integer insertNew(AcsElevatorCodeDTO dto) throws ServiceException {
|
||||
return Integer.valueOf(this.acsElevatorCodeMapper.insertNew(dto));
|
||||
}
|
||||
|
||||
public Integer updateOld(AcsElevatorCodeDTO dto) throws ServiceException {
|
||||
return Integer.valueOf(this.acsElevatorCodeMapper.updateOld(dto));
|
||||
}
|
||||
|
||||
public AcsElevatorCodeResultDTO get(AcsElevatorCodeDTO dto) {
|
||||
return this.acsElevatorCodeMapper.get(dto);
|
||||
}
|
||||
|
||||
public AcsElevatorCodeResultDTO getFirstByParentId(String parentId) {
|
||||
return this.acsElevatorCodeMapper.getFirstByParentId(parentId);
|
||||
}
|
||||
|
||||
public List<AcsElevatorCodeResultDTO> listByZoneIds(List<String> zoneIds) {
|
||||
return this.acsElevatorCodeMapper.listByZoneIds(zoneIds);
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.impl;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dao.AcsElevatorCodeDao;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.param.AcsElevatorCodeParam;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.service.AcsElevatorCodeService;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@Repository
|
||||
public class AcsElevatorCodeServiceImpl implements AcsElevatorCodeService {
|
||||
@Resource
|
||||
private AcsElevatorCodeDao acsElevatorCodeDao;
|
||||
protected final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public Integer insertNew(AcsElevatorCodeParam param) throws ServiceException {
|
||||
AcsElevatorCodeDTO dto = (AcsElevatorCodeDTO)BeanCopyUtils.copyProperties(param, AcsElevatorCodeDTO.class);
|
||||
Long createTime = Long.valueOf(System.currentTimeMillis());
|
||||
dto.setCreateTime(createTime);
|
||||
dto.setLastUpdateTime(createTime);
|
||||
return this.acsElevatorCodeDao.insertNew(dto);
|
||||
}
|
||||
|
||||
public Integer updateOld(AcsElevatorCodeParam param) throws ServiceException {
|
||||
AcsElevatorCodeDTO dto = (AcsElevatorCodeDTO)BeanCopyUtils.copyProperties(param, AcsElevatorCodeDTO.class);
|
||||
Long nowTime = Long.valueOf(System.currentTimeMillis());
|
||||
dto.setLastUpdateTime(nowTime);
|
||||
return this.acsElevatorCodeDao.updateOld(dto);
|
||||
}
|
||||
|
||||
public AcsElevatorCodeResultDTO get(AcsElevatorCodeParam param) throws ServiceException {
|
||||
AcsElevatorCodeDTO dto = (AcsElevatorCodeDTO)BeanCopyUtils.copyProperties(param, AcsElevatorCodeDTO.class);
|
||||
AcsElevatorCodeResultDTO result = this.acsElevatorCodeDao.get(dto);
|
||||
if (!ObjectUtils.isEmpty(result)) {
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public AcsElevatorCodeResultDTO getFirstByParentId(String parentId) throws ServiceException {
|
||||
return this.acsElevatorCodeDao.getFirstByParentId(parentId);
|
||||
}
|
||||
|
||||
public Map<String, AcsElevatorCodeResultDTO> mapByZoneIds(List<String> zoneIds) throws ServiceException {
|
||||
if (zoneIds == null || zoneIds.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<AcsElevatorCodeResultDTO> list = this.acsElevatorCodeDao.listByZoneIds(zoneIds);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, AcsElevatorCodeResultDTO> map = new HashMap<>(list.size() * 2);
|
||||
for (AcsElevatorCodeResultDTO row : list) {
|
||||
if (row != null && row.getZoneId() != null) {
|
||||
map.put(row.getZoneId(), row);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.mapper;
|
||||
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface AcsElevatorCodeMapper {
|
||||
AcsElevatorCodeResultDTO get(AcsElevatorCodeDTO paramAcsElevatorCodeDTO);
|
||||
|
||||
int insertNew(AcsElevatorCodeDTO paramAcsElevatorCodeDTO);
|
||||
|
||||
int updateOld(AcsElevatorCodeDTO paramAcsElevatorCodeDTO);
|
||||
|
||||
AcsElevatorCodeResultDTO getFirstByParentId(String paramString);
|
||||
|
||||
List<AcsElevatorCodeResultDTO> listByZoneIds(@Param("zoneIds") List<String> zoneIds);
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?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.codeElevatorArea.mapper.AcsElevatorCodeMapper">
|
||||
|
||||
|
||||
<insert id="insertNew" parameterType="cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO">
|
||||
insert into code_elevator_area (zone_id, code, create_time, last_update_time,is_first,parent_id)
|
||||
values (#{zoneId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=BIGINT},
|
||||
#{lastUpdateTime,jdbcType=BIGINT},#{isFirst,jdbcType=TINYINT}, #{parentId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="get" resultType="cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO">
|
||||
SELECT zone_id AS zoneId,code,is_first AS isFirst
|
||||
FROM code_elevator_area
|
||||
WHERE zone_id = #{zoneId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
<select id="getFirstByParentId" resultType="cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO">
|
||||
SELECT zone_id AS zoneId,code,is_first AS isFirst
|
||||
FROM code_elevator_area
|
||||
WHERE parent_id = #{parentId,jdbcType=VARCHAR}
|
||||
and is_first = 1
|
||||
</select>
|
||||
|
||||
<select id="listByZoneIds" resultType="cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO">
|
||||
SELECT zone_id AS zoneId, code, is_first AS isFirst
|
||||
FROM code_elevator_area
|
||||
WHERE zone_id IN
|
||||
<foreach collection="zoneIds" item="id" open="(" separator="," close=")">
|
||||
#{id,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateOld" parameterType="cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO">
|
||||
update code_elevator_area
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="lastUpdateTime != null">
|
||||
last_update_time = #{lastUpdateTime, jdbcType=BIGINT},
|
||||
</if>
|
||||
|
||||
<if test="code != null">
|
||||
code = #{code, jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isFirst != null">
|
||||
is_first = #{isFirst, jdbcType=TINYINT},
|
||||
</if>
|
||||
</trim>
|
||||
<where>
|
||||
zone_id = #{zoneId, jdbcType=VARCHAR}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.param;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorCodeParam extends CloudwalkBaseTimes implements Serializable {
|
||||
private String zoneId;
|
||||
private String parentId;
|
||||
private String code;
|
||||
private Integer isFirst;
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getIsFirst() {
|
||||
return this.isFirst;
|
||||
}
|
||||
|
||||
public void setIsFirst(Integer isFirst) {
|
||||
this.isFirst = isFirst;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.result;
|
||||
|
||||
public class AcsElevatorCodeResult {
|
||||
private String zoneId;
|
||||
private String code;
|
||||
private Integer isFirst;
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getIsFirst() {
|
||||
return this.isFirst;
|
||||
}
|
||||
|
||||
public void setIsFirst(Integer isFirst) {
|
||||
this.isFirst = isFirst;
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package cn.cloudwalk.elevator.codeElevatorArea.service;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.param.AcsElevatorCodeParam;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AcsElevatorCodeService {
|
||||
Integer insertNew(AcsElevatorCodeParam paramAcsElevatorCodeParam) throws ServiceException;
|
||||
|
||||
Integer updateOld(AcsElevatorCodeParam paramAcsElevatorCodeParam) throws ServiceException;
|
||||
|
||||
AcsElevatorCodeResultDTO get(AcsElevatorCodeParam paramAcsElevatorCodeParam) throws ServiceException;
|
||||
|
||||
AcsElevatorCodeResultDTO getFirstByParentId(String paramString) throws ServiceException;
|
||||
|
||||
/**
|
||||
* 按区域 ID 批量查询电梯编码,供树形接口一次拉取,避免循环内逐条查询。 不改变 {@link #get} 语义;入参去重由调用方控制。
|
||||
*/
|
||||
Map<String, AcsElevatorCodeResultDTO> mapByZoneIds(List<String> zoneIds) throws ServiceException;
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.result.AreaTreeResult;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.session.company.CompanyContext;
|
||||
import cn.cloudwalk.cloud.session.user.UserContext;
|
||||
import cn.cloudwalk.cloud.utils.CloudwalkDateUtils;
|
||||
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备相关服务的抽象基类:提供区域树扁平化、以及为远程调用组装的 {@link CloudwalkCallContext}(含 Feign 线程本地传参)。
|
||||
*/
|
||||
public class AbstractAcsDeviceService extends AbstractCloudwalkService {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CloudwalkCallContext getCloudwalkContext(String businessId) {
|
||||
CloudwalkCallContext context = new CloudwalkCallContext();
|
||||
CompanyContext companyContext = new CompanyContext();
|
||||
companyContext.setCompanyId(businessId);
|
||||
context.setCompany(companyContext);
|
||||
UserContext userContext = new UserContext();
|
||||
userContext.setCaller("defaultUserId");
|
||||
userContext.setCallerName("defaultUserName");
|
||||
context.setUser(userContext);
|
||||
context.setCallTime(CloudwalkDateUtils.getCurrentDate());
|
||||
Map<String, String> feignThreadLoaclMap = new HashMap<>(3);
|
||||
feignThreadLoaclMap.put("businessid", businessId);
|
||||
feignThreadLoaclMap.put("platformuserid", "defaultUserId");
|
||||
feignThreadLoaclMap.put("username", "defaultUserName");
|
||||
FeignThreadLocalUtil.set(feignThreadLoaclMap);
|
||||
return context;
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContextBuilder;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionContextHolder;
|
||||
import cn.cloudwalk.cloud.session.extend.DefaultExtendContext;
|
||||
import cn.cloudwalk.cloud.session.extend.ExtendContext;
|
||||
import cn.cloudwalk.elevator.context.CloudWalkExtendContextValue;
|
||||
import java.net.URLEncoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
public abstract class AbstractCloudwalkController {
|
||||
protected final Logger LOGGER = LoggerFactory.getLogger(getClass());
|
||||
@Autowired
|
||||
private MessageSource messageSource;
|
||||
@Autowired
|
||||
private CloudwalkSessionContextHolder cloudwalkSessionContextHolder;
|
||||
|
||||
public CloudwalkCallContext getCloudwalkContext() {
|
||||
CloudwalkCallContext cloudwalkCallContext =
|
||||
CloudwalkCallContextBuilder.buildContext(this.cloudwalkSessionContextHolder);
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
DefaultExtendContext<CloudWalkExtendContextValue> extendContext = new DefaultExtendContext();
|
||||
CloudWalkExtendContextValue cloudWalkExtendContextValue = new CloudWalkExtendContextValue();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
cloudWalkExtendContextValue.setLoginId(request.getHeader("loginid"));
|
||||
cloudWalkExtendContextValue.setAuthorization(request.getHeader("authorization"));
|
||||
extendContext.setValue(cloudWalkExtendContextValue);
|
||||
cloudwalkCallContext.setExt((ExtendContext)extendContext);
|
||||
}
|
||||
return cloudwalkCallContext;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
return attributes.getRequest().getHeader("authorization");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected HttpServletRequest getHttpServletRequest() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
return null;
|
||||
}
|
||||
return attributes.getRequest();
|
||||
}
|
||||
|
||||
public String getMessage(String code, String defaultMsg) {
|
||||
return this.messageSource.getMessage(code, null, defaultMsg, LocaleContextHolder.getLocale());
|
||||
}
|
||||
|
||||
public String getMessage(String code) {
|
||||
return getMessage(code, "");
|
||||
}
|
||||
|
||||
protected void makeExcelresponse(HttpServletRequest request, HttpServletResponse response, String fileName) {
|
||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + encodeFileName(fileName, request));
|
||||
}
|
||||
|
||||
protected String encodeFileName(String fileNames, HttpServletRequest request) {
|
||||
String codedFilename = null;
|
||||
try {
|
||||
codedFilename = URLEncoder.encode(fileNames, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("转换文件名字符类型失败,原因:", e);
|
||||
}
|
||||
return codedFilename != null ? codedFilename : fileNames;
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceService;
|
||||
import cn.cloudwalk.cloud.serial.UUIDSerial;
|
||||
import cn.cloudwalk.cloud.utils.CloudwalkDateUtils;
|
||||
import cn.cloudwalk.serial.code.AbstractGeneralCode;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
|
||||
public class AbstractCloudwalkService {
|
||||
@Autowired
|
||||
protected DeviceService deviceService;
|
||||
protected final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
private static final int GENGRAL_CODE_LENGTH = 8;
|
||||
@Autowired
|
||||
private MessageSource messageSource;
|
||||
@Autowired
|
||||
protected AbstractGeneralCode generalCode;
|
||||
@Autowired(required = false)
|
||||
private UUIDSerial uuidSerial;
|
||||
|
||||
public String getMessage(String code) {
|
||||
return this.messageSource.getMessage(code, null, "", LocaleContextHolder.getLocale());
|
||||
}
|
||||
|
||||
public String createGeneralCode() {
|
||||
return this.generalCode.generalCode(CloudwalkDateUtils.getDate8YMD(), Integer.valueOf(8));
|
||||
}
|
||||
|
||||
public String genUUID() {
|
||||
if (null != this.uuidSerial) {
|
||||
return this.uuidSerial.uuid();
|
||||
}
|
||||
return CloudwalkDateUtils.getUUID();
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import cn.cloudwalk.client.resource.application.param.ApplicationQueryParam;
|
||||
import cn.cloudwalk.client.resource.application.result.ApplicationResult;
|
||||
import cn.cloudwalk.client.resource.application.service.ApplicationService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.elevator.common.service.AcsApplicationService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AcsApplicationServiceImpl implements AcsApplicationService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AcsApplicationServiceImpl.class);
|
||||
@Resource
|
||||
private ApplicationService applicationService;
|
||||
|
||||
@Cacheable(cacheNames = {"ACS_Applicationids"},
|
||||
key = "T(cn.cloudwalk.biz.ninca.accesscontrol.cache.CacheOverrideConfig).CACHE_KEY_APPLICATION_IDS_PREFIX + #businessId")
|
||||
public String getApplicationId(String businessId) throws ServiceException {
|
||||
ApplicationQueryParam param = new ApplicationQueryParam();
|
||||
param.setBusinessId(businessId);
|
||||
param.setServiceCode("elevator-app");
|
||||
CloudwalkResult<List<ApplicationResult>> cloudwalkResult = this.applicationService.query(param);
|
||||
if (cloudwalkResult.isSuccess()) {
|
||||
if (CollectionUtils.isNotEmpty((Collection)cloudwalkResult.getData())) {
|
||||
return ((ApplicationResult)((List<ApplicationResult>)cloudwalkResult.getData()).get(0)).getId();
|
||||
}
|
||||
logger.info("未查到applicationId");
|
||||
throw new ServiceException("76260005", "未查到applicationId");
|
||||
}
|
||||
logger.info("查询applicationId失败");
|
||||
throw new ServiceException("76260006", "查询applicationId失败");
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
public class CloudwalkCallNewContext {}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
@Configuration
|
||||
public class ElevatorRemoteIoExecutorConfig {
|
||||
@Autowired
|
||||
private ElevatorRemoteIoPoolProperties elevatorRemoteIoPoolProperties;
|
||||
|
||||
@Bean(name = {"elevatorRemoteBoundedExecutor"})
|
||||
public ThreadPoolTaskExecutor elevatorRemoteBoundedExecutor() {
|
||||
ThreadPoolTaskExecutor ex = new ThreadPoolTaskExecutor();
|
||||
ex.setCorePoolSize(this.elevatorRemoteIoPoolProperties.getCorePoolSize());
|
||||
ex.setMaxPoolSize(this.elevatorRemoteIoPoolProperties.getMaxPoolSize());
|
||||
ex.setQueueCapacity(this.elevatorRemoteIoPoolProperties.getQueueCapacity());
|
||||
ex.setKeepAliveSeconds(this.elevatorRemoteIoPoolProperties.getKeepAliveSeconds());
|
||||
ex.setAllowCoreThreadTimeOut(this.elevatorRemoteIoPoolProperties.isAllowCoreThreadTimeOut());
|
||||
ex.setThreadNamePrefix("elevator-remote-io-");
|
||||
ex.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
ex.initialize();
|
||||
return ex;
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "ninca.elevator.remote-io.pool")
|
||||
public class ElevatorRemoteIoPoolProperties {
|
||||
/** 约定 §3.2 / §3.3 / §3.4:有界并行建议 4~8,默认 6 */
|
||||
private int corePoolSize = 6;
|
||||
private int maxPoolSize = 6;
|
||||
private int queueCapacity = 512;
|
||||
private int keepAliveSeconds = 60;
|
||||
private boolean allowCoreThreadTimeOut = true;
|
||||
|
||||
public int getCorePoolSize() {
|
||||
return this.corePoolSize;
|
||||
}
|
||||
|
||||
public void setCorePoolSize(int corePoolSize) {
|
||||
this.corePoolSize = corePoolSize;
|
||||
}
|
||||
|
||||
public int getMaxPoolSize() {
|
||||
return this.maxPoolSize;
|
||||
}
|
||||
|
||||
public void setMaxPoolSize(int maxPoolSize) {
|
||||
this.maxPoolSize = maxPoolSize;
|
||||
}
|
||||
|
||||
public int getQueueCapacity() {
|
||||
return this.queueCapacity;
|
||||
}
|
||||
|
||||
public void setQueueCapacity(int queueCapacity) {
|
||||
this.queueCapacity = queueCapacity;
|
||||
}
|
||||
|
||||
public int getKeepAliveSeconds() {
|
||||
return this.keepAliveSeconds;
|
||||
}
|
||||
|
||||
public void setKeepAliveSeconds(int keepAliveSeconds) {
|
||||
this.keepAliveSeconds = keepAliveSeconds;
|
||||
}
|
||||
|
||||
public boolean isAllowCoreThreadTimeOut() {
|
||||
return this.allowCoreThreadTimeOut;
|
||||
}
|
||||
|
||||
public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
|
||||
this.allowCoreThreadTimeOut = allowCoreThreadTimeOut;
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "ninca.update.floor.pool")
|
||||
public class UpdateFloorsPoolProperties {
|
||||
private int corePoolSize = 3;
|
||||
private int maxPoolSize = 5;
|
||||
private int keepAliveSeconds = 150;
|
||||
private int queueCapacity = 100;
|
||||
private boolean allowCoreThreadTimeOut = true;
|
||||
|
||||
public int getCorePoolSize() {
|
||||
return this.corePoolSize;
|
||||
}
|
||||
|
||||
public void setCorePoolSize(int corePoolSize) {
|
||||
this.corePoolSize = corePoolSize;
|
||||
}
|
||||
|
||||
public int getMaxPoolSize() {
|
||||
return this.maxPoolSize;
|
||||
}
|
||||
|
||||
public void setMaxPoolSize(int maxPoolSize) {
|
||||
this.maxPoolSize = maxPoolSize;
|
||||
}
|
||||
|
||||
public int getKeepAliveSeconds() {
|
||||
return this.keepAliveSeconds;
|
||||
}
|
||||
|
||||
public void setKeepAliveSeconds(int keepAliveSeconds) {
|
||||
this.keepAliveSeconds = keepAliveSeconds;
|
||||
}
|
||||
|
||||
public int getQueueCapacity() {
|
||||
return this.queueCapacity;
|
||||
}
|
||||
|
||||
public void setQueueCapacity(int queueCapacity) {
|
||||
this.queueCapacity = queueCapacity;
|
||||
}
|
||||
|
||||
public boolean isAllowCoreThreadTimeOut() {
|
||||
return this.allowCoreThreadTimeOut;
|
||||
}
|
||||
|
||||
public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
|
||||
this.allowCoreThreadTimeOut = allowCoreThreadTimeOut;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
@Configuration
|
||||
public class UpdateFloorsTaskExecutor {
|
||||
@Autowired
|
||||
private UpdateFloorsPoolProperties updateFloorsPoolProperties;
|
||||
|
||||
@Bean(name = {"updateFloorsExecutor"})
|
||||
public ThreadPoolTaskExecutor pictureRevisionTaskExecutor() {
|
||||
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
|
||||
threadPoolTaskExecutor.setCorePoolSize(this.updateFloorsPoolProperties.getCorePoolSize());
|
||||
threadPoolTaskExecutor.setAllowCoreThreadTimeOut(this.updateFloorsPoolProperties.isAllowCoreThreadTimeOut());
|
||||
threadPoolTaskExecutor.setMaxPoolSize(this.updateFloorsPoolProperties.getMaxPoolSize());
|
||||
threadPoolTaskExecutor.setQueueCapacity(this.updateFloorsPoolProperties.getQueueCapacity());
|
||||
threadPoolTaskExecutor.setKeepAliveSeconds(this.updateFloorsPoolProperties.getKeepAliveSeconds());
|
||||
threadPoolTaskExecutor.setThreadNamePrefix("update-floors-pool-");
|
||||
threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
|
||||
threadPoolTaskExecutor.initialize();
|
||||
return threadPoolTaskExecutor;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 电梯应用业务编排层中的公共抽象与基础服务实现(与 common 模块中的“工具型 common”区分)。
|
||||
* <p>
|
||||
* 放置跨领域的服务基类、模板方法等,供本模块内各子包复用。
|
||||
*/
|
||||
package cn.cloudwalk.elevator.common;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package cn.cloudwalk.elevator.common.service;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
|
||||
public interface AcsApplicationService {
|
||||
String getApplicationId(String paramString) throws ServiceException;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
public class AcsConstants {
|
||||
public static final String SUCCESS_CODE = "00000000";
|
||||
public static final String SERVICE_CODE = "elevator-app";
|
||||
public static final Long ONE_DAY_MILLISECONDS = Long.valueOf(86400000L);
|
||||
public static final Long ONE_YEAR_MILLISECONDS = Long.valueOf(31536000000L);
|
||||
public static final String DEFAULT_CALLER = "defaultUserId";
|
||||
public static final String DEFAULT_CALLER_NAME = "defaultUserName";
|
||||
public static final String ACS_OPEN_DOOR_RECORD_EVENT_TOPIC = "ACS_OPEN_DOOR_RECORD_EVENT_TOPIC";
|
||||
public static final String ACS_BACKEND_REG_LOG_ID_KEY_PREFIX = "acs:backendRegLogId:";
|
||||
public static final String ACS_BACKEND_REG_EXPIRE_PREFIX = "acs:backendRegExpire:";
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
public class AcsLockConstants {
|
||||
public static final String LOCK_EXPORT_BUSINESSID_PREFIX = "AcsExport:";
|
||||
|
||||
public static final String LOCK_RECORD_STATISTICS_BUSINESSID_PREFIX = "AcsRecordStatistics:";
|
||||
|
||||
public static final String LOCK_BACKEND_REG_LOG_ID_PREFIX = "AcsBackendRegLogId:";
|
||||
|
||||
public static final String LOCK_URGENT_GROUP_DEVICE_ID_PREFIX = "AcsUrgentGroupDeviceIds:";
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
import cn.cloudwalk.intelligent.davinci.storage.manager.FilePartManager;
|
||||
import cn.cloudwalk.intelligent.davinci.storage.manager.FileStorageManager;
|
||||
import cn.cloudwalk.intelligent.davinci.storage.manager.impl.FilePartManagerImpl;
|
||||
import cn.cloudwalk.intelligent.davinci.storage.manager.impl.FileStorageManagerImpl;
|
||||
import feign.Client;
|
||||
import feign.codec.Decoder;
|
||||
import feign.codec.Encoder;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Configuration
|
||||
@Import(FeignClientsConfiguration.class)
|
||||
public class DavinciStorageBeansConfiguration {
|
||||
|
||||
@Bean
|
||||
public FileStorageManager fileStorageManager(
|
||||
@Value("${feign.davinci-portal.name:davinci-portal}") String serviceName,
|
||||
Decoder decoder,
|
||||
Encoder encoder,
|
||||
Client client) {
|
||||
return new FileStorageManagerImpl(serviceName, decoder, encoder, client);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilePartManager filePartManager(
|
||||
@Value("${feign.davinci-portal.name:davinci-portal}") String serviceName,
|
||||
Decoder decoder,
|
||||
Encoder encoder,
|
||||
Client client) {
|
||||
return new FilePartManagerImpl(serviceName, decoder, encoder, client);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "cloudwalk.elevator.common")
|
||||
public class ElevatorCwosConfig {
|
||||
private String relativePrefix;
|
||||
|
||||
public String getRelativePrefix() {
|
||||
return this.relativePrefix;
|
||||
}
|
||||
|
||||
public void setRelativePrefix(String relativePrefix) {
|
||||
this.relativePrefix = relativePrefix;
|
||||
}
|
||||
}
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
public class ErrorCode {
|
||||
public static final String OTHER_ERROR = "00000001";
|
||||
|
||||
public static final String ID_IS_NULL = "53060410";
|
||||
|
||||
public static final String ID_ARRAY_IS_NULL = "53060411";
|
||||
|
||||
public static final String ADD_IMAGE_STORE_ERROR = "53060413";
|
||||
|
||||
public static final String ID_IS_ERROR = "53060414";
|
||||
|
||||
public static final String EDIT_IMAGE_STORE_IS_ERROR = "53060415";
|
||||
|
||||
public static final String IMAGE_STORE_REF_IS_ALL_NULL = "53060416";
|
||||
|
||||
public static final String IMAGFE_STORE_ORG_ID_ARRAY_IS_ERROR = "53060417";
|
||||
|
||||
public static final String IMAGFE_STORE_LABEL_ID_ARRAY_IS_ERROR = "53060418";
|
||||
|
||||
public static final String IMAGFE_STORE_PERSON_ID_ARRAY_IS_ERROR = "53060419";
|
||||
|
||||
public static final String IMAGFE_STORE_LABEL_ID_EXCLUDE_ARRAY_IS_ERROR = "53060420";
|
||||
|
||||
public static final String IMAGFE_STORE_PERSON_ID_EXCLUDE_ARRAY_IS_ERROR = "53060421";
|
||||
|
||||
public static final String IMAGE_STORE_DELETE_ERROR = "53060422";
|
||||
|
||||
public static final String IMAGE_STORE_NAME_IS_ERROR = "53060423";
|
||||
|
||||
public static final String ID_LENGTH_IS_ERROR = "53060424";
|
||||
|
||||
public static final String ORG_PARENT_NODE_IS_ERROR = "53060425";
|
||||
|
||||
public static final String GET_BUSINESS_NAME_IS_ERROR = "53060426";
|
||||
|
||||
public static final String PARENT_ID_LENGTH_IS_ERROR = "53060427";
|
||||
|
||||
public static final String FILE_UPLOAD_ERROR = "80014001";
|
||||
|
||||
public static final String FILE_UPLOAD_CONTROLLER_ERROR = "80014013";
|
||||
|
||||
public static final String FILE_TYPE_IS_INVALID = "53060429";
|
||||
|
||||
public static final String FILE_MAX_IS_ERROR = "53060428";
|
||||
|
||||
public static final String ROTATE_IMAGE_ERROR = "53060430";
|
||||
|
||||
public static final String EXTRACT_FEATURE_FAIL = "53060431";
|
||||
|
||||
public static final String FACE_DETECT_IS_EMPTY = "53060432";
|
||||
|
||||
public static final String FACE_DETECT_OVER_SIZE = "53060433";
|
||||
|
||||
public static final String IMAGE_IS_EMPTY = "53060434";
|
||||
|
||||
public static final String EXTRACT_FEATURE_EXCEPTION = "53060435";
|
||||
|
||||
public static final String EXTRACT_FEATURE_RESULT_IS_EMPTY = "53060436";
|
||||
|
||||
public static final String UPLOAD_SINGLE_FACE = "53060437";
|
||||
|
||||
public static final String GROUP_ID_IS_EMPTY = "53060438";
|
||||
|
||||
public static final String FACE_DETECT_EXCEPTION = "53060439";
|
||||
|
||||
public static final String FACE_DETECT_RESULT_IS_EMPTY = "53060440";
|
||||
|
||||
public static final String QUERY_ALL_GROUP_TOPN_FAIL = "53060441";
|
||||
|
||||
public static final String QUERY_EVERY_GROUP_TOPN_FAIL = "53060442";
|
||||
|
||||
public static final String QUERY_FEATURE_RESULT_IS_EMPTY = "53060443";
|
||||
|
||||
public static final String QUERY_FEATURE_RESULT_FAIL = "53060444";
|
||||
|
||||
public static final String IMAGE_UNDER_SIZE = "53060445";
|
||||
|
||||
public static final String IMAGE_PIXEL_UNDER_SIZE = "53060446";
|
||||
|
||||
public static final String ADD_FACE_FAIL = "53060447";
|
||||
|
||||
public static final String REMOVE_FACE_FAIL = "53060448";
|
||||
|
||||
public static final String FILE_MANAGER_READ_FILE_ERROR = "80014016";
|
||||
|
||||
public static final String FILE_MANAGER_DEL_ERROR = "80014017";
|
||||
|
||||
public static final String ADD_ORG_TYPE_ERROR = "53003800";
|
||||
|
||||
public static final String EDIT_ORG_TYPE_ERROR = "53003801";
|
||||
|
||||
public static final String DEL_ORG_TYPE_ERROR = "53003802";
|
||||
|
||||
public static final String ADD_ORG_TYPE_DUPLICATE_NAME = "53003803";
|
||||
|
||||
public static final String QUERY_ORG_TYPE_ERROR = "53003804";
|
||||
|
||||
public static final String PROPERTIES_DUPLICATE_NAME_ERROR = "53003805";
|
||||
|
||||
public static final String ADD_AREA_TYPE_ERROR = "53004800";
|
||||
|
||||
public static final String EDIT_AREA_TYPE_ERROR = "53004801";
|
||||
|
||||
public static final String DEL_AREA_TYPE_ERROR = "53004802";
|
||||
|
||||
public static final String ADD_AREA_TYPE_DUPLICATE_NAME = "53004803";
|
||||
|
||||
public static final String QUERY_AREA_TYPE_ERROR = "53004804";
|
||||
|
||||
public static final String AREA_TYPE_NAME_NOT_NULL = "53004806";
|
||||
|
||||
public static final String AREA_TYPE_NAME_LENGTH_INVAILD = "53004807";
|
||||
|
||||
public static final String AREA_TYPE_PRO_NAME_NOT_NULL = "53004810";
|
||||
|
||||
public static final String AREA_TYPE_PRO_REQUIRED_NOT_NULL = "53004811";
|
||||
|
||||
public static final String AREA_TYPE_PRO_REQUIRED_RANGE_INVAILD = "53004812";
|
||||
|
||||
public static final String AREA_TYPE_HAS_LOWER_DATA = "53004813";
|
||||
|
||||
public static final String AREA_TYPE_NOT_EDIT_DEFAULT = "53004815";
|
||||
|
||||
public static final String EXIST_AREA_WITH_TYPE = "53004854";
|
||||
|
||||
public static final String AREA_TYPE_PRO_ORDER_NOT_NULL = "53004816";
|
||||
|
||||
public static final String AREA_TYPE_PRO_ORDER_RANGE_INVAILD = "53004817";
|
||||
|
||||
public static final String QUERY_ORG_ERROR = "53003300";
|
||||
|
||||
public static final String TYPE_ID_IS_NULL = "53003301";
|
||||
|
||||
public static final String TYPE_ID_LENGTH_IS_ERROR = "53003302";
|
||||
|
||||
public static final String PARAM_LENGTH_IS_ERROR = "53003303";
|
||||
|
||||
public static final String EXIST_ORG_WITH_TYPE = "53003304";
|
||||
|
||||
public static final String ORG_ID_IS_NULL = "53003305";
|
||||
|
||||
public static final String ORG_PARENT_HSH_LOWER_LEVEL_ERROR = "53003306";
|
||||
|
||||
public static final String ORG_PARENT_ID_IS_NULL = "53003307";
|
||||
|
||||
public static final String ORG_LEVEL_IS_ERROR = "53003308";
|
||||
|
||||
public static final String ORG_NAME_IS_EXIST = "53003309";
|
||||
|
||||
public static final String ORG_ID_IS_ERROR = "53003310";
|
||||
|
||||
public static final String PERSON_ID_ARRAY_IS_ERROR = "53003311";
|
||||
|
||||
public static final String ORG_NAME_IS_NULL = "53003312";
|
||||
|
||||
public static final String ORG_YI_IS_NOT_DELETE = "53003313";
|
||||
|
||||
public static final String ORG_PARENT_IS_HAVING = "53003314";
|
||||
|
||||
public static final String ORG_CANNOT_DELETE = "53003315";
|
||||
|
||||
public static final String QZ_BUSINESS_ID_INVALID = "53014000";
|
||||
|
||||
public static final String QZ_PERSON_CODE_INVALID = "53014001";
|
||||
|
||||
public static final String QZ_PERSON_NAME_INVALID = "53014002";
|
||||
|
||||
public static final String QZ_PERSON_USER_NAME_INVALID = "53014003";
|
||||
|
||||
public static final String QZ_PERSON_PHONE_INVALID = "53014004";
|
||||
|
||||
public static final String QZ_PERSON_EMAIL_INVALID = "53014005";
|
||||
|
||||
public static final String QZ_PERSON_SYNC_ACCOUNT_INVALID = "53014006";
|
||||
|
||||
public static final String QZ_PERSON_CUSTOM_FIELD_INVALID = "53014007";
|
||||
|
||||
public static final String QZ_PERSON_ADD_ERROR = "53014008";
|
||||
|
||||
public static final String QZ_PERSON_EDIT_ERROR = "53014009";
|
||||
|
||||
public static final String QZ_PERSON_DEL_ERROR = "53014010";
|
||||
|
||||
public static final String QZ_PERSON_QUERY_ERROR = "53014011";
|
||||
|
||||
public static final String QZ_PERSON_CODE_DUPLICATE = "53014012";
|
||||
|
||||
public static final String QZ_PERSON_USER_NAME_DUPLICATE = "53014013";
|
||||
|
||||
public static final String QZ_PERSON_PHONE_DUPLICATE = "53014014";
|
||||
|
||||
public static final String QZ_PERSON_EMAIL_DUPLICATE = "53014015";
|
||||
|
||||
public static final String QZ_PERSON_FILED_LOSE = "53014016";
|
||||
|
||||
public static final String QZ_PERSON_FILED_INVALID = "53014017";
|
||||
|
||||
public static final String QZ_PERSON_FILED_NOT_EXISTS = "53014018";
|
||||
|
||||
public static final String QZ_PERSON_NO_SYSTEM_ID = "53014019";
|
||||
|
||||
public static final String QZ_PERSON_FILED_LABEL_ORGANIZATION_LOSE = "53014020";
|
||||
|
||||
public static final String QZ_PERSON_SOURCE_ILLEGAL = "53014021";
|
||||
|
||||
public static final String QZ_PERSON_PROPERTIES_CERT_LOSE = "53014022";
|
||||
|
||||
public static final String QZ_PERSON_CERT_ID_DUPLICATE = "53014023";
|
||||
|
||||
public static final String PERSON_ID_LIST_IS_EMPTY = "53014024";
|
||||
|
||||
public static final String IMAGE_ID_LIST_IS_EMPTY = "53014025";
|
||||
|
||||
public static final String IMAGE_ID_IS_EMPTY = "53014026";
|
||||
|
||||
public static final String QZ_SYSTEM_ID_VALUE_EMPTY = "53014027";
|
||||
|
||||
public static final String QZ_SYSTEM_ID_VALUE_DUPLICATE = "53014028";
|
||||
|
||||
public static final String PERSONNEL_ATTRIBUTES_ARE_NOT_SET = "53014029";
|
||||
|
||||
public static final String QZ_BATCH_ID_INVALID = "53014030";
|
||||
|
||||
public static final String QZ_BATCH_STATUS_INVALID = "53014031";
|
||||
|
||||
public static final String QZ_BATCH_ADD_ERROR = "53014032";
|
||||
|
||||
public static final String QZ_BATCH_QUERY_ERROR = "53014033";
|
||||
|
||||
public static final String QZ_BATCH_DETAIL_QUERY_ERROR = "53014034";
|
||||
|
||||
public static final String BATCH_IMPORT_INSERT_ERROR = "53014035";
|
||||
|
||||
public static final String BATCH_IMPORT_PROCESS_EXCEPTION = "53014036";
|
||||
|
||||
public static final String BATCH_IMPORT_ZIP_FILE_EMPTY = "53014037";
|
||||
|
||||
public static final String BATCH_IMPORT_UNZIP_FAILED = "53014038";
|
||||
|
||||
public static final String BATCH_IMPORT_EXCEL_FILE_NOTFOUND = "53014039";
|
||||
|
||||
public static final String BATCH_IMPORT_DATA_EMPTY = "53014040";
|
||||
|
||||
public static final String FILE_INIT_FAIL = "53014041";
|
||||
|
||||
public static final String FILE_FINISHI_FAIL = "53014042";
|
||||
|
||||
public static final String FILE_GET_FAIL = "53014043";
|
||||
|
||||
public static final String LABEL_NAME_IS_EXIST = "53003700";
|
||||
|
||||
public static final String LABEL_ID_IS_ERROR = "53003701";
|
||||
|
||||
public static final String LABEL_PAGE_IS_ERROR = "53003702";
|
||||
|
||||
public static final String QZ_LABEL_NAME_INVALID = "53003703";
|
||||
|
||||
public static final String QZ_LABEL_CODE_INVALID = "53003704";
|
||||
|
||||
public static final String LABEL_CODE_IS_EXIST = "53003705";
|
||||
|
||||
public static final String QZ_LABEL_ADD_TYPE_INVALID = "53003706";
|
||||
|
||||
public static final String QZ_LABEL_DEL_PERSON_RELATION = "53003707";
|
||||
|
||||
public static final String PERSON_PRO_NAME_NOT_NULL = "53014800";
|
||||
|
||||
public static final String PERSON_PRO_NAME_LENGTH_INVAILD = "53014801";
|
||||
|
||||
public static final String PERSON_PRO_TYPE_NOT_NULL = "53014802";
|
||||
|
||||
public static final String PERSON_PRO_TYPE_RANGE_INVAILD = "53014803";
|
||||
|
||||
public static final String PERSON_PRO_SYSACCOUNT_RANGE_INVAILD = "53014804";
|
||||
|
||||
public static final String PERSON_PRO_REQUIRED_RANGE_INVAILD = "53014805";
|
||||
|
||||
public static final String PERSON_PRO_ORDER_NOT_NULL = "53014806";
|
||||
|
||||
public static final String PERSON_PRO_REMINDER_NOT_NULL = "53014807";
|
||||
|
||||
public static final String PERSON_PRO_REMINDER_LENGTH_INVAILD = "53014808";
|
||||
|
||||
public static final String PERSON_PRO_ARRAYDATA_LENGTH_INVAILD = "53014809";
|
||||
|
||||
public static final String PERSON_PRO_MULTIPLE_RANGE_INVAILD = "53014810";
|
||||
|
||||
public static final String DEFAULT_ACCOUNT_CAN_NOT_CHANGE = "53014811";
|
||||
|
||||
public static final String REQUIRED_CAN_NOT_CHANGE = "53014812";
|
||||
|
||||
public static final String SWITCH_SIZE_PARAM_INVALID = "53014813";
|
||||
|
||||
public static final String SWITCH_BACKGROUND_OBJECT_INVALID = "53014814";
|
||||
|
||||
public static final String ORG_TYPE_NAME_NOT_NULL = "53003806";
|
||||
|
||||
public static final String ORG_TYPE_NAME_LENGTH_INVAILD = "53003807";
|
||||
|
||||
public static final String ORG_TYPE_LOWER_NOT_NULL = "53003808";
|
||||
|
||||
public static final String ORG_TYPE_LOWER_RANGE_INVAILD = "53003809";
|
||||
|
||||
public static final String ORG_TYPE_PRO_NAME_NOT_NULL = "53003810";
|
||||
|
||||
public static final String ORG_TYPE_PRO_REQUIRED_NOT_NULL = "53003811";
|
||||
|
||||
public static final String ORG_TYPE_PRO_REQUIRED_RANGE_INVAILD = "53003812";
|
||||
|
||||
public static final String ORG_TYPE_HAS_LOWER_DATA = "53003813";
|
||||
|
||||
public static final String ORG_TYPE_NOT_NEW_DEFAULT = "53003814";
|
||||
|
||||
public static final String ORG_TYPE_NOT_EDIT_DEFAULT = "53003815";
|
||||
|
||||
public static final String ORG_TYPE_PRO_ORDER_NOT_NULL = "53003816";
|
||||
|
||||
public static final String ORG_TYPE_PRO_ORDER_RANGE_INVAILD = "53003817";
|
||||
|
||||
public static final String CAT_NOT_EDIT_DEFAULT_TYPE = "53003818";
|
||||
|
||||
public static final String PERSON_NOT_EXIST = "53003819";
|
||||
|
||||
public static final String PERSON_IMAGE_SCORE_FAILE = "53003820";
|
||||
|
||||
public static final String ORG_SEARCH_PARAM_FAILE = "53003821";
|
||||
|
||||
public static final String PERSON_REGISTRY_STATUS_IS_NULL = "53014500";
|
||||
|
||||
public static final String PERSON_REGISTRY_DEVICESTATUS_IS_NULL = "53014501";
|
||||
|
||||
public static final String PERSON_REGISTRY_CODESTATUS_IS_NULL = "53014502";
|
||||
|
||||
public static final String PERSON_REGISTRY_PROPERTY_IS_NULL = "53014503";
|
||||
|
||||
public static final String PERSON_REGISTRY_DEVICE_IS_NULL = "53014504";
|
||||
|
||||
public static final String PERSON_REGISTRY_STATUS_INVALID = "53014505";
|
||||
|
||||
public static final String PERSON_REGISTRY_DEVICESTATUS_INVALID = "53014506";
|
||||
|
||||
public static final String PERSON_REGISTRY_CODESTATUS_INVALID = "53014507";
|
||||
|
||||
public static final String PERSON_REGISTRY_PRO_ID_LIST_IS_ERROR = "53014508";
|
||||
|
||||
public static final String PERSON_REGISTRY_PRO_NAME_IS_REQUIRED = "53014509";
|
||||
|
||||
public static final String PERSON_REGISTRY_PRO_ORG_LABEL_IS_REQUIRED = "53014510";
|
||||
|
||||
public static final String PERSON_REGISTRY_PRO_IS_REQUIRED = "53014511";
|
||||
|
||||
public static final String PERSON_REGISTRY_ORG_IDS_IS_ERROR = "53014512";
|
||||
|
||||
public static final String PERSON_REGISTRY_LABEL_IDS_IS_ERROR = "53014513";
|
||||
|
||||
public static final String PERSON_REGISTRY_DEVICE_IS_ERROR = "53014514";
|
||||
|
||||
public static final String PERSON_REGISTRY_ADD_FAIL = "53014515";
|
||||
|
||||
public static final String PERSON_REGISTRY_SAVE_FAIL = "53014516";
|
||||
|
||||
public static final String PERSON_REGISTRY_IS_NULL = "53014517";
|
||||
|
||||
public static final String PERSON_REGISTRY_STATUS_IS_CLOSED = "53014518";
|
||||
|
||||
public static final String PERSON_REGISTRY_DEVICE_IS_NOT_ADD = "53014519";
|
||||
|
||||
public static final String PERSON_REGISTRY_DETAIL_FAIL = "53014520";
|
||||
|
||||
public static final String PERSON_REGISTRY_PRO_LIST_FAIL = "53014521";
|
||||
|
||||
public static final String PERSON_REGISTRY_UNIQUE_PRO_IS_NULL = "53014522";
|
||||
|
||||
public static final String PERSON_REGISTRY_UNIQUE_PRO_FAIL = "53014523";
|
||||
|
||||
public static final String PERSON_PRO_IS_NULL = "53014524";
|
||||
|
||||
public static final String PERSON_CERT_PRO_IS_NULL = "53014525";
|
||||
|
||||
public static final String CARDID_NOT_BIND_PRO = "53014526";
|
||||
|
||||
public static final String NAME_NOT_BIND_PRO = "53014527";
|
||||
|
||||
public static final String BIND_PRO_ONE_TO_MANY = "53014528";
|
||||
|
||||
public static final String DEFAULT_PRO_ORG_LABEL_IS_REQUIRED = "53014529";
|
||||
|
||||
public static final String PERSON_REGISTRY_TYPE_INVALID = "53014530";
|
||||
|
||||
public static final String QUERY_DISTRICT_TREE_FAIL = "53014600";
|
||||
|
||||
public static final String QUERY_DEVICE_LIST_FAIL = "53014700";
|
||||
|
||||
public static final String DEVICE_ID_IS_NULL = "53014701";
|
||||
|
||||
public static final String QUERY_PERSON_GROUP_RELATIONS_FAIL = "53014702";
|
||||
|
||||
public static final String QUERY_QR_CODE_URL_FAIL = "53014900";
|
||||
|
||||
public static final String PERSON_AUDIT_PARAM_SOURCE = "53060533";
|
||||
|
||||
public static final String PERSON_AUDIT_DEVICE_FORBID = "53060534";
|
||||
|
||||
public static final String PERSON_AUDIT_ADD_EXCEPTION = "53060535";
|
||||
|
||||
public static final String PERSON_AUDIT_ID_INVALID = "53060536";
|
||||
|
||||
public static final String PERSON_AUDIT_ID_ISNULL = "53060537";
|
||||
|
||||
public static final String PERSON_AUDIT_QUERY_FAILED = "53060538";
|
||||
|
||||
public static final String PERSON_AUDIT_APPLY_FAILED = "53060539";
|
||||
|
||||
public static final String PERSON_AUDIT_PAGE_FAILED = "53060540";
|
||||
|
||||
public static final String PERSON_AUDIT_REGISTRY_SETTING_FAILED = "53060541";
|
||||
|
||||
public static final String PERSON_AUDIT_DEVICECODE_EMPTY = "53060542";
|
||||
|
||||
public static final String PERSON_AUDIT_DEVICE_INVALID = "53060543";
|
||||
|
||||
public static final String PERSON_AUDIT_UPLOAD_BASE64_EMPTY = "53060544";
|
||||
|
||||
public static final String PERSON_AUDIT_CHECK_NAME_EMPTY = "53060545";
|
||||
|
||||
public static final String PERSON_AUDIT_CHECK_WRONG_CAPTCHA = "53060546";
|
||||
|
||||
public static final String PERSON_AUDIT_UNIQUE_PROPERTY_ERROR = "53060547";
|
||||
|
||||
public static final String PERSON_AUDIT_QUERY_AUDIT_EMPTY = "53060548";
|
||||
|
||||
public static final String PERSON_AUDIT_AGREE_CAN_NOT_EDIT = "53060549";
|
||||
|
||||
public static final String AREA_PARENT_ID_IS_NULL = "53015100";
|
||||
|
||||
public static final String AREA_PARENT_HSH_LOWER_LEVEL_ERROR = "53015101";
|
||||
|
||||
public static final String AREA_PARENT_IS_HAVING = "53015102";
|
||||
|
||||
public static final String AREA_NAME_IS_EXIST = "53015103";
|
||||
|
||||
public static final String AREA_ID_IS_ERROR = "53015104";
|
||||
|
||||
public static final String AREA_PARENT_NODE_IS_ERROR = "53015105";
|
||||
|
||||
public static final String AREA_YI_IS_NOT_DELETE = "53015106";
|
||||
|
||||
public static final String AREA_TYPE_ID_IS_NULL = "53015107";
|
||||
|
||||
public static final String UNIT_ID_ARRAY_IS_ERROR = "53015108";
|
||||
|
||||
public static final String QUERY_AREA_ERROR = "53015109";
|
||||
|
||||
public static final String DETAIL_AREA_ERROR = "53015110";
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
public class FeignRemoteConfig {
|
||||
public static final String PLATFORM_USER_ID = "platformuserid";
|
||||
|
||||
public static final String LOGIN_ID = "loginid";
|
||||
|
||||
public static final String BUSINESS_ID = "businessid";
|
||||
|
||||
public static final String USER_NAME = "username";
|
||||
|
||||
public static final String APPLICATION_ID = "applicationid";
|
||||
|
||||
public static final String AUTHORIZATION = "authorization";
|
||||
|
||||
public static final String SERVICE_CODE = "elevator-app";
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.session.extend.DefaultExtendContext;
|
||||
import cn.cloudwalk.elevator.context.CloudWalkExtendContextValue;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class FeignThreadLocalUtil {
|
||||
private static ThreadLocal<Map<String, String>> threadLocal = new ThreadLocal<>();
|
||||
|
||||
public static void set(Map<String, String> t) {
|
||||
threadLocal.remove();
|
||||
threadLocal.set(t);
|
||||
}
|
||||
|
||||
public static Map<String, String> get() {
|
||||
return threadLocal.get();
|
||||
}
|
||||
|
||||
public static void remove() {
|
||||
threadLocal.remove();
|
||||
}
|
||||
|
||||
public static Map<String, String> getRequestHeader(HttpServletRequest request) {
|
||||
Map<String, String> map = new ConcurrentHashMap<>(10);
|
||||
if (null != request.getHeader("platformuserid")) {
|
||||
map.put("platformuserid", request.getHeader("platformuserid"));
|
||||
}
|
||||
if (null != request.getHeader("loginid")) {
|
||||
map.put("loginid", request.getHeader("loginid"));
|
||||
}
|
||||
if (null != request.getHeader("businessid")) {
|
||||
map.put("businessid", request.getHeader("businessid"));
|
||||
}
|
||||
if (null != request.getHeader("username")) {
|
||||
map.put("username", request.getHeader("username"));
|
||||
}
|
||||
if (null != request.getHeader("applicationid")) {
|
||||
map.put("applicationid", request.getHeader("applicationid"));
|
||||
}
|
||||
if (null != request.getHeader("authorization")) {
|
||||
map.put("authorization", request.getHeader("authorization"));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String, String> getDefaultReqesutHeader(String businessId) {
|
||||
Map<String, String> map = new ConcurrentHashMap<>(2);
|
||||
map.put("businessid", businessId);
|
||||
map.put("username", "default");
|
||||
return map;
|
||||
}
|
||||
|
||||
public static void setRequestHeader(Map<String, String> headerMap) {
|
||||
set(headerMap);
|
||||
}
|
||||
|
||||
public static Map<String, String> getDefaultRequestHeader(CloudwalkCallContext context) {
|
||||
Map<String, String> map = new HashMap<>(10);
|
||||
DefaultExtendContext<CloudWalkExtendContextValue> extendContext =
|
||||
(DefaultExtendContext<CloudWalkExtendContextValue>)context.getExt();
|
||||
map.put("platformuserid", context.getUser().getCaller());
|
||||
map.put("loginid", ((CloudWalkExtendContextValue)extendContext.getValue()).getLoginId());
|
||||
map.put("businessid", context.getCompany().getCompanyId());
|
||||
map.put("username",
|
||||
StringUtils.isEmpty(context.getUser().getCallerName()) ? "default" : context.getUser().getCallerName());
|
||||
map.put("applicationid", context.getApplicationId());
|
||||
map.put("authorization", ((CloudWalkExtendContextValue)extendContext.getValue()).getAuthorization());
|
||||
return map;
|
||||
}
|
||||
|
||||
public static void setRequestHeader(CloudwalkCallContext context) {
|
||||
set(getDefaultRequestHeader(context));
|
||||
}
|
||||
|
||||
/**
|
||||
* 在有界线程池等子线程中调用 Feign 前,必须为当前线程设置与 {@code context} 一致的请求头 ThreadLocal; 调用结束后恢复/清理,避免池化线程泄漏或串扰。
|
||||
*/
|
||||
public static <T> T callWithContext(CloudwalkCallContext context, Callable<T> action) throws Exception {
|
||||
Map<String, String> previous = get();
|
||||
try {
|
||||
setRequestHeader(context);
|
||||
return action.call();
|
||||
} finally {
|
||||
if (previous != null) {
|
||||
set(previous);
|
||||
} else {
|
||||
remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package cn.cloudwalk.elevator.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ImageStoreConstants {
|
||||
public static final short IS_NOT_DEL = 0;
|
||||
public static final short IS_DEL = 1;
|
||||
public static final int ASSOCIATED_ACTION_INCLUDE = 0;
|
||||
public static final int ASSOCIATED_ACTION_EXCLUDE = 1;
|
||||
public static final int ASSOCIATED_OBJECT_ORG_TYPE = 1;
|
||||
public static final int ASSOCIATED_OBJECT_LABEL_TYPE = 2;
|
||||
public static final int ASSOCIATED_OBJECT_PERSON_TYPE = 3;
|
||||
public static final int ASSOCIATED_OBJECT_MATCHPATTERN_TYPE = 4;
|
||||
public static final int ASSOCIATED_OBJECT_IMAGE_STORE_TYPE = 5;
|
||||
public static final String COMMON_BUSINESS_ID = "cloudwalk";
|
||||
public static final Integer COMMON_PROPERTIES_STATUS = Integer.valueOf(99);
|
||||
public static final Integer COMMON_UNIT_PROPERTIES_STATUS = Integer.valueOf(98);
|
||||
public static final Integer COMMON_PARK_PROPERTIES_STATUS = Integer.valueOf(97);
|
||||
private static final List<String> CUST_PROPERTIES = Arrays.asList(new String[] {"ext1", "ext2", "ext3", "ext4",
|
||||
"ext5", "ext6", "ext7", "ext8", "ext9", "ext10", "ext11", "ext12", "ext13", "ext14", "ext15", "ext16", "ext17",
|
||||
"ext18", "ext19", "ext20", "ext21", "ext22", "ext23", "ext24", "ext25", "ext26", "ext27", "ext28", "ext29",
|
||||
"ext30", "ext31", "ext32", "ext33", "ext34", "ext35", "ext36", "ext37", "ext38", "ext39", "ext40"});
|
||||
public static final String PERSON_PROPERTY_USER_NAME = "userName";
|
||||
|
||||
public static List<String> getCustProperties() {
|
||||
return CUST_PROPERTIES;
|
||||
}
|
||||
|
||||
public static final String PERSON_PROPERTY_PHONE = "phone";
|
||||
public static final String PERSON_PROPERTY_EMAIL = "email";
|
||||
public static final String COMPARE_PICTURE = "comparePicture";
|
||||
public static final String PERSON_PROPERTY_PERSON_CODE = "personCode";
|
||||
public static final String IC_CAED_NO = "icCardNo";
|
||||
public static final String IC_CAED_TYPE = "icCardType";
|
||||
public static final String FLOORS = "floors";
|
||||
public static final String PROPERTY_CODE = "code";
|
||||
public static final String PROPERTY_HAS_REQUIRED = "hasRequired";
|
||||
public static final int PROPERTY_REQUIRED = 1;
|
||||
public static final int PROPERTY_UNREQUIRED = 0;
|
||||
public static final String PERSON_PROPERTY_NAME = "name";
|
||||
public static final String PERSON_PROPERTY_ORGANIZATIONIDS = "organizationIds";
|
||||
public static final String PERSON_PROPERTY_LABELIDS = "labelIds";
|
||||
public static final String CREATE_SYS_ACCOUNT_CODE = "createSysAccount";
|
||||
public static final String CREATE_SYS_ACCOUNT_NAME = "同步创建账号";
|
||||
public static final String SYS_ACCOUNT_ID_CODE = "sysAccountId";
|
||||
public static final String SYS_ACCOUNT_ID_NAME = "同步创建账号系统ID";
|
||||
public static final Integer AGREE = Integer.valueOf(0);
|
||||
public static final String SYSTEM_USER = "system";
|
||||
public static final String IMAGE_STORE_ID = "imageStoreId";
|
||||
public static final String PASS_CRONS = "passCrons";
|
||||
public static final short PERSON_DELETED = -1;
|
||||
public static final short PERSON_VALIDATE = 0;
|
||||
public static final short PERSON_INVALIDATE = 1;
|
||||
public static final short DEVICE_PERSON_VALIDATE = 1;
|
||||
public static final short DEVICE_PERSON_INVALIDATE = 0;
|
||||
public static final Integer MAX_FILE = Integer.valueOf(3145728);
|
||||
public static final String SYSTEM_GROUP_CREATE_USER_ID = "group";
|
||||
public static final int PERSON_ACTION_DELETE = -1;
|
||||
public static final int PERSON_ACTION_ADD = 0;
|
||||
public static final int PERSON_ACTION_UPDATE = 1;
|
||||
public static final short GROUP_MODEL_STATUS_NO_IMG = 0;
|
||||
public static final int PERSON_VALIDATE_UNPROCESSED = 0;
|
||||
public static final int PERSON_VALIDATE_PROCESSED = 1;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package cn.cloudwalk.elevator.context;
|
||||
|
||||
public class CloudWalkExtendContextValue {
|
||||
private String loginId;
|
||||
private String authorization;
|
||||
|
||||
public String getLoginId() {
|
||||
return this.loginId;
|
||||
}
|
||||
|
||||
public void setLoginId(String loginId) {
|
||||
this.loginId = loginId;
|
||||
}
|
||||
|
||||
public String getAuthorization() {
|
||||
return this.authorization;
|
||||
}
|
||||
|
||||
public void setAuthorization(String authorization) {
|
||||
this.authorization = authorization;
|
||||
}
|
||||
}
|
||||
+14
@@ -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);
|
||||
}
|
||||
+46
@@ -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;
|
||||
}
|
||||
+9
@@ -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;
|
||||
}
|
||||
+98
@@ -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;
|
||||
}
|
||||
}
|
||||
+71
@@ -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;
|
||||
}
|
||||
}
|
||||
+35
@@ -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;
|
||||
}
|
||||
}
|
||||
+43
@@ -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;
|
||||
}
|
||||
}
|
||||
+151
@@ -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 + '}';
|
||||
}
|
||||
}
|
||||
+77
@@ -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 + '\'' + '}';
|
||||
}
|
||||
}
|
||||
+58
@@ -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;
|
||||
}
|
||||
}
|
||||
+35
@@ -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;
|
||||
}
|
||||
}
|
||||
+208
@@ -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;
|
||||
}
|
||||
}
|
||||
+16
@@ -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;
|
||||
}
|
||||
}
|
||||
+99
@@ -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;
|
||||
}
|
||||
}
|
||||
+235
@@ -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;
|
||||
}
|
||||
}
|
||||
+30
@@ -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;
|
||||
}
|
||||
+323
@@ -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;
|
||||
}
|
||||
}
|
||||
+30
@@ -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);
|
||||
}
|
||||
}
|
||||
+282
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+121
@@ -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);
|
||||
}
|
||||
}
|
||||
+929
@@ -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;
|
||||
}
|
||||
}
|
||||
+21
@@ -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);
|
||||
}
|
||||
}
|
||||
+14
@@ -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);
|
||||
}
|
||||
+45
@@ -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>
|
||||
+37
@@ -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);
|
||||
}
|
||||
+273
@@ -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>
|
||||
+9
@@ -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);
|
||||
}
|
||||
+17
@@ -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>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 设备域服务层:电梯设备查询/编辑、设备任务(含楼层变更)、设备侧设置与图库应用绑定等编排。
|
||||
* <p>
|
||||
* 同包名在 data 模块中承担 DAO/Mapper;此处仅放接口、入参出参与 {@code impl} 实现,表结构见 data 包说明。
|
||||
*/
|
||||
package cn.cloudwalk.elevator.device;
|
||||
+34
@@ -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;
|
||||
}
|
||||
}
|
||||
+43
@@ -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;
|
||||
}
|
||||
}
|
||||
+157
@@ -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 + '}';
|
||||
}
|
||||
}
|
||||
+123
@@ -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 + '\'' + '}';
|
||||
}
|
||||
}
|
||||
+27
@@ -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;
|
||||
}
|
||||
}
|
||||
+16
@@ -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;
|
||||
}
|
||||
}
|
||||
+91
@@ -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;
|
||||
}
|
||||
}
|
||||
+111
@@ -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;
|
||||
}
|
||||
}
|
||||
+92
@@ -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;
|
||||
}
|
||||
}
|
||||
+178
@@ -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;
|
||||
}
|
||||
}
|
||||
+99
@@ -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;
|
||||
}
|
||||
}
|
||||
+208
@@ -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;
|
||||
}
|
||||
}
|
||||
+115
@@ -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;
|
||||
}
|
||||
}
|
||||
+52
@@ -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;
|
||||
}
|
||||
}
|
||||
+68
@@ -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;
|
||||
}
|
||||
}
|
||||
+13
@@ -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;
|
||||
}
|
||||
+74
@@ -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;
|
||||
}
|
||||
+160
@@ -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("应用与图库解绑失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
+74
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -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;
|
||||
}
|
||||
}
|
||||
+34
@@ -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;
|
||||
}
|
||||
}
|
||||
+42
@@ -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;
|
||||
}
|
||||
}
|
||||
+26
@@ -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;
|
||||
}
|
||||
}
|
||||
+61
@@ -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;
|
||||
}
|
||||
}
|
||||
+26
@@ -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;
|
||||
}
|
||||
+13
@@ -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;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package cn.cloudwalk.elevator.downloadcenter;
|
||||
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.elevator.downloadcenter.param.AcsFileFinishParam;
|
||||
|
||||
public interface AcsDownloadCenterService {
|
||||
String createDownload(String paramString, CloudwalkCallContext paramCloudwalkCallContext);
|
||||
|
||||
boolean finishDownload(AcsFileFinishParam paramAcsFileFinishParam, CloudwalkCallContext paramCloudwalkCallContext);
|
||||
|
||||
int queryDownloadStatus(String paramString, CloudwalkCallContext paramCloudwalkCallContext);
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package cn.cloudwalk.elevator.downloadcenter.impl;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.file.param.FileFinishParam;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.file.param.FileGetParam;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.file.param.FileInitParam;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.file.result.FileDetail;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.file.service.FileService;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.elevator.common.AbstractCloudwalkService;
|
||||
import cn.cloudwalk.elevator.common.service.AcsApplicationService;
|
||||
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
|
||||
import cn.cloudwalk.elevator.downloadcenter.AcsDownloadCenterService;
|
||||
import cn.cloudwalk.elevator.downloadcenter.param.AcsFileFinishParam;
|
||||
import cn.cloudwalk.elevator.export.AcsFileStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AcsDownloadCenterServiceImpl extends AbstractCloudwalkService implements AcsDownloadCenterService {
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
@Autowired
|
||||
private AcsApplicationService acsApplicationService;
|
||||
|
||||
public String createDownload(String fileName, CloudwalkCallContext context) {
|
||||
try {
|
||||
FileInitParam fileInitParam = new FileInitParam();
|
||||
fileInitParam.setFileName(fileName);
|
||||
context.setApplicationId(this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId()));
|
||||
fileInitParam.setApplicationId(context.getApplicationId());
|
||||
FeignThreadLocalUtil.setRequestHeader(context);
|
||||
CloudwalkResult<String> result = this.fileService.init(fileInitParam, context);
|
||||
if ("00000000".equals(result.getCode())) {
|
||||
return (String)result.getData();
|
||||
}
|
||||
this.logger.error("下载任务初始化失败:code={},message={}", result.getCode(), result.getMessage());
|
||||
throw new RuntimeException("下载任务创建失败!");
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("下载任务初始化接口错误", (Throwable)e);
|
||||
throw new RuntimeException("下载任务创建失败!");
|
||||
} finally {
|
||||
FeignThreadLocalUtil.remove();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean finishDownload(AcsFileFinishParam param, CloudwalkCallContext context) {
|
||||
try {
|
||||
FeignThreadLocalUtil.setRequestHeader(context);
|
||||
FileFinishParam fileFinishParam =
|
||||
(FileFinishParam)BeanCopyUtils.copyProperties(param, FileFinishParam.class);
|
||||
CloudwalkResult<Boolean> result = this.fileService.finish(fileFinishParam, context);
|
||||
if ("00000000".equals(result.getCode())) {
|
||||
return true;
|
||||
}
|
||||
this.logger.error("下载任务完成失败:code={},message={}", result.getCode(), result.getMessage());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("下载任务完成接口错误", (Throwable)e);
|
||||
} finally {
|
||||
FeignThreadLocalUtil.remove();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int queryDownloadStatus(String fileId, CloudwalkCallContext context) {
|
||||
try {
|
||||
FileGetParam fileGetParam = new FileGetParam();
|
||||
fileGetParam.setFileId(fileId);
|
||||
CloudwalkResult<FileDetail> result = this.fileService.get(fileGetParam, context);
|
||||
if ("00000000".equals(result.getCode())) {
|
||||
return ((FileDetail)result.getData()).getStatus().intValue();
|
||||
}
|
||||
this.logger.error("下载任务初始化失败:code={},message={}", result.getCode(), result.getMessage());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("下载任务完成接口错误", (Throwable)e);
|
||||
}
|
||||
return AcsFileStatusEnum.PRODUCING.getCode().intValue();
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package cn.cloudwalk.elevator.downloadcenter.param;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsFileFinishParam implements Serializable {
|
||||
private static final long serialVersionUID = 4334332744642479052L;
|
||||
private String fileId;
|
||||
private Long fileSize;
|
||||
private String filePath;
|
||||
private Integer fileStatus;
|
||||
private String errorCode;
|
||||
private String errorMessage;
|
||||
|
||||
public String getFileId() {
|
||||
return this.fileId;
|
||||
}
|
||||
|
||||
public void setFileId(String fileId) {
|
||||
this.fileId = fileId;
|
||||
}
|
||||
|
||||
public Long getFileSize() {
|
||||
return this.fileSize;
|
||||
}
|
||||
|
||||
public void setFileSize(Long fileSize) {
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public Integer getFileStatus() {
|
||||
return this.fileStatus;
|
||||
}
|
||||
|
||||
public void setFileStatus(Integer fileStatus) {
|
||||
this.fileStatus = fileStatus;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return this.errorCode;
|
||||
}
|
||||
|
||||
public void setErrorCode(String errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return this.errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user