智慧保安后台管理-外网
Administrator
2022-06-10 c25ee5daa38fe27834607a255b8c444b90454f33
保安员导入导出模板修改
7 files modified
1 files added
125 ■■■■ changed files
src/main/java/org/springblade/modules/quartz/task/Task.java 22 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/excel/ExportSecurityExcel.java 77 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/excel/SecurityExcel.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IUserService.java 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/quartz/task/Task.java
@@ -229,7 +229,7 @@
            //文件个数大于10个时开始处理
//            if (files.length==0 || files.length<10){
            if (files.length==0){
                ftp.logout();
//                ftp.logout();
                return false;
            }
            else {
@@ -274,13 +274,18 @@
                    }
                }
                //关闭流
                ftp.completePendingCommand();
                ftp.logout();
//                ftp.completePendingCommand();
//                ftp.logout();
            }
        } catch (Exception e) {
            System.out.println("ftp连接失败");
            e.printStackTrace();
        } finally {
            try {
                ftp.logout();
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (ftp.isConnected()) {
                try {
                    ftp.disconnect();
@@ -533,7 +538,7 @@
            FTPFile[] files = ftp.listFiles();
            //文件个数大于10个时开始处理
            if (files.length==0){
                ftp.logout();
//                ftp.logout();
                return false;
            }
            else {
@@ -571,13 +576,18 @@
                    }
                }
                //关闭流
                ftp.completePendingCommand();
                ftp.logout();
//                ftp.completePendingCommand();
//                ftp.logout();
            }
        } catch (Exception e) {
            System.out.println("ftp连接失败");
            e.printStackTrace();
        } finally {
            try {
                ftp.logout();
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (ftp.isConnected()) {
                try {
                    ftp.disconnect();
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -1882,7 +1882,7 @@
     */
    @GetMapping("export-security-info")
    public void exportSecurityInfo(HttpServletResponse response, UserVO user) throws IOException {
        List<SecurityExcel> list = userService.exportSecurityInfo(user);
        List<ExportSecurityExcel> list = userService.exportSecurityInfo(user);
        String fileName = null;
        try {
            response.setContentType("application/vnd.ms-excel");
src/main/java/org/springblade/modules/system/excel/ExportSecurityExcel.java
New file
@@ -0,0 +1,77 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.system.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
/**
 * UserExcel
 *
 * @author Chill
 */
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class ExportSecurityExcel implements Serializable {
    private static final long serialVersionUID = 1L;
    @ExcelProperty("编号*")
    @ColumnWidth(30)
    private String id;
    @ExcelProperty("企业名称*")
    @ColumnWidth(30)
    private String deptId;
    @ColumnWidth(10)
    @ExcelProperty("姓名*")
    private String realName;
    @ColumnWidth(15)
    @ExcelProperty("联系电话*")
    private String phone;
    @ExcelProperty("性别*")
    @ColumnWidth(10)
    private String sex;
    @ExcelProperty("身份证号*")
    @ColumnWidth(20)
    private String cardid;
    @ExcelProperty("民族")
    @ColumnWidth(10)
    private String nation;
    @ExcelProperty("身份证住址*")
    private String registered;
    @ExcelProperty("保安员证编码")
    @ColumnWidth(20)
    private String securitynumber;
}
src/main/java/org/springblade/modules/system/excel/SecurityExcel.java
@@ -37,11 +37,6 @@
public class SecurityExcel implements Serializable {
    private static final long serialVersionUID = 1L;
    @ExcelProperty("编号*")
    @ColumnWidth(30)
    private String id;
    @ExcelProperty("企业名称*")
    @ColumnWidth(30)
    private String deptId;
src/main/java/org/springblade/modules/system/mapper/UserMapper.java
@@ -24,6 +24,7 @@
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.dispatcher.vo.DispatcherVO;
import org.springblade.modules.experience.entity.Experience;
import org.springblade.modules.system.excel.ExportSecurityExcel;
import org.springblade.modules.system.excel.SecurityExcel;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.entity.User;
@@ -233,7 +234,7 @@
     * @param user
     * @return
     */
    List<SecurityExcel> exportSecurityInfo(@Param("user") UserVO user);
    List<ExportSecurityExcel> exportSecurityInfo(@Param("user") UserVO user);
    /**
     * 查询押运人员编码不为null的保安信息
     * @return
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -924,7 +924,7 @@
    <!--导出保安员信息-->
    <select id="exportSecurityInfo" resultType="org.springblade.modules.system.excel.SecurityExcel">
    <select id="exportSecurityInfo" resultType="org.springblade.modules.system.excel.ExportSecurityExcel">
        select
        distinct bu.id,
        bd.dept_name deptId,
src/main/java/org/springblade/modules/system/service/IUserService.java
@@ -26,10 +26,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.entity.UserInfo;
import org.springblade.modules.system.entity.UserOauth;
import org.springblade.modules.system.excel.QrCodeExcel;
import org.springblade.modules.system.excel.SecurityExcel;
import org.springblade.modules.system.excel.SecurityYyExcel;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.excel.*;
import org.springblade.modules.system.node.TreeNode;
import org.springblade.modules.system.vo.UserVO;
@@ -353,7 +350,7 @@
     * @param user
     * @return
     */
    List<SecurityExcel> exportSecurityInfo(UserVO user);
    List<ExportSecurityExcel> exportSecurityInfo(UserVO user);
    /**
     * 导入保安员test
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -59,10 +59,7 @@
import org.springblade.modules.securitypaper.entity.SecurityPaper;
import org.springblade.modules.securitypaper.service.SecurityPaperService;
import org.springblade.modules.system.entity.*;
import org.springblade.modules.system.excel.QrCodeExcel;
import org.springblade.modules.system.excel.SecurityExcel;
import org.springblade.modules.system.excel.SecurityYyExcel;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.excel.*;
import org.springblade.modules.system.mapper.UserMapper;
import org.springblade.modules.system.node.TreeNode;
import org.springblade.modules.system.service.*;
@@ -2303,7 +2300,7 @@
     * @return
     */
    @Override
    public List<SecurityExcel> exportSecurityInfo(UserVO user) {
    public List<ExportSecurityExcel> exportSecurityInfo(UserVO user) {
        return baseMapper.exportSecurityInfo(user);
    }