注释掉离线数据上传入库的代码(因为现阶段用的库并没有切换)
This commit is contained in:
@@ -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<PortableOfflLogMapper, PortableOfflLog> implements IPortableOfflLogService {
|
||||
@@ -112,7 +115,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
||||
//实际返回的是List<Response> 也即:该文件夹下所有解析的文件对应的结果集
|
||||
List<Response> response = (List<Response>) 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<PortableOfflLogMappe
|
||||
portableOfflLog.setRealCount(pqdData.size());
|
||||
if(minFlag){
|
||||
//高频谐波数据入库
|
||||
pqdDataMapper.insertBatch(pqdData);
|
||||
//pqdDataMapper.insertBatch(pqdData);
|
||||
log.info("插入min-pqdData,其长度为:"+pqdData.size());
|
||||
//min结果集解析入库后就不需要在解析了
|
||||
minFlag = false;
|
||||
}
|
||||
@@ -228,14 +232,14 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
||||
String wavePath = null;
|
||||
//设置波形文件(去cfg结果集里面去找)
|
||||
for (Response res : cfgResponse) {
|
||||
String cfg = res.getFilename();
|
||||
String dat = cfg.substring(0,cfg.lastIndexOf("."))+OfflineConstant.DAT;
|
||||
String sharPath = OfflineConstant.COMTRADE+"/"+DataParam.wlRecordPath+uploadDataParam.getDevId()+"/"+uploadDataParam.getLineId()+"/"+getFolderName()+"/";
|
||||
tagComtradeCfg sing = (tagComtradeCfg) res.getObj();
|
||||
Date date = Date.from(newTaglogbuffer.getStart().atZone( ZoneId.systemDefault()).toInstant());
|
||||
//如果匹配上则需要将当前cfg文件及对应的dat文件上传到comtrade文件夹中
|
||||
if (sing.getTimeTrigger().compareTo(date) <= 0 && sing.getTimeEnd().compareTo(date) >= 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<PortableOfflLogMappe
|
||||
csEventPO.setProcess(data1.get(0).getProcess());
|
||||
csEventPOS.add(csEventPO);
|
||||
EntData entData = new EntData();
|
||||
entData.setLineId(uploadDataParam.getLineId());
|
||||
entData.setTime(newTaglogbuffer.getStart().toInstant(ZoneOffset.UTC));
|
||||
for(NewBodyTaglogbuffer newBodyTaglogbuffer : newTaglogbuffer.getNewBodyTaglogbuffers()){
|
||||
if(newBodyTaglogbuffer.getParaCode() == 0) entData.setEvtVvadepth(newBodyTaglogbuffer.getParaValue()/65536D);
|
||||
if(newBodyTaglogbuffer.getParaCode() == 1) entData.setEvtVvatm(newBodyTaglogbuffer.getParaValue()/65536D);
|
||||
@@ -284,9 +290,11 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
|
||||
}
|
||||
}
|
||||
}
|
||||
evtDataMapper.insertOne(entData);
|
||||
log.info("插入"+entData.toString());
|
||||
//evtDataMapper.insertOne(entData);
|
||||
}
|
||||
eventFeignClient.saveBatchEventList(csEventPOS);
|
||||
log.info("插旗"+csEventPOS.toString());
|
||||
//eventFeignClient.saveBatchEventList(csEventPOS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user