|
|
@ -160,14 +160,16 @@ public class BsSgcJsjdBuiAttendanceInformationController extends BaseController |
|
|
|
BsSgcJsjdBuiAttendanceInformation bsSgcJsjdBuiAttendanceInformation = new BsSgcJsjdBuiAttendanceInformation(); |
|
|
|
BeanUtils.copyProperties(bsSgcJsjdBuiAttendanceInformationExcel, bsSgcJsjdBuiAttendanceInformation); |
|
|
|
if (StringUtils.isNotEmpty(bsSgcJsjdBuiAttendanceInformationExcel.getAttendanceYear())) { |
|
|
|
// String[] yearMonth = bsSgcJsjdBuiAttendanceInformationExcel.getAttendanceYear().split("年");
|
|
|
|
// int year = Integer.parseInt(yearMonth[0]);
|
|
|
|
// int month = Integer.parseInt(yearMonth[1].replace("月", ""));
|
|
|
|
LocalDate baseDate = LocalDate.of(1900, 1, 1); |
|
|
|
LocalDate date = baseDate.plusDays(Integer.parseInt(bsSgcJsjdBuiAttendanceInformationExcel.getAttendanceYear()) - 2); |
|
|
|
Date attYear = Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
|
|
|
// Excel 中的日期基准是1900年1月1日,但是Excel有一个bug会将1900年当成闰年
|
|
|
|
// 因此实际处理时需要针对这个bug进行修正
|
|
|
|
|
|
|
|
|
|
|
|
String formattedDateString = bsSgcJsjdBuiAttendanceInformationExcel.getAttendanceYear().replace("年", "-").replace("月", "-01"); |
|
|
|
|
|
|
|
// 解析日期
|
|
|
|
LocalDate parsedDate = LocalDate.parse(formattedDateString, DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
|
|
|
// 解析日期
|
|
|
|
//
|
|
|
|
Date attYear = Date.from(parsedDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
|
|
bsSgcJsjdBuiAttendanceInformation.setAttendanceYear(attYear); |
|
|
|
} |
|
|
|
BsSgcJsjdBuiRealName one = bsSgcJsjdBuiRealNameService.getOne(Wrappers.lambdaQuery(BsSgcJsjdBuiRealName.class) |
|
|
@ -175,7 +177,6 @@ public class BsSgcJsjdBuiAttendanceInformationController extends BaseController |
|
|
|
// .eq(BsSgcJsjdBuiRealName::getName, bsSgcJsjdBuiAttendanceInformationExcel.getWorkerName())
|
|
|
|
.eq(BsSgcJsjdBuiRealName::getProNo, proNo), false); |
|
|
|
if (ObjectUtil.isEmpty(one)) { |
|
|
|
|
|
|
|
stringList.add(new ExcelException(bsSgcJsjdBuiAttendanceInformationExcel.getWorkerName(), "农民工花名册不存在身份证信息" + bsSgcJsjdBuiAttendanceInformationExcel.getIdNo())); |
|
|
|
} else { |
|
|
|
bsSgcJsjdBuiAttendanceInformation.setName(one.getName()); |
|
|
@ -198,7 +199,7 @@ public class BsSgcJsjdBuiAttendanceInformationController extends BaseController |
|
|
|
if (CollectionUtil.isNotEmpty(stringList)){ |
|
|
|
return util1.exportExcel(stringList,"错误信息"); |
|
|
|
}else { |
|
|
|
return AjaxResult.success(); |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|