设备操作相关接口,以及用户充值卡相关接口修改

This commit is contained in:
mi9688
2024-12-18 14:55:56 +08:00
parent 788bfb100a
commit 593f3d3faa
11 changed files with 144 additions and 18 deletions

View File

@ -0,0 +1,15 @@
package com.fastbee.iot.model.dto;
import lombok.Data;
@Data
public class DeviceOperationDTO {
private Long productId;
private String deviceNumber;
private String operationType;
private String operationCode;
}

View File

@ -5,6 +5,8 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.iot.domain.Device;
import com.fastbee.iot.mapper.DeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.iot.mapper.DeviceReportInfoMapper;
@ -24,6 +26,10 @@ public class DeviceReportInfoServiceImpl implements IDeviceReportInfoService
private DeviceReportInfoMapper deviceReportInfoMapper;
@Autowired
private DeviceMapper deviceMapper;
/**
* 查询设备上电审核前上报的基础信息
*
@ -81,7 +87,26 @@ public class DeviceReportInfoServiceImpl implements IDeviceReportInfoService
if(deviceReportInfo.getAutoReview()!=null&&deviceReportInfo.getAutoReview()){
deviceReportInfo.setStatus(2);//修改状态为已审核
}
return deviceReportInfoMapper.insertDeviceReportInfo(deviceReportInfo);
int inserted = deviceReportInfoMapper.insertDeviceReportInfo(deviceReportInfo);
if(inserted<1){
throw new ServiceException("插入设备上报信息失败!");
}
// //插入成功后,插入设备信息
// Device device= new Device();
// device.setDeviceName(deviceReportInfo.getName());
// device.setSerialNumber(deviceReportInfo.getSerialNumber());
// //TODO 弄成活的
// device.setProductId(146L);
// device.setStatus(1);//未激活
// device.setCreateTime(deviceReportInfo.getPowersTime());
// device.setTenantId(1L);//默认总管理员
// int inserted1 = deviceMapper.insert(device);
// if(inserted1<1){
// throw new ServiceException("插入设备信息失败!");
// }
return 1;
}
/**