From 843bbc338c28625669fc8cdca66cc86ee914e0c8 Mon Sep 17 00:00:00 2001 From: guofeihu <3347277866@qq.com> Date: Mon, 5 Aug 2024 16:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8A=E4=BC=A0=E5=85=A5=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81(=E5=9B=A0=E4=B8=BA=E7=8E=B0=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E7=94=A8=E7=9A=84=E5=BA=93=E5=B9=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=88=87=E6=8D=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PortableOfflLogServiceImpl.java | 24 ++++++++++++------- .../controller/EventController.java | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java index 63f5820..c6e9122 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/PortableOfflLogServiceImpl.java @@ -34,6 +34,7 @@ import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.EleEvtParm; import com.njcn.web.pojo.param.BaseParam; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -42,6 +43,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.text.SimpleDateFormat; import java.time.ZoneId; +import java.time.ZoneOffset; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -54,6 +56,7 @@ import java.util.stream.Stream; * @author guofeihu * @since 2024-07-03 */ +@Slf4j @Service @RequiredArgsConstructor public class PortableOfflLogServiceImpl extends ServiceImpl implements IPortableOfflLogService { @@ -112,7 +115,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl 也即:该文件夹下所有解析的文件对应的结果集 List response = (List) obj; //临时记录下cfg结果集(用作log绑定对应的cfg波形文件) - if(OfflineConstant.LOG.equals(dictData.getCode())){ + if(OfflineConstant.COMTRADE.equals(dictData.getCode())){ cfgResponse.addAll(response); } responses.addAll(response); @@ -163,7 +166,8 @@ public class PortableOfflLogServiceImpl extends ServiceImpl= 0) { + if ((sing!= null && sing.getTimeStart()!= null && sing.getTimeEnd() !=null && sing.getTimeTrigger().compareTo(date) <= 0 && sing.getTimeEnd().compareTo(date) >= 0)) { for(MultipartFile f : uploadDataParam.getFiles()){ - String cfg = res.getFilename(); - String dat = cfg.substring(0,cfg.lastIndexOf("."))+OfflineConstant.CFG; - String sharPath = OfflineConstant.COMTRADE+"/"+DataParam.wlRecordPath+uploadDataParam.getDevId()+"/"+uploadDataParam.getLineId()+"/"+getFolderName()+"/"; if(f.getOriginalFilename().equals(cfg) || f.getOriginalFilename().equals(dat)){ fileStorageUtil.uploadMultipart(f, sharPath); wavePath = sharPath; @@ -254,6 +258,8 @@ public class PortableOfflLogServiceImpl extends ServiceImpl saveBatchEventList(@RequestBody List csEventPOS) {