|  |  |  | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoRm.UgRtuTask; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoUg.UgRtuTask; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voPr.VoController; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Operation; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Content; | 
|---|
|  |  |  | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(res); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("查询RTU升级任务异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()) ; | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg(e.getMessage()) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除升级任务所有控制器 | 
|---|
|  |  |  | * @param taskId 任务id | 
|---|
|  |  |  | * @return 是否成功 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Operation(summary = "删除升级任务所有控制器", description = "删除升级任务所有控制器") | 
|---|
|  |  |  | @ApiResponses(value = { | 
|---|
|  |  |  | @ApiResponse( | 
|---|
|  |  |  | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, | 
|---|
|  |  |  | description = "操作结果:true:成功,false:失败(BaseResponse.content)", | 
|---|
|  |  |  | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, | 
|---|
|  |  |  | schema = @Schema(implementation = Boolean.class))} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(path = "deleteAll") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> deleteAll(Long taskId){ | 
|---|
|  |  |  | if(taskId == null){ | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("任务id不能为空") ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int count; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | count = this.sv.deleteAll(taskId); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("删除升级所有对象控制器异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg(e.getMessage()) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(count <= 0){ | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("数据库操作失败") ; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 升级任务控制器集合中删除一个控制器 | 
|---|
|  |  |  | * @param id 数据记录id | 
|---|
|  |  |  | * @return 是否成功 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Operation(summary = "升级任务控制器集合中删除一个控制器", description = "升级任务控制器集合中删除一个控制器") | 
|---|
|  |  |  | @ApiResponses(value = { | 
|---|
|  |  |  | @ApiResponse( | 
|---|
|  |  |  | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, | 
|---|
|  |  |  | description = "操作结果:true:成功,false:失败(BaseResponse.content)", | 
|---|
|  |  |  | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, | 
|---|
|  |  |  | schema = @Schema(implementation = Boolean.class))} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(path = "deleteOne") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> deleteOne(Long id){ | 
|---|
|  |  |  | if(id == null){ | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("id不能为空") ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int count; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | count = this.sv.deleteOne(id); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("删除升级对象控制器异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg(e.getMessage()) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(count <= 0){ | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("数据库操作失败") ; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|