mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
Initial commit: reorganized source tree
- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.) - frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts - scripts/: build, test-env, tools (Docker Compose, service templates, API parity) - docs/: AGENTS.md, superpowers specs, architecture docs - .gitignore: standard Java/Maven exclusions Moved from legacy maven-*/ root layout to backend/ organized structure.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>cn.cloudwalk.elevator</groupId>
|
||||
<artifactId>cw-elevator-application-reactor</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>cw-elevator-application-web</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<alibaba.eclipse.codestyle.path>${project.basedir}/../../docs/style/alibaba-eclipse-codestyle.xml</alibaba.eclipse.codestyle.path>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.cloudwalk.cloud</groupId>
|
||||
<artifactId>cloudwalk-common-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.cloudwalk.elevator</groupId>
|
||||
<artifactId>cw-elevator-application-service</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.revelc.code.formatter</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContextBuilder;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionContextHolder;
|
||||
import cn.cloudwalk.cloud.session.extend.DefaultExtendContext;
|
||||
import cn.cloudwalk.cloud.session.extend.ExtendContext;
|
||||
import cn.cloudwalk.elevator.context.CloudWalkExtendContextValue;
|
||||
import java.net.URLEncoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
public abstract class AbstractCloudwalkController {
|
||||
protected final Logger LOGGER = LoggerFactory.getLogger(getClass());
|
||||
@Autowired
|
||||
private MessageSource messageSource;
|
||||
@Autowired
|
||||
private CloudwalkSessionContextHolder cloudwalkSessionContextHolder;
|
||||
|
||||
public CloudwalkCallContext getCloudwalkContext() {
|
||||
CloudwalkCallContext cloudwalkCallContext =
|
||||
CloudwalkCallContextBuilder.buildContext(this.cloudwalkSessionContextHolder);
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
DefaultExtendContext<CloudWalkExtendContextValue> extendContext = new DefaultExtendContext();
|
||||
CloudWalkExtendContextValue cloudWalkExtendContextValue = new CloudWalkExtendContextValue();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
cloudWalkExtendContextValue.setLoginId(request.getHeader("loginid"));
|
||||
cloudWalkExtendContextValue.setAuthorization(request.getHeader("authorization"));
|
||||
extendContext.setValue(cloudWalkExtendContextValue);
|
||||
cloudwalkCallContext.setExt((ExtendContext)extendContext);
|
||||
}
|
||||
return cloudwalkCallContext;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
return attributes.getRequest().getHeader("authorization");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected HttpServletRequest getHttpServletRequest() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
return null;
|
||||
}
|
||||
return attributes.getRequest();
|
||||
}
|
||||
|
||||
public String getMessage(String code, String defaultMsg) {
|
||||
return this.messageSource.getMessage(code, null, defaultMsg, LocaleContextHolder.getLocale());
|
||||
}
|
||||
|
||||
public String getMessage(String code) {
|
||||
return getMessage(code, "");
|
||||
}
|
||||
|
||||
protected void makeExcelresponse(HttpServletRequest request, HttpServletResponse response, String fileName) {
|
||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + encodeFileName(fileName, request));
|
||||
}
|
||||
|
||||
protected String encodeFileName(String fileNames, HttpServletRequest request) {
|
||||
String codedFilename = null;
|
||||
try {
|
||||
codedFilename = URLEncoder.encode(fileNames, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("转换文件名字符类型失败,原因:", e);
|
||||
}
|
||||
return codedFilename != null ? codedFilename : fileNames;
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package cn.cloudwalk.elevator.common;
|
||||
|
||||
public class CloudwalkCallNewContext {}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package cn.cloudwalk.elevator.handler;
|
||||
|
||||
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.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.session.company.CompanyContext;
|
||||
import cn.cloudwalk.cloud.session.user.UserContext;
|
||||
import cn.cloudwalk.cloud.utils.CloudwalkDateUtils;
|
||||
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
|
||||
import cn.cloudwalk.elevator.record.service.AcsElevatorRecordService;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
public abstract class AbstractEventHandler {
|
||||
protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractEventHandler.class);
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
@Resource
|
||||
private AcsElevatorRecordService acsElevatorRecordService;
|
||||
@Resource
|
||||
protected RedisTemplate<String, Object> redisTemplate;
|
||||
@Autowired
|
||||
private MessageSource messageSource;
|
||||
|
||||
public CloudwalkCallContext getCloudwalkContext(String businessId) {
|
||||
CloudwalkCallContext context = new CloudwalkCallContext();
|
||||
CompanyContext companyContext = new CompanyContext();
|
||||
companyContext.setCompanyId(businessId);
|
||||
context.setCompany(companyContext);
|
||||
UserContext userContext = new UserContext();
|
||||
userContext.setCaller("defaultUserId");
|
||||
userContext.setCallerName("defaultUserName");
|
||||
context.setUser(userContext);
|
||||
context.setCallTime(CloudwalkDateUtils.getCurrentDate());
|
||||
Map<String, String> feignThreadLoaclMap = new HashMap<>(3);
|
||||
feignThreadLoaclMap.put("businessid", businessId);
|
||||
feignThreadLoaclMap.put("platformuserid", "defaultUserId");
|
||||
feignThreadLoaclMap.put("username", "defaultUserName");
|
||||
FeignThreadLocalUtil.set(feignThreadLoaclMap);
|
||||
return context;
|
||||
}
|
||||
|
||||
DeviceResult queryDeviceResult(String deviceCode, CloudwalkCallContext context) throws ServiceException {
|
||||
DeviceQueryParam deviceQueryParam = new DeviceQueryParam();
|
||||
deviceQueryParam.setDeviceCode(deviceCode);
|
||||
CloudwalkResult<List<DeviceResult>> deviceQueryResult = this.deviceService.list(deviceQueryParam, context);
|
||||
if (deviceQueryResult.isSuccess() && CollectionUtils.isNotEmpty((Collection)deviceQueryResult.getData())) {
|
||||
return ((List<DeviceResult>)deviceQueryResult.getData()).get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void statisticsAddCache(String key) {
|
||||
if (!this.redisTemplate.hasKey(key).booleanValue()) {
|
||||
this.acsElevatorRecordService.createCache(key, 0L);
|
||||
}
|
||||
this.redisTemplate.opsForValue().increment(key, 1L);
|
||||
}
|
||||
|
||||
public String getMessage(String code, String defaultMsg) {
|
||||
return this.messageSource.getMessage(code, null, defaultMsg, LocaleContextHolder.getLocale());
|
||||
}
|
||||
|
||||
public String getMessage(String code) {
|
||||
return getMessage(code, "");
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package cn.cloudwalk.elevator.handler;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.cwos.client.event.event.BaseEvent;
|
||||
import cn.cloudwalk.cwos.client.event.event.OpenDoorRecordEvent;
|
||||
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
|
||||
import cn.cloudwalk.elevator.em.AcsDeviceIdentifyTypeEnum;
|
||||
import cn.cloudwalk.elevator.record.dto.AcsElevatorRecordExtraDTO;
|
||||
import cn.cloudwalk.elevator.record.param.AcsElevatorRecordAddParam;
|
||||
import cn.cloudwalk.elevator.record.param.AcsOpenDoorRecordAddParam;
|
||||
import cn.cloudwalk.elevator.record.service.AcsElevatorRecordService;
|
||||
import cn.cloudwalk.elevator.util.AcsCacheKeyUtil;
|
||||
import cn.cloudwalk.elevator.util.DateUtils;
|
||||
import cn.cloudwalk.event.annotation.EventTopicSuffix;
|
||||
import cn.cloudwalk.event.handler.EventHandler;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.Date;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@EventTopicSuffix({"all"})
|
||||
public class OpenDoorRecordEventHandler extends AbstractEventHandler implements EventHandler<OpenDoorRecordEvent> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(OpenDoorRecordEventHandler.class);
|
||||
@Resource
|
||||
private AcsElevatorRecordService acsElevatorRecordService;
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
public void onEvent(OpenDoorRecordEvent openDoorRecordEvent) {
|
||||
LOGGER.info("收到openDoorRecordEvent消息:{}", JSON.toJSONString(openDoorRecordEvent));
|
||||
try {
|
||||
CloudwalkCallContext context = getCloudwalkContext(openDoorRecordEvent.getBusinessId());
|
||||
DeviceResult deviceResult = super.queryDeviceResult(openDoorRecordEvent.getDeviceId(), context);
|
||||
AcsOpenDoorRecordAddParam param = getParam(openDoorRecordEvent);
|
||||
param.setDeviceResult(deviceResult);
|
||||
AcsElevatorRecordExtraDTO elevatorRecordExtraDTO = null;
|
||||
if (StringUtils.isNotBlank(openDoorRecordEvent.getReserveInfo())) {
|
||||
JSONObject reserveInfo = JSON.parseObject(openDoorRecordEvent.getReserveInfo());
|
||||
if (!reserveInfo.isEmpty() && reserveInfo.containsKey("srcFloor")) {
|
||||
elevatorRecordExtraDTO =
|
||||
(AcsElevatorRecordExtraDTO)reserveInfo.toJavaObject(AcsElevatorRecordExtraDTO.class);
|
||||
}
|
||||
}
|
||||
if (deviceResult != null && AcsDeviceIdentifyTypeEnum.BACKEND_REG.getCode()
|
||||
.equals(Integer.valueOf(deviceResult.getIdentifyType()))) {
|
||||
// noop: backend-reg 设备不落电梯记录
|
||||
} else if (elevatorRecordExtraDTO != null) {
|
||||
AcsElevatorRecordAddParam elevatorParam = getElevatorParam(param, elevatorRecordExtraDTO);
|
||||
CloudwalkResult<Boolean> addResult = this.acsElevatorRecordService.add(elevatorParam, context);
|
||||
if (param.getRecordResult().intValue() == 1 && addResult.isSuccess()
|
||||
&& "1".equals(elevatorRecordExtraDTO.getSrcFloor())) {
|
||||
statisticsAddCache(AcsCacheKeyUtil.getOpenDoorCountKey(
|
||||
DateUtils.parseDate(new Date(), "yyyy-MM-dd"), openDoorRecordEvent.getBusinessId()));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("消费开门记录失败,原因:", e);
|
||||
} finally {
|
||||
FeignThreadLocalUtil.remove();
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanCache(CloudwalkCallContext context, DeviceResult deviceResult, String openDoorLogId,
|
||||
String recognitionNo) {
|
||||
String backendRegLogIdKey = AcsCacheKeyUtil.getBackendRegLogIdKey(deviceResult.getDeviceCode(),
|
||||
context.getCompany().getCompanyId(), recognitionNo);
|
||||
String backendRegExpireKey =
|
||||
AcsCacheKeyUtil.getBackendRegExpireKey(context.getCompany().getCompanyId(), openDoorLogId);
|
||||
this.redisTemplate.delete(backendRegLogIdKey);
|
||||
this.redisTemplate.delete(backendRegExpireKey);
|
||||
}
|
||||
|
||||
private AcsOpenDoorRecordAddParam getParam(OpenDoorRecordEvent event) {
|
||||
AcsOpenDoorRecordAddParam param =
|
||||
(AcsOpenDoorRecordAddParam)BeanCopyUtils.copyProperties(event, AcsOpenDoorRecordAddParam.class);
|
||||
param.setRecordResult(Integer.valueOf(Integer.parseInt(event.getRecordResult())));
|
||||
param.setDeviceCode(event.getDeviceId());
|
||||
param.setOpenDoorType(event.getOpenDoorType());
|
||||
return param;
|
||||
}
|
||||
|
||||
private AcsElevatorRecordAddParam getElevatorParam(AcsOpenDoorRecordAddParam addParam,
|
||||
AcsElevatorRecordExtraDTO elevatorRecordExtraDTO) {
|
||||
AcsElevatorRecordAddParam param =
|
||||
(AcsElevatorRecordAddParam)BeanCopyUtils.copyProperties(addParam, AcsElevatorRecordAddParam.class);
|
||||
return (AcsElevatorRecordAddParam)BeanCopyUtils.copyProperties(elevatorRecordExtraDTO, param);
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package cn.cloudwalk.elevator.handler;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.cwos.client.event.event.BaseEvent;
|
||||
import cn.cloudwalk.cwos.client.event.event.PersonRecordUploadEvent;
|
||||
import cn.cloudwalk.cwos.client.event.event.mode.Face;
|
||||
import cn.cloudwalk.elevator.config.FeignThreadLocalUtil;
|
||||
import cn.cloudwalk.elevator.em.CompareTypeEnum;
|
||||
import cn.cloudwalk.elevator.record.param.AcsRecogRecordAddParam;
|
||||
import cn.cloudwalk.elevator.record.service.AcsRecogRecordService;
|
||||
import cn.cloudwalk.elevator.util.AcsCacheKeyUtil;
|
||||
import cn.cloudwalk.elevator.util.DateUtils;
|
||||
import cn.cloudwalk.event.annotation.EventTopicSuffix;
|
||||
import cn.cloudwalk.event.handler.EventHandler;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
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.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@EventTopicSuffix({"all"})
|
||||
public class PersonRecordEventHandler extends AbstractEventHandler implements EventHandler<PersonRecordUploadEvent> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PersonRecordEventHandler.class);
|
||||
@Resource
|
||||
private AcsRecogRecordService acsRecogRecordService;
|
||||
|
||||
public void onEvent(PersonRecordUploadEvent personRecordUploadEvent) {
|
||||
LOGGER.info("收到personRecordUploadEvent消息:{}", JSON.toJSONString(personRecordUploadEvent));
|
||||
try {
|
||||
CloudwalkCallContext context = getCloudwalkContext(personRecordUploadEvent.getBusinessId());
|
||||
DeviceResult deviceResult = super.queryDeviceResult(personRecordUploadEvent.getDeviceId(), context);
|
||||
DeviceResult subDeviceResult = super.queryDeviceResult(personRecordUploadEvent.getSubDeviceId(), context);
|
||||
Map<String, List<Face>> faceMap = (Map<String, List<Face>>)personRecordUploadEvent.getFaces().stream()
|
||||
.collect(Collectors.groupingBy(Face::getFaceId));
|
||||
for (String faceId : faceMap.keySet()) {
|
||||
try {
|
||||
Face face = ((List<Face>)faceMap.get(faceId)).get(0);
|
||||
AcsRecogRecordAddParam param = getParam(personRecordUploadEvent, face);
|
||||
param.setDeviceResult(deviceResult);
|
||||
param.setSubDeviceResult(subDeviceResult);
|
||||
this.acsRecogRecordService.add(param, context);
|
||||
statisticsAddCache(AcsCacheKeyUtil.getRecogCountKey(DateUtils.parseDate(new Date(), "yyyy-MM-dd"),
|
||||
personRecordUploadEvent.getBusinessId()));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("保存人员识别记录失败,faceId:{},原因:", faceId, e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("消费人员识别记录失败,原因:", e);
|
||||
} finally {
|
||||
FeignThreadLocalUtil.remove();
|
||||
}
|
||||
}
|
||||
|
||||
private AcsRecogRecordAddParam getParam(PersonRecordUploadEvent event, Face face) {
|
||||
AcsRecogRecordAddParam param =
|
||||
(AcsRecogRecordAddParam)BeanCopyUtils.copyProperties(event, AcsRecogRecordAddParam.class);
|
||||
BeanCopyUtils.copyProperties(face, param);
|
||||
if (event.getPanoramaData() != null) {
|
||||
param.setPanoramaImagePath(event.getPanoramaData().getPanoramaImagePath());
|
||||
}
|
||||
param.setDeviceCode(event.getDeviceId());
|
||||
param.setThreshold(BigDecimal.valueOf(event.getThreshold()));
|
||||
param.setScore(BigDecimal.valueOf(face.getScore().floatValue()));
|
||||
param.setQualityScore(BigDecimal.valueOf(face.getQualityScore().floatValue()));
|
||||
if (face.getMaskScore() != null) {
|
||||
param.setMaskScore(BigDecimal.valueOf(face.getMaskScore().floatValue()));
|
||||
}
|
||||
if (face.getTempScore() != null) {
|
||||
param.setTempScore(BigDecimal.valueOf(face.getTempScore().floatValue()));
|
||||
}
|
||||
param.setCompareType(CompareTypeEnum.RECOG.getCode());
|
||||
return param;
|
||||
}
|
||||
}
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
package cn.cloudwalk.elevator.handler.device.controller;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceService;
|
||||
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.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.param.AcsElevatorCodeParam;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.service.AcsElevatorCodeService;
|
||||
import cn.cloudwalk.elevator.common.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
|
||||
import cn.cloudwalk.elevator.device.param.AcsDeviceQueryParam;
|
||||
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.service.AcsElevatorDeviceService;
|
||||
import cn.cloudwalk.elevator.export.impl.ElevatorDeviceExportService;
|
||||
import cn.cloudwalk.elevator.export.result.ElevatorDeviceRecordExcelResult;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsDeviceQueryForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorCodeForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorDeviceAddForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorDeviceDeleteForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorDeviceEditForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorDeviceQueryByIdForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorDeviceQueryForm;
|
||||
import cn.cloudwalk.elevator.zone.param.ZoneNextTreeParam;
|
||||
import cn.cloudwalk.elevator.zone.result.ZoneTreeResult;
|
||||
import cn.cloudwalk.elevator.zone.service.ZoneService;
|
||||
import cn.cloudwalk.elevator.zone.util.ZoneTreeCollectors;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/elevator/device/"})
|
||||
public class AcsElevatorDeviceController extends AbstractCloudwalkController {
|
||||
@Resource
|
||||
private AcsElevatorDeviceService elevatorDeviceService;
|
||||
@Resource
|
||||
private AcsElevatorCodeService elevatorCodeService;
|
||||
@Resource
|
||||
private ZoneService zoneService;
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
@Resource
|
||||
private ElevatorDeviceExportService elevatorDeviceExportService;
|
||||
|
||||
@PostMapping({"/add"})
|
||||
public CloudwalkResult add(@RequestBody AcsElevatorDeviceAddForm form) throws ServiceException {
|
||||
this.LOGGER.info("添加派梯设备,请求参数:{}", JSON.toJSONString(form));
|
||||
AcsElevatorDeviceAddParam param =
|
||||
(AcsElevatorDeviceAddParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceAddParam.class);
|
||||
String deviceCode = form.getDeviceCode();
|
||||
AcsElevatorDeviceResultDTO queryResultDTO = this.elevatorDeviceService.getByDeciveCode(deviceCode);
|
||||
if (queryResultDTO != null) {
|
||||
return CloudwalkResult.success("该设备已添加过,请重新选择!");
|
||||
}
|
||||
String businessId = getCloudwalkContext().getCompany().getCompanyId();
|
||||
param.setBusinessId(businessId);
|
||||
try {
|
||||
int result = this.elevatorDeviceService.add(param, getCloudwalkContext()).intValue();
|
||||
return CloudwalkResult.success(Integer.valueOf(result));
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("添加派梯设备失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("添加派梯设备失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/edit"})
|
||||
public CloudwalkResult edit(@RequestBody AcsElevatorDeviceEditForm form) {
|
||||
this.LOGGER.info("修改派梯设备,请求参数:{}", JSON.toJSONString(form));
|
||||
AcsElevatorDeviceEditParam param =
|
||||
(AcsElevatorDeviceEditParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceEditParam.class);
|
||||
try {
|
||||
int result = this.elevatorDeviceService.edit(param, getCloudwalkContext()).intValue();
|
||||
return CloudwalkResult.success(Integer.valueOf(result));
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("修改派梯设备失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("修改派梯设备失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/getById"})
|
||||
public CloudwalkResult<AcsElevatorDeviceResultDTO> getById(@RequestBody AcsElevatorDeviceQueryByIdForm form) {
|
||||
this.LOGGER.info("根据id获取派梯设备信息,请求参数:{}", JSON.toJSONString(form));
|
||||
AcsElevatorDeviceQueryByIdParam param =
|
||||
(AcsElevatorDeviceQueryByIdParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceQueryByIdParam.class);
|
||||
try {
|
||||
AcsElevatorDeviceResultDTO result = this.elevatorDeviceService.getById(param, getCloudwalkContext());
|
||||
return CloudwalkResult.success(result);
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("根据id获取派梯设备信息失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("根据id获取派梯设备信息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/delete"})
|
||||
public CloudwalkResult delete(@RequestBody AcsElevatorDeviceDeleteForm form) {
|
||||
try {
|
||||
this.LOGGER.info("删除派梯设备信息,请求参数:{}", JSON.toJSONString(form));
|
||||
if (form == null) {
|
||||
this.LOGGER.error("删除派梯设备信息失败,原因:无编号传输过来!");
|
||||
return CloudwalkResult.fail("无编号传输过来!", getMessage("无编号传输过来!"));
|
||||
}
|
||||
List<String> idList = form.getIds();
|
||||
int result = this.elevatorDeviceService.delete(idList, getCloudwalkContext()).intValue();
|
||||
return CloudwalkResult.success(Integer.valueOf(result));
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("修改派梯设备失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("删除派梯设备信息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/editCode"})
|
||||
public CloudwalkResult editCode(@RequestBody AcsElevatorCodeForm form) {
|
||||
try {
|
||||
this.LOGGER.info("设置电梯编码,请求参数:{}", JSON.toJSONString(form));
|
||||
AcsElevatorCodeParam param =
|
||||
(AcsElevatorCodeParam)BeanCopyUtils.copyProperties(form, AcsElevatorCodeParam.class);
|
||||
if (param.getIsFirst().intValue() == 1) {
|
||||
AcsElevatorCodeResultDTO firstResult = this.elevatorCodeService.getFirstByParentId(param.getParentId());
|
||||
if (!ObjectUtils.isEmpty(firstResult) && !firstResult.getZoneId().equals(param.getZoneId())) {
|
||||
return CloudwalkResult.fail("76260525", getMessage("76260525"));
|
||||
}
|
||||
}
|
||||
AcsElevatorCodeResultDTO result = this.elevatorCodeService.get(param);
|
||||
if (!ObjectUtils.isEmpty(result)) {
|
||||
this.elevatorCodeService.updateOld(param);
|
||||
return CloudwalkResult.success(Integer.valueOf(1));
|
||||
}
|
||||
this.elevatorCodeService.insertNew(param);
|
||||
return CloudwalkResult.success(Integer.valueOf(1));
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("设置电梯编码失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("设置电梯编码失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/get"})
|
||||
public CloudwalkResult<CloudwalkPageAble<AcsElevatorDeviceResultDTO>>
|
||||
get(@RequestBody AcsElevatorDeviceQueryForm form) {
|
||||
this.LOGGER.info("分页查询派梯设备,请求参数:{}", JSON.toJSONString(form));
|
||||
AcsElevatorDeviceQueryParam param =
|
||||
(AcsElevatorDeviceQueryParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceQueryParam.class);
|
||||
try {
|
||||
return this.elevatorDeviceService.get(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询派梯设备信息列表失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("查询派梯设备信息列表失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/export"})
|
||||
public CloudwalkResult<Boolean> export(@RequestBody AcsElevatorDeviceQueryForm form) {
|
||||
this.LOGGER.info("派梯设备导出,请求参数:{}", JSON.toJSONString(form));
|
||||
AcsElevatorDeviceQueryParam param =
|
||||
(AcsElevatorDeviceQueryParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceQueryParam.class);
|
||||
try {
|
||||
CloudwalkCallContext cloudwalkContext = getCloudwalkContext();
|
||||
if (cloudwalkContext.getCompany().getCompanyId() == null) {
|
||||
cloudwalkContext.getCompany().setCompanyId("default");
|
||||
}
|
||||
return this.elevatorDeviceExportService.startExportTask(param, ElevatorDeviceRecordExcelResult.class, null,
|
||||
cloudwalkContext);
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("派梯设备信息导出失败", (Throwable)e);
|
||||
return CloudwalkResult.fail("查询派梯设备信息列表失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/zone/treeCode"})
|
||||
public CloudwalkResult<List<ZoneTreeResult>> queryZoneTreeCode(@RequestBody ZoneNextTreeParam zoneNextTreeParam) {
|
||||
try {
|
||||
this.LOGGER.info("获取区域的电梯编码,请求参数:{}", JSON.toJSONString(zoneNextTreeParam));
|
||||
CloudwalkResult<List<ZoneTreeResult>> query =
|
||||
this.zoneService.tree(zoneNextTreeParam, getCloudwalkContext());
|
||||
CloudwalkResult<List<ZoneTreeResult>> result = new CloudwalkResult();
|
||||
List<ZoneTreeResult> treeList = (List<ZoneTreeResult>)query.getData();
|
||||
List<ZoneTreeResult> treeResultList = new ArrayList<>();
|
||||
if (treeList != null && treeList.size() > 0) {
|
||||
LinkedHashSet<String> zoneIds = new LinkedHashSet<>();
|
||||
ZoneTreeCollectors.collectNodeIds(treeList, zoneIds);
|
||||
Map<String, AcsElevatorCodeResultDTO> codeByZoneId =
|
||||
this.elevatorCodeService.mapByZoneIds(new ArrayList<>(zoneIds));
|
||||
for (ZoneTreeResult zoneTreeResult : treeList) {
|
||||
String zoneId = zoneTreeResult.getId();
|
||||
AcsElevatorCodeResultDTO code = codeByZoneId.get(zoneId);
|
||||
if (!ObjectUtils.isEmpty(code)) {
|
||||
zoneTreeResult.setElevatorCode(code.getCode());
|
||||
zoneTreeResult.setIsFirst(code.getIsFirst());
|
||||
}
|
||||
if (zoneTreeResult.getChildren() != null) {
|
||||
List<ZoneTreeResult> chidList =
|
||||
treeRecursionDataList(zoneTreeResult.getChildren(), codeByZoneId);
|
||||
zoneTreeResult.setChildren(chidList);
|
||||
}
|
||||
treeResultList.add(zoneTreeResult);
|
||||
}
|
||||
}
|
||||
query.setData(treeResultList);
|
||||
return query;
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("获取区域的电梯编码失败,原因:", e);
|
||||
return CloudwalkResult.fail("获取区域的电梯编码失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public List<ZoneTreeResult> treeRecursionDataList(List<ZoneTreeResult> childList,
|
||||
Map<String, AcsElevatorCodeResultDTO> codeByZoneId) {
|
||||
List<ZoneTreeResult> childResultList = new ArrayList<>();
|
||||
for (ZoneTreeResult zoneTreeResult : childList) {
|
||||
String id = zoneTreeResult.getId();
|
||||
AcsElevatorCodeResultDTO code = codeByZoneId.get(id);
|
||||
if (!ObjectUtils.isEmpty(code)) {
|
||||
zoneTreeResult.setElevatorCode(code.getCode());
|
||||
zoneTreeResult.setIsFirst(code.getIsFirst());
|
||||
}
|
||||
if (zoneTreeResult.getChildren() != null && zoneTreeResult.getChildren().size() > 0) {
|
||||
zoneTreeResult.setChildren(treeRecursionDataList(zoneTreeResult.getChildren(), codeByZoneId));
|
||||
}
|
||||
childResultList.add(zoneTreeResult);
|
||||
}
|
||||
return childResultList;
|
||||
}
|
||||
|
||||
@PostMapping({"/devicePage"})
|
||||
public CloudwalkResult<CloudwalkPageAble<DeviceResult>> devicePage(@RequestBody AcsDeviceQueryForm form) {
|
||||
try {
|
||||
if (this.LOGGER.isDebugEnabled()) {
|
||||
this.LOGGER.debug("devicePage form {}", JSONObject.toJSONString(form));
|
||||
}
|
||||
AcsDeviceQueryParam param = new AcsDeviceQueryParam();
|
||||
CloudwalkPageInfo pageInfo = new CloudwalkPageInfo(form.getCurrentPage(), form.getRowsOfPage());
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
if (this.LOGGER.isDebugEnabled()) {
|
||||
this.LOGGER.debug("devicePage param {}", JSONObject.toJSONString(param));
|
||||
}
|
||||
return this.elevatorDeviceService.devicePage(param, pageInfo, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("分页查询设备信息异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260529", getMessage("76260529"));
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> queryZone() throws ServiceException {
|
||||
Map<String, String> zoneMap = new HashMap<>();
|
||||
CloudwalkResult<List<ZoneTreeResult>> query =
|
||||
this.zoneService.tree(new ZoneNextTreeParam(), getCloudwalkContext());
|
||||
List<ZoneTreeResult> treeList = (List<ZoneTreeResult>)query.getData();
|
||||
if (treeList != null && treeList.size() > 0) {
|
||||
for (ZoneTreeResult zoneTreeResult : treeList) {
|
||||
String zoneId = zoneTreeResult.getId();
|
||||
String zoneName = zoneTreeResult.getName();
|
||||
zoneMap.put(zoneId, zoneName);
|
||||
getZoneMap(zoneTreeResult.getChildren(), zoneMap);
|
||||
}
|
||||
}
|
||||
return zoneMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getZoneMap(List<ZoneTreeResult> childList, Map<String, String> zoneMap)
|
||||
throws ServiceException {
|
||||
List<ZoneTreeResult> childResultList = new ArrayList<>();
|
||||
for (ZoneTreeResult zoneTreeResult : childList) {
|
||||
String zoneId = zoneTreeResult.getId();
|
||||
String zoneName = zoneTreeResult.getName();
|
||||
zoneMap.put(zoneId, zoneName);
|
||||
if (zoneTreeResult.getChildren() != null && zoneTreeResult.getChildren().size() > 0) {
|
||||
getZoneMap(zoneTreeResult.getChildren(), zoneMap);
|
||||
}
|
||||
}
|
||||
return zoneMap;
|
||||
}
|
||||
}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
package cn.cloudwalk.elevator.handler.device.controller;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.service.DeviceService;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.param.AcsElevatorCodeParam;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeQueryDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.dto.AcsElevatorCodeResultDTO;
|
||||
import cn.cloudwalk.elevator.codeElevatorArea.service.AcsElevatorCodeService;
|
||||
import cn.cloudwalk.elevator.common.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceQueryFoDTO;
|
||||
import cn.cloudwalk.elevator.device.dto.AcsElevatorDeviceResultDTO;
|
||||
import cn.cloudwalk.elevator.device.param.AcsElevatorDeviceQueryParam;
|
||||
import cn.cloudwalk.elevator.device.result.KeyValueResult;
|
||||
import cn.cloudwalk.elevator.device.service.AcsElevatorDeviceService;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorCodeQueryForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorDeviceQueryForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsElevatorRecordAddForm;
|
||||
import cn.cloudwalk.elevator.record.param.AcsElevatorRecordAddParam;
|
||||
import cn.cloudwalk.elevator.record.service.AcsElevatorRecordService;
|
||||
import cn.cloudwalk.elevator.util.StringUtils;
|
||||
import cn.cloudwalk.elevator.zone.param.ZoneNextTreeParam;
|
||||
import cn.cloudwalk.elevator.zone.result.ZoneTreeResult;
|
||||
import cn.cloudwalk.elevator.zone.service.ZoneService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 设备侧聚合网关:设备/电梯码/区域树/记录等 {@code /device/v2/} 接口,薄控制器,具体逻辑见各 {@code *Service}。
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping({"/device/v2/"})
|
||||
public class AcsElevatorDeviceGetWayController extends AbstractCloudwalkController {
|
||||
@Resource
|
||||
private AcsElevatorDeviceService elevatorDeviceService;
|
||||
@Resource
|
||||
private AcsElevatorCodeService elevatorCodeService;
|
||||
@Resource
|
||||
private ZoneService zoneService;
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
@Resource
|
||||
private AcsElevatorRecordService elevatorRecordService;
|
||||
@Value("${elevator.application.key}")
|
||||
private String key;
|
||||
@Value("${elevator.application.time}")
|
||||
private Long time;
|
||||
@Value("${elevator.application.keyA}")
|
||||
private String keyA;
|
||||
|
||||
@PostMapping({"/39201"})
|
||||
public CloudwalkResult<List<AcsElevatorDeviceQueryFoDTO>> get(@RequestBody AcsElevatorDeviceQueryForm form) {
|
||||
AcsElevatorDeviceQueryParam param =
|
||||
(AcsElevatorDeviceQueryParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceQueryParam.class);
|
||||
try {
|
||||
List<AcsElevatorDeviceQueryFoDTO> list = this.elevatorDeviceService.getFo(param);
|
||||
if (list != null && list.size() > 0) {
|
||||
return CloudwalkResult.success(list);
|
||||
}
|
||||
return CloudwalkResult.success(new ArrayList());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询派梯设备信息列表失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("查询派梯设备信息列表失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"39202"})
|
||||
public CloudwalkResult<List<AcsElevatorCodeQueryDTO>>
|
||||
queryZoneTreeCode(@RequestBody AcsElevatorCodeQueryForm form) {
|
||||
try {
|
||||
AcsElevatorDeviceQueryParam param =
|
||||
(AcsElevatorDeviceQueryParam)BeanCopyUtils.copyProperties(form, AcsElevatorDeviceQueryParam.class);
|
||||
String buildingId = "";
|
||||
String businessId = "";
|
||||
if (StringUtils.isNotBlank(form.getDeviceCode())) {
|
||||
buildingId = this.elevatorDeviceService.getBuildingId(param);
|
||||
businessId = this.elevatorDeviceService.getBusinessId(param);
|
||||
}
|
||||
ZoneNextTreeParam zoneNextTreeParam = new ZoneNextTreeParam();
|
||||
if (StringUtils.isNotBlank(buildingId)) {
|
||||
zoneNextTreeParam.setParentId(buildingId);
|
||||
}
|
||||
zoneNextTreeParam.setBusinessId(businessId);
|
||||
CloudwalkResult<List<ZoneTreeResult>> query =
|
||||
this.zoneService.tree(zoneNextTreeParam, getCloudwalkContext());
|
||||
List<ZoneTreeResult> treeList = (List<ZoneTreeResult>)query.getData();
|
||||
List<AcsElevatorCodeQueryDTO> treeResultList = new ArrayList<>();
|
||||
if (treeList != null && treeList.size() > 0) {
|
||||
for (ZoneTreeResult zoneTreeResult : treeList) {
|
||||
if ("PARK".equals(zoneTreeResult.getType())) {
|
||||
List<ZoneTreeResult> buildingList = zoneTreeResult.getChildren();
|
||||
if (buildingList != null && buildingList.size() > 0)
|
||||
for (ZoneTreeResult building : buildingList) {
|
||||
if ("BUILDING".equals(building.getType())) {
|
||||
List<ZoneTreeResult> floorList = building.getChildren();
|
||||
if (floorList != null && floorList.size() > 0)
|
||||
for (ZoneTreeResult floor : floorList) {
|
||||
AcsElevatorCodeQueryDTO querydTO = new AcsElevatorCodeQueryDTO();
|
||||
querydTO.setZoneId(floor.getId());
|
||||
querydTO.setId(floor.getId());
|
||||
querydTO.setZoneName(floor.getName());
|
||||
querydTO.setZoneType(floor.getType());
|
||||
AcsElevatorCodeParam paramCode = new AcsElevatorCodeParam();
|
||||
paramCode.setZoneId(floor.getId());
|
||||
AcsElevatorCodeResultDTO code = this.elevatorCodeService.get(paramCode);
|
||||
if (!ObjectUtils.isEmpty(code)) {
|
||||
querydTO.setCode(code.getCode());
|
||||
querydTO.setIsFirst(code.getIsFirst());
|
||||
}
|
||||
treeResultList.add(querydTO);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ("FLOOR".equals(building.getType())) {
|
||||
AcsElevatorCodeQueryDTO querydTO = new AcsElevatorCodeQueryDTO();
|
||||
querydTO.setZoneId(building.getId());
|
||||
querydTO.setZoneName(building.getName());
|
||||
querydTO.setZoneType("FLOOR");
|
||||
querydTO.setId(building.getId());
|
||||
AcsElevatorCodeParam paramCode = new AcsElevatorCodeParam();
|
||||
paramCode.setZoneId(zoneTreeResult.getId());
|
||||
AcsElevatorCodeResultDTO code = this.elevatorCodeService.get(paramCode);
|
||||
if (!ObjectUtils.isEmpty(code)) {
|
||||
querydTO.setCode(code.getCode());
|
||||
querydTO.setIsFirst(code.getIsFirst());
|
||||
}
|
||||
treeResultList.add(querydTO);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ("BUILDING".equals(zoneTreeResult.getType())) {
|
||||
List<ZoneTreeResult> floorList = zoneTreeResult.getChildren();
|
||||
if (floorList != null && floorList.size() > 0)
|
||||
for (ZoneTreeResult floor : floorList) {
|
||||
AcsElevatorCodeQueryDTO querydTO = new AcsElevatorCodeQueryDTO();
|
||||
querydTO.setZoneId(floor.getId());
|
||||
querydTO.setZoneName(floor.getName());
|
||||
querydTO.setZoneType(floor.getType());
|
||||
querydTO.setId(floor.getId());
|
||||
AcsElevatorCodeParam paramCode = new AcsElevatorCodeParam();
|
||||
paramCode.setZoneId(floor.getId());
|
||||
AcsElevatorCodeResultDTO code = this.elevatorCodeService.get(paramCode);
|
||||
if (!ObjectUtils.isEmpty(code)) {
|
||||
querydTO.setCode(code.getCode());
|
||||
querydTO.setIsFirst(code.getIsFirst());
|
||||
}
|
||||
treeResultList.add(querydTO);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ("FLOOR".equals(zoneTreeResult.getType())) {
|
||||
AcsElevatorCodeQueryDTO querydTO = new AcsElevatorCodeQueryDTO();
|
||||
querydTO.setZoneId(zoneTreeResult.getId());
|
||||
querydTO.setZoneName(zoneTreeResult.getName());
|
||||
querydTO.setZoneType("FLOOR");
|
||||
querydTO.setId(zoneTreeResult.getId());
|
||||
AcsElevatorCodeParam paramCode = new AcsElevatorCodeParam();
|
||||
paramCode.setZoneId(zoneTreeResult.getId());
|
||||
AcsElevatorCodeResultDTO code = this.elevatorCodeService.get(paramCode);
|
||||
if (!ObjectUtils.isEmpty(code)) {
|
||||
querydTO.setCode(code.getCode());
|
||||
querydTO.setIsFirst(code.getIsFirst());
|
||||
}
|
||||
treeResultList.add(querydTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
CloudwalkResult<List<AcsElevatorCodeQueryDTO>> result = CloudwalkResult.success(treeResultList);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("获取区域的电梯编码失败,原因:", e);
|
||||
return CloudwalkResult.fail("获取区域的电梯编码失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"39203"})
|
||||
public CloudwalkResult addElevatorRecord(@RequestBody AcsElevatorRecordAddForm form) {
|
||||
AcsElevatorRecordAddParam param =
|
||||
(AcsElevatorRecordAddParam)BeanCopyUtils.copyProperties(form, AcsElevatorRecordAddParam.class);
|
||||
try {
|
||||
String deviceCode = form.getDeviceCode();
|
||||
AcsElevatorDeviceQueryParam paramDevice = new AcsElevatorDeviceQueryParam();
|
||||
paramDevice.setDeviceCode(deviceCode);
|
||||
Long time1 = Long.valueOf(System.currentTimeMillis());
|
||||
String businessId = this.elevatorDeviceService.getBusinessId(paramDevice);
|
||||
if (StringUtils.isNotBlank(businessId)) {
|
||||
param.setBusinessId(businessId);
|
||||
} else {
|
||||
param.setBusinessId("000");
|
||||
}
|
||||
Long time2 = Long.valueOf(System.currentTimeMillis());
|
||||
AcsElevatorDeviceResultDTO deviceResultDTO = this.elevatorDeviceService.getByDeciveCode(deviceCode);
|
||||
DeviceResult deviceResult = new DeviceResult();
|
||||
if (deviceResultDTO != null) {
|
||||
deviceResult.setId(deviceResultDTO.getId());
|
||||
deviceResult.setDeviceCode(deviceCode);
|
||||
deviceResult.setDeviceName(deviceResultDTO.getDeviceName());
|
||||
deviceResult.setDeviceTypeName(deviceResultDTO.getDeviceTypeName());
|
||||
deviceResult.setAreaId(deviceResultDTO.getAreaId());
|
||||
}
|
||||
param.setDeviceResult(deviceResult);
|
||||
Long time3 = Long.valueOf(System.currentTimeMillis());
|
||||
CloudwalkResult<Boolean> result = this.elevatorRecordService.add(param, getCloudwalkContext());
|
||||
return CloudwalkResult.success(result);
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("添加刷脸派梯记录失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("00", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"39204"})
|
||||
public CloudwalkResult<KeyValueResult> getKey(@RequestBody AcsElevatorRecordAddForm form) {
|
||||
KeyValueResult result = new KeyValueResult();
|
||||
result.setKey(this.key);
|
||||
result.setTime(this.time);
|
||||
result.setKeyA(this.keyA);
|
||||
return CloudwalkResult.success(result);
|
||||
}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package cn.cloudwalk.elevator.handler.device.controller;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.elevator.common.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.device.dto.AcsDeviceTaskDTO;
|
||||
import cn.cloudwalk.elevator.device.param.AcsDeviceRestructureTaskParam;
|
||||
import cn.cloudwalk.elevator.device.param.AcsRestructureBindingParam;
|
||||
import cn.cloudwalk.elevator.device.param.AcsRestructureQueryParam;
|
||||
import cn.cloudwalk.elevator.device.service.AcsElevatorDeviceService;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsDeviceRestructureTaskForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsRestructureBindingForm;
|
||||
import cn.cloudwalk.elevator.handler.device.form.AcsRestructureQueryForm;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/elevator/restructure"})
|
||||
public class AcsElevatorRestructureController extends AbstractCloudwalkController {
|
||||
@Resource
|
||||
private AcsElevatorDeviceService elevatorDeviceService;
|
||||
|
||||
@PostMapping({"/unbind/floors"})
|
||||
public CloudwalkResult listUnbindFloors(@RequestBody AcsRestructureQueryForm form) {
|
||||
try {
|
||||
AcsRestructureQueryParam param = new AcsRestructureQueryParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.listUnbindFloors(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询未绑定的楼层异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("查询未绑定的派梯楼层异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/floors"})
|
||||
public CloudwalkResult listFloors(@RequestBody AcsRestructureQueryForm form) {
|
||||
try {
|
||||
AcsRestructureQueryParam param = new AcsRestructureQueryParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.listFloors(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询未绑定的派梯楼层和设备情况异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("查询未绑定的派梯楼层异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/condition"})
|
||||
public CloudwalkResult listCondition(@RequestBody AcsRestructureQueryForm form) {
|
||||
try {
|
||||
AcsRestructureQueryParam param = new AcsRestructureQueryParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.listCondition(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("根据条件查询派梯楼层异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("根据条件查询派梯楼层异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/condition/labels"})
|
||||
public CloudwalkResult listConditionByLabelIds(@RequestBody AcsRestructureQueryForm form) {
|
||||
try {
|
||||
AcsRestructureQueryParam param = new AcsRestructureQueryParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.listConditionByLabelIds(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("根据标签id集合查询派梯楼层权限异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("根据标签id集合查询派梯楼层权限异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/binding"})
|
||||
public CloudwalkResult<String> bindingFloors(@RequestBody AcsRestructureBindingForm form) {
|
||||
try {
|
||||
AcsRestructureBindingParam param = new AcsRestructureBindingParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.bindingFloors(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("机构id、标签id绑定派梯楼层异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("机构id、标签id绑定派梯楼层异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/binding/person"})
|
||||
public CloudwalkResult<String> bindingPerson(@RequestBody AcsRestructureBindingForm form) {
|
||||
try {
|
||||
AcsRestructureBindingParam param = new AcsRestructureBindingParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.bindingPerson(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("人员批量绑定派梯楼层异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("人员批量绑定派梯楼层异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/task/progress"})
|
||||
public CloudwalkResult<AcsDeviceTaskDTO> getTask(@RequestBody AcsDeviceRestructureTaskForm form) {
|
||||
try {
|
||||
AcsDeviceRestructureTaskParam param = new AcsDeviceRestructureTaskParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.getTask(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("获取任务进程异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("获取任务进程异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/task/stop"})
|
||||
public CloudwalkResult<Boolean> setTaskStop(@RequestBody AcsDeviceRestructureTaskForm form) {
|
||||
try {
|
||||
AcsDeviceRestructureTaskParam param = new AcsDeviceRestructureTaskParam();
|
||||
BeanCopyUtils.copyProperties(form, param);
|
||||
return this.elevatorDeviceService.setTaskStop(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("终止绑定进程异常,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("终止绑定进程异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cn.cloudwalk.elevator.handler.device.controller;
|
||||
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.elevator.common.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.config.ImageStoreConstants;
|
||||
import cn.cloudwalk.elevator.record.service.PersonFileService;
|
||||
import cn.cloudwalk.elevator.util.ToolUtil;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/file"})
|
||||
public class FileController extends AbstractCloudwalkController {
|
||||
@Autowired
|
||||
private PersonFileService personFileService;
|
||||
|
||||
@RequestMapping(value = {"/imgupload"}, method = {RequestMethod.POST}, consumes = {"multipart/form-data"})
|
||||
public CloudwalkResult<String> fileUpload(@RequestParam("img") String base64) {
|
||||
if (StringUtils.isEmpty((CharSequence)base64)) {
|
||||
return CloudwalkResult.fail("53060544", getMessage("53060544"));
|
||||
}
|
||||
try {
|
||||
byte[] bytes = DatatypeConverter.parseBase64Binary(base64);
|
||||
if (bytes.length > ImageStoreConstants.MAX_FILE) {
|
||||
return CloudwalkResult.fail("53060428", getMessage("53060428"));
|
||||
}
|
||||
String fileName = ToolUtil.generateUUID();
|
||||
this.LOGGER.info("上传文件:{},size={}", fileName, (Object)bytes.length);
|
||||
CloudwalkResult storeResult = this.personFileService.upload(fileName, bytes);
|
||||
if (storeResult != null && StringUtils.isNotBlank((CharSequence)((CharSequence)storeResult.getData()))) {
|
||||
return (CloudwalkResult)CloudwalkResult.success((Object)storeResult.getData());
|
||||
}
|
||||
return storeResult;
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("", e);
|
||||
return CloudwalkResult.fail("80014013", getMessage("80014013"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsDeviceQueryForm extends CloudwalkBasePageForm implements Serializable {
|
||||
private String deviceName;
|
||||
private String deviceCategoryId;
|
||||
private String areaId;
|
||||
|
||||
public String getDeviceName() {
|
||||
return this.deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public String getDeviceCategoryId() {
|
||||
return this.deviceCategoryId;
|
||||
}
|
||||
|
||||
public void setDeviceCategoryId(String deviceCategoryId) {
|
||||
this.deviceCategoryId = deviceCategoryId;
|
||||
}
|
||||
|
||||
public String getAreaId() {
|
||||
return this.areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(String areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AcsDeviceRestructureTaskForm implements Serializable {
|
||||
private static final long serialVersionUID = -7349123760464380004L;
|
||||
private String taskId;
|
||||
|
||||
public String toString() {
|
||||
return "AcsDeviceRestructureTaskForm(taskId=" + getTaskId() + ")";
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(taskId);
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof AcsDeviceRestructureTaskForm;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof AcsDeviceRestructureTaskForm)) {
|
||||
return false;
|
||||
}
|
||||
AcsDeviceRestructureTaskForm other = (AcsDeviceRestructureTaskForm)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(taskId, other.taskId);
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return this.taskId;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorCodeForm 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;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorCodeQueryForm extends CloudwalkBaseTimes implements Serializable {
|
||||
private String deviceCode;
|
||||
|
||||
public String getDeviceCode() {
|
||||
return this.deviceCode;
|
||||
}
|
||||
|
||||
public void setDeviceCode(String deviceCode) {
|
||||
this.deviceCode = deviceCode;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AcsElevatorCodeQueryForm{deviceCode='" + this.deviceCode + '\'' + '}';
|
||||
}
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
public class AcsElevatorDeviceAddForm 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 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 getCurrentBuildingId() {
|
||||
return this.currentBuildingId;
|
||||
}
|
||||
|
||||
public void setCurrentBuildingId(String currentBuildingId) {
|
||||
this.currentBuildingId = currentBuildingId;
|
||||
}
|
||||
|
||||
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 getDeleteFlag() {
|
||||
return this.deleteFlag;
|
||||
}
|
||||
|
||||
public void setDeleteFlag(Integer deleteFlag) {
|
||||
this.deleteFlag = deleteFlag;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AcsElevatorDeviceAddDTO{businessId='" + this.businessId + '\'' + ", deviceId='" + this.deviceId + '\''
|
||||
+ ", deviceCode='" + this.deviceCode + '\'' + ", deviceName='" + this.deviceName + '\''
|
||||
+ ", deviceTypeName='" + this.deviceTypeName + '\'' + ", elevatorFloorList='" + this.elevatorFloorList
|
||||
+ '\'' + ", currentFloorId='" + this.currentFloorId + '\'' + ", currentFloor='" + this.currentFloor + '\''
|
||||
+ ", currentBuilding='" + this.currentBuilding + '\'' + ", areaName='" + this.areaName + '\''
|
||||
+ ", deleteFlag=" + this.deleteFlag + '}';
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsElevatorDeviceDeleteForm extends CloudwalkBaseTimes implements Serializable {
|
||||
private List<String> ids;
|
||||
|
||||
public List<String> getIds() {
|
||||
return this.ids;
|
||||
}
|
||||
|
||||
public void setIds(List<String> ids) {
|
||||
this.ids = ids;
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.entity.CloudwalkBaseTimes;
|
||||
import java.io.Serializable;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class AcsElevatorDeviceEditForm 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 + '\'' + '}';
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorDeviceQueryByIdForm extends CloudwalkBasePageForm implements Serializable {
|
||||
private String id;
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class AcsElevatorDeviceQueryForm extends CloudwalkBasePageForm implements Serializable {
|
||||
@NotNull
|
||||
private String deviceName;
|
||||
private String deviceId;
|
||||
private String deviceTypeName;
|
||||
private String areaName;
|
||||
private String deviceCode;
|
||||
private String ip;
|
||||
private List<String> areaIds;
|
||||
private Integer status;
|
||||
private Integer onlineStatus;
|
||||
|
||||
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 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 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;
|
||||
}
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.device.result.DeviceResult;
|
||||
import java.io.Serializable;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
public class AcsElevatorRecordAddForm implements Serializable {
|
||||
@NotEmpty(message = "76260310")
|
||||
private String businessId;
|
||||
@NotEmpty(message = "76260314")
|
||||
private String deviceCode;
|
||||
private String deviceName;
|
||||
@NotEmpty(message = "76260319")
|
||||
private String openDoorType;
|
||||
private String faceImagePath;
|
||||
private String panoramaImagePath;
|
||||
@NotNull(message = "76260320")
|
||||
private Integer recordResult;
|
||||
private String recognitionNo;
|
||||
@NotNull(message = "76260301")
|
||||
private Long recognitionTime;
|
||||
private String logId;
|
||||
private String recognitionFaceId;
|
||||
private DeviceResult deviceResult;
|
||||
private String srcFloor;
|
||||
private String destFloor;
|
||||
private String dispatchElevatorNo;
|
||||
private Long dispatchElevatorTime;
|
||||
private String operateName;
|
||||
private String token;
|
||||
|
||||
public String getOperateName() {
|
||||
return this.operateName;
|
||||
}
|
||||
|
||||
public void setOperateName(String operateName) {
|
||||
this.operateName = operateName;
|
||||
}
|
||||
|
||||
public String getBusinessId() {
|
||||
return this.businessId;
|
||||
}
|
||||
|
||||
public void setBusinessId(String businessId) {
|
||||
this.businessId = businessId;
|
||||
}
|
||||
|
||||
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 getOpenDoorType() {
|
||||
return this.openDoorType;
|
||||
}
|
||||
|
||||
public void setOpenDoorType(String openDoorType) {
|
||||
this.openDoorType = openDoorType;
|
||||
}
|
||||
|
||||
public String getFaceImagePath() {
|
||||
return this.faceImagePath;
|
||||
}
|
||||
|
||||
public void setFaceImagePath(String faceImagePath) {
|
||||
this.faceImagePath = faceImagePath;
|
||||
}
|
||||
|
||||
public String getPanoramaImagePath() {
|
||||
return this.panoramaImagePath;
|
||||
}
|
||||
|
||||
public void setPanoramaImagePath(String panoramaImagePath) {
|
||||
this.panoramaImagePath = panoramaImagePath;
|
||||
}
|
||||
|
||||
public Integer getRecordResult() {
|
||||
return this.recordResult;
|
||||
}
|
||||
|
||||
public void setRecordResult(Integer recordResult) {
|
||||
this.recordResult = recordResult;
|
||||
}
|
||||
|
||||
public String getRecognitionNo() {
|
||||
return this.recognitionNo;
|
||||
}
|
||||
|
||||
public void setRecognitionNo(String recognitionNo) {
|
||||
this.recognitionNo = recognitionNo;
|
||||
}
|
||||
|
||||
public Long getRecognitionTime() {
|
||||
return this.recognitionTime;
|
||||
}
|
||||
|
||||
public void setRecognitionTime(Long recognitionTime) {
|
||||
this.recognitionTime = recognitionTime;
|
||||
}
|
||||
|
||||
public String getLogId() {
|
||||
return this.logId;
|
||||
}
|
||||
|
||||
public void setLogId(String logId) {
|
||||
this.logId = logId;
|
||||
}
|
||||
|
||||
public String getRecognitionFaceId() {
|
||||
return this.recognitionFaceId;
|
||||
}
|
||||
|
||||
public void setRecognitionFaceId(String recognitionFaceId) {
|
||||
this.recognitionFaceId = recognitionFaceId;
|
||||
}
|
||||
|
||||
public DeviceResult getDeviceResult() {
|
||||
return this.deviceResult;
|
||||
}
|
||||
|
||||
public void setDeviceResult(DeviceResult deviceResult) {
|
||||
this.deviceResult = deviceResult;
|
||||
}
|
||||
|
||||
public String getSrcFloor() {
|
||||
return this.srcFloor;
|
||||
}
|
||||
|
||||
public void setSrcFloor(String srcFloor) {
|
||||
this.srcFloor = srcFloor;
|
||||
}
|
||||
|
||||
public String getDestFloor() {
|
||||
return this.destFloor;
|
||||
}
|
||||
|
||||
public void setDestFloor(String destFloor) {
|
||||
this.destFloor = destFloor;
|
||||
}
|
||||
|
||||
public String getDispatchElevatorNo() {
|
||||
return this.dispatchElevatorNo;
|
||||
}
|
||||
|
||||
public void setDispatchElevatorNo(String dispatchElevatorNo) {
|
||||
this.dispatchElevatorNo = dispatchElevatorNo;
|
||||
}
|
||||
|
||||
public Long getDispatchElevatorTime() {
|
||||
return this.dispatchElevatorTime;
|
||||
}
|
||||
|
||||
public void setDispatchElevatorTime(Long dispatchElevatorTime) {
|
||||
this.dispatchElevatorTime = dispatchElevatorTime;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return this.token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AcsRestructureBindingForm implements Serializable {
|
||||
private String parentId;
|
||||
private String orgId;
|
||||
private String orgName;
|
||||
private String labelId;
|
||||
private String labelName;
|
||||
private String personId;
|
||||
private List<String> zoneIds;
|
||||
|
||||
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 boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof AcsRestructureBindingForm)) {
|
||||
return false;
|
||||
}
|
||||
AcsRestructureBindingForm other = (AcsRestructureBindingForm)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(parentId, other.parentId) && Objects.equals(orgId, other.orgId)
|
||||
&& Objects.equals(orgName, other.orgName) && Objects.equals(labelId, other.labelId)
|
||||
&& Objects.equals(labelName, other.labelName) && Objects.equals(personId, other.personId)
|
||||
&& Objects.equals(zoneIds, other.zoneIds);
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof AcsRestructureBindingForm;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(parentId, orgId, orgName, labelId, labelName, personId, zoneIds);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AcsRestructureBindingForm(parentId=" + getParentId() + ", orgId=" + getOrgId() + ", orgName="
|
||||
+ getOrgName() + ", labelId=" + getLabelId() + ", labelName=" + getLabelName() + ", personId="
|
||||
+ getPersonId() + ", zoneIds=" + getZoneIds() + ")";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package cn.cloudwalk.elevator.handler.device.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AcsRestructureQueryForm implements Serializable {
|
||||
private String orgId;
|
||||
private String labelId;
|
||||
private List<String> labelIds;
|
||||
private String personId;
|
||||
private String zoneId;
|
||||
private String businessId;
|
||||
|
||||
public void setOrgId(String orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public void setLabelId(String labelId) {
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public void setLabelIds(List<String> labelIds) {
|
||||
this.labelIds = labelIds;
|
||||
}
|
||||
|
||||
public void setPersonId(String personId) {
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public void setBusinessId(String businessId) {
|
||||
this.businessId = businessId;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof AcsRestructureQueryForm)) {
|
||||
return false;
|
||||
}
|
||||
AcsRestructureQueryForm other = (AcsRestructureQueryForm)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(orgId, other.orgId) && Objects.equals(labelId, other.labelId)
|
||||
&& Objects.equals(labelIds, other.labelIds) && Objects.equals(personId, other.personId)
|
||||
&& Objects.equals(zoneId, other.zoneId) && Objects.equals(businessId, other.businessId);
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof AcsRestructureQueryForm;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(orgId, labelId, labelIds, personId, zoneId, businessId);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AcsRestructureQueryForm(orgId=" + getOrgId() + ", labelId=" + getLabelId() + ", labelIds="
|
||||
+ getLabelIds() + ", personId=" + getPersonId() + ", zoneId=" + getZoneId() + ", businessId="
|
||||
+ getBusinessId() + ")";
|
||||
}
|
||||
|
||||
public String getOrgId() {
|
||||
return this.orgId;
|
||||
}
|
||||
|
||||
public String getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
public List<String> getLabelIds() {
|
||||
return this.labelIds;
|
||||
}
|
||||
|
||||
public String getPersonId() {
|
||||
return this.personId;
|
||||
}
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public String getBusinessId() {
|
||||
return this.businessId;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 设备与通行相关 HTTP 入口:设备网关查询、电梯码、通行记录等 {@code /device/v2/} 下接口。
|
||||
* <p>
|
||||
* 负责表单/JSON 与业务 {@code param} 的转换,业务规则与远程协作放在 service 层。
|
||||
*/
|
||||
package cn.cloudwalk.elevator.handler.device;
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 电梯应用 Web 层:控制器、表单对象及与前端交互的入口。
|
||||
* <p>
|
||||
* 通过依赖 {@code cw-elevator-application-service} 调用业务服务,保持 Web 层薄、校验与编排下沉。
|
||||
*/
|
||||
package cn.cloudwalk.elevator.handler;
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
package cn.cloudwalk.elevator.passrule.controller;
|
||||
|
||||
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.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.passrule.dto.AcsPassRuleImageResultDto;
|
||||
import cn.cloudwalk.elevator.passrule.dto.AcsPassRulePersonListResultDto;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRuleDeleteForm;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRuleEditForm;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRuleFloorForm;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRuleImageForm;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRuleNewForm;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRulePersonListForm;
|
||||
import cn.cloudwalk.elevator.passrule.form.AcsPassRuleQueryForm;
|
||||
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.AcsPassRuleService;
|
||||
import cn.cloudwalk.elevator.passrule.service.ImageRuleRefService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/elevator/passRule"})
|
||||
public class AcsPassRuleController extends AbstractCloudwalkController {
|
||||
@Resource
|
||||
private AcsPassRuleService acsPassRuleService;
|
||||
@Resource
|
||||
private ImageRuleRefService imageRuleRefService;
|
||||
|
||||
@RequestMapping({"/floor"})
|
||||
public CloudwalkResult<CloudwalkPageAble<AcsPassRuleFloorResult>>
|
||||
listFloor(@RequestBody AcsPassRuleFloorForm form) {
|
||||
AcsPassRuleFloorParam param =
|
||||
(AcsPassRuleFloorParam)BeanCopyUtils.copyProperties(form, AcsPassRuleFloorParam.class);
|
||||
try {
|
||||
return this.imageRuleRefService.listFloor(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询所有楼层信息失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260520", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/add"})
|
||||
public CloudwalkResult<Boolean> add(@RequestBody AcsPassRuleNewForm form) {
|
||||
AcsPassRuleNewParam param = (AcsPassRuleNewParam)BeanCopyUtils.copyProperties(form, AcsPassRuleNewParam.class);
|
||||
try {
|
||||
return this.imageRuleRefService.addOnlyRule(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("新增通行规则失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260505", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/edit"})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody AcsPassRuleEditForm form) {
|
||||
AcsPassRuleEditParam param =
|
||||
(AcsPassRuleEditParam)BeanCopyUtils.copyProperties(form, AcsPassRuleEditParam.class);
|
||||
try {
|
||||
return this.imageRuleRefService.update(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("修改通行规则失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260506", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/delete"})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody AcsPassRuleDeleteForm form) {
|
||||
AcsPassRuleDeleteParam param =
|
||||
(AcsPassRuleDeleteParam)BeanCopyUtils.copyProperties(form, AcsPassRuleDeleteParam.class);
|
||||
try {
|
||||
return this.imageRuleRefService.delete(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("删除通行规则失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260507", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/detail"})
|
||||
public CloudwalkResult<ImageRuleRefDetailResult> detail(@RequestBody AcsPassRuleQueryForm form) {
|
||||
AcsPassRuleQueryParam param =
|
||||
(AcsPassRuleQueryParam)BeanCopyUtils.copyProperties(form, AcsPassRuleQueryParam.class);
|
||||
try {
|
||||
return this.imageRuleRefService.detail(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询通行规则详情失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260508", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<ImageRuleRefPageResult>> page(@RequestBody AcsPassRuleQueryForm form) {
|
||||
AcsPassRuleQueryParam param =
|
||||
(AcsPassRuleQueryParam)BeanCopyUtils.copyProperties(form, AcsPassRuleQueryParam.class);
|
||||
try {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(form.getPageNo().intValue(), form.getPageSize().intValue());
|
||||
return this.imageRuleRefService.page(param, page, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("分页查询通行规则失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260508", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/image"})
|
||||
public CloudwalkResult<List<AcsPassRuleImageResultDto>> listByImageId(@RequestBody AcsPassRuleImageForm form) {
|
||||
AcsPassRuleImageParam param =
|
||||
(AcsPassRuleImageParam)BeanCopyUtils.copyProperties(form, AcsPassRuleImageParam.class);
|
||||
try {
|
||||
return this.imageRuleRefService.listByPersonInfo(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("根据人员id、标签集合、机构集合获取楼层权限失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260526", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/image/list"})
|
||||
public CloudwalkResult<List<AcsPassRulePersonListResultDto>>
|
||||
listByPersonList(@RequestBody AcsPassRulePersonListForm form) {
|
||||
AcsPassRulePersonListParam param = new AcsPassRulePersonListParam();
|
||||
List<AcsPassRuleImageParam> imageParam = new ArrayList<>();
|
||||
for (AcsPassRuleImageForm imageForm : form.getPersonList()) {
|
||||
AcsPassRuleImageParam copyProperties =
|
||||
(AcsPassRuleImageParam)BeanCopyUtils.copyProperties(imageForm, AcsPassRuleImageParam.class);
|
||||
imageParam.add(copyProperties);
|
||||
}
|
||||
param.setPersonList(imageParam);
|
||||
try {
|
||||
return this.imageRuleRefService.listByPersonList(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("批量获取楼层权限失败,原因:{}", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260526", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPassRuleDeleteForm implements Serializable {
|
||||
private static final long serialVersionUID = -52051042529262978L;
|
||||
private List<String> ids;
|
||||
private String zoneId;
|
||||
private String parentId;
|
||||
|
||||
public String getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = 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;
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPassRuleEditForm implements Serializable {
|
||||
private static final long serialVersionUID = -27068608402591250L;
|
||||
private String id;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private String zoneName;
|
||||
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 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;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPassRuleFloorForm extends CloudwalkBasePageForm implements Serializable {
|
||||
private static final long serialVersionUID = -46113273262522744L;
|
||||
private String zoneId;
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPassRuleImageForm 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;
|
||||
}
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPassRuleNewForm implements Serializable {
|
||||
private static final long serialVersionUID = -46113273262522744L;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private String zoneName;
|
||||
private String ruleName;
|
||||
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 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;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPassRulePersonListForm extends CloudwalkBasePageForm implements Serializable {
|
||||
private static final long serialVersionUID = -52687427633888290L;
|
||||
private List<AcsPassRuleImageForm> personList;
|
||||
|
||||
public List<AcsPassRuleImageForm> getPersonList() {
|
||||
return this.personList;
|
||||
}
|
||||
|
||||
public void setPersonList(List<AcsPassRuleImageForm> personList) {
|
||||
this.personList = personList;
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package cn.cloudwalk.elevator.passrule.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPassRuleQueryForm implements Serializable {
|
||||
private static final long serialVersionUID = -52687427633888290L;
|
||||
private String id;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private String zoneName;
|
||||
private Integer isDefault;
|
||||
private Integer pageSize = Integer.valueOf(10);
|
||||
private Integer pageNo = Integer.valueOf(1);
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return this.pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getPageNo() {
|
||||
return this.pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
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 Integer getIsDefault() {
|
||||
return this.isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(Integer isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
}
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
package cn.cloudwalk.elevator.person.controller;
|
||||
|
||||
import cn.cloudwalk.client.cwoscomponent.intelligent.imagestore.result.ImageStorePersonResult;
|
||||
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.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.person.form.AcsPersonAddForm;
|
||||
import cn.cloudwalk.elevator.person.form.AcsPersonAddVisitorForm;
|
||||
import cn.cloudwalk.elevator.person.form.AcsPersonDeleteForm;
|
||||
import cn.cloudwalk.elevator.person.form.AcsPersonEditForm;
|
||||
import cn.cloudwalk.elevator.person.form.AcsPersonQueryForm;
|
||||
import cn.cloudwalk.elevator.person.form.AcsPersonTimeDetailForm;
|
||||
import cn.cloudwalk.elevator.person.form.PersonDetailQueryForm;
|
||||
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.AcsPersonService;
|
||||
import cn.cloudwalk.elevator.person.service.PersonRuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/elevator/person"})
|
||||
public class AcsPersonController extends AbstractCloudwalkController {
|
||||
@Autowired
|
||||
private AcsPersonService acsPersonService;
|
||||
@Autowired
|
||||
private PersonRuleService personRuleService;
|
||||
|
||||
@RequestMapping({"/add"})
|
||||
public CloudwalkResult<Boolean> add(@RequestBody AcsPersonAddForm form) {
|
||||
AcsPersonAddParam param = (AcsPersonAddParam)BeanCopyUtils.copyProperties(form, AcsPersonAddParam.class);
|
||||
try {
|
||||
return this.personRuleService.add(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("从现有人员添加通行人员失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260521", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/add/visitor"})
|
||||
public CloudwalkResult<Boolean> addVisitor(@RequestBody AcsPersonAddVisitorForm form) {
|
||||
AcsPersonAddVisitorParam param =
|
||||
(AcsPersonAddVisitorParam)BeanCopyUtils.copyProperties(form, AcsPersonAddVisitorParam.class);
|
||||
try {
|
||||
String businessId = getCloudwalkContext().getCompany().getCompanyId();
|
||||
this.LOGGER.info(
|
||||
"访客派梯接口请求开始 businessId={} personId={} visitorId={} requestFloorSize={} beginTime={} endTime={}",
|
||||
businessId, form.getPersonId(), form.getVisitorId(),
|
||||
Integer.valueOf(form.getFloorIds() == null ? 0 : form.getFloorIds().size()), form.getBegVisitorTime(),
|
||||
form.getEndVisitorTime());
|
||||
CloudwalkResult<Boolean> result = this.personRuleService.addVisitor(param, getCloudwalkContext());
|
||||
this.LOGGER.info("访客派梯接口请求结束 businessId={} personId={} visitorId={} success={} code={} message={}",
|
||||
businessId, form.getPersonId(), form.getVisitorId(), Boolean.valueOf(result.isSuccess()),
|
||||
result.getCode(), result.getMessage());
|
||||
return result;
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("访客派梯接口异常 businessId={} personId={} visitorId={},原因:",
|
||||
getCloudwalkContext().getCompany().getCompanyId(), form.getPersonId(), form.getVisitorId(),
|
||||
(Throwable)e);
|
||||
return CloudwalkResult.fail("76260521", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/edit"})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody AcsPersonEditForm form) {
|
||||
AcsPersonEditParam param = (AcsPersonEditParam)BeanCopyUtils.copyProperties(form, AcsPersonEditParam.class);
|
||||
try {
|
||||
return this.acsPersonService.edit(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("编辑通行人员信息失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260522", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/delete"})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody AcsPersonDeleteForm form) {
|
||||
AcsPersonDeleteParam param =
|
||||
(AcsPersonDeleteParam)BeanCopyUtils.copyProperties(form, AcsPersonDeleteParam.class);
|
||||
try {
|
||||
return this.personRuleService.delete(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("删除通行人员失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260523", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> page(@RequestBody AcsPersonQueryForm form) {
|
||||
try {
|
||||
CloudwalkPageInfo pageInfo =
|
||||
new CloudwalkPageInfo(form.getPageNo().intValue(), form.getPageSize().intValue());
|
||||
AcsPersonQueryParam param =
|
||||
(AcsPersonQueryParam)BeanCopyUtils.copyProperties(form, AcsPersonQueryParam.class);
|
||||
return this.personRuleService.page(param, pageInfo, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("分页查询通行人员失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260410", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/timeDetail"})
|
||||
public CloudwalkResult<AcsPersonTimeDetailResult> timeDetail(@RequestBody AcsPersonTimeDetailForm form) {
|
||||
try {
|
||||
AcsPersonTimeDetailParam param =
|
||||
(AcsPersonTimeDetailParam)BeanCopyUtils.copyProperties(form, AcsPersonTimeDetailParam.class);
|
||||
return this.acsPersonService.timeDetail(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("查询通行人员时间详情失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260416", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/pageByApp"})
|
||||
public CloudwalkResult<CloudwalkPageAble<AcsPersonResult>> pageByApp(@RequestBody AcsPersonQueryForm form) {
|
||||
try {
|
||||
CloudwalkPageInfo pageInfo =
|
||||
new CloudwalkPageInfo(form.getPageNo().intValue(), form.getPageSize().intValue());
|
||||
AcsPersonQueryByAppParam param =
|
||||
(AcsPersonQueryByAppParam)BeanCopyUtils.copyProperties(form, AcsPersonQueryByAppParam.class);
|
||||
return this.acsPersonService.pageByApp(param, pageInfo, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("分页查询应用通行人员失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260417", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping({"/detail"})
|
||||
public CloudwalkResult<CloudwalkPageAble<ImageStorePersonResult>>
|
||||
personDetail(@RequestBody PersonDetailQueryForm form) {
|
||||
try {
|
||||
PersonDetailQueryParam param =
|
||||
(PersonDetailQueryParam)BeanCopyUtils.copyProperties(form, PersonDetailQueryParam.class);
|
||||
return this.personRuleService.personDetail(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("分页查询规则里通行人员失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260410", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPersonAddForm implements Serializable {
|
||||
private static final long serialVersionUID = 7916140658162290825L;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private List<String> personIds;
|
||||
private Long startTime;
|
||||
private Long endTime;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import cn.cloudwalk.elevator.person.param.AcsPersonPropertiesParam;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPersonAddNewForm implements Serializable {
|
||||
private static final long serialVersionUID = -5310626681307061439L;
|
||||
private String zoneId;
|
||||
private Long startTime;
|
||||
private Long endTime;
|
||||
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;
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AcsPersonAddVisitorForm 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 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 AcsPersonAddVisitorForm)) {
|
||||
return false;
|
||||
}
|
||||
AcsPersonAddVisitorForm other = (AcsPersonAddVisitorForm)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(visitorId, other.visitorId) && Objects.equals(personId, other.personId)
|
||||
&& Objects.equals(begVisitorTime, other.begVisitorTime)
|
||||
&& Objects.equals(endVisitorTime, other.endVisitorTime) && Objects.equals(floorIds, other.floorIds);
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof AcsPersonAddVisitorForm;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(visitorId, personId, begVisitorTime, endVisitorTime, floorIds);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AcsPersonAddVisitorForm(visitorId=" + getVisitorId() + ", personId=" + getPersonId()
|
||||
+ ", begVisitorTime=" + getBegVisitorTime() + ", endVisitorTime=" + getEndVisitorTime() + ", floorIds="
|
||||
+ getFloorIds() + ")";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class AcsPersonDeleteForm implements Serializable {
|
||||
private static final long serialVersionUID = 7916140658162290825L;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private List<String> personIds;
|
||||
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;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPersonDetailForm implements Serializable {
|
||||
private static final long serialVersionUID = 1211300452037642058L;
|
||||
private String zoneId;
|
||||
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;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPersonEditForm implements Serializable {
|
||||
private static final long serialVersionUID = 7916140658162290825L;
|
||||
private String zoneId;
|
||||
private String personId;
|
||||
private Long startTime;
|
||||
private Long endTime;
|
||||
private String imageStoreId;
|
||||
|
||||
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 String getPersonId() {
|
||||
return this.personId;
|
||||
}
|
||||
|
||||
public void setPersonId(String personId) {
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
public String getImageStoreId() {
|
||||
return this.imageStoreId;
|
||||
}
|
||||
|
||||
public void setImageStoreId(String imageStoreId) {
|
||||
this.imageStoreId = imageStoreId;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPersonFaceForm implements Serializable {
|
||||
private static final long serialVersionUID = 7916140658162290825L;
|
||||
private String deviceId;
|
||||
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;
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class AcsPersonQueryForm implements Serializable {
|
||||
private static final long serialVersionUID = -8830219133147503297L;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private String personName;
|
||||
private List<String> organizationIds;
|
||||
private List<String> labelIds;
|
||||
|
||||
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 setOrganizationIds(List<String> organizationIds) {
|
||||
this.organizationIds = organizationIds;
|
||||
}
|
||||
|
||||
public void setLabelIds(List<String> labelIds) {
|
||||
this.labelIds = labelIds;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof AcsPersonQueryForm)) {
|
||||
return false;
|
||||
}
|
||||
AcsPersonQueryForm other = (AcsPersonQueryForm)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(parentId, other.parentId) && Objects.equals(zoneId, other.zoneId)
|
||||
&& Objects.equals(personName, other.personName) && Objects.equals(organizationIds, other.organizationIds)
|
||||
&& Objects.equals(labelIds, other.labelIds) && Objects.equals(pageSize, other.pageSize)
|
||||
&& Objects.equals(pageNo, other.pageNo);
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof AcsPersonQueryForm;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(parentId, zoneId, personName, organizationIds, labelIds, pageSize, pageNo);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AcsPersonQueryForm(parentId=" + getParentId() + ", zoneId=" + getZoneId() + ", personName="
|
||||
+ getPersonName() + ", organizationIds=" + getOrganizationIds() + ", labelIds=" + getLabelIds()
|
||||
+ ", pageSize=" + getPageSize() + ", pageNo=" + getPageNo() + ")";
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public String getPersonName() {
|
||||
return this.personName;
|
||||
}
|
||||
|
||||
public List<String> getOrganizationIds() {
|
||||
return this.organizationIds;
|
||||
}
|
||||
|
||||
public List<String> getLabelIds() {
|
||||
return this.labelIds;
|
||||
}
|
||||
|
||||
private Integer pageSize = Integer.valueOf(10);
|
||||
|
||||
public Integer getPageSize() {
|
||||
return this.pageSize;
|
||||
}
|
||||
|
||||
private Integer pageNo = Integer.valueOf(1);
|
||||
|
||||
public Integer getPageNo() {
|
||||
return this.pageNo;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsPersonTimeDetailForm implements Serializable {
|
||||
private static final long serialVersionUID = -1135110893682603631L;
|
||||
private String imageStoreId;
|
||||
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;
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package cn.cloudwalk.elevator.person.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PersonDetailQueryForm extends CloudwalkBasePageForm implements Serializable {
|
||||
private static final long serialVersionUID = -8830219133147503297L;
|
||||
private String parentId;
|
||||
private String zoneId;
|
||||
private String ruleId;
|
||||
private String 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 PersonDetailQueryForm)) {
|
||||
return false;
|
||||
}
|
||||
PersonDetailQueryForm other = (PersonDetailQueryForm)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(parentId, other.parentId) && Objects.equals(zoneId, other.zoneId)
|
||||
&& Objects.equals(ruleId, other.ruleId) && Objects.equals(personName, other.personName);
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof PersonDetailQueryForm;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(parentId, zoneId, ruleId, personName);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "PersonDetailQueryForm(parentId=" + getParentId() + ", zoneId=" + getZoneId() + ", ruleId=" + getRuleId()
|
||||
+ ", personName=" + getPersonName() + ")";
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public String getZoneId() {
|
||||
return this.zoneId;
|
||||
}
|
||||
|
||||
public String getRuleId() {
|
||||
return this.ruleId;
|
||||
}
|
||||
|
||||
public String getPersonName() {
|
||||
return this.personName;
|
||||
}
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package cn.cloudwalk.elevator.record.controller;
|
||||
|
||||
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.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.AbstractCloudwalkController;
|
||||
import cn.cloudwalk.elevator.record.form.AcsElevatorRecordAnalyseCountForm;
|
||||
import cn.cloudwalk.elevator.record.form.AcsElevatorRecordAnalyseCycleForm;
|
||||
import cn.cloudwalk.elevator.record.form.AcsElevatorRecordQueryForm;
|
||||
import cn.cloudwalk.elevator.record.param.AcsElevatorRecordAnalyseCountParam;
|
||||
import cn.cloudwalk.elevator.record.param.AcsElevatorRecordAnalyseCycleParam;
|
||||
import cn.cloudwalk.elevator.record.param.AcsElevatorRecordDetailParam;
|
||||
import cn.cloudwalk.elevator.record.result.AcsElevatorAnalyseCycleResult;
|
||||
import cn.cloudwalk.elevator.record.result.AcsElevatorPageRequestInfoResult;
|
||||
import cn.cloudwalk.elevator.record.result.AcsElevatorRecordResult;
|
||||
import cn.cloudwalk.elevator.record.service.AcsElevatorRecordService;
|
||||
import cn.cloudwalk.elevator.zone.param.ZoneNextTreeParam;
|
||||
import cn.cloudwalk.elevator.zone.result.ZoneTreeResult;
|
||||
import cn.cloudwalk.elevator.zone.service.ZoneService;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/intelligent/acs/elevator/record"})
|
||||
public class AcsElevatorRecordController extends AbstractCloudwalkController {
|
||||
@Resource
|
||||
private AcsElevatorRecordService elevatorRecordService;
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
@Resource
|
||||
private ZoneService zoneService;
|
||||
|
||||
@PostMapping({"/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<AcsElevatorRecordResult>>
|
||||
detail(@RequestBody AcsElevatorRecordQueryForm form) {
|
||||
AcsElevatorRecordDetailParam param =
|
||||
(AcsElevatorRecordDetailParam)BeanCopyUtils.copyProperties(form, AcsElevatorRecordDetailParam.class);
|
||||
CloudwalkPageInfo pageInfo = new CloudwalkPageInfo(form.getCurrentPage(), form.getRowsOfPage());
|
||||
try {
|
||||
return this.elevatorRecordService.openRecord(param, pageInfo, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("开门记录详情查询失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260305", getMessage("76260305"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/analyse/cycle"})
|
||||
public CloudwalkResult<List<AcsElevatorAnalyseCycleResult>>
|
||||
analyseCycle(@RequestBody AcsElevatorRecordAnalyseCycleForm form) {
|
||||
AcsElevatorRecordAnalyseCycleParam param = (AcsElevatorRecordAnalyseCycleParam)BeanCopyUtils
|
||||
.copyProperties(form, AcsElevatorRecordAnalyseCycleParam.class);
|
||||
try {
|
||||
return this.elevatorRecordService.analyseCycle(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("开门记录统计分析查询失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260336", getMessage("76260336"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/analyse/count"})
|
||||
public CloudwalkResult<Integer> analyseCount(@RequestBody AcsElevatorRecordAnalyseCountForm form) {
|
||||
AcsElevatorRecordAnalyseCountParam param = (AcsElevatorRecordAnalyseCountParam)BeanCopyUtils
|
||||
.copyProperties(form, AcsElevatorRecordAnalyseCountParam.class);
|
||||
try {
|
||||
return this.elevatorRecordService.analyseCount(param, getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("开门记录统计分析查询失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260336", getMessage("76260336"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/page/request"})
|
||||
public CloudwalkResult<AcsElevatorPageRequestInfoResult> pageInfo() {
|
||||
try {
|
||||
return this.elevatorRecordService.pageInfo(getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.LOGGER.error("开门记录分页请求数据查询失败,原因:", (Throwable)e);
|
||||
return CloudwalkResult.fail("76260335", getMessage("76260335"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/device/list"})
|
||||
public CloudwalkResult<List<DeviceResult>> queryDeviceResult(@RequestBody DeviceQueryParam deviceQueryParam) {
|
||||
try {
|
||||
return this.deviceService.list(deviceQueryParam, getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("获取设备列表失败,原因:", e);
|
||||
return CloudwalkResult.fail("76260108", getMessage("76260108"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/zone/tree"})
|
||||
public CloudwalkResult<List<ZoneTreeResult>> queryZoneTree(@RequestBody ZoneNextTreeParam zoneNextTreeParam) {
|
||||
try {
|
||||
return this.zoneService.tree(zoneNextTreeParam, getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.LOGGER.error("获取设备列表失败,原因:", e);
|
||||
return CloudwalkResult.fail("76260108", getMessage("76260108"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package cn.cloudwalk.elevator.record.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorRecordAnalyseCountForm implements Serializable {
|
||||
private String businessId;
|
||||
private Long startTime;
|
||||
private Long endTime;
|
||||
|
||||
public String getBusinessId() {
|
||||
return this.businessId;
|
||||
}
|
||||
|
||||
public void setBusinessId(String businessId) {
|
||||
this.businessId = businessId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package cn.cloudwalk.elevator.record.form;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AcsElevatorRecordAnalyseCycleForm implements Serializable {
|
||||
private String businessId;
|
||||
private Integer timeType;
|
||||
|
||||
public String getBusinessId() {
|
||||
return this.businessId;
|
||||
}
|
||||
|
||||
public void setBusinessId(String businessId) {
|
||||
this.businessId = businessId;
|
||||
}
|
||||
|
||||
public Integer getTimeType() {
|
||||
return this.timeType;
|
||||
}
|
||||
|
||||
public void setTimeType(Integer timeType) {
|
||||
this.timeType = timeType;
|
||||
}
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package cn.cloudwalk.elevator.record.form;
|
||||
|
||||
import cn.cloudwalk.cloud.page.CloudwalkBasePageForm;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class AcsElevatorRecordQueryForm extends CloudwalkBasePageForm implements Serializable {
|
||||
@NotNull(message = "76260302")
|
||||
private Long startTime;
|
||||
@NotNull(message = "76260303")
|
||||
private Long endTime;
|
||||
private String personName;
|
||||
private String personId;
|
||||
private List<String> districtIds;
|
||||
private List<String> areaIds;
|
||||
private List<String> deviceIds;
|
||||
private String openDoorTypeCode;
|
||||
private Integer recordResult;
|
||||
private String srcFloor;
|
||||
private String destFloor;
|
||||
private String dispatchElevatorNo;
|
||||
private String personCode;
|
||||
private String orgId;
|
||||
|
||||
public String getPersonCode() {
|
||||
return this.personCode;
|
||||
}
|
||||
|
||||
public void setPersonCode(String personCode) {
|
||||
this.personCode = personCode;
|
||||
}
|
||||
|
||||
public String getOrgId() {
|
||||
return this.orgId;
|
||||
}
|
||||
|
||||
public void setOrgId(String orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
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 getPersonName() {
|
||||
return this.personName;
|
||||
}
|
||||
|
||||
public void setPersonName(String personName) {
|
||||
this.personName = personName;
|
||||
}
|
||||
|
||||
public List<String> getDistrictIds() {
|
||||
return this.districtIds;
|
||||
}
|
||||
|
||||
public void setDistrictIds(List<String> districtIds) {
|
||||
this.districtIds = districtIds;
|
||||
}
|
||||
|
||||
public List<String> getAreaIds() {
|
||||
return this.areaIds;
|
||||
}
|
||||
|
||||
public void setAreaIds(List<String> areaIds) {
|
||||
this.areaIds = areaIds;
|
||||
}
|
||||
|
||||
public List<String> getDeviceIds() {
|
||||
return this.deviceIds;
|
||||
}
|
||||
|
||||
public void setDeviceIds(List<String> deviceIds) {
|
||||
this.deviceIds = deviceIds;
|
||||
}
|
||||
|
||||
public String getOpenDoorTypeCode() {
|
||||
return this.openDoorTypeCode;
|
||||
}
|
||||
|
||||
public void setOpenDoorTypeCode(String openDoorTypeCode) {
|
||||
this.openDoorTypeCode = openDoorTypeCode;
|
||||
}
|
||||
|
||||
public Integer getRecordResult() {
|
||||
return this.recordResult;
|
||||
}
|
||||
|
||||
public void setRecordResult(Integer recordResult) {
|
||||
this.recordResult = recordResult;
|
||||
}
|
||||
|
||||
public String getSrcFloor() {
|
||||
return this.srcFloor;
|
||||
}
|
||||
|
||||
public void setSrcFloor(String srcFloor) {
|
||||
this.srcFloor = srcFloor;
|
||||
}
|
||||
|
||||
public String getDestFloor() {
|
||||
return this.destFloor;
|
||||
}
|
||||
|
||||
public void setDestFloor(String destFloor) {
|
||||
this.destFloor = destFloor;
|
||||
}
|
||||
|
||||
public String getDispatchElevatorNo() {
|
||||
return this.dispatchElevatorNo;
|
||||
}
|
||||
|
||||
public void setDispatchElevatorNo(String dispatchElevatorNo) {
|
||||
this.dispatchElevatorNo = dispatchElevatorNo;
|
||||
}
|
||||
|
||||
public String getPersonId() {
|
||||
return this.personId;
|
||||
}
|
||||
|
||||
public void setPersonId(String personId) {
|
||||
this.personId = personId;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package cn.cloudwalk.elevator.zone.util;
|
||||
|
||||
import cn.cloudwalk.elevator.util.StringUtils;
|
||||
import cn.cloudwalk.elevator.zone.result.ZoneTreeResult;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/** 区域树遍历辅助,供批量查询电梯编码等场景复用。 */
|
||||
public final class ZoneTreeCollectors {
|
||||
|
||||
private ZoneTreeCollectors() {}
|
||||
|
||||
/** 深度优先收集树上各节点 {@link ZoneTreeResult#getId()}(去重由调用方 {@link Set} 保证)。 */
|
||||
public static void collectNodeIds(List<ZoneTreeResult> nodes, Set<String> out) {
|
||||
if (nodes == null || out == null) {
|
||||
return;
|
||||
}
|
||||
for (ZoneTreeResult n : nodes) {
|
||||
if (StringUtils.isNotBlank(n.getId())) {
|
||||
out.add(n.getId());
|
||||
}
|
||||
collectNodeIds(n.getChildren(), out);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
Manifest-Version: 1.0
|
||||
Implementation-Title: cw-elevator-application-web
|
||||
Implementation-Version: 2.0-SNAPSHOT
|
||||
Archiver-Version: Plexus Archiver
|
||||
Built-By: YCWB0304
|
||||
Implementation-Vendor-Id: cn.cloudwalk.elevator
|
||||
Created-By: Apache Maven 3.6.1
|
||||
Build-Jdk: 1.8.0_144
|
||||
Implementation-URL: http://projects.spring.io/spring-boot/cw-elevator-
|
||||
application/cw-elevator-application-web/
|
||||
Implementation-Vendor: Pivotal Software, Inc.
|
||||
|
||||
Reference in New Issue
Block a user