|
...
|
...
|
@@ -2,6 +2,8 @@ package com.zhonglai.luhui.mqtt.service.topic; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.zhonglai.luhui.device.analysis.comm.service.BusinessDataUpdateService;
|
|
|
|
import com.zhonglai.luhui.device.analysis.dto.topic.AddPostDto;
|
|
|
|
import com.zhonglai.luhui.device.domain.IotThingsModel;
|
|
|
|
import com.zhonglai.luhui.device.analysis.comm.dto.ServerDto;
|
|
|
|
import com.zhonglai.luhui.device.analysis.comm.dto.business.BusinessDto;
|
|
...
|
...
|
@@ -17,6 +19,7 @@ import org.apache.commons.lang3.EnumUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
@Service("READ_REQ")
|
|
...
|
...
|
@@ -26,12 +29,20 @@ public class ReadReqTopic implements BusinessAgreement<ReadReqDto> { |
|
|
|
@Autowired
|
|
|
|
private TerminalDataThingsModeService terminalDataThingsModeService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private BusinessDataUpdateService businessDataUpdateService;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ServerDto analysis(Topic topic, ReadReqDto data) {
|
|
|
|
if(1==data.getCode())
|
|
|
|
{
|
|
|
|
JSONObject vjsonObject = data.getData().clone();
|
|
|
|
// businessDataUpdateService.updataDta(BusinessDataUpdateService.Type.ADD,topic,true,data);
|
|
|
|
AddPostDto serverDto = new AddPostDto();
|
|
|
|
serverDto.setData(data.getData());
|
|
|
|
serverDto.setIotTerminalList(new ArrayList<>());
|
|
|
|
serverDto.setDeviceSensorDataList(new ArrayList<>());
|
|
|
|
serverDto.setLogDeviceOperationList(new ArrayList<>());
|
|
|
|
businessDataUpdateService.updataDta(BusinessDataUpdateService.Type.ADD,topic,serverDto,"远程控制",false);
|
|
|
|
|
|
|
|
if(null != vjsonObject && vjsonObject.size() !=0 )
|
|
|
|
{
|
|
...
|
...
|
@@ -79,7 +90,7 @@ public class ReadReqTopic implements BusinessAgreement<ReadReqDto> { |
|
|
|
message.setCode(MessageCode.DEFAULT_SUCCESS_CODE);
|
|
|
|
message.setMessage("成功");
|
|
|
|
});
|
|
|
|
return data;
|
|
|
|
return serverDto;
|
|
|
|
}else if(0==data.getCode())
|
|
|
|
{
|
|
|
|
clienNoticeService.replySendMessage(topic, message -> {
|
|
...
|
...
|
@@ -90,9 +101,9 @@ public class ReadReqTopic implements BusinessAgreement<ReadReqDto> { |
|
|
|
message.setCode(MessageCode.DEFAULT_FAIL_CODE);
|
|
|
|
message.setMessage("失败");
|
|
|
|
});
|
|
|
|
return data;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
...
|
...
|
|