mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 08:50:29 +08:00
fix: relocate cwos-portal decompiled output to correct path; remove nested directory
Former-commit-id: dc30d42a8c55ed8b2382a41dc2434233fbed9930
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* cn.cloudwalk.cloud.exception.ServiceException
|
||||
* cn.cloudwalk.cloud.result.CloudwalkResult
|
||||
* org.springframework.cloud.netflix.feign.FeignClient
|
||||
* org.springframework.web.bind.annotation.RequestMapping
|
||||
* org.springframework.web.bind.annotation.RequestMethod
|
||||
*/
|
||||
package cn.cloudwalk.elevator.mqtt.client;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.elevator.mqtt.fallback.MqttFeignClientFallback;
|
||||
import cn.cloudwalk.elevator.mqtt.param.MqttSendMessageParam;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@FeignClient(name="${feign.mqtt.name:cloudwalk-device-thirdparty}", path="/mqtt", fallback=MqttFeignClientFallback.class)
|
||||
public interface MqttFeignClient {
|
||||
@RequestMapping(value={"/publish"}, method={RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> publish(MqttSendMessageParam var1) throws ServiceException;
|
||||
}
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* cn.cloudwalk.cloud.exception.ServiceException
|
||||
* cn.cloudwalk.cloud.result.CloudwalkResult
|
||||
* org.springframework.stereotype.Component
|
||||
*/
|
||||
package cn.cloudwalk.elevator.mqtt.fallback;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.elevator.mqtt.client.MqttFeignClient;
|
||||
import cn.cloudwalk.elevator.mqtt.param.MqttSendMessageParam;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MqttFeignClientFallback
|
||||
implements MqttFeignClient {
|
||||
@Override
|
||||
public CloudwalkResult<Boolean> publish(MqttSendMessageParam param) throws ServiceException {
|
||||
throw new RuntimeException("mqtt\u53d1\u9001\u6570\u636e\u5931\u8d25");
|
||||
}
|
||||
}
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* cn.cloudwalk.cloud.exception.ServiceException
|
||||
* cn.cloudwalk.cloud.result.CloudwalkResult
|
||||
* cn.cloudwalk.cloud.utils.BeanCopyUtils
|
||||
* cn.cloudwalk.elevator.record.dao.AcsRecogRecordDao
|
||||
* cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO
|
||||
* cn.cloudwalk.elevator.record.dto.AcsRecogRecordPageDTO
|
||||
* cn.cloudwalk.elevator.record.dto.AcsRecogRecordResultDTO
|
||||
* cn.cloudwalk.elevator.util.DateUtils
|
||||
* com.alibaba.fastjson.JSON
|
||||
* org.apache.commons.collections4.CollectionUtils
|
||||
* org.apache.commons.lang3.StringUtils
|
||||
* org.springframework.beans.factory.annotation.Qualifier
|
||||
* org.springframework.scheduling.annotation.Async
|
||||
* org.springframework.stereotype.Component
|
||||
*/
|
||||
package cn.cloudwalk.elevator.mqtt.impl;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.elevator.common.AbstractAcsDeviceService;
|
||||
import cn.cloudwalk.elevator.mqtt.client.MqttFeignClient;
|
||||
import cn.cloudwalk.elevator.mqtt.param.AcsElevatorRecordMqttParam;
|
||||
import cn.cloudwalk.elevator.mqtt.param.MqttSendMessageParam;
|
||||
import cn.cloudwalk.elevator.mqtt.service.MqttService;
|
||||
import cn.cloudwalk.elevator.record.dao.AcsRecogRecordDao;
|
||||
import cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO;
|
||||
import cn.cloudwalk.elevator.record.dto.AcsRecogRecordPageDTO;
|
||||
import cn.cloudwalk.elevator.record.dto.AcsRecogRecordResultDTO;
|
||||
import cn.cloudwalk.elevator.util.DateUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MqttServiceImpl
|
||||
extends AbstractAcsDeviceService
|
||||
implements MqttService {
|
||||
private static final String VISITOR_LABEL_CODE = "1";
|
||||
private static final String VISITOR_LABEL_NAME = "\u8bbf\u5ba2";
|
||||
private static final String ELEVATOR_RECORD_SUFFIX = "_elevator_record";
|
||||
@Qualifier(value="cn.cloudwalk.elevator.mqtt.client.MqttFeignClient")
|
||||
@Resource
|
||||
private MqttFeignClient mqttFeignClient;
|
||||
@Resource
|
||||
private AcsRecogRecordDao acsRecogRecordDao;
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void sendInfoToOne(AcsElevatorRecordAddDTO addDTO) throws ServiceException {
|
||||
this.logger.info("\u9632\u6b62\u4eba\u5458\u8bc6\u522b\u8bb0\u5f55\u672a\u5165\u5e93\u5373\u5f00\u59cb\u63a8\u9001\u6d88\u606f\uff0c\u4f11\u772010\u79d2");
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(10L);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
this.logger.error("\u4f11\u7720\u5931\u8d25\uff0c\u5931\u8d25\u539f\u56e0\uff1a{}", (Object)e.getMessage());
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
try {
|
||||
AcsRecogRecordPageDTO recordPageDTO = new AcsRecogRecordPageDTO();
|
||||
recordPageDTO.setLogId(addDTO.getRecognitionFaceId());
|
||||
recordPageDTO.setStartTime(DateUtils.todayStart());
|
||||
recordPageDTO.setEndTime(DateUtils.todayEnd());
|
||||
List recogRecordResultDTOS = this.acsRecogRecordDao.page(recordPageDTO);
|
||||
if (!CollectionUtils.isEmpty((Collection)recogRecordResultDTOS)) {
|
||||
CloudwalkResult<Boolean> publish;
|
||||
AcsRecogRecordResultDTO acsRecogRecordResultDTO = (AcsRecogRecordResultDTO)recogRecordResultDTOS.get(0);
|
||||
AcsElevatorRecordMqttParam acsElevatorRecordMqttParam = (AcsElevatorRecordMqttParam)BeanCopyUtils.copyProperties((Object)addDTO, AcsElevatorRecordMqttParam.class);
|
||||
acsElevatorRecordMqttParam.setOpenDoorId(addDTO.getId());
|
||||
acsElevatorRecordMqttParam.setPersonName(acsRecogRecordResultDTO.getPersonName());
|
||||
if (StringUtils.isNotBlank((CharSequence)acsRecogRecordResultDTO.getPersonLabelIds()) && acsRecogRecordResultDTO.getPersonLabelIds().contains(VISITOR_LABEL_CODE)) {
|
||||
acsElevatorRecordMqttParam.setIsVisitor(Boolean.TRUE);
|
||||
}
|
||||
if ((publish = this.mqttFeignClient.publish(MqttSendMessageParam.builder().topic(addDTO.getBusinessId() + ELEVATOR_RECORD_SUFFIX).data(JSON.toJSONString((Object)acsElevatorRecordMqttParam)).build())).isSuccess()) {
|
||||
this.logger.info("\u63a8\u9001\u6570\u636e\u6210\u529f\uff01\uff01\uff01,\u6570\u636e\uff0c{}", (Object)JSON.toJSONString((Object)acsElevatorRecordMqttParam));
|
||||
} else {
|
||||
this.logger.debug("\u63a8\u9001\u6570\u636e\u5931\u8d25\uff01\uff01\uff01");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
this.logger.error("\u53d1\u9001\u6d88\u606f\u5931\u8d25 param:{} {}", (Object)addDTO, (Object)e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package cn.cloudwalk.elevator.mqtt.param;
|
||||
|
||||
public class AcsElevatorRecordMqttParam {
|
||||
private String openDoorId;
|
||||
private String openDoorType;
|
||||
private String srcFloor;
|
||||
private String destFloor;
|
||||
private String dispatchElevatorNo;
|
||||
private Long dispatchElevatorTime;
|
||||
private String personName;
|
||||
private Boolean isVisitor = false;
|
||||
|
||||
public String getOpenDoorId() {
|
||||
return this.openDoorId;
|
||||
}
|
||||
|
||||
public String getOpenDoorType() {
|
||||
return this.openDoorType;
|
||||
}
|
||||
|
||||
public String getSrcFloor() {
|
||||
return this.srcFloor;
|
||||
}
|
||||
|
||||
public String getDestFloor() {
|
||||
return this.destFloor;
|
||||
}
|
||||
|
||||
public String getDispatchElevatorNo() {
|
||||
return this.dispatchElevatorNo;
|
||||
}
|
||||
|
||||
public Long getDispatchElevatorTime() {
|
||||
return this.dispatchElevatorTime;
|
||||
}
|
||||
|
||||
public String getPersonName() {
|
||||
return this.personName;
|
||||
}
|
||||
|
||||
public Boolean getIsVisitor() {
|
||||
return this.isVisitor;
|
||||
}
|
||||
|
||||
public void setOpenDoorId(String openDoorId) {
|
||||
this.openDoorId = openDoorId;
|
||||
}
|
||||
|
||||
public void setOpenDoorType(String openDoorType) {
|
||||
this.openDoorType = openDoorType;
|
||||
}
|
||||
|
||||
public void setSrcFloor(String srcFloor) {
|
||||
this.srcFloor = srcFloor;
|
||||
}
|
||||
|
||||
public void setDestFloor(String destFloor) {
|
||||
this.destFloor = destFloor;
|
||||
}
|
||||
|
||||
public void setDispatchElevatorNo(String dispatchElevatorNo) {
|
||||
this.dispatchElevatorNo = dispatchElevatorNo;
|
||||
}
|
||||
|
||||
public void setDispatchElevatorTime(Long dispatchElevatorTime) {
|
||||
this.dispatchElevatorTime = dispatchElevatorTime;
|
||||
}
|
||||
|
||||
public void setPersonName(String personName) {
|
||||
this.personName = personName;
|
||||
}
|
||||
|
||||
public void setIsVisitor(Boolean isVisitor) {
|
||||
this.isVisitor = isVisitor;
|
||||
}
|
||||
}
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package cn.cloudwalk.elevator.mqtt.param;
|
||||
|
||||
import java.beans.ConstructorProperties;
|
||||
|
||||
public class MqttSendMessageParam {
|
||||
private String topic;
|
||||
private String data;
|
||||
|
||||
@ConstructorProperties(value={"topic", "data"})
|
||||
MqttSendMessageParam(String topic, String data) {
|
||||
this.topic = topic;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static MqttSendMessageParamBuilder builder() {
|
||||
return new MqttSendMessageParamBuilder();
|
||||
}
|
||||
|
||||
public String getTopic() {
|
||||
return this.topic;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public void setTopic(String topic) {
|
||||
this.topic = topic;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class MqttSendMessageParamBuilder {
|
||||
private String topic;
|
||||
private String data;
|
||||
|
||||
MqttSendMessageParamBuilder() {
|
||||
}
|
||||
|
||||
public MqttSendMessageParamBuilder topic(String topic) {
|
||||
this.topic = topic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MqttSendMessageParamBuilder data(String data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MqttSendMessageParam build() {
|
||||
return new MqttSendMessageParam(this.topic, this.data);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "MqttSendMessageParam.MqttSendMessageParamBuilder(topic=" + this.topic + ", data=" + this.data + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* cn.cloudwalk.cloud.exception.ServiceException
|
||||
* cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO
|
||||
*/
|
||||
package cn.cloudwalk.elevator.mqtt.service;
|
||||
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.elevator.record.dto.AcsElevatorRecordAddDTO;
|
||||
|
||||
public interface MqttService {
|
||||
public void sendInfoToOne(AcsElevatorRecordAddDTO var1) throws ServiceException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user