| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.constants.AssetDeptConstant; |
| | | import com.ruoyi.system.dto.AssetRepairRecordAddDTO; |
| | | import com.ruoyi.system.dto.asset.AssetRepairCompleteDTO; |
| | | import com.ruoyi.system.query.AssetRepairRecordPageQuery; |
| | | import com.ruoyi.system.service.AssetRepairRecordService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.vo.asset.AssetRepairRecordDetailVO; |
| | | import com.ruoyi.system.vo.asset.AssetRepairRecordPageVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author WuGuanFengYue |
| | | * @since 2025-09-15 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"资产维修记录相关接口"}) |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation("新增维修记录") |
| | | @PostMapping("/add") |
| | | public R<?> addRepairRecord(@Valid @RequestBody AssetRepairRecordAddDTO addDTO) { |
| | | assetRepairRecordService.addRepairRecord(addDTO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("获取维修记录详情") |
| | | @PostMapping("/detail/{id}") |
| | | public R<AssetRepairRecordDetailVO> getRepairRecordDetail( @ApiParam(name = "id",value = "维修记录ID") @PathVariable Integer id) { |
| | | AssetRepairRecordDetailVO detail = assetRepairRecordService.getRepairRecordDetail(id); |
| | | return R.ok(detail); |
| | | } |
| | | |
| | | @ApiOperation("完成维修") |
| | | @PostMapping("/complete") |
| | | public R<?> completeRepair(@Valid @RequestBody AssetRepairCompleteDTO dto) { |
| | | assetRepairRecordService.completeRepair(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> deleteById(@ApiParam(name = "id",value = "维修记录ID")@PathVariable Integer id){ |
| | | assetRepairRecordService.deleteById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |