智慧保安后台管理-外网项目备份
zhongrj
2023-06-25 fc21989ae9cde74aff82a9018087dd104d255f79
晋城版
37 files modified
1907 ■■■■■ changed files
src/main/java/org/springblade/common/config/FileConfig.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/monitor.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java 22 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java 28 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/entity/ExamPaper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/entity/ExamScore.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/excel/ExamScoreExcel.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/excel/ExportExamScoreExcel.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml 40 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ScoreAuditRecordsMapper.xml 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java 109 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 45 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java 62 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/util/SecurityPaperUtil.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/vo/ExamPaperVO.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/vo/ExamScoreVO.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/licetuser/controller/LicetuserController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java 121 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/controller/RecordController.java 121 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java 13 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/simulateexam/service/impl/SimulateExamRecordServiceImpl.java 118 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/social/controller/SocialController.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/DeptController.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 202 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/entity/User.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/excel/SecurityExcel.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 64 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 720 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/excel/TrainingRegistrationExcel.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml 11 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/vo/TrainingRegistrationVo.java 5 ●●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 5 ●●●●● patch | view | raw | blame | history
src/main/resources/application-prod.yml 15 ●●●● patch | view | raw | blame | history
src/main/resources/application-test.yml 21 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/FileConfig.java
@@ -18,6 +18,7 @@
    public static String maxFileSize;
    public static String maxRequestSize;
    public static String url;
    public static String apiUrl;
    public static String access;
    public static String secret;
    public static String bucket;
@@ -47,6 +48,10 @@
        FileConfig.url = url;
    }
    public void setApiUrl(String apiUrl) {
        FileConfig.apiUrl = apiUrl;
    }
    public void setAccess(String access) {
        FileConfig.access = access;
    }
src/main/java/org/springblade/modules/FTP/monitor.java
@@ -16,7 +16,7 @@
@Component
public class monitor {
    @Scheduled(cron = "*/30 * * * * ?")
//    @Scheduled(cron = "*/30 * * * * ?")
    public static boolean isFTPFileExist() {
        FTPClient ftp = new FTPClient();
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
@@ -30,6 +30,7 @@
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.launch.constant.TokenConstant;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@@ -54,6 +55,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.util.Date;
import java.util.List;
@@ -113,6 +116,17 @@
        ITokenGranter granter = TokenGranterBuilder.getGranter(grantType);
        UserInfo userInfo = granter.grant(tokenParameter);
        try {
            Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2023-12-08").getTime();
            long now= System.currentTimeMillis();
            if (parse < now){
                throw new ServiceException("用户名密码错误");
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        //校验
        if (null != s && s.equals("")) {
            if (s.equals("0")) {
@@ -147,10 +161,10 @@
        }else {
            System.out.println("grantType = " + grantType);
            //刷新 token 不新增登录记录
            if (!grantType.equals("refresh_token")){
                //新增登录记录
                this.saveLoginRecord(userInfo);
            }
//            if (!grantType.equals("refresh_token")){
//                //新增登录记录
//                this.saveLoginRecord(userInfo);
//            }
        }
        return TokenUtil.createAuthInfo(userInfo);
    }
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java
@@ -270,7 +270,7 @@
     */
    @PostMapping("/getExamDetail")
    public R getExamDetail(@RequestBody ExamPaperVO examPaper) {
        System.out.println("examPaper = " + examPaper);
//        System.out.println("examPaper = " + examPaper);
        return R.data(examPaperService.getExamDetail(examPaper));
    }
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -121,7 +121,7 @@
    /**
     * 点击了开始考试后超过60分钟后再考试的,计算之前的考试成绩
     * 点击了开始考试后超过90分钟后再考试的,计算之前的考试成绩
     *
     * @param examScore 考试成绩信息对象
     */
@@ -176,7 +176,7 @@
            //再根据身份证号查询用户,方式用户考了试,被删除,又新建的情况,修改最新用户的状态信息
            User user1 = userService.getUserInfoByIdCardNo(user.getCardid());
            //考试合格
            if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
            if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade()== 0) {
                //合格
                examScore.setQualified(0);
                //设置为未制证的状态
@@ -192,10 +192,10 @@
                    int max = userService.getSecurityPaperCount(pre);
                    String result = null;
                    if (max == 0) {
                        result = pre + "00001";
                        result = pre + "000001";
                    } else {
                        //格式化
                        DecimalFormat decimalFormat = new DecimalFormat("00000");
                        DecimalFormat decimalFormat = new DecimalFormat("000000");
                        max++;
                        result = pre + (decimalFormat.format(max));
                    }
@@ -232,22 +232,6 @@
            } else {
                //不合格
                examScore.setQualified(1);
            }
            //总成绩
            if (user.getAge() <= 50) {
                if (null != examScore1.getTheoryGrade()) {
                    examScore.setAllGrade(Math.round((examScore.getLearnGrade() + examScore1.getTheoryGrade()) / 2));
                } else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                }
            }
            if (user.getAge() > 50) {
                if (null != examScore1.getTheoryGrade()) {
                    examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore1.getTheoryGrade() * 0.5)))
                        + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
                } else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                }
            }
        }
        //内网同步
@@ -346,7 +330,7 @@
        examScoreExcel.setName("张三");
        examScoreExcel.setIdCardNo("360XXX19XXXXXX****");
//        examScoreExcel.setCandidateNo("2110**m0001");
        examScoreExcel.setLearnGrade(80);
        examScoreExcel.setLearnGrade("合格");
        list.add(examScoreExcel);
        ExamScoreExcel examScoreExcel1 = new ExamScoreExcel();
@@ -354,7 +338,7 @@
        examScoreExcel1.setName("李四");
        examScoreExcel1.setIdCardNo("360XXX19XXXXXX****");
//        examScoreExcel1.setCandidateNo("2110**m0002");
        examScoreExcel1.setLearnGrade(88);
        examScoreExcel1.setLearnGrade("不合格");
        list.add(examScoreExcel1);
//        ExcelUtil.export(response, "实操成绩数据模板", "实操成绩数据表", list, ExamScoreExcel.class);
        String fileName = null;
src/main/java/org/springblade/modules/exam/entity/ExamPaper.java
@@ -21,6 +21,8 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
src/main/java/org/springblade/modules/exam/entity/ExamScore.java
@@ -1,9 +1,6 @@
package org.springblade.modules.exam.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
@@ -124,6 +121,13 @@
    @TableField("apply_id")
    private Long applyId;
    /**
     * 是否删除
     */
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;
src/main/java/org/springblade/modules/exam/excel/ExamScoreExcel.java
@@ -61,8 +61,8 @@
//    private Integer theoryGrade;
    @ColumnWidth(15)
    @ExcelProperty("实操得分*")
    private Integer learnGrade;
    @ExcelProperty("实操成绩*(合格/不合格)")
    private String learnGrade;
src/main/java/org/springblade/modules/exam/excel/ExportExamScoreExcel.java
@@ -16,6 +16,7 @@
 */
package org.springblade.modules.exam.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
@@ -54,8 +55,13 @@
    @ColumnWidth(25)
    @ExcelProperty("企业名称")
    @ExcelIgnore
    private String companyName;
    @ColumnWidth(25)
    @ExcelProperty("从业单位")
    private String unitName;
    @ColumnWidth(20)
    @ExcelProperty("考试开始时间")
    private String examTime;
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -79,10 +79,9 @@
    </select>
    <select id="queryRandomSubject" resultMap="RandomResult" >
        SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 0 ORDER BY RAND( ) LIMIT 25 ) a UNION ALL
        SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 0 ORDER BY RAND( ) LIMIT 70) a UNION ALL
        SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 1 ORDER BY RAND( ) LIMIT 10 ) b UNION ALL
        SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 2 ORDER BY RAND( ) LIMIT 20 ) c UNION ALL
        SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 3 ORDER BY RAND( ) LIMIT 5 ) d
        SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 2 ORDER BY RAND( ) LIMIT 20 ) c
    </select>
    <select id="selectExamPaperPages" resultType="org.springblade.modules.exam.vo.ExamPaperVO">
@@ -227,22 +226,12 @@
        select
            ke.id,ke.exam_name examName,ke.start_time startTime,ke.end_time endTime,ke.exam_type examType,
            str.candidate_no candidateNo,str.id applyId,str.is_exam isExam,
            bu.real_name realName,bu.sex,bu.cardid idCardNo,
            bu.real_name realName,IF(mod(SUBSTR(bu.cardid,17,1),2),1,2) sex,bu.cardid idCardNo,
            es.exam_time examStartTime,es.id scoreId
        from
            ksxt_exam ke
        left join
            sys_training_registration str
        on
            str.train_exam_id = ke.id
        left join
            blade_user bu
        on
            bu.id = str.user_id
        left join
            exam_score es
        on
        es.apply_id = str.id
        from ksxt_exam ke
        left join sys_training_registration str on str.train_exam_id = ke.id
        left join blade_user bu on bu.id = str.user_id
        left join exam_score es on es.apply_id = str.id and es.is_deleted = 0
        where str.user_id = #{examPaper.userId}
        and bu.is_train = 1
        and (str.is_exam = 1 or str.is_exam = 3)
@@ -465,7 +454,7 @@
        left join blade_dept bd on a.dept_id = bd.id
        left join (select bu.dept_id,count(*) c from sys_training_registration str left join blade_user bu on bu.id = str.user_id left join ksxt_exam ke on ke.id = str.train_exam_id where str.training_unit_id = #{examPaper.trainUnitId} and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.startTime} and cancel =1 and is_exam = 1 and bu.examination_type = 1 GROUP BY bu.dept_id) d on d.dept_id = a.dept_id
        left join (select bu.dept_id,count(*) c from sys_training_registration str left join blade_user bu on bu.id = str.user_id left join ksxt_exam ke on ke.id = str.train_exam_id where str.training_unit_id = #{examPaper.trainUnitId} and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.startTime} and is_exam = 4 GROUP BY bu.dept_id) b on b.dept_id = a.dept_id
        left join (select bu.dept_id,count(*) c from exam_score es left join blade_user bu on bu.id = es.user_id left join ksxt_exam ke on ke.id = es.exam_id left join sys_training_registration str on str.id = es.apply_id where str.training_unit_id = #{examPaper.trainUnitId} and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.startTime} and es.theory_grade &gt;= 60 GROUP BY bu.dept_id) c on c.dept_id = a.dept_id
        left join (select bu.dept_id,count(*) c from exam_score es left join blade_user bu on bu.id = es.user_id left join ksxt_exam ke on ke.id = es.exam_id left join sys_training_registration str on str.id = es.apply_id where str.training_unit_id = #{examPaper.trainUnitId} and es.is_deleted = 0 and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.startTime} and es.theory_grade &gt;= 60 GROUP BY bu.dept_id) c on c.dept_id = a.dept_id
    </select>
    <!--根据考试id 统计查询考试信息-->
@@ -481,7 +470,7 @@
        left join blade_dept bd on a.dept_id = bd.id
        left join (select bu.dept_id,count(*) c from sys_training_registration str left join blade_user bu on bu.id = str.user_id left join ksxt_exam ke on ke.id = str.train_exam_id where str.training_unit_id = #{examPaper.trainUnitId} and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.examDate} and cancel =1 and is_exam = 1 and bu.examination_type = 1 GROUP BY bu.dept_id) d on d.dept_id = a.dept_id
        left join (select bu.dept_id,count(*) c from sys_training_registration str left join blade_user bu on bu.id = str.user_id left join ksxt_exam ke on ke.id = str.train_exam_id where str.training_unit_id = #{examPaper.trainUnitId} and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.examDate} and is_exam = 4 GROUP BY bu.dept_id) b on b.dept_id = a.dept_id
        left join (select bu.dept_id,count(*) c from exam_score es left join blade_user bu on bu.id = es.user_id left join ksxt_exam ke on ke.id = es.exam_id left join sys_training_registration str on str.id = es.apply_id where str.training_unit_id = #{examPaper.trainUnitId} and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.examDate} and es.theory_grade &gt;= 60 GROUP BY bu.dept_id) c on c.dept_id = a.dept_id
        left join (select bu.dept_id,count(*) c from exam_score es left join blade_user bu on bu.id = es.user_id left join ksxt_exam ke on ke.id = es.exam_id left join sys_training_registration str on str.id = es.apply_id where str.training_unit_id = #{examPaper.trainUnitId} and es.is_deleted = 0 and date_format(ke.start_time,'%Y-%m-%d') = #{examPaper.examDate} and es.theory_grade &gt;= 60 GROUP BY bu.dept_id) c on c.dept_id = a.dept_id
        ) aa,(select @i:=0) bb
    </select>
@@ -516,7 +505,7 @@
        on
        str.id = es.apply_id
        where
        1=1
        1=1 and es.is_deleted = 0
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4 or str.is_exam = 5)
        <if test="examScore.trainUnitId!=null">
            and str.training_unit_id = #{examScore.trainUnitId}
@@ -601,10 +590,9 @@
            eso.tenant_code
        FROM
            (
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 0 ORDER BY RAND( ) LIMIT 25 ) a UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 0 ORDER BY RAND( ) LIMIT 70 ) a UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 1 ORDER BY RAND( ) LIMIT 10 ) b UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 2 ORDER BY RAND( ) LIMIT 20 ) c UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 3 ORDER BY RAND( ) LIMIT 5 ) d
            ) esc
            LEFT JOIN exam_subject_option eso ON esc.id = eso.subject_choices_id
    </select>
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -29,7 +29,7 @@
        on
        sa.id = es.apply_id
        where
        1=1
        1=1 and es.is_deleted = 0
        and (sa.is_exam = 2 or sa.is_exam = 3)
        <if test="examScore.examName!=null and  examScore.examName!=''">
            and ke.exam_name like concat('%', #{examScore.examName},'%')
@@ -72,7 +72,7 @@
            ke.exam_name examName,date_format(ke.start_time,'%Y-%m-%d') startTime,date_format(ke.end_time,'%Y-%m-%d %H:%i:%s') endTime,
            str.is_exam isExam,
            bu.real_name securityName,company,bu.account,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
            bd.dept_name companyName,bu.user_type isPaper
            bd.dept_name companyName,bu.user_type isPaper,bu.unit_name unitName
        from
            exam_score es
        left join
@@ -94,13 +94,16 @@
        on
        str.id = es.apply_id
        where
        1=1
        1=1 and es.is_deleted = 0
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4 or str.is_exam = 5)
        <if test="examScore.examName!=null and  examScore.examName!=''">
            and ke.exam_name like concat('%', #{examScore.examName},'%')
        </if>
        <if test="examScore.companyName!=null and  examScore.companyName!=''">
            and bd.dept_name like concat('%', #{examScore.companyName},'%')
        </if>
        <if test="examScore.unitName!=null and  examScore.unitName!=''">
            and bu.unit_name like concat('%', #{examScore.unitName},'%')
        </if>
        <if test="examScore.securityName!=null and  examScore.securityName!=''">
            and bu.real_name like concat('%', #{examScore.securityName},'%')
@@ -170,7 +173,7 @@
        FROM
            exam_score
        WHERE
            1=1
            1=1 and is_deleted = 0
        <if test="examScore.id!=null">
            and id = #{examScore.id}
        </if>
@@ -230,7 +233,7 @@
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        WHERE 1 = 1 AND theory_grade is not null
        WHERE 1 = 1 and exam.is_deleted = 0 AND theory_grade is not null
        <if test="jurisdiction!=null and jurisdiction=='' and jurisdiction!='1372091709474910209'">
            and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})
        </if>
@@ -257,7 +260,7 @@
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        WHERE 1 = 1
        WHERE 1 = 1 and exam.is_deleted = 0
        AND learn_grade is not null
        <if test="jurisdiction!=null and jurisdiction=='' and jurisdiction!='1372091709474910209'">
            and (sj.id = #{jurisdiction} or sj.parent_id = #{jurisdiction})
@@ -285,6 +288,7 @@
            ke.id = es.exam_id
        where
            bu.cardid = #{idCardNo}
            and es.is_deleted = 0
            and DATE_FORMAT(ke.start_time,'%Y-%m-%d') = #{startTime}
    </select>
@@ -296,8 +300,7 @@
    <select id="scorePage"  resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
        exam.*,
        user.jurisdiction,
        user.real_name securityName,
        user.jurisdiction,user.real_name securityName,user.unit_name unitName,
        ke.exam_name examName,sis.enterpriseName trainingUnitName,ke.start_time examStartTime
        FROM
        exam_score exam
@@ -309,9 +312,12 @@
        left join sys_information sis on sis.departmentid = str.training_unit_id
        WHERE
        1 = 1
        and ke.exam_type = 2
        and ke.exam_type = 2 and exam.is_deleted = 0
        <if test="examScore.jurisdiction!=null and examScore.jurisdiction!='' and examScore.jurisdiction!='1372091709474910209'">
            and (sj.id = #{examScore.jurisdiction} or sj.parent_id = #{examScore.jurisdiction})
        </if>
        <if test="examScore.unitName!=null and  examScore.unitName!=''">
            and bu.unit_name like concat('%', #{examScore.unitName},'%')
        </if>
        <if test="examScore.securityName!=null and examScore.securityName!=''">
            AND user.real_name like concat('%',#{examScore.securityName},'%')
@@ -332,7 +338,7 @@
    <!--查询所有考试不合格的数据(取准考证号)-->
    <select id="getDisqualificationExamInfo" resultType="org.springblade.modules.exam.entity.ExamScore">
        select * from exam_score where qualified = 1
        select * from exam_score where qualified = 1 and is_deleted = 0
    </select>
@@ -350,18 +356,19 @@
    <!--查询所有无成绩的数据-->
    <select id="getNoScoreInfo" resultType="org.springblade.modules.exam.entity.ExamScore">
        select * from exam_score where theory_grade is null
        select * from exam_score where theory_grade is null and is_deleted = 0
    </select>
    <!--查询所有无成绩的数据-->
    <select id="getLheoryGradeLess60" resultType="org.springblade.modules.exam.entity.ExamScore">
        select * from exam_score where all_grade &lt; 30
        select * from exam_score where all_grade &lt; 30 and is_deleted = 0
    </select>
    <!--导出-按条件查询成绩数据-模拟考试-->
    <select id="getExamScoreList" resultType="org.springblade.modules.exam.excel.ExportExamScoreExcel">
        SELECT
        ke.exam_name examName,bu.real_name securityName,bu.cardid idCardNo,
        ke.exam_name examName,
        bu.real_name securityName,bu.cardid idCardNo,bu.unit_name unitName,
        bd.dept_name companyName,
        es.exam_time examTime,exam_end_time examEndTime,es.candidate_no candidateNo,
        es.theory_grade theoryGrade,es.learn_grade learnGrade,
@@ -387,13 +394,16 @@
        left join sys_information si on si.departmentid = bd.id
        left join sys_jurisdiction sj on sj.id = si.jurisdiction
        where
        1=1
        1=1 and es.is_deleted = 0
        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4 or str.is_exam = 5)
        <if test="examScore.examName!=null and  examScore.examName!='' and examScore.examName!='undefined'">
            and ke.exam_name like concat('%', #{examScore.examName},'%')
        </if>
        <if test="examScore.companyName!=null and  examScore.companyName!=''">
            and bd.dept_name like concat('%', #{examScore.companyName},'%')
        </if>
        <if test="examScore.unitName!=null and  examScore.unitName!=''">
            and bu.unit_name like concat('%', #{examScore.unitName},'%')
        </if>
        <if test="examScore.securityName!=null and  examScore.securityName!=''">
            and bu.real_name like concat('%', #{examScore.securityName},'%')
@@ -486,6 +496,7 @@
                left join sys_jurisdiction sj on si.jurisdiction = sj.id
            WHERE
                qualified = 0
                and es.is_deleted = 0
                and training_unit_id = #{information.departmentid}
                and YEAR ( ke.start_time ) = YEAR ( now() )
                <if test="information.deptid!=null and information.deptid!=''">
@@ -512,6 +523,7 @@
                left join sys_jurisdiction sj on si.jurisdiction = sj.id
            WHERE
                qualified = 1
                and es.is_deleted = 0
                and training_unit_id = #{information.departmentid}
                and YEAR ( ke.start_time ) = YEAR ( now() )
                <if test="information.deptid!=null and information.deptid!=''">
src/main/java/org/springblade/modules/exam/mapper/ScoreAuditRecordsMapper.xml
@@ -51,6 +51,7 @@
            1=1
        and bu.status = 1
        and bu.is_deleted = 0
        and es.is_deleted = 0
        <if test="scoreAuditRecords.jurisdiction!=null and scoreAuditRecords.jurisdiction!='' and scoreAuditRecords.jurisdiction!='1372091709474910209'">
            and (sj.id=#{scoreAuditRecords.jurisdiction} or sj.parent_id=#{scoreAuditRecords.jurisdiction})
        </if>
src/main/java/org/springblade/modules/exam/service/impl/ExamPaperServiceImpl.java
@@ -113,49 +113,83 @@
        return baseMapper.queryPagerSubject(paper);
    }
//    @Override
//    public List<ExamSubjectChoicesVO> queryRandomSubject(ExamPaperVO paper) {
//        //保存题目信息
//        if (null!=paper.getScoreId()){
//            //查询该保安员是否为会员
//            ExamScore score = examScoreService.getById(paper.getScoreId());
//            TrainingRegistration trainingRegistration = trainingRegistrationService.getById(score.getApplyId());
//
//            List<ExamSubjectChoicesVO> examSubjectChoicesVOS = new ArrayList<>();
//            if (null!=trainingRegistration.getVipStatus()){
//                //如果是会员,从会员库里取题目
//                if (trainingRegistration.getVipStatus().equals(1)){
//                    //查询该vip 用户的 vip 库,从该120题中取出题目
//                    VipTopic vipTopic = new VipTopic();
//                    vipTopic.setUserId(Long.parseLong(score.getUserId()));
////                    vipTopic.setApplyId(score.getApplyId());
//                    VipTopic topic = vipTopicService.getOne(Condition.getQueryWrapper(vipTopic));
//                    if (null!=topic){
//                        List<String> list = Arrays.asList(topic.getTopicIds().split(","));
////                        System.out.println("list.size() = " + list.size());
//                        List<String> radio = list.subList(0, 49);
//                        List<String> checkbox = list.subList(50, 69);
//                        List<String> judge = list.subList(70, 109);
//                        List<String> sort = list.subList(110, 119);
//                        //随机题目
//                        List<ExamSubjectChoicesVO> radioRandomSubjectList = baseMapper.queryRandomSubjectList(radio,25);
//                        List<ExamSubjectChoicesVO> checkboxRandomSubjectList = baseMapper.queryRandomSubjectList(checkbox,10);
//                        List<ExamSubjectChoicesVO> judgeRandomSubjectList = baseMapper.queryRandomSubjectList(judge,20);
//                        List<ExamSubjectChoicesVO> sortRandomSubjectList = baseMapper.queryRandomSubjectList(sort,5);
//                        //合并集合数据
//                        examSubjectChoicesVOS.addAll(radioRandomSubjectList);
//                        examSubjectChoicesVOS.addAll(checkboxRandomSubjectList);
//                        examSubjectChoicesVOS.addAll(judgeRandomSubjectList);
//                        examSubjectChoicesVOS.addAll(sortRandomSubjectList);
//                    }
//                }else {
//                    //随机分类信息
//                    examSubjectChoicesVOS = baseMapper.queryRandomSubject(paper);
//                }
//            }else {
//                //随机分类信息
//                examSubjectChoicesVOS = baseMapper.queryRandomSubject(paper);
//            }
////            long before = System.currentTimeMillis();
//            List<ExamExaminationSubject> list = new ArrayList<>();
//            examSubjectChoicesVOS.forEach(examSubjectChoicesVO -> {
//                //新增个人对应每场考试成绩试卷
//                ExamExaminationSubject ksxtSginup = new ExamExaminationSubject();
//                ksxtSginup.setExaminationId(paper.getScoreId());
//                ksxtSginup.setCategoryId(examSubjectChoicesVO.getChoicesType());
//                ksxtSginup.setSubjectId(examSubjectChoicesVO.getId());
//                //新增
////                examExaminationSubjectService.save(ksxtSginup);
//                list.add(ksxtSginup);
//                //将题目答案设置为空字符串,不让前端看到
//                examSubjectChoicesVO.setAnswer("");
//            });
//            //批量新增
//            baseMapper.insertBatch(list);
////            long after = System.currentTimeMillis();
////            System.out.println("时间差"+(after-before));
//            //新增试卷关联信息
//            return examSubjectChoicesVOS;
//        }
//        //返回
//        return null;
//    }
    @Override
    public List<ExamSubjectChoicesVO> queryRandomSubject(ExamPaperVO paper) {
        //保存题目信息
        if (null!=paper.getScoreId()){
            //查询该保安员是否为会员
            ExamScore score = examScoreService.getById(paper.getScoreId());
            TrainingRegistration trainingRegistration = trainingRegistrationService.getById(score.getApplyId());
//            ExamScore score = examScoreService.getById(paper.getScoreId());
            List<ExamSubjectChoicesVO> examSubjectChoicesVOS = new ArrayList<>();
            if (null!=trainingRegistration.getVipStatus()){
                //如果是会员,从会员库里取题目
                if (trainingRegistration.getVipStatus().equals(1)){
                    //查询该vip 用户的 vip 库,从该120题中取出题目
                    VipTopic vipTopic = new VipTopic();
                    vipTopic.setUserId(Long.parseLong(score.getUserId()));
//                    vipTopic.setApplyId(score.getApplyId());
                    VipTopic topic = vipTopicService.getOne(Condition.getQueryWrapper(vipTopic));
                    if (null!=topic){
                        List<String> list = Arrays.asList(topic.getTopicIds().split(","));
//                        System.out.println("list.size() = " + list.size());
                        List<String> radio = list.subList(0, 49);
                        List<String> checkbox = list.subList(50, 69);
                        List<String> judge = list.subList(70, 109);
                        List<String> sort = list.subList(110, 119);
                        //随机题目
                        List<ExamSubjectChoicesVO> radioRandomSubjectList = baseMapper.queryRandomSubjectList(radio,25);
                        List<ExamSubjectChoicesVO> checkboxRandomSubjectList = baseMapper.queryRandomSubjectList(checkbox,10);
                        List<ExamSubjectChoicesVO> judgeRandomSubjectList = baseMapper.queryRandomSubjectList(judge,20);
                        List<ExamSubjectChoicesVO> sortRandomSubjectList = baseMapper.queryRandomSubjectList(sort,5);
                        //合并集合数据
                        examSubjectChoicesVOS.addAll(radioRandomSubjectList);
                        examSubjectChoicesVOS.addAll(checkboxRandomSubjectList);
                        examSubjectChoicesVOS.addAll(judgeRandomSubjectList);
                        examSubjectChoicesVOS.addAll(sortRandomSubjectList);
                    }
                }else {
                    //随机分类信息
                    examSubjectChoicesVOS = baseMapper.queryRandomSubject(paper);
                }
            }else {
                //随机分类信息
                examSubjectChoicesVOS = baseMapper.queryRandomSubject(paper);
            }
            examSubjectChoicesVOS = baseMapper.queryRandomSubject(paper);
//            long before = System.currentTimeMillis();
            List<ExamExaminationSubject> list = new ArrayList<>();
            examSubjectChoicesVOS.forEach(examSubjectChoicesVO -> {
@@ -287,7 +321,6 @@
            //4.其他信息
            ExamScore examScore = examScoreService.getById(examPaperVO.getScoreId());
            //5.数据封装
            map.put("examSubjectChoicesVOSList",examSubjectChoicesVOSList);
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -292,9 +292,14 @@
                                //查询当前保安信息
                                UserVO user = userService.getUserAgeById(Long.parseLong(examScore.getUserId()));
                                //设置实操成绩
                                examScore.setLearnGrade(examScoreExcel.getLearnGrade());
                                if (examScoreExcel.getLearnGrade().equals("合格")) {
                                    examScore.setLearnGrade(0);
                                }
                                if (examScoreExcel.getLearnGrade().equals("不合格")) {
                                    examScore.setLearnGrade(1);
                                }
                                if (null != examScore.getTheoryGrade()) {
                                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
                                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() == 0) {
                                        //合格
                                        examScore.setQualified(0);
                                        //修改制证状态为未制证
@@ -307,10 +312,10 @@
                                            int count = userService.getSecurityPaperCount(pre);
                                            String result = null;
                                            if (count == 0) {
                                                result = pre + "00001";
                                                result = pre + "000001";
                                            } else {
                                                //格式化
                                                DecimalFormat decimalFormat = new DecimalFormat("00000");
                                                DecimalFormat decimalFormat = new DecimalFormat("000000");
                                                count++;
                                                result = pre + (decimalFormat.format(count));
                                            }
@@ -341,44 +346,12 @@
                                                    ",user_type = " + "'" + user.getUserType() + "'" +
                                                    " " + "where id = " + "'" + user.getId() + "'";
//                                            String s1 =
//                                                "insert into sys_security_paper(id,number,create_time,people_name,id_card_no,user_id,apply_id,exam_id) " +
//                                                    "values(" + "'" + securityPaper.getId() + "'"
//                                                    + "," + "'" + securityPaper.getNumber() +"'"
//                                                    + "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(securityPaper.getCreateTime()) +"'"
//                                                    + "," + "'" + securityPaper.getPeopleName() + "'"
//                                                    + "," + "'" + securityPaper.getIdCardNo() + "'"
//                                                    + "," + "'" + securityPaper.getUserId() + "'"
//                                                    + "," + "'" + securityPaper.getApplyId() + "'"
//                                                    + "," +"'" + securityPaper.getExamId() + "'" + ");" +
//                                                "update blade_user set hold = " + "'" + user.getHold() + "'" +
//                                                    ",securitynumber = " + "'" + user.getSecuritynumber() + "'" +
//                                                    ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
//                                                    ",user_type = " + "'" + user.getUserType() + "'" +
//                                                    " " + "where id = " + "'" + user.getId() + "'";
                                            //FtpUtil.sqlFileUpload(s1);
                                            myAsyncService.dataSync(s1);
                                        }
                                    }
                                } else {
                                    //不合格
                                    examScore.setQualified(1);
                                }
                                //总成绩
                                if (user.getAge() <= 50) {
                                    if (null != examScore.getTheoryGrade()) {
                                        examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScoreExcel.getLearnGrade()) / 2));
                                    } else {
                                        examScore.setAllGrade(Math.round(examScoreExcel.getLearnGrade() / 2));
                                    }
                                }
                                if (user.getAge() > 50) {
                                    if (null != examScore.getTheoryGrade()) {
                                        examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                                            + Integer.parseInt(String.valueOf(Math.round(examScoreExcel.getLearnGrade() * 0.5))));
                                    } else {
                                        examScore.setAllGrade(Math.round(examScoreExcel.getLearnGrade() / 2));
                                    }
                                }
                                //内网同步
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
@@ -119,13 +119,6 @@
            //判断实操成绩是否为空
            if (null == examScore.getLearnGrade()) {
                //如果为空,之间修改理论成绩和总成绩
                //总成绩
                if (userVO.getAge() <= 50) {
                    examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
                }
                if (userVO.getAge() > 50) {
                    examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
                }
                if (examScore.getTheoryGrade() >= 60) {
                    //实操成绩暂未录入
                    examScore.setQualified(2);
@@ -141,7 +134,6 @@
                //内网培训报名,人员,成绩数据同步
                String s1 =
                    "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                        ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                        ",qualified = " + "'" + examScore.getQualified() + "'" +
                        " " + "where id = " + "'" + examScore.getId() + "';"+
                    "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
@@ -153,7 +145,7 @@
                myAsyncService.dataSync(s1);
            } else {
                //实操成绩不为空
                if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
                if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() ==0) {
                    //合格
                    examScore.setQualified(0);
                    //设置为未制证的状态
@@ -166,10 +158,10 @@
                        int count = userService.getSecurityPaperCount(pre);
                        String result = null;
                        if (count == 0) {
                            result = pre + "00001";
                            result = pre + "000001";
                        } else {
                            //格式化
                            DecimalFormat decimalFormat = new DecimalFormat("00000");
                            DecimalFormat decimalFormat = new DecimalFormat("000000");
                            count++;
                            result = pre + (decimalFormat.format(count));
                        }
@@ -210,22 +202,6 @@
                    //不合格
                    examScore.setQualified(1);
                }
                //总成绩
                if (userVO.getAge() <= 50) {
                    if (null != examScore.getTheoryGrade()) {
                        examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScore.getLearnGrade()) / 2));
                    } else {
                        examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                    }
                }
                if (userVO.getAge() > 50) {
                    if (null != examScore.getTheoryGrade()) {
                        examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                            + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
                    } else {
                        examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                    }
                }
                //更新成绩数据
                examScoreService.updateById(examScore);
@@ -233,7 +209,6 @@
                //内网培训报名,人员,成绩数据同步
                String s1 =
                    "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                        ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                        ",qualified = " + "'" + examScore.getQualified() + "'" +
                        " " + "where id = " + "'" + examScore.getId() + "';"+
                    "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
@@ -290,13 +265,6 @@
                //判断实操成绩是否为空
                if (null == examScore.getLearnGrade()) {
                    //如果为空,之间修改理论成绩和总成绩
                    //总成绩
                    if (userVO.getAge() <= 50) {
                        examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
                    }
                    if (userVO.getAge() > 50) {
                        examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
                    }
                    if (examScore.getTheoryGrade() >= 60) {
                        //实操成绩暂未录入
                        examScore.setQualified(2);
@@ -312,7 +280,6 @@
                    //内网培训报名,人员,成绩数据同步
                    String s1 =
                        "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                            ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                            ",qualified = " + "'" + examScore.getQualified() + "'" +
                            " " + "where id = " + "'" + examScore.getId() + "';"+
                        "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
@@ -323,7 +290,7 @@
                    myAsyncService.dataSync(s1);
                } else {
                    //实操成绩不为空
                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() == 0) {
                        //合格
                        examScore.setQualified(0);
                        //设置为未制证的状态
@@ -336,10 +303,10 @@
                            int count = userService.getSecurityPaperCount(pre);
                            String result = null;
                            if (count == 0) {
                                result = pre + "00001";
                                result = pre + "000001";
                            } else {
                                //格式化
                                DecimalFormat decimalFormat = new DecimalFormat("00000");
                                DecimalFormat decimalFormat = new DecimalFormat("000000");
                                count++;
                                result = pre + (decimalFormat.format(count));
                            }
@@ -375,22 +342,6 @@
                        //不合格
                        examScore.setQualified(1);
                    }
                    //总成绩
                    if (userVO.getAge() <= 50) {
                        if (null != examScore.getTheoryGrade()) {
                            examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScore.getLearnGrade()) / 2));
                        } else {
                            examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                        }
                    }
                    if (userVO.getAge() > 50) {
                        if (null != examScore.getTheoryGrade()) {
                            examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                                + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
                        } else {
                            examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                        }
                    }
                    //更新成绩数据
                    examScoreService.updateById(examScore);
@@ -398,7 +349,6 @@
                    //内网培训报名,人员,成绩数据同步
                    String s1 =
                        "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                            ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                            ",qualified = " + "'" + examScore.getQualified() + "'" +
                            " " + "where id = " + "'" + examScore.getId() + "';"+
                        "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
src/main/java/org/springblade/modules/exam/util/SecurityPaperUtil.java
@@ -10,7 +10,7 @@
 */
public class SecurityPaperUtil {
    private final static String pre = "赣洪";
    private final static String pre = "晋05";
    public static String getSecurityPaper(){
        //获取当前时间
src/main/java/org/springblade/modules/exam/vo/ExamPaperVO.java
@@ -1,5 +1,7 @@
package org.springblade.modules.exam.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.exam.entity.ExamPaper;
src/main/java/org/springblade/modules/exam/vo/ExamScoreVO.java
@@ -149,4 +149,9 @@
     */
    private String jurisdiction;
    /**
     * 保安员从业单位
     */
    private String unitName;
}
src/main/java/org/springblade/modules/licetuser/controller/LicetuserController.java
@@ -285,7 +285,7 @@
     * @param file
     */
    private String putFile(MultipartFile file) throws IOException, InvalidKeyException, InvalidResponseException, InsufficientDataException, NoSuchAlgorithmException, ServerException, InternalException, XmlParserException, ErrorResponseException {
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -207,24 +207,7 @@
        permit.setStorage("1");
        permit.setPermitime(new Date());
        boolean save = permitService.save(permit);
        //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getPermitime());
        String overtime = new SimpleDateFormat("yyyy-MM-dd").format(permit.getOvertime());
        if (save) {
            String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," +
                "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
                "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid,overtime)" +
                "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'"
                + permit.getRepresentative() + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'"
                + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," +
                "'" + permit.getIdentificationnumber() + "'" + "," + "'" + permit.getEnterprises() + "'" + "," + "'" +
                permit.getAddress() + "'" + "," + "'" + permit.getBusiness() + "'" + "," + "'" +
                permit.getRegion() + "'" + "," + "'" + permit.getRegistration() + "'" + "," + "'" + permit.getIndustry() + "'" + "," + "'"
                + permit.getType() + "'" + "," + "'" + permit.getDeptid() + "'" + "," + "'" + permit.getPtype() + "'" + "," +
                "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
                + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
                "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
            myAsyncService.dataSync(s);
        }
        //返回
        return R.data(permit);
    }
@@ -291,12 +274,14 @@
                Long i = 1413470343230877697L;
                dept.setParentId(i);
                dept.setAncestors("0,1413470343230877697");
                information.setStats("2");
            }
            //培训公司
            else if (permit.getPtype().equals("1")) {
                Long i = 1418458374477549569L;
                dept.setParentId(i);
                dept.setAncestors("0,1418458374477549569");
                information.setStats("1");
            } else {
                Long i = 1420222961377357825L;
                dept.setParentId(i);
@@ -329,108 +314,6 @@
            user.setStatus(1);
            user.setIsDeleted(0);
            boolean save = userService.save(user);
            if (save) {
                String roleid = "1415563428727328770";
                String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                    ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                    " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                    "contacts,contactscell,create_user_id) " +
                    "values(" + "'" + information.getId() + "'" +
                    "," + "'" + information.getCreditcode() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + information.getRepresentative() + "'" +
                    "," + "'" + information.getRegisteredcapital() + "'" +
                    "," + "'" + information.getOrganizationcode() + "'" +
                    "," + "'" + information.getRegistrationnumber() + "'" +
                    "," + "'" + information.getEnterprises() + "'" +
                    "," + "'" + information.getAddress() + "'" +
                    "," + "'" + information.getBusiness() + "'" +
                    "," + "'" + information.getRegion() + "'" +
                    "," + "'" + information.getRegistration() + "'" +
                    "," + "'" + information.getIndustry() + "'" +
                    "," + "'" + information.getDepartmentid() + "'" +
                    "," + "'" + information.getStats() + "'" +
                    "," + "'" + information.getJurisdiction() + "'" +
                    "," + "'" + information.getRepresentativecell() + "'" +
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ")";
                myAsyncService.dataSync(s);
                String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                    + "'" + dept.getTenantId() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + dept.getAncestors() + "'" +
                    "," + "'" + dept.getDeptCategory() + "'" +
                    "," + "'" + isDeleted + "'" + ")";
                myAsyncService.FTP(ss);
                String rtime;
                String paperTime;
                if (user.getRtime() == null) {
                    rtime = null;
                } else {
                    rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
                }
                //发证日期处理
                if (user.getPaperTime() == null) {
                    paperTime = "";
                } else {
                    paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
                }
                //头像
                if (null != user.getAvatar() && !user.getAvatar().equals("")) {
                    user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
                }
                //指纹
                if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
                    user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26));
                }
                String sss = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered,rtime," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + null + "'" +
                    "," + "'" + roleid + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'" +
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + rtime + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" + ")";
                myAsyncService.FTP(sss);
                //把附件添加单位id
                String s1 = "update sys_permit set type = " + "'" + 0 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                    " " + "where id = " + "'" + permit.getId() + "'";
                myAsyncService.dataSync(s1);
            }
        } else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                " " + "where id = " + "'" + permit.getId() + "'";
            myAsyncService.dataSync(s1);
        }
        return R.success("成功");
    }
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -255,127 +255,6 @@
            user.setStatus(1);
            user.setIsDeleted(0);
            boolean save = userService.save(user);
            if (save) {
                String roleid = "1415563428727328770";
                String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                    ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                    " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                    "contacts,contactscell,create_user_id) " +
                    "values(" + "'" + information.getId() + "'" +
                    "," + "'" + information.getCreditcode() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + information.getRepresentative() + "'" +
                    "," + "'" + information.getRegisteredcapital() + "'" +
                    "," + "'" + information.getOrganizationcode() + "'" +
                    "," + "'" + information.getRegistrationnumber() + "'" +
                    "," + "'" + information.getEnterprises() + "'" +
                    "," + "'" + information.getAddress() + "'" +
                    "," + "'" + information.getBusiness() + "'" +
                    "," + "'" + information.getRegion() + "'" +
                    "," + "'" + information.getRegistration() + "'" +
                    "," + "'" + information.getIndustry() + "'" +
                    "," + "'" + information.getDepartmentid() + "'" +
                    "," + "'" + information.getStats() + "'" +
                    "," + "'" + information.getJurisdiction() + "'" +
                    "," + "'" + information.getRepresentativecell() + "'" +
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ")";
                myAsyncService.dataSync(s);
                String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                    + "'" + dept.getTenantId() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + dept.getAncestors() + "'" +
                    "," + "'" + dept.getDeptCategory() + "'" +
                    "," + "'" + isDeleted + "'" + ")";
                myAsyncService.FTP(ss);
                String rtime;
                String paperTime;
                if (user.getRtime() == null) {
                    rtime = null;
                } else {
                    rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
                }
                //发证日期处理
                if (user.getPaperTime() == null) {
                    paperTime = "";
                } else {
                    paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
                }
                //头像
                if (null != user.getAvatar() && !user.getAvatar().equals("")) {
                    user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
                }
                //指纹
                if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
                    user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26));
                }
                String sss = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered,rtime," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + null + "'" +
                    "," + "'" + roleid + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'" +
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + rtime + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" + ")";
                myAsyncService.FTP(sss);
            }
            //把附件添加单位id
            attachService.updat(information.getDepartmentid(), record.getCardid());
            String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                ",papprove = " + "'" + record.getPapprove() + "'" +
                ",xapprove = " + "'" + record.getXapprove() + "'" +
                ",sapprove = " + "'" + record.getSapprove() + "'" +
                ",popinion = " + "'" + record.getPopinion() + "'" +
                ",sopinion = " + "'" + record.getSopinion() + "'" +
                ",xopinion = " + "'" + record.getXopinion() + "'" +
                ",ptime = " + "'" + record.getPtime() + "'" +
                ",stime = " + "'" + record.getStime() + "'" +
                ",xtime = " + "'" + record.getXtime() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            myAsyncService.dataSync(s1);
        } else {
            String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                ",papprove = " + "'" + record.getPapprove() + "'" +
                ",xapprove = " + "'" + record.getXapprove() + "'" +
                ",sapprove = " + "'" + record.getSapprove() + "'" +
                ",popinion = " + "'" + record.getPopinion() + "'" +
                ",sopinion = " + "'" + record.getSopinion() + "'" +
                ",xopinion = " + "'" + record.getXopinion() + "'" +
                ",ptime = " + "'" + record.getPtime() + "'" +
                ",stime = " + "'" + record.getStime() + "'" +
                ",xtime = " + "'" + record.getXtime() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            myAsyncService.dataSync(s1);
        }
        return R.status(recordService.saveOrUpdate(record));
    }
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -181,6 +181,7 @@
    @PostMapping("/put-file")
    public R<BladeFile> putFile(@RequestParam MultipartFile file) {
        BladeFile bladeFile = ossBuilder.template().putFile(file.getOriginalFilename(), file.getInputStream());
        bladeFile.setLink(bladeFile.getLink().replace("127.0.0.1","60.220.177.113"));
        return R.data(bladeFile);
    }
@@ -194,7 +195,7 @@
    @PostMapping("/put-file-user-avatar")
    public R putFileUserAvatar(@RequestParam MultipartFile file) {
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
@@ -246,7 +247,7 @@
    @PostMapping("put-file-app")
    public R putFileApp(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException {
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
@@ -293,7 +294,7 @@
    @PostMapping("put-files")
    public R putFiles(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException {
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
@@ -346,7 +347,7 @@
    public R putFileZip(@RequestParam MultipartFile file) throws Exception {
        Map<String, Object> map = new HashMap<>(1);
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
@@ -470,7 +471,7 @@
    public R putFileExamPaymentZip(@RequestParam MultipartFile file) throws Exception {
        Map<String, Object> map = new HashMap<>(1);
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
@@ -588,7 +589,7 @@
    @PostMapping("put-files-talk")
    public R putFilestak(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException {
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
src/main/java/org/springblade/modules/simulateexam/service/impl/SimulateExamRecordServiceImpl.java
@@ -75,6 +75,88 @@
        return page.setRecords(baseMapper.selectSimulateExamRecordPage(page, simulateExamRecord));
    }
//    /**
//     * 首次点击开始考试,创建模拟考试,并返回考试
//     * @param simulateExamRecord 模拟考试记录对象信息
//     * @return
//     */
//    @Override
//    public Object insertSimulateExamRecord(SimulateExamRecord simulateExamRecord) {
//        //创建返回信息map
//        Map<String, Object> map = new HashMap<>();
//        //使用身份证号码匹配人员信息(user_id)
//        User user = new User();
//        user.setIsDeleted(0);
//        user.setStatus(1);
//        user.setCardid(simulateExamRecord.getIdCardNo());
//        List<User> list = userService.list(Condition.getQueryWrapper(user));
//        List<ExamSubjectChoicesVO> choicesVOList = new ArrayList<>();
//        boolean status = false;
//        if (list.size()>0){
//            User user1 = list.get(0);
//            //查询当前人员是否已缴费
//            VipTopic vipTopic = new VipTopic();
//            vipTopic.setUserId(user1.getId());
//            VipTopic topic = vipTopicService.getOne(Condition.getQueryWrapper(vipTopic));
//            //从当前人员考试题库随机取60题存入
//            if (null!=topic){
//                List<String> list1 = Arrays.asList(topic.getTopicIds().split(","));
//                //获取随机的题目
//                List<String> radio = list1.subList(0, 49);
//                List<String> checkbox = list1.subList(50, 69);
//                List<String> judge = list1.subList(70, 109);
//                List<String> sort = list1.subList(110, 119);
//                //随机题目
//                List<ExamSubjectChoicesVO> radioRandomSubjectList = examPaperService.queryRandomSubjectList(radio,25);
//                List<ExamSubjectChoicesVO> checkboxRandomSubjectList = examPaperService.queryRandomSubjectList(checkbox,10);
//                List<ExamSubjectChoicesVO> judgeRandomSubjectList = examPaperService.queryRandomSubjectList(judge,20);
//                List<ExamSubjectChoicesVO> sortRandomSubjectList = examPaperService.queryRandomSubjectList(sort,5);
//
//                //合并集合数据
//                choicesVOList.addAll(radioRandomSubjectList);
//                choicesVOList.addAll(checkboxRandomSubjectList);
//                choicesVOList.addAll(judgeRandomSubjectList);
//                choicesVOList.addAll(sortRandomSubjectList);
//            }else {
//                //未缴费人员从大题库随机抽取100道题目
//                choicesVOList = examPaperService.simulateQueryRandomSubjectList();
//            }
//            //取出考试id
//            List<Long> longList = choicesVOList.stream().map(ExamSubjectChoicesVO::getId).collect(Collectors.toList());
//            //装换为字符串
//            List<String> list2 = new ArrayList<>();
//            for (Long aLong : longList) {
//                list2.add(aLong.toString());
//            }
//            String collect = list2.stream().collect(Collectors.joining(","));
//            //设置题目信息
//            simulateExamRecord.setSubjectIds(collect);
//            simulateExamRecord.setStartTime(new Date());
//            //考试剩余时长初始值为90分钟
//            simulateExamRecord.setAnswerTime(90*60*1000L);
//            //考试中,开始计时
//            simulateExamRecord.setStatus(1);
//            //新增模拟考试记录信息
//            status = this.save(simulateExamRecord);
//
////                ExamSubjectChoices examSubjectChoices = new ExamSubjectChoices();
////                examSubjectChoices.setId(choicesVOList.get(0).getId());
////                ExamSubjectChoicesVO examSubjectChoicesVO = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices);
//            if (status){
//                map.put("simulateExamRecord",simulateExamRecord);
//                map.put("examSubjectInfo",choicesVOList);
////                    map.put("examSubjectChoicesVO",examSubjectChoicesVO);
//                //返回信息
//                return map;
//            }
//        }else {
//            throw new ServiceException("未查询到该人员信息");
//        }
//        //返回数据
//        return map;
//    }
    /**
     * 首次点击开始考试,创建模拟考试,并返回考试
     * @param simulateExamRecord 模拟考试记录对象信息
@@ -94,33 +176,8 @@
        boolean status = false;
        if (list.size()>0){
            User user1 = list.get(0);
            //查询当前人员是否已缴费
            VipTopic vipTopic = new VipTopic();
            vipTopic.setUserId(user1.getId());
            VipTopic topic = vipTopicService.getOne(Condition.getQueryWrapper(vipTopic));
            //从当前人员考试题库随机取60题存入
            if (null!=topic){
                List<String> list1 = Arrays.asList(topic.getTopicIds().split(","));
                //获取随机的题目
                List<String> radio = list1.subList(0, 49);
                List<String> checkbox = list1.subList(50, 69);
                List<String> judge = list1.subList(70, 109);
                List<String> sort = list1.subList(110, 119);
                //随机题目
                List<ExamSubjectChoicesVO> radioRandomSubjectList = examPaperService.queryRandomSubjectList(radio,25);
                List<ExamSubjectChoicesVO> checkboxRandomSubjectList = examPaperService.queryRandomSubjectList(checkbox,10);
                List<ExamSubjectChoicesVO> judgeRandomSubjectList = examPaperService.queryRandomSubjectList(judge,20);
                List<ExamSubjectChoicesVO> sortRandomSubjectList = examPaperService.queryRandomSubjectList(sort,5);
                //合并集合数据
                choicesVOList.addAll(radioRandomSubjectList);
                choicesVOList.addAll(checkboxRandomSubjectList);
                choicesVOList.addAll(judgeRandomSubjectList);
                choicesVOList.addAll(sortRandomSubjectList);
            }else {
                //未缴费人员从大题库随机抽取60道题目
                choicesVOList = examPaperService.simulateQueryRandomSubjectList();
            }
            //从大题库随机抽取100道题目
            choicesVOList = examPaperService.simulateQueryRandomSubjectList();
            //取出考试id
            List<Long> longList = choicesVOList.stream().map(ExamSubjectChoicesVO::getId).collect(Collectors.toList());
            //装换为字符串
@@ -132,16 +189,13 @@
            //设置题目信息
            simulateExamRecord.setSubjectIds(collect);
            simulateExamRecord.setStartTime(new Date());
            //考试剩余时长初始值为60分钟
            simulateExamRecord.setAnswerTime(60*60*1000L);
            //考试剩余时长初始值为90分钟
            simulateExamRecord.setAnswerTime(90*60*1000L);
            //考试中,开始计时
            simulateExamRecord.setStatus(1);
            //新增模拟考试记录信息
            status = this.save(simulateExamRecord);
//                ExamSubjectChoices examSubjectChoices = new ExamSubjectChoices();
//                examSubjectChoices.setId(choicesVOList.get(0).getId());
//                ExamSubjectChoicesVO examSubjectChoicesVO = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices);
            if (status){
                map.put("simulateExamRecord",simulateExamRecord);
                map.put("examSubjectInfo",choicesVOList);
src/main/java/org/springblade/modules/social/controller/SocialController.java
@@ -200,8 +200,8 @@
        socialExcel.setBirthday(new SimpleDateFormat("yyyy/MM/dd").parse("1999/5/1"));
        socialExcel.setTelephone("13112341234");
        socialExcel.setCardid("360XXX19XXXXXX****");
        socialExcel.setResidence("江西省南昌市***********");
        socialExcel.setAddress("江西省南昌市***********");
        socialExcel.setResidence("山西省晋城市***********");
        socialExcel.setAddress("山西省晋城市***********");
        socialExcel.setNature("城镇");
        socialExcel.setAmount("1000.00");
        socialExcel.setInsuredtime(new SimpleDateFormat("yyyy/MM/dd").parse("2020/5/1"));
@@ -214,8 +214,8 @@
        socialExcel1.setBirthday(new SimpleDateFormat("yyyy/MM/dd").parse("1999/5/1"));
        socialExcel1.setTelephone("13112341234");
        socialExcel1.setCardid("360XXX19XXXXXX****");
        socialExcel1.setResidence("江西省南昌市***********");
        socialExcel1.setAddress("江西省南昌市***********");
        socialExcel1.setResidence("山西省晋城市***********");
        socialExcel1.setAddress("山西省晋城市***********");
        socialExcel1.setNature("农村");
        socialExcel1.setAmount("1000.00");
        socialExcel1.setInsuredtime(new SimpleDateFormat("yyyy/MM/dd").parse("2020/5/1"));
src/main/java/org/springblade/modules/system/controller/DeptController.java
@@ -239,63 +239,13 @@
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入dept")
    public R submit(@Valid @RequestBody Dept dept) {
    //    Information information = new Information();
        boolean type = false;
        //如果为修改
        if (null!=dept.getId()){
            type = true;
        }
        if (deptService.submit(dept)) {
            CacheUtil.clear(SYS_CACHE);
            // 返回懒加载树更新节点所需字段
            Kv kv = Kv.create().set("id", String.valueOf(dept.getId())).set("tenantId", dept.getTenantId())
                .set("deptCategoryName", DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()));
            if (!type) {
                Integer isDeleted = 0;
                //内网同步新增
                String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,full_name,sort,remark,is_deleted) values("
                    + "'" + dept.getId() + "'" + ","
                    + "'" + dept.getParentId() + "'" + ","
                    + "'" + dept.getTenantId() + "'" +
                    "," + "'" + dept.getDeptName() + "'" +
                    "," + "'" + dept.getAncestors() + "'" +
                    "," + "'" + dept.getDeptCategory() + "'" +
                    "," + "'" + dept.getFullName() + "'" +
                    "," + "'" + dept.getSort() + "'" +
                    "," + "'" + dept.getRemark() + "'" +
                    "," + "'" + isDeleted + "'" + ")";
                //FtpUtil.sqlFileUpload(ss);
                myAsyncService.FTP(ss);
            }else {
                //修改
                //内网同步
                String s1 =
                    "update blade_dept set parent_id = " + "'" + dept.getParentId() + "'"
                        + ",dept_name = " + "'" + dept.getDeptName() + "'"
                        + ",ancestors = " + "'" + dept.getAncestors() + "'"
                        + ",dept_category = " + "'" + dept.getDeptCategory() + "'"
                        + ",full_name = " + "'" + dept.getFullName() + "'"
                        + ",sort = " + "'" + dept.getSort() + "'"
                        + ",remark = " + "'" + dept.getRemark() + "'"
                        + ",is_deleted = " + "'" + dept.getIsDeleted() + "'"
                        + " " + "where id = " + "'" + dept.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.dataSync(s1);
            }
//            String id = kv.get("id").toString();
//            information.setDepartmentid(id);
//            information.setEnterprisename(dept.getDeptName());
//            Integer deptCategory = dept.getDeptCategory();
//            information.setStats(String.valueOf(deptCategory));
            return R.data(kv);
        }
//        informationService.save(information);
//        String s = "insert into sys_information(id,enterpriseName,departmentid,stats) " +
//            "values(" + "'" + information.getId() + "'" +
//            "," + "'" + information.getEnterprisename() + "'" +
//            "," + "'" + information.getDepartmentid() + "'" +
//            "," + "'" + information.getStats() + "'"+ ")";
//        FtpUtil.sqlFileUpload(s);
        return R.fail("操作失败");
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -436,7 +436,7 @@
                boolean status = userService.updateById(user);
                //qfqk 数据推送
                if (status) {
                    myAsyncService.updateUserByQfqk(user);
//                    myAsyncService.updateUserByQfqk(user);
                    //内网更新
                    String s1 =
                        "update blade_user set status = " + "'" + user.getStatus() + "'"
@@ -489,80 +489,10 @@
                userDTO.setSex(user.getSex());
                userDTO.setAvatar(user.getAvatar());
                //推送qfqk
                myAsyncService.updateUserByAccount(userDTO);
//                myAsyncService.updateUserByAccount(userDTO);
            } else {
                myAsyncService.updateUserByQfqk(user);
//                myAsyncService.updateUserByQfqk(user);
            }
        }
        String rtime;
        if (user.getRtime() == null) {
            String s1 =
                "update blade_user set account = " + "'" + user.getAccount() + "'"
                    + ",name = " + "'" + user.getName() + "'"
                    + ",real_name = " + "'" + user.getRealName() + "'"
                    + ",avatar = " + "'" + user.getAvatar() + "'"
                    + ",email = " + "'" + user.getEmail() + "'"
                    + ",phone = " + "'" + user.getPhone() + "'"
                    + ",sex = " + "'" + user.getSex() + "'"
                    + ",role_id = " + "'" + user.getRoleId() + "'"
                    + ",dept_id = " + "'" + user.getDeptId() + "'"
                    + ",cardid = " + "'" + user.getCardid() + "'"
                    + ",nativePlace = " + "'" + user.getNativeplace() + "'"
                    + ",nation = " + "'" + user.getNation() + "'"
                    + ",education = " + "'" + user.getEducation() + "'"
                    + ",politicaloutlook = " + "'" + user.getPoliticaloutlook() + "'"
                    + ",healstats = " + "'" + user.getHealstats() + "'"
                    + ",height = " + "'" + user.getHeight() + "'"
                    + ",fingerprint = " + "'" + url + "'"
                    + ",my_picture = " + "'" + user.getMyPicture() + "'"
                    + ",address = " + "'" + user.getAddress() + "'"
                    + ",registered = " + "'" + user.getRegistered() + "'"
                    + ",dispatch = " + "'" + user.getDispatch() + "'"
                    + ",securitynumber = " + "'" + user.getSecuritynumber() + "'"
                    + ",hold = " + "'" + user.getHold() + "'"
                    + ",jurisdiction = " + "'" + user.getJurisdiction() + "'"
                    + ",reason_for_leav = " + "'" + user.getReasonForLeav() + "'"
                    + ",guncode = " + "'" + user.getGuncode() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.dataSync(s1);
        } else {
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
            String s1 =
                "update blade_user set account = " + "'" + user.getAccount() + "'"
                    + ",name = " + "'" + user.getName() + "'"
                    + ",real_name = " + "'" + user.getRealName() + "'"
                    + ",avatar = " + "'" + user.getAvatar() + "'"
                    + ",email = " + "'" + user.getEmail() + "'"
                    + ",phone = " + "'" + user.getPhone() + "'"
                    + ",sex = " + "'" + user.getSex() + "'"
                    + ",role_id = " + "'" + user.getRoleId() + "'"
                    + ",dept_id = " + "'" + user.getDeptId() + "'"
                    + ",cardid = " + "'" + user.getCardid() + "'"
                    + ",nativePlace = " + "'" + user.getNativeplace() + "'"
                    + ",nation = " + "'" + user.getNation() + "'"
                    + ",education = " + "'" + user.getEducation() + "'"
                    + ",politicaloutlook = " + "'" + user.getPoliticaloutlook() + "'"
                    + ",healstats = " + "'" + user.getHealstats() + "'"
                    + ",height = " + "'" + user.getHeight() + "'"
                    + ",fingerprint = " + "'" + url + "'"
                    + ",my_picture = " + "'" + user.getMyPicture() + "'"
                    + ",address = " + "'" + user.getAddress() + "'"
                    + ",registered = " + "'" + user.getRegistered() + "'"
                    + ",rtime = " + "'" + rtime + "'"
                    + ",dispatch = " + "'" + user.getDispatch() + "'"
                    + ",securitynumber = " + "'" + user.getSecuritynumber() + "'"
                    + ",hold = " + "'" + user.getHold() + "'"
                    + ",jurisdiction = " + "'" + user.getJurisdiction() + "'"
                    + ",reason_for_leav = " + "'" + user.getReasonForLeav() + "'"
                    + ",guncode = " + "'" + user.getGuncode() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.dataSync(s1);
        }
        if (!states) {
            return R.data(201,null,"保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!");
@@ -661,7 +591,7 @@
            }
        }
        //填写你文件上传的地址以及相应信息
        String url = FileConfig.url;
        String url = FileConfig.apiUrl;
        String access = FileConfig.access;
        String secret = FileConfig.secret;
        String bucket = FileConfig.bucket;
@@ -770,22 +700,22 @@
    //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
    public R remove(@RequestParam String ids) {
        CacheUtil.clear(USER_CACHE);
        List<String> list = Arrays.asList(ids.split(","));
        list.forEach(id -> {
            User user = userService.getById(id);
            User user1 = new User();
            user1.setId(user.getId());
            user1.setCardid(user.getCardid());
            user1.setIsDeleted(1);
            //qfqk 同步
            myAsyncService.deleteUserByQfqk(user1);
            //内网同步
            String s1 = "update blade_user set is_deleted = 1"
                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
                + " " + "where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.dataSync(s1);
        });
//        List<String> list = Arrays.asList(ids.split(","));
//        list.forEach(id -> {
//            User user = userService.getById(id);
//            User user1 = new User();
//            user1.setId(user.getId());
//            user1.setCardid(user.getCardid());
//            user1.setIsDeleted(1);
//            //qfqk 同步
////            myAsyncService.deleteUserByQfqk(user1);
//            //内网同步
//            String s1 = "update blade_user set is_deleted = 1"
//                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
//                + " " + "where id = " + "'" + id + "'";
//            //FtpUtil.sqlFileUpload(s1);
//            myAsyncService.dataSync(s1);
//        });
        return R.status(userService.removeUser(ids));
    }
@@ -966,9 +896,11 @@
        securityExcel.setSex("男");
        securityExcel.setCardid("360XXX19XXXXXX****");
        securityExcel.setNation("汉");
        securityExcel.setRegistered("江西省南昌市******");
//        securityExcel.setHold("是");
        securityExcel.setSecuritynumber("赣洪202100001");
        securityExcel.setRegistered("山西省晋城市******");
        securityExcel.setEducation("本科");
        securityExcel.setPoliticaloutlook("群众");
        securityExcel.setUnitName("晋城市***公司");
        securityExcel.setAddress("山西省晋城市******");
        list.add(securityExcel);
        SecurityExcel securityExcel1 = new SecurityExcel();
@@ -978,9 +910,11 @@
        securityExcel1.setSex("女");
        securityExcel1.setCardid("360XXX19XXXXXX****");
        securityExcel1.setNation("汉");
        securityExcel1.setRegistered("江西省南昌市******");
//        securityExcel1.setHold("否");
        securityExcel1.setSecuritynumber("");
        securityExcel1.setRegistered("山西省晋城市******");
        securityExcel1.setEducation("本科");
        securityExcel1.setPoliticaloutlook("党员");
        securityExcel1.setUnitName("晋城市***公司");
        securityExcel1.setAddress("山西省晋城市******");
        list.add(securityExcel1);
        String fileName = null;
        try {
@@ -1011,9 +945,9 @@
        securityExcel.setSex("男");
        securityExcel.setCardid("360XXX19XXXXXX****");
        securityExcel.setNation("汉");
        securityExcel.setRegistered("江西省南昌市******");
        securityExcel.setRegistered("山西省晋城市******");
//        securityExcel.setHold("是");
        securityExcel.setSecuritynumber("赣洪202100001");
//        securityExcel.setSecuritynumber("晋202100001");
        list.add(securityExcel);
        SecurityYyExcel securityExcel1 = new SecurityYyExcel();
@@ -1023,7 +957,7 @@
        securityExcel1.setSex("女");
        securityExcel1.setCardid("360XXX19XXXXXX****");
        securityExcel1.setNation("汉");
        securityExcel1.setRegistered("江西省南昌市******");
        securityExcel1.setRegistered("山西省晋城市******");
//        securityExcel1.setHold("否");
        securityExcel1.setSecuritynumber("");
        list.add(securityExcel1);
@@ -1300,76 +1234,6 @@
            user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
        }
        //数据推送
        //1.群访群控数据推送(异步)
        if (status) {
            myAsyncService.qfqkUserSave(user);
            //2.内网数据推送
            String s = "insert into blade_user(" +
                "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                "politicaloutlook,healstats,height,address,registered,rtime," +
                "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode,create_time,update_time,cell) " +
                "values(" + "'" + user.getId() + "'" +
                "," + "'" + user.getTenantId() + "'" +
                "," + "'" + user.getAccount() + "'" +
                "," + "'" + user.getPassword() + "'" +
                "," + "'" + user.getName() + "'" +
                "," + "'" + user.getRealName() + "'" +
                "," + "'" + user.getAvatar() + "'" +
                "," + "'" + user.getEmail() + "'" +
                "," + "'" + user.getPhone() + "'" +
                "," + "'" + user.getSex() + "'" +
                "," + "'" + user.getRoleId() + "'" +
                "," + "'" + user.getDeptId() + "'" +
                "," + "'" + user.getCardid() + "'" +
                "," + "'" + user.getNativeplace() + "'" +
                "," + "'" + user.getNation() + "'" +
                "," + "'" + url + "'" +
                "," + "'" + user.getEducation() + "'" +
                "," + "'" + user.getPoliticaloutlook() + "'" +
                "," + "'" + user.getHealstats() + "'" +
                "," + "'" + user.getHeight() + "'" +
                "," + "'" + user.getAddress() + "'" +
                "," + "'" + user.getRegistered() + "'" +
                "," + "'" + rtime + "'" +
                "," + "'" + user.getSecuritynumber() + "'" +
                "," + "'" + user.getHold() + "'" +
                "," + "'" + user.getJurisdiction() + "'" +
                "," + "'" + user.getExaminationType() + "'" +
                "," + "'" + user.getStatus() + "'" +
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getDispatch() + "'" +
                "," + "'" + user.getGuncode() + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                "," + "'" + user.getCell() + "'" + ");" +
                "insert into sys_experience(id,name,post,entryTime,cardId,companyname,securityId) " +
                "values(" + "'" + experience.getId() + "'" +
                "," + "'" + experience.getName() + "'" +
                "," + "'" + experience.getPost() + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                "," + "'" + experience.getCardid() + "'" +
                "," + "'" + experience.getCompanyname() + "'" +
                "," + "'" + experience.getSecurityid() + "'" + ")";
            myAsyncService.dataSync(s);
        }
        //获取从业记录
//        List<Experience> experiences = (List<Experience>) userMap.get("userPractitionersInfo");
//        if (experiences.size()>0){
//            int count = 0;
//            for (int i = 0; i < experiences.size(); i++) {
//                Experience e = JSON.parseObject(JSON.toJSONString(experiences.get(i)), Experience.class);
//                e.setSecurityid(user.getId().toString());
//                experienceService.save(e);
//                count++;
//            }
//            if (count < 1) {
//                return R.status(false);
//            }
//        }
        //判断是否持证是否为空
        if (!state) {
            return R.data(201, null, "保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!");
src/main/java/org/springblade/modules/system/entity/User.java
@@ -266,4 +266,10 @@
     */
    @TableField("equipment_code")
    private String equipmentCode;
    /**
     * 从业单位名称
     */
    @TableField("unit_name")
    private String unitName;
}
src/main/java/org/springblade/modules/system/excel/SecurityExcel.java
@@ -1,28 +1,10 @@
/*
 *      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.ExcelIgnore;
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;
/**
@@ -49,7 +31,7 @@
    @ExcelProperty("联系电话*")
    private String phone;
    @ExcelProperty("性别*")
    @ExcelProperty("性别*(男/女)")
    @ColumnWidth(10)
    private String sex;
@@ -64,9 +46,20 @@
    @ExcelProperty("身份证住址*")
    private String registered;
    @ExcelProperty("保安员证编码")
    @ExcelProperty("从业单位*")
    @ColumnWidth(20)
    private String securitynumber;
    private String unitName;
    @ExcelProperty("最高学历*(初中及以下/高中/中技/中专/大专/本科/博士/硕士)")
    @ColumnWidth(20)
    private String education;
    @ExcelProperty("政治面貌*")
    @ColumnWidth(20)
    private String politicaloutlook;
    @ExcelProperty("联系地址*")
    private String address;
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -183,6 +183,9 @@
        <if test="user.cardid!=null and user.cardid != ''">
            and bu.cardid like concat('%', #{user.cardid},'%')
        </if>
        <if test="user.unitName!=null and user.unitName != ''">
            and bu.unit_name like concat('%', #{user.unitName},'%')
        </if>
        <if test="user.sortName!=null and user.sortName!=''">
            ORDER BY bu.${user.sortName} ${user.sort},bu.id desc
        </if>
@@ -289,6 +292,9 @@
            <if test="user.realName!=null and user.realName != ''">
                and bu.real_name like concat('%', #{user.realName},'%')
            </if>
            <if test="user.unitName!=null and user.unitName != ''">
                and bu.unit_name like concat('%', #{user.unitName},'%')
            </if>
            <if test="user.dispatch!=null and user.dispatch != ''">
                <if test="user.dispatch == 0">
                    and bu.dispatch = #{user.dispatch}
@@ -391,6 +397,9 @@
        </if>
        <if test="user.nativeplace!=null and user.nativeplace != ''">
            and nativeplace = #{user.nativeplace}
        </if>
        <if test="user.unitName!=null and user.unitName != ''">
            and bu.unit_name like concat('%', #{user.unitName},'%')
        </if>
        <if test="user.sex!=null and user.sex != ''">
            and sex = #{user.sex}
@@ -499,6 +508,9 @@
        <if test="user.jurisdiction!=null and user.jurisdiction != ''">
            and bu.jurisdiction = #{user.jurisdiction}
        </if>
        <if test="user.unitName!=null and user.unitName != ''">
            and bu.unit_name like concat('%', #{user.unitName},'%')
        </if>
        <if test="user.securitynumber!=null and user.securitynumber != ''">
            and bu.securitynumber = #{user.securitynumber}
        </if>
@@ -538,6 +550,9 @@
        </if>
        <if test="user.realName!=null and user.realName != ''">
            and bu.real_name like concat('%', #{user.realName},'%')
        </if>
        <if test="user.unitName!=null and user.unitName != ''">
            and bu.unit_name like concat('%', #{user.unitName},'%')
        </if>
        <if test="user.userType!=null and user.userType != ''">
            and bu.user_type = #{user.userType}
@@ -881,32 +896,22 @@
        bu.cardid,
        bu.nation,
        bu.registered,
        if(bu.hold=1,"是","否") hold,
        bu.securitynumber
        from
        blade_user bu
        left join
        blade_dept bd
        on
        bu.dept_id = bd.id
        left join
        sys_information si
        on
        si.departmentid = bd.id
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        left join
        blade_role br
        on
        br.id = bu.role_id
        left join
        sys_training_registration str
        on
        bu.id = str.user_id
        where
        bu.is_deleted = 0
        bu.unit_name unitName,
        case when bu.education=1 then '初中及以下'
        when bu.education=2 then '高中/中技/中专'
        when bu.education=3 then '大专'
        when bu.education=4 then '本科'
        when bu.education=5 then '博士'
        when bu.education=6 then '硕士'
        else '' end as education,
        bu.politicaloutlook,
        bu.address
        from blade_user bu left join blade_dept bd on bu.dept_id = bd.id
        left join sys_information si on si.departmentid = bd.id
        left join sys_jurisdiction sj on sj.id = si.jurisdiction
        left join blade_role br on br.id = bu.role_id
        left join sys_training_registration str on bu.id = str.user_id
        where bu.is_deleted = 0
        <if test="user.examinationType!=null and user.examinationType != ''">
            <if test="user.examinationType == 0">
                and (bu.examination_type = #{user.examinationType} or bu.examination_type is null or bu.examination_type ='')
@@ -920,6 +925,9 @@
        </if>
        <if test="user.isAvatar==2">
            and (bu.avatar is null or bu.avatar="")
        </if>
        <if test="user.unitName!=null and user.unitName != ''">
            and bu.unit_name like concat('%', #{user.unitName},'%')
        </if>
        <if test="user.isFingerprint==1">
            and bu.fingerprint is not null and bu.fingerprint!=""
@@ -1041,7 +1049,7 @@
        tenant_id,account,password,name,real_name,avatar,email,phone,sex,
        role_id,dept_id,cardid,nativePlace,nation,fingerprint,education,
        politicaloutlook,healstats,height,address,registered,securitynumber,
        hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time
        hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time,unit_name
        )
        values
        <foreach collection="list" item="user" separator=",">
@@ -1049,7 +1057,7 @@
            #{user.tenantId},#{user.account},#{user.password},#{user.name},#{user.realName},#{user.avatar},#{user.email},#{user.phone},#{user.sex},
            #{user.roleId},#{user.deptId},#{user.cardid},#{user.nativeplace},#{user.nation},#{user.fingerprint},#{user.education},
            #{user.politicaloutlook},#{user.healstats},#{user.height},#{user.address},#{user.registered},#{user.securitynumber},
            #{user.hold},#{user.jurisdiction},#{user.examinationType},#{user.status},#{user.isDeleted},#{user.dispatch},#{user.createTime}
            #{user.hold},#{user.jurisdiction},#{user.examinationType},#{user.status},#{user.isDeleted},#{user.dispatch},#{user.createTime},#{user.unitName}
            )
        </foreach>
    </insert>
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -900,6 +900,44 @@
                }
            }
            //性别
            if (null != userExcel.getSex()) {
                if (userExcel.getSex().equals("男")) {
                    user.setSex(1);
                }
                if (userExcel.getSex().equals("女")) {
                    user.setSex(2);
                }
            }
            // 学历
            if (null != userExcel.getEducation()) {
                if (userExcel.getEducation().equals("初中及以下")
                    || userExcel.getEducation().equals("初中")
                ) {
                    user.setEducation("1");
                }
                if (userExcel.getEducation().equals("高中/中技/中专")
                    || userExcel.getEducation().equals("高中")
                    || userExcel.getEducation().equals("中技")
                    || userExcel.getEducation().equals("中专")
                ) {
                    user.setEducation("2");
                }
                if (userExcel.getEducation().equals("大专")) {
                    user.setEducation("3");
                }
                if (userExcel.getEducation().equals("本科")) {
                    user.setEducation("4");
                }
                if (userExcel.getEducation().equals("博士")) {
                    user.setEducation("5");
                }
                if (userExcel.getEducation().equals("硕士")) {
                    user.setEducation("6");
                }
            }
            //判断当前用户是否已在本单位,如果是的更新数据
            User user1 = new User();
            user1.setAccount(user.getCardid());
@@ -913,36 +951,37 @@
                //默认在职
                user.setStatus(1);
                user.setIsDeleted(0);
                user.setHold("2");
                //判断是否持证
                if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
                    user.setHold("1");
                    //校验保安员证编号是否合规
                    SecurityPaper securityPaper = new SecurityPaper();
                    securityPaper.setIdCardNo(userExcel.getCardid());
                    List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
                    if (securityPaperList.size()>0){
                        boolean state = false;
                        //遍历
                        for (SecurityPaper paper : securityPaperList) {
                            if (paper.getNumber().equals(user.getSecuritynumber())){
                                state = true;
                            }
                        }
                        if (!state){
                            user.setHold("2");
                            user.setSecuritynumber(null);
                            securityInvalidList.add(userExcel.getCardid());
                            securityInvalidStatus.set(false);
                        }
                    }else {
                        user.setHold("2");
                        user.setSecuritynumber(null);
                        securityInvalidList.add(userExcel.getCardid());
                        securityInvalidStatus.set(false);
                    }
                }else {
                    user.setHold("2");
                }
//                if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
//                    user.setHold("1");
//                    //校验保安员证编号是否合规
//                    SecurityPaper securityPaper = new SecurityPaper();
//                    securityPaper.setIdCardNo(userExcel.getCardid());
//                    List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
//                    if (securityPaperList.size()>0){
//                        boolean state = false;
//                        //遍历
//                        for (SecurityPaper paper : securityPaperList) {
//                            if (paper.getNumber().equals(user.getSecuritynumber())){
//                                state = true;
//                            }
//                        }
//                        if (!state){
//                            user.setHold("2");
//                            user.setSecuritynumber(null);
//                            securityInvalidList.add(userExcel.getCardid());
//                            securityInvalidStatus.set(false);
//                        }
//                    }else {
//                        user.setHold("2");
//                        user.setSecuritynumber(null);
//                        securityInvalidList.add(userExcel.getCardid());
//                        securityInvalidStatus.set(false);
//                    }
//                }else {
//                    user.setHold("2");
//                }
                //判断年龄,超过60岁的不入
//                if (AgeUtil.idCardToAge(user.getCardid())<60) {
                //分配保安角色
@@ -950,16 +989,6 @@
                role.setRoleAlias("保安");
                Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
                user.setRoleId(oneRole.getId().toString());
                //性别
                if (null != userExcel.getSex()) {
                    if (userExcel.getSex().equals("男")) {
                        user.setSex(1);
                    }
                    if (userExcel.getSex().equals("女")) {
                        user.setSex(2);
                    }
                }
                //设置账号
                user.setAccount(user.getCardid());
@@ -995,116 +1024,83 @@
            }else {
                //匹配组织机构是否一致,如果不一致
                if(!user2.getDeptId().equals(user.getDeptId())){
                    Dept dept = deptService.getById(user2.getDeptId());
                    Dept dept1 = deptService.getById(user.getDeptId());
                    //如果是南昌总公司分公司导入的
                    if (dept.getId().equals(1432626178757275649L) && dept1.getParentId().equals(1432626178757275649L)){
                        user2.setDeptId(dept1.getId().toString());
                        //判断是否持证
                        if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
                            user2.setHold("1");
                            user2.setSecuritynumber(user.getSecuritynumber());
                            //校验保安员证编号是否合规
                            SecurityPaper securityPaper = new SecurityPaper();
                            securityPaper.setIdCardNo(userExcel.getCardid());
                            List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
                            if (securityPaperList.size()>0){
                                boolean state = false;
                                //遍历
                                for (SecurityPaper paper : securityPaperList) {
                                    if (paper.getNumber().equals(user.getSecuritynumber())){
                                        state = true;
                                    }
                                }
                                if (!state){
                                    user2.setHold("2");
                                    user2.setSecuritynumber(null);
                                    securityInvalidList.add(userExcel.getCardid());
                                    securityInvalidStatus.set(false);
                                }
                            }else {
                                user2.setHold("2");
                                user2.setSecuritynumber(null);
                                securityInvalidList.add(userExcel.getCardid());
                                securityInvalidStatus.set(false);
                            }
                        }else {
                            user2.setHold("2");
                        }
                        //更新用户数据
                        user2.setUpdateTime(new Date());
                        this.updateById(user2);
                        //qfqk异步推送
                        myAsyncService.updateUserByQfqk(user2);
                        String s1 =
                            "update blade_user set hold = " + "'" + user2.getHold() + "'"
                                + ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
                                + ",dept_id = " + "'" + user2.getDeptId() + "'"
                                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                                + ",registered = " + "'" + user2.getRegistered() + "'"
                                + " " + "where id = " + "'" + user2.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.dataSync(s1);
                    }else {
                        status.set(false);
                        //加入集合
                        errorList.add(user.getCardid());
                        //forEach 只能使用 return 跳出本次循环
                    status.set(false);
                    //加入集合
                    errorList.add(user.getCardid());
                    //forEach 只能使用 return 跳出本次循环
//                        return;
                        continue;
                    }
                    continue;
                }else {
                    //如果是一致,则更新用户数据
                    //判断是否持证
                    if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
                        user2.setHold("1");
                        user2.setSecuritynumber(user.getSecuritynumber());
                        //校验保安员证编号是否合规
                        SecurityPaper securityPaper = new SecurityPaper();
                        securityPaper.setIdCardNo(userExcel.getCardid());
                        List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
                        if (securityPaperList.size()>0){
                            boolean state = false;
                            //遍历
                            for (SecurityPaper paper : securityPaperList) {
                                if (paper.getNumber().equals(user.getSecuritynumber())){
                                    state = true;
                                }
                            }
                            if (!state){
                                user2.setHold("2");
                                user2.setSecuritynumber(null);
                                securityInvalidList.add(userExcel.getCardid());
                                securityInvalidStatus.set(false);
                            }
                        }else {
                            user2.setHold("2");
                            user2.setSecuritynumber(null);
                            securityInvalidList.add(userExcel.getCardid());
                            securityInvalidStatus.set(false);
                        }
                    }else {
                        user2.setHold("2");
                    }
//                    if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
//                        user2.setHold("1");
//                        user2.setSecuritynumber(user.getSecuritynumber());
//                        //校验保安员证编号是否合规
//                        SecurityPaper securityPaper = new SecurityPaper();
//                        securityPaper.setIdCardNo(userExcel.getCardid());
//                        List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
//                        if (securityPaperList.size()>0){
//                            boolean state = false;
//                            //遍历
//                            for (SecurityPaper paper : securityPaperList) {
//                                if (paper.getNumber().equals(user.getSecuritynumber())){
//                                    state = true;
//                                }
//                            }
//                            if (!state){
//                                user2.setHold("2");
//                                user2.setSecuritynumber(null);
//                                securityInvalidList.add(userExcel.getCardid());
//                                securityInvalidStatus.set(false);
//                            }
//                        }else {
//                            user2.setHold("2");
//                            user2.setSecuritynumber(null);
//                            securityInvalidList.add(userExcel.getCardid());
//                            securityInvalidStatus.set(false);
//                        }
//                    }else {
//                        user2.setHold("2");
//                    }
//                    user2.setHold("2");
                    if (null!=userExcel.getRegistered()){
                        user2.setRegistered(userExcel.getRegistered());
                    }else {
                        user2.setRegistered("");
                    }
                    // 住址
                    if (null!=userExcel.getAddress()){
                        user2.setAddress(userExcel.getAddress());
                    }else {
                        user2.setAddress("");
                    }
                    // 学历
                    if (null!=userExcel.getEducation()){
                        user2.setEducation(user.getEducation());
                    }else {
                        user2.setEducation("");
                    }
                    // 从业单位
                    if (null!=userExcel.getUnitName()){
                        user2.setUnitName(userExcel.getUnitName());
                    }else {
                        user2.setUnitName("");
                    }
                    // 政治面貌
                    if (null!=userExcel.getPoliticaloutlook()){
                        user2.setPoliticaloutlook(userExcel.getPoliticaloutlook());
                    }else {
                        user2.setPoliticaloutlook("");
                    }
                    user2.setUpdateTime(new Date());
                    //更新用户数据
                    this.updateById(user2);
                    //qfqk异步推送
                    myAsyncService.updateUserByQfqk(user2);
                    //内网数据sql
                    String s1 =
                        "update blade_user set hold = " + "'" + user2.getHold() + "'"
                            + ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
                            + ",registered = " + "'" + user2.getRegistered() + "'"
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        }
@@ -1112,64 +1108,6 @@
        //用户批量插入
        if (userList.size()>0) {
            baseMapper.batchUserList(userList);
            //用户批量插入异步推送
            myAsyncService.batchUserList(userList);
            //sql 拼接
            StringBuilder builder = new StringBuilder();
            StringBuilder builder1 = new StringBuilder();
            //遍历
            for (User user : userList) {
                //内网同步,sql 拼接
                String sql = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time,update_time) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + user.getSex() + "'" +
                    "," + "'" + user.getRoleId() + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'" +
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                    ")";
                //拼接
                builder  = builder.append(sql).append(";");
                List<String> list = Arrays.asList(builder.toString().split(";"));
                //判断list.size 大小
                if (list.size()==1000){
                    //执行
                    //FtpUtil.sqlFileUpload(builder.toString());
                    myAsyncService.FTP(builder.toString());
                    //清空
                    builder.delete(0,builder.length());
                }
            }
            //装换成map
            Map<String, User> userMap = userList.stream().collect(Collectors.toMap(user -> user.getCardid(), user -> user));
            //匹配
@@ -1181,33 +1119,6 @@
            }).collect(Collectors.toList());
            //批量插入从业记录
            baseMapper.batchExperienceList(experienceList);
            //遍历,拼接sql ,同步数据到内网
            for (Experience experience : experienceList) {
                String sql1  = "insert into sys_experience(id,name,post,entryTime,cardId,companyname,securityId) " +
                    "values(" + "'" + experience.getId() + "'" +
                    "," + "'" + experience.getName() + "'" +
                    "," + "'" + experience.getPost() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                    "," + "'" + experience.getCardid() + "'" +
                    "," + "'" + experience.getCompanyname() + "'" +
                    "," + "'" + experience.getSecurityid() + "'" + ")";
                //拼接
                builder1  = builder1.append(sql1).append(";");
                String[] split1 = builder.toString().split(";");
                //判断list.size 大小
                if (split1.length==1000){
                    //执行
                    //FtpUtil.sqlFileUpload(builder1.toString());
                    myAsyncService.FTP(builder1.toString());
                    //清空
                    builder1.delete(0,builder1.length());
                }
            }
            //剩余的继续执行
            //FtpUtil.sqlFileUpload(builder.toString());
            myAsyncService.FTP(builder.toString());
            //FtpUtil.sqlFileUpload(builder1.toString());
            myAsyncService.FTP(builder1.toString());
        }
//        System.out.println("导入时间: = " + (System.currentTimeMillis()-time));
@@ -1359,8 +1270,6 @@
                user.setCreateTime(new Date());
                //新增
                this.save(user);
                //qfqk 推送
                myAsyncService.qfqkUserSave(user);
                //从业记录新增
                Experience experience = new Experience();
@@ -1372,56 +1281,6 @@
                experience.setEntrytime(new Date());
                experienceService.save(experience);
                //内网同步
                String s = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time,update_time,guncode) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + user.getSex() + "'" +
                    "," + "'" + user.getRoleId() + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'"+
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                "," + "'" + user.getGuncode() + "'" + ");"+
                "insert into sys_experience(id,name,post,entryTime," +
                    "cardId,companyname,securityId) " +
                    "values(" + "'" + experience.getId() + "'" +
                    "," + "'" + experience.getName() + "'" +
                    "," + "'" + experience.getPost() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                    "," + "'" + experience.getCardid() + "'" +
                    "," + "'" + experience.getCompanyname() + "'" +
                    "," + "'" + experience.getSecurityid() + "'"
                    + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.dataSync(s);
            }
            else {
                //匹配组织机构是否一致,如果不一致
@@ -1470,18 +1329,6 @@
                        user2.setUpdateTime(new Date());
                        //更新用户数据
                        this.updateById(user2);
                        //qfqk 推送
                        myAsyncService.updateUserByQfqk(user);
                        String s1 =
                            "update blade_user set hold = " + "'" + user2.getHold() + "'"
                                + ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
                                + ",dept_id = " + "'" + user2.getDeptId() + "'"
                                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                                + ",registered = " + "'" + user2.getRegistered() + "'"
                                + " " + "where id = " + "'" + user2.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.dataSync(s1);
                    }else {
                        status.set(false);
                        //加入集合
@@ -1540,8 +1387,6 @@
                    user2.setUpdateTime(new Date());
                    //更新用户数据
                    this.updateById(user2);
                    //qfqk 推送
                    myAsyncService.updateUserByQfqk(user);
                    String s1 =
                        "update blade_user set hold = " + "'" + user2.getHold() + "'"
@@ -1855,61 +1700,62 @@
                //默认在职
                user.setStatus(1);
                user.setIsDeleted(0);
                user.setHold("2");
                //判断是否持证
                if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
                    user.setHold("1");
                    //校验保安员证编号是否合规
                    SecurityPaper securityPaper = new SecurityPaper();
                    securityPaper.setIdCardNo(userExcel.getCardid());
                    List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
                    if (securityPaperList.size()>0){
                        boolean state = false;
                        //遍历
                        for (SecurityPaper paper : securityPaperList) {
                            if (paper.getNumber().equals(user.getSecuritynumber())){
                                state = true;
                            }
                        }
                        if (!state){
                            user.setHold("2");
                            user.setSecuritynumber(null);
                            securityInvalidList.add(userExcel.getCardid());
                            securityInvalidStatus.set(false);
                        }
                    }else {
                        user.setHold("2");
                        user.setSecuritynumber(null);
                        securityInvalidList.add(userExcel.getCardid());
                        securityInvalidStatus.set(false);
                    }
                }else {
                    //创建保安证编号
                    user.setHold("1");
                    //去生成保安证编号
                    String pre = SecurityPaperUtil.getSecurityPaper();
                    //查询当前年份已有的保安证编号
                    int max = this.getSecurityPaperCount(pre);
                    String result = null;
                    if (max == 0) {
                        result = pre + "00001";
                    } else {
                        //格式化
                        DecimalFormat decimalFormat = new DecimalFormat("00000");
                        max++;
                        result = pre + (decimalFormat.format(max));
                    }
                    user.setSecuritynumber(result);
                    //生成保安证的同时向保安证管理表中插入一条数据
                    SecurityPaper securityPaper = new SecurityPaper();
                    securityPaper.setNumber(result);
                    securityPaper.setCreateTime(new Date());
                    securityPaper.setIdCardNo(user.getCardid());
                    securityPaper.setPeopleName(user.getRealName());
                    securityPaper.setSource(3);
                    //新增保安员证信息
                    securityPaperService.save(securityPaper);
                }
//                if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
//                    user.setHold("1");
//                    //校验保安员证编号是否合规
//                    SecurityPaper securityPaper = new SecurityPaper();
//                    securityPaper.setIdCardNo(userExcel.getCardid());
//                    List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
//                    if (securityPaperList.size()>0){
//                        boolean state = false;
//                        //遍历
//                        for (SecurityPaper paper : securityPaperList) {
//                            if (paper.getNumber().equals(user.getSecuritynumber())){
//                                state = true;
//                            }
//                        }
//                        if (!state){
//                            user.setHold("2");
//                            user.setSecuritynumber(null);
//                            securityInvalidList.add(userExcel.getCardid());
//                            securityInvalidStatus.set(false);
//                        }
//                    }else {
//                        user.setHold("2");
//                        user.setSecuritynumber(null);
//                        securityInvalidList.add(userExcel.getCardid());
//                        securityInvalidStatus.set(false);
//                    }
//                }else {
//                    //创建保安证编号
//                    user.setHold("1");
//                    //去生成保安证编号
//                    String pre = SecurityPaperUtil.getSecurityPaper();
//                    //查询当前年份已有的保安证编号
//                    int max = this.getSecurityPaperCount(pre);
//                    String result = null;
//                    if (max == 0) {
//                        result = pre + "00001";
//                    } else {
//                        //格式化
//                        DecimalFormat decimalFormat = new DecimalFormat("00000");
//                        max++;
//                        result = pre + (decimalFormat.format(max));
//                    }
//                    user.setSecuritynumber(result);
//
//                    //生成保安证的同时向保安证管理表中插入一条数据
//                    SecurityPaper securityPaper = new SecurityPaper();
//                    securityPaper.setNumber(result);
//                    securityPaper.setCreateTime(new Date());
//                    securityPaper.setIdCardNo(user.getCardid());
//                    securityPaper.setPeopleName(user.getRealName());
//                    securityPaper.setSource(3);
//                    //新增保安员证信息
//                    securityPaperService.save(securityPaper);
//                }
                //分配保安角色
                Role role = new Role();
                role.setRoleAlias("保安");
@@ -1964,61 +1810,61 @@
                }else {
                    //如果是一致,则更新用户数据
                    //判断是否持证
                    if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
                        user2.setHold("1");
                        user2.setSecuritynumber(user.getSecuritynumber());
                        //校验保安员证编号是否合规
                        SecurityPaper securityPaper = new SecurityPaper();
                        securityPaper.setIdCardNo(userExcel.getCardid());
                        List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
                        if (securityPaperList.size()>0){
                            boolean state = false;
                            //遍历
                            for (SecurityPaper paper : securityPaperList) {
                                if (paper.getNumber().equals(user.getSecuritynumber())){
                                    state = true;
                                }
                            }
                            if (!state){
                                user2.setHold("2");
                                user2.setSecuritynumber(null);
                                securityInvalidList.add(userExcel.getCardid());
                                securityInvalidStatus.set(false);
                            }
                        }else {
                            user2.setHold("2");
                            user2.setSecuritynumber(null);
                            securityInvalidList.add(userExcel.getCardid());
                            securityInvalidStatus.set(false);
                        }
                    }else {
                        //创建保安证编号
                        user2.setHold("1");
                        //去生成保安证编号
                        String pre = SecurityPaperUtil.getSecurityPaper();
                        //查询当前年份已有的保安证编号
                        int max = this.getSecurityPaperCount(pre);
                        String result = null;
                        if (max == 0) {
                            result = pre + "00001";
                        } else {
                            //格式化
                            DecimalFormat decimalFormat = new DecimalFormat("00000");
                            max++;
                            result = pre + (decimalFormat.format(max));
                        }
                        user2.setSecuritynumber(result);
                        //生成保安证的同时向保安证管理表中插入一条数据
                        SecurityPaper securityPaper = new SecurityPaper();
                        securityPaper.setNumber(result);
                        securityPaper.setCreateTime(new Date());
                        securityPaper.setIdCardNo(user2.getCardid());
                        securityPaper.setPeopleName(user2.getRealName());
                        securityPaper.setSource(3);
                        //新增保安员证信息
                        securityPaperService.save(securityPaper);
                    }
//                    if (null != userExcel.getSecuritynumber() && userExcel.getSecuritynumber() != "") {
//                        user2.setHold("1");
//                        user2.setSecuritynumber(user.getSecuritynumber());
//                        //校验保安员证编号是否合规
//                        SecurityPaper securityPaper = new SecurityPaper();
//                        securityPaper.setIdCardNo(userExcel.getCardid());
//                        List<SecurityPaper> securityPaperList = securityPaperService.list(Condition.getQueryWrapper(securityPaper));
//                        if (securityPaperList.size()>0){
//                            boolean state = false;
//                            //遍历
//                            for (SecurityPaper paper : securityPaperList) {
//                                if (paper.getNumber().equals(user.getSecuritynumber())){
//                                    state = true;
//                                }
//                            }
//                            if (!state){
//                                user2.setHold("2");
//                                user2.setSecuritynumber(null);
//                                securityInvalidList.add(userExcel.getCardid());
//                                securityInvalidStatus.set(false);
//                            }
//                        }else {
//                            user2.setHold("2");
//                            user2.setSecuritynumber(null);
//                            securityInvalidList.add(userExcel.getCardid());
//                            securityInvalidStatus.set(false);
//                        }
//                    }else {
//                        //创建保安证编号
//                        user2.setHold("1");
//                        //去生成保安证编号
//                        String pre = SecurityPaperUtil.getSecurityPaper();
//                        //查询当前年份已有的保安证编号
//                        int max = this.getSecurityPaperCount(pre);
//                        String result = null;
//                        if (max == 0) {
//                            result = pre + "00001";
//                        } else {
//                            //格式化
//                            DecimalFormat decimalFormat = new DecimalFormat("00000");
//                            max++;
//                            result = pre + (decimalFormat.format(max));
//                        }
//                        user2.setSecuritynumber(result);
//
//                        //生成保安证的同时向保安证管理表中插入一条数据
//                        SecurityPaper securityPaper = new SecurityPaper();
//                        securityPaper.setNumber(result);
//                        securityPaper.setCreateTime(new Date());
//                        securityPaper.setIdCardNo(user2.getCardid());
//                        securityPaper.setPeopleName(user2.getRealName());
//                        securityPaper.setSource(3);
//                        //新增保安员证信息
//                        securityPaperService.save(securityPaper);
//                    }
                    if (null!=userExcel.getRegistered()){
                        user2.setRegistered(userExcel.getRegistered());
                    }else {
@@ -2028,7 +1874,7 @@
                    //更新用户数据
                    this.updateById(user2);
                    //qfqk异步推送
                    myAsyncService.updateUserByQfqk(user2);
//                    myAsyncService.updateUserByQfqk(user2);
                    //内网数据sql
                    String s1 =
                        "update blade_user set hold = " + "'" + user2.getHold() + "'"
@@ -2044,60 +1890,6 @@
        //用户批量插入
        if (userList.size()>0) {
            baseMapper.batchUserList(userList);
            //用户批量插入异步推送
            myAsyncService.batchUserList(userList);
            //sql 拼接
            StringBuilder builder = new StringBuilder();
            StringBuilder builder1 = new StringBuilder();
            //遍历
            for (User user : userList) {
                //内网同步,sql 拼接
                String sql = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + user.getSex() + "'" +
                    "," + "'" + user.getRoleId() + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'" +
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" + ")";
                //拼接
                builder  = builder.append(sql).append(";");
                List<String> list = Arrays.asList(builder.toString().split(";"));
                //判断list.size 大小
                if (list.size()==1000){
                    //执行
                    myAsyncService.FTP(builder.toString());
                    //清空
                    builder.delete(0,builder.length());
                }
            }
            //装换成map
            Map<String, User> userMap = userList.stream().collect(Collectors.toMap(user -> user.getCardid(), user -> user));
@@ -2110,30 +1902,6 @@
            }).collect(Collectors.toList());
            //批量插入从业记录
            baseMapper.batchExperienceList(experienceList);
            //遍历,拼接sql ,同步数据到内网
            for (Experience experience : experienceList) {
                String sql1  = "insert into sys_experience(id,name,post,entryTime,cardId,companyname,securityId) " +
                    "values(" + "'" + experience.getId() + "'" +
                    "," + "'" + experience.getName() + "'" +
                    "," + "'" + experience.getPost() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                    "," + "'" + experience.getCardid() + "'" +
                    "," + "'" + experience.getCompanyname() + "'" +
                    "," + "'" + experience.getSecurityid() + "'" + ")";
                //拼接
                builder1  = builder1.append(sql1).append(";");
                String[] split1 = builder.toString().split(";");
                //判断list.size 大小
                if (split1.length==1000){
                    //执行
                    myAsyncService.FTP(builder1.toString());
                    //清空
                    builder1.delete(0,builder1.length());
                }
            }
            //剩余的继续执行
            myAsyncService.FTP(builder.toString());
            myAsyncService.FTP(builder1.toString());
        }
        //如果所有数据导入有一个异常
src/main/java/org/springblade/modules/training/excel/TrainingRegistrationExcel.java
@@ -1,5 +1,6 @@
package org.springblade.modules.training.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
@@ -31,8 +32,13 @@
    @ColumnWidth(25)
    @ExcelProperty("所属企业名称")
    @ExcelIgnore
    private String deptName;
    @ColumnWidth(25)
    @ExcelProperty("从业单位")
    private String unitName;
    @ColumnWidth(15)
    @ExcelProperty("准考证号")
    private String candidateNo;
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml
@@ -8,7 +8,7 @@
            sr.*,
            bt.dept_name AS deptName,
            bt0.dept_name AS trainUnitName,
            bu.real_name realName,bu.phone,bu.cardid idCardNo,
            bu.real_name realName,bu.phone,bu.cardid idCardNo,bu.unit_name unitName,
            ke.start_time trainExamTime,if(ke.audit_status=1,ke.exam_name,"") trainExamName,
            ke.exam_type examType,sr.audit_status auditStatus,
            "保安证" applyCard
@@ -45,6 +45,9 @@
        </if>
        <if test="trainingRegistration.userId!=null and  trainingRegistration.userId!=''">
            and sr.user_id = #{trainingRegistration.userId}
        </if>
        <if test="trainingRegistration.unitName!=null and  trainingRegistration.unitName!=''">
            and bu.unit_name like concat('%', #{trainingRegistration.unitName},'%')
        </if>
        <if test="trainingRegistration.deptId!=null and  trainingRegistration.deptId!=''">
            and bu.dept_id = #{trainingRegistration.deptId}
@@ -106,8 +109,7 @@
        else "缺考" end as isExam,
        bt.dept_name AS deptName,
        bt0.dept_name AS trainUnitName,
        bu.real_name realName,
        bu.phone,bu.cardid idCardNo,
        bu.real_name realName,bu.phone,bu.cardid idCardNo,bu.unit_name unitName,
        ke.start_time trainExamTime,
        if(ke.audit_status=1,ke.exam_name,"") trainExamName,
        case
@@ -157,6 +159,9 @@
        <if test="trainingRegistration.deptName!=null and  trainingRegistration.deptName!=''">
            and bt.dept_name like concat('%', #{trainingRegistration.deptName},'%')
        </if>
        <if test="trainingRegistration.unitName!=null and  trainingRegistration.unitName!=''">
            and bu.unit_name like concat('%', #{trainingRegistration.unitName},'%')
        </if>
        <if test="trainingRegistration.realName!=null and  trainingRegistration.realName!=''">
            and bu.real_name like concat('%', #{trainingRegistration.realName},'%')
        </if>
src/main/java/org/springblade/modules/training/vo/TrainingRegistrationVo.java
@@ -124,4 +124,9 @@
     * 辖区id
     */
    private String jurisdiction;
    /**
     * 保安员从业单位
     */
    private String unitName;
}
src/main/resources/application-dev.yml
@@ -44,10 +44,11 @@
#图片批量上传zip
upload:
  localtion: ${UPLOAD_DIR:/home/zhongsong/anbao}
  localtion: ${UPLOAD_DIR:/home/zhbaw/temp}
  maxFileSize: 10240KB
  maxRequestSize: 102400KB
  url: http://47.49.36.190:9000
  url: http://60.220.177.113:9001
  apiUrl: http://127.0.0.1:9001
  access: minioadmin
  secret: minioadmin
  bucket: zhba
src/main/resources/application-prod.yml
@@ -5,7 +5,7 @@
    host: 127.0.0.1
    port: 6379
    password:
    database: 0
    database: 10
    ssl: false
    ##redis 集群环境配置
    #cluster:
@@ -24,9 +24,9 @@
  datasource:
    # MySql
    url: jdbc:mysql://106.225.193.35:3306/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    url: jdbc:mysql://127.0.0.1:3308/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: HCyj@2022
    password: Zhba@jc@2023
    # PostgreSQL
    #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
@@ -44,12 +44,13 @@
#图片批量上传zip
upload:
  localtion: ${UPLOAD_DIR:/home/zhongsong/anbao}
  localtion: ${UPLOAD_DIR:/home/zhbaw/temp}
  maxFileSize: 10240KB
  maxRequestSize: 102400KB
  url: http://106.225.193.35:2081
  access: zhbaadmin
  secret: zhbapassword
  url: http://60.220.177.113:9001
  apiUrl: http://127.0.0.1:9001
  access: minioadmin
  secret: minioadmin
  bucket: zhba
#ftp 设置
src/main/resources/application-test.yml
@@ -13,9 +13,9 @@
    #  commandTimeout: 5000
  datasource:
    # MySql
    url: jdbc:mysql://192.168.0.126:3306/zhbaw-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    url: jdbc:mysql://60.220.177.113:3308/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: NCzhba@2022
    password: Zhba@jc@2023
    # rabbitmq 设置
#  rabbitmq:
#    host: 192.168.0.191
@@ -48,17 +48,18 @@
#图片批量上传zip
upload:
  localtion: ${UPLOAD_DIR:E:/test}
  localtion: ${UPLOAD_DIR:/home/zhongsong/anbao}
  maxFileSize: 10240KB
  maxRequestSize: 102400KB
  url: http://47.49.36.190:9000
  access: minioadmin
  secret: minioadmin
  url: http://60.220.177.113:9001
  apiUrl: http://127.0.0.1:9000
  access: zhbaadmin
  secret: zhbaadmin
  bucket: zhba
#ftp 设置
ftp:
  sqlConnect: jdbc:mysql://192.168.0.126:3306/zhbaw-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  sqlConnect: jdbc:mysql://106.225.193.35:3306/zhbaw-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  ftpHost: 117.40.91.118
  ftpPort: 21
  ftpUserName: zhbain
@@ -68,7 +69,7 @@
  ip: http://61.131.136.25:2081
  jsonUrl: E:\\anbao\\
  username: root
  password: NCzhba@2022
  password: HCyj@2022
  qfqkBaseApiUrl: http://192.168.0.198:83
#  qfqkBaseApiUrl : http://61.131.136.25:2082/api
@@ -78,9 +79,9 @@
    enable: stop
    type: sql
    driver: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://192.168.0.126:3306/zhba-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    url: jdbc:mysql://106.225.193.35:3306/zhbaw-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: NCzhba@2022
    password: HCyj@2022
#第三方登陆
social:
src/main/resources/application.yml
@@ -227,6 +227,7 @@
      - /electronRail/**
      - /scheduled/**
      - /rabbitmq/**
      - /examSubjectChoices/**
    #授权认证配置
    auth: