excel模板导入修改

segment2.0
linrf 2 years ago
parent fd6ab8f3ae
commit 0474a5ef54

@ -16,28 +16,50 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode
public class MedicalInfoExcelModel extends BaseRowModel {
@ExcelProperty(value = "住院号", index = 0)
// @ExcelProperty(value = "住院号", index = 0)
// private String admissId;
//
// @ExcelProperty(value = "住院次数", index = 1)
// private Integer admissTimes;
//
// @ExcelProperty(value = "流水号", index = 2)
// private String serialNumber;
//
// @ExcelProperty(value = "患者姓名", index = 3)
// private String name;
//
// @ExcelProperty(value = "住院医师", index = 4)
// private String attendingName;
//
// @ExcelProperty(value = "出院日期", index = 5)
// private String disDate;
//
// @ExcelProperty(value = "出院科室编码", index = 6)
// private String disDept;
//
// @ExcelProperty(value = "出院科室名称", index = 7)
// private String disDeptName;
@ExcelProperty(value = "住院号", index = 1)
private String admissId;
@ExcelProperty(value = "住院次数", index = 1)
@ExcelProperty(value = "住院次数", index = 6)
private Integer admissTimes;
@ExcelProperty(value = "流水号", index = 2)
@ExcelProperty(value = "流水号", index = 0)
private String serialNumber;
@ExcelProperty(value = "患者姓名", index = 3)
@ExcelProperty(value = "患者姓名", index = 2)
private String name;
@ExcelProperty(value = "住院医师", index = 4)
@ExcelProperty(value = "住院医师", index = 25)
private String attendingName;
@ExcelProperty(value = "出院日期", index = 5)
@ExcelProperty(value = "出院日期", index = 14)
private String disDate;
@ExcelProperty(value = "出院科室编码", index = 6)
private String disDept;
@ExcelProperty(value = "出院科室名称", index = 7)
@ExcelProperty(value = "出院科室名称", index = 11)
private String disDeptName;
}

@ -313,7 +313,7 @@ public class RcvBasicController implements RcvBasicApi {
})
public void importExcel(@RequestPart(value = "file") MultipartFile file, HttpServletRequest request) {
System.out.println("开始导入");
List<Object> excelData = ExcelUtil.readExcel(file, new MedicalInfoExcelModel(), 1, 2);
List<Object> excelData = ExcelUtil.readExcel(file, new MedicalInfoExcelModel(), 1, 1);
final int importMax = 100000;
if (excelData.size() > importMax) {
throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "单次导入最多支持" + importMax + "条数据!");

@ -36,9 +36,9 @@ public class MedicalImportExcelValidator {
throw new BaseException("住院号不能为空");
}
if (Func.isEmpty(medicalInfoExcelModel.getAdmissTimes())) {
throw new BaseException("住院次数不能为空");
}
// if (Func.isEmpty(medicalInfoExcelModel.getAdmissTimes())) {
// throw new BaseException("住院次数不能为空");
// }
if (Func.isNull(medicalInfoExcelModel.getSerialNumber())) {
throw new BaseException("流水号不能为空");
@ -57,9 +57,9 @@ public class MedicalImportExcelValidator {
throw new BaseException("出院日期不能为空!");
}
if (Func.isBlank(medicalInfoExcelModel.getDisDept())) {
throw new BaseException("出院科室编码不能为空");
}
// if (Func.isBlank(medicalInfoExcelModel.getDisDept())) {
// throw new BaseException("出院科室编码不能为空");
// }
if (Func.isBlank(medicalInfoExcelModel.getDisDeptName())) {
throw new BaseException("出院科室名称不能为空");
@ -108,7 +108,7 @@ public class MedicalImportExcelValidator {
final String example3 = "yyyy-MM-dd HH:mm";
final String example4 = "yyyy-MM-dd HH:mm:ss";
try {
if (dateTimeStr.length() == example1.length()) {
if (dateTimeStr.length() == example1.length() - 1) {
return Func.parseDate(dateTimeStr, example1);
}
if (dateTimeStr.length() == example2.length()) {

Loading…
Cancel
Save