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

Former-commit-id: dc30d42a8c55ed8b2382a41dc2434233fbed9930
This commit is contained in:
反编译工作区
2026-04-29 12:09:48 +08:00
parent ea8e492076
commit e8672a3c7b
1759 changed files with 547735 additions and 280 deletions
@@ -0,0 +1,87 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkSessionContextHolder
* cn.cloudwalk.cloud.context.CloudwalkSessionObject
* cn.cloudwalk.elevator.config.FeignThreadLocalUtil
* feign.RequestInterceptor
* feign.RequestTemplate
* javax.servlet.http.HttpServletRequest
* org.apache.commons.lang3.StringUtils
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.context.annotation.Configuration
* org.springframework.web.context.request.RequestContextHolder
* org.springframework.web.context.request.ServletRequestAttributes
*/
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.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 map = FeignThreadLocalUtil.get();
if (map != null && !map.isEmpty()) {
requestTemplate.header("platformuserid", new String[]{(String)map.get("platformuserid")});
requestTemplate.header("loginid", new String[]{(String)map.get("loginid")});
requestTemplate.header("businessid", new String[]{(String)map.get("businessid")});
requestTemplate.header("username", new String[]{(String)map.get("username")});
requestTemplate.header("applicationid", new String[]{(String)map.get("applicationid")});
requestTemplate.header("authorization", new String[]{(String)map.get("authorization")});
this.logger.info("feign\u8c03\u7528\u914d\u7f6eheader\u53c2\u6570, businessId={}, threadId={}", requestTemplate.headers().get("businessid"), (Object)Thread.currentThread().getId());
} else {
Map 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((CharSequence)request.getHeader("businessid")) && session != null) {
requestTemplate.header("businessid", new String[]{session.getCompany().getCompanyId()});
}
if (StringUtils.isBlank((CharSequence)request.getHeader("applicationid")) && session != null) {
requestTemplate.header("applicationid", new String[]{session.getApplicationId()});
}
}
}
}
}
@@ -0,0 +1,35 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.param.DeviceAreaTreeParam
* cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.result.AreaTreeResult
* cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.service.SysettingAreaService
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.result.CloudwalkResult
* org.springframework.cache.annotation.Cacheable
* org.springframework.stereotype.Service
*/
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);
}
}
@@ -0,0 +1,69 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.codeElevatorArea.dao.AcsElevatorCodeDao
* cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeDTO
* cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* org.springframework.stereotype.Repository
* org.springframework.util.ObjectUtils
*/
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 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(this.getClass());
@Override
public Integer insertNew(AcsElevatorCodeParam param) throws ServiceException {
AcsElevatorCodeDTO dto = (AcsElevatorCodeDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorCodeDTO.class);
Long createTime = System.currentTimeMillis();
dto.setCreateTime(createTime);
dto.setLastUpdateTime(createTime);
return this.acsElevatorCodeDao.insertNew(dto);
}
@Override
public Integer updateOld(AcsElevatorCodeParam param) throws ServiceException {
AcsElevatorCodeDTO dto = (AcsElevatorCodeDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorCodeDTO.class);
Long nowTime = System.currentTimeMillis();
dto.setLastUpdateTime(nowTime);
return this.acsElevatorCodeDao.updateOld(dto);
}
@Override
public AcsElevatorCodeResultDTO get(AcsElevatorCodeParam param) throws ServiceException {
AcsElevatorCodeDTO dto = (AcsElevatorCodeDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorCodeDTO.class);
AcsElevatorCodeResultDTO result = this.acsElevatorCodeDao.get(dto);
if (!ObjectUtils.isEmpty((Object)result)) {
return result;
}
return null;
}
@Override
public AcsElevatorCodeResultDTO getFirstByParentId(String parentId) throws ServiceException {
return this.acsElevatorCodeDao.getFirstByParentId(parentId);
}
}
@@ -0,0 +1,52 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.entity.CloudwalkBaseTimes
*/
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;
}
}
@@ -0,0 +1,35 @@
/*
* Decompiled with CFR 0.152.
*/
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;
}
}
@@ -0,0 +1,23 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO
*/
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;
public interface AcsElevatorCodeService {
public Integer insertNew(AcsElevatorCodeParam var1) throws ServiceException;
public Integer updateOld(AcsElevatorCodeParam var1) throws ServiceException;
public AcsElevatorCodeResultDTO get(AcsElevatorCodeParam var1) throws ServiceException;
public AcsElevatorCodeResultDTO getFirstByParentId(String var1) throws ServiceException;
}
@@ -0,0 +1,53 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.result.AreaTreeResult
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.session.company.CompanyContext
* cn.cloudwalk.cloud.session.user.UserContext
* cn.cloudwalk.cloud.utils.CloudwalkDateUtils
* cn.cloudwalk.elevator.config.FeignThreadLocalUtil
*/
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.common.AbstractCloudwalkService;
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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) continue;
this.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());
HashMap<String, String> feignThreadLoaclMap = new HashMap<String, String>(3);
feignThreadLoaclMap.put("businessid", businessId);
feignThreadLoaclMap.put("platformuserid", "defaultUserId");
feignThreadLoaclMap.put("username", "defaultUserName");
FeignThreadLocalUtil.set(feignThreadLoaclMap);
return context;
}
}
@@ -0,0 +1,54 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceService
* cn.cloudwalk.cloud.serial.UUIDSerial
* cn.cloudwalk.cloud.utils.CloudwalkDateUtils
* cn.cloudwalk.serial.code.AbstractGeneralCode
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.context.MessageSource
* org.springframework.context.i18n.LocaleContextHolder
*/
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(this.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();
}
}
@@ -0,0 +1,58 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.resource.application.param.ApplicationQueryParam
* cn.cloudwalk.client.resource.application.result.ApplicationResult
* cn.cloudwalk.client.resource.application.service.ApplicationService
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* org.apache.commons.collections4.CollectionUtils
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* org.springframework.cache.annotation.Cacheable
* org.springframework.stereotype.Service
*/
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;
@Override
@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 cloudwalkResult = this.applicationService.query(param);
if (cloudwalkResult.isSuccess()) {
if (CollectionUtils.isNotEmpty((Collection)((Collection)cloudwalkResult.getData()))) {
return ((ApplicationResult)((List)cloudwalkResult.getData()).get(0)).getId();
}
logger.info("\u672a\u67e5\u5230applicationId");
throw new ServiceException("76260005", "\u672a\u67e5\u5230applicationId");
}
logger.info("\u67e5\u8be2applicationId\u5931\u8d25");
throw new ServiceException("76260006", "\u67e5\u8be2applicationId\u5931\u8d25");
}
}
@@ -0,0 +1,62 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.springframework.boot.context.properties.ConfigurationProperties
* org.springframework.context.annotation.Configuration
*/
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;
}
}
@@ -0,0 +1,38 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.context.annotation.Bean
* org.springframework.context.annotation.Configuration
* org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
*/
package cn.cloudwalk.elevator.common;
import cn.cloudwalk.elevator.common.UpdateFloorsPoolProperties;
import java.util.concurrent.RejectedExecutionHandler;
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.setThreadNamePrefix("update-floors-pool-");
threadPoolTaskExecutor.setRejectedExecutionHandler((RejectedExecutionHandler)new ThreadPoolExecutor.AbortPolicy());
threadPoolTaskExecutor.initialize();
return threadPoolTaskExecutor;
}
}
@@ -0,0 +1,14 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
*/
package cn.cloudwalk.elevator.common.service;
import cn.cloudwalk.cloud.exception.ServiceException;
public interface AcsApplicationService {
public String getApplicationId(String var1) throws ServiceException;
}
@@ -0,0 +1,150 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.elevator.device.dao.AcsDeviceTaskDao
* cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto
* cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO
* cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleDeleteDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
* cn.cloudwalk.elevator.util.CollectionUtils
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.scheduling.annotation.Async
* org.springframework.stereotype.Service
* org.springframework.util.ObjectUtils
*/
package cn.cloudwalk.elevator.device.impl;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
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.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.Collections;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@Service
public class AcsDeviceTaskServiceImpl
extends AbstractAcsDeviceService
implements AcsDeviceTaskService {
@Autowired
private PersonRuleService personRuleService;
@Autowired
private ImageRuleRefService imageRuleRefService;
@Resource
private AcsDeviceTaskDao acsDeviceTaskDao;
@Resource
private ImageRuleRefDao imageRuleRefDao;
@Override
@Async(value="updateFloorsExecutor")
public void updateFloors(AcsRestructureBindingParam param, List<AcsPassRuleImageResultDto> addFloors, List<String> delFloorIds, CloudwalkCallContext context) throws ServiceException {
block16: {
try {
if (!CollectionUtils.isEmpty(addFloors)) {
for (AcsPassRuleImageResultDto addFloor : addFloors) {
AcsDeviceTaskDTO task = this.acsDeviceTaskDao.getById(param.getTaskId());
if (task.getIsStop() != 0) break;
if (!ObjectUtils.isEmpty((Object)param.getPersonId())) {
AcsPersonAddParam addParam = new AcsPersonAddParam();
addParam.setPersonIds(Collections.singletonList(param.getPersonId()));
addParam.setParentId(param.getParentId());
addParam.setZoneId(addFloor.getZoneId());
addParam.setZoneName(addFloor.getZoneName());
this.personRuleService.add(addParam, context);
} else {
AcsPassRuleNewParam ruleParam = new AcsPassRuleNewParam();
ruleParam.setParentId(param.getParentId());
ruleParam.setZoneId(addFloor.getZoneId());
ruleParam.setZoneName(addFloor.getZoneName());
if (!ObjectUtils.isEmpty((Object)param.getLabelId())) {
ruleParam.setIncludeLabels(Collections.singletonList(param.getLabelId()));
ruleParam.setRuleName(addFloor.getZoneName() + param.getLabelName());
}
if (!ObjectUtils.isEmpty((Object)param.getOrgId())) {
ruleParam.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
ruleParam.setRuleName(addFloor.getZoneName() + param.getOrgName());
}
this.imageRuleRefService.addOnlyRule(ruleParam, context);
}
AcsDeviceTaskAddDto addDto = new AcsDeviceTaskAddDto();
addDto.setId(task.getId());
addDto.setBindDevices(Integer.valueOf(task.getBindDevices() + 1));
this.acsDeviceTaskDao.updateBingDevices(addDto);
}
}
if (CollectionUtils.isEmpty(delFloorIds)) break block16;
List ruleList = this.imageRuleRefDao.listZoneInfoByIds(delFloorIds);
HashMap ruleMap = new HashMap();
ruleList.forEach(rule -> ruleMap.put(rule.getZoneId(), rule.getZoneName()));
for (String delFloorId : delFloorIds) {
AcsDeviceTaskDTO task = this.acsDeviceTaskDao.getById(param.getTaskId());
if (task.getIsStop() == 0) {
if (!ObjectUtils.isEmpty((Object)param.getPersonId())) {
AcsPersonDeleteParam delParam = new AcsPersonDeleteParam();
delParam.setParentId(param.getParentId());
delParam.setZoneId(delFloorId);
delParam.setPersonIds(Collections.singletonList(param.getPersonId()));
this.personRuleService.delete(delParam, context);
} else {
String ruleId;
String ruleName = "";
if (!ObjectUtils.isEmpty((Object)param.getLabelName())) {
ruleName = (String)ruleMap.get(delFloorId) + param.getLabelName();
}
if (!ObjectUtils.isEmpty((Object)param.getOrgName())) {
ruleName = (String)ruleMap.get(delFloorId) + param.getOrgName();
}
if (!ObjectUtils.isEmpty((Object)(ruleId = this.imageRuleRefDao.getByRuleName(ruleName, delFloorId)))) {
AcsPassRuleDeleteParam deleteParam = new AcsPassRuleDeleteParam();
deleteParam.setIds(Collections.singletonList(ruleId));
deleteParam.setZoneId(delFloorId);
deleteParam.setParentId(param.getParentId());
this.imageRuleRefService.delete(deleteParam, context);
} else {
AcsPassRuleDeleteDto dto = new AcsPassRuleDeleteDto();
dto.setZoneId(delFloorId);
dto.setLabelId(param.getLabelId());
dto.setOrgId(param.getOrgId());
this.imageRuleRefDao.deleteByOrgAndLabel(dto);
}
}
AcsDeviceTaskAddDto addDto = new AcsDeviceTaskAddDto();
addDto.setId(task.getId());
addDto.setBindDevices(Integer.valueOf(task.getBindDevices() + 1));
this.acsDeviceTaskDao.updateBingDevices(addDto);
continue;
}
break;
}
}
catch (Exception e) {
this.logger.error("\u5904\u7406\u8bbe\u5907\u4efb\u52a1\u5931\u8d25\uff0c\u5931\u8d25\u539f\u56e0\uff1a{}", (Throwable)e);
throw new ServiceException(e.getMessage());
}
}
}
}
@@ -0,0 +1,960 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult
* cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceService
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreAddParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreDelParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonDetailParam
* cn.cloudwalk.client.cwoscomponent.intelligent.person.result.PersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService
* cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.param.DeviceAreaTreeParam
* cn.cloudwalk.client.cwoscomponent.intelligent.sysetting.result.AreaTreeResult
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.device.dao.AcsDeviceTaskDao
* cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao
* cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao
* cn.cloudwalk.elevator.device.dto.AcsDeviceTaskAddDto
* cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceAddDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceEditDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryByIdDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryFoDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO
* cn.cloudwalk.elevator.passrule.dao.AcsPassRuleDao
* cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleLabelResultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto
* cn.cloudwalk.elevator.util.CollectionUtils
* cn.cloudwalk.elevator.util.StringUtils
* com.alibaba.fastjson.JSONObject
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.beans.factory.annotation.Value
* org.springframework.stereotype.Repository
* org.springframework.util.ObjectUtils
*/
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(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(this.getClass());
@Override
public Integer add(AcsElevatorDeviceAddParam param, CloudwalkCallContext context) throws ServiceException {
AcsElevatorDeviceAddDTO dto = (AcsElevatorDeviceAddDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceAddDTO.class);
try {
Long createTime = System.currentTimeMillis();
dto.setCreateTime(createTime);
dto.setLastUpdateTime(createTime);
String currentBuildingId = dto.getCurrentBuildingId();
if (dto.getDeleteFlag() == null) {
dto.setDeleteFlag(Integer.valueOf(1));
}
if (StringUtils.isNotBlank((String)currentBuildingId)) {
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(currentBuildingId);
if (ObjectUtils.isEmpty((Object)imageStoreId)) {
String bigImageStoreId = this.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("\u4fdd\u5b58\u6d3e\u68af\u8bbe\u5907\u4fe1\u606f\u5931\u8d25\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public Integer edit(AcsElevatorDeviceEditParam param, CloudwalkCallContext context) throws ServiceException {
AcsElevatorDeviceEditDTO dto = (AcsElevatorDeviceEditDTO)BeanCopyUtils.copyProperties((Object)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((String)deviceResultDTO.getCurrentFloorId()) && !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((Object)imageStoreId)) {
AcsElevatorDeviceAddParam addParam = (AcsElevatorDeviceAddParam)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceAddParam.class);
String bigImageStoreId = this.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 = System.currentTimeMillis();
dto.setLastUpdateTime(nowTime);
return this.acsElevatorDeviceDao.edit(dto);
}
catch (Exception e) {
this.logger.error("\u66f4\u65b0\u6d3e\u68af\u8bbe\u5907\u4fe1\u606f\u5931\u8d25\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
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);
return 1;
}
catch (Exception e) {
this.logger.error("\u66f4\u65b0\u6d3e\u68af\u8bbe\u5907\u4fe1\u606f\u5931\u8d25\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public String getBuildingId(AcsElevatorDeviceQueryParam param) throws ServiceException {
AcsElevatorDeviceQueryDTO dto = (AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceQueryDTO.class);
return this.acsElevatorDeviceDao.getBuildingId(dto);
}
@Override
public String getBusinessId(AcsElevatorDeviceQueryParam param) throws ServiceException {
AcsElevatorDeviceQueryDTO dto = (AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceQueryDTO.class);
return this.acsElevatorDeviceDao.getBusinessId(dto);
}
@Override
public CloudwalkResult<CloudwalkPageAble<AcsElevatorDeviceResultDTO>> get(AcsElevatorDeviceQueryParam param, CloudwalkCallContext context) throws ServiceException {
AcsElevatorDeviceQueryDTO dto = (AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceQueryDTO.class);
dto.setBusinessId(context.getCompany().getCompanyId());
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
try {
CloudwalkPageAble deviceList = this.acsElevatorDeviceDao.page(dto, page);
return CloudwalkResult.success((Object)deviceList);
}
catch (Exception e) {
this.logger.error("\u5206\u9875\u67e5\u8be2\u6d3e\u68af\u8bbe\u5907\u5931\u8d25\uff0c\u5931\u8d25\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException("76260108", this.getMessage("76260108"));
}
}
@Override
public CloudwalkResult<CloudwalkPageAble<DeviceResult>> devicePage(AcsDeviceQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
try {
DeviceQueryParam queryParam = new DeviceQueryParam();
if (!ObjectUtils.isEmpty((Object)param.getDeviceName())) {
queryParam.setDeviceName(param.getDeviceName());
}
if (!ObjectUtils.isEmpty((Object)param.getAreaId())) {
queryParam.setAreaIds(Collections.singletonList(param.getAreaId()));
}
if (!ObjectUtils.isEmpty((Object)param.getDeviceCategoryId())) {
queryParam.setDeviceTypeCategoryId(param.getDeviceCategoryId());
}
queryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult pageResult = this.deviceService.list(queryParam, context);
List<Object> result = new ArrayList();
if (!pageResult.isSuccess() || CollectionUtils.isEmpty((Collection)((Collection)pageResult.getData()))) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
List<DeviceResult> deviceResult = this.deviceFilter((List)pageResult.getData(), context);
if (CollectionUtils.isEmpty(deviceResult)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
Map<String, String> areaMap = this.getAllAreaMap(context);
result = this.page(this.convertDeviceNewResult(deviceResult, areaMap), pageInfo.getPageSize(), pageInfo.getCurrentPage());
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, (long)deviceResult.size()));
}
catch (Exception e) {
this.logger.error("\u5206\u9875\u67e5\u8be2\u8bbe\u5907\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public List<AcsElevatorDeviceQueryFoDTO> getFo(AcsElevatorDeviceQueryParam param) throws ServiceException {
AcsElevatorDeviceQueryDTO dto = (AcsElevatorDeviceQueryDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceQueryDTO.class);
List deviceList = this.acsElevatorDeviceDao.get(dto);
ArrayList<AcsElevatorDeviceQueryFoDTO> deviceFoList = new ArrayList<AcsElevatorDeviceQueryFoDTO>();
for (AcsElevatorDeviceResultDTO resultDTO : deviceList) {
AcsElevatorDeviceQueryFoDTO foDto = (AcsElevatorDeviceQueryFoDTO)BeanCopyUtils.copyProperties((Object)resultDTO, AcsElevatorDeviceQueryFoDTO.class);
deviceFoList.add(foDto);
}
return deviceFoList;
}
@Override
public AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdParam param, CloudwalkCallContext var2) throws ServiceException {
AcsElevatorDeviceQueryByIdDTO dto = (AcsElevatorDeviceQueryByIdDTO)BeanCopyUtils.copyProperties((Object)param, AcsElevatorDeviceQueryByIdDTO.class);
AcsElevatorDeviceResultDTO resultDTO = this.acsElevatorDeviceDao.getById(dto);
if (resultDTO != null && StringUtils.isNotBlank((String)resultDTO.getDeviceId())) {
DeviceResult deviceResult;
DeviceQueryParam deviceQueryParam = new DeviceQueryParam();
deviceQueryParam.setId(resultDTO.getId());
CloudwalkResult result = this.deviceService.list(deviceQueryParam, var2);
List list = (List)result.getData();
if (list != null && list.size() > 0 && (deviceResult = (DeviceResult)list.get(0)) != null) {
String id = deviceResult.getId();
Long lastHeartbeatTime = deviceResult.getLastHeartbeatTime();
String status = deviceResult.getOnlineStatus();
resultDTO.setStatusString(status);
resultDTO.setLastHeartbeatTime(lastHeartbeatTime);
}
}
return resultDTO;
}
@Override
public AcsElevatorDeviceResultDTO getByDeciveCode(String deviceCode) throws ServiceException {
return this.acsElevatorDeviceDao.getByDeciveCode(deviceCode);
}
@Override
public CloudwalkResult listUnbindFloors(AcsRestructureQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
List floorList;
AcsPassRuleImageDto dto;
ArrayList results = new ArrayList();
if (!ObjectUtils.isEmpty((Object)param.getPersonId())) {
dto = new AcsPassRuleImageDto();
dto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getOrganizationIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
floorList = this.imageRuleRefDao.listByPersonInfo(dto);
} else {
dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty((Object)param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty((Object)param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
floorList = this.imageRuleRefDao.listByRestructure(dto);
}
ArrayList floorIds = new ArrayList();
if (!CollectionUtils.isEmpty((Collection)floorList)) {
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
}
AcsPassRuleQueryDto queryDto = new AcsPassRuleQueryDto();
queryDto.setZoneIds(floorIds);
return CloudwalkResult.success((Object)this.imageRuleRefDao.listByNotZoneIds(queryDto));
}
catch (Exception e) {
this.logger.error("\u67e5\u8be2\u672a\u7ed1\u5b9a\u7684\u6d3e\u68af\u697c\u5c42\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public CloudwalkResult listFloors(AcsRestructureQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
List unBindFloors;
List floorList;
AcsPassRuleImageDto dto;
ArrayList<AcsDeviceRestructureResult> results = new ArrayList<AcsDeviceRestructureResult>();
if (!ObjectUtils.isEmpty((Object)param.getPersonId())) {
dto = new AcsPassRuleImageDto();
dto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getOrganizationIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
floorList = this.imageRuleRefDao.listByPersonInfo(dto);
} else {
dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty((Object)param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty((Object)param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
floorList = this.imageRuleRefDao.listByRestructure(dto);
}
dto = new AcsElevatorDeviceListDto();
ArrayList floorIds = new ArrayList();
if (!CollectionUtils.isEmpty((Collection)floorList)) {
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
}
AcsPassRuleQueryDto queryDto = new AcsPassRuleQueryDto();
if (!ObjectUtils.isEmpty((Object)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);
}
ArrayList unBindFloorIds = new ArrayList();
if (CollectionUtils.isEmpty((Collection)unBindFloors)) {
return CloudwalkResult.success(results);
}
unBindFloors.forEach(floor -> unBindFloorIds.add(floor.getZoneId()));
if (!ObjectUtils.isEmpty((Object)param.getZoneId())) {
dto.setCurrentFloorId(param.getZoneId());
} else {
dto.setCurrentFloorIds(unBindFloorIds);
}
List deviceList = this.acsElevatorDeviceDao.listByZoneIds((AcsElevatorDeviceListDto)dto);
ArrayList deviceIds = new ArrayList();
HashMap<String, DeviceResult> mapDevice = new HashMap<String, DeviceResult>();
if (!CollectionUtils.isEmpty((Collection)deviceList)) {
deviceList.forEach(device -> deviceIds.add(device.getDeviceId()));
DeviceQueryParam queryParam = new DeviceQueryParam();
queryParam.setBusinessId(context.getCompany().getCompanyId());
queryParam.setIds(deviceIds);
CloudwalkResult resultList = this.deviceService.list(queryParam, context);
List list = (List)resultList.getData();
if (list != null && list.size() > 0) {
for (DeviceResult deviceResult : list) {
mapDevice.put(deviceResult.getId(), deviceResult);
}
}
}
for (AcsPassRuleImageResultDto floor2 : unBindFloors) {
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor2.getZoneId());
result.setZoneName(floor2.getZoneName());
if (!CollectionUtils.isEmpty((Collection)deviceList)) {
result.setParentId(((AcsElevatorDeviceResultDTO)deviceList.get(0)).getCurrentBuildingId());
} else {
result.setParentId(this.floorBuildingId);
}
String online = "";
String offline = "";
if (!CollectionUtils.isEmpty((Collection)deviceList)) {
for (int i = 0; i < deviceList.size(); ++i) {
DeviceResult deviceResult;
if (!floor2.getZoneId().equals(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getCurrentFloorId()) || ObjectUtils.isEmpty((Object)(deviceResult = (DeviceResult)mapDevice.get(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getDeviceId())))) continue;
if ("2".equals(deviceResult.getOnlineStatus())) {
if ("".equals(online)) {
online = online + deviceResult.getDeviceName();
continue;
}
online = online + "," + deviceResult.getDeviceName();
continue;
}
offline = "".equals(offline) ? offline + deviceResult.getDeviceName() : offline + ',' + deviceResult.getDeviceName();
}
}
result.setOnlineDevices(online);
result.setOfflineDevices(offline);
results.add(result);
}
return CloudwalkResult.success(results);
}
catch (Exception e) {
this.logger.error("\u67e5\u8be2\u672a\u7ed1\u5b9a\u7684\u6d3e\u68af\u697c\u5c42\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
/*
* Enabled force condition propagation
* Lifted jumps to return sites
*/
@Override
public CloudwalkResult listCondition(AcsRestructureQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
List floorList;
AcsPassRuleImageDto dto;
ArrayList<AcsDeviceRestructureResult> results = new ArrayList<AcsDeviceRestructureResult>();
if (!ObjectUtils.isEmpty((Object)param.getBusinessId())) {
context.getCompany().setCompanyId(param.getBusinessId());
}
if (!ObjectUtils.isEmpty((Object)param.getPersonId())) {
dto = new AcsPassRuleImageDto();
dto.setPersonId(param.getPersonId());
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getOrganizationIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
floorList = this.imageRuleRefDao.listByPersonInfo(dto);
} else {
dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty((Object)param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty((Object)param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
floorList = this.imageRuleRefDao.listByRestructure(dto);
}
if (CollectionUtils.isEmpty((Collection)floorList)) return CloudwalkResult.success(results);
dto = new AcsElevatorDeviceListDto();
ArrayList floorIds = new ArrayList();
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
if (!ObjectUtils.isEmpty((Object)param.getZoneId())) {
if (!floorIds.contains(param.getZoneId())) return CloudwalkResult.success(results);
dto.setCurrentFloorIds(Collections.singletonList(param.getZoneId()));
} else {
dto.setCurrentFloorIds(floorIds);
}
List deviceList = this.acsElevatorDeviceDao.listByZoneIds((AcsElevatorDeviceListDto)dto);
if (!CollectionUtils.isEmpty((Collection)deviceList)) {
ArrayList deviceIds = new ArrayList();
deviceList.forEach(device -> deviceIds.add(device.getDeviceId()));
HashMap<String, DeviceResult> mapDevice = new HashMap<String, DeviceResult>();
DeviceQueryParam queryParam = new DeviceQueryParam();
queryParam.setBusinessId(context.getCompany().getCompanyId());
queryParam.setIds(deviceIds);
CloudwalkResult resultList = this.deviceService.list(queryParam, context);
List list = (List)resultList.getData();
if (list != null && list.size() > 0) {
for (DeviceResult deviceResult : list) {
mapDevice.put(deviceResult.getId(), deviceResult);
}
}
for (AcsPassRuleImageResultDto floor2 : floorList) {
if (!ObjectUtils.isEmpty((Object)param.getZoneId()) && !param.getZoneId().equals(floor2.getZoneId())) continue;
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor2.getZoneId());
result.setZoneName(floor2.getZoneName());
result.setParentId(this.floorBuildingId);
String online = "";
String offline = "";
for (int i = 0; i < deviceList.size(); ++i) {
if (!floor2.getZoneId().equals(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getCurrentFloorId())) continue;
DeviceResult deviceResult = (DeviceResult)mapDevice.get(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getDeviceId());
result.setParentId(((AcsElevatorDeviceResultDTO)deviceList.get(i)).getCurrentBuildingId());
if (ObjectUtils.isEmpty((Object)deviceResult)) continue;
if ("2".equals(deviceResult.getOnlineStatus())) {
if ("".equals(online)) {
online = online + deviceResult.getDeviceName();
continue;
}
online = online + "," + deviceResult.getDeviceName();
continue;
}
offline = "".equals(offline) ? offline + deviceResult.getDeviceName() : offline + ',' + deviceResult.getDeviceName();
}
result.setOnlineDevices(online);
result.setOfflineDevices(offline);
results.add(result);
}
return CloudwalkResult.success(results);
}
if (!ObjectUtils.isEmpty((Object)param.getZoneId())) {
for (AcsPassRuleImageResultDto floor3 : floorList) {
if (!floor3.getZoneId().equals(param.getZoneId())) continue;
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor3.getZoneId());
result.setZoneName(floor3.getZoneName());
result.setParentId(this.floorBuildingId);
results.add(result);
return CloudwalkResult.success(results);
}
return CloudwalkResult.success(results);
}
for (AcsPassRuleImageResultDto floor4 : floorList) {
AcsDeviceRestructureResult result = new AcsDeviceRestructureResult();
result.setZoneId(floor4.getZoneId());
result.setZoneName(floor4.getZoneName());
result.setParentId(this.floorBuildingId);
results.add(result);
}
return CloudwalkResult.success(results);
}
catch (Exception e) {
this.logger.error("\u6839\u636e\u673a\u6784id\u3001\u6807\u7b7eid\u3001\u4eba\u5458id\u67e5\u8be2\u6d3e\u68af\u8bbe\u5907\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public CloudwalkResult listConditionByLabelIds(AcsRestructureQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
ArrayList<AcsLabelElevatorResult> results = new ArrayList<AcsLabelElevatorResult>();
if (CollectionUtils.isEmpty(param.getLabelIds())) {
return CloudwalkResult.success(null);
}
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
dto.setIncludeLabels(param.getLabelIds());
List floorList = this.imageRuleRefDao.listFloorsByRestructure(dto);
HashMap<String, List> maps = new HashMap<String, List>();
if (CollectionUtils.isEmpty((Collection)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 dtos = (List)maps.get(resultDto.getLabelId());
if (!CollectionUtils.isEmpty((Collection)dtos)) {
dtos.add(resultDto);
maps.put(resultDto.getLabelId(), dtos);
continue;
}
ArrayList<AcsPassRuleLabelResultDto> dtoList = new ArrayList<AcsPassRuleLabelResultDto>();
dtoList.add(resultDto);
maps.put(resultDto.getLabelId(), dtoList);
}
for (String label : param.getLabelIds()) {
List dtoList = (List)maps.get(label);
AcsLabelElevatorResult result = new AcsLabelElevatorResult();
result.setLabelId(label);
if (!CollectionUtils.isEmpty((Collection)dtoList)) {
result.setDetails(dtoList);
} else {
result.setDetails(null);
}
results.add(result);
}
}
return CloudwalkResult.success(results);
}
catch (Exception e) {
this.logger.error("\u6839\u636e\u6807\u7b7eid\u96c6\u5408\u67e5\u8be2\u6d3e\u68af\u697c\u5c42\u6743\u9650\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public CloudwalkResult<String> bindingFloors(AcsRestructureBindingParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
if (!ObjectUtils.isEmpty((Object)param.getLabelId())) {
dto.setIncludeLabels(Collections.singletonList(param.getLabelId()));
}
if (!ObjectUtils.isEmpty((Object)param.getOrgId())) {
dto.setIncludeOrganizations(Collections.singletonList(param.getOrgId()));
}
List floorList = this.imageRuleRefDao.listByRestructure(dto);
ArrayList<String> floorIds = new ArrayList<String>();
HashMap<String, AcsPassRuleImageResultDto> zoneMap = new HashMap<String, AcsPassRuleImageResultDto>();
for (AcsPassRuleImageResultDto resultDto : floorList) {
floorIds.add(resultDto.getZoneId());
zoneMap.put(resultDto.getZoneId(), resultDto);
}
ArrayList<AcsPassRuleImageResultDto> addFloors = new ArrayList<AcsPassRuleImageResultDto>();
ArrayList<String> delFloorIds = new ArrayList<String>();
ArrayList<String> addFloorIds = new ArrayList<String>();
if (!CollectionUtils.isEmpty((Collection)floorList)) {
for (AcsPassRuleImageResultDto floor : floorList) {
if (param.getZoneIds().contains(floor.getZoneId())) continue;
delFloorIds.add(floor.getZoneId());
}
for (String zoneId : param.getZoneIds()) {
if (floorIds.contains(zoneId)) continue;
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 = this.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((Object)taskId);
}
return CloudwalkResult.success(null);
}
catch (Exception e) {
this.logger.error("\u6839\u636e\u673a\u6784id\u3001\u6807\u7b7eid\u3001\u4eba\u5458id\u67e5\u8be2\u6d3e\u68af\u8bbe\u5907\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
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 detail = this.personService.detail(detailParam, context);
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeLabels(((PersonResult)detail.getData()).getLabelIds());
}
if (!CollectionUtils.isEmpty((Collection)((PersonResult)detail.getData()).getLabelIds())) {
dto.setIncludeOrganizations(((PersonResult)detail.getData()).getOrganizationIds());
}
List floorList = this.imageRuleRefDao.listByPersonInfo(dto);
ArrayList<String> floorIds = new ArrayList<String>();
HashMap<String, AcsPassRuleImageResultDto> zoneMap = new HashMap<String, AcsPassRuleImageResultDto>();
floorList.forEach(floor -> floorIds.add(floor.getZoneId()));
for (AcsPassRuleImageResultDto resultDto : floorList) {
floorIds.add(resultDto.getZoneId());
zoneMap.put(resultDto.getZoneId(), resultDto);
}
ArrayList<AcsPassRuleImageResultDto> addFloors = new ArrayList<AcsPassRuleImageResultDto>();
ArrayList<String> delFloorIds = new ArrayList<String>();
ArrayList<String> addFloorIds = new ArrayList<String>();
if (!CollectionUtils.isEmpty((Collection)floorList)) {
for (AcsPassRuleImageResultDto floor2 : floorList) {
if (param.getZoneIds().contains(floor2.getZoneId())) continue;
delFloorIds.add(floor2.getZoneId());
}
for (String zoneId : param.getZoneIds()) {
if (floorIds.contains(zoneId)) continue;
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 = this.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((Object)taskId);
}
return CloudwalkResult.success(null);
}
catch (Exception e) {
this.logger.error("\u6839\u4eba\u5458\u6279\u91cf\u7ed1\u5b9a\u6d3e\u68af\u697c\u5c42\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
public CloudwalkResult<AcsDeviceTaskDTO> getTask(AcsDeviceRestructureTaskParam param, CloudwalkCallContext context) throws ServiceException {
try {
return CloudwalkResult.success((Object)this.acsDeviceTaskDao.getById(param.getTaskId()));
}
catch (Exception e) {
this.logger.error("\u6839\u636e\u4efb\u52a1id\u67e5\u8be2\u4efb\u52a1\u8be6\u60c5\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
@Override
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((Object)true);
}
catch (Exception e) {
this.logger.error("\u7f16\u8f91\u4efb\u52a1\u8fdb\u7a0b\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e);
throw new ServiceException((Throwable)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() + "-\u9ed8\u8ba4\u56fe\u5e93");
imageStoreAddParam.setType(Short.valueOf((short)1));
imageStoreAddParam.setSourceApplicationId(applicationId);
imageStoreAddParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult imageStoreId = this.imageStoreService.add(imageStoreAddParam, context);
if (!imageStoreId.isSuccess()) {
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u65b0\u589e\u56fe\u5e93\u5931\u8d25,\u539f\u56e0\uff1a" + imageStoreId.getMessage());
throw new ServiceException(imageStoreId.getCode(), imageStoreId.getMessage());
}
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u65b0\u589e\u56fe\u5e93\u51fa\u53c2\uff1aimageStoreId=[{}]", 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("\u56fe\u5e93\u5173\u8054\u5931\u8d25,\u56fe\u5e93id={},\u539f\u56e0:{}", imageStoreId.getData(), (Object)e.getMessage());
ImageStoreDelParam delParam = new ImageStoreDelParam();
delParam.setId((String)imageStoreId.getData());
delParam.setBusinessId(context.getCompany().getCompanyId());
this.logger.info("\u56de\u6eda\u5220\u9664\u56fe\u5e93\u5f00\u59cb,delParam={},context={}", JSONObject.toJSON((Object)delParam), JSONObject.toJSON((Object)context));
CloudwalkResult deleteResult = this.imageStoreService.delete(delParam, context);
this.logger.info("\u5220\u9664\u56fe\u5e93\uff1a\u56fe\u5e93id={},\u7ed3\u679c:{}", (Object)imageStoreId, (Object)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 = this.getAcsDeviceIds(context);
List acsDeviceIds = acsDeviceNewResults.stream().map(AcsDeviceNewResult::getDeviceId).collect(Collectors.toList());
List deviceIds = pageResult.stream().map(DeviceResult::getId).collect(Collectors.toList());
List newList = CollectionUtils.removeList(deviceIds, acsDeviceIds);
ArrayList<DeviceResult> newDeviceResultList = new ArrayList<DeviceResult>();
Map<String, DeviceResult> deviceResultMap = 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 acsDeviceList;
List<AcsDeviceNewResult> acsDeviceNewResultList = new ArrayList<AcsDeviceNewResult>();
AcsElevatorDeviceQueryDTO dto = new AcsElevatorDeviceQueryDTO();
dto.setBusinessId(context.getCompany().getCompanyId());
try {
acsDeviceList = this.acsElevatorDeviceDao.get(dto);
}
catch (ServiceException e) {
throw new ServiceException("76260007", this.getMessage("76260007"));
}
Map<String, String> areaMap = this.getAllAreaMap(context);
if (CollectionUtils.isNotEmpty((Collection)acsDeviceList)) {
List deviceIds = acsDeviceList.stream().map(AcsElevatorDeviceResultDTO::getDeviceId).collect(Collectors.toList());
DeviceQueryParam queryParam = new DeviceQueryParam();
queryParam.setIds(deviceIds);
queryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult deviceResult = this.deviceService.list(queryParam, context);
if (deviceResult.isSuccess()) {
if (CollectionUtils.isNotEmpty((Collection)((Collection)deviceResult.getData()))) {
acsDeviceNewResultList = this.convertDeviceNewResult((Collection)deviceResult.getData(), areaMap);
}
} else {
this.logger.error("\u67e5\u8be2\u8bbe\u5907\u4fe1\u606f\u5217\u8868\u5931\u8d25,\u539f\u56e0={}", (Object)deviceResult.getMessage());
throw new ServiceException("\u67e5\u8be2\u8bbe\u5907\u4fe1\u606f\u5217\u8868\u5931\u8d25");
}
}
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);
HashMap<String, String> areaMap = new HashMap<String, String>();
this.getAreaMap((List)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) continue;
this.getAreaMap(areaTree.getChildren(), areaMap);
}
}
protected List<AcsDeviceNewResult> convertDeviceNewResult(Collection<DeviceResult> datas, Map<String, String> areaMap) {
ArrayList<AcsDeviceNewResult> result = new ArrayList<AcsDeviceNewResult>();
for (DeviceResult data : datas) {
AcsDeviceNewResult acsDeviceResult = new AcsDeviceNewResult();
BeanCopyUtils.copyProperties((Object)data, (Object)acsDeviceResult);
acsDeviceResult.setId(data.getId());
acsDeviceResult.setDeviceId(data.getId());
acsDeviceResult.setDeviceStatus(Integer.valueOf(data.getStatus()));
acsDeviceResult.setDeviceOnlineStatus(Integer.valueOf(data.getOnlineStatus()));
acsDeviceResult.setAddress(this.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((String)data.getDistrictMergeName())) {
sb.append(data.getDistrictMergeName());
}
if (StringUtils.isNotBlank((String)data.getAreaName())) {
sb.append(" ");
sb.append(data.getAreaName());
}
return sb.toString().trim();
}
private List<DeviceResult> page(List<AcsDeviceNewResult> dataList, int pageSize, int currentPage) {
ArrayList<DeviceResult> currentPageList = new ArrayList<DeviceResult>();
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((Object)data, DeviceResult.class);
currentPageList.add(deviceResult);
}
}
return currentPageList;
}
}
@@ -0,0 +1,43 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.page.CloudwalkBasePageForm
*/
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class AcsDeviceQueryParam
extends CloudwalkBasePageForm
implements Serializable {
private String deviceName;
private String deviceCategoryId;
private String areaId;
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCategoryId() {
return this.deviceCategoryId;
}
public void setDeviceCategoryId(String deviceCategoryId) {
this.deviceCategoryId = deviceCategoryId;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
}
@@ -0,0 +1,53 @@
/*
* Decompiled with CFR 0.152.
*/
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 getTaskId() {
return this.taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
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;
}
String this$taskId = this.getTaskId();
String other$taskId = other.getTaskId();
return !(this$taskId == null ? other$taskId != null : !this$taskId.equals(other$taskId));
}
protected boolean canEqual(Object other) {
return other instanceof AcsDeviceRestructureTaskParam;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $taskId = this.getTaskId();
result = result * 59 + ($taskId == null ? 43 : $taskId.hashCode());
return result;
}
public String toString() {
return "AcsDeviceRestructureTaskParam(taskId=" + this.getTaskId() + ")";
}
}
@@ -0,0 +1,163 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.entity.CloudwalkBaseTimes
* javax.validation.constraints.NotNull
* org.hibernate.validator.constraints.NotEmpty
*/
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
public class AcsElevatorDeviceAddParam
extends CloudwalkBaseTimes
implements Serializable {
private String businessId;
@NotEmpty
private String deviceId;
@NotEmpty
private String deviceCode;
@NotNull
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
@NotNull
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
private Integer deleteFlag;
private String areaId;
private String elevatorFloorIdList;
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getDeleteFlag() {
return this.deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String toString() {
return "AcsElevatorDeviceAddDTO{businessId='" + this.businessId + '\'' + ", deviceId='" + this.deviceId + '\'' + ", deviceCode='" + this.deviceCode + '\'' + ", deviceName='" + this.deviceName + '\'' + ", deviceTypeName='" + this.deviceTypeName + '\'' + ", elevatorFloorList='" + this.elevatorFloorList + '\'' + ", currentFloorId='" + this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\'' + ", currentBuilding='" + this.currentBuilding + '\'' + ", areaName='" + this.areaName + '\'' + ", status=" + this.status + ", deleteFlag=" + this.deleteFlag + '}';
}
}
@@ -0,0 +1,131 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.entity.CloudwalkBaseTimes
* javax.validation.constraints.NotNull
*/
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
public class AcsElevatorDeviceEditParam
extends CloudwalkBaseTimes
implements Serializable {
private String elevatorFloorList;
@NotNull
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaId;
private String elevatorFloorIdList;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getElevatorFloorIdList() {
return this.elevatorFloorIdList;
}
public void setElevatorFloorIdList(String elevatorFloorIdList) {
this.elevatorFloorIdList = elevatorFloorIdList;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public String toString() {
return "AcsElevatorDeviceAddDTO{, elevatorFloorList='" + this.elevatorFloorList + '\'' + ", currentFloorId='" + this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\'' + ", currentBuilding='" + this.currentBuilding + '\'' + '}';
}
}
@@ -0,0 +1,37 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.entity.CloudwalkBaseTimes
* javax.validation.constraints.NotNull
*/
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
public class AcsElevatorDeviceListParam
extends CloudwalkBaseTimes
implements Serializable {
private String businessId;
@NotNull
private String currentFloorId;
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
}
@@ -0,0 +1,25 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.page.CloudwalkBasePageForm
*/
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class AcsElevatorDeviceQueryByIdParam
extends CloudwalkBasePageForm
implements Serializable {
private String id;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
}
@@ -0,0 +1,101 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.page.CloudwalkBasePageForm
* javax.validation.constraints.NotNull
*/
package cn.cloudwalk.elevator.device.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.NotNull;
public class AcsElevatorDeviceQueryParam
extends CloudwalkBasePageForm
implements Serializable {
@NotNull
private String deviceName;
private String deviceTypeName;
private String areaName;
private String deviceId;
private String deviceCode;
private List<String> areaIds;
private Integer status;
private Integer onlineStatus;
private String ip;
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getOnlineStatus() {
return this.onlineStatus;
}
public void setOnlineStatus(Integer onlineStatus) {
this.onlineStatus = onlineStatus;
}
public String getIp() {
return this.ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<String> getAreaIds() {
return this.areaIds;
}
public void setAreaIds(List<String> areaIds) {
this.areaIds = areaIds;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
}
@@ -0,0 +1,165 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.param;
import java.io.Serializable;
import java.util.List;
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 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;
}
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;
}
String this$parentId = this.getParentId();
String other$parentId = other.getParentId();
if (this$parentId == null ? other$parentId != null : !this$parentId.equals(other$parentId)) {
return false;
}
String this$orgId = this.getOrgId();
String other$orgId = other.getOrgId();
if (this$orgId == null ? other$orgId != null : !this$orgId.equals(other$orgId)) {
return false;
}
String this$orgName = this.getOrgName();
String other$orgName = other.getOrgName();
if (this$orgName == null ? other$orgName != null : !this$orgName.equals(other$orgName)) {
return false;
}
String this$labelId = this.getLabelId();
String other$labelId = other.getLabelId();
if (this$labelId == null ? other$labelId != null : !this$labelId.equals(other$labelId)) {
return false;
}
String this$labelName = this.getLabelName();
String other$labelName = other.getLabelName();
if (this$labelName == null ? other$labelName != null : !this$labelName.equals(other$labelName)) {
return false;
}
String this$personId = this.getPersonId();
String other$personId = other.getPersonId();
if (this$personId == null ? other$personId != null : !this$personId.equals(other$personId)) {
return false;
}
List<String> this$zoneIds = this.getZoneIds();
List<String> other$zoneIds = other.getZoneIds();
if (this$zoneIds == null ? other$zoneIds != null : !((Object)this$zoneIds).equals(other$zoneIds)) {
return false;
}
String this$taskId = this.getTaskId();
String other$taskId = other.getTaskId();
return !(this$taskId == null ? other$taskId != null : !this$taskId.equals(other$taskId));
}
protected boolean canEqual(Object other) {
return other instanceof AcsRestructureBindingParam;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $parentId = this.getParentId();
result = result * 59 + ($parentId == null ? 43 : $parentId.hashCode());
String $orgId = this.getOrgId();
result = result * 59 + ($orgId == null ? 43 : $orgId.hashCode());
String $orgName = this.getOrgName();
result = result * 59 + ($orgName == null ? 43 : $orgName.hashCode());
String $labelId = this.getLabelId();
result = result * 59 + ($labelId == null ? 43 : $labelId.hashCode());
String $labelName = this.getLabelName();
result = result * 59 + ($labelName == null ? 43 : $labelName.hashCode());
String $personId = this.getPersonId();
result = result * 59 + ($personId == null ? 43 : $personId.hashCode());
List<String> $zoneIds = this.getZoneIds();
result = result * 59 + ($zoneIds == null ? 43 : ((Object)$zoneIds).hashCode());
String $taskId = this.getTaskId();
result = result * 59 + ($taskId == null ? 43 : $taskId.hashCode());
return result;
}
public String toString() {
return "AcsRestructureBindingParam(parentId=" + this.getParentId() + ", orgId=" + this.getOrgId() + ", orgName=" + this.getOrgName() + ", labelId=" + this.getLabelId() + ", labelName=" + this.getLabelName() + ", personId=" + this.getPersonId() + ", zoneIds=" + this.getZoneIds() + ", taskId=" + this.getTaskId() + ")";
}
}
@@ -0,0 +1,133 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.param;
import java.io.Serializable;
import java.util.List;
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 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;
}
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;
}
String this$orgId = this.getOrgId();
String other$orgId = other.getOrgId();
if (this$orgId == null ? other$orgId != null : !this$orgId.equals(other$orgId)) {
return false;
}
String this$labelId = this.getLabelId();
String other$labelId = other.getLabelId();
if (this$labelId == null ? other$labelId != null : !this$labelId.equals(other$labelId)) {
return false;
}
List<String> this$labelIds = this.getLabelIds();
List<String> other$labelIds = other.getLabelIds();
if (this$labelIds == null ? other$labelIds != null : !((Object)this$labelIds).equals(other$labelIds)) {
return false;
}
String this$personId = this.getPersonId();
String other$personId = other.getPersonId();
if (this$personId == null ? other$personId != null : !this$personId.equals(other$personId)) {
return false;
}
String this$zoneId = this.getZoneId();
String other$zoneId = other.getZoneId();
if (this$zoneId == null ? other$zoneId != null : !this$zoneId.equals(other$zoneId)) {
return false;
}
String this$businessId = this.getBusinessId();
String other$businessId = other.getBusinessId();
return !(this$businessId == null ? other$businessId != null : !this$businessId.equals(other$businessId));
}
protected boolean canEqual(Object other) {
return other instanceof AcsRestructureQueryParam;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $orgId = this.getOrgId();
result = result * 59 + ($orgId == null ? 43 : $orgId.hashCode());
String $labelId = this.getLabelId();
result = result * 59 + ($labelId == null ? 43 : $labelId.hashCode());
List<String> $labelIds = this.getLabelIds();
result = result * 59 + ($labelIds == null ? 43 : ((Object)$labelIds).hashCode());
String $personId = this.getPersonId();
result = result * 59 + ($personId == null ? 43 : $personId.hashCode());
String $zoneId = this.getZoneId();
result = result * 59 + ($zoneId == null ? 43 : $zoneId.hashCode());
String $businessId = this.getBusinessId();
result = result * 59 + ($businessId == null ? 43 : $businessId.hashCode());
return result;
}
public String toString() {
return "AcsRestructureQueryParam(orgId=" + this.getOrgId() + ", labelId=" + this.getLabelId() + ", labelIds=" + this.getLabelIds() + ", personId=" + this.getPersonId() + ", zoneId=" + this.getZoneId() + ", businessId=" + this.getBusinessId() + ")";
}
}
@@ -0,0 +1,183 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.result;
import java.io.Serializable;
public class AcsDeviceNewResult
implements Serializable {
private static final long serialVersionUID = -3535840233209237358L;
private String id;
private String deviceId;
private String deviceName;
private String deviceCode;
private String deviceTypeId;
private String deviceTypeCode;
private String deviceTypeName;
private Integer deviceStatus;
private Integer deviceOnlineStatus;
private String address;
private String imageStoreId;
private int identifyType;
private String areaId;
private String areaName;
private Long lastHeartbeatTime;
private Integer deviceOpenStatus;
private String deviceTypeCategoryId;
private String status;
private String onlineStatus;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getAreaId() {
return this.areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceTypeId() {
return this.deviceTypeId;
}
public void setDeviceTypeId(String deviceTypeId) {
this.deviceTypeId = deviceTypeId;
}
public String getDeviceTypeCode() {
return this.deviceTypeCode;
}
public void setDeviceTypeCode(String deviceTypeCode) {
this.deviceTypeCode = deviceTypeCode;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public Integer getDeviceStatus() {
return this.deviceStatus;
}
public void setDeviceStatus(Integer deviceStatus) {
this.deviceStatus = deviceStatus;
}
public Integer getDeviceOnlineStatus() {
return this.deviceOnlineStatus;
}
public void setDeviceOnlineStatus(Integer deviceOnlineStatus) {
this.deviceOnlineStatus = deviceOnlineStatus;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public int getIdentifyType() {
return this.identifyType;
}
public void setIdentifyType(int identifyType) {
this.identifyType = identifyType;
}
public Long getLastHeartbeatTime() {
return this.lastHeartbeatTime;
}
public void setLastHeartbeatTime(Long lastHeartbeatTime) {
this.lastHeartbeatTime = lastHeartbeatTime;
}
public Integer getDeviceOpenStatus() {
return this.deviceOpenStatus;
}
public void setDeviceOpenStatus(Integer deviceOpenStatus) {
this.deviceOpenStatus = deviceOpenStatus;
}
public String getDeviceTypeCategoryId() {
return this.deviceTypeCategoryId;
}
public void setDeviceTypeCategoryId(String deviceTypeCategoryId) {
this.deviceTypeCategoryId = deviceTypeCategoryId;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getOnlineStatus() {
return this.onlineStatus;
}
public void setOnlineStatus(String onlineStatus) {
this.onlineStatus = onlineStatus;
}
}
@@ -0,0 +1,113 @@
/*
* Decompiled with CFR 0.152.
*/
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 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;
}
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;
}
String this$parentId = this.getParentId();
String other$parentId = other.getParentId();
if (this$parentId == null ? other$parentId != null : !this$parentId.equals(other$parentId)) {
return false;
}
String this$zoneId = this.getZoneId();
String other$zoneId = other.getZoneId();
if (this$zoneId == null ? other$zoneId != null : !this$zoneId.equals(other$zoneId)) {
return false;
}
String this$zoneName = this.getZoneName();
String other$zoneName = other.getZoneName();
if (this$zoneName == null ? other$zoneName != null : !this$zoneName.equals(other$zoneName)) {
return false;
}
String this$onlineDevices = this.getOnlineDevices();
String other$onlineDevices = other.getOnlineDevices();
if (this$onlineDevices == null ? other$onlineDevices != null : !this$onlineDevices.equals(other$onlineDevices)) {
return false;
}
String this$offlineDevices = this.getOfflineDevices();
String 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;
String $parentId = this.getParentId();
result = result * 59 + ($parentId == null ? 43 : $parentId.hashCode());
String $zoneId = this.getZoneId();
result = result * 59 + ($zoneId == null ? 43 : $zoneId.hashCode());
String $zoneName = this.getZoneName();
result = result * 59 + ($zoneName == null ? 43 : $zoneName.hashCode());
String $onlineDevices = this.getOnlineDevices();
result = result * 59 + ($onlineDevices == null ? 43 : $onlineDevices.hashCode());
String $offlineDevices = this.getOfflineDevices();
result = result * 59 + ($offlineDevices == null ? 43 : $offlineDevices.hashCode());
return result;
}
public String toString() {
return "AcsDeviceRestructureResult(parentId=" + this.getParentId() + ", zoneId=" + this.getZoneId() + ", zoneName=" + this.getZoneName() + ", onlineDevices=" + this.getOnlineDevices() + ", offlineDevices=" + this.getOfflineDevices() + ")";
}
}
@@ -0,0 +1,233 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.entity.CloudwalkBaseTimes
*/
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;
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 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;
}
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 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;
}
String this$businessId = this.getBusinessId();
String other$businessId = other.getBusinessId();
if (this$businessId == null ? other$businessId != null : !this$businessId.equals(other$businessId)) {
return false;
}
String this$deviceId = this.getDeviceId();
String other$deviceId = other.getDeviceId();
if (this$deviceId == null ? other$deviceId != null : !this$deviceId.equals(other$deviceId)) {
return false;
}
String this$deviceCode = this.getDeviceCode();
String other$deviceCode = other.getDeviceCode();
if (this$deviceCode == null ? other$deviceCode != null : !this$deviceCode.equals(other$deviceCode)) {
return false;
}
String this$deviceName = this.getDeviceName();
String other$deviceName = other.getDeviceName();
if (this$deviceName == null ? other$deviceName != null : !this$deviceName.equals(other$deviceName)) {
return false;
}
String this$deviceTypeName = this.getDeviceTypeName();
String other$deviceTypeName = other.getDeviceTypeName();
if (this$deviceTypeName == null ? other$deviceTypeName != null : !this$deviceTypeName.equals(other$deviceTypeName)) {
return false;
}
String this$elevatorFloorList = this.getElevatorFloorList();
String other$elevatorFloorList = other.getElevatorFloorList();
if (this$elevatorFloorList == null ? other$elevatorFloorList != null : !this$elevatorFloorList.equals(other$elevatorFloorList)) {
return false;
}
String this$currentFloorId = this.getCurrentFloorId();
String other$currentFloorId = other.getCurrentFloorId();
if (this$currentFloorId == null ? other$currentFloorId != null : !this$currentFloorId.equals(other$currentFloorId)) {
return false;
}
String this$currentFloor = this.getCurrentFloor();
String other$currentFloor = other.getCurrentFloor();
if (this$currentFloor == null ? other$currentFloor != null : !this$currentFloor.equals(other$currentFloor)) {
return false;
}
String this$currentBuilding = this.getCurrentBuilding();
String other$currentBuilding = other.getCurrentBuilding();
if (this$currentBuilding == null ? other$currentBuilding != null : !this$currentBuilding.equals(other$currentBuilding)) {
return false;
}
String this$currentBuildingId = this.getCurrentBuildingId();
String other$currentBuildingId = other.getCurrentBuildingId();
if (this$currentBuildingId == null ? other$currentBuildingId != null : !this$currentBuildingId.equals(other$currentBuildingId)) {
return false;
}
String this$areaName = this.getAreaName();
String other$areaName = other.getAreaName();
if (this$areaName == null ? other$areaName != null : !this$areaName.equals(other$areaName)) {
return false;
}
Integer this$status = this.getStatus();
Integer other$status = other.getStatus();
return !(this$status == null ? other$status != null : !((Object)this$status).equals(other$status));
}
protected boolean canEqual(Object other) {
return other instanceof AcsElevatorDeviceListResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $businessId = this.getBusinessId();
result = result * 59 + ($businessId == null ? 43 : $businessId.hashCode());
String $deviceId = this.getDeviceId();
result = result * 59 + ($deviceId == null ? 43 : $deviceId.hashCode());
String $deviceCode = this.getDeviceCode();
result = result * 59 + ($deviceCode == null ? 43 : $deviceCode.hashCode());
String $deviceName = this.getDeviceName();
result = result * 59 + ($deviceName == null ? 43 : $deviceName.hashCode());
String $deviceTypeName = this.getDeviceTypeName();
result = result * 59 + ($deviceTypeName == null ? 43 : $deviceTypeName.hashCode());
String $elevatorFloorList = this.getElevatorFloorList();
result = result * 59 + ($elevatorFloorList == null ? 43 : $elevatorFloorList.hashCode());
String $currentFloorId = this.getCurrentFloorId();
result = result * 59 + ($currentFloorId == null ? 43 : $currentFloorId.hashCode());
String $currentFloor = this.getCurrentFloor();
result = result * 59 + ($currentFloor == null ? 43 : $currentFloor.hashCode());
String $currentBuilding = this.getCurrentBuilding();
result = result * 59 + ($currentBuilding == null ? 43 : $currentBuilding.hashCode());
String $currentBuildingId = this.getCurrentBuildingId();
result = result * 59 + ($currentBuildingId == null ? 43 : $currentBuildingId.hashCode());
String $areaName = this.getAreaName();
result = result * 59 + ($areaName == null ? 43 : $areaName.hashCode());
Integer $status = this.getStatus();
result = result * 59 + ($status == null ? 43 : ((Object)$status).hashCode());
return result;
}
public String toString() {
return "AcsElevatorDeviceListResult(businessId=" + this.getBusinessId() + ", deviceId=" + this.getDeviceId() + ", deviceCode=" + this.getDeviceCode() + ", deviceName=" + this.getDeviceName() + ", deviceTypeName=" + this.getDeviceTypeName() + ", elevatorFloorList=" + this.getElevatorFloorList() + ", currentFloorId=" + this.getCurrentFloorId() + ", currentFloor=" + this.getCurrentFloor() + ", currentBuilding=" + this.getCurrentBuilding() + ", currentBuildingId=" + this.getCurrentBuildingId() + ", areaName=" + this.getAreaName() + ", status=" + this.getStatus() + ")";
}
}
@@ -0,0 +1,120 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.result;
import java.io.Serializable;
public class AcsElevatorDeviceResult
implements Serializable {
private static final long serialVersionUID = -90554404684210529L;
private String businessId;
private String deviceId;
private String deviceCode;
private String deviceName;
private String deviceTypeName;
private String elevatorFloorList;
private String currentFloorId;
private String currentFloor;
private String currentBuilding;
private String currentBuildingId;
private String areaName;
private Integer status;
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public String getCurrentFloorId() {
return this.currentFloorId;
}
public void setCurrentFloorId(String currentFloorId) {
this.currentFloorId = currentFloorId;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public String getCurrentBuilding() {
return this.currentBuilding;
}
public void setCurrentBuilding(String currentBuilding) {
this.currentBuilding = currentBuilding;
}
public String getCurrentBuildingId() {
return this.currentBuildingId;
}
public void setCurrentBuildingId(String currentBuildingId) {
this.currentBuildingId = currentBuildingId;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getDeviceName() {
return this.deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public String getAreaName() {
return this.areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
}
@@ -0,0 +1,71 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleLabelResultDto
*/
package cn.cloudwalk.elevator.device.result;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleLabelResultDto;
import java.util.List;
public class AcsLabelElevatorResult {
private String labelId;
private List<AcsPassRuleLabelResultDto> details;
public String getLabelId() {
return this.labelId;
}
public List<AcsPassRuleLabelResultDto> getDetails() {
return this.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;
}
String this$labelId = this.getLabelId();
String other$labelId = other.getLabelId();
if (this$labelId == null ? other$labelId != null : !this$labelId.equals(other$labelId)) {
return false;
}
List<AcsPassRuleLabelResultDto> this$details = this.getDetails();
List<AcsPassRuleLabelResultDto> other$details = other.getDetails();
return !(this$details == null ? other$details != null : !((Object)this$details).equals(other$details));
}
protected boolean canEqual(Object other) {
return other instanceof AcsLabelElevatorResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $labelId = this.getLabelId();
result = result * 59 + ($labelId == null ? 43 : $labelId.hashCode());
List<AcsPassRuleLabelResultDto> $details = this.getDetails();
result = result * 59 + ($details == null ? 43 : ((Object)$details).hashCode());
return result;
}
public String toString() {
return "AcsLabelElevatorResult(labelId=" + this.getLabelId() + ", details=" + this.getDetails() + ")";
}
}
@@ -0,0 +1,81 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.result;
public class KeyValueResult {
private String key;
private Long time;
private String keyA;
public String getKey() {
return this.key;
}
public Long getTime() {
return this.time;
}
public String getKeyA() {
return this.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;
}
String this$key = this.getKey();
String other$key = other.getKey();
if (this$key == null ? other$key != null : !this$key.equals(other$key)) {
return false;
}
Long this$time = this.getTime();
Long other$time = other.getTime();
if (this$time == null ? other$time != null : !((Object)this$time).equals(other$time)) {
return false;
}
String this$keyA = this.getKeyA();
String 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;
String $key = this.getKey();
result = result * 59 + ($key == null ? 43 : $key.hashCode());
Long $time = this.getTime();
result = result * 59 + ($time == null ? 43 : ((Object)$time).hashCode());
String $keyA = this.getKeyA();
result = result * 59 + ($keyA == null ? 43 : $keyA.hashCode());
return result;
}
public String toString() {
return "KeyValueResult(key=" + this.getKey() + ", time=" + this.getTime() + ", keyA=" + this.getKeyA() + ")";
}
}
@@ -0,0 +1,20 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
*/
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 {
public void updateFloors(AcsRestructureBindingParam var1, List<AcsPassRuleImageResultDto> var2, List<String> var3, CloudwalkCallContext var4) throws ServiceException;
}
@@ -0,0 +1,73 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryFoDTO
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO
*/
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 {
public Integer add(AcsElevatorDeviceAddParam var1, CloudwalkCallContext var2) throws ServiceException;
public Integer edit(AcsElevatorDeviceEditParam var1, CloudwalkCallContext var2) throws ServiceException;
public Integer delete(List<String> var1, CloudwalkCallContext var2) throws ServiceException;
public String getBuildingId(AcsElevatorDeviceQueryParam var1) throws ServiceException;
public String getBusinessId(AcsElevatorDeviceQueryParam var1) throws ServiceException;
public CloudwalkResult<CloudwalkPageAble<AcsElevatorDeviceResultDTO>> get(AcsElevatorDeviceQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<CloudwalkPageAble<DeviceResult>> devicePage(AcsDeviceQueryParam var1, CloudwalkPageInfo var2, CloudwalkCallContext var3) throws ServiceException;
public List<AcsElevatorDeviceQueryFoDTO> getFo(AcsElevatorDeviceQueryParam var1) throws ServiceException;
public AcsElevatorDeviceResultDTO getById(AcsElevatorDeviceQueryByIdParam var1, CloudwalkCallContext var2) throws ServiceException;
public AcsElevatorDeviceResultDTO getByDeciveCode(String var1) throws ServiceException;
public CloudwalkResult listUnbindFloors(AcsRestructureQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult listFloors(AcsRestructureQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult listCondition(AcsRestructureQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult listConditionByLabelIds(AcsRestructureQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<String> bindingFloors(AcsRestructureBindingParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<String> bindingPerson(AcsRestructureBindingParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<AcsDeviceTaskDTO> getTask(AcsDeviceRestructureTaskParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> setTaskStop(AcsDeviceRestructureTaskParam var1, CloudwalkCallContext var2) throws ServiceException;
}
@@ -0,0 +1,166 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.application.param.ApplicationImageStoreAddParam
* cn.cloudwalk.client.cwoscomponent.intelligent.application.param.ApplicationImageStoreDelParam
* cn.cloudwalk.client.cwoscomponent.intelligent.application.service.ApplicationImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceImageStoreParam
* cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreDelParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreListResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.elevator.util.CollectionUtils
* org.springframework.stereotype.Service
*/
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;
@Override
public CloudwalkResult<Boolean> bindAppImageStoreDevice(DeviceImageStoreAppBindParam param, CloudwalkCallContext context) throws ServiceException {
this.bindApplicationImageStore(param, context);
return CloudwalkResult.success((Object)true);
}
@Override
public CloudwalkResult<Boolean> bindDeviceAndImageStore(DeviceImageStoreAppBindParam param, CloudwalkCallContext context) throws ServiceException {
try {
this.bindDeviceImageStore(param, context);
}
catch (ServiceException e) {
this.logger.error("\u8bbe\u5907\u56fe\u5e93\u5173\u8054\u5931\u8d25,\u56fe\u5e93id={},\u539f\u56e0:{}", (Object)param.getImageStoreId(), (Object)e.getMessage());
throw new ServiceException("\u8bbe\u5907\u56fe\u5e93\u5173\u8054\u5931\u8d25");
}
return CloudwalkResult.success((Object)true);
}
private void bindApplicationImageStore(DeviceImageStoreAppBindParam param, CloudwalkCallContext context) throws ServiceException {
ApplicationImageStoreAddParam applicationImageStoreAddParam = new ApplicationImageStoreAddParam();
applicationImageStoreAddParam.setApplicationId(param.getApplicationId());
applicationImageStoreAddParam.setImageStoreId(param.getImageStoreId());
CloudwalkResult applicationImageStoreAddResult = this.applicationImageStoreService.add(applicationImageStoreAddParam, context);
if (!applicationImageStoreAddResult.isSuccess()) {
this.logger.error("\u6dfb\u52a0\u5e94\u7528\u56fe\u5e93\u5173\u8054\u5931\u8d25\uff0c\u539f\u56e0\uff1a{}", (Object)applicationImageStoreAddResult.getMessage());
throw new ServiceException(applicationImageStoreAddResult.getCode(), "\u6dfb\u52a0\u5e94\u7528\u56fe\u5e93\u5173\u8054\u5931\u8d25\uff0c\u539f\u56e0\uff1a" + applicationImageStoreAddResult.getMessage());
}
}
private void bindDeviceImageStore(DeviceImageStoreAppBindParam param, CloudwalkCallContext context) throws ServiceException {
DeviceImageStoreParam imageStoreSaveParam = new DeviceImageStoreParam();
imageStoreSaveParam.setDeviceId(param.getDeviceId());
imageStoreSaveParam.setImageStoreId(param.getImageStoreId());
CloudwalkResult saveDeviceResult = this.deviceImageStoreService.add(imageStoreSaveParam, context);
if (!saveDeviceResult.isSuccess()) {
this.logger.error("\u7ed1\u5b9a\u8bbe\u5907\u4e0e\u56fe\u5e93\u5931\u8d25,\u8bbe\u5907id={},\u56fe\u5e93id={},\u539f\u56e0:{}", new Object[]{param.getDeviceId(), param.getImageStoreId(), saveDeviceResult.getMessage()});
throw new ServiceException("\u7ed1\u5b9a\u8bbe\u5907\u4e0e\u56fe\u5e93\u5931\u8d25");
}
}
@Override
public CloudwalkResult<Boolean> unbindAppImageStoreDevice(DeviceImageStoreAppUnbindParam param, CloudwalkCallContext context) throws ServiceException {
this.deviceUnBindImageStore(context, param.getDeviceId(), param.getImageStoreId(), param.getDeviceCode());
this.applicationUnBindImageStore(param.getApplicationId(), param.getImageStoreId(), context);
List<ImageStoreListResult> imageStoreList = this.getImageStoreResult(param.getImageStoreId(), param.getDeviceCode(), context);
if (!CollectionUtils.isEmpty(imageStoreList)) {
this.deleteImageStore(param.getImageStoreId(), context);
}
return CloudwalkResult.success((Object)true);
}
@Override
public CloudwalkResult<Boolean> deleteImageStore(DeviceImageStoreAppUnbindParam param, CloudwalkCallContext context) throws ServiceException {
this.applicationUnBindImageStore(param.getApplicationId(), param.getImageStoreId(), context);
this.deleteImageStore(param.getImageStoreId(), context);
return CloudwalkResult.success((Object)true);
}
@Override
public CloudwalkResult<Boolean> unbindAppImageStoreDeviceNotDeleteImage(DeviceImageStoreAppUnbindParam param, CloudwalkCallContext context) throws ServiceException {
this.deviceUnBindImageStore(context, param.getDeviceId(), param.getImageStoreId(), param.getDeviceCode());
return CloudwalkResult.success((Object)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 imageStoreList = this.imageStoreService.list(imageStoreQueryParam, context);
if (!imageStoreList.isSuccess()) {
this.logger.error("\u67e5\u8be2\u8bbe\u5907\u56fe\u5e93\u5931\u8d25,\u8bbe\u5907\u7f16\u53f7:{},\u56fe\u5e93id:{},\u539f\u56e0:{}", new Object[]{deviceCode, imageStoreId, imageStoreList.getMessage()});
throw new ServiceException("\u67e5\u8be2\u8bbe\u5907\u56fe\u5e93\u5931\u8d25,\u8bbe\u5907\u7f16\u53f7:{}" + deviceCode);
}
return (List)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 deleteDeviceImageStoreResult = this.deviceImageStoreService.delete(deviceImageStoreParam, context);
this.logger.info("\u5220\u9664\u8bbe\u5907\u56fe\u5e93\u5173\u8054\uff1a\u56fe\u5e93id={},\u7ed3\u679c:{}", (Object)imageStoreId, (Object)deleteDeviceImageStoreResult.getMessage());
if (!deleteDeviceImageStoreResult.isSuccess()) {
this.logger.error("\u5220\u9664\u8bbe\u5907\u56fe\u5e93\u5173\u8054\u5931\u8d25,\u8bbe\u5907\u7f16\u53f7:{},\u56fe\u5e93id:{},\u539f\u56e0:{}", new Object[]{deviceCode, imageStoreId, deleteDeviceImageStoreResult.getMessage()});
throw new ServiceException("\u5220\u9664\u8bbe\u5907\u56fe\u5e93\u5173\u8054\u5931\u8d25,\u8bbe\u5907\u7f16\u53f7:" + deviceCode);
}
}
private void deleteImageStore(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
ImageStoreDelParam imageStoreDelParam = new ImageStoreDelParam();
imageStoreDelParam.setId(imageStoreId);
imageStoreDelParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult deleteImageStoreResult = this.imageStoreService.delete(imageStoreDelParam, context);
if (!deleteImageStoreResult.isSuccess()) {
this.logger.error("\u5220\u9664\u56fe\u5e93\u5931\u8d25,\u56fe\u5e93id:{},\u539f\u56e0:{}", (Object)imageStoreId, (Object)deleteImageStoreResult.getMessage());
throw new ServiceException("\u5220\u9664\u56fe\u5e93\u5931\u8d25");
}
}
public void applicationUnBindImageStore(String applicationId, String imageStoreId, CloudwalkCallContext context) throws ServiceException {
ApplicationImageStoreDelParam applicationImageStoreDelParam = new ApplicationImageStoreDelParam();
applicationImageStoreDelParam.setApplicationId(applicationId);
applicationImageStoreDelParam.setImageStoreId(imageStoreId);
CloudwalkResult deleteApplicationImageStoreResult = this.applicationImageStoreService.delete(applicationImageStoreDelParam, context);
this.logger.info("\u5220\u9664\u5e94\u7528\u56fe\u5e93\u5173\u8054\uff1a\u56fe\u5e93id={},\u5e94\u7528id={},\u7ed3\u679c:{}", new Object[]{imageStoreId, applicationId, deleteApplicationImageStoreResult.getMessage()});
if (!deleteApplicationImageStoreResult.isSuccess()) {
this.logger.error("\u5e94\u7528\u4e0e\u56fe\u5e93\u89e3\u7ed1\u5931\u8d25,\u5e94\u7528id:{},\u56fe\u5e93id:{},\u539f\u56e0\uff1a{}", new Object[]{applicationId, imageStoreId, deleteApplicationImageStoreResult.getMessage()});
throw new ServiceException("\u5e94\u7528\u4e0e\u56fe\u5e93\u89e3\u7ed1\u5931\u8d25");
}
}
}
@@ -0,0 +1,86 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceSettingQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceSettingResult
* cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceSettingResult$DeviceSettings
* cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceSettingService
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.elevator.em.AcsDeviceSettingEnum
* com.google.common.collect.Lists
* org.apache.commons.collections4.CollectionUtils
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.stereotype.Service
*/
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;
@Override
public CloudwalkResult<AcsDeviceSettingResult> getTemperatureSetting(AcsDeviceTemperatureSettingParam param, CloudwalkCallContext context) throws ServiceException {
AcsDeviceSettingResult result = new AcsDeviceSettingResult();
result.setDeviceId(param.getDeviceId());
DeviceSettingQueryParam deviceSettingQueryParam = new DeviceSettingQueryParam();
deviceSettingQueryParam.setDeviceIds((List)Lists.newArrayList((Object[])new String[]{param.getDeviceId()}));
deviceSettingQueryParam.setHasDefault(Short.valueOf((short)0));
CloudwalkResult deviceSettingQueryResult = this.deviceSettingService.query(deviceSettingQueryParam);
if (deviceSettingQueryResult.isSuccess()) {
DeviceSettingResult deviceSettingResult;
List settingResult;
if (CollectionUtils.isNotEmpty((Collection)((Collection)deviceSettingQueryResult.getData())) && CollectionUtils.isNotEmpty((Collection)(settingResult = (deviceSettingResult = (DeviceSettingResult)((List)deviceSettingQueryResult.getData()).get(0)).getSettings()))) {
ArrayList<AcsSettingAttr> acsSettingAttrs = new ArrayList<AcsSettingAttr>();
this.recursionSettingAttr(acsSettingAttrs, settingResult);
List<AcsSettingAttr> attrs = 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((Object)result);
}
return CloudwalkResult.fail((String)deviceSettingQueryResult.getCode(), (String)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);
this.recursionSettingAttr(acsSettingAttrs, deviceSetting.getChild());
}
}
}
}
@@ -0,0 +1,25 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.device.setting.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsDeviceTemperatureSettingParam
implements Serializable {
@NotBlank(message="76260003")
private String deviceId;
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
@@ -0,0 +1,39 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.setting.param;
import java.io.Serializable;
public class DeviceImageStoreAppBindParam
implements Serializable {
private static final long serialVersionUID = -5165610910023828727L;
private String applicationId;
private String imageStoreId;
private String deviceId;
public String getApplicationId() {
return this.applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
@@ -0,0 +1,47 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.setting.param;
import java.io.Serializable;
public class DeviceImageStoreAppUnbindParam
implements Serializable {
private String applicationId;
private String imageStoreId;
private String deviceId;
private String deviceCode;
public String getApplicationId() {
return this.applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return this.deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
}
@@ -0,0 +1,32 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.setting.result;
import cn.cloudwalk.elevator.device.setting.result.AcsSettingAttr;
import java.io.Serializable;
import java.util.List;
public class AcsDeviceSettingResult
implements Serializable {
private static final long serialVersionUID = -6934487366934322212L;
private String deviceId;
private List<AcsSettingAttr> attrs;
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public List<AcsSettingAttr> getAttrs() {
return this.attrs;
}
public void setAttrs(List<AcsSettingAttr> attrs) {
this.attrs = attrs;
}
}
@@ -0,0 +1,66 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.device.setting.result;
import java.io.Serializable;
public class AcsSettingAttr
implements Serializable {
private static final long serialVersionUID = 1670487736253830287L;
private String name;
private String value;
private String remark;
private String code;
private String id;
private String parentId;
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
}
@@ -0,0 +1,28 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
*/
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 {
public CloudwalkResult<Boolean> bindAppImageStoreDevice(DeviceImageStoreAppBindParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> bindDeviceAndImageStore(DeviceImageStoreAppBindParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> unbindAppImageStoreDevice(DeviceImageStoreAppUnbindParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> deleteImageStore(DeviceImageStoreAppUnbindParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> unbindAppImageStoreDeviceNotDeleteImage(DeviceImageStoreAppUnbindParam var1, CloudwalkCallContext var2) throws ServiceException;
}
@@ -0,0 +1,20 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
*/
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 {
public CloudwalkResult<AcsDeviceSettingResult> getTemperatureSetting(AcsDeviceTemperatureSettingParam var1, CloudwalkCallContext var2) throws ServiceException;
}
@@ -0,0 +1,19 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
*/
package cn.cloudwalk.elevator.downloadcenter;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.elevator.downloadcenter.param.AcsFileFinishParam;
public interface AcsDownloadCenterService {
public String createDownload(String var1, CloudwalkCallContext var2);
public boolean finishDownload(AcsFileFinishParam var1, CloudwalkCallContext var2);
public int queryDownloadStatus(String var1, CloudwalkCallContext var2);
}
@@ -0,0 +1,115 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.file.param.FileFinishParam
* cn.cloudwalk.client.cwoscomponent.intelligent.file.param.FileGetParam
* cn.cloudwalk.client.cwoscomponent.intelligent.file.param.FileInitParam
* cn.cloudwalk.client.cwoscomponent.intelligent.file.result.FileDetail
* cn.cloudwalk.client.cwoscomponent.intelligent.file.service.FileService
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.config.FeignThreadLocalUtil
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.stereotype.Service
*/
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;
@Override
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((CloudwalkCallContext)context);
CloudwalkResult result = this.fileService.init(fileInitParam, context);
if ("00000000".equals(result.getCode())) {
String string = (String)result.getData();
return string;
}
try {
this.logger.error("\u4e0b\u8f7d\u4efb\u52a1\u521d\u59cb\u5316\u5931\u8d25\uff1acode={},message={}", (Object)result.getCode(), (Object)result.getMessage());
throw new RuntimeException("\u4e0b\u8f7d\u4efb\u52a1\u521b\u5efa\u5931\u8d25\uff01");
}
catch (ServiceException e) {
this.logger.error("\u4e0b\u8f7d\u4efb\u52a1\u521d\u59cb\u5316\u63a5\u53e3\u9519\u8bef", (Throwable)e);
throw new RuntimeException("\u4e0b\u8f7d\u4efb\u52a1\u521b\u5efa\u5931\u8d25\uff01");
}
}
finally {
FeignThreadLocalUtil.remove();
}
}
/*
* WARNING - Removed try catching itself - possible behaviour change.
*/
@Override
public boolean finishDownload(AcsFileFinishParam param, CloudwalkCallContext context) {
try {
FeignThreadLocalUtil.setRequestHeader((CloudwalkCallContext)context);
FileFinishParam fileFinishParam = (FileFinishParam)BeanCopyUtils.copyProperties((Object)param, FileFinishParam.class);
CloudwalkResult result = this.fileService.finish(fileFinishParam, context);
if ("00000000".equals(result.getCode())) {
boolean bl = true;
return bl;
}
this.logger.error("\u4e0b\u8f7d\u4efb\u52a1\u5b8c\u6210\u5931\u8d25\uff1acode={},message={}", (Object)result.getCode(), (Object)result.getMessage());
}
catch (ServiceException e) {
this.logger.error("\u4e0b\u8f7d\u4efb\u52a1\u5b8c\u6210\u63a5\u53e3\u9519\u8bef", (Throwable)e);
}
finally {
FeignThreadLocalUtil.remove();
}
return false;
}
@Override
public int queryDownloadStatus(String fileId, CloudwalkCallContext context) {
try {
FileGetParam fileGetParam = new FileGetParam();
fileGetParam.setFileId(fileId);
CloudwalkResult result = this.fileService.get(fileGetParam, context);
if ("00000000".equals(result.getCode())) {
return ((FileDetail)result.getData()).getStatus();
}
this.logger.error("\u4e0b\u8f7d\u4efb\u52a1\u521d\u59cb\u5316\u5931\u8d25\uff1acode={},message={}", (Object)result.getCode(), (Object)result.getMessage());
}
catch (ServiceException e) {
this.logger.error("\u4e0b\u8f7d\u4efb\u52a1\u5b8c\u6210\u63a5\u53e3\u9519\u8bef", (Throwable)e);
}
return AcsFileStatusEnum.PRODUCING.getCode();
}
}
@@ -0,0 +1,66 @@
/*
* Decompiled with CFR 0.152.
*/
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;
}
}
@@ -0,0 +1,519 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.davinci.portal.file.param.part.FilePartAppendParam
* cn.cloudwalk.client.davinci.portal.file.param.part.FilePartFinishParam
* cn.cloudwalk.client.davinci.portal.file.param.part.FilePartInitParam
* cn.cloudwalk.client.davinci.portal.file.result.FilePartResult
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.elevator.config.FeignThreadLocalUtil
* cn.cloudwalk.elevator.util.CollectionUtils
* cn.cloudwalk.elevator.util.DateUtils
* cn.cloudwalk.elevator.util.StringUtils
* cn.cloudwalk.intelligent.davinci.common.exception.DavinciServiceException
* cn.cloudwalk.intelligent.davinci.storage.bean.file.dto.FileRemoveDTO
* cn.cloudwalk.intelligent.davinci.storage.manager.FileStorageManager
* cn.cloudwalk.intelligent.lock.annotation.RequiredLock
* com.github.pagehelper.PageInfo
* com.google.common.collect.Lists
* org.apache.commons.lang3.StringUtils
* org.apache.poi.hssf.usermodel.HSSFCell
* org.apache.poi.hssf.usermodel.HSSFCellStyle
* org.apache.poi.hssf.usermodel.HSSFClientAnchor
* org.apache.poi.hssf.usermodel.HSSFFont
* org.apache.poi.hssf.usermodel.HSSFPatriarch
* org.apache.poi.hssf.usermodel.HSSFRichTextString
* org.apache.poi.hssf.usermodel.HSSFRow
* org.apache.poi.hssf.usermodel.HSSFSheet
* org.apache.poi.hssf.usermodel.HSSFWorkbook
* org.apache.poi.ss.usermodel.Font
* org.apache.poi.ss.usermodel.HorizontalAlignment
* org.apache.poi.ss.usermodel.RichTextString
* org.apache.poi.ss.usermodel.VerticalAlignment
* org.slf4j.Logger
* org.slf4j.LoggerFactory
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.beans.factory.annotation.Value
* org.springframework.data.redis.core.RedisTemplate
* org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
*/
package cn.cloudwalk.elevator.export;
import cn.cloudwalk.client.davinci.portal.file.param.part.FilePartAppendParam;
import cn.cloudwalk.client.davinci.portal.file.param.part.FilePartFinishParam;
import cn.cloudwalk.client.davinci.portal.file.param.part.FilePartInitParam;
import cn.cloudwalk.client.davinci.portal.file.result.FilePartResult;
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.common.AbstractCloudwalkService;
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 cn.cloudwalk.elevator.export.ExcelAttribute;
import cn.cloudwalk.elevator.export.ExcelCallback;
import cn.cloudwalk.elevator.export.utils.ExcelUtil;
import cn.cloudwalk.elevator.storage.AcsFileStorageService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.util.DateUtils;
import cn.cloudwalk.elevator.util.StringUtils;
import cn.cloudwalk.intelligent.davinci.common.exception.DavinciServiceException;
import cn.cloudwalk.intelligent.davinci.storage.bean.file.dto.FileRemoveDTO;
import cn.cloudwalk.intelligent.davinci.storage.manager.FileStorageManager;
import cn.cloudwalk.intelligent.lock.annotation.RequiredLock;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.VerticalAlignment;
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.data.redis.core.RedisTemplate;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
public abstract class AcsAbstractExportAsyncService<T, R>
extends AbstractCloudwalkService {
protected static final Logger LOGGER = LoggerFactory.getLogger(AcsAbstractExportAsyncService.class);
private static final Integer FILE_PART_BATCH_SIZE = 0x500001;
@Value(value="${cloudwalk.access-control.export-max-record:1000}")
private long EXPORT_MAX_RECORD;
@Autowired
private AcsFileStorageService acsFileStorageService;
@Autowired
private AcsDownloadCenterService acsDownloadCenterService;
@Resource
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private FileStorageManager fileStorageManager;
@RequiredLock(name="T(cn.cloudwalk.elevator.config.AcsLockConstants).LOCK_EXPORT_BUSINESSID_PREFIX.concat(#context.company.companyId)", lockWaitTime=5000L)
public CloudwalkResult<Boolean> startExportTask(T param, Class<R> clazz, String fileName, CloudwalkCallContext context) throws ServiceException {
String cacheKey = "acs_export_prefix:#" + context.getCompany().getCompanyId();
try {
String taskId = (String)this.redisTemplate.opsForValue().get((Object)cacheKey);
if (StringUtils.isNotBlank((String)taskId)) {
return CloudwalkResult.fail((String)"76260308", (String)this.getMessage("76260308"));
}
String exportFileName = StringUtils.isNotBlank((String)fileName) ? fileName : this.getDefaultFileName();
ExportRecordContext.Builder builder = new ExportRecordContext.Builder();
ExportRecordContext exportRecordContext = builder.withFileName(exportFileName).withTaskStatus(AcsFileStatusEnum.PRODUCING.getCode()).build();
((CompletableFuture)CompletableFuture.runAsync(() -> {
try {
String fileId = this.acsDownloadCenterService.createDownload(exportFileName, context);
this.redisTemplate.opsForValue().set((Object)cacheKey, (Object)fileId, 5L, TimeUnit.MINUTES);
exportRecordContext.setFileId(fileId);
}
catch (Exception e) {
LOGGER.info("\u5bfc\u51fa\u65f6\uff0c\u521d\u59cb\u5316\u5bfc\u51fa\u4efb\u52a1\u5931\u8d25\uff0c\u539f\u56e0\uff1a", (Throwable)e);
this.redisTemplate.delete((Object)cacheKey);
throw new CompletionException(e);
}
}).thenAccept(n -> {
try {
this.export(param, clazz, exportRecordContext, null, context);
}
catch (Exception e) {
LOGGER.info("\u5bfc\u51fa\u65f6\u5f02\u5e38\uff0c\u539f\u56e0=[{}]", (Object)e.getMessage(), (Object)e);
throw new CompletionException(e);
}
finally {
FeignThreadLocalUtil.remove();
this.redisTemplate.delete((Object)cacheKey);
}
})).whenComplete((n, e) -> {
if (null != e) {
LOGGER.error("\u5f02\u6b65\u5bfc\u51fa\u4efb\u52a1\u8fd0\u884c\u5931\u8d25\uff0c\u539f\u56e0\uff1a", e);
AcsFileFinishParam fileFinishParam = new AcsFileFinishParam();
if (e.getCause() instanceof ServiceException) {
ServiceException serviceException = (ServiceException)e.getCause();
fileFinishParam.setErrorCode(serviceException.getCode());
fileFinishParam.setErrorMessage(serviceException.getMessage());
} else {
fileFinishParam.setErrorCode("76260000");
fileFinishParam.setErrorMessage(this.getMessage("76260000"));
}
fileFinishParam.setFileId(exportRecordContext.getFileId());
fileFinishParam.setFileStatus(AcsFileStatusEnum.FAIL.getCode());
this.acsDownloadCenterService.finishDownload(fileFinishParam, context);
} else if (AcsFileStatusEnum.CANCELED.getCode().intValue() != exportRecordContext.getTaskStatus()) {
LOGGER.info("\u5f02\u6b65\u5bfc\u51fa\u6210\u529f\u3002[{}]", (Object)exportRecordContext.toString());
AcsFileFinishParam fileFinishParam = new AcsFileFinishParam();
fileFinishParam.setFileId(exportRecordContext.getFileId());
fileFinishParam.setFilePath(exportRecordContext.getFilePath());
fileFinishParam.setFileSize(exportRecordContext.getFileSize());
fileFinishParam.setFileStatus(AcsFileStatusEnum.FINISH.getCode());
this.acsDownloadCenterService.finishDownload(fileFinishParam, context);
} else if (StringUtils.isNotBlank((String)exportRecordContext.getFilePath())) {
FileRemoveDTO fileRemoveDTO = new FileRemoveDTO();
fileRemoveDTO.setFileList((List)Lists.newArrayList((Object[])new String[]{exportRecordContext.getFilePath()}));
try {
this.fileStorageManager.remove(fileRemoveDTO);
}
catch (DavinciServiceException e1) {
this.logger.error("\u5220\u9664\u6587\u4ef6\u5931\u8d25\uff0cfileId=[{}]\uff0c\u539f\u56e0\uff1a", (Object)exportRecordContext.getFileId(), (Object)e1);
}
}
});
return CloudwalkResult.success((Object)true);
}
catch (Exception e2) {
this.logger.error("\u5f02\u6b65\u5bfc\u51fa\u4efb\u52a1\u5f02\u5e38\uff0c\u539f\u56e0\uff1a", (Throwable)e2);
throw new ServiceException((Throwable)e2);
}
}
private void export(T param, Class<R> clazz, ExportRecordContext exportRecordContext, ExcelCallback callback, CloudwalkCallContext context) throws Exception {
ByteArrayOutputStream output = new ByteArrayOutputStream();
String sheetName = exportRecordContext.getFileName();
FeignThreadLocalUtil.setRequestHeader((CloudwalkCallContext)context);
int startPage = 1;
int pageSize = 100;
long maxPageSize = this.EXPORT_MAX_RECORD / 100L;
PageInfo pageInfo = new PageInfo();
ArrayList<Object> list = this.getList(param, context, startPage, 100, pageInfo);
Long totalRows = pageInfo.getTotal();
Long totalPages = pageInfo.getPages();
try (HSSFWorkbook workbook = new HSSFWorkbook();){
int sheetSize = 65536;
Field[] allFields = clazz.getDeclaredFields();
ArrayList<Field> fields = new ArrayList<Field>();
for (Field field : allFields) {
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
if (attr == null || !attr.isExport()) continue;
fields.add(field);
}
long listSize = this.EXPORT_MAX_RECORD < totalRows ? this.EXPORT_MAX_RECORD : totalRows;
int startRow = 0;
int sheetNo = (int)listSize / sheetSize;
block15: for (int index = 0; index <= sheetNo; ++index) {
HSSFSheet sheet = workbook.createSheet();
workbook.setSheetName(index, sheetName + index);
ExcelUtil.createRowHeard(sheet, fields, workbook, startRow);
while (true) {
if (this.isCancelDownload(exportRecordContext, context)) {
output.close();
return;
}
if (CollectionUtils.isEmpty(list)) {
list = this.getList(param, context, startPage, 100, pageInfo);
}
this.createRowContent(sheet, fields, workbook, list, (startPage - 1) * 100, (startPage - 1) * 100 + list.size(), startRow + 1);
if (null != callback) {
callback.call(workbook, sheet);
}
if ((long)(++startPage) > totalPages || (long)startPage > maxPageSize) continue block15;
list = new ArrayList();
}
}
output.flush();
workbook.write((OutputStream)output);
output.close();
byte[] fileByte = output.toByteArray();
exportRecordContext.setFileSize(Long.valueOf(fileByte.length));
String filePath = this.fileStore(exportRecordContext.getFileName() + ".xls", fileByte, exportRecordContext, context);
exportRecordContext.setFilePath(filePath);
}
catch (Exception e) {
throw new Exception("\u5c06list\u6570\u636e\u6e90\u7684\u6570\u636e\u5bfc\u5165\u5230excel\u8868\u5355\u5f02\u5e38!", e);
}
}
private boolean isCancelDownload(ExportRecordContext exportRecordContext, CloudwalkCallContext context) {
int taskStatus = this.acsDownloadCenterService.queryDownloadStatus(exportRecordContext.getFileId(), context);
if (AcsFileStatusEnum.CANCELED.getCode() == taskStatus) {
this.logger.info("\u5bfc\u51fa\u4efb\u52a1\u5df2\u53d6\u6d88\uff0cfileID=[{}]", (Object)exportRecordContext.getFileId());
exportRecordContext.setTaskStatus(taskStatus);
return true;
}
return false;
}
private ArrayList<R> getList(T param, CloudwalkCallContext context, int startPage, int pageSize, PageInfo pageInfo) throws ServiceException {
CloudwalkPageInfo cloudwalkPageInfo = new CloudwalkPageInfo(startPage, pageSize);
CloudwalkPageAble<R> dataPage = this.queryPage(param, cloudwalkPageInfo, context);
pageInfo.setTotal(dataPage.getTotalRows());
pageInfo.setPages((int)dataPage.getTotalPages());
return Lists.newArrayList((Iterable)dataPage.getDatas());
}
private int getColumnSize(Class clazz) {
Field[] allFields = clazz.getDeclaredFields();
int size = 0;
for (Field field : allFields) {
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
if (attr == null || !attr.isExport()) continue;
++size;
}
return size;
}
private void setRow1(HSSFWorkbook workBook, HSSFSheet sheet, String row1Str) {
HSSFCellStyle cellStyle1 = workBook.createCellStyle();
HSSFFont font1 = workBook.createFont();
font1.setFontHeightInPoints((short)15);
font1.setBold(Boolean.TRUE.booleanValue());
cellStyle1.setAlignment(HorizontalAlignment.LEFT);
cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
HSSFRichTextString row1String = new HSSFRichTextString(row1Str);
row1String.applyFont(0, row1Str.length(), (Font)font1);
sheet.getRow(0).getCell(0).setCellValue((RichTextString)row1String);
sheet.getRow(0).getCell(0).setCellStyle(cellStyle1);
}
private String fileStore(String fileName, byte[] bytes, ExportRecordContext exportRecordContext, CloudwalkCallContext context) throws ServiceException {
int size = bytes.length;
LOGGER.info("\u6587\u4ef6\u5927\u5c0f\u4e3a: {}", (Object)size);
FilePartInitParam param = new FilePartInitParam();
param.setFileName(fileName);
LOGGER.info("\u6587\u4ef6\u5206\u7247\u521d\u59cb\u5316\u5f00\u59cb");
CloudwalkResult<FilePartResult> result = this.acsFileStorageService.filePartInit(param);
if (result.isSuccess()) {
CloudwalkResult<String> finishResult;
LOGGER.info("\u6587\u4ef6\u5206\u7247\u521d\u59cb\u5316\u7ed3\u675f\uff0cuploadId = {}, filePath = {}", (Object)((FilePartResult)result.getData()).getUploadId(), (Object)((FilePartResult)result.getData()).getFilePath());
FilePartResult filePartResult = (FilePartResult)result.getData();
int times = 0;
while (true) {
int start;
if (this.isCancelDownload(exportRecordContext, context)) {
return ((FilePartResult)result.getData()).getFilePath();
}
int end = (start = times++ * FILE_PART_BATCH_SIZE) + FILE_PART_BATCH_SIZE > size ? size : start + FILE_PART_BATCH_SIZE;
byte[] trunk = Arrays.copyOfRange(bytes, start, end);
LOGGER.info("\u7b2c{}\u4e2a\u5206\u7247\u5f00\u59cb\u8ffd\u52a0\uff0cuploadId = {}, filePath = {}, size ; {}", new Object[]{times, filePartResult.getUploadId(), filePartResult.getFilePath(), trunk.length});
FilePartAppendParam appendParam = new FilePartAppendParam();
appendParam.setFilePath(filePartResult.getFilePath());
appendParam.setPartNumber(Integer.valueOf(times));
appendParam.setUploadId(filePartResult.getUploadId());
appendParam.setContent((Object)trunk);
this.acsFileStorageService.filePartAppend(appendParam);
LOGGER.info("\u7b2c{}\u4e2a\u5206\u7247\u5b8c\u6210\u8ffd\u52a0\uff0cuploadId = {}, filePath = {}", new Object[]{times, filePartResult.getUploadId(), filePartResult.getFilePath()});
if (end < size) continue;
LOGGER.info("\u8ffd\u52a0\u5b8c\u6210\uff0c\u51c6\u5907\u7ed3\u675f\uff0cuploadId = {}, filePath = {}", (Object)filePartResult.getUploadId(), (Object)filePartResult.getFilePath());
FilePartFinishParam finishParam = new FilePartFinishParam();
finishParam.setFilePath(filePartResult.getFilePath());
finishParam.setUploadId(filePartResult.getUploadId());
finishParam.setFileSize(Long.valueOf(size));
finishParam.setReturnType(Integer.valueOf(1));
finishResult = this.acsFileStorageService.filePartFinish(finishParam);
LOGGER.info("\u7ed3\u675f\u5b8c\u6210\uff0cuploadId = {}, filePath = {}, finishFilePath = {}", new Object[]{filePartResult.getUploadId(), filePartResult.getFilePath(), finishResult.getData()});
if (finishResult.isSuccess()) break;
}
return ((String)finishResult.getData()).split("=")[1];
}
throw new ServiceException(result.getCode(), result.getMessage());
}
protected abstract CloudwalkPageAble<R> queryPage(T var1, CloudwalkPageInfo var2, CloudwalkCallContext var3) throws ServiceException;
protected abstract CloudwalkResult<String> createLocalFile(T var1, String var2, CloudwalkCallContext var3) throws ServiceException;
protected abstract String getDefaultFileName();
protected abstract String getDefaultFileTitleName();
protected ThreadPoolTaskExecutor getExportExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.setMaxPoolSize(30);
executor.setThreadNamePrefix("Export-Pool-Executor");
executor.setQueueCapacity(25);
executor.initialize();
executor.setRejectedExecutionHandler((RejectedExecutionHandler)new ThreadPoolExecutor.AbortPolicy());
return executor;
}
private <T> void createRowContent(HSSFSheet sheet, List<Field> fields, HSSFWorkbook workbook, List<T> list, int startNo, int endNo, int rowIndex) throws Exception {
String value = null;
int hwPicType = 0;
byte[] picByte = null;
int listIndex = 0;
for (int i = startNo; i < endNo; ++i) {
HSSFRow row = sheet.createRow(i + 1);
T vo = list.get(listIndex);
++listIndex;
for (int j = 0; j < fields.size(); ++j) {
Field field = fields.get(j);
field.setAccessible(true);
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
int col = j;
if (org.apache.commons.lang3.StringUtils.isNotBlank((CharSequence)attr.column())) {
col = ExcelUtil.getExcelCol(attr.column());
}
if (!attr.isExport()) continue;
HSSFCell cell = row.createCell(col);
Class<Comparable<Date>> classType = field.getType();
if (field.get(vo) == null) continue;
value = null;
if (classType.isAssignableFrom(Date.class)) {
value = DateUtils.formatDate((Date)((Date)field.get(vo)), (String)"yyyy-MM-dd HH:mm:ss");
}
if (classType.isAssignableFrom(Long.class) && attr.isDate()) {
value = DateUtils.formatDate((Date)new Date((Long)field.get(vo)), (String)"yyyy-MM-dd HH:mm:ss");
}
if (attr.isPic()) {
try {
if (field.getType().equals(String.class)) {
picByte = ExcelUtil.getBytesByUrl((String)field.get(vo));
}
picByte = (byte[])field.get(vo);
}
catch (Exception exception) {
// empty catch block
}
hwPicType = 5;
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 1020, 250, (short)col, row.getRowNum(), (short)col, row.getRowNum());
patriarch.createPicture(anchor, workbook.addPicture(picByte, hwPicType));
row.setHeight((short)1000);
continue;
}
cell.setCellValue(field.get(vo) == null ? "" : (value == null ? String.valueOf(field.get(vo)) : value));
}
}
}
public CloudwalkResult<Long> exportCount() throws ServiceException {
try {
return CloudwalkResult.success((Object)this.EXPORT_MAX_RECORD);
}
catch (Exception e) {
this.logger.error("\u83b7\u53d6\u6700\u5927\u5bfc\u51fa\u8bb0\u5f55\u5931\u8d25", (Throwable)e);
throw new ServiceException((Throwable)e);
}
}
private static class ExportRecordContext {
private String fileId;
private String filePath;
private String fileName;
private Long fileSize;
private int taskStatus;
private ExportRecordContext() {
}
public int getTaskStatus() {
return this.taskStatus;
}
public void setTaskStatus(int taskStatus) {
this.taskStatus = taskStatus;
}
public String getFileId() {
return this.fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFilePath() {
return this.filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileName() {
return this.fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public Long getFileSize() {
return this.fileSize;
}
public void setFileSize(Long fileSize) {
this.fileSize = fileSize;
}
public String toString() {
return "ExportRecordContext{fileId='" + this.fileId + '\'' + ", filePath='" + this.filePath + '\'' + ", fileName='" + this.fileName + '\'' + ", fileSize=" + this.fileSize + ", taskStatus=" + this.taskStatus + '}';
}
private static class Builder {
private String fileId;
private String filePath;
private String fileName;
private Long fileSize;
private int taskStatus;
private Builder() {
}
public Builder withTaskStatus(int taskStatus) {
this.taskStatus = taskStatus;
return this;
}
public Builder withFileId(String fileId) {
this.fileId = fileId;
return this;
}
public Builder withFilePath(String filePath) {
this.filePath = filePath;
return this;
}
public Builder withFileName(String fileName) {
this.fileName = fileName;
return this;
}
public Builder withFileSize(Long fileSize) {
this.fileSize = fileSize;
return this;
}
public ExportRecordContext build() {
ExportRecordContext context = new ExportRecordContext();
context.setFileId(this.fileId);
context.setFileSize(this.fileSize);
context.setFilePath(this.filePath);
context.setFileName(this.fileName);
context.setTaskStatus(this.taskStatus);
return context;
}
}
}
}
@@ -0,0 +1,38 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.export;
public enum AcsFileStatusEnum {
FINISH(0, "\u5df2\u5b8c\u6210"),
PRODUCING(1, "\u751f\u6210\u4e2d"),
DELETED(2, "\u5df2\u5220\u9664"),
CANCELED(3, "\u5df2\u53d6\u6d88"),
EXPIRED(4, "\u5df2\u8fc7\u671f"),
FAIL(5, "\u5931\u8d25");
private Integer code;
private String message;
private AcsFileStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public static AcsFileStatusEnum getEnumByCode(Integer code) {
for (AcsFileStatusEnum item : AcsFileStatusEnum.values()) {
if (!code.equals(item.getCode())) continue;
return item;
}
return null;
}
public Integer getCode() {
return this.code;
}
public String getMessage() {
return this.message;
}
}
@@ -0,0 +1,28 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.export;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(value=RetentionPolicy.RUNTIME)
@Target(value={ElementType.FIELD})
public @interface ExcelAttribute {
public String name();
public String column() default "";
public String[] combo() default {};
public boolean isExport() default true;
public boolean isMark() default false;
public boolean isDate() default false;
public boolean isPic() default false;
}
@@ -0,0 +1,18 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* org.apache.poi.hssf.usermodel.HSSFSheet
* org.apache.poi.hssf.usermodel.HSSFWorkbook
*/
package cn.cloudwalk.elevator.export;
import cn.cloudwalk.cloud.exception.ServiceException;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public interface ExcelCallback {
public void call(HSSFWorkbook var1, HSSFSheet var2) throws ServiceException;
}
@@ -0,0 +1,84 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO
* cn.cloudwalk.elevator.util.CollectionUtils
* cn.cloudwalk.elevator.util.DateUtils
* org.springframework.stereotype.Service
*/
package cn.cloudwalk.elevator.export.impl;
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.device.dto.AcsElevatorDeviceResultDTO;
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceQueryParam;
import cn.cloudwalk.elevator.device.service.AcsElevatorDeviceService;
import cn.cloudwalk.elevator.export.AcsAbstractExportAsyncService;
import cn.cloudwalk.elevator.export.result.ElevatorDeviceRecordExcelResult;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.util.DateUtils;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
@Service
public class ElevatorDeviceExportService
extends AcsAbstractExportAsyncService<AcsElevatorDeviceQueryParam, ElevatorDeviceRecordExcelResult> {
@Resource
private AcsElevatorDeviceService elevatorDeviceService;
@Override
protected CloudwalkPageAble<ElevatorDeviceRecordExcelResult> queryPage(AcsElevatorDeviceQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
CloudwalkPageAble data;
param.setCurrentPage(pageInfo.getCurrentPage());
param.setRowsOfPage(pageInfo.getPageSize());
CloudwalkResult<CloudwalkPageAble<AcsElevatorDeviceResultDTO>> result = this.elevatorDeviceService.get(param, context);
if (result.isSuccess() && CollectionUtils.isNotEmpty((Collection)(data = (CloudwalkPageAble)result.getData()).getDatas())) {
List targetList = BeanCopyUtils.copy((Collection)data.getDatas(), ElevatorDeviceRecordExcelResult.class);
for (ElevatorDeviceRecordExcelResult item : targetList) {
if (Objects.equals(item.getStatus(), 1)) {
item.setDeviceOnlineStatus("\u7981\u7528");
continue;
}
if (Objects.equals(item.getOnlineStatus(), 2)) {
item.setDeviceOnlineStatus("\u5728\u7ebf");
continue;
}
if (!Objects.equals(item.getOnlineStatus(), 3)) continue;
item.setDeviceOnlineStatus("\u79bb\u7ebf");
}
return new CloudwalkPageAble((Collection)targetList, pageInfo, ((CloudwalkPageAble)result.getData()).getTotalRows());
}
throw new ServiceException(result.getCode(), result.getMessage());
}
@Override
protected CloudwalkResult<String> createLocalFile(AcsElevatorDeviceQueryParam param, String fileName, CloudwalkCallContext context) throws ServiceException {
return null;
}
@Override
protected String getDefaultFileName() {
return "\u6d3e\u68af\u8bbe\u5907\u5bfc\u51fa" + DateUtils.formatDate((Date)new Date(), (String)"yyyyMMddHHmmss");
}
@Override
protected String getDefaultFileTitleName() {
return "\u6d3e\u68af\u8bbe\u5907";
}
}
@@ -0,0 +1,222 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.export.result;
import cn.cloudwalk.elevator.export.ExcelAttribute;
import java.io.Serializable;
public class ElevatorDeviceRecordExcelResult
implements Serializable {
@ExcelAttribute(name="\u8bbe\u5907\u540d\u79f0", column="A")
private String deviceName;
@ExcelAttribute(name="\u8bbe\u5907\u7f16\u53f7", column="B")
private String deviceCode;
@ExcelAttribute(name="\u8bbe\u5907\u578b\u53f7", column="C")
private String deviceTypeName;
@ExcelAttribute(name="\u5b89\u88c5\u533a\u57df", column="D")
private String areaName;
@ExcelAttribute(name="\u5f53\u524d\u697c\u5c42", column="E")
private String currentFloor;
@ExcelAttribute(name="\u6d3e\u68af\u697c\u5c42", column="F")
private String elevatorFloorList;
@ExcelAttribute(name="\u8bbe\u5907\u72b6\u6001", column="G")
private String deviceOnlineStatus;
@ExcelAttribute(name="\u8bbe\u5907IP", column="H")
private String ip;
@ExcelAttribute(name="\u6700\u540e\u5fc3\u8df3", column="I", isDate=true)
private Long lastHeartbeatTime;
private Integer status;
private Integer onlineStatus;
public String getDeviceName() {
return this.deviceName;
}
public String getDeviceCode() {
return this.deviceCode;
}
public String getDeviceTypeName() {
return this.deviceTypeName;
}
public String getAreaName() {
return this.areaName;
}
public String getCurrentFloor() {
return this.currentFloor;
}
public String getElevatorFloorList() {
return this.elevatorFloorList;
}
public String getDeviceOnlineStatus() {
return this.deviceOnlineStatus;
}
public String getIp() {
return this.ip;
}
public Long getLastHeartbeatTime() {
return this.lastHeartbeatTime;
}
public Integer getStatus() {
return this.status;
}
public Integer getOnlineStatus() {
return this.onlineStatus;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public void setDeviceTypeName(String deviceTypeName) {
this.deviceTypeName = deviceTypeName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public void setElevatorFloorList(String elevatorFloorList) {
this.elevatorFloorList = elevatorFloorList;
}
public void setDeviceOnlineStatus(String deviceOnlineStatus) {
this.deviceOnlineStatus = deviceOnlineStatus;
}
public void setIp(String ip) {
this.ip = ip;
}
public void setLastHeartbeatTime(Long lastHeartbeatTime) {
this.lastHeartbeatTime = lastHeartbeatTime;
}
public void setStatus(Integer status) {
this.status = status;
}
public void setOnlineStatus(Integer onlineStatus) {
this.onlineStatus = onlineStatus;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ElevatorDeviceRecordExcelResult)) {
return false;
}
ElevatorDeviceRecordExcelResult other = (ElevatorDeviceRecordExcelResult)o;
if (!other.canEqual(this)) {
return false;
}
String this$deviceName = this.getDeviceName();
String other$deviceName = other.getDeviceName();
if (this$deviceName == null ? other$deviceName != null : !this$deviceName.equals(other$deviceName)) {
return false;
}
String this$deviceCode = this.getDeviceCode();
String other$deviceCode = other.getDeviceCode();
if (this$deviceCode == null ? other$deviceCode != null : !this$deviceCode.equals(other$deviceCode)) {
return false;
}
String this$deviceTypeName = this.getDeviceTypeName();
String other$deviceTypeName = other.getDeviceTypeName();
if (this$deviceTypeName == null ? other$deviceTypeName != null : !this$deviceTypeName.equals(other$deviceTypeName)) {
return false;
}
String this$areaName = this.getAreaName();
String other$areaName = other.getAreaName();
if (this$areaName == null ? other$areaName != null : !this$areaName.equals(other$areaName)) {
return false;
}
String this$currentFloor = this.getCurrentFloor();
String other$currentFloor = other.getCurrentFloor();
if (this$currentFloor == null ? other$currentFloor != null : !this$currentFloor.equals(other$currentFloor)) {
return false;
}
String this$elevatorFloorList = this.getElevatorFloorList();
String other$elevatorFloorList = other.getElevatorFloorList();
if (this$elevatorFloorList == null ? other$elevatorFloorList != null : !this$elevatorFloorList.equals(other$elevatorFloorList)) {
return false;
}
String this$deviceOnlineStatus = this.getDeviceOnlineStatus();
String other$deviceOnlineStatus = other.getDeviceOnlineStatus();
if (this$deviceOnlineStatus == null ? other$deviceOnlineStatus != null : !this$deviceOnlineStatus.equals(other$deviceOnlineStatus)) {
return false;
}
String this$ip = this.getIp();
String other$ip = other.getIp();
if (this$ip == null ? other$ip != null : !this$ip.equals(other$ip)) {
return false;
}
Long this$lastHeartbeatTime = this.getLastHeartbeatTime();
Long other$lastHeartbeatTime = other.getLastHeartbeatTime();
if (this$lastHeartbeatTime == null ? other$lastHeartbeatTime != null : !((Object)this$lastHeartbeatTime).equals(other$lastHeartbeatTime)) {
return false;
}
Integer this$status = this.getStatus();
Integer other$status = other.getStatus();
if (this$status == null ? other$status != null : !((Object)this$status).equals(other$status)) {
return false;
}
Integer this$onlineStatus = this.getOnlineStatus();
Integer other$onlineStatus = other.getOnlineStatus();
return !(this$onlineStatus == null ? other$onlineStatus != null : !((Object)this$onlineStatus).equals(other$onlineStatus));
}
protected boolean canEqual(Object other) {
return other instanceof ElevatorDeviceRecordExcelResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $deviceName = this.getDeviceName();
result = result * 59 + ($deviceName == null ? 43 : $deviceName.hashCode());
String $deviceCode = this.getDeviceCode();
result = result * 59 + ($deviceCode == null ? 43 : $deviceCode.hashCode());
String $deviceTypeName = this.getDeviceTypeName();
result = result * 59 + ($deviceTypeName == null ? 43 : $deviceTypeName.hashCode());
String $areaName = this.getAreaName();
result = result * 59 + ($areaName == null ? 43 : $areaName.hashCode());
String $currentFloor = this.getCurrentFloor();
result = result * 59 + ($currentFloor == null ? 43 : $currentFloor.hashCode());
String $elevatorFloorList = this.getElevatorFloorList();
result = result * 59 + ($elevatorFloorList == null ? 43 : $elevatorFloorList.hashCode());
String $deviceOnlineStatus = this.getDeviceOnlineStatus();
result = result * 59 + ($deviceOnlineStatus == null ? 43 : $deviceOnlineStatus.hashCode());
String $ip = this.getIp();
result = result * 59 + ($ip == null ? 43 : $ip.hashCode());
Long $lastHeartbeatTime = this.getLastHeartbeatTime();
result = result * 59 + ($lastHeartbeatTime == null ? 43 : ((Object)$lastHeartbeatTime).hashCode());
Integer $status = this.getStatus();
result = result * 59 + ($status == null ? 43 : ((Object)$status).hashCode());
Integer $onlineStatus = this.getOnlineStatus();
result = result * 59 + ($onlineStatus == null ? 43 : ((Object)$onlineStatus).hashCode());
return result;
}
public String toString() {
return "ElevatorDeviceRecordExcelResult(deviceName=" + this.getDeviceName() + ", deviceCode=" + this.getDeviceCode() + ", deviceTypeName=" + this.getDeviceTypeName() + ", areaName=" + this.getAreaName() + ", currentFloor=" + this.getCurrentFloor() + ", elevatorFloorList=" + this.getElevatorFloorList() + ", deviceOnlineStatus=" + this.getDeviceOnlineStatus() + ", ip=" + this.getIp() + ", lastHeartbeatTime=" + this.getLastHeartbeatTime() + ", status=" + this.getStatus() + ", onlineStatus=" + this.getOnlineStatus() + ")";
}
}
@@ -0,0 +1,515 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.elevator.util.DateUtils
* org.apache.commons.lang3.StringUtils
* org.apache.poi.hssf.usermodel.DVConstraint
* org.apache.poi.hssf.usermodel.HSSFCell
* org.apache.poi.hssf.usermodel.HSSFCellStyle
* org.apache.poi.hssf.usermodel.HSSFClientAnchor
* org.apache.poi.hssf.usermodel.HSSFDataValidation
* org.apache.poi.hssf.usermodel.HSSFFont
* org.apache.poi.hssf.usermodel.HSSFPatriarch
* org.apache.poi.hssf.usermodel.HSSFRow
* org.apache.poi.hssf.usermodel.HSSFSheet
* org.apache.poi.hssf.usermodel.HSSFWorkbook
* org.apache.poi.ss.usermodel.Cell
* org.apache.poi.ss.usermodel.DataValidation
* org.apache.poi.ss.usermodel.DataValidationConstraint
* org.apache.poi.ss.usermodel.Row
* org.apache.poi.ss.usermodel.Sheet
* org.apache.poi.ss.usermodel.Workbook
* org.apache.poi.ss.usermodel.WorkbookFactory
* org.apache.poi.ss.util.CellRangeAddressList
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package cn.cloudwalk.elevator.export.utils;
import cn.cloudwalk.elevator.export.ExcelAttribute;
import cn.cloudwalk.elevator.export.ExcelCallback;
import cn.cloudwalk.elevator.util.DateUtils;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.DVConstraint;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ExcelUtil {
public static final String FONT_CODE = "1";
private static final int BUF_SIZE = 8096;
private static Logger logger = LoggerFactory.getLogger(ExcelUtil.class);
private static String EXPORT_KEY = "isExport";
private static String ANNOTATION_FIELD = "memberValues";
public static <T> List<T> getExcelToList(String sheetName, Integer startNo, InputStream input, Class<T> clazz) throws Exception {
ArrayList<T> list = new ArrayList<T>();
try (Workbook book = WorkbookFactory.create((InputStream)input);){
Sheet sheet = null;
if (StringUtils.isNotBlank((CharSequence)sheetName)) {
sheet = book.getSheet(sheetName);
}
if (sheet == null) {
sheet = book.getSheetAt(0);
}
int rows = sheet.getLastRowNum();
int startLine = 1;
if (null != startNo && startNo >= 0) {
startLine = startNo;
}
if (rows > 0) {
Field[] allFields = clazz.getDeclaredFields();
Map<String, Field> fieldsMap = ExcelUtil.getStringFieldMap(allFields);
Row firstRow = sheet.getRow(sheet.getFirstRowNum() + startLine - 1);
for (int i = sheet.getFirstRowNum() + startLine; i <= rows; ++i) {
Row row = sheet.getRow(i);
if (row == null) continue;
Iterator cells = row.cellIterator();
T entity = null;
boolean isNull = true;
while (cells.hasNext()) {
Cell cell = (Cell)cells.next();
String fieldName = firstRow.getCell(cell.getColumnIndex()).getStringCellValue();
if (!fieldsMap.containsKey(fieldName)) continue;
cell.setCellType(1);
String c = cell.getStringCellValue();
if (StringUtils.isNotEmpty((CharSequence)c)) {
isNull = false;
}
entity = entity == null ? (T)clazz.newInstance() : entity;
Field field = fieldsMap.get(fieldName);
Class<?> fieldType = field.getType();
if (fieldType == null) continue;
ExcelUtil.setValue(entity, c, field, fieldType);
}
if (entity == null || isNull) continue;
list.add(entity);
}
}
}
catch (Exception e) {
throw new Exception("\u5c06excel\u8868\u5355\u6570\u636e\u6e90\u7684\u6570\u636e\u5bfc\u5165\u5230list\u5f02\u5e38!", e);
}
return list;
}
private static <T> void setValue(T entity, String c, Field field, Class<?> fieldType) throws IllegalAccessException {
if (String.class == fieldType) {
field.set(entity, String.valueOf(c));
} else if (BigDecimal.class == fieldType) {
field.set(entity, BigDecimal.valueOf(Double.valueOf(c)));
} else if (Integer.TYPE == fieldType || Integer.class == fieldType) {
field.set(entity, Integer.parseInt(c));
} else if (Long.TYPE == fieldType || Long.class == fieldType) {
field.set(entity, Long.valueOf(c));
} else if (Float.TYPE == fieldType || Float.class == fieldType) {
field.set(entity, Float.valueOf(c));
} else if (Short.TYPE == fieldType || Short.class == fieldType) {
field.set(entity, Short.valueOf(c));
} else if (Double.TYPE == fieldType || Double.class == fieldType) {
field.set(entity, Double.valueOf(c));
}
}
private static Map<String, Field> getStringFieldMap(Field[] allFields) {
HashMap<String, Field> fieldsMap = new HashMap<String, Field>(allFields.length);
for (Field field : allFields) {
ExcelAttribute attribute;
if (!field.isAnnotationPresent(ExcelAttribute.class) || StringUtils.isBlank((CharSequence)(attribute = field.getAnnotation(ExcelAttribute.class)).name())) continue;
field.setAccessible(true);
fieldsMap.put(attribute.name(), field);
}
return fieldsMap;
}
public static <T> boolean matchExcel(String sheetName, InputStream input, Class<T> clazz) throws Exception {
block6: {
try {
int rows;
HSSFWorkbook book = new HSSFWorkbook(input);
HSSFSheet sheet = null;
if (StringUtils.isNotBlank((CharSequence)sheetName)) {
sheet = book.getSheet(sheetName);
}
if (sheet == null) {
sheet = book.getSheetAt(0);
}
if ((rows = sheet.getLastRowNum()) > 0) {
Field[] allFields = clazz.getDeclaredFields();
Map<String, Field> fieldsMap = ExcelUtil.getStringFieldMap(allFields);
HSSFRow firstRow = sheet.getRow(sheet.getFirstRowNum());
Iterator cells = firstRow.cellIterator();
while (cells.hasNext()) {
Cell cell = (Cell)cells.next();
String fieldName = firstRow.getCell(cell.getColumnIndex()).getStringCellValue();
if (fieldsMap.containsKey(fieldName)) continue;
return false;
}
break block6;
}
return false;
}
catch (Exception e) {
throw new Exception("\u5c06excel\u8868\u5355\u6570\u636e\u6e90\u7684\u6570\u636e\u5bfc\u5165\u5230list\u5f02\u5e38!", e);
}
}
return true;
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public static <T> boolean getListToExcel(List<T> list, List<T> listHead, String sheetName, OutputStream output, Class<T> clazz) throws Exception {
try (HSSFWorkbook workbook = new HSSFWorkbook();){
Field[] allFields = clazz.getDeclaredFields();
ArrayList<Field> fields = new ArrayList<Field>();
for (Field field : allFields) {
if (!field.isAnnotationPresent(ExcelAttribute.class)) continue;
fields.add(field);
}
HSSFSheet sheet = workbook.createSheet();
workbook.setSheetName(0, sheetName);
ExcelUtil.createRowContent(sheet, fields, workbook, listHead, 0, listHead.size(), 0);
ExcelUtil.createRowHeard(sheet, fields, workbook, 1);
ExcelUtil.createRowContent(sheet, fields, workbook, list, 0, list.size(), 2);
output.flush();
workbook.write(output);
output.close();
int n = Boolean.TRUE.booleanValue() ? 1 : 0;
return n != 0;
}
catch (Exception e) {
throw new Exception("\u5c06list\u6570\u636e\u6e90\u7684\u6570\u636e\u5bfc\u5165\u5230excel\u8868\u5355\u5f02\u5e38!", e);
}
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public static <T> boolean getListToExcel(List<T> list, String sheetName, OutputStream output, Class<T> clazz) throws Exception {
try (HSSFWorkbook workbook = new HSSFWorkbook();){
int sheetSize = 65536;
Field[] allFields = clazz.getDeclaredFields();
ArrayList<Field> fields = new ArrayList<Field>();
for (Field field : allFields) {
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
if (attr == null || !attr.isExport()) continue;
fields.add(field);
}
int listSize = 0;
if (list != null && list.size() > 0) {
listSize = list.size();
}
int sheetNo = listSize / sheetSize;
for (int index = 0; index <= sheetNo; ++index) {
HSSFSheet sheet = workbook.createSheet();
workbook.setSheetName(index, sheetName + index);
ExcelUtil.createRowHeard(sheet, fields, workbook, 2);
int startNo = index * sheetSize;
int endNo = Math.min(startNo + sheetSize, listSize);
ExcelUtil.createRowContent(sheet, fields, workbook, list, startNo, endNo, 3);
}
output.flush();
workbook.write(output);
output.close();
int n = Boolean.TRUE.booleanValue() ? 1 : 0;
return n != 0;
}
catch (Exception e) {
throw new Exception("\u5c06list\u6570\u636e\u6e90\u7684\u6570\u636e\u5bfc\u5165\u5230excel\u8868\u5355\u5f02\u5e38!", e);
}
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public static <T> boolean getListToExcel(List<T> list, String sheetName, OutputStream output, Class<T> clazz, Integer startRow, ExcelCallback callback) throws Exception {
try (HSSFWorkbook workbook = new HSSFWorkbook();){
int sheetSize = 65536;
Field[] allFields = clazz.getDeclaredFields();
ArrayList<Field> fields = new ArrayList<Field>();
for (Field field : allFields) {
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
if (attr == null || !attr.isExport()) continue;
fields.add(field);
}
int listSize = 0;
if (list != null && list.size() > 0) {
listSize = list.size();
}
int sheetNo = listSize / sheetSize;
for (int index = 0; index <= sheetNo; ++index) {
HSSFSheet sheet = workbook.createSheet();
workbook.setSheetName(index, sheetName + index);
ExcelUtil.createRowHeard(sheet, fields, workbook, startRow);
int startNo = index * sheetSize;
int endNo = Math.min(startNo + sheetSize, listSize);
ExcelUtil.createRowContent(sheet, fields, workbook, list, startNo, endNo, startRow + 1);
if (null == callback) continue;
callback.call(workbook, sheet);
}
output.flush();
workbook.write(output);
output.close();
int n = Boolean.TRUE.booleanValue() ? 1 : 0;
return n != 0;
}
catch (Exception e) {
throw new Exception("\u5c06list\u6570\u636e\u6e90\u7684\u6570\u636e\u5bfc\u5165\u5230excel\u8868\u5355\u5f02\u5e38!", e);
}
}
private static <T> void createRowContent(HSSFSheet sheet, List<Field> fields, HSSFWorkbook workbook, List<T> list, int startNo, int endNo, int rowIndex) throws Exception {
String value = null;
int hwPicType = 0;
byte[] picByte = null;
for (int i = startNo; i < endNo; ++i) {
HSSFRow row = sheet.createRow(i - startNo + rowIndex);
T vo = list.get(i);
for (int j = 0; j < fields.size(); ++j) {
Field field = fields.get(j);
field.setAccessible(true);
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
int col = j;
if (StringUtils.isNotBlank((CharSequence)attr.column())) {
col = ExcelUtil.getExcelCol(attr.column());
}
if (!attr.isExport()) continue;
HSSFCell cell = row.createCell(col);
Class<Comparable<Date>> classType = field.getType();
if (field.get(vo) == null) continue;
value = null;
if (classType.isAssignableFrom(Date.class)) {
value = DateUtils.formatDate((Date)((Date)field.get(vo)), (String)"yyyy-MM-dd HH:mm:ss");
}
if (classType.isAssignableFrom(Long.class) && attr.isDate()) {
value = DateUtils.formatDate((Date)new Date((Long)field.get(vo)), (String)"yyyy-MM-dd HH:mm:ss");
}
if (attr.isPic()) {
try {
if (field.getType().equals(String.class)) {
picByte = ExcelUtil.getBytesByUrl((String)field.get(vo));
}
picByte = (byte[])field.get(vo);
}
catch (Exception exception) {
// empty catch block
}
hwPicType = 5;
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 1020, 250, (short)col, row.getRowNum(), (short)col, row.getRowNum());
patriarch.createPicture(anchor, workbook.addPicture(picByte, hwPicType));
row.setHeight((short)1000);
continue;
}
cell.setCellValue(field.get(vo) == null ? "" : (value == null ? String.valueOf(field.get(vo)) : value));
}
}
}
public static void createRowHeard(HSSFSheet sheet, List<Field> fields, HSSFWorkbook workbook, int index) {
HSSFRow row = sheet.createRow(index);
for (int i = 0; i < fields.size(); ++i) {
int col = i;
Field field = fields.get(i);
ExcelAttribute attr = field.getAnnotation(ExcelAttribute.class);
if (StringUtils.isNotBlank((CharSequence)attr.column())) {
col = ExcelUtil.getExcelCol(attr.column());
}
HSSFCell cell = row.createCell(col);
HSSFCellStyle cellStyle = ExcelUtil.createCellStyle(workbook, attr.isMark() ? "2" : FONT_CODE);
cell.setCellStyle(cellStyle);
sheet.setColumnWidth(i, (int)((double)(attr.name().getBytes().length <= 4 ? 6 : attr.name().getBytes().length) * 1.5 * 256.0));
cell.setCellType(1);
cell.setCellValue(attr.name());
}
}
private static HSSFCellStyle createCellStyle(HSSFWorkbook workbook, String type) {
HSSFFont font = workbook.createFont();
HSSFCellStyle cellStyle = workbook.createCellStyle();
font.setFontName("Arail narrow");
font.setBoldweight((short)700);
if (FONT_CODE.equals(type)) {
font.setColor((short)Short.MAX_VALUE);
cellStyle.setFont(font);
} else {
font.setColor((short)10);
cellStyle.setFont(font);
}
return cellStyle;
}
public static int getExcelCol(String col) {
col = col.toUpperCase();
int count = -1;
char[] cs = col.toCharArray();
for (int i = 0; i < cs.length; ++i) {
count = (int)((double)count + (double)(cs[i] - 64) * Math.pow(26.0, (double)cs.length - 1.0 - (double)i));
}
return count;
}
public static HSSFSheet setHSSFPrompt(HSSFSheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, int firstCol, int endCol) {
DVConstraint constraint = DVConstraint.createCustomFormulaConstraint((String)"DD1");
CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
HSSFDataValidation dataValidationView = new HSSFDataValidation(regions, (DataValidationConstraint)constraint);
dataValidationView.createPromptBox(promptTitle, promptContent);
sheet.addValidationData((DataValidation)dataValidationView);
return sheet;
}
public static HSSFSheet setHSSFValidation(HSSFSheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) {
DVConstraint constraint = DVConstraint.createExplicitListConstraint((String[])textlist);
CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
HSSFDataValidation dataValidationList = new HSSFDataValidation(regions, (DataValidationConstraint)constraint);
sheet.addValidationData((DataValidation)dataValidationList);
return sheet;
}
/*
* WARNING - Removed try catching itself - possible behaviour change.
*/
public static byte[] getBytesByUrl(String imgUrl) throws Exception {
if (StringUtils.isEmpty((CharSequence)imgUrl)) {
return null;
}
BufferedInputStream bis = null;
ByteArrayOutputStream bos = null;
try {
int size;
URL url = new URL(imgUrl);
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http.setConnectTimeout(3000);
http.connect();
bis = new BufferedInputStream(http.getInputStream());
bos = new ByteArrayOutputStream();
byte[] buf = new byte[8096];
while ((size = bis.read(buf)) != -1) {
bos.write(buf, 0, size);
}
http.disconnect();
byte[] byArray = bos.toByteArray();
return byArray;
}
finally {
if (bis != null) {
try {
bis.close();
}
catch (IOException e) {
logger.error("\u6d41\u5173\u95ed\u5931\u8d25\uff0c\u539f\u56e0\uff1a" + e.getMessage(), (Throwable)e);
}
}
if (bos != null) {
try {
bos.close();
}
catch (IOException e) {
logger.error("\u6d41\u5173\u95ed\u5931\u8d25\uff0c\u539f\u56e0\uff1a" + e.getMessage(), (Throwable)e);
}
}
}
}
public static void setExcelAttribute(ExcelAttribute excelAttribute, String key, Object obj, boolean isExport) {
if (excelAttribute == null) {
return;
}
InvocationHandler invocationHandler = Proxy.getInvocationHandler(excelAttribute);
Field value = null;
try {
value = invocationHandler.getClass().getDeclaredField(ANNOTATION_FIELD);
}
catch (Exception e) {
logger.warn("\u53cd\u5c04\u83b7\u53d6ExcelAttribute\u6ce8\u89e3\u7684\u6210\u5458\u5b57\u6bb5\u5f02\u5e38", (Throwable)e);
}
if (value == null) {
return;
}
value.setAccessible(true);
Map memberValues = null;
try {
memberValues = (Map)value.get(invocationHandler);
}
catch (Exception e) {
logger.warn("\u53cd\u5c04\u83b7\u53d6ExcelAttribute\u6ce8\u89e3\u7684\u6210\u5458\u503c\u5f02\u5e38", (Throwable)e);
}
if (memberValues == null) {
return;
}
if (obj != null) {
memberValues.put(key, obj);
}
if (!isExport) {
memberValues.put(EXPORT_KEY, isExport);
}
}
/*
* Exception decompiling
*/
public static <T> boolean appendListToExcel(InputStream inputStream, List<T> list, int sheetIndex, OutputStream output, Class<T> clazz, Integer startRow) throws Exception {
/*
* This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
*
* org.benf.cfr.reader.util.ConfusedCFRException: Started 2 blocks at once
* at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.getStartingBlocks(Op04StructuredStatement.java:412)
* at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:487)
* at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
* at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
* at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
* at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
* at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
* at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
* at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
* at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
* at org.benf.cfr.reader.Main.main(Main.java:54)
*/
throw new IllegalStateException("Decompilation failed");
}
}
@@ -0,0 +1,46 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package cn.cloudwalk.elevator.export.utils;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FolderUtils {
private static Logger logger = LoggerFactory.getLogger(FolderUtils.class);
public static void deleteFolder(String path) {
File file = new File(path);
if (file.exists()) {
File[] files = file.listFiles();
int len = files.length;
for (int i = 0; i < len; ++i) {
if (files[i].isDirectory()) {
FolderUtils.deleteFolder(files[i].getPath());
continue;
}
FolderUtils.doDelete(files[i]);
}
FolderUtils.doDelete(file);
}
}
public static void deleteFile(String path) {
File file = new File(path);
if (file.exists()) {
FolderUtils.doDelete(file);
}
}
public static void doDelete(File file) {
if (file.exists() && !file.delete()) {
logger.error("\u6587\u4ef6\u5220\u9664\u5931\u8d25");
}
}
}
@@ -0,0 +1,26 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* org.springframework.cloud.netflix.feign.FeignClient
* org.springframework.web.bind.annotation.RequestMapping
* org.springframework.web.bind.annotation.RequestMethod
*/
package cn.cloudwalk.elevator.mqtt.client;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.mqtt.fallback.MqttFeignClientFallback;
import cn.cloudwalk.elevator.mqtt.param.MqttSendMessageParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient(name="${feign.mqtt.name:cloudwalk-device-thirdparty}", path="/mqtt", fallback=MqttFeignClientFallback.class)
public interface MqttFeignClient {
@RequestMapping(value={"/publish"}, method={RequestMethod.POST})
public CloudwalkResult<Boolean> publish(MqttSendMessageParam var1) throws ServiceException;
}
@@ -0,0 +1,25 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* org.springframework.stereotype.Component
*/
package cn.cloudwalk.elevator.mqtt.fallback;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.elevator.mqtt.client.MqttFeignClient;
import cn.cloudwalk.elevator.mqtt.param.MqttSendMessageParam;
import org.springframework.stereotype.Component;
@Component
public class MqttFeignClientFallback
implements MqttFeignClient {
@Override
public CloudwalkResult<Boolean> publish(MqttSendMessageParam param) throws ServiceException {
throw new RuntimeException("mqtt\u53d1\u9001\u6570\u636e\u5931\u8d25");
}
}
@@ -0,0 +1,97 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.record.dao.AcsRecogRecordDao
* cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO
* cn.cloudwalk.elevator.record.dto.AcsRecogRecordPageDTO
* cn.cloudwalk.elevator.record.dto.AcsRecogRecordResultDTO
* cn.cloudwalk.elevator.util.DateUtils
* com.alibaba.fastjson.JSON
* org.apache.commons.collections4.CollectionUtils
* org.apache.commons.lang3.StringUtils
* org.springframework.beans.factory.annotation.Qualifier
* org.springframework.scheduling.annotation.Async
* org.springframework.stereotype.Component
*/
package cn.cloudwalk.elevator.mqtt.impl;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.common.AbstractAcsDeviceService;
import cn.cloudwalk.elevator.mqtt.client.MqttFeignClient;
import cn.cloudwalk.elevator.mqtt.param.AcsElevatorRecordMqttParam;
import cn.cloudwalk.elevator.mqtt.param.MqttSendMessageParam;
import cn.cloudwalk.elevator.mqtt.service.MqttService;
import cn.cloudwalk.elevator.record.dao.AcsRecogRecordDao;
import cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO;
import cn.cloudwalk.elevator.record.dto.AcsRecogRecordPageDTO;
import cn.cloudwalk.elevator.record.dto.AcsRecogRecordResultDTO;
import cn.cloudwalk.elevator.util.DateUtils;
import com.alibaba.fastjson.JSON;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@Component
public class MqttServiceImpl
extends AbstractAcsDeviceService
implements MqttService {
private static final String VISITOR_LABEL_CODE = "1";
private static final String VISITOR_LABEL_NAME = "\u8bbf\u5ba2";
private static final String ELEVATOR_RECORD_SUFFIX = "_elevator_record";
@Qualifier(value="cn.cloudwalk.elevator.mqtt.client.MqttFeignClient")
@Resource
private MqttFeignClient mqttFeignClient;
@Resource
private AcsRecogRecordDao acsRecogRecordDao;
@Override
@Async
public void sendInfoToOne(AcsElevatorRecordAddDTO addDTO) throws ServiceException {
this.logger.info("\u9632\u6b62\u4eba\u5458\u8bc6\u522b\u8bb0\u5f55\u672a\u5165\u5e93\u5373\u5f00\u59cb\u63a8\u9001\u6d88\u606f\uff0c\u4f11\u772010\u79d2");
try {
TimeUnit.SECONDS.sleep(10L);
}
catch (InterruptedException e) {
this.logger.error("\u4f11\u7720\u5931\u8d25\uff0c\u5931\u8d25\u539f\u56e0\uff1a{}", (Object)e.getMessage());
throw new ServiceException(e.getMessage());
}
try {
AcsRecogRecordPageDTO recordPageDTO = new AcsRecogRecordPageDTO();
recordPageDTO.setLogId(addDTO.getRecognitionFaceId());
recordPageDTO.setStartTime(DateUtils.todayStart());
recordPageDTO.setEndTime(DateUtils.todayEnd());
List recogRecordResultDTOS = this.acsRecogRecordDao.page(recordPageDTO);
if (!CollectionUtils.isEmpty((Collection)recogRecordResultDTOS)) {
CloudwalkResult<Boolean> publish;
AcsRecogRecordResultDTO acsRecogRecordResultDTO = (AcsRecogRecordResultDTO)recogRecordResultDTOS.get(0);
AcsElevatorRecordMqttParam acsElevatorRecordMqttParam = (AcsElevatorRecordMqttParam)BeanCopyUtils.copyProperties((Object)addDTO, AcsElevatorRecordMqttParam.class);
acsElevatorRecordMqttParam.setOpenDoorId(addDTO.getId());
acsElevatorRecordMqttParam.setPersonName(acsRecogRecordResultDTO.getPersonName());
if (StringUtils.isNotBlank((CharSequence)acsRecogRecordResultDTO.getPersonLabelIds()) && acsRecogRecordResultDTO.getPersonLabelIds().contains(VISITOR_LABEL_CODE)) {
acsElevatorRecordMqttParam.setIsVisitor(Boolean.TRUE);
}
if ((publish = this.mqttFeignClient.publish(MqttSendMessageParam.builder().topic(addDTO.getBusinessId() + ELEVATOR_RECORD_SUFFIX).data(JSON.toJSONString((Object)acsElevatorRecordMqttParam)).build())).isSuccess()) {
this.logger.info("\u63a8\u9001\u6570\u636e\u6210\u529f\uff01\uff01\uff01,\u6570\u636e\uff0c{}", (Object)JSON.toJSONString((Object)acsElevatorRecordMqttParam));
} else {
this.logger.debug("\u63a8\u9001\u6570\u636e\u5931\u8d25\uff01\uff01\uff01");
}
}
}
catch (Exception e) {
this.logger.error("\u53d1\u9001\u6d88\u606f\u5931\u8d25 param:{} {}", (Object)addDTO, (Object)e.getMessage());
}
}
}
@@ -0,0 +1,80 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.mqtt.param;
public class AcsElevatorRecordMqttParam {
private String openDoorId;
private String openDoorType;
private String srcFloor;
private String destFloor;
private String dispatchElevatorNo;
private Long dispatchElevatorTime;
private String personName;
private Boolean isVisitor = false;
public String getOpenDoorId() {
return this.openDoorId;
}
public String getOpenDoorType() {
return this.openDoorType;
}
public String getSrcFloor() {
return this.srcFloor;
}
public String getDestFloor() {
return this.destFloor;
}
public String getDispatchElevatorNo() {
return this.dispatchElevatorNo;
}
public Long getDispatchElevatorTime() {
return this.dispatchElevatorTime;
}
public String getPersonName() {
return this.personName;
}
public Boolean getIsVisitor() {
return this.isVisitor;
}
public void setOpenDoorId(String openDoorId) {
this.openDoorId = openDoorId;
}
public void setOpenDoorType(String openDoorType) {
this.openDoorType = openDoorType;
}
public void setSrcFloor(String srcFloor) {
this.srcFloor = srcFloor;
}
public void setDestFloor(String destFloor) {
this.destFloor = destFloor;
}
public void setDispatchElevatorNo(String dispatchElevatorNo) {
this.dispatchElevatorNo = dispatchElevatorNo;
}
public void setDispatchElevatorTime(Long dispatchElevatorTime) {
this.dispatchElevatorTime = dispatchElevatorTime;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public void setIsVisitor(Boolean isVisitor) {
this.isVisitor = isVisitor;
}
}
@@ -0,0 +1,64 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.mqtt.param;
import java.beans.ConstructorProperties;
public class MqttSendMessageParam {
private String topic;
private String data;
@ConstructorProperties(value={"topic", "data"})
MqttSendMessageParam(String topic, String data) {
this.topic = topic;
this.data = data;
}
public static MqttSendMessageParamBuilder builder() {
return new MqttSendMessageParamBuilder();
}
public String getTopic() {
return this.topic;
}
public String getData() {
return this.data;
}
public void setTopic(String topic) {
this.topic = topic;
}
public void setData(String data) {
this.data = data;
}
public static class MqttSendMessageParamBuilder {
private String topic;
private String data;
MqttSendMessageParamBuilder() {
}
public MqttSendMessageParamBuilder topic(String topic) {
this.topic = topic;
return this;
}
public MqttSendMessageParamBuilder data(String data) {
this.data = data;
return this;
}
public MqttSendMessageParam build() {
return new MqttSendMessageParam(this.topic, this.data);
}
public String toString() {
return "MqttSendMessageParam.MqttSendMessageParamBuilder(topic=" + this.topic + ", data=" + this.data + ")";
}
}
}
@@ -0,0 +1,16 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO
*/
package cn.cloudwalk.elevator.mqtt.service;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO;
public interface MqttService {
public void sendInfoToOne(AcsElevatorRecordAddDTO var1) throws ServiceException;
}
@@ -0,0 +1,77 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreEditParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonData
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreDetailResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
*/
package cn.cloudwalk.elevator.passrule.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreEditParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonData;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreDetailResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult;
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 java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
public class AbstractAcsPassService
extends AbstractCloudwalkService {
@Resource
private ImageStoreService imageStoreService;
protected ImageStoreDetailResult getImageStoreDetail(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
ImageStoreQueryParam param = new ImageStoreQueryParam();
param.setId(imageStoreId);
param.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult imageStoreDetail = this.imageStoreService.detail(param, context);
if (!imageStoreDetail.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u56fe\u5e93\u8be6\u60c5\u5931\u8d25\uff0c\u539f\u56e0\uff1a" + imageStoreDetail.getMessage());
throw new ServiceException("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u56fe\u5e93\u8be6\u60c5\u5931\u8d25");
}
return (ImageStoreDetailResult)imageStoreDetail.getData();
}
protected ImageStoreEditParam getEditParamByImageStore(ImageStoreDetailResult imageStoreDetail) {
ImageStoreEditParam param = new ImageStoreEditParam();
BeanCopyUtils.copyProperties((Object)imageStoreDetail, (Object)param);
param.setIncludeOrganizations(imageStoreDetail.getIncludeOrganizations().stream().map(OrganizationResult::getId).collect(Collectors.toList()));
param.setIncludeLabels(imageStoreDetail.getIncludeLabels().stream().map(LabelResult::getId).collect(Collectors.toList()));
param.setIncludePersons(this.getImageStorePersonData(imageStoreDetail.getIncludePersons()));
param.setExcludeLabels(imageStoreDetail.getExcludeLabels().stream().map(LabelResult::getId).collect(Collectors.toList()));
param.setExcludePersons(imageStoreDetail.getExcludePersons().stream().map(ImgStorePersonResult::getId).collect(Collectors.toList()));
return param;
}
private List<ImageStorePersonData> getImageStorePersonData(List<ImgStorePersonResult> imgStorePersonResults) {
ArrayList<ImageStorePersonData> personDataList = new ArrayList<ImageStorePersonData>();
for (ImgStorePersonResult personResult : imgStorePersonResults) {
ImageStorePersonData personData = new ImageStorePersonData();
BeanCopyUtils.copyProperties((Object)personResult, (Object)personData);
personData.setObjectId(personResult.getId());
personDataList.add(personData);
}
return personDataList;
}
}
@@ -0,0 +1,522 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreAddParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreDelParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreEditParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreDetailResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreListResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService
* cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.DataAccessException
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO
* cn.cloudwalk.elevator.em.AcsPassTypeEnum
* cn.cloudwalk.elevator.passrule.dao.AcsPassRuleDao
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleAddDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleDeleteDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleEditDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleIsDefaultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleResultDto
* cn.cloudwalk.elevator.util.CollectionUtils
* com.alibaba.fastjson.JSONObject
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.stereotype.Service
* org.springframework.transaction.annotation.Propagation
* org.springframework.transaction.annotation.Transactional
* org.springframework.util.ObjectUtils
*/
package cn.cloudwalk.elevator.passrule.impl;
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.param.ImageStoreEditParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreDetailResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreListResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService;
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
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.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.common.service.AcsApplicationService;
import cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
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.em.AcsPassTypeEnum;
import cn.cloudwalk.elevator.passrule.dao.AcsPassRuleDao;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleAddDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleDeleteDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleEditDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleIsDefaultDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleResultDto;
import cn.cloudwalk.elevator.passrule.impl.AbstractAcsPassService;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleDeleteParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleEditParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleFloorParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleImageParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleIsDefaultParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleNewParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleQueryParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeCycleParam;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleDetailResult;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleFloorResult;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleResult;
import cn.cloudwalk.elevator.passrule.service.AcsPassRuleService;
import cn.cloudwalk.elevator.person.param.AcsPersonQueryParam;
import cn.cloudwalk.elevator.person.result.AcsPersonResult;
import cn.cloudwalk.elevator.person.service.AcsPersonService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.zone.param.ZoneNextTreeParam;
import cn.cloudwalk.elevator.zone.result.ZoneTreeResult;
import cn.cloudwalk.elevator.zone.service.ZoneService;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@Service
public class AcsPassRuleServiceImpl
extends AbstractAcsPassService
implements AcsPassRuleService {
@Resource
private ImageStoreService imageStoreService;
@Resource
private ImageStorePersonService imageStorePersonService;
@Resource
private PersonService personService;
@Resource
private ZoneService zoneService;
@Autowired
private AcsApplicationService acsApplicationService;
@Autowired
private AcsPersonService acsPersonService;
@Resource
private AcsPassRuleDao acsPassRuleDao;
@Resource
private AcsDeviceImageStoreAppBindService acsDeviceImageStoreAppBindService;
@Resource
private AcsElevatorDeviceDao acsElevatorDeviceDao;
@Override
public CloudwalkResult<List<AcsPassRuleFloorResult>> listFloor(AcsPassRuleFloorParam param, CloudwalkCallContext context) throws ServiceException {
ZoneNextTreeParam treeParam = new ZoneNextTreeParam();
treeParam.setParentId(param.getZoneId());
CloudwalkResult<List<ZoneTreeResult>> zoneTree = this.zoneService.tree(treeParam, context);
if (!zoneTree.isSuccess()) {
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u533a\u57df\u6811\u72b6\u56fe\u5931\u8d25,\u539f\u56e0\uff1a" + zoneTree.getMessage());
throw new ServiceException(zoneTree.getCode(), zoneTree.getMessage());
}
try {
ArrayList<AcsPassRuleFloorResult> passRuleResults = new ArrayList<AcsPassRuleFloorResult>();
if (!CollectionUtils.isEmpty((Collection)((Collection)zoneTree.getData()))) {
for (ZoneTreeResult zoneTreeResult : (List)zoneTree.getData()) {
this.getZoneTypeIsThree(zoneTreeResult, passRuleResults);
}
} else {
return CloudwalkResult.success(passRuleResults);
}
for (AcsPassRuleFloorResult passRuleResult : passRuleResults) {
AcsElevatorDeviceListDto dto = new AcsElevatorDeviceListDto();
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setCurrentFloorId(passRuleResult.getId());
List deviceList = this.acsElevatorDeviceDao.listByZoneId(dto);
passRuleResult.setDeviceNumber(deviceList.size());
AcsPersonQueryParam personParam = new AcsPersonQueryParam();
personParam.setZoneId(passRuleResult.getId());
CloudwalkPageInfo pageInfo = new CloudwalkPageInfo(1, 10);
CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> page = this.acsPersonService.page(personParam, pageInfo, context);
passRuleResult.setPersonNumber(((CloudwalkPageAble)page.getData()).getTotalRows());
}
return CloudwalkResult.success(passRuleResults);
}
catch (DataAccessException e) {
this.logger.error("\u67e5\u8be2\u6240\u6709\u697c\u5c42\u4fe1\u606f\u5931\u8d25");
throw new ServiceException("76260520", this.getMessage("76260520"));
}
}
@Override
public CloudwalkResult<String> getIsDefaultByZoneId(AcsPassRuleIsDefaultParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleIsDefaultDto dto = new AcsPassRuleIsDefaultDto();
dto.setZoneId(param.getZoneId());
dto.setBusinessId(context.getCompany().getCompanyId());
return CloudwalkResult.success((Object)this.acsPassRuleDao.getIsDefaultByZoneId(dto));
}
catch (DataAccessException e) {
this.logger.error("\u6839\u636e\u697c\u5c42id\u83b7\u53d6\u9ed8\u8ba4\u56fe\u5e93id\u5931\u8d25");
throw new ServiceException("76260524", this.getMessage("76260524"));
}
}
@Override
@CloudwalkParamsValidate(argsIndexs={0, 1})
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class})
public CloudwalkResult<String> add(AcsPassRuleNewParam param, CloudwalkCallContext context) throws ServiceException {
String imageStoreId = this.addImageStore(param, context);
AcsPassRuleAddDto dto = new AcsPassRuleAddDto();
dto.setId(this.genUUID());
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setName(param.getRuleName());
dto.setImageStoreId(imageStoreId);
dto.setZoneId(param.getZoneId());
dto.setZoneName(param.getZoneName());
dto.setBeginDate(param.getStartTime());
dto.setEndDate(param.getEndTime());
dto.setIsDefault(param.getIsDefault());
try {
this.acsPassRuleDao.insert(dto);
return CloudwalkResult.success((Object)imageStoreId);
}
catch (DataAccessException e) {
this.logger.error("\u6dfb\u52a0\u901a\u884c\u89c4\u5219\u5931\u8d25");
throw new ServiceException("76260505", this.getMessage("76260505"));
}
}
private String addImageStore(AcsPassRuleNewParam param, CloudwalkCallContext context) throws ServiceException {
ImageStoreAddParam imageStoreAddParam = new ImageStoreAddParam();
String applicationId = this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId());
BeanCopyUtils.copyProperties((Object)param, (Object)imageStoreAddParam);
imageStoreAddParam.setExpiryBeginDate(param.getStartTime());
imageStoreAddParam.setExpiryEndDate(param.getEndTime());
imageStoreAddParam.setName(param.getZoneName() + "-" + param.getRuleName());
imageStoreAddParam.setType(Short.valueOf((short)1));
imageStoreAddParam.setSourceApplicationId(applicationId);
imageStoreAddParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult imageStoreId = this.imageStoreService.add(imageStoreAddParam, context);
if (!imageStoreId.isSuccess()) {
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u65b0\u589e\u56fe\u5e93\u5931\u8d25,\u539f\u56e0\uff1a" + imageStoreId.getMessage());
throw new ServiceException(imageStoreId.getCode(), imageStoreId.getMessage());
}
AcsElevatorDeviceListDto dto = new AcsElevatorDeviceListDto();
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setCurrentFloorId(param.getZoneId());
List deviceList = null;
try {
deviceList = this.acsElevatorDeviceDao.listByZoneId(dto);
}
catch (DataAccessException e) {
this.logger.error("\u6839\u636e\u697c\u5c42id\u83b7\u53d6\u8bbe\u5907\u4fe1\u606f\u5931\u8d25\uff0c\u539f\u56e0\u662f\uff1a{}", (Object)e.getMessage());
}
DeviceImageStoreAppBindParam appBindParam = new DeviceImageStoreAppBindParam();
appBindParam.setImageStoreId((String)imageStoreId.getData());
appBindParam.setApplicationId(applicationId);
this.acsDeviceImageStoreAppBindService.bindAppImageStoreDevice(appBindParam, context);
if (!CollectionUtils.isEmpty((Collection)deviceList)) {
for (AcsElevatorDeviceResultDTO device : deviceList) {
try {
DeviceImageStoreAppBindParam bindParam = new DeviceImageStoreAppBindParam();
bindParam.setImageStoreId((String)imageStoreId.getData());
bindParam.setDeviceId(device.getDeviceId());
bindParam.setApplicationId(applicationId);
this.acsDeviceImageStoreAppBindService.bindDeviceAndImageStore(bindParam, context);
}
catch (ServiceException e) {
this.logger.error("\u56fe\u5e93\u5173\u8054\u5931\u8d25,\u56fe\u5e93id={},\u539f\u56e0:{}", imageStoreId.getData(), (Object)e.getMessage());
ImageStoreDelParam delParam = new ImageStoreDelParam();
delParam.setId((String)imageStoreId.getData());
delParam.setBusinessId(context.getCompany().getCompanyId());
this.logger.info("\u56de\u6eda\u5220\u9664\u56fe\u5e93\u5f00\u59cb,delParam={},context={}", JSONObject.toJSON((Object)delParam), JSONObject.toJSON((Object)context));
CloudwalkResult deleteResult = this.imageStoreService.delete(delParam, context);
this.logger.info("\u5220\u9664\u56fe\u5e93\uff1a\u56fe\u5e93id={},\u7ed3\u679c:{}", (Object)imageStoreId, (Object)deleteResult.getMessage());
throw new ServiceException(e.getCode(), e.getMessage());
}
}
}
return (String)imageStoreId.getData();
}
@Override
@CloudwalkParamsValidate(argsIndexs={0, 1})
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class})
public CloudwalkResult<Boolean> update(AcsPassRuleEditParam param, CloudwalkCallContext context) throws ServiceException {
this.checkDefaultRule(Collections.singletonList(param.getId()), context);
AcsPassRuleEditDto dto = new AcsPassRuleEditDto();
BeanCopyUtils.copyProperties((Object)param, (CloudwalkCallContext)context, (Object)dto);
dto.setValidDateCron(null);
dto.setValidDateJson(null);
dto.setBeginDate(param.getStartTime());
dto.setEndDate(param.getEndTime());
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setName(param.getRuleName());
try {
this.acsPassRuleDao.update(dto);
List<AcsPassRuleResultDto> ruleList = this.getRuleByIds(Collections.singletonList(dto.getId()), context);
this.updateImageStore(param, ruleList.get(0), context);
return CloudwalkResult.success((Object)true);
}
catch (DataAccessException e) {
this.logger.error("\u7f16\u8f91\u901a\u884c\u89c4\u5219\u7f16\u8f91\u5931\u8d25");
throw new ServiceException("76260506", this.getMessage("76260506"));
}
}
private List<AcsPassRuleResultDto> checkDefaultRule(List<String> ruleIds, CloudwalkCallContext context) throws ServiceException {
List<AcsPassRuleResultDto> resultDtoList = this.getRuleByIds(ruleIds, context);
for (AcsPassRuleResultDto resultDto : resultDtoList) {
if (ObjectUtils.isEmpty((Object)resultDto.getIsDefault()) || resultDto.getIsDefault() != 1) continue;
throw new ServiceException("\u95e8\u7981\u9ed8\u8ba4\u89c4\u5219\u4e0d\u53ef\u7f16\u8f91\u548c\u5220\u9664");
}
return resultDtoList;
}
private void updateImageStore(AcsPassRuleEditParam param, AcsPassRuleResultDto ruleResultDto, CloudwalkCallContext context) throws ServiceException {
ImageStoreDetailResult imageStoreDetail = this.getImageStoreDetail(ruleResultDto.getImageStoreId(), context);
ImageStoreEditParam imageStoreEditParam = this.getEditParamByImageStore(imageStoreDetail);
BeanCopyUtils.copyProperties((Object)ruleResultDto, (Object)imageStoreEditParam);
BeanCopyUtils.copyProperties((Object)param, (Object)imageStoreEditParam);
imageStoreEditParam.setName(param.getZoneName() + "-" + param.getRuleName());
imageStoreEditParam.setExpiryBeginDate(param.getStartTime());
imageStoreEditParam.setExpiryEndDate(param.getEndTime());
imageStoreEditParam.setValidDateCron(null);
imageStoreEditParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult result = this.imageStoreService.edit(imageStoreEditParam, context);
if (!result.isSuccess()) {
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u7f16\u8f91\u56fe\u5e93\u5931\u8d25\uff1a\u539f\u56e0:" + result.getMessage());
throw new ServiceException(result.getCode(), result.getMessage());
}
}
private List<AcsPassRuleResultDto> getRuleByIds(List<String> ruleIds, CloudwalkCallContext context) throws ServiceException {
AcsPassRuleQueryDto dto = new AcsPassRuleQueryDto();
dto.setIds(ruleIds);
dto.setBusinessId(context.getCompany().getCompanyId());
try {
return this.acsPassRuleDao.list(dto);
}
catch (DataAccessException e) {
this.logger.error("\u901a\u884c\u89c4\u5219\u67e5\u8be2\u5931\u8d25");
throw new ServiceException("\u901a\u884c\u89c4\u5219\u67e5\u8be2\u5931\u8d25");
}
}
@Override
@CloudwalkParamsValidate(argsIndexs={0, 1})
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class})
public CloudwalkResult<Boolean> delete(AcsPassRuleDeleteParam param, CloudwalkCallContext context) throws ServiceException {
List<AcsPassRuleResultDto> resultDtos = this.checkDefaultRule(param.getIds(), context);
String applicationId = this.acsApplicationService.getApplicationId(context.getCompany().getCompanyId());
AcsElevatorDeviceListDto deviceListDto = new AcsElevatorDeviceListDto();
deviceListDto.setBusinessId(context.getCompany().getCompanyId());
deviceListDto.setCurrentFloorId(param.getZoneId());
List deviceList = null;
try {
deviceList = this.acsElevatorDeviceDao.listByZoneId(deviceListDto);
}
catch (DataAccessException e) {
this.logger.error("\u6839\u636e\u697c\u5c42id\u83b7\u53d6\u8bbe\u5907\u4fe1\u606f\u5931\u8d25\uff0c\u539f\u56e0\u662f\uff1a{}", (Object)e.getMessage());
}
for (AcsPassRuleResultDto dto : resultDtos) {
if (!CollectionUtils.isEmpty((Collection)deviceList)) {
for (AcsElevatorDeviceResultDTO device : deviceList) {
DeviceImageStoreAppUnbindParam unbindParam = new DeviceImageStoreAppUnbindParam();
unbindParam.setApplicationId(applicationId);
unbindParam.setDeviceId(device.getDeviceId());
unbindParam.setDeviceCode(device.getDeviceCode());
unbindParam.setImageStoreId(dto.getImageStoreId());
this.acsDeviceImageStoreAppBindService.unbindAppImageStoreDevice(unbindParam, context);
}
continue;
}
DeviceImageStoreAppUnbindParam unbindParam = new DeviceImageStoreAppUnbindParam();
unbindParam.setApplicationId(applicationId);
unbindParam.setImageStoreId(dto.getImageStoreId());
this.acsDeviceImageStoreAppBindService.deleteImageStore(unbindParam, context);
}
AcsPassRuleDeleteDto dto = new AcsPassRuleDeleteDto();
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setIds(param.getIds());
try {
this.acsPassRuleDao.delete(dto);
return CloudwalkResult.success((Object)true);
}
catch (DataAccessException e) {
this.logger.error("\u901a\u884c\u89c4\u5219\u5220\u9664\u5931\u8d25");
throw new ServiceException("76260507", this.getMessage("76260507"));
}
}
@Override
@CloudwalkParamsValidate(argsIndexs={0, 1})
public CloudwalkResult<AcsPassRuleDetailResult> detail(AcsPassRuleQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleQueryDto dto = new AcsPassRuleQueryDto();
BeanCopyUtils.copyProperties((Object)param, (Object)dto);
dto.setBusinessId(context.getCompany().getCompanyId());
List passRuleResult = this.acsPassRuleDao.list(dto);
if (CollectionUtils.isEmpty((Collection)passRuleResult)) {
return CloudwalkResult.fail((String)"76260517", (String)this.getMessage("76260517"));
}
AcsPassRuleDetailResult result = this.coverRuleDetailResult((AcsPassRuleResultDto)passRuleResult.get(0), context);
return CloudwalkResult.success((Object)result);
}
catch (DataAccessException e) {
this.logger.error("\u67e5\u8be2\u901a\u884c\u89c4\u5219\u8be6\u60c5\u5931\u8d25");
throw new ServiceException("76260508", this.getMessage("76260508"));
}
}
private List<AcsPassRuleResult> coverRulePageResult(List<AcsPassRuleResultDto> passRuleResultDtos, CloudwalkCallContext context, boolean needDetail) throws ServiceException {
ArrayList<AcsPassRuleResult> results = new ArrayList<AcsPassRuleResult>();
Map<String, ImageStoreListResult> imageStoreResultMap = null;
if (needDetail) {
List<String> imageStoreIds = passRuleResultDtos.stream().map(AcsPassRuleResultDto::getImageStoreId).collect(Collectors.toList());
List<ImageStoreListResult> imageStoreListResult = this.getImageStorePageResult(imageStoreIds, context);
imageStoreResultMap = imageStoreListResult.stream().collect(Collectors.toMap(ImageStoreListResult::getId, ImageStoreListResult2 -> ImageStoreListResult2));
}
for (AcsPassRuleResultDto dto : passRuleResultDtos) {
AcsPassRuleResult result = new AcsPassRuleResult();
BeanCopyUtils.copyProperties((Object)dto, (Object)result);
result.setRuleName(dto.getName());
result.setPassType(AcsPassTypeEnum.LONG_TIME.getCode());
if (dto.getBeginDate() != null || dto.getEndDate() != null) {
result.setPassType(AcsPassTypeEnum.AUTO_PASS.getCode());
}
if (needDetail && imageStoreResultMap.containsKey(dto.getImageStoreId())) {
ImageStoreListResult imageStoreListResult = imageStoreResultMap.get(dto.getImageStoreId());
result.setPersonSum(imageStoreListResult.getPersonNum());
result.setIncludeOrganizations(imageStoreListResult.getIncludeOrganizations());
result.setIncludeLabels(imageStoreListResult.getIncludeLabels());
result.setExcludeLabels(imageStoreListResult.getExcludeLabels());
}
results.add(result);
}
return results;
}
private List<ImageStoreListResult> getImageStorePageResult(List<String> imageStoreIds, CloudwalkCallContext context) throws ServiceException {
ImageStoreQueryParam param = new ImageStoreQueryParam();
param.setIds(imageStoreIds);
param.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult imageStoreResult = this.imageStoreService.list(param, context);
if (!imageStoreResult.isSuccess()) {
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u5206\u9875\u67e5\u8be2\u56fe\u5e93\u5931\u8d25\uff0c\u539f\u56e0\uff1a" + imageStoreResult.getMessage());
throw new ServiceException(imageStoreResult.getCode(), imageStoreResult.getMessage());
}
return (List)imageStoreResult.getData();
}
private AcsPassRuleDetailResult coverRuleDetailResult(AcsPassRuleResultDto dto, CloudwalkCallContext context) throws ServiceException {
AcsPassRuleDetailResult result = new AcsPassRuleDetailResult();
BeanCopyUtils.copyProperties((Object)dto, (Object)result);
result.setRuleName(dto.getName());
ImageStoreDetailResult imageStoreDetailResult = this.getImageStoreDetail(dto.getImageStoreId(), context);
result.setIncludeOrganizations(imageStoreDetailResult.getIncludeOrganizations());
result.setIncludeLabels(imageStoreDetailResult.getIncludeLabels());
result.setExcludeLabels(imageStoreDetailResult.getExcludeLabels());
List timeCycleParams = JSONObject.parseArray((String)dto.getValidDateJson(), AcsPassTimeCycleParam.class);
result.setPassableCycle(timeCycleParams);
result.setPassType(AcsPassTypeEnum.LONG_TIME.getCode());
if (dto.getBeginDate() != null || dto.getEndDate() != null) {
result.setPassType(AcsPassTypeEnum.AUTO_PASS.getCode());
}
return result;
}
@Override
@CloudwalkParamsValidate(argsIndexs={0, 1})
public CloudwalkResult<CloudwalkPageAble<AcsPassRuleResult>> page(AcsPassRuleQueryParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleQueryDto dto = new AcsPassRuleQueryDto();
dto.setZoneId(param.getZoneId());
dto.setBusinessId(context.getCompany().getCompanyId());
CloudwalkPageAble passRuleResult = this.acsPassRuleDao.page(dto, page);
if (CollectionUtils.isEmpty((Collection)passRuleResult.getDatas()) && ObjectUtils.isEmpty((Object)param.getIsDefault())) {
AcsPassRuleNewParam ruleNewParam = new AcsPassRuleNewParam();
ruleNewParam.setZoneId(param.getZoneId());
ruleNewParam.setZoneName(param.getZoneName());
ruleNewParam.setRuleName("\u9ed8\u8ba4\u89c4\u5219");
ruleNewParam.setIsDefault(1);
this.add(ruleNewParam, context);
passRuleResult = this.acsPassRuleDao.page(dto, page);
}
List<AcsPassRuleResult> results = this.coverRulePageResult((List)passRuleResult.getDatas(), context, true);
return CloudwalkResult.success((Object)new CloudwalkPageAble(results, page, passRuleResult.getTotalRows()));
}
catch (DataAccessException e) {
this.logger.error("\u5206\u9875\u67e5\u8be2\u901a\u884c\u89c4\u5219\u5931\u8d25");
throw new ServiceException("76260508", this.getMessage("76260508"));
}
}
@Override
public CloudwalkResult<List<AcsPassRuleResult>> list(AcsPassRuleQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleQueryDto dto = new AcsPassRuleQueryDto();
BeanCopyUtils.copyProperties((Object)param, (Object)dto);
dto.setBusinessId(context.getCompany().getCompanyId());
List passRuleResult = this.acsPassRuleDao.list(dto);
return CloudwalkResult.success(this.coverRulePageResult(passRuleResult, context, false));
}
catch (DataAccessException e) {
this.logger.error("\u67e5\u8be2\u901a\u884c\u89c4\u5219\u5931\u8d25");
throw new ServiceException("76260508", this.getMessage("76260508"));
}
}
@Override
public CloudwalkResult<List<AcsPassRuleImageResultDto>> listByImageId(AcsPassRuleImageParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
BeanCopyUtils.copyProperties((Object)param, (Object)dto);
List resultDtos = this.acsPassRuleDao.listByImageId(dto);
return CloudwalkResult.success((Object)resultDtos);
}
catch (DataAccessException e) {
this.logger.error("\u6839\u636e\u56fe\u5e93id\u96c6\u5408\u67e5\u8be2\u5bf9\u5e94\u697c\u5c42\u4fe1\u606f\u5931\u8d25");
throw new ServiceException("76260526", this.getMessage("76260526"));
}
}
private void getZoneTypeIsThree(ZoneTreeResult zoneTreeResult, List<AcsPassRuleFloorResult> passRuleResults) {
if ("FLOOR".equals(zoneTreeResult.getType())) {
AcsPassRuleFloorResult result = new AcsPassRuleFloorResult();
result.setId(zoneTreeResult.getId());
result.setName(zoneTreeResult.getName());
result.setUnitNumber(zoneTreeResult.getUnitCount());
passRuleResults.add(result);
} else if (!CollectionUtils.isEmpty(zoneTreeResult.getChildren())) {
for (ZoneTreeResult treeResult : zoneTreeResult.getChildren()) {
this.getZoneTypeIsThree(treeResult, passRuleResults);
}
}
}
}
@@ -0,0 +1,797 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreEditParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonData
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.UpdateGroupPersonRefParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreDetailResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.label.param.LabelDetailParam
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelDetailResult
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult
* cn.cloudwalk.client.cwoscomponent.intelligent.label.service.LabelService
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.param.OrganizationListParam
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.service.OrganizationService
* cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.DataAccessException
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao
* cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto
* cn.cloudwalk.elevator.em.AcsPassTypeEnum
* cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRulePersonListDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRulePersonListResultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto
* cn.cloudwalk.elevator.passrule.dto.ImageRuleRefAddDto
* cn.cloudwalk.elevator.passrule.dto.ImageRuleRefListResult
* cn.cloudwalk.elevator.passrule.dto.ImageRuleRefResultDto
* cn.cloudwalk.elevator.util.CollectionUtils
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.stereotype.Service
* org.springframework.transaction.annotation.Propagation
* org.springframework.transaction.annotation.Transactional
* org.springframework.util.ObjectUtils
*/
package cn.cloudwalk.elevator.passrule.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreEditParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonData;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.UpdateGroupPersonRefParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreDetailResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.param.LabelDetailParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelDetailResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.service.LabelService;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.param.OrganizationListParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.service.OrganizationService;
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
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.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao;
import cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListDto;
import cn.cloudwalk.elevator.em.AcsPassTypeEnum;
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.AcsPassRulePersonListDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRulePersonListResultDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto;
import cn.cloudwalk.elevator.passrule.dto.ImageRuleRefAddDto;
import cn.cloudwalk.elevator.passrule.dto.ImageRuleRefListResult;
import cn.cloudwalk.elevator.passrule.dto.ImageRuleRefResultDto;
import cn.cloudwalk.elevator.passrule.impl.AbstractAcsPassService;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleDeleteParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleEditParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleFloorParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleImageParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleNewParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRulePersonListParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleQueryParam;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleFloorResult;
import cn.cloudwalk.elevator.passrule.result.ImageRuleRefDetailResult;
import cn.cloudwalk.elevator.passrule.result.ImageRuleRefPageResult;
import cn.cloudwalk.elevator.passrule.service.ImageRuleRefService;
import cn.cloudwalk.elevator.person.param.AcsPersonQueryParam;
import cn.cloudwalk.elevator.person.result.AcsPersonResult;
import cn.cloudwalk.elevator.person.service.PersonRuleService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.zone.param.ZoneQueryParam;
import cn.cloudwalk.elevator.zone.result.ZoneResult;
import cn.cloudwalk.elevator.zone.service.ZoneService;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@Service
public class ImageRuleRefServiceImpl
extends AbstractAcsPassService
implements ImageRuleRefService {
@Autowired
private ImageStorePersonService imageStorePersonService;
@Autowired
private OrganizationService organizationService;
@Autowired
private LabelService labelService;
@Resource
private ImageRuleRefDao imageRuleRefDao;
@Resource
private DeviceImageStoreDao deviceImageStoreDao;
@Resource
private ImageStoreService imageStoreService;
@Resource
private ZoneService zoneService;
@Resource
private AcsElevatorDeviceDao acsElevatorDeviceDao;
@Resource
private PersonRuleService personRuleService;
@Override
public CloudwalkResult<CloudwalkPageAble<ImageRuleRefPageResult>> page(AcsPassRuleQueryParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleQueryDto dto = new AcsPassRuleQueryDto();
dto.setZoneId(param.getZoneId());
dto.setBusinessId(context.getCompany().getCompanyId());
CloudwalkPageAble passRuleResult = this.imageRuleRefDao.page(dto, page);
if (CollectionUtils.isEmpty((Collection)passRuleResult.getDatas()) && ObjectUtils.isEmpty((Object)param.getIsDefault())) {
AcsPassRuleNewParam ruleNewParam = new AcsPassRuleNewParam();
ruleNewParam.setZoneId(param.getZoneId());
ruleNewParam.setZoneName(param.getZoneName());
ruleNewParam.setRuleName("\u9ed8\u8ba4\u89c4\u5219");
ruleNewParam.setIsDefault(1);
ruleNewParam.setParentId(param.getParentId());
this.addOnlyRule(ruleNewParam, context);
passRuleResult = this.imageRuleRefDao.page(dto, page);
}
List<ImageRuleRefPageResult> results = this.coverRulePageResult((List)passRuleResult.getDatas(), param.getParentId(), context);
return CloudwalkResult.success((Object)new CloudwalkPageAble(results, page, passRuleResult.getTotalRows()));
}
catch (Exception e) {
this.logger.error("\u5206\u9875\u67e5\u8be2\u901a\u884c\u89c4\u5219\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260508", this.getMessage("76260508"));
}
}
@Override
public CloudwalkResult<CloudwalkPageAble<AcsPassRuleFloorResult>> listFloor(AcsPassRuleFloorParam param, CloudwalkCallContext context) throws ServiceException {
ZoneQueryParam queryParam = new ZoneQueryParam();
queryParam.setParentId(param.getZoneId());
queryParam.setRowsOfPage(param.getRowsOfPage());
queryParam.setCurrentPage(param.getCurrentPage());
CloudwalkResult<CloudwalkPageAble<ZoneResult>> zonePageData = this.zoneService.page(queryParam, context);
if (!zonePageData.isSuccess()) {
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u5206\u9875\u67e5\u8be2\u533a\u57df\u5931\u8d25,\u539f\u56e0\uff1a" + zonePageData.getMessage());
throw new ServiceException(zonePageData.getCode(), zonePageData.getMessage());
}
try {
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
CloudwalkPageAble ruleFloorResult = null;
if (!ObjectUtils.isEmpty((Object)zonePageData.getData()) && !CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)zonePageData.getData()).getDatas())) {
List resultList = BeanCopyUtils.copy((Collection)((CloudwalkPageAble)zonePageData.getData()).getDatas(), AcsPassRuleFloorResult.class);
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getZoneId());
for (AcsPassRuleFloorResult floorResult : resultList) {
AcsElevatorDeviceListDto dto = new AcsElevatorDeviceListDto();
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setCurrentFloorId(floorResult.getId());
List deviceList = this.acsElevatorDeviceDao.listByZoneId(dto);
floorResult.setDeviceNumber(deviceList.size());
Long number = 0L;
floorResult.setPersonNumber(number);
if (ObjectUtils.isEmpty((Object)imageStoreId)) continue;
AcsPersonQueryParam personQueryParam = new AcsPersonQueryParam();
personQueryParam.setImageStoreId(imageStoreId);
personQueryParam.setZoneId(floorResult.getId());
personQueryParam.setParentId(param.getZoneId());
CloudwalkPageInfo pageInfo = new CloudwalkPageInfo(1, 10);
CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> result = this.personRuleService.page(personQueryParam, pageInfo, context);
floorResult.setPersonNumber(((CloudwalkPageAble)result.getData()).getTotalRows());
}
ruleFloorResult = new CloudwalkPageAble((Collection)resultList, page, ((CloudwalkPageAble)zonePageData.getData()).getTotalRows());
}
return CloudwalkResult.success(ruleFloorResult);
}
catch (DataAccessException e) {
this.logger.error("\u67e5\u8be2\u6240\u6709\u697c\u5c42\u4fe1\u606f\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260520", this.getMessage("76260520"));
}
}
@Override
public CloudwalkResult<List<AcsPassRuleImageResultDto>> listByPersonInfo(AcsPassRuleImageParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleImageDto dto = new AcsPassRuleImageDto();
BeanCopyUtils.copyProperties((Object)param, (Object)dto);
List resultDtos = this.imageRuleRefDao.listByPersonInfo(dto);
return CloudwalkResult.success((Object)resultDtos);
}
catch (DataAccessException e) {
this.logger.error("\u6839\u636e\u4eba\u5458id\u3001\u6807\u7b7e\u96c6\u5408\u3001\u673a\u6784\u96c6\u5408\u83b7\u53d6\u697c\u5c42\u6743\u9650\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260526", this.getMessage("76260526"));
}
}
@Override
public CloudwalkResult<List<AcsPassRulePersonListResultDto>> listByPersonList(AcsPassRulePersonListParam param, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRulePersonListDto dto = new AcsPassRulePersonListDto();
ArrayList<String> personIds = new ArrayList<String>();
ArrayList<String> labelIds = new ArrayList<String>();
ArrayList<String> orgIds = new ArrayList<String>();
for (AcsPassRuleImageParam imageParam : param.getPersonList()) {
personIds.add(imageParam.getPersonId());
if (!CollectionUtils.isEmpty(imageParam.getIncludeLabels())) {
labelIds.addAll(imageParam.getIncludeLabels());
}
if (CollectionUtils.isEmpty(imageParam.getIncludeOrganizations())) continue;
orgIds.addAll(imageParam.getIncludeOrganizations());
}
dto.setPersonIds(personIds);
dto.setIncludeLabels(labelIds);
dto.setIncludeOrganizations(orgIds);
List resultDtos = this.imageRuleRefDao.listByPersonList(dto);
HashMap personIdMap = new HashMap();
HashMap labelIdMap = new HashMap();
HashMap orgIdMap = new HashMap();
for (ImageRuleRefResultDto resultDto : resultDtos) {
if (!ObjectUtils.isEmpty((Object)resultDto.getPersonId())) {
List personList = (List)personIdMap.get(resultDto.getPersonId());
if (!CollectionUtils.isEmpty((Collection)personList)) {
personList.add(resultDto);
continue;
}
ArrayList<ImageRuleRefResultDto> personListDto = new ArrayList<ImageRuleRefResultDto>();
personListDto.add(resultDto);
personIdMap.put(resultDto.getPersonId(), personListDto);
continue;
}
if (!ObjectUtils.isEmpty((Object)resultDto.getIncludeLabels())) {
List labelList = (List)labelIdMap.get(resultDto.getIncludeLabels());
if (!CollectionUtils.isEmpty((Collection)labelList)) {
labelList.add(resultDto);
continue;
}
ArrayList<ImageRuleRefResultDto> labelListDto = new ArrayList<ImageRuleRefResultDto>();
labelListDto.add(resultDto);
labelIdMap.put(resultDto.getIncludeLabels(), labelListDto);
continue;
}
if (ObjectUtils.isEmpty((Object)resultDto.getIncludeOrganizations())) continue;
List orgList = (List)orgIdMap.get(resultDto.getIncludeOrganizations());
if (!CollectionUtils.isEmpty((Collection)orgList)) {
orgList.add(resultDto);
continue;
}
ArrayList<ImageRuleRefResultDto> orgListDto = new ArrayList<ImageRuleRefResultDto>();
orgListDto.add(resultDto);
orgIdMap.put(resultDto.getIncludeOrganizations(), orgListDto);
}
ArrayList<AcsPassRulePersonListResultDto> returnList = new ArrayList<AcsPassRulePersonListResultDto>();
for (AcsPassRuleImageParam imageParam : param.getPersonList()) {
AcsPassRuleImageResultDto result;
List zoneIdList = this.imageRuleRefDao.listPersonDelByPersonId(imageParam.getPersonId());
AcsPassRulePersonListResultDto listResultDto = new AcsPassRulePersonListResultDto();
listResultDto.setPersonId(imageParam.getPersonId());
ArrayList<AcsPassRuleImageResultDto> zoneList = new ArrayList<AcsPassRuleImageResultDto>();
ArrayList<String> listZoneIds = new ArrayList<String>();
List personMapDto = (List)personIdMap.get(imageParam.getPersonId());
if (!CollectionUtils.isEmpty((Collection)personMapDto)) {
for (ImageRuleRefResultDto resultDto : personMapDto) {
if (zoneIdList.contains(resultDto.getZoneId())) continue;
listZoneIds.add(resultDto.getZoneId());
AcsPassRuleImageResultDto result2 = new AcsPassRuleImageResultDto();
result2.setZoneId(resultDto.getZoneId());
result2.setZoneName(resultDto.getZoneName());
zoneList.add(result2);
}
}
if (!CollectionUtils.isEmpty(imageParam.getIncludeLabels())) {
for (String labelId : imageParam.getIncludeLabels()) {
List labelMapDto = (List)labelIdMap.get(labelId);
if (CollectionUtils.isEmpty((Collection)labelMapDto)) continue;
for (ImageRuleRefResultDto resultDto : labelMapDto) {
if (zoneIdList.contains(resultDto.getZoneId()) || listZoneIds.contains(resultDto.getZoneId())) continue;
listZoneIds.add(resultDto.getZoneId());
result = new AcsPassRuleImageResultDto();
result.setZoneId(resultDto.getZoneId());
result.setZoneName(resultDto.getZoneName());
zoneList.add(result);
}
}
}
if (!CollectionUtils.isEmpty(imageParam.getIncludeOrganizations())) {
for (String orgId : imageParam.getIncludeOrganizations()) {
List orgMapDto = (List)orgIdMap.get(orgId);
if (CollectionUtils.isEmpty((Collection)orgMapDto)) continue;
for (ImageRuleRefResultDto resultDto : orgMapDto) {
if (zoneIdList.contains(resultDto.getZoneId()) || listZoneIds.contains(resultDto.getZoneId())) continue;
listZoneIds.add(resultDto.getZoneId());
result = new AcsPassRuleImageResultDto();
result.setZoneId(resultDto.getZoneId());
result.setZoneName(resultDto.getZoneName());
zoneList.add(result);
}
}
}
listResultDto.setZoneList(zoneList);
returnList.add(listResultDto);
}
return CloudwalkResult.success(returnList);
}
catch (DataAccessException e) {
this.logger.error("\u6839\u636e\u4eba\u5458id\u3001\u6807\u7b7e\u96c6\u5408\u3001\u673a\u6784\u96c6\u5408\u6279\u91cf\u83b7\u53d6\u697c\u5c42\u6743\u9650\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260526", this.getMessage("76260526"));
}
}
@Override
public CloudwalkResult<ImageRuleRefDetailResult> detail(AcsPassRuleQueryParam param, CloudwalkCallContext context) throws ServiceException {
try {
ImageRuleRefResultDto byId = this.imageRuleRefDao.getById(param.getId());
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
List child = this.imageRuleRefDao.listByParentRule(Collections.singletonList(param.getId()));
if (!CollectionUtils.isEmpty((Collection)child)) {
for (ImageRuleRefResultDto resultDto : child) {
if (!ObjectUtils.isEmpty((Object)resultDto.getIncludeLabels())) {
includeLabels.add(resultDto.getIncludeLabels());
continue;
}
if (ObjectUtils.isEmpty((Object)resultDto.getIncludeOrganizations())) continue;
includeOrganizations.add(resultDto.getIncludeOrganizations());
}
}
ImageRuleRefDetailResult result = (ImageRuleRefDetailResult)BeanCopyUtils.copyProperties((Object)byId, ImageRuleRefDetailResult.class);
result.setRuleName(byId.getName());
if (!CollectionUtils.isEmpty(includeLabels)) {
ArrayList<LabelDetailResult> labelDetailResultList = new ArrayList<LabelDetailResult>();
for (String label : includeLabels) {
LabelDetailParam labelDetailParam = new LabelDetailParam();
labelDetailParam.setId(label);
CloudwalkResult detail = this.labelService.detail(labelDetailParam, context);
labelDetailResultList.add((LabelDetailResult)detail.getData());
}
result.setIncludeLabels(labelDetailResultList);
}
if (!CollectionUtils.isEmpty(includeOrganizations)) {
OrganizationListParam orgParam = new OrganizationListParam();
orgParam.setIds(includeOrganizations);
CloudwalkResult orglist = this.organizationService.list(orgParam, context);
result.setIncludeOrganizations((List)orglist.getData());
}
return CloudwalkResult.success((Object)result);
}
catch (DataAccessException e) {
this.logger.error("\u67e5\u8be2\u901a\u884c\u89c4\u5219\u8be6\u60c5\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260508", this.getMessage("76260508"));
}
}
@Override
@CloudwalkParamsValidate(argsIndexs={0, 1})
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class})
public CloudwalkResult<Boolean> addOnlyRule(AcsPassRuleNewParam param, CloudwalkCallContext context) throws ServiceException {
try {
ImageRuleRefAddDto dto;
AcsElevatorDeviceListByBuildingIdDto buildingIdDto = new AcsElevatorDeviceListByBuildingIdDto();
buildingIdDto.setCurrentBuildingId(param.getParentId());
buildingIdDto.setBusinessId(context.getCompany().getCompanyId());
List deviceList = this.acsElevatorDeviceDao.listBuBuildingId(buildingIdDto);
if (CollectionUtils.isEmpty((Collection)deviceList)) {
return CloudwalkResult.fail((String)"76260527", (String)this.getMessage("76260527"));
}
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
ImageRuleRefAddDto addDto = this.createAddDto(param, context);
this.imageRuleRefDao.insert(addDto);
if (!ObjectUtils.isEmpty((Object)param.getIsDefault()) && param.getIsDefault() == 1) {
return CloudwalkResult.success((Object)true);
}
ImageStoreQueryParam queryParam = new ImageStoreQueryParam();
queryParam.setId(imageStoreId);
queryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult imageDetail = this.imageStoreService.detail(queryParam, context);
ImageStoreEditParam editParam = (ImageStoreEditParam)BeanCopyUtils.copyProperties((Object)imageDetail.getData(), ImageStoreEditParam.class);
editParam.setImageStoreId(((ImageStoreDetailResult)imageDetail.getData()).getId());
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getIncludePersons())) {
ArrayList<ImageStorePersonData> includePersons = new ArrayList<ImageStorePersonData>();
for (ImgStorePersonResult personResult : ((ImageStoreDetailResult)imageDetail.getData()).getIncludePersons()) {
ImageStorePersonData data = new ImageStorePersonData();
data.setObjectId(personResult.getId());
includePersons.add(data);
}
editParam.setIncludePersons(includePersons);
}
ArrayList<String> oldIncludeLabels = new ArrayList<String>();
ArrayList<String> oldIncludeOrganizations = new ArrayList<String>();
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getIncludeLabels())) {
for (LabelResult labelResult : ((ImageStoreDetailResult)imageDetail.getData()).getIncludeLabels()) {
oldIncludeLabels.add(labelResult.getId());
}
}
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getIncludeOrganizations())) {
for (OrganizationResult organizationResult : ((ImageStoreDetailResult)imageDetail.getData()).getIncludeOrganizations()) {
oldIncludeOrganizations.add(organizationResult.getId());
}
}
if (!CollectionUtils.isEmpty(param.getIncludeLabels())) {
for (String label : param.getIncludeLabels()) {
dto = this.createAddDto(param, context);
dto.setParentRule(addDto.getId());
dto.setIncludeLabels(label);
this.imageRuleRefDao.insert(dto);
if (oldIncludeLabels.contains(label)) continue;
includeLabels.add(label);
}
}
if (!CollectionUtils.isEmpty(param.getIncludeOrganizations())) {
for (String org : param.getIncludeOrganizations()) {
dto = this.createAddDto(param, context);
dto.setParentRule(addDto.getId());
dto.setIncludeOrganizations(org);
this.imageRuleRefDao.insert(dto);
if (oldIncludeOrganizations.contains(org)) continue;
includeOrganizations.add(org);
}
}
if (!CollectionUtils.isEmpty(includeLabels) || !CollectionUtils.isEmpty(includeOrganizations)) {
CloudwalkResult edit;
includeLabels.addAll(oldIncludeLabels);
includeOrganizations.addAll(oldIncludeOrganizations);
editParam.setIncludeLabels(includeLabels);
editParam.setIncludeOrganizations(includeOrganizations);
editParam.setBusinessId(context.getCompany().getCompanyId());
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getExcludePersons())) {
ArrayList<String> excPersonIds = new ArrayList<String>();
for (ImgStorePersonResult personResult : ((ImageStoreDetailResult)imageDetail.getData()).getExcludePersons()) {
excPersonIds.add(personResult.getId());
}
editParam.setExcludePersons(excPersonIds);
}
if (ObjectUtils.isEmpty((Object)(edit = this.imageStoreService.edit(editParam, context)).getData()) || !((Boolean)edit.getData()).booleanValue()) {
throw new ServiceException(edit.getCode(), edit.getMessage());
}
}
UpdateGroupPersonRefParam refParam = new UpdateGroupPersonRefParam();
refParam.setImageStoreId(imageStoreId);
refParam.setBusinessId(context.getCompany().getCompanyId());
refParam.setLabelIds(param.getIncludeLabels());
refParam.setOrganizationIds(param.getIncludeOrganizations());
this.imageStorePersonService.updateGroupPersonRef(refParam, context);
return CloudwalkResult.success((Object)true);
}
catch (DataAccessException e) {
this.logger.error("\u6dfb\u52a0\u901a\u884c\u89c4\u5219\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260505", this.getMessage("76260505"));
}
}
@Override
public CloudwalkResult<Boolean> update(AcsPassRuleEditParam param, CloudwalkCallContext context) throws ServiceException {
this.checkDefaultRule(param.getId());
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
ImageStoreQueryParam queryParam = new ImageStoreQueryParam();
queryParam.setId(imageStoreId);
queryParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult imageDetail = this.imageStoreService.detail(queryParam, context);
ImageStoreEditParam editParam = (ImageStoreEditParam)BeanCopyUtils.copyProperties((Object)imageDetail.getData(), ImageStoreEditParam.class);
editParam.setImageStoreId(imageStoreId);
ArrayList<String> oldIncludeLabels = new ArrayList<String>();
ArrayList<String> oldIncludeOrganizations = new ArrayList<String>();
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
ArrayList<String> includeLabels2 = new ArrayList<String>();
ArrayList<String> includeOrganizations2 = new ArrayList<String>();
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getIncludeLabels())) {
for (LabelResult labelResult : ((ImageStoreDetailResult)imageDetail.getData()).getIncludeLabels()) {
oldIncludeLabels.add(labelResult.getId());
}
}
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getIncludeOrganizations())) {
for (OrganizationResult organizationResult : ((ImageStoreDetailResult)imageDetail.getData()).getIncludeOrganizations()) {
oldIncludeOrganizations.add(organizationResult.getId());
}
}
try {
ImageRuleRefAddDto dto;
List oldRule = this.imageRuleRefDao.listByParentRule(Collections.singletonList(param.getId()));
ArrayList<String> updateLabels = new ArrayList<String>(param.getIncludeLabels());
ArrayList<String> updateOrgIds = new ArrayList<String>(param.getIncludeOrganizations());
Boolean isTrue = true;
if (!CollectionUtils.isEmpty((Collection)oldRule)) {
for (Object dto2 : oldRule) {
if (!ObjectUtils.isEmpty((Object)dto2.getIncludeLabels()) && !updateLabels.contains(dto2.getIncludeLabels())) {
updateLabels.add(dto2.getIncludeLabels());
isTrue = false;
}
if (ObjectUtils.isEmpty((Object)dto2.getIncludeOrganizations()) || updateOrgIds.contains(dto2.getIncludeOrganizations())) continue;
updateOrgIds.add(dto2.getIncludeOrganizations());
isTrue = false;
}
}
this.imageRuleRefDao.deleteById(param.getId());
ImageRuleRefAddDto addDto = this.createUpdateDto(param, context);
this.imageRuleRefDao.insert(addDto);
if (!CollectionUtils.isEmpty(param.getIncludeLabels())) {
for (String label : param.getIncludeLabels()) {
dto = this.createUpdateDto(param, context);
dto.setIncludeLabels(label);
dto.setParentRule(addDto.getId());
this.imageRuleRefDao.insert(dto);
if (editParam.getIncludeLabels().contains(label)) continue;
includeLabels.add(label);
includeLabels2.add(label);
}
}
if (!CollectionUtils.isEmpty(param.getExcludeLabels())) {
for (String label : param.getExcludeLabels()) {
dto = this.createUpdateDto(param, context);
dto.setExcludeLabels(label);
dto.setParentRule(addDto.getId());
this.imageRuleRefDao.insert(dto);
}
}
if (!CollectionUtils.isEmpty(param.getIncludeOrganizations())) {
for (String org : param.getIncludeOrganizations()) {
dto = this.createUpdateDto(param, context);
dto.setIncludeOrganizations(org);
dto.setParentRule(addDto.getId());
this.imageRuleRefDao.insert(dto);
if (editParam.getIncludeOrganizations().contains(org)) continue;
includeOrganizations.add(org);
includeOrganizations2.add(org);
}
}
if (!CollectionUtils.isEmpty(includeLabels) || !CollectionUtils.isEmpty(includeOrganizations)) {
CloudwalkResult includePersons;
includeLabels.addAll(oldIncludeLabels);
includeOrganizations.addAll(oldIncludeOrganizations);
editParam.setIncludeLabels(includeLabels);
editParam.setIncludeOrganizations(includeOrganizations);
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getExcludePersons())) {
ArrayList<String> excPersonIds = new ArrayList<String>();
for (ImgStorePersonResult personResult : ((ImageStoreDetailResult)imageDetail.getData()).getExcludePersons()) {
excPersonIds.add(personResult.getId());
}
editParam.setExcludePersons(excPersonIds);
}
if (!CollectionUtils.isEmpty((Collection)((ImageStoreDetailResult)imageDetail.getData()).getIncludePersons())) {
includePersons = new ArrayList();
for (ImgStorePersonResult personResult : ((ImageStoreDetailResult)imageDetail.getData()).getIncludePersons()) {
ImageStorePersonData personData = new ImageStorePersonData();
personData.setObjectId(personResult.getId());
includePersons.add(personData);
}
editParam.setIncludePersons((List)includePersons);
}
editParam.setBusinessId(context.getCompany().getCompanyId());
includePersons = this.imageStoreService.edit(editParam, context);
}
if (!isTrue.booleanValue()) {
UpdateGroupPersonRefParam refParam = new UpdateGroupPersonRefParam();
refParam.setImageStoreId(imageStoreId);
refParam.setBusinessId(context.getCompany().getCompanyId());
refParam.setLabelIds(updateLabels);
refParam.setOrganizationIds(updateOrgIds);
this.imageStorePersonService.updateGroupPersonRef(refParam, context);
}
return CloudwalkResult.success((Object)true);
}
catch (DataAccessException e) {
this.logger.error("\u6dfb\u52a0\u901a\u884c\u89c4\u5219\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260505", this.getMessage("76260505"));
}
}
@Override
public CloudwalkResult<Boolean> delete(AcsPassRuleDeleteParam param, CloudwalkCallContext context) throws ServiceException {
try {
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
for (String id : param.getIds()) {
this.checkDefaultRule(id);
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
List child = this.imageRuleRefDao.listByParentRule(Collections.singletonList(id));
if (!CollectionUtils.isEmpty((Collection)child)) {
for (ImageRuleRefResultDto resultDto : child) {
if (!ObjectUtils.isEmpty((Object)resultDto.getIncludeLabels())) {
includeLabels.add(resultDto.getIncludeLabels());
continue;
}
if (ObjectUtils.isEmpty((Object)resultDto.getIncludeOrganizations())) continue;
includeOrganizations.add(resultDto.getIncludeOrganizations());
}
}
this.imageRuleRefDao.deleteById(id);
UpdateGroupPersonRefParam refParam = new UpdateGroupPersonRefParam();
refParam.setBusinessId(context.getCompany().getCompanyId());
refParam.setImageStoreId(imageStoreId);
refParam.setLabelIds(includeLabels);
refParam.setOrganizationIds(includeOrganizations);
this.imageStorePersonService.updateGroupPersonRef(refParam, context);
}
return CloudwalkResult.success((Object)true);
}
catch (DataAccessException e) {
this.logger.error("\u901a\u884c\u89c4\u5219\u5220\u9664\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260507", this.getMessage("76260507"));
}
}
private List<ImageRuleRefPageResult> coverRulePageResult(List<ImageRuleRefResultDto> datas, String parentId, CloudwalkCallContext context) throws Exception {
ArrayList<ImageRuleRefPageResult> detailResultList = new ArrayList<ImageRuleRefPageResult>();
if (CollectionUtils.isEmpty(datas)) {
return detailResultList;
}
List personSum = this.imageRuleRefDao.countPersonIdByZoneId(datas.get(0).getZoneId());
for (ImageRuleRefResultDto data : datas) {
ImageRuleRefPageResult detailResult = new ImageRuleRefPageResult();
AcsPersonQueryParam personQueryParam = new AcsPersonQueryParam();
BeanCopyUtils.copyProperties((Object)data, (Object)detailResult);
detailResult.setRuleName(data.getName());
detailResult.setPassType(AcsPassTypeEnum.LONG_TIME.getCode());
if (data.getIsDefault() == 1) {
detailResult.setPersonSum(personSum.size());
} else {
personQueryParam.setDelPersonIds(personSum);
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
List child = this.imageRuleRefDao.listByParentRule(Collections.singletonList(data.getId()));
if (!CollectionUtils.isEmpty((Collection)child)) {
for (ImageRuleRefResultDto resultDto : child) {
if (!ObjectUtils.isEmpty((Object)resultDto.getIncludeLabels())) {
includeLabels.add(resultDto.getIncludeLabels());
continue;
}
if (ObjectUtils.isEmpty((Object)resultDto.getIncludeOrganizations())) continue;
includeOrganizations.add(resultDto.getIncludeOrganizations());
}
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(parentId);
personQueryParam.setImageStoreId(imageStoreId);
personQueryParam.setLabelIds(includeLabels);
personQueryParam.setOrganizationIds(includeOrganizations);
if (!CollectionUtils.isEmpty(personQueryParam.getOrganizationIds()) && !CollectionUtils.isEmpty(personQueryParam.getLabelIds())) {
personQueryParam.setIsElevator(3);
} else if (!CollectionUtils.isEmpty(personQueryParam.getOrganizationIds())) {
personQueryParam.setIsElevator(1);
} else if (!CollectionUtils.isEmpty(personQueryParam.getLabelIds())) {
personQueryParam.setIsElevator(2);
}
CloudwalkPageInfo page = new CloudwalkPageInfo(1, 10);
CloudwalkPageAble<ImageStorePersonResult> pageResult = this.getImageStorePerson(personQueryParam, page, context);
List delPerson = this.imageRuleRefDao.listPersonDelByZoneId(data.getZoneId());
if (!ObjectUtils.isEmpty((Object)pageResult.getDatas())) {
detailResult.setPersonSum(Math.toIntExact(pageResult.getTotalRows()) - delPerson.size());
} else {
detailResult.setPersonSum(0);
}
if (!CollectionUtils.isEmpty(includeLabels)) {
ArrayList<LabelDetailResult> labelDetailResultList = new ArrayList<LabelDetailResult>();
for (String label : includeLabels) {
LabelDetailParam param = new LabelDetailParam();
param.setId(label);
CloudwalkResult detail = this.labelService.detail(param, context);
labelDetailResultList.add((LabelDetailResult)detail.getData());
}
detailResult.setIncludeLabels(labelDetailResultList);
}
if (!CollectionUtils.isEmpty(includeOrganizations)) {
OrganizationListParam orgParam = new OrganizationListParam();
orgParam.setIds(includeOrganizations);
CloudwalkResult orglist = this.organizationService.list(orgParam, context);
detailResult.setIncludeOrganizations((List)orglist.getData());
}
}
}
detailResultList.add(detailResult);
}
return detailResultList;
}
private CloudwalkPageAble<ImageStorePersonResult> getImageStorePerson(AcsPersonQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
CloudwalkPageAble results = new CloudwalkPageAble();
ImageStorePersonQueryParam imageStorePersonQueryParam = new ImageStorePersonQueryParam();
imageStorePersonQueryParam.setImageStoreId(param.getImageStoreId());
imageStorePersonQueryParam.setOrganizationIds(param.getOrganizationIds());
imageStorePersonQueryParam.setLabelIds(param.getLabelIds());
imageStorePersonQueryParam.setCurrentPage(pageInfo.getCurrentPage());
imageStorePersonQueryParam.setRowsOfPage(pageInfo.getPageSize());
imageStorePersonQueryParam.setIsElevator(param.getIsElevator());
imageStorePersonQueryParam.setDelPersonIds(param.getDelPersonIds());
CloudwalkResult pageResult = this.imageStorePersonService.page(imageStorePersonQueryParam, context);
if (!pageResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u56fe\u5e93\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Object)pageResult.getMessage());
throw new ServiceException(pageResult.getCode(), pageResult.getMessage());
}
if (!CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)pageResult.getData()).getDatas())) {
results = (CloudwalkPageAble)pageResult.getData();
}
return results;
}
private ImageRuleRefListResult refListByZoneId(String zoneId) {
List child;
ImageRuleRefListResult listResult = new ImageRuleRefListResult();
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
List parentRuleList = this.imageRuleRefDao.listRuleByZoneIdExtDefault(zoneId);
if (!CollectionUtils.isEmpty((Collection)parentRuleList) && !CollectionUtils.isEmpty((Collection)(child = this.imageRuleRefDao.listByParentRule(parentRuleList)))) {
for (ImageRuleRefResultDto resultDto : child) {
if (!ObjectUtils.isEmpty((Object)resultDto.getIncludeLabels())) {
includeLabels.add(resultDto.getExcludeLabels());
continue;
}
if (ObjectUtils.isEmpty((Object)resultDto.getIncludeOrganizations())) continue;
includeOrganizations.add(resultDto.getIncludeOrganizations());
}
}
listResult.setIncludeLabels(includeLabels);
listResult.setIncludeOrganizations(includeOrganizations);
return listResult;
}
private ImageRuleRefAddDto createAddDto(AcsPassRuleNewParam param, CloudwalkCallContext context) {
ImageRuleRefAddDto dto = new ImageRuleRefAddDto();
dto.setId(this.genUUID());
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setName(param.getRuleName());
dto.setZoneId(param.getZoneId());
dto.setZoneName(param.getZoneName());
dto.setStartTime(param.getStartTime());
dto.setEndTime(param.getEndTime());
if (!ObjectUtils.isEmpty((Object)param.getIsDefault())) {
dto.setIsDefault(param.getIsDefault());
} else {
dto.setIsDefault(Integer.valueOf(0));
}
dto.setCreateTime(Long.valueOf(System.currentTimeMillis()));
dto.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
return dto;
}
private ImageRuleRefAddDto createUpdateDto(AcsPassRuleEditParam param, CloudwalkCallContext context) {
ImageRuleRefAddDto dto = new ImageRuleRefAddDto();
dto.setId(this.genUUID());
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setName(param.getRuleName());
dto.setZoneId(param.getZoneId());
dto.setZoneName(param.getZoneName());
dto.setStartTime(param.getStartTime());
dto.setEndTime(param.getEndTime());
dto.setCreateTime(Long.valueOf(System.currentTimeMillis()));
dto.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
dto.setIsDefault(Integer.valueOf(0));
return dto;
}
private ImageRuleRefResultDto checkDefaultRule(String id) throws ServiceException {
try {
ImageRuleRefResultDto resultDto = this.imageRuleRefDao.getById(id);
if (!ObjectUtils.isEmpty((Object)resultDto.getIsDefault()) && resultDto.getIsDefault() == 1) {
throw new ServiceException("\u6d3e\u68af\u9ed8\u8ba4\u89c4\u5219\u4e0d\u53ef\u7f16\u8f91\u548c\u5220\u9664");
}
return resultDto;
}
catch (DataAccessException e) {
throw new ServiceException("\u6d3e\u68af\u9ed8\u8ba4\u89c4\u5219\u4e0d\u53ef\u7f16\u8f91\u548c\u5220\u9664");
}
}
}
@@ -0,0 +1,45 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotEmpty
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
import java.util.List;
import org.hibernate.validator.constraints.NotEmpty;
public class AcsPassRuleDeleteParam
implements Serializable {
private static final long serialVersionUID = -40026518356914854L;
@NotEmpty(message="76260515")
private List<String> ids;
private String zoneId;
private String parentId;
public List<String> getIds() {
return this.ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
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;
}
}
@@ -0,0 +1,121 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.validation.constraints.Size
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPassRuleEditParam
implements Serializable {
private static final long serialVersionUID = 924203126937866288L;
@NotBlank(message="76260515")
private String id;
private String parentId;
private String zoneId;
private String zoneName;
@NotBlank(message="76260514")
@Size(min=1, max=32, message="76260518")
private String ruleName;
private String oldName;
private List<String> includeOrganizations;
private List<String> includeLabels;
private List<String> excludeLabels;
private Long startTime;
private Long endTime;
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getOldName() {
return this.oldName;
}
public void setOldName(String oldName) {
this.oldName = oldName;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getZoneName() {
return this.zoneName;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public String getRuleName() {
return this.ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public List<String> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<String> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<String> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<String> includeLabels) {
this.includeLabels = includeLabels;
}
public List<String> getExcludeLabels() {
return this.excludeLabels;
}
public void setExcludeLabels(List<String> excludeLabels) {
this.excludeLabels = excludeLabels;
}
public Long getStartTime() {
return this.startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return this.endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
}
@@ -0,0 +1,26 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.page.CloudwalkBasePageForm
*/
package cn.cloudwalk.elevator.passrule.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class AcsPassRuleFloorParam
extends CloudwalkBasePageForm
implements Serializable {
private static final long serialVersionUID = 137892620174267456L;
private String zoneId;
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
}
@@ -0,0 +1,58 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
import java.util.List;
public class AcsPassRuleImageParam
implements Serializable {
private static final long serialVersionUID = -52687427633888290L;
private List<String> imageStoreIds;
private String businessId;
private String personId;
private List<String> includeOrganizations;
private List<String> includeLabels;
public List<String> getImageStoreIds() {
return this.imageStoreIds;
}
public void setImageStoreIds(List<String> imageStoreIds) {
this.imageStoreIds = imageStoreIds;
}
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public List<String> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<String> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<String> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<String> includeLabels) {
this.includeLabels = includeLabels;
}
}
@@ -0,0 +1,21 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
public class AcsPassRuleIsDefaultParam
implements Serializable {
private static final long serialVersionUID = 137892620174267456L;
private String zoneId;
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
}
@@ -0,0 +1,111 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.validation.constraints.Size
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPassRuleNewParam
implements Serializable {
private static final long serialVersionUID = 137892620174267456L;
private String parentId;
private String zoneId;
private String zoneName;
@NotBlank(message="76260514")
@Size(min=1, max=32, message="76260518")
private String ruleName;
private List<String> includeLabels;
private List<String> includeOrganizations;
private List<String> excludeLabels;
private Long startTime;
private Long endTime;
private Integer isDefault;
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getZoneName() {
return this.zoneName;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public String getRuleName() {
return this.ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public List<String> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<String> includeLabels) {
this.includeLabels = includeLabels;
}
public List<String> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<String> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<String> getExcludeLabels() {
return this.excludeLabels;
}
public void setExcludeLabels(List<String> excludeLabels) {
this.excludeLabels = excludeLabels;
}
public Long getStartTime() {
return this.startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return this.endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public Integer getIsDefault() {
return this.isDefault;
}
public void setIsDefault(Integer isDefault) {
this.isDefault = isDefault;
}
}
@@ -0,0 +1,28 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.page.CloudwalkBasePageForm
*/
package cn.cloudwalk.elevator.passrule.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleImageParam;
import java.io.Serializable;
import java.util.List;
public class AcsPassRulePersonListParam
extends CloudwalkBasePageForm
implements Serializable {
private static final long serialVersionUID = -52687427633888290L;
private List<AcsPassRuleImageParam> personList;
public List<AcsPassRuleImageParam> getPersonList() {
return this.personList;
}
public void setPersonList(List<AcsPassRuleImageParam> personList) {
this.personList = personList;
}
}
@@ -0,0 +1,66 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
public class AcsPassRuleQueryParam
implements Serializable {
private static final long serialVersionUID = -31004388036379268L;
private String id;
private String parentId;
private String zoneId;
private String zoneName;
private String imageStoreId;
private Integer isDefault;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getZoneName() {
return this.zoneName;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public Integer getIsDefault() {
return this.isDefault;
}
public void setIsDefault(Integer isDefault) {
this.isDefault = isDefault;
}
}
@@ -0,0 +1,58 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.validation.constraints.Size
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.passrule.param;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeCycleParam;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPassTimeAddParam
implements Serializable {
private static final long serialVersionUID = 8600793178515359164L;
@NotBlank(message="76260512")
@Size(min=1, max=64, message="76260519")
private String passableTimeName;
private Long beginDate;
private Long endDate;
private List<AcsPassTimeCycleParam> passableCycle;
public String getPassableTimeName() {
return this.passableTimeName;
}
public void setPassableTimeName(String passableTimeName) {
this.passableTimeName = passableTimeName;
}
public Long getBeginDate() {
return this.beginDate;
}
public void setBeginDate(Long beginDate) {
this.beginDate = beginDate;
}
public Long getEndDate() {
return this.endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public List<AcsPassTimeCycleParam> getPassableCycle() {
return this.passableCycle;
}
public void setPassableCycle(List<AcsPassTimeCycleParam> passableCycle) {
this.passableCycle = passableCycle;
}
}
@@ -0,0 +1,32 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.passrule.param;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeParam;
import java.io.Serializable;
import java.util.List;
public class AcsPassTimeCycleParam
implements Serializable {
private static final long serialVersionUID = 9084516985152275888L;
private int weekday;
private List<AcsPassTimeParam> time;
public int getWeekday() {
return this.weekday;
}
public void setWeekday(int weekday) {
this.weekday = weekday;
}
public List<AcsPassTimeParam> getTime() {
return this.time;
}
public void setTime(List<AcsPassTimeParam> time) {
this.time = time;
}
}
@@ -0,0 +1,27 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotEmpty
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
import java.util.List;
import org.hibernate.validator.constraints.NotEmpty;
public class AcsPassTimeDeleteParam
implements Serializable {
private static final long serialVersionUID = -1142611457619464538L;
@NotEmpty(message="76260513")
private List<String> ids;
public List<String> getIds() {
return this.ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
}
@@ -0,0 +1,68 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.validation.constraints.Size
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.passrule.param;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeCycleParam;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPassTimeEditParam
implements Serializable {
private static final long serialVersionUID = -8271994630899900554L;
@NotBlank(message="76260513")
private String id;
@NotBlank(message="76260512")
@Size(min=1, max=64, message="76260519")
private String passableTimeName;
private Long beginDate;
private Long endDate;
private List<AcsPassTimeCycleParam> passableCycle;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getPassableTimeName() {
return this.passableTimeName;
}
public void setPassableTimeName(String passableTimeName) {
this.passableTimeName = passableTimeName;
}
public Long getBeginDate() {
return this.beginDate;
}
public void setBeginDate(Long beginDate) {
this.beginDate = beginDate;
}
public Long getEndDate() {
return this.endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public List<AcsPassTimeCycleParam> getPassableCycle() {
return this.passableCycle;
}
public void setPassableCycle(List<AcsPassTimeCycleParam> passableCycle) {
this.passableCycle = passableCycle;
}
}
@@ -0,0 +1,30 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
public class AcsPassTimeParam
implements Serializable {
private static final long serialVersionUID = 7496987389322298594L;
private String beginTime;
private String endTime;
public String getBeginTime() {
return this.beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return this.endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
}
@@ -0,0 +1,26 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.passrule.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPassTimeQueryParam
implements Serializable {
private static final long serialVersionUID = 7311660131290856391L;
@NotBlank(message="76260513")
private String id;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
}
@@ -0,0 +1,144 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult
*/
package cn.cloudwalk.elevator.passrule.result;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeCycleParam;
import java.util.List;
public class AcsPassRuleDetailResult {
private static final long serialVersionUID = -90554404684210529L;
private String id;
private String ruleName;
private String imageStoreId;
private String zoneId;
private String zoneName;
private Long beginDate;
private Long endDate;
private String validDateCron;
private String validDateJson;
private List<LabelResult> excludeLabels;
private List<OrganizationResult> includeOrganizations;
private List<LabelResult> includeLabels;
private List<AcsPassTimeCycleParam> passableCycle;
private Integer passType;
public String getRuleName() {
return this.ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public Long getBeginDate() {
return this.beginDate;
}
public void setBeginDate(Long beginDate) {
this.beginDate = beginDate;
}
public Long getEndDate() {
return this.endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public String getValidDateCron() {
return this.validDateCron;
}
public void setValidDateCron(String validDateCron) {
this.validDateCron = validDateCron;
}
public String getValidDateJson() {
return this.validDateJson;
}
public void setValidDateJson(String validDateJson) {
this.validDateJson = validDateJson;
}
public List<LabelResult> getExcludeLabels() {
return this.excludeLabels;
}
public void setExcludeLabels(List<LabelResult> excludeLabels) {
this.excludeLabels = excludeLabels;
}
public List<OrganizationResult> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<OrganizationResult> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<LabelResult> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<LabelResult> includeLabels) {
this.includeLabels = includeLabels;
}
public List<AcsPassTimeCycleParam> getPassableCycle() {
return this.passableCycle;
}
public void setPassableCycle(List<AcsPassTimeCycleParam> passableCycle) {
this.passableCycle = passableCycle;
}
public Integer getPassType() {
return this.passType;
}
public void setPassType(Integer passType) {
this.passType = passType;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getZoneName() {
return this.zoneName;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
}
@@ -0,0 +1,117 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.passrule.result;
import java.io.Serializable;
public class AcsPassRuleFloorResult
implements Serializable {
private static final long serialVersionUID = -90554404684210529L;
private String id;
private String name;
private Integer deviceNumber;
private Integer unitNumber;
private Long personNumber;
public String getId() {
return this.id;
}
public String getName() {
return this.name;
}
public Integer getDeviceNumber() {
return this.deviceNumber;
}
public Integer getUnitNumber() {
return this.unitNumber;
}
public Long getPersonNumber() {
return this.personNumber;
}
public void setId(String id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setDeviceNumber(Integer deviceNumber) {
this.deviceNumber = deviceNumber;
}
public void setUnitNumber(Integer unitNumber) {
this.unitNumber = unitNumber;
}
public void setPersonNumber(Long personNumber) {
this.personNumber = personNumber;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AcsPassRuleFloorResult)) {
return false;
}
AcsPassRuleFloorResult other = (AcsPassRuleFloorResult)o;
if (!other.canEqual(this)) {
return false;
}
String this$id = this.getId();
String other$id = other.getId();
if (this$id == null ? other$id != null : !this$id.equals(other$id)) {
return false;
}
String this$name = this.getName();
String other$name = other.getName();
if (this$name == null ? other$name != null : !this$name.equals(other$name)) {
return false;
}
Integer this$deviceNumber = this.getDeviceNumber();
Integer other$deviceNumber = other.getDeviceNumber();
if (this$deviceNumber == null ? other$deviceNumber != null : !((Object)this$deviceNumber).equals(other$deviceNumber)) {
return false;
}
Integer this$unitNumber = this.getUnitNumber();
Integer other$unitNumber = other.getUnitNumber();
if (this$unitNumber == null ? other$unitNumber != null : !((Object)this$unitNumber).equals(other$unitNumber)) {
return false;
}
Long this$personNumber = this.getPersonNumber();
Long other$personNumber = other.getPersonNumber();
return !(this$personNumber == null ? other$personNumber != null : !((Object)this$personNumber).equals(other$personNumber));
}
protected boolean canEqual(Object other) {
return other instanceof AcsPassRuleFloorResult;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $id = this.getId();
result = result * 59 + ($id == null ? 43 : $id.hashCode());
String $name = this.getName();
result = result * 59 + ($name == null ? 43 : $name.hashCode());
Integer $deviceNumber = this.getDeviceNumber();
result = result * 59 + ($deviceNumber == null ? 43 : ((Object)$deviceNumber).hashCode());
Integer $unitNumber = this.getUnitNumber();
result = result * 59 + ($unitNumber == null ? 43 : ((Object)$unitNumber).hashCode());
Long $personNumber = this.getPersonNumber();
result = result * 59 + ($personNumber == null ? 43 : ((Object)$personNumber).hashCode());
return result;
}
public String toString() {
return "AcsPassRuleFloorResult(id=" + this.getId() + ", name=" + this.getName() + ", deviceNumber=" + this.getDeviceNumber() + ", unitNumber=" + this.getUnitNumber() + ", personNumber=" + this.getPersonNumber() + ")";
}
}
@@ -0,0 +1,165 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult
*/
package cn.cloudwalk.elevator.passrule.result;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult;
import java.io.Serializable;
import java.util.List;
public class AcsPassRuleResult
implements Serializable {
private static final long serialVersionUID = -90554404684210529L;
private String id;
private String ruleName;
private int personSum;
private String imageStoreId;
private String passableTimeName;
private String zoneId;
private Long beginDate;
private Long endDate;
private String validDateCron;
private String validDateJson;
private List<LabelResult> excludeLabels;
private List<OrganizationResult> includeOrganizations;
private List<LabelResult> includeLabels;
private List<ImgStorePersonResult> includePersons;
private Integer passType;
private Integer isDefault;
public String getRuleName() {
return this.ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public int getPersonSum() {
return this.personSum;
}
public void setPersonSum(int personSum) {
this.personSum = personSum;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public Long getBeginDate() {
return this.beginDate;
}
public void setBeginDate(Long beginDate) {
this.beginDate = beginDate;
}
public Long getEndDate() {
return this.endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public String getValidDateCron() {
return this.validDateCron;
}
public void setValidDateCron(String validDateCron) {
this.validDateCron = validDateCron;
}
public String getValidDateJson() {
return this.validDateJson;
}
public void setValidDateJson(String validDateJson) {
this.validDateJson = validDateJson;
}
public List<LabelResult> getExcludeLabels() {
return this.excludeLabels;
}
public void setExcludeLabels(List<LabelResult> excludeLabels) {
this.excludeLabels = excludeLabels;
}
public List<OrganizationResult> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<OrganizationResult> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<LabelResult> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<LabelResult> includeLabels) {
this.includeLabels = includeLabels;
}
public String getPassableTimeName() {
return this.passableTimeName;
}
public void setPassableTimeName(String passableTimeName) {
this.passableTimeName = passableTimeName;
}
public List<ImgStorePersonResult> getIncludePersons() {
return this.includePersons;
}
public void setIncludePersons(List<ImgStorePersonResult> includePersons) {
this.includePersons = includePersons;
}
public Integer getPassType() {
return this.passType;
}
public void setPassType(Integer passType) {
this.passType = passType;
}
public Integer getIsDefault() {
return this.isDefault;
}
public void setIsDefault(Integer isDefault) {
this.isDefault = isDefault;
}
}
@@ -0,0 +1,144 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelDetailResult
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult
*/
package cn.cloudwalk.elevator.passrule.result;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelDetailResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeCycleParam;
import java.util.List;
public class ImageRuleRefDetailResult {
private static final long serialVersionUID = -90554404684210529L;
private String id;
private String ruleName;
private String imageStoreId;
private String zoneId;
private String zoneName;
private Long beginDate;
private Long endDate;
private String validDateCron;
private String validDateJson;
private List<String> excludeLabels;
private List<OrganizationResult> includeOrganizations;
private List<LabelDetailResult> includeLabels;
private List<AcsPassTimeCycleParam> passableCycle;
private Integer passType;
public String getRuleName() {
return this.ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public Long getBeginDate() {
return this.beginDate;
}
public void setBeginDate(Long beginDate) {
this.beginDate = beginDate;
}
public Long getEndDate() {
return this.endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public String getValidDateCron() {
return this.validDateCron;
}
public void setValidDateCron(String validDateCron) {
this.validDateCron = validDateCron;
}
public String getValidDateJson() {
return this.validDateJson;
}
public void setValidDateJson(String validDateJson) {
this.validDateJson = validDateJson;
}
public List<String> getExcludeLabels() {
return this.excludeLabels;
}
public void setExcludeLabels(List<String> excludeLabels) {
this.excludeLabels = excludeLabels;
}
public List<OrganizationResult> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<OrganizationResult> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<LabelDetailResult> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<LabelDetailResult> includeLabels) {
this.includeLabels = includeLabels;
}
public List<AcsPassTimeCycleParam> getPassableCycle() {
return this.passableCycle;
}
public void setPassableCycle(List<AcsPassTimeCycleParam> passableCycle) {
this.passableCycle = passableCycle;
}
public Integer getPassType() {
return this.passType;
}
public void setPassType(Integer passType) {
this.passType = passType;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getZoneName() {
return this.zoneName;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
}
@@ -0,0 +1,163 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelDetailResult
* cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult
*/
package cn.cloudwalk.elevator.passrule.result;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.label.result.LabelDetailResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.organization.result.OrganizationResult;
import java.util.List;
public class ImageRuleRefPageResult {
private static final long serialVersionUID = -90554404684210529L;
private String id;
private String ruleName;
private int personSum;
private String imageStoreId;
private String passableTimeName;
private String zoneId;
private Long beginDate;
private Long endDate;
private String validDateCron;
private String validDateJson;
private List<String> excludeLabels;
private List<OrganizationResult> includeOrganizations;
private List<LabelDetailResult> includeLabels;
private List<ImgStorePersonResult> includePersons;
private Integer passType;
private Integer isDefault;
public String getRuleName() {
return this.ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public int getPersonSum() {
return this.personSum;
}
public void setPersonSum(int personSum) {
this.personSum = personSum;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public Long getBeginDate() {
return this.beginDate;
}
public void setBeginDate(Long beginDate) {
this.beginDate = beginDate;
}
public Long getEndDate() {
return this.endDate;
}
public void setEndDate(Long endDate) {
this.endDate = endDate;
}
public String getValidDateCron() {
return this.validDateCron;
}
public void setValidDateCron(String validDateCron) {
this.validDateCron = validDateCron;
}
public String getValidDateJson() {
return this.validDateJson;
}
public void setValidDateJson(String validDateJson) {
this.validDateJson = validDateJson;
}
public List<String> getExcludeLabels() {
return this.excludeLabels;
}
public void setExcludeLabels(List<String> excludeLabels) {
this.excludeLabels = excludeLabels;
}
public List<OrganizationResult> getIncludeOrganizations() {
return this.includeOrganizations;
}
public void setIncludeOrganizations(List<OrganizationResult> includeOrganizations) {
this.includeOrganizations = includeOrganizations;
}
public List<LabelDetailResult> getIncludeLabels() {
return this.includeLabels;
}
public void setIncludeLabels(List<LabelDetailResult> includeLabels) {
this.includeLabels = includeLabels;
}
public String getPassableTimeName() {
return this.passableTimeName;
}
public void setPassableTimeName(String passableTimeName) {
this.passableTimeName = passableTimeName;
}
public List<ImgStorePersonResult> getIncludePersons() {
return this.includePersons;
}
public void setIncludePersons(List<ImgStorePersonResult> includePersons) {
this.includePersons = includePersons;
}
public Integer getPassType() {
return this.passType;
}
public void setPassType(Integer passType) {
this.passType = passType;
}
public Integer getIsDefault() {
return this.isDefault;
}
public void setIsDefault(Integer isDefault) {
this.isDefault = isDefault;
}
}
@@ -0,0 +1,51 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
*/
package cn.cloudwalk.elevator.passrule.service;
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.passrule.dto.AcsPassRuleImageResultDto;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleDeleteParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleEditParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleFloorParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleImageParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleIsDefaultParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleNewParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleQueryParam;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleDetailResult;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleFloorResult;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleResult;
import java.util.List;
public interface AcsPassRuleService {
public CloudwalkResult<List<AcsPassRuleFloorResult>> listFloor(AcsPassRuleFloorParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<String> getIsDefaultByZoneId(AcsPassRuleIsDefaultParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<String> add(AcsPassRuleNewParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> update(AcsPassRuleEditParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> delete(AcsPassRuleDeleteParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<AcsPassRuleDetailResult> detail(AcsPassRuleQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<CloudwalkPageAble<AcsPassRuleResult>> page(AcsPassRuleQueryParam var1, CloudwalkPageInfo var2, CloudwalkCallContext var3) throws ServiceException;
public CloudwalkResult<List<AcsPassRuleResult>> list(AcsPassRuleQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<List<AcsPassRuleImageResultDto>> listByImageId(AcsPassRuleImageParam var1, CloudwalkCallContext var2) throws ServiceException;
}
@@ -0,0 +1,51 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRulePersonListResultDto
*/
package cn.cloudwalk.elevator.passrule.service;
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.passrule.dto.AcsPassRuleImageResultDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRulePersonListResultDto;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleDeleteParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleEditParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleFloorParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleImageParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleNewParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRulePersonListParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleQueryParam;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleFloorResult;
import cn.cloudwalk.elevator.passrule.result.ImageRuleRefDetailResult;
import cn.cloudwalk.elevator.passrule.result.ImageRuleRefPageResult;
import java.util.List;
public interface ImageRuleRefService {
public CloudwalkResult<CloudwalkPageAble<ImageRuleRefPageResult>> page(AcsPassRuleQueryParam var1, CloudwalkPageInfo var2, CloudwalkCallContext var3) throws ServiceException;
public CloudwalkResult<CloudwalkPageAble<AcsPassRuleFloorResult>> listFloor(AcsPassRuleFloorParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<List<AcsPassRuleImageResultDto>> listByPersonInfo(AcsPassRuleImageParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<List<AcsPassRulePersonListResultDto>> listByPersonList(AcsPassRulePersonListParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<ImageRuleRefDetailResult> detail(AcsPassRuleQueryParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> addOnlyRule(AcsPassRuleNewParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> update(AcsPassRuleEditParam var1, CloudwalkCallContext var2) throws ServiceException;
public CloudwalkResult<Boolean> delete(AcsPassRuleDeleteParam var1, CloudwalkCallContext var2) throws ServiceException;
}
@@ -0,0 +1,524 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.application.param.ApplicationImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.biology.service.BiologyToolService
* cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceApplicationResult
* cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceImageStoreResult
* cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceApplicationService
* cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonBindParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonDelParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStoreQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStoreListResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStoreBatchBindPersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService
* cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonAddParam
* cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.person.result.PersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService
* cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.entity.CloudwalkBaseIdentify
* cn.cloudwalk.cloud.exception.DataAccessException
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.em.AcsPassTypeEnum
* cn.cloudwalk.elevator.passrule.dao.AcsPassRuleDao
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto
* cn.cloudwalk.elevator.passrule.dto.AcsPassRuleResultDto
* cn.cloudwalk.elevator.util.CollectionUtils
* cn.cloudwalk.elevator.util.DateUtils
* cn.cloudwalk.elevator.util.StringUtils
* com.alibaba.fastjson.JSONObject
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.stereotype.Service
*/
package cn.cloudwalk.elevator.person.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.application.param.ApplicationImageStoreQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.biology.service.BiologyToolService;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.param.DeviceImageStoreQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceApplicationResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceImageStoreResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceApplicationService;
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonBindParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonDelParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonQueryParam;
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.result.ImageStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImgStoreBatchBindPersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStoreService;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonAddParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.result.PersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService;
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.entity.CloudwalkBaseIdentify;
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.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.em.AcsPassTypeEnum;
import cn.cloudwalk.elevator.passrule.dao.AcsPassRuleDao;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleQueryDto;
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleResultDto;
import cn.cloudwalk.elevator.passrule.impl.AbstractAcsPassService;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleIsDefaultParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassRuleQueryParam;
import cn.cloudwalk.elevator.passrule.param.AcsPassTimeCycleParam;
import cn.cloudwalk.elevator.passrule.result.AcsPassRuleResult;
import cn.cloudwalk.elevator.passrule.service.AcsPassRuleService;
import cn.cloudwalk.elevator.person.param.AcsPersonAddNewParam;
import cn.cloudwalk.elevator.person.param.AcsPersonAddParam;
import cn.cloudwalk.elevator.person.param.AcsPersonDeleteParam;
import cn.cloudwalk.elevator.person.param.AcsPersonEditParam;
import cn.cloudwalk.elevator.person.param.AcsPersonQueryByAppParam;
import cn.cloudwalk.elevator.person.param.AcsPersonQueryParam;
import cn.cloudwalk.elevator.person.param.AcsPersonTimeDetailParam;
import cn.cloudwalk.elevator.person.result.AcsPersonResult;
import cn.cloudwalk.elevator.person.result.AcsPersonTimeDetailResult;
import cn.cloudwalk.elevator.person.service.AcsPersonService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.util.DateUtils;
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.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AcsPersonServiceImpl
extends AbstractAcsPassService
implements AcsPersonService {
private static final int ROWS_OF_PAGE = 1000;
@Autowired
private BiologyToolService biologyToolService;
@Autowired
private DeviceImageStoreService deviceImageStoreService;
@Autowired
private ImageStorePersonService imageStorePersonService;
@Autowired
private DeviceApplicationService deviceApplicationService;
@Autowired
private PersonService personService;
@Autowired
private ImageStoreService imageStoreService;
@Resource
private AcsPassRuleService acsPassRuleService;
@Resource
private AcsPassRuleDao acsPassRuleDao;
@Override
@CloudwalkParamsValidate
public CloudwalkResult<Boolean> add(AcsPersonAddParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u4ece\u73b0\u6709\u4eba\u5458\u6dfb\u52a0\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonAddParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
String acsImageStoreId = this.getAcsImageStore(param.getZoneId(), context);
ImageStorePersonBindParam imageStorePersonBindParam = new ImageStorePersonBindParam();
imageStorePersonBindParam.setImageStoreId(acsImageStoreId);
imageStorePersonBindParam.setPersonIds(param.getPersonIds());
imageStorePersonBindParam.setNullDateIsLongTerm(Boolean.valueOf(true));
imageStorePersonBindParam.setExpiryBeginDate(param.getStartTime());
imageStorePersonBindParam.setExpiryEndDate(param.getEndTime());
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u7ed1\u5b9a\u4eba\u5458\u56fe\u5e93\u5f00\u59cb\uff0cimageStorePersonBindParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)imageStorePersonBindParam), (Object)JSONObject.toJSONString((Object)context));
CloudwalkResult bindResult = this.imageStorePersonService.batchBind(imageStorePersonBindParam, context);
if (!bindResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u7ed1\u5b9a\u4eba\u5458\u56fe\u5e93\u5f02\u5e38\uff0c\u539f\u56e0\uff1a[{}],\u5931\u8d25\u4eba\u5458id:[{}]", (Object)bindResult.getMessage(), (Object)((ImgStoreBatchBindPersonResult)bindResult.getData()).getFailPersonIds());
return CloudwalkResult.fail((String)bindResult.getCode(), (String)bindResult.getMessage());
}
return CloudwalkResult.success((Object)true);
}
private void bindImageStorePerson(String acsImageStoreId, String personId, Long startTime, Long endTime, CloudwalkCallContext context) throws ServiceException {
ImageStorePersonBindParam imageStorePersonBindParam = new ImageStorePersonBindParam();
imageStorePersonBindParam.setImageStoreId(acsImageStoreId);
imageStorePersonBindParam.setNullDateIsLongTerm(Boolean.valueOf(true));
imageStorePersonBindParam.setPersonId(personId);
imageStorePersonBindParam.setExpiryBeginDate(startTime);
imageStorePersonBindParam.setExpiryEndDate(endTime);
this.logger.info("\u56fe\u5e93\u4eba\u5458\u5173\u7cfb\u7ed1\u5b9a\u5f00\u59cb\uff0cimageStorePersonBindParam:[{}],context:[{}]", (Object)JSONObject.toJSONString((Object)imageStorePersonBindParam), (Object)JSONObject.toJSONString((Object)context));
CloudwalkResult bindResult = this.imageStorePersonService.bind(imageStorePersonBindParam, context);
if (!bindResult.isSuccess()) {
this.logger.error("\u56fe\u5e93\u4eba\u5458\u5173\u7cfb\u7ed1\u5b9a\u5931\u8d25,imageStoreId=[{}],personId=[{}],\u539f\u56e0\uff1a[{}]", new Object[]{acsImageStoreId, personId, bindResult.getMessage()});
throw new ServiceException(bindResult.getCode(), bindResult.getMessage());
}
}
private String addPerson(AcsPersonAddNewParam param, CloudwalkCallContext context) throws ServiceException {
PersonAddParam personAddParam = new PersonAddParam();
BeanCopyUtils.copyProperties((Object)param.getPersonProperties(), (Object)personAddParam);
CloudwalkResult addPersonResult = this.personService.add(personAddParam, context);
if (!addPersonResult.isSuccess()) {
this.logger.info("\u65b0\u589e\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Object)addPersonResult.getMessage());
throw new ServiceException(addPersonResult.getCode(), addPersonResult.getMessage());
}
return (String)addPersonResult.getData();
}
@Override
@CloudwalkParamsValidate
public CloudwalkResult<Boolean> edit(AcsPersonEditParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u7f16\u8f91\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonEditParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
this.checkPersonIdByImageStore(param.getPersonId(), param.getImageStoreId(), context);
ImageStorePersonDelParam delParam = new ImageStorePersonDelParam();
delParam.setImageStoreId(param.getImageStoreId());
delParam.setPersonId(param.getPersonId());
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u89e3\u7ed1\u56fe\u5e93\u4eba\u5458\u5f00\u59cb\uff0cImageStorePersonDelParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)delParam), (Object)JSONObject.toJSONString((Object)context));
CloudwalkResult deleteResult = this.imageStorePersonService.delete(delParam, context);
if (!deleteResult.isSuccess()) {
this.logger.error("\u56fe\u5e93\u4eba\u5458\u66f4\u65b0\u4e4b\u524d\u5148\u89e3\u7ed1\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Object)deleteResult.getMessage());
return CloudwalkResult.fail((String)"76260406", (String)(this.getMessage("76260406") + " " + deleteResult.getMessage()));
}
this.bindImageStorePerson(param.getImageStoreId(), param.getPersonId(), param.getStartTime(), param.getEndTime(), context);
return CloudwalkResult.success((Object)true);
}
@Override
@CloudwalkParamsValidate
public CloudwalkResult<Boolean> delete(AcsPersonDeleteParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u5220\u9664\u95e8\u7981\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonDeleteParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
for (String personId : param.getPersonIds()) {
ImageStorePersonDelParam imageStorePersonDelParam = new ImageStorePersonDelParam();
imageStorePersonDelParam.setPersonId(personId);
imageStorePersonDelParam.setImageStoreId(param.getImageStoreId());
CloudwalkResult imageStorePersonDeleteResult = this.imageStorePersonService.delete(imageStorePersonDelParam, context);
if (imageStorePersonDeleteResult.isSuccess()) continue;
return CloudwalkResult.fail((String)"76260407", (String)(this.getMessage("76260407") + " " + imageStorePersonDeleteResult.getMessage()));
}
return CloudwalkResult.success((Object)true);
}
private List<DeviceApplicationResult> sortedDeviceAppList(CloudwalkResult<List<DeviceApplicationResult>> deviceAppResult) {
List deviceAppList = (List)deviceAppResult.getData();
ArrayList<DeviceApplicationResult> sortedDeviceAppList = new ArrayList<DeviceApplicationResult>();
List acsAppList = deviceAppList.stream().filter(s -> "elevator-app".equals(s.getServiceCode())).collect(Collectors.toList());
List otherAppList = deviceAppList.stream().filter(s -> !"elevator-app".equals(s.getServiceCode())).collect(Collectors.toList());
sortedDeviceAppList.addAll(acsAppList);
sortedDeviceAppList.addAll(otherAppList);
return sortedDeviceAppList;
}
@Override
@CloudwalkParamsValidate
public CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> page(AcsPersonQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u5206\u9875\u67e5\u8be2\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonQueryParam=[{}], CloudwalkPageInfo=[{}], CloudwalkCallContext=[{}]", new Object[]{JSONObject.toJSONString((Object)param), JSONObject.toJSONString((Object)pageInfo), JSONObject.toJSONString((Object)context)});
ArrayList<AcsPersonResult> result = new ArrayList<AcsPersonResult>();
List<String> personIds = null;
List<AcsPassRuleResult> ruleResults = this.getRuleListByZoneId(param.getZoneId(), context);
if (CollectionUtils.isEmpty(ruleResults)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
List<String> imageStoreIds = ruleResults.stream().map(AcsPassRuleResult::getImageStoreId).collect(Collectors.toList());
if (StringUtils.isNotBlank((String)param.getImageStoreId()) && !imageStoreIds.contains(param.getImageStoreId())) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
Map<String, AcsPassRuleResult> ruleMap = ruleResults.stream().collect(Collectors.toMap(AcsPassRuleResult::getImageStoreId, r -> r));
if (!StringUtils.isEmpty((String)param.getPersonName()) && CollectionUtils.isEmpty(personIds = this.getPersonIdsByName(param.getPersonName(), context))) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
CloudwalkPageAble<ImageStorePersonResult> pageResult = this.getImageStorePerson(param, pageInfo, context, personIds, imageStoreIds);
if (!CollectionUtils.isEmpty((Collection)pageResult.getDatas())) {
this.covertPageResult(result, pageResult.getDatas(), ruleMap, context);
}
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, pageResult.getTotalRows()));
}
private List<ImageStoreListResult> getImageStoreIdsByAppAndDevice(String applicationId, String deviceId, CloudwalkCallContext context) throws ServiceException {
ApplicationImageStoreQueryParam queryParam = new ApplicationImageStoreQueryParam();
queryParam.setApplicationId(applicationId);
List<DeviceImageStoreResult> deviceImageStore = this.getDeviceImageStore(deviceId, context);
if (deviceImageStore.isEmpty()) {
return new ArrayList<ImageStoreListResult>();
}
List imageStoreIdByDevice = deviceImageStore.stream().map(DeviceImageStoreResult::getImageStoreId).collect(Collectors.toList());
ImageStoreQueryParam imageStoreQueryParam = new ImageStoreQueryParam();
imageStoreQueryParam.setBusinessId(context.getCompany().getCompanyId());
imageStoreQueryParam.setApplicationId(applicationId);
imageStoreQueryParam.setIds(imageStoreIdByDevice);
CloudwalkResult imageStoreResult = this.imageStoreService.list(imageStoreQueryParam, context);
return (List)imageStoreResult.getData();
}
private CloudwalkPageAble<ImageStorePersonResult> getImageStorePerson(AcsPersonQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context, List<String> personIds, List<String> imageStoreIds) throws ServiceException {
CloudwalkPageAble results = new CloudwalkPageAble();
ImageStorePersonQueryParam imageStorePersonQueryParam = new ImageStorePersonQueryParam();
imageStorePersonQueryParam.setImageStoreId(param.getImageStoreId());
if (StringUtils.isEmpty((String)param.getImageStoreId())) {
imageStorePersonQueryParam.setImageStoreIds(imageStoreIds);
}
imageStorePersonQueryParam.setPersonIds(personIds);
imageStorePersonQueryParam.setOrganizationIds(param.getOrganizationIds());
imageStorePersonQueryParam.setLabelIds(param.getLabelIds());
imageStorePersonQueryParam.setCurrentPage(pageInfo.getCurrentPage());
imageStorePersonQueryParam.setRowsOfPage(pageInfo.getPageSize());
CloudwalkResult pageResult = this.imageStorePersonService.page(imageStorePersonQueryParam, context);
if (!pageResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u56fe\u5e93\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Object)pageResult.getMessage());
throw new ServiceException(pageResult.getCode(), pageResult.getMessage());
}
if (!CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)pageResult.getData()).getDatas())) {
results = (CloudwalkPageAble)pageResult.getData();
}
return results;
}
@Override
public CloudwalkResult<AcsPersonTimeDetailResult> timeDetail(AcsPersonTimeDetailParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u67e5\u8be2\u901a\u884c\u4eba\u5458\u65f6\u95f4\u8be6\u60c5\u5f00\u59cb\uff0cAcsPersonTimeDetailParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
AcsPersonTimeDetailResult result = new AcsPersonTimeDetailResult();
ImageStorePersonResult imageStorePersonResult = this.getImageStorePersonResult(param, context);
AcsPassRuleResult rule = this.getRuleByImageStore(param.getImageStoreId(), context);
result.setBeginDate(imageStorePersonResult.getExpiryBeginDate());
result.setEndDate(imageStorePersonResult.getExpiryEndDate());
result.setPassType(AcsPassTypeEnum.LONG_TIME.getCode());
if (imageStorePersonResult.getExpiryBeginDate() != null || imageStorePersonResult.getExpiryEndDate() != null) {
result.setPassType(AcsPassTypeEnum.AUTO_PASS.getCode());
}
if (!CollectionUtils.isEmpty((Collection)imageStorePersonResult.getValidDateCron())) {
BeanCopyUtils.copyProperties((Object)rule, (Object)result);
result.setPassableTimeName(rule.getPassableTimeName());
List timeCycleParams = JSONObject.parseArray((String)rule.getValidDateJson(), AcsPassTimeCycleParam.class);
result.setPassableCycle(timeCycleParams);
result.setPassType(AcsPassTypeEnum.PASS_TIME.getCode());
}
ImageStorePersonQueryParam imageStorePersonQueryParam = new ImageStorePersonQueryParam();
imageStorePersonQueryParam.setPersonId(param.getPersonId());
imageStorePersonQueryParam.setRowsOfPage(1000);
CloudwalkResult imageStorePersonPageResult = this.imageStorePersonService.page(imageStorePersonQueryParam, context);
ImageStorePersonResult imageStoreResult = (ImageStorePersonResult)((CloudwalkPageAble)imageStorePersonPageResult.getData()).getDatas().iterator().next();
result.setComparePicture(imageStoreResult.getComparePicture());
result.setPersonName(imageStoreResult.getName());
result.setPersonId(imageStoreResult.getPersonId());
return CloudwalkResult.success((Object)result);
}
private AcsPassRuleResult getRuleByImageStore(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
AcsPassRuleQueryParam ruleQueryParam = new AcsPassRuleQueryParam();
ruleQueryParam.setImageStoreId(imageStoreId);
CloudwalkResult<List<AcsPassRuleResult>> results = this.acsPassRuleService.list(ruleQueryParam, context);
return (AcsPassRuleResult)((List)results.getData()).get(0);
}
private ImageStorePersonResult getImageStorePersonResult(AcsPersonTimeDetailParam param, CloudwalkCallContext context) throws ServiceException {
ImageStorePersonQueryParam imageStorePersonQueryParam = new ImageStorePersonQueryParam();
imageStorePersonQueryParam.setImageStoreId(param.getImageStoreId());
imageStorePersonQueryParam.setPersonId(param.getPersonId());
CloudwalkResult pageResult = this.imageStorePersonService.page(imageStorePersonQueryParam, context);
if (!pageResult.isSuccess() || CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)pageResult.getData()).getDatas())) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u901a\u884c\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a" + pageResult.getMessage());
throw new ServiceException("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u901a\u884c\u4eba\u5458\u5931\u8d25");
}
List list = (List)((CloudwalkPageAble)pageResult.getData()).getDatas();
return (ImageStorePersonResult)list.get(0);
}
private List<String> mergeTime(List<ImageStorePersonResult> imageStorePersonList) {
ArrayList<String> passIntervals = new ArrayList<String>();
List personLongTerm = imageStorePersonList.stream().filter(s -> s.getExpiryBeginDate() == null && s.getExpiryEndDate() == null).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(personLongTerm)) {
passIntervals.add("\u957f\u671f");
} else {
Collections.sort(imageStorePersonList, (t1, t2) -> t1.getExpiryBeginDate().compareTo(t2.getExpiryEndDate()));
for (int i = 0; i < imageStorePersonList.size() - 1; ++i) {
int j = i + 1;
if (imageStorePersonList.get(i).getExpiryEndDate() < imageStorePersonList.get(j).getExpiryBeginDate()) continue;
if (imageStorePersonList.get(i).getExpiryEndDate() >= imageStorePersonList.get(j).getExpiryEndDate()) {
imageStorePersonList.set(j, imageStorePersonList.get(i));
} else {
imageStorePersonList.get(j).setExpiryBeginDate(imageStorePersonList.get(i).getExpiryBeginDate());
}
imageStorePersonList.set(i, null);
}
List personTimeMergeList = imageStorePersonList.stream().filter(s -> s != null).collect(Collectors.toList());
for (ImageStorePersonResult personTimeMerge : personTimeMergeList) {
String beginDate = DateUtils.parseDate((Date)new Date(personTimeMerge.getExpiryBeginDate()), (String)"yyyy-MM-dd HH:mm:ss");
String endDate = DateUtils.parseDate((Date)new Date(personTimeMerge.getExpiryEndDate()), (String)"yyyy-MM-dd HH:mm:ss");
passIntervals.add(beginDate + " \u81f3 " + endDate);
}
}
return passIntervals;
}
private void covertPageResult(List<AcsPersonResult> result, Collection<ImageStorePersonResult> datas, Map<String, AcsPassRuleResult> ruleMap, CloudwalkCallContext context) throws ServiceException {
List<String> personIds = datas.stream().map(ImageStorePersonResult::getPersonId).collect(Collectors.toList());
Map<String, PersonResult> personIcCardMap = this.getPersonIcCardByIds(personIds, context);
for (ImageStorePersonResult data : datas) {
AcsPassRuleResult rule = null;
AcsPersonResult acsPersonResult = new AcsPersonResult();
if (ruleMap != null && ruleMap.get(data.getImageStoreId()) != null) {
rule = ruleMap.get(data.getImageStoreId());
acsPersonResult.setRuleName(rule.getRuleName());
acsPersonResult.setRuleId(rule.getId());
}
BeanCopyUtils.copyProperties((Object)data, (Object)acsPersonResult);
acsPersonResult.setPersonName(data.getName());
acsPersonResult.setStartTime(data.getExpiryBeginDate());
acsPersonResult.setEndTime(data.getExpiryEndDate());
acsPersonResult.setPassType(AcsPassTypeEnum.LONG_TIME.getCode());
if (data.getExpiryBeginDate() != null || data.getExpiryEndDate() != null) {
acsPersonResult.setPassType(AcsPassTypeEnum.AUTO_PASS.getCode());
}
if (personIcCardMap != null && personIcCardMap.get(data.getPersonId()) != null) {
acsPersonResult.setIcCardNo(personIcCardMap.get(data.getPersonId()).getIcCardNo());
}
result.add(acsPersonResult);
}
}
private Map<String, PersonResult> getPersonIcCardByIds(List<String> personIds, CloudwalkCallContext context) throws ServiceException {
Map<String, PersonResult> personIcCardMap = null;
PersonQueryParam param = new PersonQueryParam();
param.setIds(personIds);
CloudwalkResult personResult = this.personService.list(param, context);
List personList = (List)personResult.getData();
if (personResult.isSuccess() && CollectionUtils.isNotEmpty((Collection)personList)) {
personIcCardMap = personList.stream().collect(Collectors.toMap(CloudwalkBaseIdentify::getId, PersonResult2 -> PersonResult2));
}
return personIcCardMap;
}
private List<String> getPersonIdsByName(String personName, CloudwalkCallContext context) throws ServiceException {
List<String> personIdsByName = new ArrayList<String>();
if (StringUtils.isNotBlank((String)personName)) {
PersonQueryParam personQueryParam = new PersonQueryParam();
personQueryParam.setName(personName);
CloudwalkResult personResult = this.personService.list(personQueryParam, context);
List personList = (List)personResult.getData();
if (personResult.isSuccess() && CollectionUtils.isNotEmpty((Collection)personList)) {
personIdsByName = personList.stream().map(CloudwalkBaseIdentify::getId).collect(Collectors.toList());
}
}
return personIdsByName;
}
private List<AcsPassRuleResult> getRuleListByZoneId(String zoneId, CloudwalkCallContext context) throws ServiceException {
AcsPassRuleQueryParam param = new AcsPassRuleQueryParam();
param.setZoneId(zoneId);
CloudwalkResult<List<AcsPassRuleResult>> ruleResult = this.acsPassRuleService.list(param, context);
if (!ruleResult.isSuccess()) {
this.logger.error("\u67e5\u8be2\u901a\u884c\u89c4\u5219\u5931\u8d25,\u539f\u56e0:[{}]", (Object)ruleResult.getMessage());
throw new ServiceException("76260508", ruleResult.getMessage());
}
return (List)ruleResult.getData();
}
private String getAcsImageStore(String zoneId, CloudwalkCallContext context) throws ServiceException {
AcsPassRuleIsDefaultParam param = new AcsPassRuleIsDefaultParam();
param.setZoneId(zoneId);
CloudwalkResult<String> imageStore = this.acsPassRuleService.getIsDefaultByZoneId(param, context);
if (imageStore.isSuccess()) {
if (imageStore.getData() != null) {
return (String)imageStore.getData();
}
throw new ServiceException("\u9ed8\u8ba4\u89c4\u5219\u7ed1\u5b9a\u7684\u56fe\u5e93\u4e0d\u5b58\u5728");
}
throw new ServiceException(imageStore.getCode(), imageStore.getMessage());
}
private void checkPersonIdByImageStore(String personId, String acsImageStoreId, CloudwalkCallContext context) throws ServiceException {
ImageStorePersonQueryParam imageStorePersonQueryParam = new ImageStorePersonQueryParam();
imageStorePersonQueryParam.setPersonId(personId);
imageStorePersonQueryParam.setImageStoreId(acsImageStoreId);
CloudwalkResult imageStorePersonResult = this.imageStorePersonService.page(imageStorePersonQueryParam, context);
if (imageStorePersonResult.isSuccess()) {
if (imageStorePersonResult.getData() == null || CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)imageStorePersonResult.getData()).getDatas())) {
throw new ServiceException("\u8be5\u4eba\u5458\u672a\u7ed1\u5b9a\u95e8\u7981\u56fe\u5e93\uff0c\u4eba\u5458id\u4e3a:" + personId);
}
} else {
throw new ServiceException(imageStorePersonResult.getCode(), imageStorePersonResult.getMessage());
}
}
private List<DeviceImageStoreResult> getDeviceImageStore(String deviceId, CloudwalkCallContext context) throws ServiceException {
DeviceImageStoreQueryParam deviceImageStoreQueryParam = new DeviceImageStoreQueryParam();
deviceImageStoreQueryParam.setDeviceId(deviceId);
CloudwalkResult imageStoreResult = this.deviceImageStoreService.list(deviceImageStoreQueryParam, context);
if (imageStoreResult.isSuccess()) {
if (CollectionUtils.isNotEmpty((Collection)((Collection)imageStoreResult.getData()))) {
return (List)imageStoreResult.getData();
}
throw new ServiceException("\u8be5\u8bbe\u5907\u672a\u7ed1\u5b9a\u56fe\u5e93");
}
throw new ServiceException(imageStoreResult.getCode(), imageStoreResult.getMessage());
}
@Override
@CloudwalkParamsValidate
public CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> pageByApp(AcsPersonQueryByAppParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
List<String> personIds = null;
ArrayList<AcsPersonResult> result = new ArrayList<AcsPersonResult>();
List<ImageStoreListResult> imageStoreResult = this.getImageStoreIdsByAppAndDevice(param.getApplicationId(), param.getDeviceId(), context);
List<String> imageStoreIds = imageStoreResult.stream().map(ImageStoreListResult::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(imageStoreIds)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
if (!StringUtils.isEmpty((String)param.getPersonName()) && CollectionUtils.isEmpty(personIds = this.getPersonIdsByName(param.getPersonName(), context))) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
CloudwalkPageAble<ImageStorePersonResult> pageResult = this.getAppImageStorePerson(imageStoreIds, personIds, pageInfo, context);
if (!CollectionUtils.isEmpty((Collection)pageResult.getDatas())) {
this.covertPageResult(result, pageResult.getDatas(), null, context);
}
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, pageResult.getTotalRows()));
}
private CloudwalkPageAble<ImageStorePersonResult> getAppImageStorePerson(List<String> imageStoreIds, List<String> personIds, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
ImageStorePersonQueryParam param = new ImageStorePersonQueryParam();
param.setImageStoreIds(imageStoreIds);
param.setPersonIds(personIds);
param.setCurrentPage(pageInfo.getCurrentPage());
param.setRowsOfPage(pageInfo.getPageSize());
CloudwalkResult pageResult = this.imageStorePersonService.page(param, context);
if (!pageResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u56fe\u5e93\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Object)pageResult.getMessage());
throw new ServiceException(pageResult.getCode(), pageResult.getMessage());
}
return (CloudwalkPageAble)pageResult.getData();
}
private List<AcsPassRuleResultDto> getRuleByImageStoreIds(List<String> imageStoreIds, CloudwalkCallContext context) throws ServiceException {
try {
AcsPassRuleQueryDto dto = new AcsPassRuleQueryDto();
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setImageStoreIds(imageStoreIds);
return this.acsPassRuleDao.list(dto);
}
catch (DataAccessException e) {
this.logger.error("\u67e5\u8be2\u901a\u884c\u89c4\u5219\u5931\u8d25");
throw new ServiceException("76260508", this.getMessage("76260508"));
}
}
private List<ImageStorePersonResult> getPersonImageStore(String personId, List<String> imageStoreIds, CloudwalkCallContext context) throws ServiceException {
ImageStorePersonQueryParam param = new ImageStorePersonQueryParam();
param.setImageStoreIds(imageStoreIds);
param.setPersonId(personId);
CloudwalkResult imageStorePersonResult = this.imageStorePersonService.page(param, context);
if (!imageStorePersonResult.isSuccess()) {
throw new ServiceException(imageStorePersonResult.getCode(), imageStorePersonResult.getMessage());
}
return (List)((CloudwalkPageAble)imageStorePersonResult.getData()).getDatas();
}
}
@@ -0,0 +1,551 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonBindParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.UpdateGroupPersonRefParam
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStorePersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService
* cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonDetailParam
* cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonQueryParam
* cn.cloudwalk.client.cwoscomponent.intelligent.person.result.PersonResult
* cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService
* cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate
* cn.cloudwalk.cloud.context.CloudwalkCallContext
* cn.cloudwalk.cloud.entity.CloudwalkBaseIdentify
* cn.cloudwalk.cloud.exception.DataAccessException
* cn.cloudwalk.cloud.exception.ServiceException
* cn.cloudwalk.cloud.page.CloudwalkPageAble
* cn.cloudwalk.cloud.page.CloudwalkPageInfo
* cn.cloudwalk.cloud.result.CloudwalkResult
* cn.cloudwalk.cloud.utils.BeanCopyUtils
* cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao
* cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao
* cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto
* cn.cloudwalk.elevator.em.AcsPassTypeEnum
* cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao
* cn.cloudwalk.elevator.passrule.dto.ImageRuleRefAddDto
* cn.cloudwalk.elevator.passrule.dto.ImageRuleRefResultDto
* cn.cloudwalk.elevator.util.CollectionUtils
* cn.cloudwalk.elevator.util.StringUtils
* com.alibaba.fastjson.JSONObject
* org.springframework.beans.factory.annotation.Autowired
* org.springframework.stereotype.Service
* org.springframework.transaction.annotation.Propagation
* org.springframework.transaction.annotation.Transactional
* org.springframework.util.ObjectUtils
*/
package cn.cloudwalk.elevator.person.impl;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonBindParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.ImageStorePersonQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.param.UpdateGroupPersonRefParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStorePersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.service.ImageStorePersonService;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonDetailParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.param.PersonQueryParam;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.result.PersonResult;
import cn.cloudwalk.client.cwoscomponent.intelligent.person.service.PersonService;
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.entity.CloudwalkBaseIdentify;
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.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.elevator.device.dao.AcsElevatorDeviceDao;
import cn.cloudwalk.elevator.device.dao.DeviceImageStoreDao;
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceListByBuildingIdDto;
import cn.cloudwalk.elevator.em.AcsPassTypeEnum;
import cn.cloudwalk.elevator.passrule.dao.ImageRuleRefDao;
import cn.cloudwalk.elevator.passrule.dto.ImageRuleRefAddDto;
import cn.cloudwalk.elevator.passrule.dto.ImageRuleRefResultDto;
import cn.cloudwalk.elevator.passrule.impl.AbstractAcsPassService;
import cn.cloudwalk.elevator.person.param.AcsPersonAddParam;
import cn.cloudwalk.elevator.person.param.AcsPersonAddVisitorParam;
import cn.cloudwalk.elevator.person.param.AcsPersonDeleteParam;
import cn.cloudwalk.elevator.person.param.AcsPersonEditParam;
import cn.cloudwalk.elevator.person.param.AcsPersonQueryByAppParam;
import cn.cloudwalk.elevator.person.param.AcsPersonQueryParam;
import cn.cloudwalk.elevator.person.param.AcsPersonTimeDetailParam;
import cn.cloudwalk.elevator.person.param.PersonDetailQueryParam;
import cn.cloudwalk.elevator.person.result.AcsPersonResult;
import cn.cloudwalk.elevator.person.result.AcsPersonTimeDetailResult;
import cn.cloudwalk.elevator.person.service.PersonRuleService;
import cn.cloudwalk.elevator.util.CollectionUtils;
import cn.cloudwalk.elevator.util.StringUtils;
import cn.cloudwalk.elevator.zone.param.ZoneQueryParam;
import cn.cloudwalk.elevator.zone.result.ZoneResult;
import cn.cloudwalk.elevator.zone.service.ZoneService;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@Service
public class PersonRuleServiceImpl
extends AbstractAcsPassService
implements PersonRuleService {
@Resource
private ImageRuleRefDao imageRuleRefDao;
@Resource
private DeviceImageStoreDao deviceImageStoreDao;
@Autowired
private ImageStorePersonService imageStorePersonService;
@Autowired
private PersonService personService;
@Resource
private AcsElevatorDeviceDao acsElevatorDeviceDao;
@Resource
private ZoneService zoneService;
@Override
@CloudwalkParamsValidate
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class})
public CloudwalkResult<Boolean> add(AcsPersonAddParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u4ece\u73b0\u6709\u4eba\u5458\u6dfb\u52a0\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonAddParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
try {
AcsElevatorDeviceListByBuildingIdDto buildingIdDto = new AcsElevatorDeviceListByBuildingIdDto();
buildingIdDto.setCurrentBuildingId(param.getParentId());
buildingIdDto.setBusinessId(context.getCompany().getCompanyId());
List deviceList = this.acsElevatorDeviceDao.listBuBuildingId(buildingIdDto);
if (CollectionUtils.isEmpty((Collection)deviceList)) {
return CloudwalkResult.fail((String)"76260527", (String)this.getMessage("76260527"));
}
ImageRuleRefResultDto defaultRule = this.imageRuleRefDao.getDefaultByZoneId(param.getZoneId());
if (ObjectUtils.isEmpty((Object)defaultRule)) {
ImageRuleRefAddDto dto = new ImageRuleRefAddDto();
dto.setId(this.genUUID());
dto.setBusinessId(context.getCompany().getCompanyId());
dto.setName("\u9ed8\u8ba4\u89c4\u5219");
dto.setZoneId(param.getZoneId());
dto.setZoneName(param.getZoneName());
dto.setIsDefault(Integer.valueOf(1));
dto.setCreateTime(Long.valueOf(System.currentTimeMillis()));
dto.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
this.imageRuleRefDao.insert(dto);
defaultRule = this.imageRuleRefDao.getDefaultByZoneId(param.getZoneId());
}
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
ImageStorePersonQueryParam queryParam = new ImageStorePersonQueryParam();
queryParam.setImageStoreId(imageStoreId);
queryParam.setPersonIds(param.getPersonIds());
CloudwalkResult personPage = this.imageStorePersonService.page(queryParam, context);
ArrayList<String> personPageIds = new ArrayList<String>();
if (!CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)personPage.getData()).getDatas())) {
for (ImageStorePersonResult personResult : ((CloudwalkPageAble)personPage.getData()).getDatas()) {
personPageIds.add(personResult.getPersonId());
}
}
ArrayList<String> bindPersonIds = new ArrayList<String>();
for (String personId : param.getPersonIds()) {
ImageRuleRefResultDto del;
if (!personPageIds.contains(personId)) {
bindPersonIds.add(personId);
}
if (!ObjectUtils.isEmpty((Object)(del = this.imageRuleRefDao.getDelByPersonIdAndZoneId(personId, param.getZoneId())))) continue;
ImageRuleRefAddDto addDto = new ImageRuleRefAddDto();
addDto.setId(this.genUUID());
addDto.setBusinessId(context.getCompany().getCompanyId());
addDto.setPersonId(personId);
addDto.setParentRule(defaultRule.getId());
addDto.setName(defaultRule.getName());
addDto.setZoneId(param.getZoneId());
addDto.setZoneName(defaultRule.getZoneName());
addDto.setCreateTime(Long.valueOf(System.currentTimeMillis()));
addDto.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
addDto.setPersonDelete(Integer.valueOf(0));
this.imageRuleRefDao.insert(addDto);
}
this.imageRuleRefDao.deleteByPersonIdsIsDel(param.getPersonIds(), param.getZoneId());
if (!CollectionUtils.isEmpty(bindPersonIds)) {
ImageStorePersonBindParam imageStorePersonBindParam = new ImageStorePersonBindParam();
imageStorePersonBindParam.setImageStoreId(imageStoreId);
imageStorePersonBindParam.setPersonIds(bindPersonIds);
imageStorePersonBindParam.setNullDateIsLongTerm(Boolean.valueOf(true));
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u7ed1\u5b9a\u4eba\u5458\u56fe\u5e93\u5f00\u59cb\uff0cimageStorePersonBindParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)imageStorePersonBindParam), (Object)JSONObject.toJSONString((Object)context));
CloudwalkResult bindResult = this.imageStorePersonService.batchBind(imageStorePersonBindParam, context);
if (!bindResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u7ed1\u5b9a\u4eba\u5458\u56fe\u5e93\u5f02\u5e38\uff0c\u539f\u56e0\uff1a[{}],\u5931\u8d25\u4eba\u5458id:[{}]", (Object)bindResult.getMessage(), bindPersonIds);
return CloudwalkResult.fail((String)bindResult.getCode(), (String)bindResult.getMessage());
}
}
UpdateGroupPersonRefParam refParam = new UpdateGroupPersonRefParam();
refParam.setBusinessId(context.getCompany().getCompanyId());
refParam.setPersonIds(param.getPersonIds());
refParam.setImageStoreId(imageStoreId);
this.imageStorePersonService.updateGroupPersonRef(refParam, context);
}
catch (DataAccessException e) {
this.logger.error("\u6dfb\u52a0\u901a\u884c\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Throwable)e);
throw new ServiceException("76260521", this.getMessage("76260521"));
}
return CloudwalkResult.success((Object)true);
}
@Override
@CloudwalkParamsValidate
public CloudwalkResult<Boolean> addVisitor(AcsPersonAddVisitorParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u6839\u636e\u88ab\u8bbf\u4eba\u6dfb\u52a0\u8bbf\u5ba2\u6d3e\u68af\u6743\u9650\u5f00\u59cb\uff0cAcsPersonAddVisitorParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
try {
if (CollectionUtils.isEmpty(param.getFloorIds())) {
PersonDetailParam detailParam = new PersonDetailParam();
detailParam.setId(param.getPersonId());
detailParam.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult detail = this.personService.detail(detailParam, context);
param.setFloorIds(((PersonResult)detail.getData()).getFloorList());
}
ZoneQueryParam zoneQueryParam = new ZoneQueryParam();
zoneQueryParam.setId(param.getFloorIds().get(0));
zoneQueryParam.setRowsOfPage(10);
zoneQueryParam.setCurrentPage(1);
CloudwalkResult<CloudwalkPageAble<ZoneResult>> zonePage = this.zoneService.page(zoneQueryParam, context);
List zoneResults = (List)((CloudwalkPageAble)zonePage.getData()).getDatas();
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(((ZoneResult)zoneResults.get(0)).getParentId());
ArrayList<ImageRuleRefAddDto> insertList = new ArrayList<ImageRuleRefAddDto>();
for (String floorId : param.getFloorIds()) {
ImageRuleRefResultDto defaultRule = this.imageRuleRefDao.getDefaultByZoneId(floorId);
ImageRuleRefAddDto addDto = new ImageRuleRefAddDto();
addDto.setId(this.genUUID());
addDto.setBusinessId(context.getCompany().getCompanyId());
addDto.setPersonId(param.getVisitorId());
addDto.setParentRule(defaultRule.getId());
addDto.setName(defaultRule.getName());
addDto.setZoneId(defaultRule.getZoneId());
addDto.setZoneName(defaultRule.getZoneName());
addDto.setCreateTime(Long.valueOf(System.currentTimeMillis()));
addDto.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
addDto.setPersonDelete(Integer.valueOf(0));
insertList.add(addDto);
}
this.logger.info("\u8bbf\u5ba2\u6dfb\u52a0\u6d3e\u68af\u6743\u9650\u5f00\u59cb\uff0c\u6570\u636e\u4e3a=[{}]", (Object)JSONObject.toJSONString(insertList));
if (!CollectionUtils.isEmpty(insertList)) {
this.imageRuleRefDao.insertList(insertList);
}
ImageStorePersonBindParam imageStorePersonBindParam = new ImageStorePersonBindParam();
imageStorePersonBindParam.setImageStoreId(imageStoreId);
imageStorePersonBindParam.setPersonIds(Collections.singletonList(param.getVisitorId()));
imageStorePersonBindParam.setNullDateIsLongTerm(Boolean.valueOf(true));
imageStorePersonBindParam.setExpiryBeginDate(param.getBegVisitorTime());
imageStorePersonBindParam.setExpiryEndDate(param.getEndVisitorTime());
this.logger.info("\u8fdc\u7a0b\u8c03\u7528\u7ed1\u5b9a\u4eba\u5458\u56fe\u5e93\u5f00\u59cb\uff0cimageStorePersonBindParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)imageStorePersonBindParam), (Object)JSONObject.toJSONString((Object)context));
CloudwalkResult bindResult = this.imageStorePersonService.batchBind(imageStorePersonBindParam, context);
if (!bindResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u7ed1\u5b9a\u4eba\u5458\u56fe\u5e93\u5f02\u5e38\uff0c\u539f\u56e0\uff1a[{}],\u5931\u8d25\u4eba\u5458id:[{}]", (Object)bindResult.getMessage(), (Object)param.getVisitorId());
return CloudwalkResult.fail((String)bindResult.getCode(), (String)bindResult.getMessage());
}
UpdateGroupPersonRefParam refParam = new UpdateGroupPersonRefParam();
refParam.setBusinessId(context.getCompany().getCompanyId());
refParam.setPersonIds(Collections.singletonList(param.getVisitorId()));
refParam.setImageStoreId(imageStoreId);
this.imageStorePersonService.updateGroupPersonRef(refParam, context);
}
catch (Exception e) {
this.logger.error("\u6839\u636e\u88ab\u8bbf\u4eba\u6dfb\u52a0\u8bbf\u5ba2\u6d3e\u68af\u6743\u9650\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Throwable)e);
throw new ServiceException("76260530", this.getMessage("76260530"));
}
return CloudwalkResult.success((Object)true);
}
@Override
public CloudwalkResult<Boolean> edit(AcsPersonEditParam param, CloudwalkCallContext context) throws ServiceException {
return null;
}
@Override
public CloudwalkResult<Boolean> delete(AcsPersonDeleteParam param, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u4ece\u73b0\u6709\u4eba\u5458\u5220\u9664\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonDeleteParam=[{}], CloudwalkCallContext=[{}]", (Object)JSONObject.toJSONString((Object)param), (Object)JSONObject.toJSONString((Object)context));
try {
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
for (String personId : param.getPersonIds()) {
ImageRuleRefResultDto rule = this.imageRuleRefDao.getByPersonIdAndZoneId(Collections.singletonList(personId), param.getZoneId());
if (!ObjectUtils.isEmpty((Object)rule)) {
this.imageRuleRefDao.deleteByPersonId(personId, param.getZoneId());
continue;
}
ImageRuleRefAddDto addDto = new ImageRuleRefAddDto();
addDto.setId(this.genUUID());
addDto.setBusinessId(context.getCompany().getCompanyId());
addDto.setPersonId(personId);
addDto.setZoneId(param.getZoneId());
addDto.setPersonDelete(Integer.valueOf(1));
addDto.setCreateTime(Long.valueOf(System.currentTimeMillis()));
addDto.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
this.imageRuleRefDao.insert(addDto);
}
UpdateGroupPersonRefParam refParam = new UpdateGroupPersonRefParam();
refParam.setBusinessId(context.getCompany().getCompanyId());
refParam.setPersonIds(param.getPersonIds());
refParam.setImageStoreId(imageStoreId);
this.imageStorePersonService.updateGroupPersonRef(refParam, context);
}
catch (DataAccessException e) {
this.logger.error("\u5220\u9664\u901a\u884c\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Throwable)e);
throw new ServiceException("76260523", this.getMessage("76260523"));
}
return CloudwalkResult.success((Object)true);
}
@Override
public CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> page(AcsPersonQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
this.logger.info("\u5206\u9875\u67e5\u8be2\u901a\u884c\u4eba\u5458\u5f00\u59cb\uff0cAcsPersonQueryParam=[{}], CloudwalkPageInfo=[{}], CloudwalkCallContext=[{}]", new Object[]{JSONObject.toJSONString((Object)param), JSONObject.toJSONString((Object)pageInfo), JSONObject.toJSONString((Object)context)});
try {
CloudwalkPageAble<ImageStorePersonResult> pageResult;
ArrayList<AcsPersonResult> result = new ArrayList<AcsPersonResult>();
List<String> personIds = null;
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
if (ObjectUtils.isEmpty((Object)imageStoreId)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
param.setImageStoreId(imageStoreId);
List parentRuleList = this.imageRuleRefDao.listRuleByZoneIdExtDefault(param.getZoneId());
List personIdList = this.imageRuleRefDao.countPersonIdByZoneId(param.getZoneId());
if (CollectionUtils.isEmpty((Collection)parentRuleList) && CollectionUtils.isEmpty((Collection)personIdList)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
param.setPersonIds(personIdList);
if (!CollectionUtils.isEmpty((Collection)parentRuleList)) {
ArrayList<String> includeLabels = new ArrayList<String>();
ArrayList<String> includeOrganizations = new ArrayList<String>();
List child = this.imageRuleRefDao.listByParentRule(parentRuleList);
if (!CollectionUtils.isEmpty((Collection)child)) {
for (ImageRuleRefResultDto resultDto : child) {
if (!ObjectUtils.isEmpty((Object)resultDto.getIncludeLabels())) {
includeLabels.add(resultDto.getIncludeLabels());
continue;
}
if (ObjectUtils.isEmpty((Object)resultDto.getIncludeOrganizations())) continue;
includeOrganizations.add(resultDto.getIncludeOrganizations());
}
} else if (CollectionUtils.isEmpty((Collection)personIdList)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
ArrayList<String> elevatorIncludeLabels = new ArrayList<String>();
ArrayList<String> elevatorOrganizations = new ArrayList<String>();
if (!CollectionUtils.isEmpty(param.getLabelIds())) {
for (String labelId : param.getLabelIds()) {
if (includeLabels.contains(labelId)) continue;
elevatorIncludeLabels.add(labelId);
}
}
if (!CollectionUtils.isEmpty(param.getOrganizationIds())) {
for (String orgId : param.getOrganizationIds()) {
if (includeOrganizations.contains(orgId)) continue;
elevatorOrganizations.add(orgId);
}
}
if (!CollectionUtils.isEmpty(elevatorIncludeLabels)) {
param.setElevatorLabelIds(elevatorIncludeLabels);
}
param.setLabelIds(includeLabels);
if (!CollectionUtils.isEmpty(elevatorOrganizations)) {
param.setElevatorOrganizationIds(elevatorOrganizations);
}
param.setOrganizationIds(includeOrganizations);
List delPersonIds = this.imageRuleRefDao.listPersonDelByZoneId(param.getZoneId());
param.setDelPersonIds(delPersonIds);
}
if (!CollectionUtils.isEmpty(param.getElevatorLabelIds()) || !CollectionUtils.isEmpty(param.getElevatorOrganizationIds())) {
param.setIsElevator(0);
} else if (!CollectionUtils.isEmpty(param.getLabelIds()) && !CollectionUtils.isEmpty(param.getOrganizationIds())) {
param.setIsElevator(3);
param.setElevatorLabelIds(param.getLabelIds());
param.setElevatorOrganizationIds(param.getOrganizationIds());
} else if (!CollectionUtils.isEmpty(param.getOrganizationIds())) {
param.setIsElevator(1);
param.setElevatorOrganizationIds(param.getOrganizationIds());
} else if (!CollectionUtils.isEmpty(param.getLabelIds())) {
param.setIsElevator(2);
param.setElevatorLabelIds(param.getLabelIds());
}
if (!StringUtils.isEmpty((String)param.getPersonName())) {
personIds = this.getPersonIdsByName(param, context);
if (!CollectionUtils.isEmpty(param.getDelPersonIds()) && !CollectionUtils.isEmpty(personIds)) {
ArrayList<String> newPersonIds = new ArrayList<String>();
for (int i = 0; i < personIds.size(); ++i) {
if (param.getDelPersonIds().contains(personIds.get(i))) continue;
newPersonIds.add(personIds.get(i));
}
if (CollectionUtils.isEmpty(newPersonIds)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
personIds.clear();
personIds.addAll(newPersonIds);
}
if (CollectionUtils.isEmpty(personIds)) {
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, 0L));
}
}
if (!CollectionUtils.isEmpty((Collection)(pageResult = this.getImageStorePerson(param, pageInfo, context, imageStoreId, personIds)).getDatas())) {
this.covertPageResult(result, pageResult.getDatas(), context);
}
return CloudwalkResult.success((Object)new CloudwalkPageAble(result, pageInfo, pageResult.getTotalRows()));
}
catch (DataAccessException e) {
this.logger.error("\u5206\u9875\u67e5\u8be2\u901a\u884c\u4eba\u5458\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260528", this.getMessage("76260528"));
}
}
@Override
public CloudwalkResult<AcsPersonTimeDetailResult> timeDetail(AcsPersonTimeDetailParam param, CloudwalkCallContext context) throws ServiceException {
return null;
}
@Override
public CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> pageByApp(AcsPersonQueryByAppParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context) throws ServiceException {
return null;
}
@Override
public CloudwalkResult<CloudwalkPageAble<ImageStorePersonResult>> personDetail(PersonDetailQueryParam param, CloudwalkCallContext context) throws ServiceException {
String imageStoreId = this.deviceImageStoreDao.getByBuildingId(param.getParentId());
List resultDtos = this.imageRuleRefDao.listByParentRule(Collections.singletonList(param.getRuleId()));
try {
List delPersonIds = this.imageRuleRefDao.listPersonDelByZoneId(param.getZoneId());
if (CollectionUtils.isEmpty((Collection)resultDtos)) {
return CloudwalkResult.success(null);
}
ArrayList<String> personIds = new ArrayList<String>();
ArrayList<String> labelIds = new ArrayList<String>();
ArrayList<String> orgIds = new ArrayList<String>();
for (ImageRuleRefResultDto dto : resultDtos) {
if (!ObjectUtils.isEmpty((Object)dto.getPersonId())) {
personIds.add(dto.getPersonId());
}
if (!ObjectUtils.isEmpty((Object)dto.getIncludeLabels())) {
labelIds.add(dto.getIncludeLabels());
}
if (ObjectUtils.isEmpty((Object)dto.getIncludeOrganizations())) continue;
orgIds.add(dto.getIncludeOrganizations());
}
ImageStorePersonQueryParam queryParam = new ImageStorePersonQueryParam();
queryParam.setImageStoreId(imageStoreId);
queryParam.setName(param.getPersonName());
queryParam.setPersonIds(personIds);
queryParam.setLabelIds(labelIds);
queryParam.setOrganizationIds(orgIds);
queryParam.setDelPersonIds(delPersonIds);
queryParam.setIsElevator(Integer.valueOf(0));
queryParam.setRowsOfPage(param.getRowsOfPage());
queryParam.setCurrentPage(param.getCurrentPage());
return this.imageStorePersonService.page(queryParam, context);
}
catch (DataAccessException e) {
this.logger.error("\u5206\u9875\u67e5\u8be2\u901a\u884c\u4eba\u5458\u5931\u8d25", (Throwable)e);
throw new ServiceException("76260528", this.getMessage("76260528"));
}
}
private List<String> getPersonIdsByName(AcsPersonQueryParam param, CloudwalkCallContext context) throws ServiceException {
List<String> personIdsByName = new ArrayList<String>();
if (StringUtils.isNotBlank((String)param.getPersonName())) {
PersonQueryParam personQueryParam = new PersonQueryParam();
personQueryParam.setName(param.getPersonName());
personQueryParam.setIds(param.getPersonIds());
personQueryParam.setLabelIds(param.getElevatorLabelIds());
personQueryParam.setOrganizationIds(param.getElevatorOrganizationIds());
personQueryParam.setIsElevator(param.getIsElevator());
CloudwalkResult personResult = this.personService.list(personQueryParam, context);
List personList = (List)personResult.getData();
if (personResult.isSuccess() && CollectionUtils.isNotEmpty((Collection)personList)) {
ArrayList<PersonResult> newPersonList = new ArrayList<PersonResult>();
for (PersonResult result : personList) {
if (param.getPersonIds().contains(result.getId())) {
newPersonList.add(result);
continue;
}
if (!CollectionUtils.isEmpty((Collection)result.getOrganizationIds())) {
for (String orgId : result.getOrganizationIds()) {
if (CollectionUtils.isEmpty(param.getOrganizationIds()) || !param.getOrganizationIds().contains(orgId)) continue;
newPersonList.add(result);
}
continue;
}
if (CollectionUtils.isEmpty((Collection)result.getLabelIds())) continue;
for (String labelId : result.getLabelIds()) {
if (CollectionUtils.isEmpty(param.getLabelIds()) || !param.getLabelIds().contains(labelId)) continue;
newPersonList.add(result);
}
}
if (CollectionUtils.isNotEmpty(newPersonList)) {
personIdsByName = newPersonList.stream().map(CloudwalkBaseIdentify::getId).collect(Collectors.toList());
}
}
}
return personIdsByName;
}
private CloudwalkPageAble<ImageStorePersonResult> getImageStorePerson(AcsPersonQueryParam param, CloudwalkPageInfo pageInfo, CloudwalkCallContext context, String imageStoreId, List<String> personIds) throws ServiceException {
CloudwalkPageAble results = new CloudwalkPageAble();
ImageStorePersonQueryParam imageStorePersonQueryParam = new ImageStorePersonQueryParam();
imageStorePersonQueryParam.setImageStoreId(imageStoreId);
if (!CollectionUtils.isEmpty(personIds)) {
imageStorePersonQueryParam.setPersonIds(personIds);
imageStorePersonQueryParam.setIsElevator(Integer.valueOf(4));
} else {
imageStorePersonQueryParam.setPersonIds(param.getPersonIds());
imageStorePersonQueryParam.setOrganizationIds(param.getElevatorOrganizationIds());
imageStorePersonQueryParam.setLabelIds(param.getElevatorLabelIds());
imageStorePersonQueryParam.setCurrentPage(pageInfo.getCurrentPage());
imageStorePersonQueryParam.setRowsOfPage(pageInfo.getPageSize());
imageStorePersonQueryParam.setIsElevator(param.getIsElevator());
imageStorePersonQueryParam.setDelPersonIds(param.getDelPersonIds());
}
CloudwalkResult pageResult = this.imageStorePersonService.page(imageStorePersonQueryParam, context);
if (!pageResult.isSuccess()) {
this.logger.error("\u8fdc\u7a0b\u8c03\u7528\u67e5\u8be2\u56fe\u5e93\u4eba\u5458\u5931\u8d25\uff0c\u539f\u56e0\uff1a[{}]", (Object)pageResult.getMessage());
throw new ServiceException(pageResult.getCode(), pageResult.getMessage());
}
if (!CollectionUtils.isEmpty((Collection)((CloudwalkPageAble)pageResult.getData()).getDatas())) {
results = (CloudwalkPageAble)pageResult.getData();
}
return results;
}
private void covertPageResult(List<AcsPersonResult> result, Collection<ImageStorePersonResult> datas, CloudwalkCallContext context) throws ServiceException {
List<String> personIds = datas.stream().map(ImageStorePersonResult::getPersonId).collect(Collectors.toList());
Map<String, PersonResult> personIcCardMap = this.getPersonIcCardByIds(personIds, context);
for (ImageStorePersonResult data : datas) {
Object rule = null;
AcsPersonResult acsPersonResult = new AcsPersonResult();
BeanCopyUtils.copyProperties((Object)data, (Object)acsPersonResult);
acsPersonResult.setPersonName(data.getName());
acsPersonResult.setStartTime(data.getExpiryBeginDate());
acsPersonResult.setEndTime(data.getExpiryEndDate());
acsPersonResult.setPassType(AcsPassTypeEnum.LONG_TIME.getCode());
if (data.getExpiryBeginDate() != null || data.getExpiryEndDate() != null) {
acsPersonResult.setPassType(AcsPassTypeEnum.AUTO_PASS.getCode());
}
if (personIcCardMap != null && personIcCardMap.get(data.getPersonId()) != null) {
acsPersonResult.setIcCardNo(personIcCardMap.get(data.getPersonId()).getIcCardNo());
}
result.add(acsPersonResult);
}
}
private Map<String, PersonResult> getPersonIcCardByIds(List<String> personIds, CloudwalkCallContext context) throws ServiceException {
Map<String, PersonResult> personIcCardMap = null;
PersonQueryParam param = new PersonQueryParam();
param.setIds(personIds);
CloudwalkResult personResult = this.personService.list(param, context);
List personList = (List)personResult.getData();
if (personResult.isSuccess() && CollectionUtils.isNotEmpty((Collection)personList)) {
personIcCardMap = personList.stream().collect(Collectors.toMap(CloudwalkBaseIdentify::getId, PersonResult2 -> PersonResult2));
}
return personIcCardMap;
}
}
@@ -0,0 +1,57 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.validation.Valid
* javax.validation.constraints.NotNull
*/
package cn.cloudwalk.elevator.person.param;
import cn.cloudwalk.elevator.person.param.AcsPersonPropertiesParam;
import java.io.Serializable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
public class AcsPersonAddNewParam
implements Serializable {
private static final long serialVersionUID = -943980110684030345L;
private String zoneId;
private Long startTime;
private Long endTime;
@Valid
@NotNull(message="76260408")
private AcsPersonPropertiesParam personProperties;
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public Long getStartTime() {
return this.startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return this.endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public AcsPersonPropertiesParam getPersonProperties() {
return this.personProperties;
}
public void setPersonProperties(AcsPersonPropertiesParam personProperties) {
this.personProperties = personProperties;
}
}
@@ -0,0 +1,72 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotEmpty
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import java.util.List;
import org.hibernate.validator.constraints.NotEmpty;
public class AcsPersonAddParam
implements Serializable {
private static final long serialVersionUID = 1742648191193141962L;
private String parentId;
private String zoneId;
private String zoneName;
@NotEmpty(message="76260405")
private List<String> personIds;
private Long startTime;
private Long endTime;
public String getZoneName() {
return this.zoneName;
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public List<String> getPersonIds() {
return this.personIds;
}
public void setPersonIds(List<String> personIds) {
this.personIds = personIds;
}
public Long getStartTime() {
return this.startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return this.endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
}
@@ -0,0 +1,118 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import java.util.List;
public class AcsPersonAddVisitorParam
implements Serializable {
private static final long serialVersionUID = 7916140658162290825L;
private String visitorId;
private String personId;
private Long begVisitorTime;
private Long endVisitorTime;
private List<String> floorIds;
public String getVisitorId() {
return this.visitorId;
}
public String getPersonId() {
return this.personId;
}
public Long getBegVisitorTime() {
return this.begVisitorTime;
}
public Long getEndVisitorTime() {
return this.endVisitorTime;
}
public List<String> getFloorIds() {
return this.floorIds;
}
public void setVisitorId(String visitorId) {
this.visitorId = visitorId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public void setBegVisitorTime(Long begVisitorTime) {
this.begVisitorTime = begVisitorTime;
}
public void setEndVisitorTime(Long endVisitorTime) {
this.endVisitorTime = endVisitorTime;
}
public void setFloorIds(List<String> floorIds) {
this.floorIds = floorIds;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AcsPersonAddVisitorParam)) {
return false;
}
AcsPersonAddVisitorParam other = (AcsPersonAddVisitorParam)o;
if (!other.canEqual(this)) {
return false;
}
String this$visitorId = this.getVisitorId();
String other$visitorId = other.getVisitorId();
if (this$visitorId == null ? other$visitorId != null : !this$visitorId.equals(other$visitorId)) {
return false;
}
String this$personId = this.getPersonId();
String other$personId = other.getPersonId();
if (this$personId == null ? other$personId != null : !this$personId.equals(other$personId)) {
return false;
}
Long this$begVisitorTime = this.getBegVisitorTime();
Long other$begVisitorTime = other.getBegVisitorTime();
if (this$begVisitorTime == null ? other$begVisitorTime != null : !((Object)this$begVisitorTime).equals(other$begVisitorTime)) {
return false;
}
Long this$endVisitorTime = this.getEndVisitorTime();
Long other$endVisitorTime = other.getEndVisitorTime();
if (this$endVisitorTime == null ? other$endVisitorTime != null : !((Object)this$endVisitorTime).equals(other$endVisitorTime)) {
return false;
}
List<String> this$floorIds = this.getFloorIds();
List<String> other$floorIds = other.getFloorIds();
return !(this$floorIds == null ? other$floorIds != null : !((Object)this$floorIds).equals(other$floorIds));
}
protected boolean canEqual(Object other) {
return other instanceof AcsPersonAddVisitorParam;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $visitorId = this.getVisitorId();
result = result * 59 + ($visitorId == null ? 43 : $visitorId.hashCode());
String $personId = this.getPersonId();
result = result * 59 + ($personId == null ? 43 : $personId.hashCode());
Long $begVisitorTime = this.getBegVisitorTime();
result = result * 59 + ($begVisitorTime == null ? 43 : ((Object)$begVisitorTime).hashCode());
Long $endVisitorTime = this.getEndVisitorTime();
result = result * 59 + ($endVisitorTime == null ? 43 : ((Object)$endVisitorTime).hashCode());
List<String> $floorIds = this.getFloorIds();
result = result * 59 + ($floorIds == null ? 43 : ((Object)$floorIds).hashCode());
return result;
}
public String toString() {
return "AcsPersonAddVisitorParam(visitorId=" + this.getVisitorId() + ", personId=" + this.getPersonId() + ", begVisitorTime=" + this.getBegVisitorTime() + ", endVisitorTime=" + this.getEndVisitorTime() + ", floorIds=" + this.getFloorIds() + ")";
}
}
@@ -0,0 +1,40 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import java.util.List;
public class AcsPersonCheckTimeParam
implements Serializable {
private static final long serialVersionUID = -4963269689428542769L;
private String personId;
private List<String> imageStoreIds;
private Long time;
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public List<String> getImageStoreIds() {
return this.imageStoreIds;
}
public void setImageStoreIds(List<String> imageStoreIds) {
this.imageStoreIds = imageStoreIds;
}
public Long getTime() {
return this.time;
}
public void setTime(Long time) {
this.time = time;
}
}
@@ -0,0 +1,66 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
* org.hibernate.validator.constraints.NotEmpty
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import java.util.List;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
public class AcsPersonDeleteParam
implements Serializable {
private static final long serialVersionUID = 1742648191193141962L;
private String parentId;
private String zoneId;
@NotEmpty(message="76260405")
private List<String> personIds;
@NotBlank(message="76260418")
private String imageStoreId;
private String personId;
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public String getParentId() {
return this.parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public List<String> getPersonIds() {
return this.personIds;
}
public void setPersonIds(List<String> personIds) {
this.personIds = personIds;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
}
@@ -0,0 +1,35 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPersonDetailParam
implements Serializable {
private static final long serialVersionUID = -4991936524378444365L;
private String zoneId;
@NotBlank(message="76260405")
private String personId;
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
}
@@ -0,0 +1,63 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPersonEditParam
implements Serializable {
private static final long serialVersionUID = 1742648191193141962L;
private String zoneId;
@NotBlank(message="76260405")
private String personId;
private Long startTime;
private Long endTime;
@NotBlank(message="76260418")
private String imageStoreId;
public String getZoneId() {
return this.zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public Long getStartTime() {
return this.startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return this.endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
}
@@ -0,0 +1,36 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPersonFaceParam
implements Serializable {
private static final long serialVersionUID = 1742648191193141962L;
@NotBlank(message="76260402")
private String deviceId;
@NotBlank(message="76260403")
private String faceImage;
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getFaceImage() {
return this.faceImage;
}
public void setFaceImage(String faceImage) {
this.faceImage = faceImage;
}
}
@@ -0,0 +1,495 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import java.util.List;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPersonPropertiesParam
implements Serializable {
private static final long serialVersionUID = -448990843685123843L;
private String name;
private String userName;
private String personCode;
private String phone;
private String email;
private List<String> organizationIds;
private List<String> labelIds;
private Long expiryBeginDate;
private Long expiryEndDate;
@NotBlank(message="76260412")
private String comparePicture;
private String ext1;
private String ext2;
private String ext3;
private String ext4;
private String ext5;
private String ext6;
private String ext7;
private String ext8;
private String ext9;
private String ext10;
private String ext11;
private String ext12;
private String ext13;
private String ext14;
private String ext15;
private String ext16;
private String ext17;
private String ext18;
private String ext19;
private String ext20;
private String ext21;
private String ext22;
private String ext23;
private String ext24;
private String ext25;
private String ext26;
private String ext27;
private String ext28;
private String ext29;
private String ext30;
private String ext31;
private String ext32;
private String ext33;
private String ext34;
private String ext35;
private String ext36;
private String ext37;
private String ext38;
private String ext39;
private String ext40;
private Integer createSysAccount;
private String welcome;
private String showPicture;
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPersonCode() {
return this.personCode;
}
public void setPersonCode(String personCode) {
this.personCode = personCode;
}
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public List<String> getOrganizationIds() {
return this.organizationIds;
}
public void setOrganizationIds(List<String> organizationIds) {
this.organizationIds = organizationIds;
}
public List<String> getLabelIds() {
return this.labelIds;
}
public void setLabelIds(List<String> labelIds) {
this.labelIds = labelIds;
}
public Long getExpiryBeginDate() {
return this.expiryBeginDate;
}
public void setExpiryBeginDate(Long expiryBeginDate) {
this.expiryBeginDate = expiryBeginDate;
}
public Long getExpiryEndDate() {
return this.expiryEndDate;
}
public void setExpiryEndDate(Long expiryEndDate) {
this.expiryEndDate = expiryEndDate;
}
public String getComparePicture() {
return this.comparePicture;
}
public void setComparePicture(String comparePicture) {
this.comparePicture = comparePicture;
}
public String getExt1() {
return this.ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return this.ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return this.ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
public String getExt4() {
return this.ext4;
}
public void setExt4(String ext4) {
this.ext4 = ext4;
}
public String getExt5() {
return this.ext5;
}
public void setExt5(String ext5) {
this.ext5 = ext5;
}
public String getExt6() {
return this.ext6;
}
public void setExt6(String ext6) {
this.ext6 = ext6;
}
public String getExt7() {
return this.ext7;
}
public void setExt7(String ext7) {
this.ext7 = ext7;
}
public String getExt8() {
return this.ext8;
}
public void setExt8(String ext8) {
this.ext8 = ext8;
}
public String getExt9() {
return this.ext9;
}
public void setExt9(String ext9) {
this.ext9 = ext9;
}
public String getExt10() {
return this.ext10;
}
public void setExt10(String ext10) {
this.ext10 = ext10;
}
public String getExt11() {
return this.ext11;
}
public void setExt11(String ext11) {
this.ext11 = ext11;
}
public String getExt12() {
return this.ext12;
}
public void setExt12(String ext12) {
this.ext12 = ext12;
}
public String getExt13() {
return this.ext13;
}
public void setExt13(String ext13) {
this.ext13 = ext13;
}
public String getExt14() {
return this.ext14;
}
public void setExt14(String ext14) {
this.ext14 = ext14;
}
public String getExt15() {
return this.ext15;
}
public void setExt15(String ext15) {
this.ext15 = ext15;
}
public String getExt16() {
return this.ext16;
}
public void setExt16(String ext16) {
this.ext16 = ext16;
}
public String getExt17() {
return this.ext17;
}
public void setExt17(String ext17) {
this.ext17 = ext17;
}
public String getExt18() {
return this.ext18;
}
public void setExt18(String ext18) {
this.ext18 = ext18;
}
public String getExt19() {
return this.ext19;
}
public void setExt19(String ext19) {
this.ext19 = ext19;
}
public String getExt20() {
return this.ext20;
}
public void setExt20(String ext20) {
this.ext20 = ext20;
}
public String getExt21() {
return this.ext21;
}
public void setExt21(String ext21) {
this.ext21 = ext21;
}
public String getExt22() {
return this.ext22;
}
public void setExt22(String ext22) {
this.ext22 = ext22;
}
public String getExt23() {
return this.ext23;
}
public void setExt23(String ext23) {
this.ext23 = ext23;
}
public String getExt24() {
return this.ext24;
}
public void setExt24(String ext24) {
this.ext24 = ext24;
}
public String getExt25() {
return this.ext25;
}
public void setExt25(String ext25) {
this.ext25 = ext25;
}
public String getExt26() {
return this.ext26;
}
public void setExt26(String ext26) {
this.ext26 = ext26;
}
public String getExt27() {
return this.ext27;
}
public void setExt27(String ext27) {
this.ext27 = ext27;
}
public String getExt28() {
return this.ext28;
}
public void setExt28(String ext28) {
this.ext28 = ext28;
}
public String getExt29() {
return this.ext29;
}
public void setExt29(String ext29) {
this.ext29 = ext29;
}
public String getExt30() {
return this.ext30;
}
public void setExt30(String ext30) {
this.ext30 = ext30;
}
public String getExt31() {
return this.ext31;
}
public void setExt31(String ext31) {
this.ext31 = ext31;
}
public String getExt32() {
return this.ext32;
}
public void setExt32(String ext32) {
this.ext32 = ext32;
}
public String getExt33() {
return this.ext33;
}
public void setExt33(String ext33) {
this.ext33 = ext33;
}
public String getExt34() {
return this.ext34;
}
public void setExt34(String ext34) {
this.ext34 = ext34;
}
public String getExt35() {
return this.ext35;
}
public void setExt35(String ext35) {
this.ext35 = ext35;
}
public String getExt36() {
return this.ext36;
}
public void setExt36(String ext36) {
this.ext36 = ext36;
}
public String getExt37() {
return this.ext37;
}
public void setExt37(String ext37) {
this.ext37 = ext37;
}
public String getExt38() {
return this.ext38;
}
public void setExt38(String ext38) {
this.ext38 = ext38;
}
public String getExt39() {
return this.ext39;
}
public void setExt39(String ext39) {
this.ext39 = ext39;
}
public String getExt40() {
return this.ext40;
}
public void setExt40(String ext40) {
this.ext40 = ext40;
}
public Integer getCreateSysAccount() {
return this.createSysAccount;
}
public void setCreateSysAccount(Integer createSysAccount) {
this.createSysAccount = createSysAccount;
}
public String getWelcome() {
return this.welcome;
}
public void setWelcome(String welcome) {
this.welcome = welcome;
}
public String getShowPicture() {
return this.showPicture;
}
public void setShowPicture(String showPicture) {
this.showPicture = showPicture;
}
}
@@ -0,0 +1,45 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPersonQueryByAppParam
implements Serializable {
private static final long serialVersionUID = -4823559329166668237L;
@NotBlank(message="76260402")
private String deviceId;
@NotBlank(message="76260415")
private String applicationId;
private String personName;
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getApplicationId() {
return this.applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
public String getPersonName() {
return this.personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
}
@@ -0,0 +1,214 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import java.util.List;
public class AcsPersonQueryParam
implements Serializable {
private static final long serialVersionUID = -3343979289939890513L;
private String parentId;
private String zoneId;
private String personName;
private String imageStoreId;
private List<String> organizationIds;
private List<String> labelIds;
private List<String> personIds;
private Integer isElevator;
private List<String> delPersonIds;
private List<String> elevatorLabelIds;
private List<String> elevatorOrganizationIds;
public String getParentId() {
return this.parentId;
}
public String getZoneId() {
return this.zoneId;
}
public String getPersonName() {
return this.personName;
}
public String getImageStoreId() {
return this.imageStoreId;
}
public List<String> getOrganizationIds() {
return this.organizationIds;
}
public List<String> getLabelIds() {
return this.labelIds;
}
public List<String> getPersonIds() {
return this.personIds;
}
public Integer getIsElevator() {
return this.isElevator;
}
public List<String> getDelPersonIds() {
return this.delPersonIds;
}
public List<String> getElevatorLabelIds() {
return this.elevatorLabelIds;
}
public List<String> getElevatorOrganizationIds() {
return this.elevatorOrganizationIds;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public void setOrganizationIds(List<String> organizationIds) {
this.organizationIds = organizationIds;
}
public void setLabelIds(List<String> labelIds) {
this.labelIds = labelIds;
}
public void setPersonIds(List<String> personIds) {
this.personIds = personIds;
}
public void setIsElevator(Integer isElevator) {
this.isElevator = isElevator;
}
public void setDelPersonIds(List<String> delPersonIds) {
this.delPersonIds = delPersonIds;
}
public void setElevatorLabelIds(List<String> elevatorLabelIds) {
this.elevatorLabelIds = elevatorLabelIds;
}
public void setElevatorOrganizationIds(List<String> elevatorOrganizationIds) {
this.elevatorOrganizationIds = elevatorOrganizationIds;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof AcsPersonQueryParam)) {
return false;
}
AcsPersonQueryParam other = (AcsPersonQueryParam)o;
if (!other.canEqual(this)) {
return false;
}
String this$parentId = this.getParentId();
String other$parentId = other.getParentId();
if (this$parentId == null ? other$parentId != null : !this$parentId.equals(other$parentId)) {
return false;
}
String this$zoneId = this.getZoneId();
String other$zoneId = other.getZoneId();
if (this$zoneId == null ? other$zoneId != null : !this$zoneId.equals(other$zoneId)) {
return false;
}
String this$personName = this.getPersonName();
String other$personName = other.getPersonName();
if (this$personName == null ? other$personName != null : !this$personName.equals(other$personName)) {
return false;
}
String this$imageStoreId = this.getImageStoreId();
String other$imageStoreId = other.getImageStoreId();
if (this$imageStoreId == null ? other$imageStoreId != null : !this$imageStoreId.equals(other$imageStoreId)) {
return false;
}
List<String> this$organizationIds = this.getOrganizationIds();
List<String> other$organizationIds = other.getOrganizationIds();
if (this$organizationIds == null ? other$organizationIds != null : !((Object)this$organizationIds).equals(other$organizationIds)) {
return false;
}
List<String> this$labelIds = this.getLabelIds();
List<String> other$labelIds = other.getLabelIds();
if (this$labelIds == null ? other$labelIds != null : !((Object)this$labelIds).equals(other$labelIds)) {
return false;
}
List<String> this$personIds = this.getPersonIds();
List<String> other$personIds = other.getPersonIds();
if (this$personIds == null ? other$personIds != null : !((Object)this$personIds).equals(other$personIds)) {
return false;
}
Integer this$isElevator = this.getIsElevator();
Integer other$isElevator = other.getIsElevator();
if (this$isElevator == null ? other$isElevator != null : !((Object)this$isElevator).equals(other$isElevator)) {
return false;
}
List<String> this$delPersonIds = this.getDelPersonIds();
List<String> other$delPersonIds = other.getDelPersonIds();
if (this$delPersonIds == null ? other$delPersonIds != null : !((Object)this$delPersonIds).equals(other$delPersonIds)) {
return false;
}
List<String> this$elevatorLabelIds = this.getElevatorLabelIds();
List<String> other$elevatorLabelIds = other.getElevatorLabelIds();
if (this$elevatorLabelIds == null ? other$elevatorLabelIds != null : !((Object)this$elevatorLabelIds).equals(other$elevatorLabelIds)) {
return false;
}
List<String> this$elevatorOrganizationIds = this.getElevatorOrganizationIds();
List<String> other$elevatorOrganizationIds = other.getElevatorOrganizationIds();
return !(this$elevatorOrganizationIds == null ? other$elevatorOrganizationIds != null : !((Object)this$elevatorOrganizationIds).equals(other$elevatorOrganizationIds));
}
protected boolean canEqual(Object other) {
return other instanceof AcsPersonQueryParam;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $parentId = this.getParentId();
result = result * 59 + ($parentId == null ? 43 : $parentId.hashCode());
String $zoneId = this.getZoneId();
result = result * 59 + ($zoneId == null ? 43 : $zoneId.hashCode());
String $personName = this.getPersonName();
result = result * 59 + ($personName == null ? 43 : $personName.hashCode());
String $imageStoreId = this.getImageStoreId();
result = result * 59 + ($imageStoreId == null ? 43 : $imageStoreId.hashCode());
List<String> $organizationIds = this.getOrganizationIds();
result = result * 59 + ($organizationIds == null ? 43 : ((Object)$organizationIds).hashCode());
List<String> $labelIds = this.getLabelIds();
result = result * 59 + ($labelIds == null ? 43 : ((Object)$labelIds).hashCode());
List<String> $personIds = this.getPersonIds();
result = result * 59 + ($personIds == null ? 43 : ((Object)$personIds).hashCode());
Integer $isElevator = this.getIsElevator();
result = result * 59 + ($isElevator == null ? 43 : ((Object)$isElevator).hashCode());
List<String> $delPersonIds = this.getDelPersonIds();
result = result * 59 + ($delPersonIds == null ? 43 : ((Object)$delPersonIds).hashCode());
List<String> $elevatorLabelIds = this.getElevatorLabelIds();
result = result * 59 + ($elevatorLabelIds == null ? 43 : ((Object)$elevatorLabelIds).hashCode());
List<String> $elevatorOrganizationIds = this.getElevatorOrganizationIds();
result = result * 59 + ($elevatorOrganizationIds == null ? 43 : ((Object)$elevatorOrganizationIds).hashCode());
return result;
}
public String toString() {
return "AcsPersonQueryParam(parentId=" + this.getParentId() + ", zoneId=" + this.getZoneId() + ", personName=" + this.getPersonName() + ", imageStoreId=" + this.getImageStoreId() + ", organizationIds=" + this.getOrganizationIds() + ", labelIds=" + this.getLabelIds() + ", personIds=" + this.getPersonIds() + ", isElevator=" + this.getIsElevator() + ", delPersonIds=" + this.getDelPersonIds() + ", elevatorLabelIds=" + this.getElevatorLabelIds() + ", elevatorOrganizationIds=" + this.getElevatorOrganizationIds() + ")";
}
}
@@ -0,0 +1,35 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* org.hibernate.validator.constraints.NotBlank
*/
package cn.cloudwalk.elevator.person.param;
import java.io.Serializable;
import org.hibernate.validator.constraints.NotBlank;
public class AcsPersonTimeDetailParam
implements Serializable {
private static final long serialVersionUID = 9094521665731451301L;
private String imageStoreId;
@NotBlank(message="76260405")
private String personId;
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
}
@@ -0,0 +1,106 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* cn.cloudwalk.cloud.page.CloudwalkBasePageForm
*/
package cn.cloudwalk.elevator.person.param;
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
import java.io.Serializable;
public class PersonDetailQueryParam
extends CloudwalkBasePageForm
implements Serializable {
private static final long serialVersionUID = -8830219133147503297L;
private String parentId;
private String zoneId;
private String ruleId;
private String personName;
public String getParentId() {
return this.parentId;
}
public String getZoneId() {
return this.zoneId;
}
public String getRuleId() {
return this.ruleId;
}
public String getPersonName() {
return this.personName;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public void setRuleId(String ruleId) {
this.ruleId = ruleId;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof PersonDetailQueryParam)) {
return false;
}
PersonDetailQueryParam other = (PersonDetailQueryParam)o;
if (!other.canEqual(this)) {
return false;
}
String this$parentId = this.getParentId();
String other$parentId = other.getParentId();
if (this$parentId == null ? other$parentId != null : !this$parentId.equals(other$parentId)) {
return false;
}
String this$zoneId = this.getZoneId();
String other$zoneId = other.getZoneId();
if (this$zoneId == null ? other$zoneId != null : !this$zoneId.equals(other$zoneId)) {
return false;
}
String this$ruleId = this.getRuleId();
String other$ruleId = other.getRuleId();
if (this$ruleId == null ? other$ruleId != null : !this$ruleId.equals(other$ruleId)) {
return false;
}
String this$personName = this.getPersonName();
String other$personName = other.getPersonName();
return !(this$personName == null ? other$personName != null : !this$personName.equals(other$personName));
}
protected boolean canEqual(Object other) {
return other instanceof PersonDetailQueryParam;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
String $parentId = this.getParentId();
result = result * 59 + ($parentId == null ? 43 : $parentId.hashCode());
String $zoneId = this.getZoneId();
result = result * 59 + ($zoneId == null ? 43 : $zoneId.hashCode());
String $ruleId = this.getRuleId();
result = result * 59 + ($ruleId == null ? 43 : $ruleId.hashCode());
String $personName = this.getPersonName();
result = result * 59 + ($personName == null ? 43 : $personName.hashCode());
return result;
}
public String toString() {
return "PersonDetailQueryParam(parentId=" + this.getParentId() + ", zoneId=" + this.getZoneId() + ", ruleId=" + this.getRuleId() + ", personName=" + this.getPersonName() + ")";
}
}
@@ -0,0 +1,40 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.result;
import java.io.Serializable;
import java.util.List;
public class AcsAppResult
implements Serializable {
private static final long serialVersionUID = 2531683869129123657L;
private String applicationId;
private String applicationName;
private List<String> passIntervals;
public String getApplicationId() {
return this.applicationId;
}
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
public String getApplicationName() {
return this.applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
public List<String> getPassIntervals() {
return this.passIntervals;
}
public void setPassIntervals(List<String> passIntervals) {
this.passIntervals = passIntervals;
}
}
@@ -0,0 +1,39 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.result;
import java.io.Serializable;
public class AcsImageStoreStatisticsResult
implements Serializable {
private static final long serialVersionUID = 2509672603592424330L;
private String imageStoreId;
private String imageStoreName;
private Integer personNum;
public String getImageStoreId() {
return this.imageStoreId;
}
public void setImageStoreId(String imageStoreId) {
this.imageStoreId = imageStoreId;
}
public String getImageStoreName() {
return this.imageStoreName;
}
public void setImageStoreName(String imageStoreName) {
this.imageStoreName = imageStoreName;
}
public Integer getPersonNum() {
return this.personNum;
}
public void setPersonNum(Integer personNum) {
this.personNum = personNum;
}
}
@@ -0,0 +1,23 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.result;
import cn.cloudwalk.elevator.person.result.AppImageStoreStatisticsResult;
import java.io.Serializable;
import java.util.List;
public class AcsImagestorePersonStatisticsResult
implements Serializable {
private static final long serialVersionUID = 8443213995134853671L;
private List<AppImageStoreStatisticsResult> appImageStores;
public List<AppImageStoreStatisticsResult> getAppImageStores() {
return this.appImageStores;
}
public void setAppImageStores(List<AppImageStoreStatisticsResult> appImageStores) {
this.appImageStores = appImageStores;
}
}
@@ -0,0 +1,50 @@
/*
* Decompiled with CFR 0.152.
*/
package cn.cloudwalk.elevator.person.result;
import cn.cloudwalk.elevator.person.result.AcsAppResult;
import java.io.Serializable;
import java.util.List;
public class AcsPersonDetailResult
implements Serializable {
private static final long serialVersionUID = 6635686175965530739L;
private String personId;
private String personName;
private String comparePicture;
private List<AcsAppResult> apps;
public String getPersonId() {
return this.personId;
}
public void setPersonId(String personId) {
this.personId = personId;
}
public String getPersonName() {
return this.personName;
}
public void setPersonName(String personName) {
this.personName = personName;
}
public String getComparePicture() {
return this.comparePicture;
}
public void setComparePicture(String comparePicture) {
this.comparePicture = comparePicture;
}
public List<AcsAppResult> getApps() {
return this.apps;
}
public void setApps(List<AcsAppResult> apps) {
this.apps = apps;
}
}

Some files were not shown because too many files have changed in this diff Show More