1
0

5 Incheckningar 43a21fba73 ... 43f5b7374c

Upphovsman SHA1 Meddelande Datum
  cuidi 43f5b7374c 导入excel考勤信息 1 år sedan
  cuidi 5cfaf50584 导入excel考勤信息 1 år sedan
  cuidi 092c703090 Merge branch 'master' of http://39.105.160.25:10880/wuheng/eas-system 1 år sedan
  cuidi 25ded5b94c 拉代码 1 år sedan
  cuidi 7b10a657c8 Merge branch 'cuidi1' 1 år sedan

+ 4 - 0
common/src/main/java/com/koobietech/eas/common/utils/FileManager.java

@@ -2,6 +2,8 @@ package com.koobietech.eas.common.utils;
 
 
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
 import java.io.*;
 import java.io.*;
@@ -13,6 +15,7 @@ import java.util.Objects;
 @Component
 @Component
 public class FileManager {
 public class FileManager {
 
 
+    private static final Logger logger = LoggerFactory.getLogger(FileManager.class);
     String separator = File.separator ;
     String separator = File.separator ;
 
 
     /**********************************
     /**********************************
@@ -406,6 +409,7 @@ public class FileManager {
             fileOutputStream = new FileOutputStream(savePath);
             fileOutputStream = new FileOutputStream(savePath);
             workbook.write(fileOutputStream);
             workbook.write(fileOutputStream);
         } catch (IOException e) {
         } catch (IOException e) {
+            logger.error(e.getMessage());
             result = false;
             result = false;
         } finally {
         } finally {
             if (Objects.nonNull(fileOutputStream)) {
             if (Objects.nonNull(fileOutputStream)) {

+ 28 - 1
controller/src/main/java/com/koobietech/eas/controller/EasArcTlsAttendanceController.java

@@ -10,8 +10,11 @@ import com.koobietech.eas.service.EasArcTlsAttendanceService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.io.IOException;
+import java.io.InputStream;
 
 
 @Tag(name = "签到模块")
 @Tag(name = "签到模块")
 @RestController
 @RestController
@@ -45,7 +48,7 @@ public class EasArcTlsAttendanceController {
         if (isExist) {
         if (isExist) {
             System.out.println("!!!!!已经存在,转到更新方法");
             System.out.println("!!!!!已经存在,转到更新方法");
             return update(attendance);
             return update(attendance);
-        }else{
+        } else {
             System.out.println("!!!!!不存在,正在执行添加方法");
             System.out.println("!!!!!不存在,正在执行添加方法");
             boolean isAdded = easArcTlsAttendanceService.add(attendance);
             boolean isAdded = easArcTlsAttendanceService.add(attendance);
             if (isAdded) {
             if (isAdded) {
@@ -77,4 +80,28 @@ public class EasArcTlsAttendanceController {
         }
         }
         return JsonResult.fail("更新签到记录失败");
         return JsonResult.fail("更新签到记录失败");
     }
     }
+
+    @PostMapping(value = "/importExcelAttendance")
+    @Operation(summary = "Excel导入学生考勤信息",description = "用于Excel导入学生考勤信息")
+    public JsonResult importExcelAttendance(MultipartFile excelFile) {
+        InputStream inputStream = null;
+        Boolean aBoolean;
+        try {
+            inputStream = excelFile.getInputStream();
+            aBoolean = easArcTlsAttendanceService.importExcelAttendance(inputStream);
+        } catch (IOException e) {
+            aBoolean = false;
+        } finally {
+            try {
+                inputStream.close();
+            } catch (IOException e) {
+
+            }
+        }
+        if (aBoolean == true) {
+            return JsonResult.ok();
+        }
+        return JsonResult.fail();
+
+    }
 }
 }

+ 1 - 1
controller/src/main/resources/application-local.yaml

@@ -1,5 +1,5 @@
 server:
 server:
-  port: 8080
+  port: 8081
 spring:
 spring:
   datasource:
   datasource:
     url: jdbc:mysql://127.0.0.1:3306/eas?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true&tinyInt1isBit=false
     url: jdbc:mysql://127.0.0.1:3306/eas?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=true&tinyInt1isBit=false

+ 6 - 0
dao/pom.xml

@@ -16,6 +16,12 @@
             <groupId>com.github.xiaoymin</groupId>
             <groupId>com.github.xiaoymin</groupId>
             <artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
             <artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>com.koobietech.eas</groupId>
+            <artifactId>mbg</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
     <parent>
     <parent>

+ 20 - 0
dao/src/main/java/com/koobietech/eas/dao/mapper/AttendanceQueryMapper.java

@@ -0,0 +1,20 @@
+package com.koobietech.eas.dao.mapper;
+
+
+import com.koobietech.eas.dao.Pojo.EasArcTlsAttendancePojo;
+import com.koobietech.eas.mbg.model.EasArcTlsAttendance;
+import com.koobietech.eas.mbg.model.EasArcTlsAttendanceExample;
+
+import java.util.List;
+
+public interface AttendanceQueryMapper {
+
+    //根据模板查询
+    List<EasArcTlsAttendance> selectByExample(EasArcTlsAttendanceExample example);
+
+    //查询执行条数
+    long countByExample(EasArcTlsAttendanceExample example);
+
+    //导入Excel
+    EasArcTlsAttendancePojo importExcel(String studentNumber);
+}

+ 31 - 6
dao/src/main/java/com/koobietech/eas/dao/pojo/EasArcTlsAttendancePojo.java

@@ -1,6 +1,7 @@
 package com.koobietech.eas.dao.pojo;
 package com.koobietech.eas.dao.pojo;
 
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -12,32 +13,56 @@ import java.util.Date;
 @Data
 @Data
 public class EasArcTlsAttendancePojo implements Serializable {
 public class EasArcTlsAttendancePojo implements Serializable {
 
 
-    @Excel(name = "签到日期")
+    @Excel(name = "签到日期" , exportFormat="yyyy年MM月dd日")
     private Date checkinDate;
     private Date checkinDate;
 
 
     @Excel(name = "学员档案号")
     @Excel(name = "学员档案号")
     private String studentNumber;
     private String studentNumber;
 
 
+    @Excel(name = "学员ID号")
+    private String studentId;
+
+    @Excel(name = "排课ID")
+    private int scheduleId;
+
     //a表示正常出勤, b表示迟到、早退, c表示旷课, d表示请假, e表示无效
     //a表示正常出勤, b表示迟到、早退, c表示旷课, d表示请假, e表示无效
-    @Excel(name = "上午出勤状态")
+    @Excel(name = "上午出勤状态", replace = { "正常出勤_a", "迟到、早退_b" }, width = 10)
     private String morning;
     private String morning;
 
 
     //a表示正常出勤,   b表示迟到、早退, c 表示旷课, d 表示请假, e表示无效"
     //a表示正常出勤,   b表示迟到、早退, c 表示旷课, d 表示请假, e表示无效"
-    @Excel(name = "下午出勤状态")
+    @Excel(name = "下午出勤状态", replace = { "正常出勤_a", "迟到、早退_b" }, width = 10)
     private String afternoon;
     private String afternoon;
 
 
     @Excel(name = "学员姓名")
     @Excel(name = "学员姓名")
     private String studentName;
     private String studentName;
 
 
     @Excel(name = "类别" )
     @Excel(name = "类别" )
-    private Integer category;
+    private String category;
 
 
     @Excel(name = "科目" )
     @Excel(name = "科目" )
-    private Integer subject;
+    private String subject;
 
 
-    @Excel(name = "创建时间" )
+    @Excel(name = "创建时间" , exportFormat="yyyy年MM月dd日HH时mm分ss秒")
     private Date createTime;
     private Date createTime;
 
 
+    private Long id;
+
+    @Schema(description = "月份")
+    private Integer month;
+
+    @Schema(description = "创建用户")
+    private Integer createUid;
+
+    @Schema(description = "修改时间")
+    private Date modifyTime;
+
+    @Excel(name = "起始时间" , exportFormat="yyyy年MM月dd日HH时mm分ss秒")
+    private Date startTime;
+
+    @Excel(name = "结束时间" , exportFormat="yyyy年MM月dd日HH时mm分ss秒")
+    private Date endTime;
+
+
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
 }
 }

+ 103 - 0
dao/src/main/resources/com/koobietech/eas/dao/mapper/AttendanceQueryMapper.xml

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.koobietech.eas.dao.mapper.AttendanceQueryMapper">
+    <resultMap id="BaseSelectMap" type="com.koobietech.eas.dao.Pojo.EasArcTlsAttendancePojo">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="checkin_date" jdbcType="DATE" property="checkinDate" />
+        <result column="schedule_id" jdbcType="INTEGER" property="scheduleId" />
+        <result column="month" jdbcType="INTEGER" property="month" />
+        <result column="morning" jdbcType="CHAR" property="morning" />
+        <result column="afternoon" jdbcType="CHAR" property="afternoon" />
+        <result column="student_name" jdbcType="VARCHAR" property="studentName" />
+        <result column="student_number" jdbcType="VARCHAR" property="studentNumber" />
+        <result column="create_uid" jdbcType="INTEGER" property="createUid" />
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+        <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
+    </resultMap>
+
+    <resultMap id="execlDetail" type="com.koobietech.eas.dao.Pojo.EasArcTlsAttendancePojo">
+        <result column="studentId" property="studentId" />
+        <result column="category" property="category" />
+        <result column="subject" property="subject" />
+        <result column="startTime" property="startTime" />
+        <result column="endTime" property="endTime" />
+    </resultMap>
+
+
+    <sql id="Example_Where_Clause">
+        <where>
+            <foreach collection="oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+
+    <sql id="Base_Column_List">
+        id, checkin_date, schedule_id, month, morning, afternoon, student_name, student_number,
+    create_uid, create_time, modify_time
+    </sql>
+
+    <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsAttendanceExample" resultMap="BaseSelectMap">
+        select
+        <if test="distinct">
+            distinct
+        </if>
+        <include refid="Base_Column_List" />
+        from eas_arc_tls_attendance
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+        <if test="orderByClause != null">
+            order by ${orderByClause}
+        </if>
+    </select>
+
+    <select id="countByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsAttendanceExample" resultType="java.lang.Long">
+        select count(*) from eas_arc_tls_attendance
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </select>
+
+
+    //导入excel
+    <select id="importExcel" resultMap="execlDetail">
+        SELECT
+            IFNULL(su.`name`,"") AS `subject`,
+            IFNULL(c.`name`,"") AS category,
+            IFNULL(sc.start_time, '1970-01-01 00:00:00') AS startTime,
+            IFNULL(sc.end_time, '1970-01-01 00:00:00') AS endTime,
+            IFNULL(s.id,0) AS studentId
+        FROM
+            eas_arc_tls_attendance AS a
+                LEFT JOIN eas_sys_student AS s ON a.student_number = s.student_number
+                LEFT JOIN eas_edu_schedule AS sc ON a.schedule_id = sc.id
+                LEFT JOIN eas_edu_subjects AS su ON sc.subjects_id = su.id
+                LEFT JOIN eas_edu_category AS c ON sc.category_id = c.id
+        WHERE
+            a.student_number = #{studentNumber}
+    </select>
+
+</mapper>

+ 3 - 0
service/src/main/java/com/koobietech/eas/service/EasArcTlsAttendanceService.java

@@ -3,6 +3,7 @@ package com.koobietech.eas.service;
 import com.koobietech.eas.common.result.PageData;
 import com.koobietech.eas.common.result.PageData;
 import com.koobietech.eas.mbg.model.EasArcTlsAttendance;
 import com.koobietech.eas.mbg.model.EasArcTlsAttendance;
 
 
+import java.io.InputStream;
 import java.util.List;
 import java.util.List;
 
 
 public interface EasArcTlsAttendanceService {
 public interface EasArcTlsAttendanceService {
@@ -17,4 +18,6 @@ public interface EasArcTlsAttendanceService {
     boolean isExist(EasArcTlsAttendance attendance);
     boolean isExist(EasArcTlsAttendance attendance);
 
 
     List<EasArcTlsAttendance> getStudentList(Long scheduleId);
     List<EasArcTlsAttendance> getStudentList(Long scheduleId);
+
+    Boolean importExcelAttendance(InputStream inputStream);
 }
 }

+ 73 - 12
service/src/main/java/com/koobietech/eas/service/impl/EasArcTlsAttendanceServiceImpl.java

@@ -1,7 +1,9 @@
 package com.koobietech.eas.service.impl;
 package com.koobietech.eas.service.impl;
 
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import com.koobietech.eas.common.constant.FileType;
 import com.koobietech.eas.common.constant.FileType;
 import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.exception.EasException;
@@ -10,6 +12,7 @@ import com.koobietech.eas.common.utils.SecurityUtils;
 import com.koobietech.eas.dao.pojo.EasArcTlsAttendancePojo;
 import com.koobietech.eas.dao.pojo.EasArcTlsAttendancePojo;
 import com.koobietech.eas.dao.pojo.EasArcTlsScoresPojo;
 import com.koobietech.eas.dao.pojo.EasArcTlsScoresPojo;
 import com.koobietech.eas.dao.dto.ArchivesDto;
 import com.koobietech.eas.dao.dto.ArchivesDto;
+import com.koobietech.eas.dao.mapper.AttendanceQueryMapper;
 import com.koobietech.eas.mbg.mapper.*;
 import com.koobietech.eas.mbg.mapper.*;
 import com.koobietech.eas.mbg.model.*;
 import com.koobietech.eas.mbg.model.*;
 import com.koobietech.eas.service.EasArcTlsAttendanceService;
 import com.koobietech.eas.service.EasArcTlsAttendanceService;
@@ -19,6 +22,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.ZoneOffset;
 import java.time.ZoneOffset;
 import java.util.*;
 import java.util.*;
@@ -48,6 +53,9 @@ public class EasArcTlsAttendanceServiceImpl implements EasArcTlsAttendanceServic
     @Resource
     @Resource
     EasArcArchivesMapper arcArchivesMapper;
     EasArcArchivesMapper arcArchivesMapper;
 
 
+    @Resource
+    AttendanceQueryMapper attendanceQueryMapper;
+
     @Override
     @Override
     public PageData query(EasArcTlsAttendance attendance) {
     public PageData query(EasArcTlsAttendance attendance) {
         EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
         EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
@@ -87,8 +95,8 @@ public class EasArcTlsAttendanceServiceImpl implements EasArcTlsAttendanceServic
         }
         }
 
 
         List<EasArcTlsAttendance> easArcTlsAttendances =
         List<EasArcTlsAttendance> easArcTlsAttendances =
-                easArcTlsAttendanceMapper.selectByExample(easArcTlsAttendanceExample);
-        long l = easArcTlsAttendanceMapper.countByExample(easArcTlsAttendanceExample);
+                attendanceQueryMapper.selectByExample(easArcTlsAttendanceExample);
+        long l = attendanceQueryMapper.countByExample(easArcTlsAttendanceExample);
         PageData ret = new PageData();
         PageData ret = new PageData();
         ret.setData(easArcTlsAttendances);
         ret.setData(easArcTlsAttendances);
         ret.setTotal(l);
         ret.setTotal(l);
@@ -179,11 +187,54 @@ public class EasArcTlsAttendanceServiceImpl implements EasArcTlsAttendanceServic
                 .collect(Collectors.toList());
                 .collect(Collectors.toList());
     }
     }
 
 
-    public boolean saveStudentAttendanceArchive(EasArcTlsAttendance attendance){
+    @Override
+    public Boolean importExcelAttendance(InputStream inputStream) {
+        ImportParams importParams = new ImportParams();
+        //设置标题行数
+        importParams.setTitleRows(1);
+        //设置标头行数
+        importParams.setHeadRows(1);
+        try {
+            //调用工具类导入excel
+            List<EasArcTlsAttendancePojo> attendance = ExcelImportUtil.importExcel(inputStream,
+                    EasArcTlsAttendancePojo.class, importParams);
+            EasArcTlsAttendance easArcTlsAttendance = null;
+            //遍历存储考勤信息
+            for (EasArcTlsAttendancePojo attendancePojo : attendance) {
+                if ( !StringUtils.hasText(attendancePojo.getStudentNumber()) ) {
+                    continue;
+                }
+                easArcTlsAttendance = new EasArcTlsAttendance();
+                //拷贝考勤信息
+                BeanUtil.copyProperties(attendancePojo, easArcTlsAttendance);
+                easArcTlsAttendance.setCreateUid( SecurityUtils.getLoginUid().intValue() );
+                easArcTlsAttendance.setModifyTime(new Date());
+                easArcTlsAttendance.setCreateTime(new Date());
+                easArcTlsAttendance.setMonth(attendancePojo.getCheckinDate().getMonth());
+                //将excel信息存入数据库
+                easArcTlsAttendanceMapper.insert(easArcTlsAttendance);
+            }
+            if ( Objects.nonNull (easArcTlsAttendance) ) {
+                //考勤信息不为空,存入学生档案
+                saveStudentAttendanceArchive(easArcTlsAttendance);
+            }
+        } catch (Exception e) {
+            throw new EasException(e.getMessage());
+        } finally {
+            try {
+                if (inputStream != null) {
+                    inputStream.close();
+                }
+            } catch (Exception e) {
+            }
+        }
+        return true;
+    }
+
+    public boolean saveStudentAttendanceArchive(EasArcTlsAttendance attendance) {
         EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
         EasArcTlsAttendanceExample easArcTlsAttendanceExample = new EasArcTlsAttendanceExample();
         EasArcTlsAttendanceExample.Criteria criteria = easArcTlsAttendanceExample.createCriteria();
         EasArcTlsAttendanceExample.Criteria criteria = easArcTlsAttendanceExample.createCriteria();
         criteria.andStudentNumberEqualTo(attendance.getStudentNumber());
         criteria.andStudentNumberEqualTo(attendance.getStudentNumber());
-        //criteria.andScheduleIdEqualTo(attendance.getScheduleId());
         List<EasArcTlsAttendance> easArcTlsAttendances = easArcTlsAttendanceMapper.selectByExample(easArcTlsAttendanceExample);
         List<EasArcTlsAttendance> easArcTlsAttendances = easArcTlsAttendanceMapper.selectByExample(easArcTlsAttendanceExample);
         ArchivesDto archivesDto = saveEasArcTlsAttendanceToExcel(easArcTlsAttendances, attendance.getStudentNumber());
         ArchivesDto archivesDto = saveEasArcTlsAttendanceToExcel(easArcTlsAttendances, attendance.getStudentNumber());
         EasArcArchives easArcArchives = new EasArcArchives();
         EasArcArchives easArcArchives = new EasArcArchives();
@@ -191,26 +242,36 @@ public class EasArcTlsAttendanceServiceImpl implements EasArcTlsAttendanceServic
         easArcArchives.setArchiveNumber(archivesDto.getArchiveCode());
         easArcArchives.setArchiveNumber(archivesDto.getArchiveCode());
         easArcArchives.setFilePath(archivesDto.getPath());
         easArcArchives.setFilePath(archivesDto.getPath());
         easArcArchives.setCreateTime(new Date());
         easArcArchives.setCreateTime(new Date());
-        easArcArchives.setCreateUid( SecurityUtils.getLoginUid().intValue() );
+        easArcArchives.setCreateUid(SecurityUtils.getLoginUid().intValue());
         easArcArchives.setModifyTime(new Date());
         easArcArchives.setModifyTime(new Date());
         easArcArchives.setArctype(FileType.XLSX.name());
         easArcArchives.setArctype(FileType.XLSX.name());
-        easArcArchives.setManagerId( SecurityUtils.getLoginUid().intValue() );
-        easArcArchives.setValidityTime( new Date(LocalDate.now().plusMonths(20)
-                .atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli()) );
+        easArcArchives.setManagerId(SecurityUtils.getLoginUid().intValue());
+        easArcArchives.setValidityTime(new Date(LocalDate.now().plusMonths(20)
+                .atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli()));
         int insert = arcArchivesMapper.insert(easArcArchives);
         int insert = arcArchivesMapper.insert(easArcArchives);
         return insert == 1;
         return insert == 1;
     }
     }
 
 
-    private ArchivesDto saveEasArcTlsAttendanceToExcel(List<EasArcTlsAttendance> easArcTlsAttendances, String studentNumber) {
+    private ArchivesDto saveEasArcTlsAttendanceToExcel
+            (List<EasArcTlsAttendance> easArcTlsAttendances, String studentNumber) {
         List<EasArcTlsAttendancePojo> arcTlsAttendanceList = new ArrayList<>();
         List<EasArcTlsAttendancePojo> arcTlsAttendanceList = new ArrayList<>();
-        for (EasArcTlsAttendance tlsAttendance: easArcTlsAttendances) {
+        for (EasArcTlsAttendance tlsAttendance : easArcTlsAttendances) {
             EasArcTlsAttendancePojo easArcTlsAttendancePojo = new EasArcTlsAttendancePojo();
             EasArcTlsAttendancePojo easArcTlsAttendancePojo = new EasArcTlsAttendancePojo();
             BeanUtil.copyProperties(tlsAttendance, easArcTlsAttendancePojo);
             BeanUtil.copyProperties(tlsAttendance, easArcTlsAttendancePojo);
+            EasArcTlsAttendancePojo tlsAttendancePojo = attendanceQueryMapper.importExcel(studentNumber);
+            if ( Objects.nonNull(tlsAttendancePojo) ) {
+                easArcTlsAttendancePojo.setCategory(tlsAttendancePojo.getCategory());
+                easArcTlsAttendancePojo.setSubject(tlsAttendancePojo.getSubject());
+                easArcTlsAttendancePojo.setStudentId(tlsAttendancePojo.getStudentId());
+                easArcTlsAttendancePojo.setStartTime(tlsAttendancePojo.getStartTime());
+                easArcTlsAttendancePojo.setEndTime(tlsAttendancePojo.getEndTime());
+            }
             arcTlsAttendanceList.add(easArcTlsAttendancePojo);
             arcTlsAttendanceList.add(easArcTlsAttendancePojo);
         }
         }
-        ExportParams params   = new ExportParams("学员签到表", "签到");
+        System.out.println(  arcTlsAttendanceList  );
+        ExportParams params = new ExportParams("学员签到表", "签到");
         Workbook workbook = ExcelExportUtil.exportExcel(params,
         Workbook workbook = ExcelExportUtil.exportExcel(params,
-                EasArcTlsScoresPojo.class, arcTlsAttendanceList);
+                EasArcTlsAttendancePojo.class, arcTlsAttendanceList);
         ArchivesDto archivesDto = easArchivesFilesService.saveArchiveFile(studentNumber, workbook);
         ArchivesDto archivesDto = easArchivesFilesService.saveArchiveFile(studentNumber, workbook);
         return archivesDto;
         return archivesDto;
     }
     }

+ 2 - 2
service/src/main/java/com/koobietech/eas/service/impl/EasArchivesFilesServiceImpl.java

@@ -115,14 +115,14 @@ public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
     }
     }
 
 
     private ArchivesDto saveArchiveDocumentFile(String studentNumber, XWPFDocument document, String type) {
     private ArchivesDto saveArchiveDocumentFile(String studentNumber, XWPFDocument document, String type) {
-        String archiveCode = StudentArchiveGenerator.generateArchiveCode(studentNumber, FileType.valueOf(type).getSuffix());
+        String archiveCode = StudentArchiveGenerator.generateArchiveCode(studentNumber, String.valueOf(FileType.valueOf(type).getValue()));
         String path = getArchivePath(studentNumber, archiveCode, FileType.valueOf(type).getSuffix());
         String path = getArchivePath(studentNumber, archiveCode, FileType.valueOf(type).getSuffix());
         boolean status = fileManager.saveDocument(document, path);
         boolean status = fileManager.saveDocument(document, path);
         return new ArchivesDto(path, status, archiveCode, type);
         return new ArchivesDto(path, status, archiveCode, type);
     }
     }
 
 
     private ArchivesDto saveArchiveWorkbookFile(String studentNumber, Workbook workbook, String type) {
     private ArchivesDto saveArchiveWorkbookFile(String studentNumber, Workbook workbook, String type) {
-        String archiveCode = StudentArchiveGenerator.generateArchiveCode(studentNumber, FileType.valueOf(type).getSuffix());
+        String archiveCode = StudentArchiveGenerator.generateArchiveCode(studentNumber, String.valueOf(FileType.valueOf(type).getValue()));
         String path = getArchivePath(studentNumber, archiveCode, FileType.valueOf(type).getSuffix());
         String path = getArchivePath(studentNumber, archiveCode, FileType.valueOf(type).getSuffix());
         boolean status = fileManager.saveWorkbook(workbook, path);
         boolean status = fileManager.saveWorkbook(workbook, path);
         return new ArchivesDto(path, status, archiveCode, type);
         return new ArchivesDto(path, status, archiveCode, type);