修改bug

This commit is contained in:
hzj
2024-10-21 15:33:31 +08:00
parent a83ab8b141
commit 6cca1cc74d

View File

@@ -41,8 +41,10 @@ import com.njcn.system.pojo.po.DictData;
import com.njcn.web.pojo.param.BaseParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -247,7 +249,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
boolean minFlag = true;
//开始上传文件、记录上传日志、解析的文件结果入库
//最外层便利所有文件确保所有文件都上传及记录上传日志
int nowStep = 0;
int nowStep = uploadDataParam.getFiles().size();
PortableOffMainLog portableOffMainLog = new PortableOffMainLog();
portableOffMainLog.setId(IdUtil.fastSimpleUUID());
portableOffMainLog.setStartTime(LocalDateTime.now());
@@ -296,7 +298,11 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
portableOfflLog.setRealCount(pqdData.size());
if(minFlag){
log.info("类型min,插入infulxDb的pqdData");
pqdDataMapper.insertBatch(pqdData);
List<List<PqdData>> partition = ListUtils.partition(pqdData, 1500);
for (List<PqdData> sliceList : partition) {
List<PqdData> sublistAsOriginalListType = new ArrayList<>(sliceList);
pqdDataMapper.insertBatch(sublistAsOriginalListType);
}
//min结果集解析入库后就不需要在解析了
minFlag = false;
}
@@ -457,7 +463,7 @@ public class PortableOfflLogServiceImpl extends ServiceImpl<PortableOfflLogMappe
}
}
nowStep++;
String json = "{operate:makeUp,"+"allStep:"+uploadDataParam.getFiles().size()+",nowStep:"+nowStep+"}";
String json = "{allStep:"+uploadDataParam.getFiles().size()*2+",nowStep:"+nowStep+"}";
publisher.send("/dataOnlineRecruitment/Progress/" + uploadDataParam.getLineId(), new Gson().toJson(json), 1, false);
//无需解析的不需要记录