From 5bd56f3ebf96aa9a71e4a452cd2402df59d17384 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期四, 04 九月 2025 09:28:27 +0800
Subject: [PATCH] 1.全部页面增加线下数据查询 2.增加一键删除线下玻璃按钮

---
 JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java |  302 +++++++++++++++++++++++++++-----------------------
 1 files changed, 162 insertions(+), 140 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 156a2d2..c9e3eaf 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
@@ -29,159 +29,181 @@
  * @author yanzhixin
  * @since 2024-09-13
  */
-    @RestController
-    @RequestMapping("/tasking")
-    public class TaskingController {
-        @Autowired
-        private TaskingService taskingService;
-        @Autowired
-        private ProjectService projectService;
-        @Autowired
-        private MachineMapper machineMapper;
-        @Autowired
-        private TaskingMapper taskingMapper;
-        @Autowired
-        private TaskingLogService taskingLogService;
-        @Autowired
-        private KBBTLensSortingMapper kBBTLensSortingMapper;
+@RestController
+@RequestMapping("/tasking")
+public class TaskingController {
+    @Autowired
+    private TaskingService taskingService;
+    @Autowired
+    private ProjectService projectService;
+    @Autowired
+    private MachineMapper machineMapper;
+    @Autowired
+    private TaskingMapper taskingMapper;
+    @Autowired
+    private TaskingLogService taskingLogService;
+    @Autowired
+    private KBBTLensSortingMapper kBBTLensSortingMapper;
 
 
-
-        @ApiOperation("鏌ヨ搴撲綅淇℃伅 杩斿洖缁撴灉")
-        @PostMapping("/findKBBTLensSorting")
-        @ResponseBody
-        public Result findKBBTLensSorting(@RequestBody Map<String, String> map) {
-            try {
-                String scanId=map.get("scanId").toString();
-                if (!scanId.isEmpty()){
-                    List<KBBTLensSorting> list=kBBTLensSortingMapper.selectList(new QueryWrapper<KBBTLensSorting>().lambda()
-                            .eq(KBBTLensSorting::getBarcode,scanId));
-                    return Result.build(200,"鎴愬姛",list);
-                }
-                return Result.build(199,"鍓嶇浼犲�糔ULL",map);
-            }catch (Exception e){
-                return Result.build(199,"寮傚父",map);
+    @ApiOperation("鏌ヨ搴撲綅淇℃伅 杩斿洖缁撴灉")
+    @PostMapping("/findKBBTLensSorting")
+    @ResponseBody
+    public Result findKBBTLensSorting(@RequestBody Map<String, String> map) {
+        try {
+            String scanId = map.get("scanId").toString();
+            if (!scanId.isEmpty()) {
+                List<KBBTLensSorting> list = kBBTLensSortingMapper.selectList(new QueryWrapper<KBBTLensSorting>().lambda()
+                        .eq(KBBTLensSorting::getBarcode, scanId));
+                return Result.build(200, "鎴愬姛", list);
             }
+            return Result.build(199, "鍓嶇浼犲�糔ULL", map);
+        } catch (Exception e) {
+            return Result.build(199, "寮傚父", map);
         }
-        @ApiOperation("鎵爜鎴愬姛鍚庤繑鍥炵粨鏋� machineId,scanId")
-        @PostMapping("/scanMachineAdd")
-        @ResponseBody
-        public Result scanMachineAdd(@RequestBody Map<String, String> map) {
-            try {
-                String machineId=map.get("machineId").toString();
-                String scanId=map.get("scanId").toString();
-                if (!scanId.isEmpty()&&!machineId.isEmpty()){
-                    Machine machine = machineMapper.selectById(machineId);
-                    int addCount =taskingService.scanMachineAdd(machine,scanId);
-                    return Result.build(200,"鎴愬姛",addCount);
-                }
-                return Result.build(199,"鍓嶇浼犲�糔ULL",map);
-            }catch (Exception e){
-                return Result.build(199,"寮傚父",map);
+    }
+
+    @ApiOperation("鎵爜鎴愬姛鍚庤繑鍥炵粨鏋� machineId,scanId")
+    @PostMapping("/scanMachineAdd")
+    @ResponseBody
+    public Result scanMachineAdd(@RequestBody Map<String, String> map) {
+        try {
+            String machineId = map.get("machineId").toString();
+            String scanId = map.get("scanId").toString();
+            if (!scanId.isEmpty() && !machineId.isEmpty()) {
+                Machine machine = machineMapper.selectById(machineId);
+                int addCount = taskingService.scanMachineAdd(machine, scanId);
+                return Result.build(200, "鎴愬姛", addCount);
             }
+            return Result.build(199, "鍓嶇浼犲�糔ULL", map);
+        } catch (Exception e) {
+            return Result.build(199, "寮傚父", map);
         }
-        @ApiOperation("鎶ュ伐鎻愪氦 ")
-        @PostMapping("/reportForWork")
-        @ResponseBody
-        public Result reportForWork(@RequestBody Machine machine) {
-            try {
-                int deleteCount=taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>()
-                        .selectAll(Tasking.class)
-                        .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId)
-                        .innerJoin(Machine.class,Machine::getId,LineConfiguration::getMachineId)
-                        .eq(LineConfiguration::getMachineId,machine.getId())
-                        .eq(Tasking::getGlassState,"姝e父")
-                        .eq(Tasking::getState,"绾夸笂")
-                        .ne(Tasking::getWorkState,"瀹屽伐"));
-                taskingLogService.reportTaskingLog();
-                return Result.build(200,"鎴愬姛",deleteCount);
-            }catch (Exception e){
-                return Result.build(199,"寮傚父",machine);
-            }
-        }
-        @ApiOperation("鏌ヨ褰撳墠璁惧锛屾湭瀹屽伐鐘舵�佺殑绾夸笂浠诲姟")
-        @PostMapping("/findMachineTask")
-        @ResponseBody
-        public Result findMachineTask(@RequestBody Machine machine) {
-            List<Tasking> list =taskingService.findMachineTask(machine);
-            return Result.build(200,"鎴愬姛",list);
-        }
+    }
 
-        @ApiOperation("鏌ヨ褰撳墠璁惧锛屾煇鐘舵�佺殑绾夸笂浠诲姟銆愮瓑寰�/姝e湪宸ヤ綔/瀹屽伐銆�")
-        @PostMapping("/findMachineWorkStateTask")
-        @ResponseBody
-        public Result findMachineWorkStateTask(@RequestBody Machine machine,String workState) {
-            List<Tasking> list =taskingService.findMachineWorkStateTask(machine,workState);
-            return Result.build(200,"鎴愬姛",list);
+    @ApiOperation("鎶ュ伐鎻愪氦 ")
+    @PostMapping("/reportForWork")
+    @ResponseBody
+    public Result reportForWork(@RequestBody Machine machine) {
+        try {
+            int deleteCount = taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>()
+                    .selectAll(Tasking.class)
+                    .innerJoin(LineConfiguration.class, LineConfiguration::getId, Tasking::getLineConfigurationId)
+                    .innerJoin(Machine.class, Machine::getId, LineConfiguration::getMachineId)
+                    .eq(LineConfiguration::getMachineId, machine.getId())
+                    .eq(Tasking::getGlassState, "姝e父")
+                    .eq(Tasking::getState, "绾夸笂")
+                    .ne(Tasking::getWorkState, "瀹屽伐"));
+            taskingLogService.reportTaskingLog();
+            return Result.build(200, "鎴愬姛", deleteCount);
+        } catch (Exception e) {
+            return Result.build(199, "寮傚父", machine);
         }
+    }
 
-        @ApiOperation("淇敼鐜荤拑鐘舵�� 銆愮牬鎹熴��")
-        @PostMapping("/damagedTask")
-        @ResponseBody
-        public Result damagedTask(@RequestBody Tasking tasking) {
-            int count =taskingService.damagedTask(tasking);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
-        @ApiOperation("淇敼浠诲姟鐘舵�� 銆愭鍦ㄥ伐浣溿��")
-        @PostMapping("/startMachineTask")
-        @ResponseBody
-        public Result startMachineTask(@RequestBody Machine machine) {
-            Tasking tasking =taskingService.startMachineTask(machine);
-            return Result.build(200,"淇敼鎴愬姛锛�",tasking);
-        }
-        @ApiOperation("淇敼浠诲姟鐘舵�� 銆愬け璐ャ��")
-        @PostMapping("/loseMachineTask")
-        @ResponseBody
-        public Result loseMachineTask(@RequestBody Machine machine) {
-            int count =taskingService.loseMachineTask(machine);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
-        @ApiOperation("淇敼浠诲姟鐘舵�� 銆愬畬宸ャ��")
-        @PostMapping("/finishMachineTask")
-        @ResponseBody
-        public Result finishMachineTask(@RequestBody Machine machine) {
-            int count =taskingService.finishMachineTask(machine);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
+    @ApiOperation("鏌ヨ褰撳墠璁惧锛屾湭瀹屽伐鐘舵�佺殑绾夸笂浠诲姟")
+    @PostMapping("/findMachineTask")
+    @ResponseBody
+    public Result findMachineTask(@RequestBody Machine machine) {
+        List<Tasking> list = taskingService.findMachineTask(machine);
+        return Result.build(200, "鎴愬姛", list);
+    }
 
-        @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
-        @PostMapping("/glassTopLineList")
-        @ResponseBody
-        public Result glassTopLineList(@RequestBody List<Tasking> taskingList) {
-            int count =taskingService.glassTopLine(taskingList);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
+    @ApiOperation("鏌ヨ褰撳墠璁惧锛屾煇鐘舵�佺殑绾夸笂浠诲姟銆愮瓑寰�/姝e湪宸ヤ綔/瀹屽伐銆�")
+    @PostMapping("/findMachineWorkStateTask")
+    @ResponseBody
+    public Result findMachineWorkStateTask(@RequestBody Machine machine, String workState) {
+        List<Tasking> list = taskingService.findMachineWorkStateTask(machine, workState);
+        return Result.build(200, "鎴愬姛", list);
+    }
 
-        @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
-        @PostMapping("/glassTopLine")
-        @ResponseBody
-        public Result glassTopLine(@RequestBody Tasking tasking) {
-            int count =taskingService.glassTopLine(tasking);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
+    @ApiOperation("淇敼鐜荤拑鐘舵�� 銆愮牬鎹熴��")
+    @PostMapping("/damagedTask")
+    @ResponseBody
+    public Result damagedTask(@RequestBody Tasking tasking) {
+        int count = taskingService.damagedTask(tasking);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
 
-        @ApiOperation("淇敼褰撳墠璁惧 銆愪笅绾裤��")
-        @PostMapping("/glassDownLine")
-        @ResponseBody
-        public Result glassDownLine(@RequestBody Tasking tasking) {
-            int count =taskingService.glassDownLine(tasking);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
-        @ApiOperation("鐜荤拑 銆愪笅绾裤��")
-        @PostMapping("/glassAgainTopLine")
-        @ResponseBody
-        public Result glassAgainTopLine(@RequestBody Tasking tasking) {
-            int count =taskingService.stopTasking(tasking);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
+    @ApiOperation("淇敼浠诲姟鐘舵�� 銆愭鍦ㄥ伐浣溿��")
+    @PostMapping("/startMachineTask")
+    @ResponseBody
+    public Result startMachineTask(@RequestBody Machine machine) {
+        Tasking tasking = taskingService.startMachineTask(machine);
+        return Result.build(200, "淇敼鎴愬姛锛�", tasking);
+    }
 
-        @ApiOperation("鎻愪氦 鎵爜鎶ュ伐 ")
-        @PostMapping("/scanReport")
-        @ResponseBody
-        public Result scanReport(@RequestBody Tasking tasking) {
-            int count =taskingService.stopTasking(tasking);
-            return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
-        }
+    @ApiOperation("淇敼浠诲姟鐘舵�� 銆愬け璐ャ��")
+    @PostMapping("/loseMachineTask")
+    @ResponseBody
+    public Result loseMachineTask(@RequestBody Machine machine) {
+        int count = taskingService.loseMachineTask(machine);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
+
+    @ApiOperation("淇敼浠诲姟鐘舵�� 銆愬畬宸ャ��")
+    @PostMapping("/finishMachineTask")
+    @ResponseBody
+    public Result finishMachineTask(@RequestBody Machine machine) {
+        int count = taskingService.finishMachineTask(machine);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
+
+    @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
+    @PostMapping("/glassTopLineList")
+    @ResponseBody
+    public Result glassTopLineList(@RequestBody List<Tasking> taskingList) {
+        int count = taskingService.glassTopLine(taskingList);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
+
+    @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
+    @PostMapping("/glassTopLine")
+    @ResponseBody
+    public Result glassTopLine(@RequestBody Tasking tasking) {
+        int count = taskingService.glassTopLine(tasking);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
+
+    @ApiOperation("淇敼褰撳墠璁惧 銆愪笅绾裤��")
+    @PostMapping("/glassDownLine")
+    @ResponseBody
+    public Result glassDownLine(@RequestBody Tasking tasking) {
+        int count = taskingService.glassDownLine(tasking);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
+
+    @ApiOperation("鐜荤拑 銆愪笅绾裤��")
+    @PostMapping("/glassAgainTopLine")
+    @ResponseBody
+    public Result glassAgainTopLine(@RequestBody Tasking tasking) {
+        int count = taskingService.stopTasking(tasking);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
+
+    @ApiOperation("鏌ヨ銆愮嚎涓嬨�戠幓鐠� ")
+    @PostMapping("/selectGlassDownLine")
+    @ResponseBody
+    public Result selectGlassDownLine() {
+        List<Tasking> downLineTask = taskingService.findDownLineTask();
+        return Result.build(200, "鏌ヨ鎴愬姛锛�", downLineTask);
+    }
+
+    @ApiOperation("鍒犻櫎銆愮嚎涓嬨�戠幓鐠� ")
+    @PostMapping("/deleteGlassDownLine")
+    @ResponseBody
+    public Result deleteGlassDownLine() {
+        int count = taskingService.deleteGlassDownLine();
+        return Result.build(200, "娓呴櫎鎴愬姛锛�"+count, count);
+    }
+
+    @ApiOperation("鎻愪氦 鎵爜鎶ュ伐 ")
+    @PostMapping("/scanReport")
+    @ResponseBody
+    public Result scanReport(@RequestBody Tasking tasking) {
+        int count = taskingService.stopTasking(tasking);
+        return Result.build(200, "淇敼鎴愬姛锛�" + count, count);
+    }
 
 }
 

--
Gitblit v1.8.0