Commit 22514a1f authored by 刘林's avatar 刘林

fix(jg):导入bug修改

parent e0d04900
......@@ -35,7 +35,7 @@ public class DataDockTemplateVersionUtils {
/**
* 错误提示
*/
public static final String ERROR_MESSAGE = "数据上传模板有更新了,请您下载最新的梳理数据上传!";
public static final String ERROR_MESSAGE = "模板结构已调整,请下载最新模板,并根据最新格式整理数据后上传,以确保数据导入成功!";
public static final Map<String, String> VERSION_MAP = new HashMap<>();
......@@ -44,16 +44,16 @@ public class DataDockTemplateVersionUtils {
VERSION_MAP.put("公用管道设备", "V1.0.0");
VERSION_MAP.put("历史无证_压力容器设备_氧舱", "V1.0.0");
VERSION_MAP.put("历史无证设备_场内机动车辆", "V1.0.0");
VERSION_MAP.put("历史无证设备_电梯设备", "V1.0.0");
VERSION_MAP.put("历史无证设备_电梯设备", "V1.0.1");
VERSION_MAP.put("历史无证设备_管道设备", "V1.0.0");
VERSION_MAP.put("历史无证设备_锅炉设备", "V1.0.0");
VERSION_MAP.put("历史无证设备_起重机械设备", "V1.0.0");
VERSION_MAP.put("历史无证设备_索道设备", "V1.0.0");
VERSION_MAP.put("历史无证设备_索道设备", "V1.0.1");
VERSION_MAP.put("历史无证设备_压力容器设备_固定式", "V1.0.0");
VERSION_MAP.put("历史无证设备_压力容器设备", "V1.0.0");
VERSION_MAP.put("历史无证设备_游乐设施设备", "V1.0.0");
VERSION_MAP.put("历史有证_场内机动车辆", "V1.0.0");
VERSION_MAP.put("历史有证_电梯设备", "V1.0.0");
VERSION_MAP.put("历史有证_电梯设备", "V1.0.1");
VERSION_MAP.put("历史有证_管道设备", "V1.0.0");
VERSION_MAP.put("历史有证_锅炉设备", "V1.0.0");
VERSION_MAP.put("历史有证_起重机械设备", "V1.0.0");
......@@ -63,7 +63,7 @@ public class DataDockTemplateVersionUtils {
VERSION_MAP.put("历史有证_压力容器设备", "V1.0.0");
VERSION_MAP.put("历史有证_游乐设施设备", "V1.0.0");
VERSION_MAP.put("新设备_场内机动车辆", "V1.0.0");
VERSION_MAP.put("新设备_电梯设备", "V1.0.0");
VERSION_MAP.put("新设备_电梯设备", "V1.0.1");
VERSION_MAP.put("新设备_管道设备", "V1.0.0");
VERSION_MAP.put("新设备_锅炉设备", "V1.0.0");
VERSION_MAP.put("新设备_起重机械设备", "V1.0.0");
......@@ -113,14 +113,14 @@ public class DataDockTemplateVersionUtils {
public static String checkTemplateVersion(MultipartFile file, List<ReadSheet> sheetList) throws IOException {
byte[] fileBytes = file.getBytes();
List<String> errorMessages = new ArrayList<>(1);
boolean foundVersionSheet = false;
for (ReadSheet readSheet : sheetList) {
String sheetName = readSheet.getSheetName();
if (!sheetName.contains("版本信息")) {
continue;
}
foundVersionSheet = true;
int sheetNo = readSheet.getSheetNo();
EasyExcel.read(new ByteArrayInputStream(fileBytes), EquipInfoExcelDto.class, new AnalysisEventListener<EquipInfoExcelDto>() {
@Override
public void invoke(EquipInfoExcelDto data, AnalysisContext context) {
......@@ -136,6 +136,9 @@ public class DataDockTemplateVersionUtils {
}).headRowNumber(1).sheet(sheetNo, sheetName).doRead();
}
if (!foundVersionSheet) {
errorMessages.add("检测到您使用的模板已过期,为避免数据导入错误,请下载最新模板,并根据新格式整理数据后重新上传!");
}
return ValidationUtil.isEmpty(errorMessages) ? "" : errorMessages.get(0);
}
}
......@@ -135,6 +135,10 @@ public class EquipInfoExcelDto extends BaseDto {
@ExcelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "96333码")
@ExcelProperty(value = "96333码")
private String code96333;
//-----------------------------------------------------------------------使用信息
@ApiModelProperty(value = "使用单位统一社会信用代码")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment