吉安感知网项目-后端
linwei
2026-04-02 8ac34cbae4ea8cc47194f51389a4e2dddebcc7d5
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceMaintainPlanController.java
@@ -96,6 +96,17 @@
   @ApiOperationSupport(order = 3)
   @ApiOperation(value = "新增或修改", notes = "传入fwDeviceMaintainPlan")
   public R submit(@Valid @RequestBody FwDeviceMaintainPlanDTO fwDeviceMaintainPlan) {
      if (null == fwDeviceMaintainPlan.getDeviceId()) {
         return R.fail("参数错误");
      }
      long count = fwDeviceMaintainPlanService.count(new QueryWrapper<FwDeviceMaintainPlanEntity>().lambda()
            .eq(FwDeviceMaintainPlanEntity::getDeviceId, fwDeviceMaintainPlan.getDeviceId()));
      if (count > 0) {
         return R.fail("该设备已建立维护计划");
      }
      return R.status(fwDeviceMaintainPlanService.saveOrUpdate(FwDeviceMaintainPlanWrapper.build().entityDTO(fwDeviceMaintainPlan)));
   }