From ef9e8df8f911d53d1ec23bf920f1cd5ba8f18e13 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期五, 13 九月 2024 08:04:26 +0800
Subject: [PATCH] 线路配置,打标机前端页面

---
 JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java |   99 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 94 insertions(+), 5 deletions(-)

diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java
index 329b2ef..4ded016 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java
@@ -1,9 +1,14 @@
 package com.mes.md.controller;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.mes.md.entity.Tasking;
+import com.mes.md.service.TaskingService;
+import com.mes.utils.Result;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
 
 /**
  * <p>
@@ -13,9 +18,93 @@
  * @author wu
  * @since 2024-08-28
  */
-@RestController
-@RequestMapping("/tasking")
-public class TaskingController {
+    @RestController
+    @RequestMapping("/tasking")
+    public class TaskingController {
+        @Autowired
+        private TaskingService taskingService;
+
+        @ApiOperation("鍒囨崲妯″紡")
+        @PostMapping("/updateLoadState") //鍒囨崲妯″紡"
+        @ResponseBody
+        public Result<Boolean> updateStatus(@RequestBody Integer state) {
+            if(state == 1){
+                boolean result =taskingService.updateStatus(state);
+                return Result.build(1,"瀹氬埗妯″紡",result);
+            }else {
+                boolean result =taskingService.updateStatus(state);
+                return Result.build(0,"鏍囧噯妯″紡",result);
+            }
+        }
+        @ApiOperation("鐐瑰嚮鏆傚仠璁惧")
+        @PostMapping("/updateLoadStatus") //鐐瑰嚮鏆傚仠璁惧
+        @ResponseBody
+        public Result<Boolean> updateLoadStatus(@RequestBody Integer state) {
+            if(state == 1){
+                boolean result =taskingService.updateLoadState(state);
+                return Result.build(1,"鎴愬姛",result);
+            }else {
+                boolean result =taskingService.updateLoadState(state);
+                return Result.build(0,"鎴愬姛",result);
+            }
+        }
+        @ApiOperation("鐐瑰嚮鐮存崯")
+        @PostMapping("/updateDamage") //鏆傚仠涓婄墖浠诲姟
+        @ResponseBody
+        public Result<Tasking> updateDamage(@RequestBody Tasking tasking) {
+
+            boolean result =taskingService.updateDamage(tasking);
+            return Result.build(1,"瀹氬埗妯″紡",null);
+
+
+        }
+        @ApiOperation("鏌ヨ褰撳墠妯″紡杩囧幓鐨勭幓鐠�")
+        @PostMapping("/selectTasking") //鏆傚仠涓婄墖浠诲姟
+        @ResponseBody
+        public Result<List<Tasking>> selectTasking() {
+
+            List<Tasking> tasking =taskingService.selectTasking();
+            return Result.build(1,"瀹氬埗妯″紡",tasking);
+        }
+
+        @ApiOperation("鏌ヨ褰撳墠宸ヨ壓锛屾煇宸ヤ綔鐘舵�佺殑绾夸笂浠诲姟")
+        @PostMapping("/findCraftTasking")
+        @ResponseBody
+        public Result findCraftTasking(@RequestBody Tasking tasking) {
+            List<Tasking> list =taskingService.findCraftTasking(tasking);
+            return Result.build(200,"鎴愬姛",list);
+        }
+
+        @ApiOperation("淇敼浠诲姟鐘舵�� 銆愮牬鎹�/澶辫触/瀹屽伐銆�")
+        @PostMapping("/updateCraftTasking")
+        @ResponseBody
+        public Result updateCraftTasking(@RequestBody Tasking tasking) {
+            int count =taskingService.updateCraftTasking(tasking);
+            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
+        }
+        @ApiOperation("淇敼褰撳墠璁惧 銆愬紑宸�/鏆傚仠銆�")
+        @PostMapping("/updateMachineState")
+        @ResponseBody
+        public Result updateMachineState(@RequestBody Tasking tasking) {
+            int count =taskingService.updateCraftTasking(tasking);
+            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
+        }
+        @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
+        @PostMapping("/updateTopLine")
+        @ResponseBody
+        public Result updateTopLine(@RequestBody Tasking tasking) {
+            int count =taskingService.updateCraftTasking(tasking);
+            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
+        }
+
+        @ApiOperation("淇敼褰撳墠璁惧 銆愪笅绾裤��")
+        @PostMapping("/updateDownLine")
+        @ResponseBody
+        public Result updateDownLine(@RequestBody Tasking tasking) {
+            int count =taskingService.updateCraftTasking(tasking);
+            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
+        }
+
 
 }
 

--
Gitblit v1.8.0