漏洞修复

This commit is contained in:
筱锋xiao_lfeng 2023-08-19 19:24:43 +08:00
parent c422864e43
commit ad9b37db63
3 changed files with 7 additions and 5 deletions

View File

@ -67,8 +67,6 @@ public class GetSheetService {
Cell cell = iterator.next();
title = (title == null || title.isEmpty() ? new StringBuilder() : title).append(cell.toString());
}
// 获取 Header
Iterator<Cell> headerRow = getEntitySheet.getRow(1).cellIterator();
// 获取总行数
ArrayList<ArrayList<Object>> line = new ArrayList<>();
String[] rowMax = new String[getEntitySheet.getRow(1).getPhysicalNumberOfCells()];

View File

@ -7,6 +7,7 @@ import com.wxjw.dal.pojo.ErrorCode;
import com.wxjw.dal.pojo.data.RetrieveFiles.InsertTableData;
import com.wxjw.dal.pojo.entity.ExcelInfoEntity;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
@ -26,7 +27,7 @@ public class InsertTableService {
@Getter
private String validationErrorMessage = null;
public void insertLogic(InsertTableData resultBody, ExcelInfoMapper excelInfoMapper) {
public void insertLogic(@NotNull InsertTableData resultBody, @NotNull ExcelInfoMapper excelInfoMapper) {
// 搜索数据是否存在
ArrayList<ExcelInfoEntity> excelInfoList = (ArrayList<ExcelInfoEntity>) excelInfoMapper.getAllExcelFilesNameNoRepetition(resultBody.getFile_name());
if (!excelInfoList.isEmpty()) {

View File

@ -112,8 +112,11 @@ public class UploadSheetService {
.setUpdateBy(excelInfo.getUpdateBy())
.setCreateTime(excelInfo.getCreateTime())
.setUpdateBy(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
excelInfoMapper.updateExcelInfo(excelInfoUpdate);
returnResult = ResultUtil.success();
if (excelInfoMapper.updateExcelInfo(excelInfoUpdate)) {
returnResult = ResultUtil.success();
} else {
returnResult = ResultUtil.error(ErrorCode.DATA_UPDATE_FAILURE);
}
} else {
returnResult = ResultUtil.error(ErrorCode.DATA_IS_EMPTY);
}