| | |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | | import com.gkhy.exam.common.api.CommonResult; |
| | | import com.gkhy.exam.common.constant.UserConstant; |
| | | import com.gkhy.exam.common.exception.ApiException; |
| | | import com.gkhy.exam.common.utils.PageUtils; |
| | | import com.gkhy.exam.common.utils.SecurityUtils; |
| | | import com.gkhy.exam.system.domain.AnnualMaintenanceEvaluate; |
| | |
| | | .in(AnnualMaintenanceEvaluateDevice::getId, evaluateDeviceIds) |
| | | ); |
| | | if (update <= 0){ |
| | | throw new RuntimeException("保存年度基础设施维护计划设备失败"); |
| | | throw new ApiException("保存年度基础设施维护计划设备失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | }); |
| | | int insert = annualMaintenanceEvaluateDeviceMapper.batchInsert(addData); |
| | | if (insert <= 0){ |
| | | throw new RuntimeException("保存年度基础设施维护计划设备失败"); |
| | | throw new ApiException("保存年度基础设施维护计划设备失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | }); |
| | | int update = annualMaintenanceEvaluateDeviceMapper.batchUpdate(updateData); |
| | | if (update <= 0){ |
| | | throw new RuntimeException("保存年度基础设施维护计划设备失败"); |
| | | throw new ApiException("保存年度基础设施维护计划设备失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | .set(AnnualMaintenanceEvaluateDevice::getUpdateTime, LocalDateTime.now()) |
| | | .set(AnnualMaintenanceEvaluateDevice::getUpdateBy, SecurityUtils.getUsername())); |
| | | if (update1 <= 0){ |
| | | throw new RuntimeException("删除年度基础设施维护计划设备失败"); |
| | | throw new ApiException("删除年度基础设施维护计划设备失败"); |
| | | } |
| | | return CommonResult.success("删除成功"); |
| | | } |