|
@@ -3842,8 +3842,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
//然后解析表格
|
|
|
Workbook workbook = WorkbookFactory.create(new FileInputStream(file));
|
|
|
|
|
|
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
//获取公司全部成员
|
|
|
List<User> allUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
|
|
@@ -3942,12 +3942,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
msg.setError(MessageUtils.message("data.NullErrorByRow",dataCount));
|
|
|
return msg;
|
|
|
}
|
|
|
- if(!isDateFormat){
|
|
|
- msg.setError("请确认日期列是否为日期");
|
|
|
- return msg;
|
|
|
- }
|
|
|
if(!isValidDate(reportDate)){
|
|
|
- msg.setError("请确认日期列所填日期格式是否正确 示例:1999-01-01");
|
|
|
+ msg.setError("请确认日期列所填日期格式是否正确 示例:1999/01/01");
|
|
|
return msg;
|
|
|
}
|
|
|
// String username = withCheckIn==null?row.getCell(1).getStringCellValue().trim():row.getCell(2).getStringCellValue().trim();
|
|
@@ -6245,7 +6241,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
Company company = companyMapper.selectById(companyId);
|
|
|
List<String> exampleDataList=new ArrayList<>();
|
|
|
heads.add("日期");
|
|
|
- exampleDataList.add("2023-06-28");
|
|
|
+ exampleDataList.add("2023/06/28");
|
|
|
heads.add("员工姓名");
|
|
|
exampleDataList.add("张三");
|
|
|
heads.add("员工工号");
|
|
@@ -6393,8 +6389,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
// 输入批注信息
|
|
|
//comment.setString(new HSSFRichTextString("日期格式:yyyy-MM-dd\n" +
|
|
|
// "例如: 2021-01-01"));
|
|
|
- comment.setString(new XSSFRichTextString(MessageUtils.message("excel.dateFormat")+"\n" +
|
|
|
- MessageUtils.message("excel.forExample")));
|
|
|
+ comment.setString(new XSSFRichTextString("日期格式:yyyy/MM/dd\n" +
|
|
|
+ "例如: 2021/01/01"));
|
|
|
cell.setCellComment(comment);
|
|
|
break;
|
|
|
case "员工工号":
|
|
@@ -6464,7 +6460,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
public static boolean isValidDate(String s) {
|
|
|
|
|
|
try {
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
dateFormat.parse(s);
|
|
|
return true;
|
|
|
|