2 Revīzijas 7f51df69eb ... 65574e5125

Autors SHA1 Ziņojums Datums
  admin 65574e5125 xsky 1 gadu atpakaļ
  admin b00501e547 xsky 1 gadu atpakaļ

+ 12 - 6
xsky-service/pom.xml

@@ -36,12 +36,6 @@
             <version>3.5.3.1</version>
         </dependency>
 
-<!--        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus</artifactId>
-            <version>3.5.3.1</version>
-            <systemPath>${project.basedir}/lib/mybatis-plus-3.1.0.jar</systemPath>
-        </dependency>-->
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
@@ -72,6 +66,12 @@
             <systemPath>${project.basedir}/lib/DmJdbcDriver18.jar</systemPath>
         </dependency>
 
+<!--        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.3.0</version>
+        </dependency>-->
+
         <dependency>
             <groupId>com.itheima</groupId>
             <artifactId>file-starter</artifactId>
@@ -133,5 +133,11 @@
             <version>2.0.24</version>
         </dependency>
 
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+
     </dependencies>
 </project>

+ 24 - 6
xsky-service/src/main/java/com/itheima/file/controller/ApiController.java

@@ -1,10 +1,12 @@
 package com.itheima.file.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.itheima.file.pojo.Org;
 import com.itheima.file.pojo.Person;
 import com.itheima.file.service.OrgService;
 import com.itheima.file.service.PersonService;
+import com.itheima.file.util.ExcelUtils;
 import com.itheima.file.util.HTTPHelper;
 import com.itheima.file.util.SslUtils;
 import lombok.extern.slf4j.Slf4j;
@@ -13,12 +15,16 @@ import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
 import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.Base64;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Slf4j
 @RestController
@@ -31,15 +37,27 @@ public class ApiController {
     private PersonService personService;
 
     @GetMapping("/org")
-    public List<Org> getOrgList(){
-        List<Org> list = orgService.list();
-        return list;
+    public void getOrgList(HttpServletResponse response){
+        QueryWrapper<Org> queryWrapper = new QueryWrapper<>();
+        queryWrapper.last(" limit 500");
+        List<Org> list = orgService.list(queryWrapper);
+        try {
+            ExcelUtils.exportExcel(list, "组织信息", "组织信息", Org.class, "组织信息", response);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
     }
 
     @GetMapping("/person")
-    public List<Person> getPersonList(){
-        List<Person> list = personService.list();
-        return list;
+    public void getPersonList(HttpServletResponse response){
+        QueryWrapper<Person> queryWrapper = new QueryWrapper<>();
+        // queryWrapper.last(" limit 500");
+        List<Person> list = personService.list(queryWrapper);
+        try {
+            ExcelUtils.exportExcel(list, "人员信息", "人员信息", Person.class, "人员信息", response);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
     }
 
 }

+ 20 - 4
xsky-service/src/main/java/com/itheima/file/pojo/Org.java

@@ -1,5 +1,6 @@
 package com.itheima.file.pojo;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -8,40 +9,55 @@ import lombok.Data;
 @TableName(value="\"wukuang\".\"org\"")
 public class Org {
 
+    @Excel(name = "id", width = 20)
     @TableField(value = "ASG_ID")
     private int asgId;
+    @Excel(name = "根节点ID", width = 20)
     @TableField(value = "ASG_OBJ_ID")
     private Long asgObjId;
     @TableField(value = "ASG_LEVEL")
     private int asgLevel;
+    @Excel(name = "层级码", width = 20)
     @TableField(value = "ASG_PATH_CODE")
-    private String asgPathCode;
+    private String asgPathcode;
+    @Excel(name = "组织名称链", width = 20)
     @TableField(value = "ASG_PATH_NAME")
-    private String asgPathName;
+    private String asgPathname;
+    @Excel(name = "组织编码链", width = 20)
     @TableField(value = "ASG_PATHNAME_CODE")
     private String asgPathnameCode;
+    @Excel(name = "组织编码", width = 20)
     @TableField(value = "ASG_ORGAN_CODE")
-    private Long asgOrganCode;
+    private Long asgOrgancode;
+    @Excel(name = "组织名称", width = 20)
     @TableField(value = "ASG_ORGAN_NAME")
-    private String asgOrganName;
+    private String asgOrganname;
+    @Excel(name = "是否分管[0不是1是]", width = 20)
     @TableField(value = "ASG_LEADFG")
     private int asgLeadfg;
+    @Excel(name = "组织名称", width = 20)
     @TableField(value = "ASG_DATE")
     private Long asgDate;
+    @Excel(name = "是否领导班子[0不是1是]", width = 20)
     @TableField(value = "ASG_LEAD")
     private int asgLead;
     @TableField(value = "ASG_TYPE")
     private String asgType;
+    @Excel(name = "组织名称链", width = 20)
     @TableField(value = "ASG_PATHNAME_ALL")
     private String asgPathnameAll;
+    @Excel(name = "同步时间", width = 20)
     @TableField(value = "ASG_CRTDATE")
     private String asgCrtdate;
+    @Excel(name = "组织简称", width = 20)
     @TableField(value = "ASG_ORGANNAME_SHORT")
     private String asgOrgannameShort;
     @TableField(value = "ASG_ZZZLXBM")
     private String asgZzzlxbm;
+    @Excel(name = "负责人", width = 20)
     @TableField(value = "ASG_QYFZR")
     private String asgQyfzr;
+    @Excel(name = "经营状态", width = 20)
     @TableField(value = "ASG_ZJYZT")
     private String asgZjyzt;
     @TableField(value = "ASG_PRIOX")

+ 40 - 1
xsky-service/src/main/java/com/itheima/file/pojo/Person.java

@@ -1,5 +1,6 @@
 package com.itheima.file.pojo;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -7,83 +8,121 @@ import lombok.Data;
 @Data
 @TableName(value="\"wukuang\".\"person\"")
 public class Person {
+    @Excel(name = "id", width = 20)
     @TableField(value = "ASO_ID")
     private Long asoId;
-    @TableField(value = "ASO_OBJ_ID")
+    @Excel(name = "asoObjId", width = 20)
+    @TableField(value = "asoObjId")
     private Long asoObjId;
+    @Excel(name = "asoLevel", width = 20)
     @TableField(value = "ASO_LEVEL")
     private String asoLevel;
+    @Excel(name = "asoPathcode", width = 20)
     @TableField(value = "ASO_PATHCODE")
     private String asoPathcode;
+    @Excel(name = "asoPathname", width = 20)
     @TableField(value = "ASO_PATHNAME")
     private String asoPathname;
+    @Excel(name = "asoOrgancode", width = 20)
     @TableField(value = "ASO_ORGANCODE")
     private String asoOrgancode;
+    @Excel(name = "asoPathnameCode", width = 20)
     @TableField(value = "ASO_PATHNAME_CODE")
     private String asoPathnameCode;
+    @Excel(name = "asoOrganname", width = 20)
     @TableField(value = "ASO_ORGANNAME")
     private String asoOrganname;
+    @Excel(name = "asoPostcode", width = 20)
     @TableField(value = "ASO_POSTCODE")
     private String asoPostcode;
+    @Excel(name = "asoPostname", width = 20)
     @TableField(value = "ASO_POSTNAME")
     private String asoPostname;
+    @Excel(name = "asoUsercode", width = 20)
     @TableField(value = "ASO_USERCODE")
     private String asoUsercode;
+    @Excel(name = "asoUsername", width = 20)
     @TableField(value = "ASO_USERNAME")
     private String asoUsername;
+    @Excel(name = "asoLead", width = 20)
     @TableField(value = "ASO_LEAD")
     private String asoLead;
     @TableField(value = "ASO_LEADCAP")
+    @Excel(name = "asoLeadcap", width = 20)
     private String asoLeadcap;
+    @Excel(name = "asoLeadfg", width = 20)
     @TableField(value = "ASO_LEADFG")
     private String asoLeadfg;
+    @Excel(name = "同步日期", width = 20)
     @TableField(value = "ASO_DATE")
     private String asoDate;
+    @Excel(name = "组织全名", width = 20)
     @TableField(value = "ASO_PATHNAME_ALL")
     private String asoPathnameAll;
+    @Excel(name = "身份证号", width = 20)
     @TableField(value = "ASO_IDENTITY")
     private String asoIdentity;
+    @Excel(name = "asoCrtdate", width = 20)
     @TableField(value = "ASO_CRTDATE")
     private String asoCrtdate;
+    @Excel(name = "员工组", width = 20)
     @TableField(value = "ASO_PGTXT")
     private String asoPgtxt;
+    @Excel(name = "员工子组", width = 20)
     @TableField(value = "ASO_PKTXT")
     private String asoPktxt;
+    @Excel(name = "照片地址", width = 20)
     @TableField(value = "ASO_IMAGE")
     private String asoImage;
+    @Excel(name = "asoRelat", width = 20)
     @TableField(value = "ASO_RELAT")
     private String asoRelat;
+    @Excel(name = "人员所在组织排序号", width = 20)
     @TableField(value = "ASO_PRIOX")
     private String asoPriox;
 
+    @Excel(name = "性别标识", width = 20)
     @TableField(value = "ASO_GESCH")
     private int asoGesch;
+    @Excel(name = "性别文本", width = 20)
     @TableField(value = "ASO_GESCHNAME")
     private String asoGeschname;
+    @Excel(name = "出生日期", width = 20)
     @TableField(value = "ASO_GBDAT")
     private String asoGbdat;
 
+    @Excel(name = "手机号码", width = 20)
     @TableField(value = "ASO_PHONE")
     private String asoPhone;
+    @Excel(name = "ASO_PERSG", width = 20)
     @TableField(value = "ASO_PERSG")
     private String asoPersg;
+    @Excel(name = "ASO_PERSK", width = 20)
     @TableField(value = "ASO_PERSK")
     private String asoPersk;
+    @Excel(name = "asoUsaccno", width = 20)
     @TableField(value = "ASO_USACCNO")
     private String asoUsaccno;
+    @Excel(name = "asoRacky", width = 20)
     @TableField(value = "ASO_RACKY")
     private String asoRacky;
+    @Excel(name = "asoRackyx", width = 20)
     @TableField(value = "ASO_RACKYX")
     private String asoRackyx;
 
+    @Excel(name = "asoZhrjg", width = 20)
     @TableField(value = "ASO_ZHRJG")
     private String asoZhrjg;
+    @Excel(name = "asoStrjob", width = 20)
     @TableField(value = "ASO_STRJOB")
     private String asoStrjob;
+    @Excel(name = "asoStrwk", width = 20)
     @TableField(value = "ASO_STRWK")
     private String asoStrwk;
+    @Excel(name = "asoPcode", width = 20)
     @TableField(value = "ASO_PCODE")
     private String asoPcode;
+    @Excel(name = "asoPtext", width = 20)
     @TableField(value = "ASO_PTEXT")
     private String asoPtext;
 

+ 323 - 0
xsky-service/src/main/java/com/itheima/file/util/ExcelUtils.java

@@ -0,0 +1,323 @@
+package com.itheima.file.util;
+
+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.ImportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.formula.functions.T;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+/**
+ * @author XuPengFei
+ */
+public class ExcelUtils {
+    /**
+     * excel 导出
+     *
+     * @param list           数据
+     * @param title          标题
+     * @param sheetName      sheet名称
+     * @param pojoClass      pojo类型
+     * @param fileName       文件名称
+     * @param isCreateHeader 是否创建表头
+     * @param response
+     */
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) throws IOException {
+        ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF);
+        exportParams.setCreateHeadRows(isCreateHeader);
+        defaultExport(list, pojoClass, fileName, response, exportParams);
+    }
+
+    /**
+     * excel 导出
+     *
+     * @param list      数据
+     * @param title     标题
+     * @param sheetName sheet名称
+     * @param pojoClass pojo类型
+     * @param fileName  文件名称
+     * @param response
+     */
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName, HttpServletResponse response) throws IOException {
+        ExportParams params = new ExportParams(title, sheetName, ExcelType.XSSF);
+
+        defaultExport(list, pojoClass, fileName, response, params);
+    }
+
+    /**
+     * excel 导出
+     *
+     * @param list         数据
+     * @param pojoClass    pojo类型
+     * @param fileName     文件名称
+     * @param response
+     * @param exportParams 导出参数
+     */
+    public static void exportExcel(List<?> list, Class<?> pojoClass, String fileName, ExportParams exportParams, HttpServletResponse response) throws IOException {
+        defaultExport(list, pojoClass, fileName, response, exportParams);
+    }
+
+    /**
+     * excel 导出
+     *
+     * @param list     数据
+     * @param fileName 文件名称
+     * @param response
+     */
+    public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws IOException {
+        defaultExport(list, fileName, response);
+    }
+
+    /**
+     * 默认的 excel 导出
+     *
+     * @param list         数据
+     * @param pojoClass    pojo类型
+     * @param fileName     文件名称
+     * @param response
+     * @param exportParams 导出参数
+     */
+    private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws IOException {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    /**
+     * 默认的 excel 导出
+     *
+     * @param list     数据
+     * @param fileName 文件名称
+     * @param response
+     */
+    private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws IOException {
+        Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
+        downLoadExcel(fileName, response, workbook);
+    }
+
+    /**
+     * 下载
+     *
+     * @param fileName 文件名称
+     * @param response
+     * @param workbook excel数据
+     */
+    public static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException {
+        try {
+            response.setCharacterEncoding("UTF-8");
+            response.setHeader("content-Type", "application/vnd.ms-excel");
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName + "." + ExcelTypeEnum.XLSX.getValue(), "UTF-8"));
+            workbook.write(response.getOutputStream());
+        } catch (Exception e) {
+            throw new IOException(e.getMessage());
+        }
+    }
+
+    /**
+     * excel 导入
+     *
+     * @param filePath   excel文件路径
+     * @param titleRows  标题行
+     * @param headerRows 表头行
+     * @param pojoClass  pojo类型
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
+        if (StringUtils.isBlank(filePath)) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        params.setNeedSave(true);
+        params.setSaveUrl("/excel/");
+        try {
+            return ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
+        } catch (NoSuchElementException e) {
+            throw new IOException("模板不能为空");
+        } catch (Exception e) {
+            throw new IOException(e.getMessage());
+        }
+    }
+
+    /**
+     * excel 导入
+     *
+     * @param file      excel文件
+     * @param pojoClass pojo类型
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> importExcel(MultipartFile file, Class<T> pojoClass) throws IOException {
+        return importExcel(file, 1, 1, pojoClass);
+    }
+
+    /**
+     * excel 导入
+     *
+     * @param file       excel文件
+     * @param titleRows  标题行
+     * @param headerRows 表头行
+     * @param pojoClass  pojo类型
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
+        return importExcel(file, titleRows, headerRows, false, pojoClass);
+    }
+
+    /**
+     * excel 导入
+     *
+     * @param file       上传的文件
+     * @param titleRows  标题行
+     * @param headerRows 表头行
+     * @param needVerfiy 是否检验excel内容
+     * @param pojoClass  pojo类型
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, boolean needVerfiy, Class<T> pojoClass) throws IOException {
+        if (file == null) {
+            return null;
+        }
+        try {
+            return importExcel(file.getInputStream(), titleRows, headerRows, needVerfiy, pojoClass);
+        } catch (Exception e) {
+            throw new IOException(e.getMessage());
+        }
+    }
+
+    /**
+     * excel 导入
+     *
+     * @param inputStream 文件输入流
+     * @param titleRows   标题行
+     * @param headerRows  表头行
+     * @param needVerfiy  是否检验excel内容
+     * @param pojoClass   pojo类型
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> importExcel(InputStream inputStream, Integer titleRows, Integer headerRows, boolean needVerfiy, Class<T> pojoClass) throws IOException {
+        if (inputStream == null) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        params.setSaveUrl("/excel/");
+        params.setNeedSave(true);
+        try {
+            return ExcelImportUtil.importExcel(inputStream, pojoClass, params);
+        } catch (NoSuchElementException e) {
+            throw new IOException("excel文件不能为空");
+        } catch (Exception e) {
+            throw new IOException(e.getMessage());
+        }
+    }
+
+    public static <T> List<T> importExcel111(InputStream inputStream, Integer titleRows, Integer headerRows, boolean needVerfiy, Class<T> pojoClass) throws IOException {
+        if (inputStream == null) {
+            return null;
+        }
+        ImportParams params = new ImportParams();
+        params.setTitleRows(titleRows);
+        params.setHeadRows(headerRows);
+        params.setSaveUrl("/excel/");
+        params.setNeedSave(true);
+        try {
+            return ExcelImportUtil.importExcel(inputStream, pojoClass, params);
+        } catch (NoSuchElementException e) {
+            throw new IOException("excel文件不能为空");
+        } catch (Exception e) {
+            throw new IOException(e.getMessage());
+        }
+    }
+
+    /**
+     * Excel 类型枚举
+     */
+    enum ExcelTypeEnum {
+        /**
+         * XLS格式
+         */
+        XLS("xls"), XLSX("xlsx");
+        private String value;
+
+        ExcelTypeEnum(String value) {
+            this.value = value;
+        }
+
+        public String getValue() {
+            return value;
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+        }
+    }
+
+
+    /**
+     * 小雨: 导入后返回失败的数据
+     */
+    public static <T> void downLoadFailExcel(ExcelImportResult<T> result, HttpServletResponse response) throws IOException {
+        /**
+         * 验证失败的就返回给前端用户,并且带有错误消息提示内容
+         */
+        if (result.isVerifyFail()) {
+            /**
+             * 验证是否有失败,文件下载功能:将验证失败的数据放入excel文件中,让用户下载
+             */
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setHeader("Content-disposition", "attachment;filename=errors.xlsx");
+            response.setHeader("Pragma", "No-cache");
+            ServletOutputStream fos = null;
+            try {
+                fos = response.getOutputStream();
+                //直接获取验证失败的那个Workbook对象
+                result.getFailWorkbook().write(fos);
+                fos.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public static <T> void downLoadVolFailExcel(ExcelImportResult<T> result, HttpServletResponse response, Class<T> pojoClass) throws IOException {
+        /**
+         * 验证失败的就返回给前端用户,并且带有错误消息提示内容,文件下载功能:将验证失败的数据放入excel文件中,让用户下载
+         */
+        if (result.isVerifyFail()) {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setHeader("Content-disposition", "attachment;filename=errors.xlsx");
+            response.setHeader("Pragma", "No-cache");
+            ServletOutputStream fos = null;
+            try {
+                fos = response.getOutputStream();
+                /**
+                 * 直接获取验证失败的那个Workbook对象
+                 */
+                result.getFailWorkbook().write(fos);
+                fos.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 6 - 0
xsky-service/src/main/resources/application.yml

@@ -1,5 +1,11 @@
 spring:
   datasource:
+#    driver-class-name: com.mysql.cj.jdbc.Driver
+#    url: jdbc:mysql://139.198.181.54:3306/blog?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#    username: root
+#    password: Dcp#7ujm
+
+  #    达梦数据库
     driver-class-name: dm.jdbc.driver.DmDriver
     url: jdbc:dm://10.2.147.94:5236 #?schema=wukuang #?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
     username: SYSDBA

+ 2 - 0
xsky-service/src/test/java/com/itheima/file/ApiTestData.java

@@ -7,6 +7,7 @@ import com.itheima.file.pojo.Person;
 import com.itheima.file.service.FatherSonService;
 import com.itheima.file.service.OrgService;
 import com.itheima.file.service.PersonService;
+import com.itheima.file.util.ExcelUtils;
 import com.itheima.file.util.HTTPHelper;
 import com.itheima.file.util.HttpClientUtils;
 import com.itheima.file.util.SslUtils;
@@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import javax.servlet.http.HttpServletResponse;
 import java.net.URISyntaxException;
 import java.util.Base64;
 import java.util.LinkedHashMap;

+ 1 - 1
xsky-service/src/test/java/com/itheima/file/HttpClientExample.java

@@ -1,6 +1,6 @@
 package com.itheima.file;
 
-import dm.jdbc.filter.stat.json.JSONObject;
+import com.alibaba.fastjson.JSONObject;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.auth.AuthScope;