From 5b8a52d6cef6f6b1032cc576471b505e69304331 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 08 十一月 2024 15:47:38 +0800
Subject: [PATCH] 上传RTU升级文件接收端增加判断重名文件,重名文件不允许上传
---
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java
index 66872cd..33993ce 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/program/UgRtuProgramCtrl.java
@@ -151,6 +151,10 @@
if(vo.file == null){
return BaseResponseUtils.buildFail("RTU绋嬪簭鏂囦欢蹇呴』涓婁紶") ;
}
+ String fileName = vo.file.getOriginalFilename() ;
+ if(this.sv.existFileName(fileName)){
+ return BaseResponseUtils.buildFail("RTU绋嬪簭鏂囦欢鍚嶅凡瀛樺湪") ;
+ }
HexFileVo fileVo = null ;
byte[] fileBytes = null ;
@@ -166,7 +170,7 @@
}
if(fileVo != null){
UgRtuProgram po = new UgRtuProgram();
- po.hexFileName = vo.file.getOriginalFilename() ;
+ po.hexFileName = fileName ;
po.programCalculateBytes = (int)fileVo.calculateBytes ;
po.programCrc16 = fileVo.bytesCrc16 ;
po.programBytes = fileVo.bytes;
--
Gitblit v1.8.0