From 73739df48132de6d98a8f22047a37decd9c78c56 Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期四, 11 一月 2024 18:10:18 +0800
Subject: [PATCH] 维修添加实际用料

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderController.java               |    4 ++--
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderActualMaterialController.java |   13 +++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderActualMaterialController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderActualMaterialController.java
index 0ecd931..9042f3b 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderActualMaterialController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderActualMaterialController.java
@@ -269,7 +269,16 @@
         }
         return Result.error("鍑哄簱鍗曚笉瀛樺湪");
     }
-
-
+    @PostMapping(value = "/addNew")
+    public Result<String> addNew(@RequestBody List<RepairOrderActualMaterial> list) {
+        if(list.size()!=0){
+            String id = list.get(0).getRepairOrderId();
+            repairOrderActualMaterialService.remove(new QueryWrapper<RepairOrderActualMaterial>().eq("repair_order_id",id));
+            repairOrderActualMaterialService.saveBatch(list);
+            return Result.OK("娣诲姞鎴愬姛");
+        }else {
+            return Result.error("娣诲姞澶辫触");
+        }
+    }
 
 }
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderController.java
index aa77ba7..40f235d 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/RepairOrderController.java
@@ -1551,10 +1551,10 @@
          List<RepairOrderActualWorkHours> hoursList = repairOrderActualWorkHoursService.list(new QueryWrapper<RepairOrderActualWorkHours>().eq("repair_order_id",id).eq("del_flag",0));
 		 List<RepairOrderActualWorkHours> mainStuff = repairOrderActualWorkHoursService.list(new QueryWrapper<RepairOrderActualWorkHours>().eq("repair_order_id",id).eq("del_flag",0).eq("principal_contractor","1"));
 		 if(hoursList.size()<2){
-		 	return Result.error("鎿嶄綔澶辫触锛岃鑷冲皯娣诲姞涓や釜鎵夸慨浜�");
+		 	return Result.error("鎿嶄綔澶辫触锛岃鑷冲皯娣诲姞涓や釜鎵夸慨浜猴紝骞朵笖璁剧疆涓�涓富鎵夸慨浜�");
 		 }
 		 if(mainStuff.size()!=1){
-			 return Result.error("鎿嶄綔澶辫触锛岃娣诲姞涓绘壙淇汉锛屾湁涓斿彧鏈変竴涓�");
+			 return Result.error("鎿嶄綔澶辫触锛岃璁剧疆涓绘壙淇汉锛屾湁涓斿彧鏈変竴涓�");
 		 }
 		 if(StringUtils.isNotBlank(repairOrder.getProjectMaintenanceOrderId())){
 			 //鍒ゆ柇椤圭洰鎬х淮淇瓙琛ㄧ姸鎬�

--
Gitblit v1.9.3