智慧保安后台管理-外网项目备份
新增数据同步方式及配置,当选择为sql时则为数据库直连同步,全局替换所有的同步方法,用户修改,离职,注销修改调整,文件上传去除同步推送上传
52 files modified
3 files added
903 ■■■■ changed files
src/main/java/org/springblade/common/config/DataSyncConfig.java 59 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/utils/InvestigateUtil.java 115 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/MysqlCenlint.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/service/impl/AccreditationRecordsServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ApplyController.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ExamPaymentController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/coinspect/controller/CoinspectController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dataSync/MysqlCenlint.java 207 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/desk/controller/NoticeController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/directive/controller/DirectiveController.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java 28 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherUnitController.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherUnitServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/CarController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/EquipageController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/GunController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/fixed.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/CarServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/EquipageServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java 11 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 18 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamSubjectChoicesServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/experience/controller/ExperienceController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/controller/LiveLocationController.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/controller/LocusController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/controller/MemberController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/performance/controller/PerformanceController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/controller/RecordController.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordLegalperson/controller/RecordLegalpersonController.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/controller/RecordkController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/registerUnit/controller/RegisterUnitController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/controller/AttachController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java 34 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/controller/RevokeController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/securityapply/service/impl/SecurityApplyServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/seinspect/controller/SeinspectController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java 10 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/DeptController.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 40 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/MyAsyncService.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 18 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/controller/TalkController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java 16 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/service/impl/TrainingRegistrationServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/controller/ZcController.java 2 ●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 13 ●●●● patch | view | raw | blame | history
src/main/resources/application-test.yml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/DataSyncConfig.java
New file
@@ -0,0 +1,59 @@
package org.springblade.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
 * 数据同步配置
 * @author zhongrj
 * @since 2022-08-22
 */
@ConfigurationProperties(prefix = "data.sync")
@Component
public class DataSyncConfig {
    /**
     * 同步类型: ftp,sql
     */
    public static String type;
    /**
     * 数据库连接驱动
     */
    public static String driver;
    /**
     * 数据库连接 url
     */
    public static String url;
    /**
     * 数据库连接用户名
     */
    public static String username;
    /**
     * 数据库连接密码
     */
    public static String password;
    public void setType(String type) {
        DataSyncConfig.type = type;
    }
    public void setDriver(String driver) {
        DataSyncConfig.driver = driver;
    }
    public void setUrl(String url) {
        DataSyncConfig.url = url;
    }
    public void setUsername(String username) {
        DataSyncConfig.username = username;
    }
    public void setPassword(String password) {
        DataSyncConfig.password = password;
    }
}
src/main/java/org/springblade/common/utils/InvestigateUtil.java
New file
@@ -0,0 +1,115 @@
package org.springblade.common.utils;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
/**
 * @author zhongrj
 * @date 2021-08-12
 */
public class InvestigateUtil {
    /**
     * 人员审查
     *
     * @param idCardNo 人员身份证号
     * @return
     */
    public static String httpGet(String idCardNo, Integer pageNum, Integer pageSize) {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
            .url("http://47.49.27.44:8000/dbapi/dmc_bjhc?page_num=" + pageNum + "&page_size=" + pageSize + "&sfzh=" + idCardNo)
            .get()
            .addHeader("Authorization", "Bearer eyJ0eXAiOiJqd3QiLCJhbGciOiJIUzI1NiIsInVjIjoiMzYwNjAyMTk4OTA3MDgxMDE4IiwidG9rZW5fdHlwZSI6MX0.eyJpc3MiOiJITGdGVGYwZWwwNTRDYlNWNUptMUY1eXA3UjRWNnpuMyIsImlhdCI6MTYyOTc5NDk4MH0.KOyEdkXDc5FP98KFLYOBnDgthJZF6VDOxJvlYFrXmrA")
            .build();
        try {
            Response response = client.newCall(request).execute();
            return response.body().string();
        } catch (Exception e) {
        }
        return null;
    }
    /**
     * 人员审查
     *
     * @param idCardNo 人员身份证号
     * @return
     */
    public static String httpGetOne(String idCardNo) {
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
            .url("http://47.49.27.44:8000/dbapi/dmc_bjhc?page_num=1&page_size=1000&sfzh=" + idCardNo)
            .get()
            .addHeader("Authorization", "Bearer eyJ0eXAiOiJqd3QiLCJhbGciOiJIUzI1NiIsInVjIjoiMzYwNjAyMTk4OTA3MDgxMDE4IiwidG9rZW5fdHlwZSI6MX0.eyJpc3MiOiJITGdGVGYwZWwwNTRDYlNWNUptMUY1eXA3UjRWNnpuMyIsImlhdCI6MTYyOTc5NDk4MH0.KOyEdkXDc5FP98KFLYOBnDgthJZF6VDOxJvlYFrXmrA")
            .build();
        try {
            Response response = client.newCall(request).execute();
            return response.body().string();
        } catch (Exception e) {
        }
        return null;
    }
    /**
     * 枪支定位
     *
     * @param idCardNo  护卫员身份证号
     * @param deptName  所在单位名称
     * @param startTime 定位开始时间
     * @param endTime   定位结束时间
     */
    public static String httpGetGunPosition(String idCardNo, String deptName, String startTime, String endTime, Integer pageNum, Integer pageSize) {
        OkHttpClient client = new OkHttpClient();
        String hwysfzh = "";
        String szdw = "";
        String kssj = "";
        String jssj = "";
        String page_size = "&page_size=" + pageSize;
        String page_num = "&page_num=" + pageNum;
        if (idCardNo != null && !idCardNo.equals("")) {
            hwysfzh = "&hwysfzh=" + idCardNo;
        }
        if (deptName != null && !deptName.equals("")) {
            szdw = "&szdw=" + deptName;
        }
        if (startTime != null && !startTime.equals("")) {
            kssj = "&kssj=" + startTime;
        }
        if (endTime != null && !endTime.equals("")) {
            jssj = "&jssj=" + endTime;
        }
        Request request = new Request.Builder()
            .url("http://47.49.27.44:8000/dbapi/dmc_qzdw?" + hwysfzh + szdw + kssj + jssj)
            .get()
            .addHeader("Authorization", "Bearer eyJ0eXAiOiJqd3QiLCJhbGciOiJIUzI1NiIsInVjIjoiMzYwNjAyMTk4OTA3MDgxMDE4IiwidG9rZW5fdHlwZSI6MX0.eyJpc3MiOiI3aWN5MXplc3N2eVBPVlJKUVk2aHpPRTJhc0JMdkw1MyIsImlhdCI6MTYyOTI1MTMzOX0.DLasFawQHexpRBFORQU64tbSR_n76bpway42GfIwPf4")
            .build();
        try {
            Response response = client.newCall(request).execute();
            return response.body().string();
        } catch (Exception e) {
        }
        return null;
    }
    // 工具方法
    public static <T> Consumer<T> consumerWithIndex(BiConsumer<T, Integer> consumer) {
        class Obj {
            int i;
        }
        Obj obj = new Obj();
        return t -> {
            int index = obj.i++;
            consumer.accept(t, index);
        };
    }
}
src/main/java/org/springblade/modules/FTP/MysqlCenlint.java
@@ -1,15 +1,15 @@
package org.springblade.modules.FTP;
import org.springblade.common.config.DataSyncConfig;
import org.springblade.common.config.FtpConfig;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import static org.springblade.common.config.FtpConfig.*;
import static org.springblade.common.config.FtpConfig.localPath;
public class MysqlCenlint {
@@ -22,15 +22,17 @@
        try {
            int ColumnCount;
            //int RowCount;
            String driver = "com.mysql.jdbc.Driver";
            String url = sqlConnect; //换成要连接的数据库信息
            String user = username;
            String password = FtpConfig.password;
            String driver = DataSyncConfig.driver;
            //换成要连接的数据库信息
            String url = DataSyncConfig.url;
            String user = DataSyncConfig.username;
            String password = DataSyncConfig.password;
            Class.forName ( driver );
            Connection conn = (Connection) DriverManager.getConnection ( url, user, password );
            if (!conn.isClosed ()) {
                System.out.println ( "数据库连接成功:" );
                String sqls = sql; //sql
                //sql
                String sqls = sql;
                PreparedStatement ps = conn.prepareStatement ( sqls );
                boolean execute = ps.execute();
                ps.close ();
@@ -51,10 +53,11 @@
        try {
            int ColumnCount;
            //int RowCount;
            String driver = "com.mysql.jdbc.Driver";
            String url = sqlConnect; //换成要连接的数据库信息
            String user = username;
            String password = FtpConfig.password;
            String driver = DataSyncConfig.driver;
            //换成要连接的数据库信息
            String url = DataSyncConfig.url;
            String user = DataSyncConfig.username;
            String password = DataSyncConfig.password;
            Class.forName ( driver );
            Connection conn = (Connection) DriverManager.getConnection ( url, user, password );
            if (!conn.isClosed ()) {
@@ -80,10 +83,11 @@
        try {
            int ColumnCount;
            //int RowCount;
            String driver = "com.mysql.jdbc.Driver";
            String url = sqlConnect; //换成要连接的数据库信息
            String user = username;
            String password = FtpConfig.password;
            String driver = DataSyncConfig.driver;
            //换成要连接的数据库信息
            String url = DataSyncConfig.url;
            String user = DataSyncConfig.username;
            String password = DataSyncConfig.password;
            Class.forName ( driver );
            Connection conn = (Connection) DriverManager.getConnection ( url, user, password );
            if (!conn.isClosed ()) {
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
@@ -103,7 +103,7 @@
            ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
            " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
        return R.data(save);
    }
@@ -159,7 +159,7 @@
                        ",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
                        "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }else {
                //内网同步
                String s =
@@ -169,7 +169,7 @@
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "'";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
        }else {
            //内网同步
@@ -180,7 +180,7 @@
                    ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                    "where id = " + "'" + accreditationRecords.getId() + "'";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        //返回
        return R.status(b);
@@ -223,7 +223,7 @@
                            ",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
                            "where id = " + "'" + user.getId() + "'";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                }else {
                    //内网同步
                    String s =
@@ -233,7 +233,7 @@
                            ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                            "where id = " + "'" + accreditationRecords.getId() + "'";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                }
            }else {
                //内网同步
@@ -244,7 +244,7 @@
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "'";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
        });
        //返回
src/main/java/org/springblade/modules/accreditation/service/impl/AccreditationRecordsServiceImpl.java
@@ -85,7 +85,7 @@
                        + "'" + records.getType() + "'" + ","
                        + "'" + records.getAuditStatus() + "'" + ")";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                }
            }
            //判断类型,如果是证书的,审核未通过的可以再次申请,审核通过的,暂时不给于新增记录
@@ -106,7 +106,7 @@
                        + "'" + records.getType() + "'" + ","
                        + "'" + records.getAuditStatus() + "'" + ")";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                }
            }
@@ -240,7 +240,7 @@
                "update sys_accreditation_records set status = " + accreditationRecords.getStatus() + "" +
                    "where id = " + "'" + accreditationRecords.getId() + "'";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        });
        return true;
    }
src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -156,7 +156,7 @@
            "'" + "," + "'" + apply.getApplyStatus() + "'" + "," + "'" + apply.getIsExam() + "'" + ");" +
            "update blade_user set is_apply = " + user1.getIsApply() + " " + "where id = " + "'" + user1.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
    }
@@ -391,7 +391,7 @@
            //内网同步
            String s1 = "delete from sys_apply where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(applyService.removeByIds(Func.toLongList(ids)));
    }
@@ -493,7 +493,7 @@
            "update sys_apply set apply_status = " + apply.getApplyStatus() + " " + "where id = " + "'" + apply.getId() + "';" +
                "update blade_user set is_apply = " + user.getIsApply() + " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
    }
@@ -667,7 +667,7 @@
                "," + "'" + format + "'" +
                "," + "'" + endTimeFormat + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
            //修改报名信息
            applyIds.forEach(apply -> {
@@ -681,7 +681,7 @@
                        "update sys_apply set exam_id = " + apply.getExamId() + ",candidate_no = " + "'" + apply.getCandidateNo() + "'" +
                            " " + "where id = " + "'" + apply.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            });
        }
@@ -743,7 +743,7 @@
                "," + "'" + examScore.getExamId() + "'" +
                "," + "'" + examScore.getApplyId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        return examScore;
    }
src/main/java/org/springblade/modules/apply/controller/ExamPaymentController.java
@@ -98,7 +98,7 @@
            //内网同步
            String s1 = "delete from sys_exam_payment where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(examPaymentService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -146,7 +146,7 @@
                        +"'" + apply1.getIsExam() + "'" + ");" +
                        "update blade_user set is_apply = " + "'" + user1.getIsApply() + "'" +"where id = " + "'" + user1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                }else {
                    if (user1.getIsApply()!=1) {
                        Apply apply1 = new Apply();
@@ -178,7 +178,7 @@
                            +"'" + apply1.getIsExam() + "'" + ");" +
                            "update blade_user set is_apply = " + "'" + user1.getIsApply() + "'" +"where id = " + "'" + user1.getId() + "'";
                        //FtpUtil.sqlFileUpload(s);
                        myAsyncService.FTP(s);
                        myAsyncService.dataSync(s);
                    }
                }
            }
@@ -471,7 +471,7 @@
            String s1 =
                "update sys_apply set is_exam = " + apply1.getIsExam() + " " +"where id = " + "'" + apply1.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        //模拟考
        if (apply.getExamType()==2){
@@ -485,7 +485,7 @@
            String s1 =
                "update sys_training_registration set is_exam = " + trainingRegistration.getIsExam() + " " +"where id = " + "'" + trainingRegistration.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
    }
src/main/java/org/springblade/modules/coinspect/controller/CoinspectController.java
@@ -118,7 +118,7 @@
                "'" + coinspect.getResults() + "'" + "," +
                "'" + coinspect.getUrl() + "'" + ")";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.success("新增成功");
    }
src/main/java/org/springblade/modules/dataSync/MysqlCenlint.java
New file
@@ -0,0 +1,207 @@
package org.springblade.modules.dataSync;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springblade.common.config.DataSyncConfig;
import org.springblade.common.utils.InvestigateUtil;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Date;
@Component
public class MysqlCenlint {
    @Autowired
    private IUserService userService;
    //声明对象
    private static MysqlCenlint mysqlCenlint;
    /**
     * 初始化
     */
    @PostConstruct
    public void init(){
        mysqlCenlint = this;
        mysqlCenlint.userService = this.userService;
    }
    /**
     * sql 连接
     * @param sql
     */
    public static void sqlConnect(String sql,Integer type){
        String driver = DataSyncConfig.driver;
        //换成要连接的数据库信息
        String url = DataSyncConfig.url;
        String user = DataSyncConfig.username;
        String password = DataSyncConfig.password;
        Connection conn = null;
        PreparedStatement ps = null;
        try {
            Class.forName ( driver );
            conn = (Connection) DriverManager.getConnection ( url, user, password );
            if (!conn.isClosed ()) {
                System.out.println ( "数据库连接成功:" );
                String sqls = sql;
                ps = conn.prepareStatement ( sqls );
                //判断是否为修改,删除
                if (type==1){
                    //修改删除
                    ps.executeUpdate();
                }else {
                    //新增
                    ps.execute();
                }
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace ();
        }finally {
            try {
                ps.close();
                conn.close();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
            }
        }
    }
    /**
     * 连接mysql数据库 新增
     * @param sql
     */
    public static void inster(String sql) {
        sqlConnect(sql,2);
        try {
            Thread.sleep(300);
            //对比 sql 字符串,如果是是往用户表里插入保安员数据,则调用公安审查接口
            String insertUserSql = "insert into blade_user";
            if (sql.contains(insertUserSql)){
                //如果包含,调用公安接口进行保安员审查
                getMxaminationSecurityInfo(sql);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    /**
     * 审查保安员
     * @param sqls 新增的sql 语句
     */
    private static void getMxaminationSecurityInfo(String sqls) {
        //解析sql,读取数据,取出角色,如果是保安员,则审查,如果不是就不审查
        //获取第一个 (  ) 的位置
        int a = sqls.indexOf("(");
        int b = sqls.indexOf(")");
        //获取第二个 ( )的位置
        a = sqls.indexOf("(",a+1);
        b = sqls.indexOf(")",b+1);
        //截取字符串
        String subSql = sqls.substring(a, b);
        String[] splitSql = subSql.split(",");
        //读取角色
        String roleId = splitSql[10];
        //去除单引号
        String subRoleId = roleId.substring(1, roleId.length() - 1);
        //如果是保安员
        if (subRoleId.equals("1412226235153731586")){
            //读取身份证号
            String cardid = splitSql[12];
            //去除单引号
            String subCardid = cardid.substring(1, cardid.length() - 1);
            User user = new User();
            String userId = splitSql[0].substring(2, splitSql[0].length() - 1);
            user.setId(Long.parseLong(userId));
            System.out.println("身份证:"+subCardid);
            //远程调用接口
            String body = InvestigateUtil.httpGetOne(subCardid);
            JSONObject jsonObject = new JSONObject(body);
            Object data = jsonObject.get("data");
            JSONObject jsonData = new JSONObject(data.toString());
            JSONArray res = jsonData.getJSONArray("res");
            //设置审核时间
            user.setAuditTime(new Date());
            if (res.length() == 0) {
                //没有数据正常
                user.setExaminationType("0");
            } else {
                int count = 0;
                user.setExaminationType("1");
                for (int i = 0; i < res.length(); i++) {
                    if (res.getJSONObject(i).get("zdrylbjh").toString() != null
                        && res.getJSONObject(i).get("zdrylbjh").toString() != ""
                        && res.getJSONObject(i).get("zdrylbjh").toString() != "null"
                    ) {
                        user.setExaminationMx(res.getJSONObject(i).get("zdrylbjh").toString());
                        //更新用户数据
                        mysqlCenlint.userService.updateById(user);
                        break;
                    }
                    if (res.getJSONObject(i).get("zdryxlmc").toString() != null
                        && res.getJSONObject(i).get("zdryxlmc").toString() != ""
                        && res.getJSONObject(i).get("zdryxlmc").toString() != "null"
                    ) {
                        user.setExaminationMx(res.getJSONObject(i).get("zdryxlmc").toString());
                        //更新用户数据
                        mysqlCenlint.userService.updateById(user);
                        break;
                    }
                    if (res.getJSONObject(i).get("ztrylx").toString() != null
                        && res.getJSONObject(i).get("ztrylx").toString() != ""
                        && res.getJSONObject(i).get("ztrylx").toString() != "null"
                    ) {
                        user.setExaminationMx(res.getJSONObject(i).get("ztrylx").toString());
                        //更新用户数据
                        mysqlCenlint.userService.updateById(user);
                        break;
                    }
//                        if (res.getJSONObject(i).get("ajlbmc").toString() != null
//                            && res.getJSONObject(i).get("ajlbmc").toString() != "") {
//                            user.setExaminationMx(res.getJSONObject(i).get("ajlbmc").toString());
//                            //更新用户数据
//                            userService.updateById(user);
//                            break;
//                        }
                    count++;
                    //条件中的数据都为空,则审查为正常
                    if (count==res.length()){
                        //更新用户数据,设为正常
                        user.setExaminationType("0");
                        mysqlCenlint.userService.updateById(user);
                    }
                }
            }
            //更新用户数据
            mysqlCenlint.userService.updateById(user);
        }
    }
    /**
     * 连接mysql数据库 修改
     * @param sql
     */
    public static void update(String sql) {
        sqlConnect(sql,1);
    }
    /**
     * 连接mysql数据库 删除
     * @param sql
     */
    public static void delete(String sql) {
        sqlConnect(sql,1);
    }
}
src/main/java/org/springblade/modules/desk/controller/NoticeController.java
@@ -153,7 +153,7 @@
                        "'" + notice.getCoverUrl() + "'" + "," +
                        "'" + notice.getType() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            //修改
@@ -174,7 +174,7 @@
                        ",type = " + "'" + notice.getType() + "'" +
                        " " + "where id = " + "'" + notice.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        return R.status(status);
@@ -193,7 +193,7 @@
            //内网同步
            String s1 = "delete from blade_notice where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        boolean temp = noticeService.deleteLogic(Func.toLongList(ids));
        return R.status(temp);
src/main/java/org/springblade/modules/directive/controller/DirectiveController.java
@@ -80,7 +80,7 @@
                    "'" + directive.getSendTime() + "'" + "," +
                    "'" + directive.getContent() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        if (status) {
            //新增图片
@@ -102,7 +102,7 @@
                            "'" + directiveFile.getDirectiveId() + "'" + "," +
                            "'" + urls+ "'"+ ")";
                    //FtpUtil.sqlFileUpload(s2);
                    myAsyncService.FTP(s2);
                    myAsyncService.dataSync(s2);
                    if (!status) {
                        return R.status(false);
                    }
@@ -133,7 +133,7 @@
                ",content = " + "'" + directive.getContent() + "'" +
                " " + "where id = " + "'" + directive.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        boolean status = false;
        if (update) {
@@ -157,7 +157,7 @@
                            "'" + directiveFile.getDirectiveId() + "'" + "," +
                            "'" + urls + "'"+ ")";
                    //FtpUtil.sqlFileUpload(s2);
                    myAsyncService.FTP(s2);
                    myAsyncService.dataSync(s2);
                    if (!status) {
                        R.status(false);
                    }
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java
@@ -165,7 +165,7 @@
                "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.status(status);
    }
@@ -206,7 +206,7 @@
                        "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            dispatcher.setUpdateTime(new Date());
@@ -255,7 +255,7 @@
                            "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                            " " + "where id = " + "'" + user1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            } else {
                //没有修改保安员,只修改了派遣时间等信息
@@ -274,7 +274,7 @@
                            ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                            " " + "where id = " + "'" + dispatcher.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        }
@@ -337,7 +337,7 @@
                                    "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                                    " " + "where id = " + "'" + user.getId() + "'";
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                            myAsyncService.dataSync(s1);
                        }
                    } else {
                        User user = new User();
@@ -363,7 +363,7 @@
                                "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                                " " + "where id = " + "'" + user.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                } else {
                    User user = new User();
@@ -389,7 +389,7 @@
                            "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            });
@@ -466,7 +466,7 @@
                                "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                                " " + "where id = " + "'" + user1.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                } else {
                    //修改原保安人员的派遣状态
@@ -511,7 +511,7 @@
                            "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                            " " + "where id = " + "'" + user1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            } else {
                //修改原保安人员的派遣状态
@@ -556,7 +556,7 @@
                        "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                        " " + "where id = " + "'" + user1.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            if (null != dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
@@ -585,7 +585,7 @@
                                ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                                " " + "where id = " + "'" + dispatcher.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                } else {
                    //没有修改保安员,只修改了派遣时间等信息
@@ -604,7 +604,7 @@
                            ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                            " " + "where id = " + "'" + dispatcher.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            } else {
                //没有修改保安员,只修改了派遣时间等信息
@@ -623,7 +623,7 @@
                        ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + dispatcher.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        return R.status(status);
@@ -643,7 +643,7 @@
            //内网同步
            String s1 = "delete from sys_dispatcher where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(dispatcherService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherUnitController.java
@@ -155,7 +155,7 @@
                        "'" + dispatcherUnit.getCell() + "'" + "," +
                        "'" + dispatcherUnit.getNum() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            //修改
@@ -184,12 +184,12 @@
                        ",num = " + "'" + dispatcherUnit.getNum() + "'" +
                        " " + "where id = " + "'" + dispatcherUnit.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
                //内网同步派遣记录修改合同时间
                String s2 =
                    "update sys_dispatcher set end_time = " + "'" + endTime + "'" + " " + "where dispatcher_unit_id = " + "'" + ids + "'";
                //FtpUtil.sqlFileUpload(s2);
                myAsyncService.FTP(s2);
                myAsyncService.dataSync(s2);
            }
        }
        return R.status(status);
@@ -208,7 +208,7 @@
            //内网同步
            String s1 = "delete from sys_dispatcher_unit where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(dispatcherUnitService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherUnitServiceImpl.java
@@ -188,7 +188,7 @@
                    "'" + dispatcherUnit.getCell() + "'" + "," +
                    "'" + dispatcherUnit.getNum() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
    }
}
src/main/java/org/springblade/modules/equipage/controller/CarController.java
@@ -107,7 +107,7 @@
                        "'" + car.getMode() + "'" + "," +
                        "'" + car.getJurisdiction() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
@@ -128,7 +128,7 @@
                        ",jurisdiction = " + "'" + car.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + car.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        return R.status(status);
@@ -147,7 +147,7 @@
            //内网同步
            String s1 = "delete from sys_car where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(carService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/equipage/controller/EquipageController.java
@@ -101,7 +101,7 @@
                        "'" + equipage.getPersonInCharge() + "'" + "," +
                        "'" + equipage.getNum() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            //修改
@@ -121,7 +121,7 @@
                        ",person_in_charge = " + "'" + equipage.getPersonInCharge() + "'" +
                        " " + "where id = " + "'" + equipage.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        return R.status(status);
@@ -140,7 +140,7 @@
            //内网同步
            String s1 = "delete from sys_equipage where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(equipageService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/equipage/controller/GunController.java
@@ -105,7 +105,7 @@
                        "'" + gun.getCardNo() + "'" + "," +
                        "'" + gun.getJurisdiction() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            //修改
@@ -124,7 +124,7 @@
                        ",card_no = " + "'" + gun.getCardNo() + "'" +
                        " " + "where id = " + "'" + gun.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        return R.status(status);
@@ -143,7 +143,7 @@
            //内网同步
            String s1 = "delete from sys_gun where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(gunService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/equipage/controller/fixed.java
@@ -116,7 +116,7 @@
                            "'" + liveLocation.getLatitude() + "'" + "," +
                            "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                } else {
                    status = liveLocationService.updateById(liveLocationInfo);
                    //内网同步
@@ -128,7 +128,7 @@
                            ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                            " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        }
@@ -201,7 +201,7 @@
                    }
                }
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
    }
@@ -268,7 +268,7 @@
                                    "'" + liveLocation.getLatitude() + "'" + "," +
                                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                            myAsyncService.dataSync(s1);
                        }
                    } else {
                        status = liveLocationService.updateById(liveLocationInfo);
@@ -282,7 +282,7 @@
                                    ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                                    " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                            myAsyncService.dataSync(s1);
                        }
                    }
                }
src/main/java/org/springblade/modules/equipage/service/impl/CarServiceImpl.java
@@ -92,7 +92,7 @@
                    "," + "'" + car.getUmweltsatz() + "'" +
                    "," + "'" + car.getMode() + "'" + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            });
        }else {
src/main/java/org/springblade/modules/equipage/service/impl/EquipageServiceImpl.java
@@ -109,7 +109,7 @@
                            "'" + new SimpleDateFormat("yyyy/MM/dd").format(equipage.getDateForProduction()) + "'" + "," +
                            "'" + equipage.getNum() + "'" + ")";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }else {
                    //数据推送
                    String s1 =
@@ -122,7 +122,7 @@
                            "'" + equipage.getBrand() + "'" + "," +
                            "'" + equipage.getNum() + "'" + ")";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            });
        }
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java
@@ -95,7 +95,7 @@
                        "'" + gun.getPersonInCharge() + "'" + "," +
                        "'" +gun.getCardNo() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            });
        }else {
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java
@@ -143,7 +143,7 @@
                "'" + "," + "'" + examPaper.getExamType() +
                "'" + "," + "'" + format + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        return R.status(save);
    }
@@ -162,7 +162,7 @@
                    ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getStartTime()) + "'" +
                    " " + "where id = " + "'" + exam.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(b);
    }
@@ -190,7 +190,7 @@
            //内网同步
            String s1 = "delete from ksxt_exam where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        boolean temp = examPaperService.removeByIds(Func.toLongList(ids));
        return R.status(temp);
@@ -291,7 +291,7 @@
                    + ",confirm_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getConfirmTime()) + "'"
                    + " " + "where id = " + "'" + exam.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        //返回数据
        return R.data(status);
@@ -321,7 +321,7 @@
                        + ",audit_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getAuditTime()) + "'"
                        + " " + "where id = " + "'" + examPaper.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
            //查询当前考试已报名的人员培训报名数据集合
            List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId());
@@ -363,7 +363,7 @@
                                + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'"
                                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
                        //FtpUtil.sqlFileUpload(s2);
                        myAsyncService.FTP(s2);
                        myAsyncService.dataSync(s2);
                    }
                });
            }
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -101,7 +101,8 @@
                "values(" + "'" + sid + "'" +
                "," + "'" + format + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            //数据同步
            myAsyncService.dataSync(s);
        }
        //返回
        return R.status(save);
@@ -156,7 +157,7 @@
                "update exam_score set qualified = " + "'" + examScore.getQualified() + "'" +
                    " " + "where id = " + "'" + examScore.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(status);
    }
@@ -224,7 +225,7 @@
                                ",user_type = " + "'" + user1.getUserType() + "'" +
                                " " + "where id = " + "'" + user1.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                }
            } else {
@@ -255,7 +256,7 @@
                ",qualified = " + "'" + examScore.getQualified() + "'" +
                " " + "where id = " + "'" + examScore.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        //本地修改
        return R.status(examScoreService.updateById(examScore));
@@ -283,7 +284,7 @@
            //内网同步
            String s1 = "delete from exam_score where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(examScoreService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -184,7 +184,7 @@
                    "update sys_apply set is_exam = " + apply1.getIsExam() + " " + "where id = " + "'" + apply1.getId() + "';" +
                        "update blade_user set is_apply = " + user.getIsApply() + " " + "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
            //培训考试
@@ -208,7 +208,7 @@
                    "update sys_training_registration set is_exam = " + trainingRegistration1.getIsExam() + " " + "where id = " + "'" + trainingRegistration1.getId() + "';" +
                        "update blade_user set is_train = " + user.getIsTrain() + " " + "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
            //设置提交时间
            examScore.setExamEndTime(new Date());
@@ -240,7 +240,7 @@
                    ",qualified = " + "'" + examScore.getQualified() + "'" +
                    " " + "where id = " + "'" + examScore.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
            if (i > 0) {
                //返回结果
@@ -357,7 +357,7 @@
//                                                    ",user_type = " + "'" + user.getUserType() + "'" +
//                                                    " " + "where id = " + "'" + user.getId() + "'";
                                            //FtpUtil.sqlFileUpload(s1);
                                            myAsyncService.FTP(s1);
                                            myAsyncService.dataSync(s1);
                                        }
                                    }
                                } else {
@@ -388,7 +388,7 @@
                                        ",qualified = " + "'" + examScore.getQualified() + "'" +
                                        " " + "where id = " + "'" + examScore.getId() + "'";
                                //FtpUtil.sqlFileUpload(s1);
                                myAsyncService.FTP(s1);
                                myAsyncService.dataSync(s1);
                                //更新成绩数据
                                baseMapper.updateById(examScore);
                            } else {
@@ -657,7 +657,7 @@
                            " " + "where id = " + "'" + user.getId() + "';" +
                            "delete from exam_score where id = " + "'" + updateParamVo.getScoreId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                    return true;
                }
@@ -688,7 +688,7 @@
                            " " + "where id = " + "'" + user.getId() + "';" +
                            "delete from exam_score where id = " + "'" + updateParamVo.getScoreId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                    return true;
                }
@@ -820,7 +820,7 @@
            "update sys_training_registration set is_exam = " + trainingRegistration1.getIsExam() + " " + "where id = " + "'" + trainingRegistration1.getId() + "';" +
                "update blade_user set is_train = " + user.getIsTrain() + " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
        //设置理论得分
        score.setTheoryGrade(count);
@@ -848,7 +848,7 @@
                ",qualified = " + "'" + score.getQualified() + "'" +
                " " + "where id = " + "'" + score.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        if (i > 0) {
            //返回结果
src/main/java/org/springblade/modules/exam/service/impl/ExamSubjectChoicesServiceImpl.java
@@ -404,7 +404,7 @@
            "," + "'" + examAnswerRecord.getAnswerResult() + "'" +
            "," + "'" + examAnswerRecord.getScoreId() + "'" + ")";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
    }
    /**
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
@@ -150,7 +150,7 @@
                    "update blade_user set is_train = " + "'" +  user.getIsTrain() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            } else {
                //实操成绩不为空
                if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
@@ -204,7 +204,7 @@
                                + "," + "'" + securityPaper.getApplyId() + "'"
                                + "," +"'" + securityPaper.getExamId() + "'" + ")";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                } else {
                    //不合格
@@ -245,7 +245,7 @@
                        ",is_train = " + "'" + user.getIsTrain() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        //审核时间
@@ -320,7 +320,7 @@
                        "update blade_user set is_train = " + "'" +  user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                } else {
                    //实操成绩不为空
                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
@@ -409,7 +409,7 @@
                            ",is_train = " + "'" + user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
            //审核时间
src/main/java/org/springblade/modules/experience/controller/ExperienceController.java
@@ -165,7 +165,7 @@
                    + ",securityId = " + "'" + experience.getSecurityid() + "'"
                    + " " + "where id = " + "'" + experience.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }else {
            //新增
@@ -191,7 +191,7 @@
                "," + "'" + experience.getSecurityid() + "'"
                + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        return R.status(status);
    }
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -270,7 +270,7 @@
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getRoleId() + "'" + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
        }
@@ -328,7 +328,7 @@
                ",licence = " + "'" + licences + "'" +
                " " + "where id = " + "'" + information.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.success("修改成功");
    }
@@ -366,23 +366,23 @@
            //保安公司信息
            String s1 = "delete from sys_information where departmentid = " + "'" + s + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
            //主要管理人
            String s2 = "delete from sys_shareholder where dept_id = " + "'" + s + "'";
            //FtpUtil.sqlFileUpload(s2);
            myAsyncService.FTP(s2);
            myAsyncService.dataSync(s2);
            //出资人
            String s3 = "delete from sys_member where dept_id = " + "'" + s + "'";
            //FtpUtil.sqlFileUpload(s3);
            myAsyncService.FTP(s3);
            myAsyncService.dataSync(s3);
            //组织机构信息逻辑删除
            String s4 = "update blade_dept set is_deleted  = 1 where id = " + "'" + s + "'";
            //FtpUtil.sqlFileUpload(s4);
            myAsyncService.FTP(s4);
            myAsyncService.dataSync(s4);
            //保安公司人员信息删除
            String s5 = "update blade_user set is_deleted  = 1 where dept_id " + "'" + s + "'";
            //FtpUtil.sqlFileUpload(s5);
            myAsyncService.FTP(s5);
            myAsyncService.dataSync(s5);
        });
        //返回
        return R.success("删除成功");
src/main/java/org/springblade/modules/location/controller/LiveLocationController.java
@@ -90,7 +90,7 @@
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                        "'" + liveLocation.getLocation() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            //更新
@@ -109,7 +109,7 @@
                        ",location = " + "'" + liveLocation.getLocation() + "'" +
                        " " + "where id = " + "'" + liveLocation.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
@@ -138,7 +138,7 @@
                    "'" + locus.getLongitude() + "'" + "," +
                    "'" + locus.getLatitude() + "'" + ")";
            //FtpUtil.sqlFileUpload(s2);
            myAsyncService.FTP(s2);
            myAsyncService.dataSync(s2);
            if (save1) {
                //返回数据
@@ -184,7 +184,7 @@
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                        "'" + liveLocation.getLocation() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            //更新
@@ -203,7 +203,7 @@
                        ",location = " + "'" + liveLocation.getLocation() + "'" +
                        " " + "where id = " + "'" + liveLocation.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
@@ -231,7 +231,7 @@
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(locus.getRecordTime()) + "'" + "," +
                    "'" + locus.getLongitude() + "'" + "," +
                    "'" + locus.getLatitude() + "'" + ")";
            myAsyncService.FTP(s2);
            myAsyncService.dataSync(s2);
            //FtpUtil.sqlFileUpload(s2);
            if (save1) {
src/main/java/org/springblade/modules/location/controller/LocusController.java
@@ -216,7 +216,7 @@
                    }
                }
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
                deletescsv(substring);
            }
            deletescsv(substring);
src/main/java/org/springblade/modules/member/controller/MemberController.java
@@ -115,7 +115,7 @@
                    "'" + member.getCreditcode() + "'" + "," +
                    "'" + member.getDeptId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(save);
    }
@@ -138,7 +138,7 @@
                ",dept_id = " + "'" + member.getDeptId() + "'" +
                " " + "where id = " + "'" + member.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(b);
    }
@@ -166,7 +166,7 @@
        list.forEach(id -> {
            String s1 = "delete from sys_member where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(memberService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/performance/controller/PerformanceController.java
@@ -101,7 +101,7 @@
                "'" + new SimpleDateFormat("yyyy-MM-dd").format(performance.getTime()) + "'" + "," +
                "'" + performance.getScore() + "'" + ")";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.status(save);
    }
@@ -120,7 +120,7 @@
            ",score = " + "'" + performance.getScore() + "'" +
            " " + "where id = " + "'" + performance.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.status(b);
    }
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -186,7 +186,7 @@
            + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
            "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
        return R.success("许可提交成功");
    }
@@ -223,7 +223,7 @@
                "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
                + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
                "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        //返回
        return R.data(permit);
@@ -355,7 +355,7 @@
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ")";
                myAsyncService.FTP(s);
                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() + "'" +
@@ -425,12 +425,12 @@
                //把附件添加单位id
                String s1 = "update sys_permit set type = " + "'" + 0 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                    " " + "where id = " + "'" + permit.getId() + "'";
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                " " + "where id = " + "'" + permit.getId() + "'";
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.success("成功");
    }
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -143,7 +143,7 @@
            recordService.removeByIds(Func.toLongList(id));
            String s1 = "delete from sys_record where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        record.setStorage("1");
        record.setType("2");
@@ -160,7 +160,7 @@
                "," + "'" + record.getStorage() + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOvertime()) + "'"
                + ")";
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        return R.success("成功");
    }
@@ -281,7 +281,7 @@
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ")";
                myAsyncService.FTP(s);
                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() + "'" +
@@ -362,7 +362,7 @@
                ",stime = " + "'" + record.getStime() + "'" +
                ",xtime = " + "'" + record.getXtime() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        } else {
            String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                ",papprove = " + "'" + record.getPapprove() + "'" +
@@ -375,7 +375,7 @@
                ",stime = " + "'" + record.getStime() + "'" +
                ",xtime = " + "'" + record.getXtime() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(recordService.saveOrUpdate(record));
    }
src/main/java/org/springblade/modules/recordLegalperson/controller/RecordLegalpersonController.java
@@ -143,7 +143,7 @@
            recordService.removeByIds(Func.toLongList(id));
            String s1 = "delete from sys_record where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        record.setStorage("1");
        record.setType("2");
@@ -168,7 +168,7 @@
            "," + "'" + record.getChangecontactscell() + "'" +
            ")";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
        return R.success("成功");
    }
@@ -227,7 +227,7 @@
                            ",representativecell = " + "'" + information1.getRepresentativecell()  + "'" +
                            " " + "where id = " + "'" + information1.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }else {
                //按组织机构查询
                Information information2 = new Information();
@@ -251,7 +251,7 @@
                        ",representativecell = " + "'" + information1.getRepresentativecell()  + "'" +
                        " " + "where id = " + "'" + information1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }else {
                    //设置未审核不通过
                    record.setType("1");
@@ -262,7 +262,7 @@
                        ",approve = " + "'" + record.getApprove() + "'" +
                        " " + "where id = " + "'" + record.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                    throw new ServiceException("当前公司单位未保安服务系统存在,请先注册!");
                }
            }
@@ -276,7 +276,7 @@
                ",approve = " + "'" + record.getApprove() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        //返回数据
        return R.status(status);
src/main/java/org/springblade/modules/recordk/controller/RecordkController.java
@@ -182,7 +182,7 @@
        String s1 = "update sys_recordk set type = " + "'" + 0 + "'" + ",approve = " + "'" + recordk.getApprove() + "'" +
            " " + "where id = " + "'" + recordk.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.status(b);
    }
src/main/java/org/springblade/modules/registerUnit/controller/RegisterUnitController.java
@@ -319,7 +319,7 @@
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getRoleId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
    }
}
src/main/java/org/springblade/modules/resource/controller/AttachController.java
@@ -134,7 +134,7 @@
            //内网同步
            String s1 = "delete from blade_attach where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(attachService.deleteLogic(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -225,8 +225,8 @@
                in, in.available(), -1)
                .headers(headers)
                .build());
        InputStream inputStream = file.getInputStream();
        FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//        InputStream inputStream = file.getInputStream();
//        FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
        in.close();
        String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
        //数据封装
@@ -277,8 +277,8 @@
                in, in.available(), -1)
                .headers(headers)
                .build());
        InputStream inputStream = file.getInputStream();
        FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//        InputStream inputStream = file.getInputStream();
//        FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
        in.close();
        String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
        return R.data(urls);
@@ -324,8 +324,8 @@
                in, in.available(), -1)
                .headers(headers)
                .build());
        InputStream inputStream = file.getInputStream();
        FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//        InputStream inputStream = file.getInputStream();
//        FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
        in.close();
        String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
        //数据封装
@@ -434,13 +434,15 @@
                    //内网数据推送
                    //数据推送
                    String s = "update blade_user set avatar = " + "'" + inUrl + "'" + "where id = " + "'" + user.getId() + "'";
                    String s = "update blade_user set avatar = " + "'" + inUrl +
                        ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" +
                        "'" + "where id = " + "'" + user.getId() + "'";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                    //文件推送
                    InputStream inputStream = multipartFile.getInputStream();
                    FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//                    InputStream inputStream = multipartFile.getInputStream();
//                    FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
                    in.close();
                }
            }
@@ -559,11 +561,11 @@
                        "," + "'" + examPayment.getPaymentStatus() + "'" +
                        "," +"'" + inUrl + "'" + ")";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                    //文件推送
                    InputStream inputStream = multipartFile.getInputStream();
                    FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//                    InputStream inputStream = multipartFile.getInputStream();
//                    FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
                    in.close();
                }
            }
@@ -619,8 +621,8 @@
                .build());
        //文件推送
        InputStream inputStream = file.getInputStream();
        FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
//        InputStream inputStream = file.getInputStream();
//        FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream);
        in.close();
        String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName;
        //数据封装
@@ -756,7 +758,7 @@
            s1 += ")";
        }
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return attach.getId();
    }
src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
@@ -123,7 +123,7 @@
                + revoke.getType() + "'" + "," + "'" + revoke.getDeptid() + "'" + "," + "'" + revoke.getPtype() + "'" + "," +
                "'" + revoke.getRepresentativecell() + "'" + "," + "'" + revoke.getContacts() + "'" + "," + "'" + revoke.getContactscell() + "'" + "," +
                "'" + revoke.getReason() + "'" + "," + "'" + revoke.getJurisdiction() + "'" + "," + "'" + revoke.getCardid() + "'" + ")";
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        return R.success("成功");
    }
src/main/java/org/springblade/modules/securityapply/service/impl/SecurityApplyServiceImpl.java
@@ -101,7 +101,7 @@
                            ",securitynumber = " + "'" + user.getSecuritynumber() + "'" +
                            ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:dd").format(user.getUpdateTime()) + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        }
src/main/java/org/springblade/modules/seinspect/controller/SeinspectController.java
@@ -121,7 +121,7 @@
                    "'" + seinspect.getJurisdiction() + "'" + "," +
                    "'" + seinspect.getSecurityId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.success("成功");
    }
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java
@@ -115,7 +115,7 @@
                    "'" + shareholder.getCreditcode() + "'" + "," +
                    "'" + shareholder.getDeptId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        } else {
            String s1 =
                "insert into sys_shareholder(id,shareholder,shareholdingratio,capital,capitalTime,cardid,cell,creditCode,dept_id) " +
@@ -129,7 +129,7 @@
                    "'" + shareholder.getCreditcode() + "'" + "," +
                    "'" + shareholder.getDeptId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(save);
    }
@@ -153,7 +153,7 @@
                ",dept_id = " + "'" + shareholder.getDeptId() + "'" +
                " " + "where id = " + "'" + shareholder.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        } else {
            //内网同步
            String s1 = "update sys_shareholder set shareholder = " + "'" + shareholder.getShareholder() + "'" +
@@ -166,7 +166,7 @@
                ",dept_id = " + "'" + shareholder.getDeptId() + "'" +
                " " + "where id = " + "'" + shareholder.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.status(b);
    }
@@ -194,7 +194,7 @@
        list.forEach(id -> {
            String s1 = "delete from sys_shareholder where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(shareholderService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/system/controller/DeptController.java
@@ -280,7 +280,7 @@
                        + ",is_deleted = " + "'" + dept.getIsDeleted() + "'"
                        + " " + "where id = " + "'" + dept.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
//            String id = kv.get("id").toString();
//            information.setDepartmentid(id);
@@ -312,7 +312,7 @@
            //内网同步
            String s1 = "update blade_dept set is_deleted = 1 where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(deptService.removeDept(ids));
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -274,7 +274,7 @@
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getJurisdiction() + "'"
                    + ")";
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
        } else {
            //修改
@@ -295,7 +295,7 @@
                        + ",cardid = " + "'" + user.getCardid() + "'"
                        + ",guncode = " + "'" + user.getGuncode() + "'"
                        + " " + "where id = " + "'" + user.getId() + "'";
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
@@ -373,7 +373,7 @@
                                "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'"
                                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
                                    + " " + "where id = " + "'" + dispatcher1.getId() + "'";
                            myAsyncService.FTP(s1);
                            myAsyncService.dataSync(s1);
                        }
                    });
                }
@@ -398,7 +398,7 @@
                        "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
                            + " " + "where id = " + "'" + experience1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                } else {
                    //新增
                    if (null != user.getRtime()) {
@@ -427,7 +427,7 @@
                            "," + "'" + experience.getCompanyname() + "'" +
                            "," + "'" + experience.getSecurityid() + "'"
                            + ")";
                        myAsyncService.FTP(s);
                        myAsyncService.dataSync(s);
                    }
                }
@@ -438,10 +438,10 @@
                    //内网更新
                    String s1 =
                        "update blade_user set status = " + "'" + user.getStatus() + "'"
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
                            + " " + "where id = " + "'" + user.getId() + "'";
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
                return R.success("修改成功");
            }
        }
@@ -526,7 +526,7 @@
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        } else {
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
            String s1 =
@@ -560,7 +560,7 @@
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        if (!states) {
            return R.data(201,null,"保安证编号不匹配,请核实!也可通过提供保安证件信息提交核实申请!");
@@ -636,7 +636,7 @@
                + ",cell = " + "'" + user.getCell() + "'"
                + " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.success("修改成功");
    }
@@ -744,7 +744,7 @@
                    "update sys_accreditation_records set status = " + "'" + accreditationRecords1.getStatus() + "'" +
                    " " + "where id = " + "'" + accreditationRecords1.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
            //返回
            return R.success("修改成功");
        }
@@ -755,7 +755,7 @@
                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                + " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        return R.success("修改成功");
    }
@@ -778,9 +778,11 @@
            //qfqk 同步
            myAsyncService.deleteUserByQfqk(user1);
            //内网同步
            String s1 = "update blade_user set is_deleted = 1 where id = " + "'" + id + "'";
            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.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(userService.removeUser(ids));
    }
@@ -1201,7 +1203,7 @@
                                ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'" +
                                " where id = " + "'" + user2.getId() + "'";
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                            myAsyncService.dataSync(s1);
                            //人员离职后修改派遣记录,修改从业记录
                            updateUserDispatcherExp(user2);
@@ -1349,7 +1351,7 @@
                "," + "'" + experience.getCompanyname() + "'" +
                "," + "'" + experience.getSecurityid() + "'"
                + ")";
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
@@ -1397,7 +1399,7 @@
                        + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
                        + " " + "where id = " + "'" + dispatcher1.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            });
        }
@@ -1420,7 +1422,7 @@
                "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
                    + " " + "where id = " + "'" + experience1.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        } else {
            //新增
            if (null != user.getRtime()) {
@@ -1450,7 +1452,7 @@
                "," + "'" + experience.getSecurityid() + "'"
                + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
    }
src/main/java/org/springblade/modules/system/service/MyAsyncService.java
@@ -1,8 +1,10 @@
package org.springblade.modules.system.service;
import net.sf.json.JSONObject;
import org.springblade.common.config.DataSyncConfig;
import org.springblade.common.utils.HttpClientUtils;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.dataSync.MysqlCenlint;
import org.springblade.modules.system.dto.UserDTO;
import org.springblade.modules.system.entity.User;
import org.springframework.scheduling.annotation.Async;
@@ -158,4 +160,51 @@
            }
        }
    }
    /**
     * 数据同步
     * @param sql
     */
    @Async
    public void dataSync(String sql) {
        //判断同步类型
        //sql 直连处理
        if (DataSyncConfig.type.equals("sql")) {
            sqlDataHandler(sql);
        }
        //ftp 连接同步
        if (DataSyncConfig.type.equals("ftp")){
            FTP(sql);
        }
    }
    /**
     *  sql 直连处理
     * @param sql sql
     */
    @Async
    public void sqlDataHandler(String sql) {
        //以逗号分割
        String[] split = sql.split(";");
        if (null!=split && split.length>0) {
            for (String sqls : split) {
                //判断是否是新增,删除,修改
                String substring = sqls.substring(0, 2);
                //新增
                if (substring.equals("in")) {
                    //运行sql语句
                    MysqlCenlint.inster(sqls);
                }
                //修改
                else if (substring.equals("up")) {
                    MysqlCenlint.update(sqls);
                }
                //删除
                else {
                    MysqlCenlint.delete(sqls);
                }
            }
        }
    }
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -150,7 +150,7 @@
            "," + "'" + user.getIsDeleted() + "'"
            + ")";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
        return b;
    }
@@ -551,7 +551,7 @@
                    "," + "'" + user.getJurisdiction() + "'"
                    + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }else {
                //匹配组织机构是否一致,如果不一致
                if(!user2.getDeptId().equals(user.getDeptId())){
@@ -589,7 +589,7 @@
                            + ",cardid = " + "'" + user2.getCardid() + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        });
@@ -1044,7 +1044,7 @@
                                + ",registered = " + "'" + user2.getRegistered() + "'"
                                + " " + "where id = " + "'" + user2.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }else {
                        status.set(false);
                        //加入集合
@@ -1104,7 +1104,7 @@
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        }
@@ -1418,7 +1418,7 @@
                    "," + "'" + experience.getSecurityid() + "'"
                    + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
            }
            else {
                //匹配组织机构是否一致,如果不一致
@@ -1478,7 +1478,7 @@
                                + ",registered = " + "'" + user2.getRegistered() + "'"
                                + " " + "where id = " + "'" + user2.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }else {
                        status.set(false);
                        //加入集合
@@ -1547,7 +1547,7 @@
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        });
@@ -2033,7 +2033,7 @@
                            + ",registered = " + "'" + user2.getRegistered() + "'"
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                }
            }
        }
src/main/java/org/springblade/modules/talk/controller/TalkController.java
@@ -122,7 +122,7 @@
                    "'" + talk.getDeptid() + "'" + "," +
                    "'" + talk.getImgurl() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.success("新增成功");
    }
@@ -154,7 +154,7 @@
                ",imgurl = " + "'" + talk.getImgurl() + "'" +
                " " + "where id = " + "'" + talk.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        }
        return R.success("修改成功");
    }
@@ -183,7 +183,7 @@
            //内网同步
            String s1 = "delete from sys_talk where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(talkService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java
@@ -170,7 +170,7 @@
            + "," +"'" + trainingRegistration.getAuditStatus() + "'" + ");" +
            "update blade_user set is_train = " + user1.getIsTrain() + " " +"where id = " + "'" + user1.getId() + "'";
        //FtpUtil.sqlFileUpload(sql);
        myAsyncService.FTP(sql);
        myAsyncService.dataSync(sql);
    }
@@ -300,7 +300,7 @@
                " " +"where id = " + "'" + trainingRegistration.getId() + "';" +
                "update blade_user set is_train = " + user.getIsTrain() + " " +"where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
    }
    /**
@@ -634,7 +634,7 @@
                    "," + "'" + creatorTimeFormat +"'" +
                    ","  +"'" + examPaper.getAuditStatus() + "'" + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                myAsyncService.dataSync(s);
                //修改报名信息
@@ -650,7 +650,7 @@
                                + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'"
                                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                });
            }
@@ -707,7 +707,7 @@
                "," + "'" + creatorTimeFormat +"'" +
                ","  +"'" + examPaper.getAuditStatus() + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
            //修改报名信息
            list.forEach(id ->{
@@ -725,7 +725,7 @@
                                + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'"
                                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                        myAsyncService.dataSync(s1);
                    }
                }
            });
@@ -751,7 +751,7 @@
            "update sys_training_registration set vip_status = " + "'" + trainingRegistration.getVipStatus() + "'"
                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        myAsyncService.dataSync(s1);
        //更新并返回数据
        return R.data(trainingRegistrationService.updateById(trainingRegistration));
    }
@@ -779,7 +779,7 @@
                        "update sys_training_registration set vip_status = " + "'" + registration.getVipStatus() + "'"
                            + " " + "where id = " + "'" + registration.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    myAsyncService.dataSync(s1);
                    //更新
                    trainingRegistrationService.updateById(registration);
                }
src/main/java/org/springblade/modules/training/service/impl/TrainingRegistrationServiceImpl.java
@@ -296,7 +296,7 @@
            + "," +"'" + trainingRegistration.getAuditStatus() + "'" + ");" +
            "update blade_user set is_train = " + user1.getIsTrain() + " " +"where id = " + "'" + user1.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        myAsyncService.dataSync(s);
    }
@@ -410,7 +410,7 @@
                                    + "'" + examScore.getApplyId() + "'" + ","
                                    + "'" + examScore.getExamId() + "'" + ")";
                            //FtpUtil.sqlFileUpload(s);
                            myAsyncService.FTP(s);
                            myAsyncService.dataSync(s);
                        }
                    }
                }
@@ -474,7 +474,7 @@
                                ",qualified = " + "'" + examScore1.getQualified() + "'" +
                                " " + "where id = " + "'" + examScore1.getId() + "'";
                        //FtpUtil.sqlFileUpload(s);
                        myAsyncService.FTP(s);
                        myAsyncService.dataSync(s);
                    });
                }else {
                    //数据同步
@@ -482,7 +482,7 @@
                        "update sys_training_registration set is_exam = " + trainingRegistration1.getIsExam() +
                            " " + "where id = " + "'" + trainingRegistration1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    myAsyncService.dataSync(s);
                }
            });
        }
src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java
@@ -124,7 +124,7 @@
                        "'" + workReport.getCategory() + "'" + "," +
                        "'" + workReport.getUserId() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        } else {
            workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
@@ -149,7 +149,7 @@
                        ",user_id = " + "'" + workReport.getUserId() + "'" +
                        " " + "where id = " + "'" + workReport.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                myAsyncService.dataSync(s1);
            }
        }
        return R.status(status);
@@ -168,7 +168,7 @@
            //内网同步
            String s1 = "delete from sys_work_report where id = " + "'" + id + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            myAsyncService.dataSync(s1);
        });
        return R.status(workReportService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -188,7 +188,7 @@
                "," + "'" + user.getExaminationType() + "'" +
                "," + "'" + user.getDispatch() + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            myAsyncService.dataSync(s);
        }
        return R.status(zcService.updateById(zc));
src/main/resources/application-dev.yml
@@ -24,9 +24,9 @@
  datasource:
    # MySql
    url: jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    url: jdbc:mysql://localhost:3306/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: ZHba@0112
    password: NCzhba@2022
    # PostgreSQL
    #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
@@ -68,6 +68,15 @@
#  qfqkBaseApiUrl: http://61.131.136.25:2082/api
  qfqkBaseApiUrl: http://localhost:83
# 数据同步配置
data:
  sync:
    type: sql
    driver: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/zhba?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    username: root
    password: NCzhba@2022
#第三方登陆
social:
  enabled: true
src/main/resources/application-test.yml
@@ -58,7 +58,7 @@
#ftp 设置
ftp:
  sqlConnect: jdbc:mysql://localhost:3306/zhbaw-test?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  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
  ftpHost: 117.40.91.118
  ftpPort: 21
  ftpUserName: zhbain
@@ -72,6 +72,15 @@
  qfqkBaseApiUrl: http://192.168.0.198:83
#  qfqkBaseApiUrl : http://61.131.136.25:2082/api
# 数据同步配置
data:
  sync:
    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
    username: root
    password: NCzhba@2022
#第三方登陆
social:
  enabled: true