|
@@ -18,7 +18,12 @@ import com.template.model.result.PageUtils;
|
|
|
import com.template.model.vo.AskForLeaveScreenVo;
|
|
import com.template.model.vo.AskForLeaveScreenVo;
|
|
|
import com.template.model.vo.FaceManagementVo;
|
|
import com.template.model.vo.FaceManagementVo;
|
|
|
import com.template.model.vo.LastSevenDaysTrackVo;
|
|
import com.template.model.vo.LastSevenDaysTrackVo;
|
|
|
|
|
+import com.template.model.vo.SmartAccessVo;
|
|
|
import com.template.services.*;
|
|
import com.template.services.*;
|
|
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -546,6 +551,48 @@ public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI
|
|
|
return CommonResult.ok(result);
|
|
return CommonResult.ok(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void faceManagementExport(HttpServletResponse response, String keyWord, String gradeId, String classId, String startTime, String endTime) {
|
|
|
|
|
+ //导出
|
|
|
|
|
+ Workbook workbook = new XSSFWorkbook();
|
|
|
|
|
+ Sheet sheet = workbook.createSheet("人脸记录");
|
|
|
|
|
+ Row headerRow = sheet.createRow(0);
|
|
|
|
|
+ headerRow.createCell(0).setCellValue("序号");
|
|
|
|
|
+ headerRow.createCell(1).setCellValue("姓名");
|
|
|
|
|
+ headerRow.createCell(2).setCellValue("班级");
|
|
|
|
|
+ headerRow.createCell(3).setCellValue("年级");
|
|
|
|
|
+ headerRow.createCell(4).setCellValue("地点");
|
|
|
|
|
+ headerRow.createCell(5).setCellValue("图片");
|
|
|
|
|
+ headerRow.createCell(6).setCellValue("创建时间");
|
|
|
|
|
+
|
|
|
|
|
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ // 默认前一天的
|
|
|
|
|
+ if (ObjectUtils.isEmpty(startTime)||ObjectUtils.isEmpty(endTime)) {
|
|
|
|
|
+ LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
|
|
|
|
|
+ LocalDateTime end = now.plusDays(1);
|
|
|
|
|
+ startTime=now.format(dateTimeFormatter);
|
|
|
|
|
+ endTime=end.format(dateTimeFormatter);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<FaceManagementVo> vos= smartFaceDiscernService.faceManagementExport(keyWord,gradeId,classId,startTime,endTime);
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < vos.size(); i++) {
|
|
|
|
|
+ FaceManagementVo vo = vos.get(i);
|
|
|
|
|
+ Row dataRow = sheet.createRow(i + 1);
|
|
|
|
|
+ dataRow.createCell(0).setCellValue(i + 1);
|
|
|
|
|
+ dataRow.createCell(1).setCellValue(vo.getName());
|
|
|
|
|
+ dataRow.createCell(2).setCellValue(vo.getClassName());
|
|
|
|
|
+ dataRow.createCell(3).setCellValue(vo.getGradeName());
|
|
|
|
|
+ dataRow.createCell(4).setCellValue(vo.getLocation());
|
|
|
|
|
+ dataRow.createCell(5).setCellValue(vo.getImage());
|
|
|
|
|
+ dataRow.createCell(6).setCellValue(vo.getDateTime());
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 将工作簿写入文件
|
|
|
|
|
+ ExcelUtils.excelDownload(workbook, "人脸记录.xlsx", response);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
public static JSONObject getDate(Integer date) {
|
|
public static JSONObject getDate(Integer date) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|