|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
package com.shxy.xymanager_service.mqtt;
|
|
|
|
|
package com.shxy.xymanager_service.mqtt.handler;
|
|
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.entity.TerminalPhoto;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Terminals;
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.model.mqtt.DeviceUploadImageDataEvent;
|
|
|
|
|
import com.shxy.xymanager_common.model.mqtt.*;
|
|
|
|
|
import com.shxy.xymanager_common.util.DateUtil;
|
|
|
|
|
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
|
|
|
|
|
import com.shxy.xymanager_service.service.TerminalExtService;
|
|
|
|
@ -23,7 +23,9 @@ import java.io.IOException;
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
@ -92,4 +94,28 @@ public class PhotoHandler {
|
|
|
|
|
|
|
|
|
|
terminalPhotoDao.insert(record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MessageUpload allowUpload(DeviceRequestUploadImageDataEvent image, String deviceId) {
|
|
|
|
|
SetAcceptCameraPhoto item = new SetAcceptCameraPhoto();
|
|
|
|
|
item.setChannel(image.getChannelNumber());
|
|
|
|
|
item.setPreset_no(image.getPresetPosition());
|
|
|
|
|
|
|
|
|
|
PlatformSettingParameterLssueService issue = new PlatformSettingParameterLssueService();
|
|
|
|
|
issue.setSetAcceptCameraPhoto(item);
|
|
|
|
|
CommonData data = new CommonData();
|
|
|
|
|
data.setPlatformSettingParameterLssueService(issue);
|
|
|
|
|
OneService service = new OneService();
|
|
|
|
|
service.setData(data);
|
|
|
|
|
service.setServiceId("PlatformSettingParameterLssueService");
|
|
|
|
|
List<OneService> listS = new ArrayList<>();
|
|
|
|
|
listS.add(service);
|
|
|
|
|
Device device = new Device();
|
|
|
|
|
device.setServices(listS);
|
|
|
|
|
device.setDeviceId(deviceId);
|
|
|
|
|
List<Device> listD = new ArrayList<>();
|
|
|
|
|
listD.add(device);
|
|
|
|
|
MessageUpload upload = new MessageUpload();
|
|
|
|
|
upload.setDevices(listD);
|
|
|
|
|
return upload;
|
|
|
|
|
}
|
|
|
|
|
}
|