修改逻辑,归零不需要requireIot

This commit is contained in:
磷叶 2025-01-31 18:40:54 +08:00
parent 0b0018914a
commit 2669b9a2f2
3 changed files with 4 additions and 4 deletions

View File

@ -83,7 +83,7 @@ public class BillMonitorTask {
// 判断是否低功率若低于指定功率则关闭订单清零设备 // 判断是否低功率若低于指定功率则关闭订单清零设备
if (deviceInfo != null && deviceInfo.getP() != null && deviceInfo.getP().compareTo(bill.getSuitLowPower()) < 0) { if (deviceInfo != null && deviceInfo.getP() != null && deviceInfo.getP().compareTo(bill.getSuitLowPower()) < 0) {
String reason = String.format("低功率订单%s自动关闭", bill.getBillNo()); String reason = String.format("低功率订单%s自动关闭", bill.getBillNo());
deviceService.resetWithBill(bill.getDeviceId(), true, deviceInfo.getW(), reason, false, true); deviceService.resetWithBill(bill.getDeviceId(), false, deviceInfo.getW(), reason, false, true);
} }
} catch (Exception e) { } catch (Exception e) {
log.warn("关闭低功率订单{}出错:{}", bill.getBillNo(), e.getMessage()); log.warn("关闭低功率订单{}出错:{}", bill.getBillNo(), e.getMessage());

View File

@ -182,7 +182,7 @@ public class AppDeviceController extends BaseController {
return error("您无权操作此设备"); return error("您无权操作此设备");
} }
String reason = String.format("商户设备归零:id=%s", deviceId); String reason = String.format("商户设备归零:id=%s", deviceId);
return toAjax(smDeviceService.resetWithBill(deviceId, true, null, reason, true, true)); return toAjax(smDeviceService.resetWithBill(deviceId, false, null, reason, true, true));
} }
@ApiOperation("获取设备用电量分析") @ApiOperation("获取设备用电量分析")

View File

@ -180,14 +180,14 @@ public class SmDeviceController extends BaseController
@Log(title = "设备时长归零", businessType = BusinessType.OTHER) @Log(title = "设备时长归零", businessType = BusinessType.OTHER)
@PutMapping("/{deviceId}/reset") @PutMapping("/{deviceId}/reset")
public AjaxResult reset(@PathVariable @ApiParam("设备id") Long deviceId) { public AjaxResult reset(@PathVariable @ApiParam("设备id") Long deviceId) {
return toAjax(deviceService.resetWithBill(deviceId, true, null, "后台设备时长归零", true, false)); return toAjax(deviceService.resetWithBill(deviceId, false, null, "后台设备时长归零", true, false));
} }
@PreAuthorize("@ss.hasPermi('system:device:resetEle')") @PreAuthorize("@ss.hasPermi('system:device:resetEle')")
@Log(title = "设备清空电量", businessType = BusinessType.OTHER) @Log(title = "设备清空电量", businessType = BusinessType.OTHER)
@PutMapping("/{deviceId}/resetEle") @PutMapping("/{deviceId}/resetEle")
public AjaxResult resetEle(@PathVariable @ApiParam("设备id") Long deviceId) { public AjaxResult resetEle(@PathVariable @ApiParam("设备id") Long deviceId) {
return toAjax(deviceService.resetWithBill(deviceId, true, null, "后台设备电量归零", false, true)); return toAjax(deviceService.resetWithBill(deviceId, false, null, "后台设备电量归零", false, true));
} }
@ApiOperation("设备开关") @ApiOperation("设备开关")