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

Former-commit-id: dc30d42a8c55ed8b2382a41dc2434233fbed9930
This commit is contained in:
反编译工作区
2026-04-29 12:09:48 +08:00
parent ea8e492076
commit e8672a3c7b
1759 changed files with 547735 additions and 280 deletions
@@ -0,0 +1,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, "");
}
}
@@ -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 = 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()))) {
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);
}
}
@@ -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 = queryDeviceResult(personRecordUploadEvent.getDeviceId(), context);
DeviceResult subDeviceResult = 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;
}
}
@@ -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;
}
}
@@ -0,0 +1,232 @@
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.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 cn.cloudwalk.elevator.zone.util.ZoneTreeCollectors;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
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();
LinkedHashSet<String> zoneIdsForCode = new LinkedHashSet<>();
ZoneTreeCollectors.collectNodeIds(treeList, zoneIdsForCode);
Map<String, AcsElevatorCodeResultDTO> codeByZoneId =
this.elevatorCodeService.mapByZoneIds(new ArrayList<>(zoneIdsForCode));
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());
AcsElevatorCodeResultDTO code = codeByZoneId.get(floor.getId());
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());
AcsElevatorCodeResultDTO code = codeByZoneId.get(zoneTreeResult.getId());
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());
AcsElevatorCodeResultDTO code = codeByZoneId.get(floor.getId());
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());
AcsElevatorCodeResultDTO code = codeByZoneId.get(zoneTreeResult.getId());
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());
}
}
/**
* 历史接口:曾下发应用密钥。按安全走查要求不再返回明文密钥,仅保留时间戳供客户端对时等场景使用。
*/
@Deprecated
@PostMapping({"39204"})
public CloudwalkResult<KeyValueResult> getKey(@RequestBody AcsElevatorRecordAddForm form) {
KeyValueResult result = new KeyValueResult();
result.setKey("");
result.setTime(this.time);
result.setKeyA("");
this.LOGGER.warn("getKey(39204) 已停用明文密钥下发,调用方应迁移至安全鉴权方式");
return CloudwalkResult.success(result);
}
}
@@ -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());
}
}
}
@@ -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(base64)) {
return CloudwalkResult.fail("53060544", getMessage("53060544"));
}
try {
byte[] bytes = DatatypeConverter.parseBase64Binary(base64);
if (bytes.length > ImageStoreConstants.MAX_FILE.intValue()) {
return CloudwalkResult.fail("53060428", getMessage("53060428"));
}
String fileName = ToolUtil.generateUUID();
this.LOGGER.info("上传文件:{},size={}", fileName, Integer.valueOf(bytes.length));
CloudwalkResult<String> storeResult = this.personFileService.upload(fileName, bytes);
if (storeResult != null && StringUtils.isNotBlank((CharSequence)storeResult.getData())) {
return CloudwalkResult.success(storeResult.getData());
}
return storeResult;
} catch (Exception e) {
this.LOGGER.error("", e);
return CloudwalkResult.fail("80014013", getMessage("80014013"));
}
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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 + '\'' + '}';
}
}
@@ -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 + '}';
}
}
@@ -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;
}
}
@@ -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 + '\'' + '}';
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -0,0 +1,6 @@
/**
* 设备与通行相关 HTTP 入口:设备网关查询、电梯码、通行记录等 {@code /device/v2/} 下接口。
* <p>
* 负责表单/JSON 与业务 {@code param} 的转换,业务规则与远程协作放在 service 层。
*/
package cn.cloudwalk.elevator.handler.device;
@@ -0,0 +1,6 @@
/**
* 电梯应用 Web 层:控制器、表单对象及与前端交互的入口。
* <p>
* 通过依赖 {@code cw-elevator-application-service} 调用业务服务,保持 Web 层薄、校验与编排下沉。
*/
package cn.cloudwalk.elevator.handler;