From f68d3c71819feb59e7a227a5d992b059b900916c Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期五, 28 三月 2025 08:28:26 +0800
Subject: [PATCH] 修改报表,界面添加查询流程卡个数,调整推送数据到前端的间隔

---
 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java |   80 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
index ec69a2c..1a5c276 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
@@ -1,8 +1,13 @@
 package com.mes.bigstorage.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.mes.bigstorage.entity.BigStorageCageDetails;
 import com.mes.bigstorage.service.BigStorageCageDetailsService;
 import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.common.config.Const;
+import com.mes.utils.RedisUtil;
 import com.mes.utils.Result;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -12,6 +17,7 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import java.util.List;
 import java.util.Map;
 
@@ -32,6 +38,8 @@
     private BigStorageCageDetailsService bigStorageCageDetailsService;
     @Autowired
     private BigStorageCageService bigStorageCageService;
+    @Resource
+    private RedisUtil redisUtil;
 
 
     @ApiOperation("鐜荤拑璇︽儏鏌ヨ")
@@ -83,7 +91,8 @@
     @ApiOperation("鎸囧畾閽㈠寲")
     @PostMapping("/TemperingGlass")
     public Result temperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) {
-        boolean result = bigStorageCageDetailsService.temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId());
+        boolean result = bigStorageCageDetailsService
+                .temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId(),bigStorageCageDetails.getTemperingFeedSequence().toString());
         if (result == true) {
             return Result.build(200, "鎸囧畾閽㈠寲鎴愬姛", 1);
         } else {
@@ -94,7 +103,74 @@
     @ApiOperation("閽㈠寲鏌ヨ")
     @PostMapping("/selectTemperingGlass")
     public Result selectTemperingGlass() {
-        return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageDetailsService.selectTemperingGlass());
+        return Result.build(200, "鏌ヨ鎴愬姛", bigStorageCageDetailsService.selectTemperingGlass());
+    }
+
+    @ApiOperation("鏄惁閽㈠寲寮�鍏�")
+    @PostMapping("/temperingSwitch")
+    public Result temperingSwitch(Boolean flag) {
+        bigStorageCageDetailsService.temperingSwitch(flag);
+        return Result.build(200, "淇敼鎴愬姛", redisUtil.getCacheObject("temperingSwitch"));
+    }
+
+    @ApiOperation("娴佺▼鍗℃煡璇�")
+    @PostMapping("/selectFlowCardByCache")
+    public Result selectFlowCardByCache() {
+        List<Map<String, Object>> flowCardIdCount=bigStorageCageDetailsService.listMaps(
+                new QueryWrapper<BigStorageCageDetails>()
+                        .select("flow_card_id,layer,count(*) as count")
+                        .eq("state", Const.GLASS_STATE_IN)
+                        .eq("tempering_layout_id",0)
+                        .groupBy("flow_card_id,layer")
+        );
+        return Result.build(200, "鏌ヨ鎴愬姛", flowCardIdCount);
+    }
+
+    @ApiOperation("娴佺▼鍗′釜鏁版煡璇�")
+        @PostMapping("/selectFlowCardCount")
+    public Result selectFlowCardCount() {
+        return Result.build(200, "鏌ヨ鎴愬姛", bigStorageCageDetailsService.selectFlowCardCount());
+    }
+
+    @ApiOperation("鎸囧畾娴佺▼鍗�")
+    @PostMapping("/appointFlowCard")
+    public Result appointFlowCard(@RequestBody BigStorageCageDetails bigStorageCageDetails) {
+        List<BigStorageCageDetails> bigStorageCageDetailsList=bigStorageCageDetailsService.list(
+                new LambdaQueryWrapper<BigStorageCageDetails>()
+                .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_ARTIFICIAL)
+        );
+        if(bigStorageCageDetailsList.size()==0){
+            bigStorageCageDetailsService.update(
+                    new LambdaUpdateWrapper<BigStorageCageDetails>()
+                            .set(BigStorageCageDetails::getState,Const.GLASS_STATE_ARTIFICIAL)
+                            .eq(BigStorageCageDetails::getFlowCardId,bigStorageCageDetails.getFlowCardId())
+                            .eq(BigStorageCageDetails::getLayer,bigStorageCageDetails.getLayer())
+                            .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_IN)
+            );
+            return Result.build(200, "鎸囧畾娴佺▼鍗℃垚鍔�", 1);
+        }else{
+            return Result.build(200, "鎸囧畾娴佺▼鍗℃垚鍔�", 1);
+        }
+    }
+
+    @ApiOperation("鎸囧畾宸ョ▼")
+    @PostMapping("/appointEngineerId")
+    public Result appointEngineerId(@RequestBody BigStorageCageDetails bigStorageCageDetails) {
+        bigStorageCageDetailsService.appointEngineerId(bigStorageCageDetails.getEngineerId());
+        return Result.build(200, "淇敼鎴愬姛", 1);
+    }
+
+    @ApiOperation("璋冨害鏃堕棿鏌ヨ")
+    @PostMapping("/scheduleTime")
+    public Result scheduleTime() {
+        return Result.build(200, "淇敼鎴愬姛", bigStorageCageDetailsService.scheduleTime());
+    }
+
+    @ApiOperation("鍙栨秷鍑虹墖浠诲姟")
+    @PostMapping("/cancelOutTask")
+    public Result cancelOutTask() {
+        bigStorageCageDetailsService.cancelOutTask();
+        return Result.build(200, "鍙栨秷鎴愬姛", 1);
     }
 }
 

--
Gitblit v1.8.0