소스 검색

学员信息导入导出

wuheng 1 년 전
부모
커밋
b2cdedbb4c

+ 0 - 4
common/pom.xml

@@ -14,10 +14,6 @@
     </parent>
 
     <dependencies>
-        <dependency>
-            <groupId>cn.afterturn</groupId>
-            <artifactId>easypoi-base</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-redis</artifactId>

+ 8 - 0
common/src/main/java/com/koobietech/eas/common/result/JsonResult.java

@@ -12,6 +12,14 @@ public class JsonResult implements Serializable {
 
     private Integer code = 200;
 
+    /**
+     * 成功
+     * @return
+     */
+    public static JsonResult bool( boolean status ){
+        return status ? JsonResult.ok() : JsonResult.fail();
+    }
+
     /**
      * 成功
      * @return

+ 6 - 0
common/src/main/java/com/koobietech/eas/common/utils/ArchiveManager.java

@@ -2,8 +2,10 @@ package com.koobietech.eas.common.utils;
 
 import com.koobietech.eas.common.constant.FileType;
 import com.koobietech.eas.common.constant.UniversityCode;
+import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.pojo.ArchiveNumberInfoPojo;
 import com.koobietech.eas.common.pojo.StudentNumberInfoPojo;
+import org.springframework.util.StringUtils;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -72,6 +74,10 @@ public class ArchiveManager {
      * @return  ST911X3B98736M20251021273
      */
     public static String generateStudentCode(String studentNumber, String studentCardId, String schoolName, String enrollmentDate) {
+        if ( !StringUtils.hasText(studentCardId)
+                || !StringUtils.hasText(schoolName) || !StringUtils.hasText(enrollmentDate) ) {
+            throw new EasException("参数不能为空");
+        }
         LocalDate localDateEnrollmentDate = LocalDate.of(Integer.parseInt(enrollmentDate), 1, 1);
         String studentAge = String.valueOf(getStudentAge(studentCardId));
         String studentNum = getStudentNum(studentNumber);

+ 0 - 9
controller/pom.xml

@@ -14,19 +14,10 @@
     </parent>
 
     <dependencies>
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.anji-plus</groupId>
             <artifactId>captcha</artifactId>
         </dependency>
-        <dependency>
-            <groupId>cn.afterturn</groupId>
-            <artifactId>easypoi-base</artifactId>
-            <version>4.3.0</version>
-        </dependency>
         <dependency>
             <groupId>com.github.xiaoymin</groupId>
             <artifactId>knife4j-openapi3-spring-boot-starter</artifactId>

+ 3 - 0
controller/src/main/java/com/koobietech/eas/ControllerApplication.java

@@ -6,6 +6,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.FilterType;
 
+/**
+ * @author lc
+ */
 @SpringBootApplication
 @MapperScan(basePackages = {"com.koobietech.eas.mbg.mapper","com.koobietech.eas.dao.mapper"})
 @ComponentScan(basePackages = {"com.koobietech.eas"}, excludeFilters = {

+ 46 - 9
controller/src/main/java/com/koobietech/eas/controller/EasSysStuProfileController.java

@@ -7,9 +7,12 @@ import com.koobietech.eas.service.EasStuProfileService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
 
 /**
  * @author lc
@@ -21,14 +24,48 @@ public class EasSysStuProfileController {
     @Resource
     private EasStuProfileService easStuProfileService;
 
-    @PostMapping("/StuProfileDownload")
-    @Operation(summary = "保存学生档案为word文档到本地或者服务器中", description = "根据学生档案信息和管理员ID保存学生档案为word文档到本地或者服务器中,注意manager_id要传在url中")
-    public JsonResult StuProfileDownload(@RequestBody EasArcTlsStudents easArcTlsStudents, @RequestParam Integer manager_id) throws FileNotFoundException {
-        //StuProfileDownload返回值是boolean,这里用JsonResult包装一下 加上if判断
-        if (easStuProfileService.StuProfileDownload(easArcTlsStudents, manager_id)) {
-            return JsonResult.ok("下载成功");
-        }
-        return JsonResult.fail("下载失败");
+    @PostMapping("/add")
+    @Operation(summary = "添加学员", description = "添加学员")
+    public JsonResult add(@RequestBody EasArcTlsStudents easArcTlsStudents) {
+        return JsonResult.bool(easStuProfileService.add(easArcTlsStudents));
+    }
+
+    @PostMapping("/del/{id}")
+    @Operation(summary = "更新学员信息", description = "更新学员信息")
+    public JsonResult delete(@PathVariable int id){
+        boolean result = easStuProfileService.delete(id);
+        return JsonResult.bool(result);
+    }
+
+    @PostMapping("/update")
+    @Operation(summary = "更新学员信息", description = "更新学员信息")
+    public JsonResult update(@RequestBody EasArcTlsStudents studentDto){
+        boolean result = easStuProfileService.update(studentDto);
+        return JsonResult.bool(result);
+    }
+    @PostMapping("/query")
+    @Operation(summary = "查询学员信息", description = "查询学员信息")
+    public JsonResult query(@RequestBody(required = false) EasArcTlsStudents studentDto,
+                            @RequestParam Integer pageNum, @RequestParam Integer pageSize){
+        List<EasArcTlsStudents> res = easStuProfileService.query(studentDto, pageNum, pageSize);
+        return JsonResult.data(res);
     }
 
+    @PostMapping("/importExcel")
+    @Operation(summary = "导入学员信息", description = "导入学员信息")
+    public JsonResult importExcel( MultipartFile file ){
+        InputStream inputStream = null;
+        boolean result = false;
+        try {
+            inputStream = file.getInputStream();
+            result = easStuProfileService.importExcel(inputStream);
+        } catch (IOException e) {}finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {}
+            }
+        }
+        return JsonResult.bool(result);
+    }
 }

+ 112 - 0
controller/src/test/java/com/koobietech/eas/controller/ChatClient.java

@@ -0,0 +1,112 @@
+package com.koobietech.eas.controller;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.util.Scanner;
+
+/**
+ * ClassName: ChatClient
+ * Package: com.lc.chat
+ * Description:
+ *
+ * @Author 爱扣钉-陈晨
+ * @Create 2023/8/18 9:00
+ * @Version 1.0
+ */
+public class ChatClient {
+    public static void main(String[] args) throws Exception {
+        Scanner scanner = new Scanner(System.in);
+        //请输入链接地址
+        //创建网络链接对象Socket
+        Socket socket = new Socket("192.168.18.32",9999);
+        System.out.println("链接系统成功,请输入个人昵称,bye退出");
+        String nickname = scanner.nextLine();
+        //发送线程
+        SendThread send = new SendThread(socket,nickname);
+        send.start();
+
+        //接收线程
+        ReceiveThread receive = new ReceiveThread(socket);
+        receive.start();
+        //插队
+        send.join();
+
+    }
+}
+class ReceiveThread extends Thread{
+    Socket socket;
+
+    public ReceiveThread(Socket socket) {
+        this.socket = socket;
+    }
+
+    @Override
+    public void run() {
+        try {
+            //获取输入字节流
+            InputStream is = socket.getInputStream();
+            Scanner scanner = new Scanner(is);
+            //循环
+            while (scanner.hasNextLine()){
+                String s1 = socket.getInetAddress().toString().substring(1);
+                String s2 = InetAddress.getLocalHost().getHostAddress();
+                if (!s1.equals(s2)){
+                    String s = scanner.nextLine();
+                    System.out.println(s);
+                }
+
+            }
+            socket.close();
+
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
+class SendThread extends Thread {
+    private Socket socket;
+
+    private String nickname;
+
+    public SendThread(Socket socket , String nickname ) throws IOException {
+        this.socket = socket;
+        this.nickname = nickname;
+
+        //获取输出字节流
+        OutputStream os = socket.getOutputStream();
+        PrintStream ps = new PrintStream(os);
+        //发送名称
+        ps.println( nickname);
+    }
+
+    @Override
+    public void run() {
+        try {
+            //获取输出字节流
+            OutputStream os = socket.getOutputStream();
+            PrintStream ps = new PrintStream(os);
+            //键盘输入
+            Scanner scanner = new Scanner(System.in);
+            //循环
+            while (true){
+
+                String str = scanner.nextLine();
+                if (str.equals("bye")){
+                    break;
+                }
+                ps.println( nickname+":"+ str);
+
+            }
+            socket.shutdownOutput();
+            socket.close();
+
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
+

+ 1 - 1
dao/pom.xml

@@ -10,7 +10,7 @@
     <dependencies>
         <dependency>
             <groupId>cn.afterturn</groupId>
-            <artifactId>easypoi-annotation</artifactId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
         </dependency>
         <dependency>
             <groupId>com.github.xiaoymin</groupId>

+ 102 - 0
dao/src/main/java/com/koobietech/eas/dao/dto/EasArcTlsStudentsDto.java

@@ -0,0 +1,102 @@
+package com.koobietech.eas.dao.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lc
+ */
+@Data
+public class EasArcTlsStudentsDto {
+
+    @Schema(description = "对应的文件档案号")
+    @Excel(name = "文件档案号")
+    private String archiveNumber;
+
+    @Excel(name = "学生档案号")
+    @Schema(description = "归属的学员档案号")
+    private String studentNumber;
+
+    @Excel(name =  "学生姓名")
+    @Schema(description = "学生姓名")
+    private String studentName;
+
+    @Excel(name = "学生性别", replace = { "男_M", "女_F" } )
+    @Schema(description = "学生性别")
+    private String gender;
+
+    @Excel(name = "出生日期")
+    @Schema(description = "学生出生日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date birthdate;
+
+    @Excel(name = "学生居住地")
+    @Schema(description = "学生居住地址")
+    private String address;
+
+    @Excel(name = "学生联系电话")
+    @Schema(description = "学生联系电话")
+    private String phone;
+
+    @Excel(name = "学生电子邮箱")
+    @Schema(description = "学生电子邮箱")
+    private String email;
+
+    @Excel(name = "学生入学进入培训班日期", importFormat = "yyyy-MM-dd" )
+    @Schema(description = "学生入学进入培训班日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date enrollmentDate;
+
+    @Schema(description = "学生在培训班毕业日期")
+    @Excel(name = "学生在培训班毕业日期", importFormat = "yyyy-MM-dd" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date graduationDate;
+
+    @Excel(name = "学生培训时年级")
+    @Schema(description = "学生年级")
+    private Integer grade;
+
+    @Excel(name = "学生专业")
+    @Schema(description = "学生专业")
+    private String major;
+
+    @Excel(name = "学生辅修专业")
+    @Schema(description = "学生辅修专业")
+    private String minor;
+
+    @Excel(name = "学生所在学校")
+    @Schema(description = "学生所在学校")
+    private String university;
+
+    @ExcelIgnore
+    @Schema(description = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date createTime;
+
+    @ExcelIgnore
+    @Schema(description = "修改时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date modifyTime;
+
+    @Excel(name = "招生老师ID")
+    @Schema(description = "招生老师")
+    private Integer admissionsId;
+
+    @Excel(name = "直属负责人ID")
+    @Schema(description = "直属负责人ID")
+    private Integer managerId;
+
+    @ExcelIgnore
+    @Schema(description = "创建用户ID")
+    private Integer createUid;
+
+    @Schema(description = "学生身份证号")
+    @Excel(name = "学生身份证号")
+    private String studentIdnumber;
+
+}

+ 1 - 6
pom.xml

@@ -60,12 +60,7 @@
             </dependency>
             <dependency>
                 <groupId>cn.afterturn</groupId>
-                <artifactId>easypoi-base</artifactId>
-                <version>${easypoi.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>cn.afterturn</groupId>
-                <artifactId>easypoi-annotation</artifactId>
+                <artifactId>easypoi-spring-boot-starter</artifactId>
                 <version>${easypoi.version}</version>
             </dependency>
             <dependency>

+ 1 - 2
service/pom.xml

@@ -14,8 +14,7 @@
         </dependency>
         <dependency>
             <groupId>cn.afterturn</groupId>
-            <artifactId>easypoi-base</artifactId>
-            <version>4.3.0</version>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
         </dependency>
         <dependency>
             <groupId>com.github.pagehelper</groupId>

+ 14 - 3
service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java

@@ -1,10 +1,21 @@
 package com.koobietech.eas.service;
 
-import com.koobietech.eas.common.result.JsonResult;
 import com.koobietech.eas.mbg.model.EasArcTlsStudents;
 
-import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.List;
 
+/**
+ * @author lc
+ */
 public interface EasStuProfileService {
-    boolean StuProfileDownload(EasArcTlsStudents easArcTlsStudents,Integer manager_id) throws FileNotFoundException;
+    boolean add(EasArcTlsStudents easArcTlsStudents);
+
+    List<EasArcTlsStudents> query(EasArcTlsStudents studentDto, Integer pageNum, Integer pageSize);
+
+    boolean update(EasArcTlsStudents studentDto);
+
+    boolean delete(int id);
+
+    boolean importExcel(InputStream inputStream);
 }

+ 99 - 13
service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java

@@ -1,16 +1,22 @@
 package com.koobietech.eas.service.impl;
 
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import com.github.pagehelper.PageHelper;
 import com.koobietech.eas.common.constant.FileType;
 import com.koobietech.eas.common.constant.Gender;
 import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.utils.ArchiveManager;
 import com.koobietech.eas.common.utils.DateManager;
+import com.koobietech.eas.common.utils.SecurityManager;
 import com.koobietech.eas.dao.dto.ArchivesDto;
+import com.koobietech.eas.dao.dto.EasArcTlsStudentsDto;
 import com.koobietech.eas.mbg.mapper.EasArcArchivesMapper;
 import com.koobietech.eas.mbg.mapper.EasArcTlsStudentsMapper;
 import com.koobietech.eas.mbg.mapper.EasSysStudentMapper;
 import com.koobietech.eas.mbg.model.EasArcArchives;
 import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+import com.koobietech.eas.mbg.model.EasArcTlsStudentsExample;
 import com.koobietech.eas.mbg.model.EasSysStudent;
 import com.koobietech.eas.service.EasArchivesFilesService;
 import com.koobietech.eas.service.EasStuProfileService;
@@ -23,6 +29,7 @@ import org.apache.poi.xwpf.usermodel.XWPFTableRow;
 import org.springframework.beans.BeanUtils;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import javax.annotation.Resource;
 import java.io.IOException;
@@ -46,7 +53,7 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
     private EasArchivesFilesService easArchivesFilesService;
 
     @Override
-    public boolean StuProfileDownload(EasArcTlsStudents easArcTlsStudents, Integer manager_id) {
+    public boolean add(EasArcTlsStudents easArcTlsStudents) {
 
         //使用try-with-resources 语句 保证流的关闭
         try (InputStream wordStream = getClass().getClassLoader().getResourceAsStream(TEMPLATE_PATH)) {
@@ -55,9 +62,17 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
                 //调用内部类方法 生成学号
                 String studentNumber = generateStudentNumber(easArcTlsStudents);
 
+                easArcTlsStudents.setStudentNumber(studentNumber);
                 Map<String, Object> map = generateDataMap(easArcTlsStudents, studentNumber);
                 replacePlaceholders(doc, map);
+                //这里会生成一个学生档案保存本地 目前这里有bug保存不成功 而且文件后缀有错误
+                ArchivesDto archivesDto = insertEasArcArchives(easArcTlsStudents, doc);
+                if ( !archivesDto.isStatus() ) {
+                    throw new EasException("EasArcArchives保存失败", 8002);
+                }
+
                 //将easArcTlsStudents 保存到数据库
+                easArcTlsStudents.setArchiveNumber(archivesDto.getArchiveCode());
                 boolean isTlsStudentsInsert = insertEasArcTlsStudents(easArcTlsStudents);
                 if (!isTlsStudentsInsert) {
                     throw new EasException("EasArcTlsStudents保存失败", 8000);
@@ -66,11 +81,7 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
                 if (!isSysStudentsInsert) {
                     throw new EasException("EasSysStudents保存失败", 8001);
                 }
-                //这里会生成一个学生档案保存本地 目前这里有bug保存不成功 而且文件后缀有错误
-                boolean isEasArcArchives = insertEasArcArchives(easArcTlsStudents, studentNumber, manager_id, doc);
-                if (!isEasArcArchives) {
-                    throw new EasException("EasArcArchives保存失败", 8002);
-                }
+
             }
         } catch (IOException e) {
             return false;
@@ -78,6 +89,81 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
         return true;
     }
 
+    @Override
+    public List<EasArcTlsStudents> query(EasArcTlsStudents studentDto, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        EasArcTlsStudentsExample easArcTlsStudentsExample = new EasArcTlsStudentsExample();
+        EasArcTlsStudentsExample.Criteria criteria = easArcTlsStudentsExample.createCriteria();
+        if ( Objects.nonNull(studentDto) ) {
+            if (StringUtils.hasText(studentDto.getStudentName())) {
+                criteria.andStudentNameLike("%" + studentDto.getStudentName() + "%");
+            }
+            if (StringUtils.hasText(studentDto.getStudentNumber())) {
+                criteria.andStudentNumberLike("%" + studentDto.getStudentNumber() + "%");
+            }
+            if (Objects.nonNull(studentDto.getGender())) {
+                criteria.andGenderEqualTo(studentDto.getGender());
+            }
+            if (StringUtils.hasText(studentDto.getStudentIdnumber())) {
+                criteria.andStudentIdnumberEqualTo(studentDto.getStudentIdnumber());
+            }
+            if (StringUtils.hasText(studentDto.getPhone())) {
+                criteria.andPhoneLike("%"+studentDto.getPhone() + "% %" + studentDto.getPhone() + "%");
+            }
+            if (StringUtils.hasText(studentDto.getUniversity())) {
+                criteria.andUniversityLike("%" + studentDto.getUniversity() + "%");
+            }
+            if (StringUtils.hasText(studentDto.getAddress())) {
+                criteria.andAddressLike("%" + studentDto.getAddress() + "%");
+            }
+            if (StringUtils.hasText(studentDto.getEmail())) {
+                criteria.andEmailEqualTo(studentDto.getEmail());
+            }
+            if (Objects.nonNull(studentDto.getEnrollmentDate())) {
+                criteria.andEnrollmentDateEqualTo(studentDto.getEnrollmentDate());
+            }
+        }
+        List<EasArcTlsStudents> easArcTlsStudents = easArcTlsStudentsMapper.selectByExample(easArcTlsStudentsExample);
+        return easArcTlsStudents;
+    }
+
+    @Override
+    public boolean update(EasArcTlsStudents studentDto) {
+        return easArcTlsStudentsMapper.updateByPrimaryKey(studentDto) == 1;
+    }
+
+    @Override
+    public boolean delete(int id) {
+        return easArcTlsStudentsMapper.deleteByPrimaryKey(id) == 1;
+    }
+
+    @Override
+    public boolean importExcel(InputStream inputStream) {
+        ImportParams params = new ImportParams();
+        params.setTitleRows(1);
+        params.setHeadRows(1);
+        try {
+            EasArcTlsStudents easArcTlsStudents = null;
+                    List<EasArcTlsStudentsDto> studentList = ExcelImportUtil.importExcel(
+                    inputStream, EasArcTlsStudentsDto.class, params);
+            for (EasArcTlsStudentsDto studentDto : studentList) {
+                easArcTlsStudents = new EasArcTlsStudents();
+                BeanUtils.copyProperties(studentDto, easArcTlsStudents);
+                add(easArcTlsStudents);
+            }
+            return true;
+        } catch (Exception ignored){
+            ignored.printStackTrace();
+        } finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException ignored) {}
+            }
+        }
+        return false;
+    }
+
     private Map<String, Object> generateDataMap(EasArcTlsStudents easArcTlsStudents, String studentNumber) {
         Map<String, Object> map = new HashMap<>();
         map.put("student_name", easArcTlsStudents.getStudentName());
@@ -93,9 +179,9 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
         return map;
     }
 
-    public boolean insertEasArcArchives(EasArcTlsStudents easArcTlsStudents, String studentNumber, Integer managerId, XWPFDocument doc) {
+    public ArchivesDto insertEasArcArchives(EasArcTlsStudents easArcTlsStudents,  XWPFDocument doc) {
         // 生成档案号
-        String archiveCode = ArchiveManager.generateArchiveCode(studentNumber, String.valueOf(FileType.DOCX));
+        String archiveCode = ArchiveManager.generateArchiveCode(easArcTlsStudents.getStudentNumber(), String.valueOf(FileType.DOCX.getValue()));
 
         // 保存学员档案文件
         ArchivesDto archivesDto = easArchivesFilesService.saveArchiveStudentsFile(easArcTlsStudents.getStudentIdnumber(), doc);
@@ -114,21 +200,21 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
         // 创建 EasArcArchives 对象并设置属性
         EasArcArchives easArcArchives = new EasArcArchives();
         easArcArchives.setArchiveNumber(archiveCode);
-        easArcArchives.setStudentNumber(studentNumber);
+        easArcArchives.setStudentNumber(easArcTlsStudents.getStudentNumber());
         easArcArchives.setFilePath(filePath);
         easArcArchives.setArctype(arcType);
         easArcArchives.setCreateTime(createTime);
         easArcArchives.setModifyTime(modifyTime);
         easArcArchives.setValidityTime(validityTime);
-        easArcArchives.setManagerId(managerId);
-        easArcArchives.setCreateUid(1);
+        easArcArchives.setManagerId(easArcTlsStudents.getManagerId());
+        easArcArchives.setCreateUid(SecurityManager.getLoginUid().intValue());
         easArcArchives.setCreateDate(new Date());
 
         // 插入到数据库
         int result = easArcArchivesMapper.insert(easArcArchives);
-
+        archivesDto.setStatus( result == 1 );
         // 返回是否成功插入数据库
-        return result > 0;
+        return archivesDto;
     }