From 836ec39fdad422b1a148699a4c5fb8c5b4d395f0 Mon Sep 17 00:00:00 2001
From: zuoxiao <lf_zuo@163.com>
Date: 星期三, 25 六月 2025 11:04:33 +0800
Subject: [PATCH] feat(card): 添加管理类型卡写卡功能并优化卡片相关逻辑- 在 OperateTypeENUM 中添加 SUPPLEMENT 和 MANAGEMENT_CARD_WRITE 枚举值 - 在 SeManagementCard 中添加 cancelTime 和 state 字段 - 更新相关 mapper 和 XML 文件以支持新增字段 - 修改 CardSv 中的回调处理逻辑,支持管理类型卡写卡 - 优化 CreateManagementCardDto 中识别码的示例值

---
 pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/rtuLog/RtuLogCtrl.java |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/rtuLog/RtuLogCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/rtuLog/RtuLogCtrl.java
new file mode 100644
index 0000000..e85fdaf
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/rtuLog/RtuLogCtrl.java
@@ -0,0 +1,60 @@
+package com.dy.pipIrrMwTestWeb.rtuLog;
+
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import jakarta.servlet.ServletOutputStream;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.net.URLEncoder;
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/8/28 14:55
+ * @Description
+ */
+@Slf4j
+@RestController
+@RequestMapping(path="rtuLog")
+public class RtuLogCtrl extends RtuLogSupport {
+
+    @GetMapping(path = "logFile")
+    public BaseResponse<List<String>> rtuLogFile(String rtuAddr, HttpServletRequest req, HttpServletResponse rep){
+        ServletOutputStream out = null ;
+        try{
+            byte[] bs = this.requestMw4File(rtuAddr, mwUrlRtuLogFile) ;
+            if(bs != null && bs.length > 0){
+                String fileReName = rtuAddr + ".log" ;
+                //URLEncoder.encode鍙互闃叉涓枃涔辩爜
+                fileReName = URLEncoder.encode(fileReName, "UTF-8").replaceAll("\\+", "%20");
+                rep.addHeader("content-type", "application/octet-stream;charset=UTF-8");
+                rep.addHeader("Content-Disposition", "attachment;fileName=" + fileReName);
+                out = rep.getOutputStream() ;
+                out.write(bs, 0, (bs==null?0:bs.length));
+                out.flush();
+            }else{
+                return BaseResponseUtils.buildError("鑾峰彇鏂囦欢澶辫触") ;
+            }
+        }catch (Exception e){
+        }finally {
+            if(out != null){
+                try{
+                    out.close();
+                }catch(Exception e){
+                }
+            }
+        }
+        return null ;
+    }
+
+    @GetMapping(path="logText")
+    public BaseResponse<List<String>> rtuLogText(String rtuAddr){
+        BaseResponse<List<String>> response = this.requestMw4Text(rtuAddr, mwUrlRtuLogText) ;
+        return response ;
+    }
+}

--
Gitblit v1.8.0