补招日志问题修改

This commit is contained in:
hzj
2024-11-27 15:57:07 +08:00
parent 59a2bb5e62
commit d0c7edff8a

View File

@@ -267,7 +267,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
int successcCount = 0;
portableOffMainLog.setStatus("1");
List<PortableOfflLog> portableOfflLogs = new ArrayList<>();
for(MultipartFile file : uploadDataParam.getFiles()){
//初始上传日志基本信息
@@ -281,11 +281,16 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
//默认总条数及入库数为0(防止解析的数据重复插入及上传的文件目录路径错误)
portableOfflLog.setAllCount(0);
portableOfflLog.setRealCount(0);
if(file.getOriginalFilename().contains("record.bin")){
portableOfflLog.setAllCount(1);
portableOfflLog.setState(1);
}
//开始匹配解析的文件结果入库
for(Response response : responses){
//min解析结果较为特殊所有的文件解析后只有一条结果
if(OfflineConstant.MIN.equals(response.getFilename()) && checkPrevsFolder(file.getOriginalFilename(),OfflineConstant.MIN)!=null&&minFlag){
List<PqdData> pqdData = (List<PqdData>) response.getObj();
pqdData.forEach(temp->{
temp.setClDid(cdid);
@@ -334,6 +339,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
if(pqdData != null && !pqdData.isEmpty()){
//否则正常标记为成功解析
portableOfflLog.setState(1);
portableOfflLog.setName("min文件夹");
portableOfflLog.setAllCount(pqdData.size());
portableOfflLog.setRealCount(pqdData.size());
if(minFlag){
@@ -351,17 +357,16 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
//判断当前解析的数据属于哪种结果(目前来说三种:comtrade、log、min(除外))
if(checkPrevsFolder(file.getOriginalFilename(),OfflineConstant.COMTRADE)!=null){ //cfg
//如果明确返回了state 那么当前文件解析出错
if(response.getState() != null){
portableOfflLog.setState(response.getState());
}
//由于dat文件不解析但是日志需要记载所以都设为1
TagComtradeCfg tagComtradeCfg = (TagComtradeCfg) response.getObj();
if(tagComtradeCfg != null){
//否则正常标记为成功解析
portableOfflLog.setState(1);
portableOfflLog.setAllCount(1);
portableOfflLog.setRealCount(1);
//否则正常标记为成功解析
portableOfflLog.setState(1);
portableOfflLog.setAllCount(1);
portableOfflLog.setRealCount(1);
//cfg入库
}
}
if(checkPrevsFolder(file.getOriginalFilename(),OfflineConstant.LOG)!=null){ //事件
//如果明确返回了state 那么当前文件解析出错
@@ -511,7 +516,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
this.baseMapper.insert(portableOfflLog);
successcCount++;
}
portableOfflLogs.add(portableOfflLog);
}
portableOffMainLog.setEndTime(LocalDateTime.now());
portableOffMainLog.setSuccessCount(successcCount);