From c76a3b1194f320bf84061676d14200f7e78f044e Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 29 八月 2025 17:51:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/com/ruoyi/device/controller/DeviceRepairController.java | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java b/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
index 9dd898a..8c103ed 100644
--- a/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
+++ b/src/main/java/com/ruoyi/device/controller/DeviceRepairController.java
@@ -15,14 +15,18 @@
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
+import java.util.Arrays;
@Api(tags = "璁惧鎶ヤ慨绠$悊")
-@RequestMapping("/device/reppair")
+@RequestMapping("/device/repair")
@RestController
public class DeviceRepairController {
@Autowired
private IDeviceRepairService deviceRepairService;
+
+ @Autowired
+ private IDeviceLedgerService deviceLedgerService;
@ApiModelProperty("璁惧鎶ヤ慨鍒楄〃")
@GetMapping("/page")
@@ -32,26 +36,37 @@
@PostMapping()
@ApiModelProperty("娣诲姞璁惧鎶ヤ慨")
- public AjaxResult add(DeviceRepair deviceRepair) {
+ public AjaxResult add( @RequestBody DeviceRepair deviceRepair) {
+ DeviceLedger byId = deviceLedgerService.getById(deviceRepair.getDeviceLedgerId());
+ deviceRepair.setDeviceName(byId.getDeviceName());
+ deviceRepair.setDeviceModel(byId.getDeviceModel());
return deviceRepairService.saveDeviceRepair(deviceRepair);
}
@ApiModelProperty("鏍规嵁id鏌ヨ璁惧鎶ヤ慨")
@GetMapping("/{id}")
public AjaxResult detail(@PathVariable Long id) {
- return AjaxResult.success(deviceRepairService.getById(id));
+ DeviceRepairDto byId = deviceRepairService.detailById(id);
+ return AjaxResult.success(byId);
}
@PutMapping ()
@ApiModelProperty("淇敼璁惧鎶ヤ慨")
- public AjaxResult update(DeviceRepair deviceRepair) {
+ public AjaxResult update( @RequestBody DeviceRepair deviceRepair) {
return deviceRepairService.updateDeviceRepair(deviceRepair);
}
- @DeleteMapping("/{id}")
+ @PostMapping ("repair")
+ @ApiModelProperty("璁惧缁翠慨")
+ public AjaxResult repair( @RequestBody DeviceRepair deviceRepair) {
+ deviceRepair.setStatus(1);
+ return deviceRepairService.updateDeviceRepair(deviceRepair);
+ }
+
+ @DeleteMapping("/{ids}")
@ApiModelProperty("鍒犻櫎璁惧鎶ヤ慨")
- public AjaxResult delete(@PathVariable ArrayList<Long> ids) {
- boolean b = deviceRepairService.removeBatchByIds(ids);
+ public AjaxResult delete(@PathVariable("ids") Long[] ids) {
+ boolean b = deviceRepairService.removeBatchByIds(Arrays.asList(ids));
if (!b) {
return AjaxResult.error("鍒犻櫎澶辫触");
}
--
Gitblit v1.9.3