|
@@ -22,6 +22,7 @@ import com.xy.dto.DeviceAnnualFeeDto;
|
|
import com.xy.dto.MqttUserDto;
|
|
import com.xy.dto.MqttUserDto;
|
|
import com.xy.dto.be.MercDto;
|
|
import com.xy.dto.be.MercDto;
|
|
import com.xy.entity.*;
|
|
import com.xy.entity.*;
|
|
|
|
+import com.xy.error.CommRuntimeException;
|
|
import com.xy.mapper.DeviceAnnualFeeMapper;
|
|
import com.xy.mapper.DeviceAnnualFeeMapper;
|
|
import com.xy.service.be.MercService;
|
|
import com.xy.service.be.MercService;
|
|
import com.xy.utils.*;
|
|
import com.xy.utils.*;
|
|
@@ -86,9 +87,23 @@ public class DeviceAnnualFeeServiceImpl extends ServiceImpl<DeviceAnnualFeeMappe
|
|
@PostMapping("check")
|
|
@PostMapping("check")
|
|
@ApiOperation("检查")
|
|
@ApiOperation("检查")
|
|
public R<String> check(@RequestBody @Validated DeviceAnnualFeeDto.Check check) {
|
|
public R<String> check(@RequestBody @Validated DeviceAnnualFeeDto.Check check) {
|
|
- log.info("独立部署检查:{},运行环境:{}", check.getDeviceId(), check.getRunPlatform());
|
|
|
|
|
|
+ log.info("独立部署检查:{},{},运行环境:{}", check.getDeviceId(), check.getSn(), check.getRunPlatform());
|
|
|
|
+ Long deviceId = check.getDeviceId();
|
|
|
|
+ String sn = check.getSn();
|
|
|
|
+ if (!Emptys.check(deviceId) && !Emptys.check(sn)) {
|
|
|
|
+ throw new CommRuntimeException("deviceId和sn必须传入一个");
|
|
|
|
+ }
|
|
|
|
+ if (!Emptys.check(deviceId)) {
|
|
|
|
+ DeviceSysinfo deviceSysinfo = deviceSysinfoService.getOne(new LambdaQueryWrapper<DeviceSysinfo>()
|
|
|
|
+ .eq(DeviceSysinfo::getDeviceSn, sn)
|
|
|
|
+ );
|
|
|
|
+ if (deviceSysinfo == null) {
|
|
|
|
+ throw new CommRuntimeException("sn未查找到设备");
|
|
|
|
+ }
|
|
|
|
+ deviceId = deviceSysinfo.getDeviceId();
|
|
|
|
+ }
|
|
DeviceAnnualFee deviceAnnualFee = getOne(new LambdaQueryWrapper<DeviceAnnualFee>()
|
|
DeviceAnnualFee deviceAnnualFee = getOne(new LambdaQueryWrapper<DeviceAnnualFee>()
|
|
- .eq(DeviceAnnualFee::getDeviceId, check.getDeviceId())
|
|
|
|
|
|
+ .eq(DeviceAnnualFee::getDeviceId, deviceId)
|
|
.eq(DeviceAnnualFee::getIsThis, true)
|
|
.eq(DeviceAnnualFee::getIsThis, true)
|
|
);
|
|
);
|
|
if (deviceAnnualFee == null) {
|
|
if (deviceAnnualFee == null) {
|