|
@ -186,10 +186,10 @@ public class DataInputService {
|
|
if(data.length()>60000){
|
|
if(data.length()>60000){
|
|
throw new ServiceException("设备数据data超过最大允许字符");
|
|
throw new ServiceException("设备数据data超过最大允许字符");
|
|
}
|
|
}
|
|
String categoryCode = jsonObject.getString("categoryCode");
|
|
|
|
if(StringUtils.isBlank(categoryCode)){
|
|
|
|
throw new ServiceException("设备类型不能为空");
|
|
|
|
}
|
|
|
|
|
|
// String categoryCode = jsonObject.getString("categoryCode");
|
|
|
|
// if(StringUtils.isBlank(categoryCode)){
|
|
|
|
// throw new ServiceException("设备类型不能为空");
|
|
|
|
// }
|
|
IotDeviceDO iotDeviceDO = iotDeviceService.findByDeviceSn(deviceSn);
|
|
IotDeviceDO iotDeviceDO = iotDeviceService.findByDeviceSn(deviceSn);
|
|
if(iotDeviceDO==null){
|
|
if(iotDeviceDO==null){
|
|
throw new ServiceException("请先注册设备后在上传");
|
|
throw new ServiceException("请先注册设备后在上传");
|
|
@ -199,7 +199,7 @@ public class DataInputService {
|
|
recordDO.setDeviceSn(deviceSn);
|
|
recordDO.setDeviceSn(deviceSn);
|
|
recordDO.setHospital(hospital);
|
|
recordDO.setHospital(hospital);
|
|
recordDO.setJsonData(data);
|
|
recordDO.setJsonData(data);
|
|
recordDO.setCategoryCode(categoryCode);
|
|
|
|
|
|
recordDO.setCategoryCode("uploadDeviceData");
|
|
recordDO.setStatus(0);
|
|
recordDO.setStatus(0);
|
|
recordDO.setCreateTime(new Date());
|
|
recordDO.setCreateTime(new Date());
|
|
iotDeviceUploadRecordDao.save(recordDO);
|
|
iotDeviceUploadRecordDao.save(recordDO);
|