智慧保安后台管理-外网
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
FTP异步处理
50 files modified
3840 ■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 67 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/accreditation/service/impl/AccreditationRecordsServiceImpl.java 59 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ApplyController.java 306 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ExamPaymentController.java 13 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java 15 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/coinspect/controller/CoinspectController.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/desk/controller/NoticeController.java 83 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/directive/controller/DirectiveController.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java 193 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherUnitController.java 105 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherUnitServiceImpl.java 26 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/CarController.java 91 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/EquipageController.java 87 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/GunController.java 88 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/fixed.java 64 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/CarServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/EquipageServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java 221 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java 120 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java 21 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 216 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamSubjectChoicesServiceImpl.java 103 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java 18 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/experience/controller/ExperienceController.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 215 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/controller/LiveLocationController.java 155 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/controller/LocusController.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/controller/MemberController.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/performance/controller/PerformanceController.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java 246 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/controller/RecordController.java 286 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordLegalperson/controller/RecordLegalpersonController.java 20 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recordk/controller/RecordkController.java 21 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/registerUnit/controller/RegisterUnitController.java 5 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/controller/AttachController.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java 11 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/revoke/controller/RevokeController.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/seinspect/controller/SeinspectController.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/DeptController.java 11 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 400 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/MyAsyncService.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 37 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/talk/controller/TalkController.java 61 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java 25 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/service/impl/TrainingRegistrationServiceImpl.java 15 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java 110 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/controller/ZcController.java 5 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -38,8 +38,7 @@
    public SecureRegistry secureRegistry() {
        SecureRegistry secureRegistry = new SecureRegistry();
        secureRegistry.setEnabled(true);
        secureRegistry.excludePathPatterns("/blade-auth/**");
//        secureRegistry.excludePathPatterns("/blade-user/**");
        secureRegistry.excludePathPatterns("/blade-auth/**");secureRegistry.excludePathPatterns("/blade-user/**");
        secureRegistry.excludePathPatterns("/blade-system/menu/routes");
        secureRegistry.excludePathPatterns("/blade-system/menu/auth-routes");
        secureRegistry.excludePathPatterns("/blade-system/menu/top-menu");
@@ -53,38 +52,38 @@
        secureRegistry.excludePathPatterns("/webjars/**");
        secureRegistry.excludePathPatterns("/swagger-resources/**");
        secureRegistry.excludePathPatterns("/druid/**");
//        secureRegistry.excludePathPatterns("/performance/**");
//        secureRegistry.excludePathPatterns("/information/**");
//        secureRegistry.excludePathPatterns("/shareholder/**");
//        secureRegistry.excludePathPatterns("/member/**");
//        secureRegistry.excludePathPatterns("/honor/**");
//        secureRegistry.excludePathPatterns("/dispatcher/**");
//        secureRegistry.excludePathPatterns("/employment/**");
//        secureRegistry.excludePathPatterns("/train/**");
//        secureRegistry.excludePathPatterns("/examination/**");
//        secureRegistry.excludePathPatterns("/experience/**");
//        secureRegistry.excludePathPatterns("/record/**");
//        secureRegistry.excludePathPatterns("/revoke/**");
//        secureRegistry.excludePathPatterns("/recordk/**");
//        secureRegistry.excludePathPatterns("/jurisdiction/**");
//        secureRegistry.excludePathPatterns("/permit/**");
//        secureRegistry.excludePathPatterns("/car/**");
//        secureRegistry.excludePathPatterns("/gun/**");
//        secureRegistry.excludePathPatterns("/equipage/**");
//        secureRegistry.excludePathPatterns("/blade-user/**");
//        secureRegistry.excludePathPatterns("/trainingRegistration/**");
//        secureRegistry.excludePathPatterns("/seinspect/**");
//        secureRegistry.excludePathPatterns("/coinspect/**");
//        secureRegistry.excludePathPatterns("/blade-user/**");
//        secureRegistry.excludePathPatterns("/pushMsg/**");
//        secureRegistry.excludePathPatterns("/owner/**");
//        secureRegistry.excludePathPatterns("/friend/**");
//        secureRegistry.excludePathPatterns("/chat-records/**");
//        secureRegistry.excludePathPatterns("/chatgroup/**");
//        secureRegistry.excludePathPatterns("/chatgroupc/**");
//        secureRegistry.excludePathPatterns("/zc/**");
//        secureRegistry.excludePathPatterns("/licet/**");
//        secureRegistry.excludePathPatterns("/licetuser/**");
        secureRegistry.excludePathPatterns("/performance/**");
        secureRegistry.excludePathPatterns("/information/**");
        secureRegistry.excludePathPatterns("/shareholder/**");
        secureRegistry.excludePathPatterns("/member/**");
        secureRegistry.excludePathPatterns("/honor/**");
        secureRegistry.excludePathPatterns("/dispatcher/**");
        secureRegistry.excludePathPatterns("/employment/**");
        secureRegistry.excludePathPatterns("/train/**");
        secureRegistry.excludePathPatterns("/examination/**");
        secureRegistry.excludePathPatterns("/experience/**");
        secureRegistry.excludePathPatterns("/record/**");
        secureRegistry.excludePathPatterns("/revoke/**");
        secureRegistry.excludePathPatterns("/recordk/**");
        secureRegistry.excludePathPatterns("/jurisdiction/**");
        secureRegistry.excludePathPatterns("/permit/**");
        secureRegistry.excludePathPatterns("/car/**");
        secureRegistry.excludePathPatterns("/gun/**");
        secureRegistry.excludePathPatterns("/equipage/**");
        secureRegistry.excludePathPatterns("/blade-user/**");
        secureRegistry.excludePathPatterns("/trainingRegistration/**");
        secureRegistry.excludePathPatterns("/seinspect/**");
        secureRegistry.excludePathPatterns("/coinspect/**");
        secureRegistry.excludePathPatterns("/blade-user/**");
        secureRegistry.excludePathPatterns("/pushMsg/**");
        secureRegistry.excludePathPatterns("/owner/**");
        secureRegistry.excludePathPatterns("/friend/**");
        secureRegistry.excludePathPatterns("/chat-records/**");
        secureRegistry.excludePathPatterns("/chatgroup/**");
        secureRegistry.excludePathPatterns("/chatgroupc/**");
        secureRegistry.excludePathPatterns("/zc/**");
        secureRegistry.excludePathPatterns("/licet/**");
        secureRegistry.excludePathPatterns("/licetuser/**");
        return secureRegistry;
    }
src/main/java/org/springblade/modules/accreditation/controller/AccreditationRecordsController.java
@@ -29,6 +29,7 @@
import org.springblade.modules.accreditation.entity.AccreditationRecords;
import org.springblade.modules.accreditation.service.AccreditationRecordsService;
import org.springblade.modules.accreditation.vo.AccreditationRecordsVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.*;
@@ -56,7 +57,7 @@
    private final AccreditationRecordsService accreditationRecordsService;
    private final IUserService userService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
@@ -101,7 +102,8 @@
        "update blade_user set user_type = " + "'" + user.getUserType() + "'" +
            ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
            " " + "where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        return R.data(save);
    }
@@ -156,7 +158,8 @@
                        "update blade_user set user_type = " + user.getUserType() + "" +
                        ",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
                        "where id = " + "'" + user.getId() + "'";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            }else {
                //内网同步
                String s =
@@ -165,7 +168,8 @@
                        ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "'";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            }
        }else {
            //内网同步
@@ -175,7 +179,8 @@
                    ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                    ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                    "where id = " + "'" + accreditationRecords.getId() + "'";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
        //返回
        return R.status(b);
@@ -217,7 +222,8 @@
                            "update blade_user set user_type = " + user.getUserType() + "" +
                            ",update_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "" +
                            "where id = " + "'" + user.getId() + "'";
                    FtpUtil.sqlFileUpload(s);
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                }else {
                    //内网同步
                    String s =
@@ -226,7 +232,8 @@
                            ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                            ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                            "where id = " + "'" + accreditationRecords.getId() + "'";
                    FtpUtil.sqlFileUpload(s);
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                }
            }else {
                //内网同步
@@ -236,7 +243,8 @@
                        ",audit_time = " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(accreditationRecords.getAuditTime()) + "" +
                        ",audit_user = " + accreditationRecords.getAuditUser() + " " +
                        "where id = " + "'" + accreditationRecords.getId() + "'";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            }
        });
        //返回
src/main/java/org/springblade/modules/accreditation/service/impl/AccreditationRecordsServiceImpl.java
@@ -12,6 +12,8 @@
import org.springblade.modules.accreditation.mapper.AccreditationRecordsMapper;
import org.springblade.modules.accreditation.service.AccreditationRecordsService;
import org.springblade.modules.accreditation.vo.AccreditationRecordsVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.MalformedURLException;
@@ -25,15 +27,18 @@
/**
 * 制证记录服务实现类
 *
 * @author zhongrj
 */
@Service
@AllArgsConstructor
public class AccreditationRecordsServiceImpl extends ServiceImpl<AccreditationRecordsMapper, AccreditationRecords> implements AccreditationRecordsService {
    @Autowired
    private MyAsyncService myAsyncService;
    /**
     * 自定义分页
     *
     * @param page
     * @param accreditationRecords
     * @return
@@ -46,6 +51,7 @@
    /**
     * 制证申请(批量)
     *
     * @param accreditationRecords 制证记录信息对象
     */
    @Override
@@ -53,7 +59,7 @@
        //读取ids
        List<String> list = Arrays.asList(accreditationRecords.getIds().split(","));
        //遍历
        list.forEach(id->{
        list.forEach(id -> {
            AccreditationRecords records = new AccreditationRecords();
            records.setCreateTime(new Date());
            records.setCreateUser(accreditationRecords.getCreateUser());
@@ -62,10 +68,10 @@
            records.setType(accreditationRecords.getType());
            records.setUserId(Long.parseLong(id));
            //判断类型,如果是上岗证则判断是否有申请,有申请的不在新增记录
            if (accreditationRecords.getType()==1){
            if (accreditationRecords.getType() == 1) {
                //查询当前人员是否有申请记录
                int count  = baseMapper.getAccreditationRecordsByUserIdCount(id);
                if (count<1){
                int count = baseMapper.getAccreditationRecordsByUserIdCount(id);
                if (count < 1) {
                    //新增
                    this.save(records);
@@ -74,18 +80,19 @@
                        "values(" + "'" + records.getId() + "'" + ","
                        + "'" + records.getUserId() + "'" + ","
                        + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(records.getCreateTime()) + "'" + ","
                        + "'" + records.getCreateUser() +"'" + ","
                        + "'" + records.getStatus() +"'" + ","
                        + "'" + records.getType() +"'" + ","
                        +"'" + records.getAuditStatus() + "'" + ")";
                    FtpUtil.sqlFileUpload(s);
                        + "'" + records.getCreateUser() + "'" + ","
                        + "'" + records.getStatus() + "'" + ","
                        + "'" + records.getType() + "'" + ","
                        + "'" + records.getAuditStatus() + "'" + ")";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                }
            }
            //判断类型,如果是证书的,审核未通过的可以再次申请,审核通过的,暂时不给于新增记录
            if (accreditationRecords.getType()==2){
            if (accreditationRecords.getType() == 2) {
                //查询当前人员是否有待审核和审核通过的记录数
                int count  = baseMapper.getAccreditationRecordsByUserIdAuditCount(id,2);
                if (count<1){
                int count = baseMapper.getAccreditationRecordsByUserIdAuditCount(id, 2);
                if (count < 1) {
                    //新增
                    this.save(records);
@@ -94,11 +101,12 @@
                        "values(" + "'" + records.getId() + "'" + ","
                        + "'" + records.getUserId() + "'" + ","
                        + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(records.getCreateTime()) + "'" + ","
                        + "'" + records.getCreateUser() +"'" + ","
                        + "'" + records.getStatus() +"'" + ","
                        + "'" + records.getType() +"'" + ","
                        +"'" + records.getAuditStatus() + "'" + ")";
                    FtpUtil.sqlFileUpload(s);
                        + "'" + records.getCreateUser() + "'" + ","
                        + "'" + records.getStatus() + "'" + ","
                        + "'" + records.getType() + "'" + ","
                        + "'" + records.getAuditStatus() + "'" + ")";
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                }
            }
@@ -108,6 +116,7 @@
    /**
     * 自定义详情信息
     *
     * @param accreditationRecords
     * @return
     */
@@ -118,6 +127,7 @@
    /**
     * 导出保安员证信息
     *
     * @param accreditationRecords
     * @return
     */
@@ -125,7 +135,7 @@
    public List<ExportSecurityPaperExcel> exportSecurityPaperList(AccreditationRecordsVo accreditationRecords) {
        //查询数据
        List<AccreditationRecordsVo> accreditationRecordsVos = baseMapper.exportSecurityPaperList(accreditationRecords);
        if (accreditationRecordsVos.size()>0) {
        if (accreditationRecordsVos.size() > 0) {
            //返回的集合数据
            List<ExportSecurityPaperExcel> list = new ArrayList<>();
            //遍历
@@ -144,9 +154,9 @@
                excel.setRealName(accreditationRecordsVo.getRealName());
                excel.setIdCardNo(accreditationRecordsVo.getIdCardNo());
                excel.setDeptName(accreditationRecordsVo.getDeptName());
                if (accreditationRecordsVo.getSex().equals("1")){
                if (accreditationRecordsVo.getSex().equals("1")) {
                    excel.setSex("男");
                }else {
                } else {
                    excel.setSex("女");
                }
                excel.setPaperTime(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
@@ -186,6 +196,7 @@
    /**
     * 导出证书制证信息
     *
     * @param accreditationRecords
     * @return
     */
@@ -209,6 +220,7 @@
    /**
     * 批量修改为已制证
     *
     * @param accreditationRecords 制证记录信息对象
     */
    @Override
@@ -216,7 +228,7 @@
        //读取ids
        List<String> list = Arrays.asList(accreditationRecords.getIds().split(","));
        //遍历
        list.forEach(id->{
        list.forEach(id -> {
            AccreditationRecords records = new AccreditationRecords();
            records.setStatus(2);
            records.setId(Long.parseLong(id));
@@ -227,7 +239,8 @@
            String s =
                "update sys_accreditation_records set status = " + accreditationRecords.getStatus() + "" +
                    "where id = " + "'" + accreditationRecords.getId() + "'";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        });
        return true;
    }
src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -31,6 +31,7 @@
import org.springblade.modules.exam.service.ExamScoreService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.training.vo.TrainingRegistrationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -56,20 +57,22 @@
@RequestMapping("/apply")
public class ApplyController {
//    @Autowired
    //    @Autowired
    private final ApplyService applyService;
//    @Autowired
    //    @Autowired
    private final ExamPaperService examPaperService;
//    @Autowired
    //    @Autowired
    private final IUserService userService;
//    @Autowired
    //    @Autowired
    private final ExamScoreService examScoreService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     *
     * @param query page,size
     * @param apply 考试报名信息对象
     */
@@ -90,14 +93,15 @@
    /**
     * 新增报名
     *
     * @param apply 考试报名信息对象
     */
    @PostMapping("/save")
    @ApiOperation(value = "新增", notes = "传入apply")
    public R save(@RequestBody Apply apply){
    public R save(@RequestBody Apply apply) {
        //查询人员是否已报名
        User user = userService.getById(apply.getUserId());
        if (null==user.getIsApply()){
        if (null == user.getIsApply()) {
            //默认通过
            apply.setApplyStatus(2);
            //默认为未考试状态
@@ -112,14 +116,14 @@
            userService.updateById(user1);
            //内网数据同步
            saveApply(apply,user1);
            saveApply(apply, user1);
            return R.data(200,"报名成功");
        }else {
            if (1==user.getIsApply()){
                return R.data(201,"已报名,不能重复报名");
            return R.data(200, "报名成功");
        } else {
            if (1 == user.getIsApply()) {
                return R.data(201, "已报名,不能重复报名");
            }
            if (1!=user.getIsApply()){
            if (1 != user.getIsApply()) {
                //默认通过
                apply.setApplyStatus(2);
                //默认为未考试状态
@@ -133,30 +137,32 @@
                userService.updateById(user1);
                //内网数据同步
                saveApply(apply,user1);
                saveApply(apply, user1);
                return R.data(200,"报名成功");
                return R.data(200, "报名成功");
            }
        }
        return R.data(202,"报名失败");
        return R.data(202, "报名失败");
    }
    /**
     * 报名
     */
    private void saveApply(Apply apply,User user1){
    private void saveApply(Apply apply, User user1) {
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        Long id = apply.getId();
        String s = "insert into sys_apply(id,user_id,apply_time,apply_status,is_exam) " +
            "values(" + "'" + id + "'" + "," + "'" + apply.getUserId() + "'" + "," + "'" + formatStr +
            "'" + "," + "'" + apply.getApplyStatus() + "'" + "," +"'" + apply.getIsExam() + "'" + ");" +
            "update blade_user set is_apply = " + user1.getIsApply() + " " +"where id = " + "'" + user1.getId() + "'";
        FtpUtil.sqlFileUpload(s);
            "'" + "," + "'" + apply.getApplyStatus() + "'" + "," + "'" + apply.getIsExam() + "'" + ");" +
            "update blade_user set is_apply = " + user1.getIsApply() + " " + "where id = " + "'" + user1.getId() + "'";
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
    }
    /**
     * 修改
     *
     * @param apply 考试报名信息对象
     */
    @PostMapping("/update")
@@ -166,10 +172,11 @@
    /**
     * 新增或修改
     *
     * @param apply 考试报名信息对象
     */
    @PostMapping("/submit")
    public R submit(@RequestBody Apply apply){
    public R submit(@RequestBody Apply apply) {
        return R.data(applyService.saveOrUpdate(apply));
    }
@@ -180,7 +187,7 @@
    @PostMapping("import-apply")
    @ApiOperation(value = "导入报名考试数据", notes = "传入excel")
    public R importUser(MultipartFile file, Integer isCovered) {
        ApplyImporter applyImporter = new ApplyImporter(applyService, false,null);
        ApplyImporter applyImporter = new ApplyImporter(applyService, false, null);
        ExcelUtil.save(file, applyImporter, ApplyExcel.class);
        return R.success("操作成功");
    }
@@ -190,8 +197,8 @@
     */
    @PostMapping("import-applys")
    @ApiOperation(value = "导入报名考试数据", notes = "传入excel")
    public R importUser(MultipartFile file, Integer isCovered,Long examId) {
        ApplyImporter applyImporter = new ApplyImporter(applyService, false,examId);
    public R importUser(MultipartFile file, Integer isCovered, Long examId) {
        ApplyImporter applyImporter = new ApplyImporter(applyService, false, examId);
        ExcelUtil.save(file, applyImporter, ApplyExcel.class);
        return R.success("操作成功");
    }
@@ -209,61 +216,63 @@
    /**
     * 导出报名数数据
     *
     * @param response
     * @param apply 报名对象
     * @param apply    报名对象
     */
    @GetMapping("export-apply")
    @ApiOperation(value = "导出报名清册")
    public void exportApply(HttpServletResponse response,Apply apply) {
    public void exportApply(HttpServletResponse response, Apply apply) {
        List<ApplyInfoExcel> list = applyService.getApplyExcelList(apply);
        ExcelUtil.export(response, "考试报名清册数据"+ DateUtil.time(), "考试报名清册数据表", list, ApplyInfoExcel.class);
        ExcelUtil.export(response, "考试报名清册数据" + DateUtil.time(), "考试报名清册数据表", list, ApplyInfoExcel.class);
    }
    /**
     * 生成准考证号码
     *
     * @param apply 考试报名信息对象
     */
    private String getCandidateNo(Apply apply) {
        //获取考试信息
        ExamPaper examPaper = examPaperService.getById(apply.getExamId());
        if (null!=examPaper.getStartTime()){
        if (null != examPaper.getStartTime()) {
            String format = new SimpleDateFormat("yyyy-MM-dd").format(examPaper.getStartTime());
            String year = format.substring(2,4);
            String quarter  = null;
            String year = format.substring(2, 4);
            String quarter = null;
            String months = null;
            int month = Integer.parseInt(format.substring(5,7));
            int day = Integer.parseInt(format.substring(8,10));
            int month = Integer.parseInt(format.substring(5, 7));
            int day = Integer.parseInt(format.substring(8, 10));
            String days = null;
            if (month>0 && month<=3){
            if (month > 0 && month <= 3) {
                quarter = "C";
            }
            if (month>3 && month<=6){
            if (month > 3 && month <= 6) {
                quarter = "X";
            }
            if (month>6 && month<=9){
            if (month > 6 && month <= 9) {
                quarter = "Q";
            }
            if (month>9 && month<=12){
            if (month > 9 && month <= 12) {
                quarter = "D";
            }
            if (month<=9){
            if (month <= 9) {
                months = "0" + month;
            }
            if (day<=9){
            if (day <= 9) {
                days = "0" + day;
            }else {
                days = ""+day;
            } else {
                days = "" + day;
            }
            String type = null;
            if (examPaper.getExamType()==1){
            if (examPaper.getExamType() == 1) {
                type = "z";
            }
            if (examPaper.getExamType()==2){
            if (examPaper.getExamType() == 2) {
                type = "m";
            }
            //获取考试名称前缀,去除数字,字母
            String examName
                = examPaper.getExamName().replaceAll("\\s*", "").replaceAll("[^(\\u4e00-\\u9fa5)]", "").substring(0,1);
                = examPaper.getExamName().replaceAll("\\s*", "").replaceAll("[^(\\u4e00-\\u9fa5)]", "").substring(0, 1);
            //前缀 = 年的最后两位  + 月份(两位) + 考试名称(中文拼音)首字母(去除数字,字母) + 考试类型 + 季度拼音首字母大写(春季就是 C)
//            String result = year
@@ -274,12 +283,12 @@
            //前缀 = 年的最后两位  + 月份(两位) + 日 (两位) + 考试类型 正式考试  z   模拟考试   m
            String result = year
                            + months
                            + days
                            + type;
                + months
                + days
                + type;
            //查询是当前前缀已生成的数量
            int count = applyService.getCandidateNoCount(result);
            if (count==0){
            if (count == 0) {
                return result + "0000";
            }
            //格式化
@@ -293,61 +302,63 @@
    /**
     * 生成报名编号
     *
     * @param apply 考试报名信息对象
     */
    private String getApplyCode(Apply apply) {
        //获取考试信息
        ExamPaper examPaper = examPaperService.getById(apply.getExamId());
        if (null!=examPaper.getStartTime()){
        if (null != examPaper.getStartTime()) {
            String format = new SimpleDateFormat("yyyy-MM-dd").format(examPaper.getStartTime());
            String year = format.substring(2,4);
            String quarter  = null;
            String year = format.substring(2, 4);
            String quarter = null;
            String months = null;
            String days = null;
            int month = Integer.parseInt(format.substring(5,7));
            int day = Integer.parseInt(format.substring(8,10));
            if (month>0 && month<=3){
            int month = Integer.parseInt(format.substring(5, 7));
            int day = Integer.parseInt(format.substring(8, 10));
            if (month > 0 && month <= 3) {
                quarter = "C";
            }
            if (month>3 && month<=6){
            if (month > 3 && month <= 6) {
                quarter = "X";
            }
            if (month>6 && month<=9){
            if (month > 6 && month <= 9) {
                quarter = "Q";
            }
            if (month>9 && month<=12){
            if (month > 9 && month <= 12) {
                quarter = "D";
            }
            if (month<=9){
            if (month <= 9) {
                months = "0" + month;
            }
            if (day<=9){
            if (day <= 9) {
                days = "0" + day;
            }
            //获取考试名称前缀,去除数字,字母
            String examName
                = examPaper.getExamName().replaceAll("\\s*", "").replaceAll("[^(\\u4e00-\\u9fa5)]", "").substring(0,1);
                = examPaper.getExamName().replaceAll("\\s*", "").replaceAll("[^(\\u4e00-\\u9fa5)]", "").substring(0, 1);
            //前缀 = 年的最后两位  + 月份(两位) + 考试名称(中文拼音)首字母(去除数字,字母) + 考试类型 + 季度拼音首字母大写(春季就是 C)
            String result = year
                            + months
                            + toFirstChar(examName).toUpperCase()
                            + examPaper.getExamType()
                            + quarter;
                + months
                + toFirstChar(examName).toUpperCase()
                + examPaper.getExamType()
                + quarter;
            //生成随机数
            UUID uuid = UUID.randomUUID();
            //返回
            return result + uuid.toString().replaceAll("\\-","");
            return result + uuid.toString().replaceAll("\\-", "");
        }
        return null;
    }
    /**
     * 获取字符串拼音的第一个字母
     *
     * @param chinese
     * @return
     */
    private String toFirstChar(String chinese){
    private String toFirstChar(String chinese) {
        String pinyinStr = "";
        char[] newChar = chinese.toCharArray();
        //转为单个字符
@@ -361,7 +372,7 @@
                } catch (BadHanyuPinyinOutputFormatCombination e) {
                    e.printStackTrace();
                }
            }else{
            } else {
                pinyinStr += newChar[i];
            }
        }
@@ -370,6 +381,7 @@
    /**
     * 删除
     *
     * @param ids 考试报名信息ids 数组
     */
    @PostMapping("/remove")
@@ -378,13 +390,15 @@
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_apply where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(applyService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 查询用户详情
     *
     * @param user
     */
    @GetMapping("/userDetail")
@@ -398,6 +412,7 @@
    /**
     * 详情
     *
     * @param apply 考试报名信息对象
     */
    @GetMapping("/detail")
@@ -411,11 +426,12 @@
    /**
     * 获取准考证信息
     *
     * @param apply
     * @return
     */
    @GetMapping("/getApplyInfo")
    public R<ApplyPaPerVO> getApplyInfo(Apply apply,HttpServletResponse response) {
    public R<ApplyPaPerVO> getApplyInfo(Apply apply, HttpServletResponse response) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
        response.setHeader("Access-Control-Allow-Credentials", "true");
@@ -427,13 +443,14 @@
    /**
     * 取消报名
     *
     * @param apply 考试报名信息对象
     */
    @PostMapping("/cancelApply")
    public R cancelApply(@RequestBody Apply apply){
    public R cancelApply(@RequestBody Apply apply) {
        //查询人员是否已报名
        User user = userService.getById(apply.getUserId());
        if(null==user.getIsApply()){
        if (null == user.getIsApply()) {
            apply.setApplyStatus(4);
            boolean status = applyService.updateById(apply);
            //修改保安报名状态
@@ -441,14 +458,14 @@
            userService.updateById(user);
            //取消报名同步
            cancelApplySync(apply,user);
            cancelApplySync(apply, user);
            if (status){
                return R.data(200,"取消报名成功");
            if (status) {
                return R.data(200, "取消报名成功");
            }
        }else {
            if(user.getIsApply()==1){
        } else {
            if (user.getIsApply() == 1) {
                apply.setApplyStatus(4);
                boolean status = applyService.updateById(apply);
                //修改保安报名状态
@@ -456,40 +473,42 @@
                userService.updateById(user);
                //取消报名同步
                cancelApplySync(apply,user);
                cancelApplySync(apply, user);
                if (status){
                    return R.data(200,"取消报名成功");
                if (status) {
                    return R.data(200, "取消报名成功");
                }
            }else {
                return R.data(201,"尚未报名");
            } else {
                return R.data(201, "尚未报名");
            }
        }
        return R.data(202,"取消报名失败");
        return R.data(202, "取消报名失败");
    }
    /**
     * 取消报名同步
     */
    private void cancelApplySync(Apply apply,User user){
    private void cancelApplySync(Apply apply, User user) {
        String s =
            "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);
            "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);
    }
    /**
     * 公司报名列表取消报名,无applyId
     *
     * @param apply 考试报名信息对象
     */
    @PostMapping("/cancelApplyNotApplyId")
    public R cancelApplyNotApplyId(@RequestBody Apply apply){
    public R cancelApplyNotApplyId(@RequestBody Apply apply) {
        //查询人员是否已报名
        User user = userService.getById(apply.getUserId());
        //查询报名信息,取最新的一条(即当前userId,)applyId最大的一条记录
        Apply apply1 = applyService.getMaxApplyIdByUserIdInfo(apply.getUserId());
        if(null==user.getIsApply()){
        if (null == user.getIsApply()) {
            apply1.setApplyStatus(4);
            boolean status = applyService.updateById(apply1);
            //修改保安报名状态
@@ -497,16 +516,16 @@
            userService.updateById(user);
            //取消报名同步
            cancelApplySync(apply1,user);
            cancelApplySync(apply1, user);
            if (status){
                return R.data(200,"取消报名成功");
            if (status) {
                return R.data(200, "取消报名成功");
            }
        }else {
            if (user.getIsApply()!=1) {
                return R.data(201,"尚未报名");
        } else {
            if (user.getIsApply() != 1) {
                return R.data(201, "尚未报名");
            }
            if(user.getIsApply()==1){
            if (user.getIsApply() == 1) {
                apply1.setApplyStatus(4);
                boolean status = applyService.updateById(apply1);
                //修改保安报名状态
@@ -514,23 +533,24 @@
                userService.updateById(user);
                //取消报名同步
                cancelApplySync(apply1,user);
                cancelApplySync(apply1, user);
                if (status){
                    return R.data(200,"取消报名成功");
                if (status) {
                    return R.data(200, "取消报名成功");
                }
            }
        }
        return R.data(202,"取消报名失败");
        return R.data(202, "取消报名失败");
    }
    /**
     * 批量报名
     *
     * @param ids userIds 人员
     */
    @PostMapping("/batchApply")
    public R batchApply(@RequestParam String ids,@RequestParam String deptId){
    public R batchApply(@RequestParam String ids, @RequestParam String deptId) {
        if (!ids.equals("")) {
            List<String> list = Arrays.asList(ids.split(","));
            list.forEach(userId -> {
@@ -549,7 +569,7 @@
                    userService.updateById(user);
                    //内网数据同步
                    saveApply(apply1,user);
                    saveApply(apply1, user);
                } else {
                    if (user.getIsApply() != 1) {
                        Apply apply1 = new Apply();
@@ -564,15 +584,15 @@
                        userService.updateById(user);
                        //内网数据同步
                        saveApply(apply1,user);
                        saveApply(apply1, user);
                    }
                }
            });
        }else {
        } else {
            //查询所有未报名的人员
            List<User> users = userService.getNotApplyIdList(deptId);
            if (users.size()>0){
                users.forEach(user ->{
            if (users.size() > 0) {
                users.forEach(user -> {
                    //未报名的新增,已报名的不做处理
                    if (null == user.getIsApply()) {
                        Apply apply1 = new Apply();
@@ -587,7 +607,7 @@
                        userService.updateById(user);
                        //内网数据同步
                        saveApply(apply1,user);
                        saveApply(apply1, user);
                    } else {
                        if (user.getIsApply() != 1) {
                            Apply apply1 = new Apply();
@@ -602,26 +622,26 @@
                            userService.updateById(user);
                            //内网数据同步
                            saveApply(apply1,user);
                            saveApply(apply1, user);
                        }
                    }
                });
            }
        }
        return R.data(200,"报名成功");
        return R.data(200, "报名成功");
    }
    /**
     * 生成考试,报名
     *
     * @param applyVO 报名info
     */
    @PostMapping("/batchExam")
    public R batchExam(@RequestBody ApplyVO applyVO){
    public R batchExam(@RequestBody ApplyVO applyVO) {
        //查询已报名未关联试卷的人员
        List<Apply> applyIds = applyService.getApplyIds(applyVO);
        if (applyIds.size()>0){
        if (applyIds.size() > 0) {
            //生成考试
            ExamPaper examPaper = new ExamPaper();
            examPaper.setExamType(1);
@@ -630,9 +650,9 @@
            Calendar instance = Calendar.getInstance();
            instance.setTime(applyVO.getStartTime());
            int year = instance.get(Calendar.YEAR);
            int month = instance.get(Calendar.MONTH)+1;
            int month = instance.get(Calendar.MONTH) + 1;
            int day = instance.get(Calendar.DAY_OF_MONTH);
            String examName = year + "年" + month+ "月"+ day +"日" +"保安员证考试";
            String examName = year + "年" + month + "月" + day + "日" + "保安员证考试";
            examPaper.setExamName(examName);
            //生成考试
            examPaperService.save(examPaper);
@@ -643,23 +663,25 @@
            String s = "insert into ksxt_exam(id,exam_name,exam_type,start_time,end_time) " +
                "values(" + "'" + sid + "'" +
                "," + "'" + examPaper.getExamName() + "'" +
                "," + "'" + examPaper.getExamType() +"'" +
                "," + "'" + format +"'" +
                ","  +"'" + endTimeFormat + "'" + ")";
            FtpUtil.sqlFileUpload(s);
                "," + "'" + examPaper.getExamType() + "'" +
                "," + "'" + format + "'" +
                "," + "'" + endTimeFormat + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            //修改报名信息
            applyIds.forEach(apply ->{
            applyIds.forEach(apply -> {
                //如果查出来的是已存在考试信息数据,则跳过
                if (null==apply.getExamId()){
                if (null == apply.getExamId()) {
                    apply.setExamId(examPaper.getId());
                    apply.setCandidateNo(getCandidateNo(apply));
                    applyService.updateById(apply);
                    String s1 =
                        "update sys_apply set exam_id = " + apply.getExamId() + ",candidate_no = " + "'" + apply.getCandidateNo() + "'" +
                            " " +"where id = " + "'" + apply.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                            " " + "where id = " + "'" + apply.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            });
        }
@@ -669,33 +691,36 @@
    /**
     * 查询报名清册信息
     *
     * @param apply 报名信息
     * @return
     */
    @GetMapping("/getApplyDetailList")
    public Map<String,Object> getApplyDetailList(ApplyVO apply){
    public Map<String, Object> getApplyDetailList(ApplyVO apply) {
        return applyService.getApplyDetailList(apply);
    }
    /**
     * 查询保安员个人报名信息
     *
     * @param apply 报名信息,包含userId
     * @return
     */
    @GetMapping("/getSecurityApplyDetail")
    public ApplyVO getSecurityApplyDetail(ApplyVO apply){
    public ApplyVO getSecurityApplyDetail(ApplyVO apply) {
        return applyService.getSecurityApplyDetail(apply);
    }
    /**
     * 修改考试状态
     *
     * @param apply 报名信息,包含userId,applyid
     * @return
     */
    @PostMapping("/updateApplyStatus")
    public ExamScore updateApplyStatus(@RequestBody ApplyVO apply){
    public ExamScore updateApplyStatus(@RequestBody ApplyVO apply) {
        applyService.updateApplyStatus(apply);
        //新增考试成绩,没有成绩数据,待提交答题后更新数据
        ExamScore examScore = new ExamScore();
@@ -705,29 +730,32 @@
        examScore.setCandidateNo(apply.getCandidateNo());
        examScore.setExamTime(new Date());
        //新增考试成绩
        examScoreService.save(examScore);
        //内网同步
        Long sid = examScore.getId();
        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime());
        String s = "insert into exam_score(id,candidate_no,exam_time,user_id,exam_id,apply_id) " +
            "values(" + "'" + sid + "'" +
            "," + "'" + examScore.getCandidateNo() + "'" +
            "," + "'" + format + "'" +
            "," + "'" + examScore.getUserId() +"'" +
            ","  +"'" + examScore.getExamId() +"'" +
            ","  +"'" + examScore.getApplyId() + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        boolean save = examScoreService.save(examScore);
        if (save) {
            //内网同步
            Long sid = examScore.getId();
            String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime());
            String s = "insert into exam_score(id,candidate_no,exam_time,user_id,exam_id,apply_id) " +
                "values(" + "'" + sid + "'" +
                "," + "'" + examScore.getCandidateNo() + "'" +
                "," + "'" + format + "'" +
                "," + "'" + examScore.getUserId() + "'" +
                "," + "'" + examScore.getExamId() + "'" +
                "," + "'" + examScore.getApplyId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
        return examScore;
    }
    /**
     * test
     *
     * @return
     */
    @GetMapping("/test")
    public Object test(){
    public Object test() {
        String s1 = "insert into exam_score(id,exam_id,apply_id) values(223,88,315)";
        String s2 = "111222333";
        String s3 = "select * from ksxt_exam";
@@ -736,14 +764,14 @@
//        FtpUtil.sqlFileUpload(s3);
        String json1 = JSON.toJSONString(s3);
        String response1 = String.valueOf((new Date()).getTime());
        OutJson.createJsonFile(json1, localPath, "f"+response1);
        OutJson.createJsonFile(json1, localPath, "f" + response1);
        FileInputStream in1 = null;
        try {
            in1 = new FileInputStream(new File(localPath + "f"+response1+".json"));
            in1 = new FileInputStream(new File(localPath + "f" + response1 + ".json"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "f"+response1+".json", in1);
        FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", "f" + response1 + ".json", in1);
        return "成功";
    }
src/main/java/org/springblade/modules/apply/controller/ExamPaymentController.java
@@ -13,6 +13,7 @@
import org.springblade.modules.apply.entity.ExamPayment;
import org.springblade.modules.apply.service.ExamPaymentService;
import org.springblade.modules.apply.vo.ExamPaymentVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@@ -29,10 +30,12 @@
public class ExamPaymentController {
    private final ExamPaymentService examPaymentService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     * @param query page,size
     *
     * @param query       page,size
     * @param examPayment 考试缴费信息对象
     */
    @GetMapping("/page")
@@ -52,6 +55,7 @@
    /**
     * 新增
     *
     * @param examPayment 考试缴费信息对象
     */
    @PostMapping("/save")
@@ -63,6 +67,7 @@
    /**
     * 修改
     *
     * @param examPayment 考试缴费信息对象
     */
    @PostMapping("/update")
@@ -72,6 +77,7 @@
    /**
     * 新增或修改
     *
     * @param examPayment 考试缴费信息对象
     */
    @PostMapping("/submit")
@@ -82,6 +88,7 @@
    /**
     * 删除
     *
     * @param ids 考试缴费信息ids 数组
     */
    @PostMapping("/remove")
@@ -90,13 +97,15 @@
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_exam_payment where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(examPaymentService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 详情
     *
     * @param examPayment 考试缴费信息对象
     */
    @GetMapping("/detail")
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -28,6 +28,7 @@
import org.springblade.modules.exam.service.ExamScoreService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.service.TrainingRegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -56,6 +57,8 @@
    @Autowired
    private TrainingRegistrationService trainingRegistrationService;
    @Autowired
    private  MyAsyncService myAsyncService;
    /**
     * 自定义分页数据
@@ -142,7 +145,8 @@
                        + "'" + examId + "'" + ","
                        +"'" + apply1.getIsExam() + "'" + ");" +
                        "update blade_user set is_apply = " + "'" + user1.getIsApply() + "'" +"where id = " + "'" + user1.getId() + "'";
                    FtpUtil.sqlFileUpload(s);
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                }else {
                    if (user1.getIsApply()!=1) {
                        Apply apply1 = new Apply();
@@ -173,7 +177,8 @@
                            + "'" + examId + "'" + ","
                            +"'" + apply1.getIsExam() + "'" + ");" +
                            "update blade_user set is_apply = " + "'" + user1.getIsApply() + "'" +"where id = " + "'" + user1.getId() + "'";
                        FtpUtil.sqlFileUpload(s);
                        //FtpUtil.sqlFileUpload(s);
                        myAsyncService.FTP(s);
                    }
                }
            }
@@ -465,7 +470,8 @@
            String s1 =
                "update sys_apply set is_exam = " + apply1.getIsExam() + " " +"where id = " + "'" + apply1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        //模拟考
        if (apply.getExamType()==2){
@@ -478,7 +484,8 @@
            String s1 =
                "update sys_training_registration set is_exam = " + trainingRegistration.getIsExam() + " " +"where id = " + "'" + trainingRegistration.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
    }
src/main/java/org/springblade/modules/coinspect/controller/CoinspectController.java
@@ -33,6 +33,7 @@
import org.springblade.modules.coinspect.entity.Coinspect;
import org.springblade.modules.coinspect.service.ICoinspectService;
import org.springblade.modules.coinspect.vo.CoinspectVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -52,7 +53,7 @@
public class CoinspectController extends BladeController {
    private final ICoinspectService coinspectService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
     */
@@ -116,7 +117,8 @@
                "'" + coinspect.getInsid() + "'" + "," +
                "'" + coinspect.getResults() + "'" + "," +
                "'" + coinspect.getUrl() + "'" + ")";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.success("新增成功");
    }
src/main/java/org/springblade/modules/desk/controller/NoticeController.java
@@ -36,6 +36,7 @@
import org.springblade.modules.desk.wrapper.NoticeWrapper;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@@ -60,6 +61,7 @@
    private final INoticeService noticeService;
    private final IDeptService iDeptService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -90,7 +92,7 @@
    /**
     * 多表联合查询自定义分页
     */
        @GetMapping("/page")
    @GetMapping("/page")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
        @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
@@ -128,46 +130,52 @@
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入notice")
    public R submit(@RequestBody Notice notice){
    public R submit(@RequestBody Notice notice) {
        boolean status = false;
        if (null==notice.getId()) {
        if (null == notice.getId()) {
            //新增
            status = noticeService.save(notice);
            notice.setIsDeleted(0);
            //数据同步
            String s1 =
                "insert into blade_notice(id,title,category,release_time,content,create_user,create_dept,create_time,is_deleted,dept_id,cover_url,type) " +
                    "values(" + "'" + notice.getId() + "'" + "," +
                    "'" + notice.getTitle() + "'" + "," +
                    "'" + notice.getCategory() + "'" + "," +
                    "'" +  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getReleaseTime()) + "'" + "," +
                    "'" + notice.getContent() + "'" + "," +
                    "'" + notice.getCreateUser() + "'" + "," +
                    "'" + notice.getCreateDept() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(notice.getCreateTime()) + "'" + "," +
                    "'" + notice.getIsDeleted() + "'" + "," +
                    "'" + notice.getDeptId() + "'" + "," +
                    "'" + notice.getCoverUrl() + "'" + "," +
                    "'" +notice.getType() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据同步
                String s1 =
                    "insert into blade_notice(id,title,category,release_time,content,create_user,create_dept,create_time,is_deleted,dept_id,cover_url,type) " +
                        "values(" + "'" + notice.getId() + "'" + "," +
                        "'" + notice.getTitle() + "'" + "," +
                        "'" + notice.getCategory() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getReleaseTime()) + "'" + "," +
                        "'" + notice.getContent() + "'" + "," +
                        "'" + notice.getCreateUser() + "'" + "," +
                        "'" + notice.getCreateDept() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(notice.getCreateTime()) + "'" + "," +
                        "'" + notice.getIsDeleted() + "'" + "," +
                        "'" + notice.getDeptId() + "'" + "," +
                        "'" + notice.getCoverUrl() + "'" + "," +
                        "'" + notice.getType() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            //修改
            status = noticeService.updateById(notice);
            //内网同步
            String s1 =
                "update blade_notice set title = " + "'" + notice.getTitle() + "'" +
                    ",category = " + "'" + notice.getCategory() + "'" +
                    ",release_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getReleaseTime()) + "'" +
                    ",content = " + "'" + notice.getContent() + "'" +
                    ",create_user = " + "'" + notice.getCreateUser() + "'" +
                    ",create_dept = " + "'" + notice.getCreateDept() + "'" +
                    ",create_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getCreateTime()) + "'" +
                    ",is_deleted = " + "'" + notice.getIsDeleted() + "'" +
                    ",dept_id = " + "'" + notice.getDeptId() + "'" +
                    ",cover_url = " + "'" + notice.getCoverUrl() + "'" +
                    ",type = " + "'" + notice.getType() + "'" +
                    " " +"where id = " + "'" + notice.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update blade_notice set title = " + "'" + notice.getTitle() + "'" +
                        ",category = " + "'" + notice.getCategory() + "'" +
                        ",release_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getReleaseTime()) + "'" +
                        ",content = " + "'" + notice.getContent() + "'" +
                        ",create_user = " + "'" + notice.getCreateUser() + "'" +
                        ",create_dept = " + "'" + notice.getCreateDept() + "'" +
                        ",create_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(notice.getCreateTime()) + "'" +
                        ",is_deleted = " + "'" + notice.getIsDeleted() + "'" +
                        ",dept_id = " + "'" + notice.getDeptId() + "'" +
                        ",cover_url = " + "'" + notice.getCoverUrl() + "'" +
                        ",type = " + "'" + notice.getType() + "'" +
                        " " + "where id = " + "'" + notice.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        return R.status(status);
    }
@@ -181,10 +189,11 @@
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) throws Exception {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from blade_notice where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        boolean temp = noticeService.deleteLogic(Func.toLongList(ids));
        return R.status(temp);
src/main/java/org/springblade/modules/directive/controller/DirectiveController.java
@@ -15,6 +15,7 @@
import org.springblade.modules.directive.entity.DirectiveFile;
import org.springblade.modules.directive.service.DirectiveService;
import org.springblade.modules.directive.vo.DirectiveVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
@@ -31,6 +32,7 @@
public class DirectiveController {
    private final DirectiveService directiveService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
@@ -67,16 +69,19 @@
        boolean status = false;
        directive.setSendTime(new Date());
        status = directiveService.save(directive);
        //数据同步
        String s1 =
            "insert into sys_directive(id,type,send_directive_id,receive_directive_ids,send_time,content) " +
                "values(" + "'" + directive.getId() + "'" + "," +
                "'" + directive.getType() + "'" + "," +
                "'" + directive.getSendDirectiveId() + "'" + "," +
                "'" + directive.getReceiveDirectiveIds() + "'" + "," +
                "'" + directive.getSendTime() + "'" + "," +
                "'" + directive.getContent() + "'" + ")";
        FtpUtil.sqlFileUpload(s1);
        if (status){
            //数据同步
            String s1 =
                "insert into sys_directive(id,type,send_directive_id,receive_directive_ids,send_time,content) " +
                    "values(" + "'" + directive.getId() + "'" + "," +
                    "'" + directive.getType() + "'" + "," +
                    "'" + directive.getSendDirectiveId() + "'" + "," +
                    "'" + directive.getReceiveDirectiveIds() + "'" + "," +
                    "'" + directive.getSendTime() + "'" + "," +
                    "'" + directive.getContent() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        if (status) {
            //新增图片
            if (null != directive.getUrl() && directive.getUrl() != "") {
@@ -96,7 +101,8 @@
                            "'" + directiveFile.getType() + "'" + "," +
                            "'" + directiveFile.getDirectiveId() + "'" + "," +
                            "'" + urls+ "'"+ ")";
                    FtpUtil.sqlFileUpload(s2);
                    //FtpUtil.sqlFileUpload(s2);
                    myAsyncService.FTP(s2);
                    if (!status) {
                        return R.status(false);
                    }
@@ -118,14 +124,17 @@
    public R updateDirectiveAndFile(@RequestBody DirectiveVo directive) throws Exception {
        //新增指令信息
        boolean update = directiveService.updateById(directive);
        //内网同步
        String s1 = "update sys_directive set type = " + "'" + directive.getType() + "'" +
            ",send_directive_id = " + "'" + directive.getSendDirectiveId() + "'" +
            ",receive_directive_ids = " + "'" + directive.getReceiveDirectiveIds() + "'" +
            ",send_time = " + "'" + directive.getSendTime() + "'" +
            ",content = " + "'" + directive.getContent() + "'" +
            " " + "where id = " + "'" + directive.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        if (update) {
            //内网同步
            String s1 = "update sys_directive set type = " + "'" + directive.getType() + "'" +
                ",send_directive_id = " + "'" + directive.getSendDirectiveId() + "'" +
                ",receive_directive_ids = " + "'" + directive.getReceiveDirectiveIds() + "'" +
                ",send_time = " + "'" + directive.getSendTime() + "'" +
                ",content = " + "'" + directive.getContent() + "'" +
                " " + "where id = " + "'" + directive.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        boolean status = false;
        if (update) {
            //先删除图片
@@ -147,7 +156,8 @@
                            "'" + directiveFile.getType() + "'" + "," +
                            "'" + directiveFile.getDirectiveId() + "'" + "," +
                            "'" + urls + "'"+ ")";
                    FtpUtil.sqlFileUpload(s2);
                    //FtpUtil.sqlFileUpload(s2);
                    myAsyncService.FTP(s2);
                    if (!status) {
                        R.status(false);
                    }
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java
@@ -21,6 +21,7 @@
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
@@ -34,6 +35,7 @@
import org.springblade.modules.dispatcher.service.IDispatcherUnitService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.system.vo.UserVO;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -50,7 +52,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
/**
 *  控制器
 * 控制器
 *
 * @author BladeX
 * @since 2021-07-07
@@ -66,6 +68,7 @@
    private final IDispatcherUnitService dispatcherUnitService;
    private final IUserService userService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -128,6 +131,7 @@
    /**
     * 结束派遣
     *
     * @param dispatcher
     */
    @PostMapping("/over-dispatcher")
@@ -142,10 +146,10 @@
        List<Dispatcher> dispatcherList = dispatcherService.list(Condition.getQueryWrapper(dispatcher1));
        User user = new User();
        if (dispatcherList.size()<1){
        if (dispatcherList.size() < 1) {
            //用户状态改变
            user.setDispatch("1");
        }else {
        } else {
            //用户状态改变
            user.setDispatch("0");
        }
@@ -153,15 +157,15 @@
        userService.updateById(user);
        //内网同步
        String s1 =
            "update sys_dispatcher set status = " + "'" + dispatcher.getStatus() + "'" +
                ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" +
                " " +"where id = " + "'" + dispatcher.getId() + "';"+
                " " + "where id = " + "'" + dispatcher.getId() + "';" +
                "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                " " +"where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
                " " + "where id = " + "'" + user.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.status(status);
    }
@@ -185,23 +189,25 @@
            //新增派遣记录
            status = dispatcherService.save(dispatcher);
            //数据同步
            String s1 =
                "insert into sys_dispatcher(id,dispatcherTime,dispatcherAddress,dispatcher_unit_id,user_ids,end_time,dept_id,jurisdiction,create_time,status) " +
                    "values(" + "'" + dispatcher.getId() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" + "," +
                    "'" + dispatcher.getDispatcheraddress() + "'" + "," +
                    "'" + dispatcher.getDispatcherUnitId() + "'" + "," +
                    "'" + dispatcher.getUserIds() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" + "," +
                    "'" + dispatcher.getDeptId() + "'" + "," +
                    "'" + dispatcher.getJurisdiction() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getCreateTime()) + "'" + "," +
                    "'" + dispatcher.getStatus() + "'" + ");" +
                    "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                    " " + "where id = " + "'" + user.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //数据同步
                String s1 =
                    "insert into sys_dispatcher(id,dispatcherTime,dispatcherAddress,dispatcher_unit_id,user_ids,end_time,dept_id,jurisdiction,create_time,status) " +
                        "values(" + "'" + dispatcher.getId() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" + "," +
                        "'" + dispatcher.getDispatcheraddress() + "'" + "," +
                        "'" + dispatcher.getDispatcherUnitId() + "'" + "," +
                        "'" + dispatcher.getUserIds() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" + "," +
                        "'" + dispatcher.getDeptId() + "'" + "," +
                        "'" + dispatcher.getJurisdiction() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getCreateTime()) + "'" + "," +
                        "'" + dispatcher.getStatus() + "'" + ");" +
                        "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            dispatcher.setUpdateTime(new Date());
            //查询当前派遣记录
@@ -232,45 +238,48 @@
                //修改
                status = dispatcherService.updateById(dispatcher);
                //内网同步
                String s1 =
                    "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                        " " + "where id = " + "'" + user.getId() + "';" +
                    "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" +
                        ",dispatcherAddress = " + "'" + dispatcher.getDispatcheraddress() + "'" +
                        ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" +
                        ",user_ids = " + "'" + dispatcher.getUserIds() + "'" +
                        ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" +
                        ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getUpdateTime()) + "'" +
                        ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                        ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + dispatcher.getId() + "';" +
                    "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                        " " + "where id = " + "'" + user1.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
            }else {
                if (status) {
                    //内网同步
                    String s1 =
                        "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                            " " + "where id = " + "'" + user.getId() + "';" +
                            "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" +
                            ",dispatcherAddress = " + "'" + dispatcher.getDispatcheraddress() + "'" +
                            ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" +
                            ",user_ids = " + "'" + dispatcher.getUserIds() + "'" +
                            ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" +
                            ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getUpdateTime()) + "'" +
                            ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                            ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                            " " + "where id = " + "'" + dispatcher.getId() + "';" +
                            "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                            " " + "where id = " + "'" + user1.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            } else {
                //没有修改保安员,只修改了派遣时间等信息
                //修改
                status = dispatcherService.updateById(dispatcher);
                //内网同步
                String s1 =
                    "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" +
                        ",dispatcherAddress = " + "'" + dispatcher.getDispatcheraddress() + "'" +
                        ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" +
                        ",user_ids = " + "'" + dispatcher.getUserIds() + "'" +
                        ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" +
                        ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getUpdateTime()) + "'" +
                        ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                        ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + dispatcher.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                if (status) {
                    //内网同步
                    String s1 =
                        "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" +
                            ",dispatcherAddress = " + "'" + dispatcher.getDispatcheraddress() + "'" +
                            ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" +
                            ",user_ids = " + "'" + dispatcher.getUserIds() + "'" +
                            ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getEndTime()) + "'" +
                            ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getUpdateTime()) + "'" +
                            ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                            ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                            " " + "where id = " + "'" + dispatcher.getId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }
        }
        return R.status(status);
    }
    /**
@@ -284,7 +293,7 @@
        AtomicBoolean errorStatus = new AtomicBoolean(true);
        //将不能导入的保安员账号存起来
        List<String> errorList = new ArrayList<>();
        if (list.size()>0) {
        if (list.size() > 0) {
            //遍历
            list.forEach(id -> {
                dispatcher.setCreateTime(new Date());
@@ -292,19 +301,19 @@
                dispatcher.setUserIds(id);
                //判断派遣单位类型,如果是医院,学校,银行等单位,则派遣人员年龄不应大于50岁
                DispatcherUnit dispatcherUnit = dispatcherUnitService.getById(dispatcher.getDispatcherUnitId());
                if (null!=dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)){
                if (null != dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
                    //判断
                    if (dispatcherUnit.getDistrict().equals(1) ||
                        dispatcherUnit.getDistrict().equals(2) ||
                        dispatcherUnit.getDistrict().equals(3)){
                        dispatcherUnit.getDistrict().equals(3)) {
                        //查询保安员年龄
                        UserVO user1 = userService.getUserAgeById(Long.parseLong(dispatcher.getUserIds()));
                        if (user1.getAge()>50) {
                        if (user1.getAge() > 50) {
                            errorStatus.set(false);
                            errorList.add(user1.getCardid());
                            //跳出本次循环
                            return;
                        }else {
                        } else {
                            User user = new User();
                            user.setId(Long.parseLong(id));
                            user.setDispatch("0");
@@ -327,9 +336,10 @@
                                    "'" + dispatcher.getStatus() + "'" + ");" +
                                    "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                                    " " + "where id = " + "'" + user.getId() + "'";
                            FtpUtil.sqlFileUpload(s1);
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                        }
                    }else {
                    } else {
                        User user = new User();
                        user.setId(Long.parseLong(id));
                        user.setDispatch("0");
@@ -350,11 +360,12 @@
                                "'" + dispatcher.getJurisdiction() + "'" + "," +
                                "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getCreateTime()) + "'" + "," +
                                "'" + dispatcher.getStatus() + "'" + ");" +
                            "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                                "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                                " " + "where id = " + "'" + user.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                }else {
                } else {
                    User user = new User();
                    user.setId(Long.parseLong(id));
                    user.setDispatch("0");
@@ -375,15 +386,16 @@
                            "'" + dispatcher.getJurisdiction() + "'" + "," +
                            "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher.getCreateTime()) + "'" + "," +
                            "'" + dispatcher.getStatus() + "'" + ");" +
                        "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                            "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            });
            if (!errorStatus.get()){
            if (!errorStatus.get()) {
                String errorAccount = StringUtils.join(errorList, "\\\n");
                throw new ServiceException("保安员["+ errorAccount +"]派遣失败!派遣到学校,医院,银行的保安员年龄应不超过50周岁!");
                throw new ServiceException("保安员[" + errorAccount + "]派遣失败!派遣到学校,医院,银行的保安员年龄应不超过50周岁!");
            }
        }
        return R.status(status.get());
@@ -402,7 +414,7 @@
        //判断派遣单位类型,如果是医院,学校,银行等单位,则派遣人员年龄不应大于50岁
        DispatcherUnit dispatcherUnit = dispatcherUnitService.getById(dispatcher.getDispatcherUnitId());
        if (!dispatcher1.getUserIds().equals(dispatcher.getUserIds())) {
            if (null!=dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
            if (null != dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
                //判断
                if (dispatcherUnit.getDistrict().equals(1) ||
                    dispatcherUnit.getDistrict().equals(2) ||
@@ -410,7 +422,7 @@
                    //查询保安员年龄
                    UserVO userVO = userService.getUserAgeById(Long.parseLong(dispatcher.getUserIds()));
                    if (userVO.getAge() > 50) {
                        throw new ServiceException("保安员["+ userVO.getCardid() +"]变更派遣失败!派遣到学校,医院,银行的保安员年龄应不超过50周岁!");
                        throw new ServiceException("保安员[" + userVO.getCardid() + "]变更派遣失败!派遣到学校,医院,银行的保安员年龄应不超过50周岁!");
                    } else {
                        //修改原保安人员的派遣状态
                        //查询原保安人员的派遣记录,是否存在多条未结束派遣的
@@ -451,11 +463,12 @@
                                ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                                ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                                " " + "where id = " + "'" + dispatcher.getId() + "';" +
                            "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                                "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                                " " + "where id = " + "'" + user1.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                }else {
                } else {
                    //修改原保安人员的派遣状态
                    //查询原保安人员的派遣记录,是否存在多条未结束派遣的
                    Dispatcher dispatcher2 = new Dispatcher();
@@ -497,9 +510,10 @@
                            " " + "where id = " + "'" + dispatcher.getId() + "';" +
                            "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                            " " + "where id = " + "'" + user1.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }else {
            } else {
                //修改原保安人员的派遣状态
                //查询原保安人员的派遣记录,是否存在多条未结束派遣的
                Dispatcher dispatcher2 = new Dispatcher();
@@ -541,10 +555,11 @@
                        " " + "where id = " + "'" + dispatcher.getId() + "';" +
                        "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" +
                        " " + "where id = " + "'" + user1.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }else {
            if (null!=dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
        } else {
            if (null != dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) {
                //判断
                if (dispatcherUnit.getDistrict().equals(1) ||
                    dispatcherUnit.getDistrict().equals(2) ||
@@ -569,9 +584,10 @@
                                ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                                ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                                " " + "where id = " + "'" + dispatcher.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                }else {
                } else {
                    //没有修改保安员,只修改了派遣时间等信息
                    //修改
                    status = dispatcherService.updateById(dispatcher);
@@ -587,9 +603,10 @@
                            ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                            ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                            " " + "where id = " + "'" + dispatcher.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }else {
            } else {
                //没有修改保安员,只修改了派遣时间等信息
                //修改
                status = dispatcherService.updateById(dispatcher);
@@ -605,7 +622,8 @@
                        ",dept_id = " + "'" + dispatcher.getDeptId() + "'" +
                        ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + dispatcher.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        return R.status(status);
@@ -621,10 +639,11 @@
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_dispatcher where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(dispatcherService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherUnitController.java
@@ -41,6 +41,7 @@
import org.springblade.modules.dispatcher.vo.DispatcherVO;
import org.springblade.modules.exam.excel.ExamScoreExcel;
import org.springblade.modules.exam.excel.ExamScoreImporter;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -53,7 +54,7 @@
import java.util.List;
/**
 *  控制器
 * 控制器
 *
 * @author zhongrj
 * @since 2021-07-07
@@ -66,6 +67,7 @@
    private final IDispatcherUnitService dispatcherUnitService;
    private final IDispatcherService dispatcherService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -98,6 +100,7 @@
    /**
     * 自定义树
     *
     * @param dispatcher
     * @return
     */
@@ -127,61 +130,67 @@
     * 新增或修改
     */
    @PostMapping("/submit")
    public R submit(@Valid @RequestBody DispatcherUnit dispatcherUnit){
    public R submit(@Valid @RequestBody DispatcherUnit dispatcherUnit) {
        boolean status = false;
        if (null==dispatcherUnit.getId()) {
        if (null == dispatcherUnit.getId()) {
            dispatcherUnit.setCreateTime(new Date());
            //新增
            status = dispatcherUnitService.save(dispatcherUnit);
            //数据同步
            String s1 =
                "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,jurisdiction,create_time,start_time,end_time," +
                    "serve_type,security_linkman,cell,num) " +
                    "values(" + "'" + dispatcherUnit.getId() + "'" + "," +
                    "'" + dispatcherUnit.getName() + "'" + "," +
                    "'" + dispatcherUnit.getDeptId() + "'" + "," +
                    "'" + dispatcherUnit.getLinkman() + "'" + "," +
                    "'" + dispatcherUnit.getPhone() + "'" + "," +
                    "'" + dispatcherUnit.getJurisdiction() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcherUnit.getCreateTime()) + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" + "," +
                    "'" + dispatcherUnit.getServeType() + "'" + "," +
                    "'" + dispatcherUnit.getSecurityLinkman() + "'" + "," +
                    "'" + dispatcherUnit.getCell() + "'" + "," +
                    "'" +dispatcherUnit.getNum() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据同步
                String s1 =
                    "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,jurisdiction,create_time,start_time,end_time," +
                        "serve_type,security_linkman,cell,num) " +
                        "values(" + "'" + dispatcherUnit.getId() + "'" + "," +
                        "'" + dispatcherUnit.getName() + "'" + "," +
                        "'" + dispatcherUnit.getDeptId() + "'" + "," +
                        "'" + dispatcherUnit.getLinkman() + "'" + "," +
                        "'" + dispatcherUnit.getPhone() + "'" + "," +
                        "'" + dispatcherUnit.getJurisdiction() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcherUnit.getCreateTime()) + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" + "," +
                        "'" + dispatcherUnit.getServeType() + "'" + "," +
                        "'" + dispatcherUnit.getSecurityLinkman() + "'" + "," +
                        "'" + dispatcherUnit.getCell() + "'" + "," +
                        "'" + dispatcherUnit.getNum() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            //修改
            status = dispatcherUnitService.updateById(dispatcherUnit);
            //派遣记录修改合同时间
            Long id = dispatcherUnit.getId();
            String ids=String.valueOf(id);
            String ids = String.valueOf(id);
            Date date = dispatcherUnit.getEndTime();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            String endTime = sdf.format(date);
            dispatcherService.updateEndtime(endTime,ids);
            //内网同步
            String s1 =
            dispatcherService.updateEndtime(endTime, ids);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_dispatcher_unit set name = " + "'" + dispatcherUnit.getName() + "'" +
                    ",dept_id = " + "'" + dispatcherUnit.getDeptId() + "'" +
                    ",linkman = " + "'" + dispatcherUnit.getLinkman() + "'" +
                    ",phone = " + "'" + dispatcherUnit.getPhone() + "'" +
                    ",jurisdiction = " + "'" + dispatcherUnit.getJurisdiction() + "'" +
                    ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" +
                    ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" +
                    ",serve_type = " + "'" + dispatcherUnit.getServeType() + "'" +
                    ",security_linkman = " + "'" + dispatcherUnit.getSecurityLinkman() + "'" +
                    ",cell = " + "'" + dispatcherUnit.getCell() + "'" +
                    ",num = " + "'" + dispatcherUnit.getNum() + "'" +
                    " " +"where id = " + "'" + dispatcherUnit.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //内网同步派遣记录修改合同时间
            String s2 =
                "update sys_dispatcher set end_time = " + "'" + endTime + "'" +" " + "where dispatcher_unit_id = " + "'" + ids + "'";
            FtpUtil.sqlFileUpload(s2);
                        ",dept_id = " + "'" + dispatcherUnit.getDeptId() + "'" +
                        ",linkman = " + "'" + dispatcherUnit.getLinkman() + "'" +
                        ",phone = " + "'" + dispatcherUnit.getPhone() + "'" +
                        ",jurisdiction = " + "'" + dispatcherUnit.getJurisdiction() + "'" +
                        ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getStartTime()) + "'" +
                        ",end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcherUnit.getEndTime()) + "'" +
                        ",serve_type = " + "'" + dispatcherUnit.getServeType() + "'" +
                        ",security_linkman = " + "'" + dispatcherUnit.getSecurityLinkman() + "'" +
                        ",cell = " + "'" + dispatcherUnit.getCell() + "'" +
                        ",num = " + "'" + dispatcherUnit.getNum() + "'" +
                        " " + "where id = " + "'" + dispatcherUnit.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                //内网同步派遣记录修改合同时间
                String s2 =
                    "update sys_dispatcher set end_time = " + "'" + endTime + "'" + " " + "where dispatcher_unit_id = " + "'" + ids + "'";
                //FtpUtil.sqlFileUpload(s2);
                myAsyncService.FTP(s2);
            }
        }
        return R.status(status);
    }
@@ -192,19 +201,21 @@
     */
    @PostMapping("/remove")
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids){
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_dispatcher_unit where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(dispatcherUnitService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 导入派遣单位数据
     *
     * @param isCovered 1 覆盖  0不覆盖
     * @return
     */
@@ -248,7 +259,7 @@
        unitExcel1.setNum(100);
        list.add(unitExcel1);
        ExcelUtil.export(response, "派遣单位数据导入模板"+ DateUtil.time(), "派遣单位数据表", list, DispatcherUnitExcel.class);
        ExcelUtil.export(response, "派遣单位数据导入模板" + DateUtil.time(), "派遣单位数据表", list, DispatcherUnitExcel.class);
    }
src/main/java/org/springblade/modules/dispatcher/service/impl/DispatcherUnitServiceImpl.java
@@ -30,6 +30,7 @@
import org.springblade.modules.dispatcher.vo.DispatcherUnitVO;
import org.springblade.modules.dispatcher.vo.DispatcherVO;
import org.springblade.modules.system.service.IUserDeptService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.stereotype.Service;
import java.text.ParseException;
@@ -40,7 +41,7 @@
import java.util.regex.Pattern;
/**
 *  服务实现类
 * 服务实现类
 *
 * @author BladeX
 * @since 2021-07-07
@@ -53,6 +54,7 @@
    private final IDispatcherService dispatcherService;
    private final IUserDeptService userDeptService;
    private final MyAsyncService myAsyncService;
    @Override
    public IPage<DispatcherUnitVO> selectDispatcherUnitPage(IPage<DispatcherUnitVO> page, DispatcherUnitVO dispatcherUnitVO) {
@@ -66,6 +68,7 @@
    /**
     * 派遣公司信息详情
     *
     * @param dispatcherUnit 派遣信息对象
     * @return
     */
@@ -76,6 +79,7 @@
    /**
     * 自定义树
     *
     * @param dispatcher
     * @return
     */
@@ -86,6 +90,7 @@
    /**
     * 派遣导入
     *
     * @param data
     * @param isCovered
     */
@@ -96,12 +101,12 @@
            //派遣单位
            DispatcherUnit dispatcherUnit = new DispatcherUnit();
            //数据获取
            if (dispatcherUnitExcel.getDeptName()!=null && dispatcherUnitExcel.getDeptName()!=""){
            if (dispatcherUnitExcel.getDeptName() != null && dispatcherUnitExcel.getDeptName() != "") {
                String deptId = userDeptService.selectIn(dispatcherUnitExcel.getDeptName());
                dispatcherUnit.setDeptId(Long.parseLong(deptId));
            }
            if (dispatcherUnitExcel.getName()!=null && dispatcherUnitExcel.getName()!=""){
            if (dispatcherUnitExcel.getName() != null && dispatcherUnitExcel.getName() != "") {
                //仅中文
//                String chinese = "^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$";
//                Pattern compile = Pattern.compile(chinese);
@@ -109,27 +114,27 @@
                dispatcherUnit.setName(dispatcherUnitExcel.getName());
            }
            if (dispatcherUnitExcel.getLinkman()!=null && dispatcherUnitExcel.getLinkman()!=""){
            if (dispatcherUnitExcel.getLinkman() != null && dispatcherUnitExcel.getLinkman() != "") {
                dispatcherUnit.setLinkman(dispatcherUnitExcel.getLinkman());
            }
            if (dispatcherUnitExcel.getPhone()!=null && dispatcherUnitExcel.getPhone()!=""){
            if (dispatcherUnitExcel.getPhone() != null && dispatcherUnitExcel.getPhone() != "") {
                dispatcherUnit.setPhone(dispatcherUnitExcel.getPhone());
            }
            if (dispatcherUnitExcel.getSecurityLinkman()!=null && dispatcherUnitExcel.getSecurityLinkman()!=""){
            if (dispatcherUnitExcel.getSecurityLinkman() != null && dispatcherUnitExcel.getSecurityLinkman() != "") {
                dispatcherUnit.setSecurityLinkman(dispatcherUnitExcel.getSecurityLinkman());
            }
            if (dispatcherUnitExcel.getCell()!=null && dispatcherUnitExcel.getCell()!=""){
            if (dispatcherUnitExcel.getCell() != null && dispatcherUnitExcel.getCell() != "") {
                dispatcherUnit.setCell(dispatcherUnitExcel.getCell());
            }
            if (dispatcherUnitExcel.getServeType()!=null && dispatcherUnitExcel.getServeType()!=""){
            if (dispatcherUnitExcel.getServeType() != null && dispatcherUnitExcel.getServeType() != "") {
                dispatcherUnit.setServeType(dispatcherUnitExcel.getServeType());
            }
            if (dispatcherUnitExcel.getNum()!=null){
            if (dispatcherUnitExcel.getNum() != null) {
                dispatcherUnit.setNum(dispatcherUnitExcel.getNum());
            }
@@ -182,7 +187,8 @@
                    "'" + dispatcherUnit.getSecurityLinkman() + "'" + "," +
                    "'" + dispatcherUnit.getCell() + "'" + "," +
                    "'" + dispatcherUnit.getNum() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
    }
}
src/main/java/org/springblade/modules/equipage/controller/CarController.java
@@ -20,6 +20,7 @@
import org.springblade.modules.equipage.excel.CarImporter;
import org.springblade.modules.equipage.service.CarService;
import org.springblade.modules.equipage.vo.CarVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -42,11 +43,13 @@
public class CarController {
    private final CarService carService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     *
     * @param query page,size
     * @param car 车辆信息对象
     * @param car   车辆信息对象
     */
    @GetMapping("/page")
    public R<IPage<CarVo>> page(CarVo car, Query query) {
@@ -56,6 +59,7 @@
    /**
     * 新增
     *
     * @param car 车辆信息对象
     */
    @PostMapping("/save")
@@ -66,6 +70,7 @@
    /**
     * 修改
     *
     * @param car 车辆信息对象
     */
    @PostMapping("/update")
@@ -75,71 +80,81 @@
    /**
     * 新增或修改
     *
     * @param car 车辆信息对象
     */
    @PostMapping("/submit")
    public R submit(@RequestBody Car car) throws Exception {
        boolean status = false;
        if (null==car.getId()) {
        if (null == car.getId()) {
            car.setDateForProduction(new Date());
            //新增
            status = carService.save(car);
            if (status) {
                //数据同步
                String s1 =
                    "insert into sys_car(id,car_number,number_type,car_type,dept_id," +
                        "person_in_charge,brand,date_for_production,umweltsatz,mode,jurisdiction) " +
                        "values(" + "'" + car.getId() + "'" + "," +
                        "'" + car.getCarNumber() + "'" + "," +
                        "'" + car.getNumberType() + "'" + "," +
                        "'" + car.getCarType() + "'" + "," +
                        "'" + car.getDeptId() + "'" + "," +
                        "'" + car.getPersonInCharge() + "'" + "," +
                        "'" + car.getBrand() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" + "," +
                        "'" + car.getUmweltsatz() + "'" + "," +
                        "'" + car.getMode() + "'" + "," +
                        "'" + car.getJurisdiction() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
            //数据同步
            String s1 =
                "insert into sys_car(id,car_number,number_type,car_type,dept_id," +
                    "person_in_charge,brand,date_for_production,umweltsatz,mode,jurisdiction) " +
                    "values(" + "'" + car.getId() + "'" + "," +
                    "'" + car.getCarNumber() + "'" + "," +
                    "'" + car.getNumberType() + "'" + "," +
                    "'" + car.getCarType() + "'" + "," +
                    "'" + car.getDeptId() + "'" + "," +
                    "'" + car.getPersonInCharge() + "'" + "," +
                    "'" + car.getBrand() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" + "," +
                    "'" + car.getUmweltsatz() + "'" + "," +
                    "'" + car.getMode() + "'" + "," +
                    "'" +car.getJurisdiction() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
        } else {
            //修改
            status = carService.updateById(car);
            //内网同步
            String s1 =
                "update sys_car set car_number = " + "'" + car.getCarNumber() + "'" +
                    ",number_type = " + "'" + car.getNumberType() + "'" +
                    ",car_type = " + "'" + car.getCarType() + "'" +
                    ",dept_id = " + "'" + car.getDeptId() + "'" +
                    ",person_in_charge = " + "'" + car.getJurisdiction() + "'" +
                    ",brand = " + "'" + car.getBrand() + "'" +
                    ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" +
                    ",umweltsatz = " + "'" + car.getUmweltsatz() + "'" +
                    ",mode = " + "'" + car.getMode() + "'" +
                    ",jurisdiction = " + "'" + car.getJurisdiction() + "'" +
                    " " +"where id = " + "'" + car.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_car set car_number = " + "'" + car.getCarNumber() + "'" +
                        ",number_type = " + "'" + car.getNumberType() + "'" +
                        ",car_type = " + "'" + car.getCarType() + "'" +
                        ",dept_id = " + "'" + car.getDeptId() + "'" +
                        ",person_in_charge = " + "'" + car.getJurisdiction() + "'" +
                        ",brand = " + "'" + car.getBrand() + "'" +
                        ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" +
                        ",umweltsatz = " + "'" + car.getUmweltsatz() + "'" +
                        ",mode = " + "'" + car.getMode() + "'" +
                        ",jurisdiction = " + "'" + car.getJurisdiction() + "'" +
                        " " + "where id = " + "'" + car.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        return R.status(status);
    }
    /**
     * 删除
     *
     * @param ids 车辆信息ids 数组
     */
    @PostMapping("/remove")
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_car where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(carService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 详情
     *
     * @param car 车辆信息对象
     */
    @GetMapping("/detail")
@@ -153,8 +168,8 @@
     * 导入车辆信息, excel
     */
    @PostMapping("import-car")
    public R importCar(MultipartFile file, Integer isCovered,String deptId) {
        CarImporter carImporter = new CarImporter(carService, false,deptId);
    public R importCar(MultipartFile file, Integer isCovered, String deptId) {
        CarImporter carImporter = new CarImporter(carService, false, deptId);
        ExcelUtil.save(file, carImporter, CarExcel.class);
        return R.success("操作成功");
    }
@@ -178,7 +193,7 @@
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
            fileName = URLEncoder.encode("车辆导入数据模板"+ DateUtil.time(), Charsets.UTF_8.name());
            fileName = URLEncoder.encode("车辆导入数据模板" + DateUtil.time(), Charsets.UTF_8.name());
            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
            //修改单元格格式为文本格式
src/main/java/org/springblade/modules/equipage/controller/EquipageController.java
@@ -18,6 +18,7 @@
import org.springblade.modules.equipage.vo.EquipageVo;
import org.springblade.modules.exam.excel.ExamScoreExcel;
import org.springblade.modules.exam.excel.ExamScoreImporter;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -38,10 +39,12 @@
public class EquipageController {
    private final EquipageService equipageService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     * @param query page,size
     *
     * @param query    page,size
     * @param equipage 装备信息对象
     */
    @GetMapping("/page")
@@ -52,6 +55,7 @@
    /**
     * 新增
     *
     * @param equipage 装备信息对象
     */
    @PostMapping("/save")
@@ -62,6 +66,7 @@
    /**
     * 修改
     *
     * @param equipage 装备信息对象
     */
    @PostMapping("/update")
@@ -71,69 +76,78 @@
    /**
     * 新增或修改
     *
     * @param equipage 装备信息对象
     */
    @PostMapping("/submit")
    public R submit(@RequestBody Equipage equipage){
    public R submit(@RequestBody Equipage equipage) {
        boolean status = false;
        if (equipage.getId()==null){
        if (equipage.getId() == null) {
            //新增
            status = equipageService.save(equipage);
            //数据推送
            String s1 =
                "insert into sys_equipage(id,name,number,specifications,mode,dept_id,brand,date_for_production,jurisdiction,person_in_charge,num) " +
                    "values(" + "'" + equipage.getId() + "'" + "," +
                    "'" + equipage.getName() + "'" + "," +
                    "'" + equipage.getNumber() + "'" + "," +
                    "'" + equipage.getSpecifications() + "'" + "," +
                    "'" + equipage.getMode() + "'" + "," +
                    "'" + equipage.getDeptId() + "'" + "," +
                    "'" + equipage.getBrand() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" + "," +
                    "'" + equipage.getJurisdiction() + "'" + "," +
                    "'" + equipage.getPersonInCharge() + "'" + "," +
                    "'" +equipage.getNum() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据推送
                String s1 =
                    "insert into sys_equipage(id,name,number,specifications,mode,dept_id,brand,date_for_production,jurisdiction,person_in_charge,num) " +
                        "values(" + "'" + equipage.getId() + "'" + "," +
                        "'" + equipage.getName() + "'" + "," +
                        "'" + equipage.getNumber() + "'" + "," +
                        "'" + equipage.getSpecifications() + "'" + "," +
                        "'" + equipage.getMode() + "'" + "," +
                        "'" + equipage.getDeptId() + "'" + "," +
                        "'" + equipage.getBrand() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" + "," +
                        "'" + equipage.getJurisdiction() + "'" + "," +
                        "'" + equipage.getPersonInCharge() + "'" + "," +
                        "'" + equipage.getNum() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            //修改
            status = equipageService.updateById(equipage);
            //内网同步
            String s1 =
                "update sys_equipage set name = " + "'" + equipage.getName() + "'" +
                    ",number = " + "'" + equipage.getDeptId() + "'" +
                    ",specifications = " + "'" + equipage.getSpecifications() + "'" +
                    ",mode = " + "'" + equipage.getMode() + "'" +
                    ",dept_id = " + "'" + equipage.getDeptId() + "'" +
                    ",brand = " + "'" + equipage.getBrand() + "'" +
                    ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" +
                    ",jurisdiction = " + "'" + equipage.getJurisdiction() + "'" +
                    ",num = " + "'" + equipage.getNum() + "'" +
                    ",person_in_charge = " + "'" + equipage.getPersonInCharge() + "'" +
                    " " +"where id = " + "'" + equipage.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_equipage set name = " + "'" + equipage.getName() + "'" +
                        ",number = " + "'" + equipage.getDeptId() + "'" +
                        ",specifications = " + "'" + equipage.getSpecifications() + "'" +
                        ",mode = " + "'" + equipage.getMode() + "'" +
                        ",dept_id = " + "'" + equipage.getDeptId() + "'" +
                        ",brand = " + "'" + equipage.getBrand() + "'" +
                        ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" +
                        ",jurisdiction = " + "'" + equipage.getJurisdiction() + "'" +
                        ",num = " + "'" + equipage.getNum() + "'" +
                        ",person_in_charge = " + "'" + equipage.getPersonInCharge() + "'" +
                        " " + "where id = " + "'" + equipage.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        return R.status(status);
    }
    /**
     * 删除
     *
     * @param ids 装备信息ids 数组
     */
    @PostMapping("/remove")
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_equipage where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(equipageService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 详情
     *
     * @param equipage 装备信息对象
     */
    @GetMapping("/detail")
@@ -145,6 +159,7 @@
    /**
     * 导入装备数据
     *
     * @param isCovered 1 覆盖  0不覆盖
     * @return
     */
src/main/java/org/springblade/modules/equipage/controller/GunController.java
@@ -20,6 +20,7 @@
import org.springblade.modules.equipage.excel.GunImporter;
import org.springblade.modules.equipage.service.GunService;
import org.springblade.modules.equipage.vo.GunVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -42,11 +43,13 @@
public class GunController {
    private final GunService gunService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     *
     * @param query page,size
     * @param gun 枪支信息对象
     * @param gun   枪支信息对象
     */
    @GetMapping("/page")
    public R<IPage<GunVo>> page(GunVo gun, Query query) {
@@ -56,6 +59,7 @@
    /**
     * 新增
     *
     * @param gun 枪支信息对象
     */
    @PostMapping("/save")
@@ -66,6 +70,7 @@
    /**
     * 修改
     *
     * @param gun 枪支信息对象
     */
    @PostMapping("/update")
@@ -75,68 +80,77 @@
    /**
     * 新增或修改
     *
     * @param gun 枪支信息对象
     */
    @PostMapping("/submit")
    public R submit(@RequestBody Gun gun){
    public R submit(@RequestBody Gun gun) {
        boolean status = false;
        if (null==gun.getId()) {
        if (null == gun.getId()) {
            //新增
            status = gunService.save(gun);
            //数据同步
            String s1 =
                "insert into sys_gun(id,issue_unit,card_number,gun_mode," +
                    "dept_id,person_in_charge,issue_time,valid_time,jurisdiction,card_no) " +
                    "values(" + "'" + gun.getId() + "'" + "," +
                    "'" + gun.getIssueUnit() + "'" + "," +
                    "'" + gun.getCardNumber() + "'" + "," +
                    "'" + gun.getGunMode() + "'" + "," +
                    "'" + gun.getDeptId() + "'" + "," +
                    "'" + gun.getPersonInCharge() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getIssueTime()) + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" + "," +
                    "'" +gun.getCardNo() + "'" + "," +
                    "'" +gun.getJurisdiction() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据同步
                String s1 =
                    "insert into sys_gun(id,issue_unit,card_number,gun_mode," +
                        "dept_id,person_in_charge,issue_time,valid_time,jurisdiction,card_no) " +
                        "values(" + "'" + gun.getId() + "'" + "," +
                        "'" + gun.getIssueUnit() + "'" + "," +
                        "'" + gun.getCardNumber() + "'" + "," +
                        "'" + gun.getGunMode() + "'" + "," +
                        "'" + gun.getDeptId() + "'" + "," +
                        "'" + gun.getPersonInCharge() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getIssueTime()) + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" + "," +
                        "'" + gun.getCardNo() + "'" + "," +
                        "'" + gun.getJurisdiction() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            //修改
            status = gunService.updateById(gun);
            //内网同步
            String s1 =
                "update sys_gun set issue_unit = " + "'" + gun.getIssueUnit() + "'" +
                    ",card_number = " + "'" + gun.getCardNumber() + "'" +
                    ",gun_mode = " + "'" + gun.getGunMode() + "'" +
                    ",dept_id = " + "'" + gun.getDeptId() + "'" +
                    ",person_in_charge = " + "'" + gun.getJurisdiction() + "'" +
                    ",issue_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getIssueTime()) + "'" +
                    ",valid_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" +
                    ",jurisdiction = " + "'" + gun.getJurisdiction() + "'" +
                    ",card_no = " + "'" + gun.getCardNo() + "'" +
                    " " +"where id = " + "'" + gun.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_gun set issue_unit = " + "'" + gun.getIssueUnit() + "'" +
                        ",card_number = " + "'" + gun.getCardNumber() + "'" +
                        ",gun_mode = " + "'" + gun.getGunMode() + "'" +
                        ",dept_id = " + "'" + gun.getDeptId() + "'" +
                        ",person_in_charge = " + "'" + gun.getJurisdiction() + "'" +
                        ",issue_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getIssueTime()) + "'" +
                        ",valid_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" +
                        ",jurisdiction = " + "'" + gun.getJurisdiction() + "'" +
                        ",card_no = " + "'" + gun.getCardNo() + "'" +
                        " " + "where id = " + "'" + gun.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        return R.status(status);
    }
    /**
     * 删除
     *
     * @param ids 枪支信息ids 数组
     */
    @PostMapping("/remove")
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_gun where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(gunService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 详情
     *
     * @param gun 枪支信息对象
     */
    @GetMapping("/detail")
@@ -152,7 +166,7 @@
     */
    @PostMapping("import-gun")
    public R importGun(MultipartFile file, Integer isCovered, String deptId) {
        GunImporter gunImporter = new GunImporter(gunService, false,deptId);
        GunImporter gunImporter = new GunImporter(gunService, false, deptId);
        ExcelUtil.save(file, gunImporter, GunExcel.class);
        return R.success("操作成功");
    }
@@ -176,7 +190,7 @@
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
            fileName = URLEncoder.encode("枪支导入数据模板"+ DateUtil.time(), Charsets.UTF_8.name());
            fileName = URLEncoder.encode("枪支导入数据模板" + DateUtil.time(), Charsets.UTF_8.name());
            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
            //修改单元格格式为文本格式
            EasyExcel.write(response.getOutputStream(), GunExcel.class).sheet("枪支数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list);
src/main/java/org/springblade/modules/equipage/controller/fixed.java
@@ -13,9 +13,11 @@
import org.springblade.modules.location.service.LiveLocationService;
import org.springblade.modules.location.service.LocusService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
@@ -33,6 +35,8 @@
    private LocusService locusService;
    @Autowired
    private CarService carService;
    @Autowired
    private MyAsyncService myAsyncService;
    /**
     * 押运人员
@@ -45,7 +49,7 @@
        String url = "http://47.104.104.46/api/client/getgis.php";
        //查询有押运人员的数据
        List<Map<String, Object>> list = userService.selectEquipent();
        if (list.size()>0) {
        if (list.size() > 0) {
            for (int i = 0; i < list.size(); i++) {
                //实时位置实体类
                LiveLocation liveLocation = new LiveLocation();
@@ -111,7 +115,8 @@
                            "'" + liveLocation.getLongitude() + "'" + "," +
                            "'" + liveLocation.getLatitude() + "'" + "," +
                            "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                } else {
                    status = liveLocationService.updateById(liveLocationInfo);
                    //内网同步
@@ -122,7 +127,8 @@
                            ",latitude = " + "'" + liveLocationInfo.getLatitude() + "'" +
                            ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                            " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }
        }
@@ -162,10 +168,9 @@
            JSONArray jsonArray = JSONArray.fromObject(a);
            String s1 = "";
            String track = jsonArray.getJSONObject(0).get("track").toString();
            if (track.equals("[]")){
            if (track.equals("[]")) {
                System.out.println("数据为空");
            }
            else {
            } else {
                JSONArray jsonArray1 = JSONArray.fromObject(track);
                for (int j = 0; j < jsonArray1.size(); j++) {
                    String gis_jd = jsonArray1.getJSONObject(j).get("gis_jd").toString();
@@ -195,7 +200,8 @@
                        s1 += ";";
                    }
                }
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
    }
@@ -227,7 +233,7 @@
                String a = "[" + res + "]";
                JSONArray jsonArray = JSONArray.fromObject(a);
                String code = jsonArray.getJSONObject(0).get("code").toString();
                if (Integer.parseInt(code)==200) {
                if (Integer.parseInt(code) == 200) {
                    String data = jsonArray.getJSONObject(0).get("data").toString();
                    String b = "[" + data + "]";
                    JSONArray jsonArrayb = JSONArray.fromObject(b);
@@ -251,27 +257,33 @@
                    if (null == liveLocationInfo) {
                        //新增
                        status = liveLocationService.save(liveLocation);
                        //数据推送
                        String s1 =
                            "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time) " +
                                "values(" + "'" + liveLocation.getId() + "'" + "," +
                                "'" + liveLocation.getType() + "'" + "," +
                                "'" + liveLocation.getWorkerId() + "'" + "," +
                                "'" + liveLocation.getLongitude() + "'" + "," +
                                "'" + liveLocation.getLatitude() + "'" + "," +
                                "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
                        FtpUtil.sqlFileUpload(s1);
                        if (status) {
                            //数据推送
                            String s1 =
                                "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time) " +
                                    "values(" + "'" + liveLocation.getId() + "'" + "," +
                                    "'" + liveLocation.getType() + "'" + "," +
                                    "'" + liveLocation.getWorkerId() + "'" + "," +
                                    "'" + liveLocation.getLongitude() + "'" + "," +
                                    "'" + liveLocation.getLatitude() + "'" + "," +
                                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + ")";
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                        }
                    } else {
                        status = liveLocationService.updateById(liveLocationInfo);
                        //内网同步
                        String s1 =
                            "update sys_live_location set type = " + "'" + liveLocationInfo.getType() + "'" +
                                ",worker_id = " + "'" + liveLocationInfo.getWorkerId() + "'" +
                                ",longitude = " + "'" + liveLocationInfo.getLongitude() + "'" +
                                ",latitude = " + "'" + liveLocationInfo.getLatitude() + "'" +
                                ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                                " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        if (status) {
                            String s1 =
                                "update sys_live_location set type = " + "'" + liveLocationInfo.getType() + "'" +
                                    ",worker_id = " + "'" + liveLocationInfo.getWorkerId() + "'" +
                                    ",longitude = " + "'" + liveLocationInfo.getLongitude() + "'" +
                                    ",latitude = " + "'" + liveLocationInfo.getLatitude() + "'" +
                                    ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocationInfo.getRecordTime()) + "'" +
                                    " " + "where id = " + "'" + liveLocationInfo.getId() + "'";
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                        }
                    }
                }
            } catch (Exception e) {
src/main/java/org/springblade/modules/equipage/service/impl/CarServiceImpl.java
@@ -12,6 +12,7 @@
import org.springblade.modules.equipage.vo.CarVo;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserDeptService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -28,6 +29,8 @@
    @Autowired
    private IUserDeptService userDeptService;
    @Autowired
    private  MyAsyncService myAsyncService;
    /**
     * 车辆分页信息
@@ -88,7 +91,8 @@
                    "," + "'" + car.getBrand() + "'" +
                    "," + "'" + car.getUmweltsatz() + "'" +
                    "," + "'" + car.getMode() + "'" + ")";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            });
        }else {
src/main/java/org/springblade/modules/equipage/service/impl/EquipageServiceImpl.java
@@ -13,6 +13,7 @@
import org.springblade.modules.equipage.vo.EquipageVo;
import org.springblade.modules.system.service.IUserDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -31,6 +32,7 @@
    private final IUserService userService;
    private final IUserDeptService userDeptService;
    private final MyAsyncService myAsyncService;
    @Override
    public IPage<EquipageVo> selectEquipagePage(IPage<EquipageVo> page, EquipageVo rquipage) {
@@ -106,7 +108,8 @@
                            "'" + equipage.getBrand() + "'" + "," +
                            "'" + new SimpleDateFormat("yyyy/MM/dd").format(equipage.getDateForProduction()) + "'" + "," +
                            "'" + equipage.getNum() + "'" + ")";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }else {
                    //数据推送
                    String s1 =
@@ -118,7 +121,8 @@
                            "'" + equipage.getPersonInCharge() + "'" + "," +
                            "'" + equipage.getBrand() + "'" + "," +
                            "'" + equipage.getNum() + "'" + ")";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            });
        }
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java
@@ -13,6 +13,7 @@
import org.springblade.modules.equipage.service.GunService;
import org.springblade.modules.equipage.vo.GunVo;
import org.springblade.modules.system.service.IUserDeptService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -29,6 +30,8 @@
    @Autowired
    private IUserDeptService userDeptService;
    @Autowired
    private  MyAsyncService myAsyncService;
    /**
     * 枪支分页信息
@@ -91,7 +94,8 @@
                        "'" + gun.getDeptId() + "'" + "," +
                        "'" + gun.getPersonInCharge() + "'" + "," +
                        "'" +gun.getCardNo() + "'" + ")";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            });
        }else {
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java
@@ -44,6 +44,7 @@
import org.springblade.modules.exam.wrapper.ExamPaperWrapper;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.training.entity.TrainExam;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.service.TrainingRegistrationService;
@@ -78,6 +79,7 @@
    private final IUserService userService;
    private final MyAsyncService myAsyncService;
    /**
@@ -114,7 +116,8 @@
    /**
     * 自定义查询
     * @param query 分页条件
     *
     * @param query       分页条件
     * @param examPaperVO 查询参数
     * @return
     */
@@ -134,11 +137,14 @@
    public R save(@RequestBody ExamPaper examPaper) {
        boolean save = examPaperService.save(examPaper);
        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getStartTime());
        String s = "insert into ksxt_exam(id,exam_name,exam_type,start_time) " +
            "values(" + "'" + examPaper.getId() + "'" + "," + "'" + examPaper.getExamName() +
            "'" + "," + "'" + examPaper.getExamType() +
            "'" + ","  +"'" + format + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        if (save) {
            String s = "insert into ksxt_exam(id,exam_name,exam_type,start_time) " +
                "values(" + "'" + examPaper.getId() + "'" + "," + "'" + examPaper.getExamName() +
                "'" + "," + "'" + examPaper.getExamType() +
                "'" + "," + "'" + format + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
        return R.status(save);
    }
@@ -149,12 +155,16 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入exam")
    public R update(@RequestBody ExamPaper exam) {
        String s1 =
            "update ksxt_exam set exam_name = " + "'" + exam.getExamName() + "'" +
                ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getStartTime()) + "'" +
                " " +"where id = " + "'" + exam.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.status(examPaperService.updateById(exam));
        boolean b = examPaperService.updateById(exam);
        if (b) {
            String s1 =
                "update ksxt_exam set exam_name = " + "'" + exam.getExamName() + "'" +
                    ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getStartTime()) + "'" +
                    " " + "where id = " + "'" + exam.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(b);
    }
    /**
@@ -176,10 +186,11 @@
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from ksxt_exam where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        boolean temp = examPaperService.removeByIds(Func.toLongList(ids));
        return R.status(temp);
@@ -232,6 +243,7 @@
    /**
     * 自定义树
     *
     * @param examPaper
     * @return
     */
@@ -245,24 +257,26 @@
     * 解除绑定
     */
    @GetMapping("/UnbindSubject")
    public R UnbindSubject(String paperid,String subjectid){
        return R.status(examPaperService.UnbindSubject(paperid,subjectid));
    public R UnbindSubject(String paperid, String subjectid) {
        return R.status(examPaperService.UnbindSubject(paperid, subjectid));
    }
    /**
     * 查询考生考试信息
     *
     * @param examPaper 用户id
     * @return
     */
    @PostMapping("/getExamDetail")
    public R getExamDetail(@RequestBody ExamPaperVO examPaper){
    public R getExamDetail(@RequestBody ExamPaperVO examPaper) {
        System.out.println("examPaper = " + examPaper);
        return R.data(examPaperService.getExamDetail(examPaper));
    }
    /**
     * 考试名单确认
     *
     * @param
     * @return
     */
@@ -270,12 +284,15 @@
    public R applyConfirm(@RequestBody ExamPaper exam) {
        exam.setConfirmTime(new Date());
        boolean status = examPaperService.updateById(exam);
        //内网数据同步
        String s1 =
            "update ksxt_exam set confirm_user = " + "'" + exam.getConfirmUser()+ "'"
                + ",confirm_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getConfirmTime())+ "'"
                + " " +"where id = " + "'" + exam.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        if (status) {
            //内网数据同步
            String s1 =
                "update ksxt_exam set confirm_user = " + "'" + exam.getConfirmUser() + "'"
                    + ",confirm_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getConfirmTime()) + "'"
                    + " " + "where id = " + "'" + exam.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        //返回数据
        return R.data(status);
    }
@@ -283,67 +300,74 @@
    /**
     * 审核修改
     *
     * @param examPaper 报名培训申请信息对象
     */
    @PostMapping("/update-audit")
    public R updateAudit(@RequestBody ExamPaper examPaper){
    public R updateAudit(@RequestBody ExamPaper examPaper) {
        //查询之前的审核状态,如果审核状态没有发生改变,则不会去修改审核信息
        ExamPaper paper = examPaperService.getById(examPaper.getId());
        boolean status = false;
        if (null!=paper.getAuditStatus()){
        if (null != paper.getAuditStatus()) {
            //审核状态发生改变
//            if (!paper.getAuditStatus().equals(examPaper.getAuditStatus())){
                examPaper.setAuditTime(new Date());
                //修改考试审核状态
                status = examPaperService.updateById(examPaper);
            examPaper.setAuditTime(new Date());
            //修改考试审核状态
            status = examPaperService.updateById(examPaper);
            if (status) {
                //数据同步
                String s1 =
                    "update ksxt_exam set audit_status = " + "'" + examPaper.getAuditStatus()+ "'"
                        + ",audit_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getAuditTime())+ "'"
                        + " " +"where id = " + "'" + examPaper.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //查询当前考试已报名的人员培训报名数据集合
                List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId());
                    "update ksxt_exam set audit_status = " + "'" + examPaper.getAuditStatus() + "'"
                        + ",audit_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getAuditTime()) + "'"
                        + " " + "where id = " + "'" + examPaper.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
            //查询当前考试已报名的人员培训报名数据集合
            List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId());
//        System.out.println("trainingRegistrations = " + trainingRegistrations);
                if (trainingRegistrations.size()>0) {
                    trainingRegistrations.forEach(trainingRegistration -> {
                        //审核通过,则生成准考证号
                        if (examPaper.getAuditStatus()==1) {
                            trainingRegistration.setAuditStatus(1);
                            //查询当前用户审核状态,如果异常,则审核不通过
                            User user = userService.getById(trainingRegistration.getUserId());
                            if (null!=user){
                                if (null!=user.getExaminationType() && !user.getExaminationType().equals("")){
                                    if (user.getExaminationType().equals("1")){
                                        //审核不通过
                                        trainingRegistration.setAuditStatus(2);
                                    }
            if (trainingRegistrations.size() > 0) {
                trainingRegistrations.forEach(trainingRegistration -> {
                    //审核通过,则生成准考证号
                    if (examPaper.getAuditStatus() == 1) {
                        trainingRegistration.setAuditStatus(1);
                        //查询当前用户审核状态,如果异常,则审核不通过
                        User user = userService.getById(trainingRegistration.getUserId());
                        if (null != user) {
                            if (null != user.getExaminationType() && !user.getExaminationType().equals("")) {
                                if (user.getExaminationType().equals("1")) {
                                    //审核不通过
                                    trainingRegistration.setAuditStatus(2);
                                }
                            }
                            if(null==trainingRegistration.getCandidateNo() || trainingRegistration.getCandidateNo().equals("")){
                                //生成准考证号
                                trainingRegistration.setCandidateNo(getCandidateNo(examPaper));
                            }
                        }
                        //审核不通过
                        if (examPaper.getAuditStatus()==2) {
                            trainingRegistration.setAuditStatus(2);
                        if (null == trainingRegistration.getCandidateNo() || trainingRegistration.getCandidateNo().equals("")) {
                            //生成准考证号
                            trainingRegistration.setCandidateNo(getCandidateNo(examPaper));
                        }
                        //待审核
                        if (examPaper.getAuditStatus()==3) {
                            trainingRegistration.setAuditStatus(3);
                        }
                        //修改培训报名信息
                        trainingRegistrationService.updateById(trainingRegistration);
                    }
                    //审核不通过
                    if (examPaper.getAuditStatus() == 2) {
                        trainingRegistration.setAuditStatus(2);
                    }
                    //待审核
                    if (examPaper.getAuditStatus() == 3) {
                        trainingRegistration.setAuditStatus(3);
                    }
                    //修改培训报名信息
                    boolean b = trainingRegistrationService.updateById(trainingRegistration);
                    if (b) {
                        //数据同步
                        String s2 =
                            "update sys_training_registration set candidate_no = " + "'" + trainingRegistration.getCandidateNo()+ "'"
                            "update sys_training_registration set candidate_no = " + "'" + trainingRegistration.getCandidateNo() + "'"
                                + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'"
                                + " " +"where id = " + "'" + trainingRegistration.getId() + "'";
                        FtpUtil.sqlFileUpload(s2);
                    });
                }
                return R.status(status);
                                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
                        //FtpUtil.sqlFileUpload(s2);
                        myAsyncService.FTP(s2);
                    }
                });
            }
            return R.status(status);
//            }
        }
        //返回
@@ -352,45 +376,46 @@
    /**
     * 生成准考证号码
     *
     * @param examPaper 考试报名信息对象
     */
    private String getCandidateNo(ExamPaper examPaper) {
        //获取考试信息
        if (null!=examPaper.getStartTime()){
        if (null != examPaper.getStartTime()) {
            String format = new SimpleDateFormat("yyyy-MM-dd").format(examPaper.getStartTime());
            String year = format.substring(2,4);
            String quarter  = null;
            String year = format.substring(2, 4);
            String quarter = null;
            String months = null;
            int month = Integer.parseInt(format.substring(5,7));
            int day = Integer.parseInt(format.substring(8,10));
            int month = Integer.parseInt(format.substring(5, 7));
            int day = Integer.parseInt(format.substring(8, 10));
            String days = null;
            if (month>0 && month<=3){
            if (month > 0 && month <= 3) {
                quarter = "C";
            }
            if (month>3 && month<=6){
            if (month > 3 && month <= 6) {
                quarter = "X";
            }
            if (month>6 && month<=9){
            if (month > 6 && month <= 9) {
                quarter = "Q";
            }
            if (month>9 && month<=12){
            if (month > 9 && month <= 12) {
                quarter = "D";
            }
            if (month<=9){
            if (month <= 9) {
                months = "0" + month;
            }else {
            } else {
                months = String.valueOf(month);
            }
            if (day<=9){
            if (day <= 9) {
                days = "0" + day;
            }else {
                days = ""+day;
            } else {
                days = "" + day;
            }
            String type = null;
            if (examPaper.getExamType()==1){
            if (examPaper.getExamType() == 1) {
                type = "z";
            }
            if (examPaper.getExamType()==2){
            if (examPaper.getExamType() == 2) {
                type = "m";
            }
            //获取考试名称前缀,去除数字,字母
@@ -425,43 +450,47 @@
    /**
     * 考试中页面刷新,1查询所有的答题信息,2查询所有的已答信息  3其他信息
     *
     * @param examPaperVO 必须包含 scoreId
     * @return
     */
    @GetMapping("/getExamRefreshInfo")
    public R getExamRefreshInfo(ExamPaperVO examPaperVO){
    public R getExamRefreshInfo(ExamPaperVO examPaperVO) {
        return R.data(examPaperService.getExamRefreshInfo(examPaperVO));
    }
    /**
     * 查询考试统计信息
     *
     * @param examPaperVO
     * @return
     */
    @GetMapping("/getExamStatistics")
    public R getExamStatistics(ExamPaperVO examPaperVO, Query query){
    public R getExamStatistics(ExamPaperVO examPaperVO, Query query) {
        IPage<ExamStatisticsVO> pages = examPaperService.getExamStatistics(Condition.getPage(query), examPaperVO);
        return R.data(pages);
    }
    /**
     * 根据考试id 统计查询考试信息
     *
     * @param examPaperVO
     * @return
     */
    @GetMapping("/getExamInfoByExamId")
    public R getExamInfoByExamId(ExamStatisticsVO examPaperVO, Query query){
    public R getExamInfoByExamId(ExamStatisticsVO examPaperVO, Query query) {
        IPage<ExamStatisticsVO> pages = examPaperService.getExamInfoByExamId(Condition.getPage(query), examPaperVO);
        return R.data(pages);
    }
    /**
     * 导出考试统计情况信息
     * @param examScoreVO  需要传三个参数  1:培训学校名称,2:培训学校id 3:日期  4:考试类型,培训考试
     *
     * @param examScoreVO 需要传三个参数  1:培训学校名称,2:培训学校id 3:日期  4:考试类型,培训考试
     */
    @GetMapping("export-examStatistics")
    public void exportExamStatistics(HttpServletResponse response, ExamScoreVO examScoreVO) throws Exception  {
        try{
    public void exportExamStatistics(HttpServletResponse response, ExamScoreVO examScoreVO) throws Exception {
        try {
            //获取考试情况统计数据
            List<ExamStatisticsVO> list1 = examPaperService.getExamInfoByExamIdList(examScoreVO);
@@ -474,7 +503,7 @@
            InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(templateFileName);
            //设置文件名称
            String fileName = URLEncoder.encode(examScoreVO.getCompanyName()+examScoreVO.getExamDate()+"考试情况数据"+ DateUtil.time(), Charsets.UTF_8.name());
            String fileName = URLEncoder.encode(examScoreVO.getCompanyName() + examScoreVO.getExamDate() + "考试情况数据" + DateUtil.time(), Charsets.UTF_8.name());
            //设置文件类型
            response.setContentType("application/vnd.ms-excel");
            //设置编码格式
@@ -498,25 +527,25 @@
            int ycnum = list1.stream().mapToInt(ExamStatisticsVO::getYcnum).sum();
            int qknum = list1.stream().mapToInt(ExamStatisticsVO::getQknum).sum();
            int yknum = list1.stream().mapToInt(ExamStatisticsVO::getYknum).sum();
            map.put("znumTotal",znum);
            map.put("ycnumTotal",ycnum);
            map.put("qknumTotal",qknum);
            map.put("yknumTotal",yknum);
            map.put("znumTotal", znum);
            map.put("ycnumTotal", ycnum);
            map.put("qknumTotal", qknum);
            map.put("yknumTotal", yknum);
            //计算占比,格式化小数
            DecimalFormat df = new DecimalFormat("0.00");
            //返回的是String类型,缺考人数占比
            map.put("absentProportionTotal",df.format((float)qknum/znum*100));
            map.put("absentProportionTotal", df.format((float) qknum / znum * 100));
            //合格人数占比
            DecimalFormat df1 = new DecimalFormat("0.00");
            map.put("qualifiedProportionTotal",df1.format((float)yknum/znum*100));
            map.put("qualifiedProportionTotal", df1.format((float) yknum / znum * 100));
            excelWriter.fill(map, writeSheet);
            //关闭流
            excelWriter.finish();
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -31,6 +31,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.system.vo.UserVO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -59,6 +60,7 @@
    private final ExamPaperService examPaperService;
    private final SecurityPaperService securityPaperService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
@@ -90,13 +92,16 @@
    @ApiOperation(value = "新增", notes = "传入examScore")
    public R save(@RequestBody ExamScore examScore) {
        boolean save = examScoreService.save(examScore);
        //内网同步
        Long sid = examScore.getId();
        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime());
        String s = "insert into exam_score(id,exam_time) " +
            "values(" + "'" + sid + "'" +
            "," + "'" + format + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        if (save) {
            //内网同步
            Long sid = examScore.getId();
            String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime());
            String s = "insert into exam_score(id,exam_time) " +
                "values(" + "'" + sid + "'" +
                "," + "'" + format + "'" + ")";
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
        //返回
        return R.status(save);
    }
@@ -115,6 +120,7 @@
    /**
     * 点击了开始考试后超过60分钟后再考试的,计算之前的考试成绩
     *
     * @param examScore 考试成绩信息对象
     */
    @GetMapping("/getExamScore")
@@ -143,12 +149,14 @@
    public R updateAbsent(@RequestBody ExamScore examScore) {
        examScore.setQualified(3);
        boolean status = examScoreService.updateByIdAndQualifiee(examScore);
        //内网数据推送
        String s1 =
            "update exam_score set qualified = " + "'" + examScore.getQualified() + "'" +
                " " + "where id = " + "'" + examScore.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        if (status) {
            //内网数据推送
            String s1 =
                "update exam_score set qualified = " + "'" + examScore.getQualified() + "'" +
                    " " + "where id = " + "'" + examScore.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(status);
    }
@@ -175,7 +183,7 @@
                ExamPaper paper = examPaperService.getById(examScore.getExamId());
//                if (paper.getExamType() == 1) {
                //如果已有保安证编号,不更新用户信息
                if (null==user1.getSecuritynumber() || user1.getSecuritynumber().equals("")) {
                if (null == user1.getSecuritynumber() || user1.getSecuritynumber().equals("")) {
                    //去生成保安证编号
                    String pre = SecurityPaperUtil.getSecurityPaper();
                    //查询当前年份已有的保安证编号
@@ -205,30 +213,17 @@
                    //修改为持证保安
                    user1.setHold("1");
                    //更新保安数据
                    userService.updateById(user1);
                    //数据同步
                    String s1 =
                        "update blade_user set hold = " + "'" + user1.getHold() + "'" +
                            ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" +
                            ",user_type = " + "'" + user1.getUserType() + "'" +
                            " " + "where id = " + "'" + user1.getId() + "'";
//                    String s1 =
//                        "insert into sys_security_paper(id,number,create_time,people_name,id_card_no,user_id,apply_id,exam_id) " +
//                            "values(" + "'" + securityPaper.getId() + "'"
//                            + "," + "'" + securityPaper.getNumber() +"'"
//                            + "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(securityPaper.getCreateTime()) +"'"
//                            + "," + "'" + securityPaper.getPeopleName() + "'"
//                            + "," + "'" + securityPaper.getIdCardNo() + "'"
//                            + "," + "'" + securityPaper.getUserId() + "'"
//                            + "," + "'" + securityPaper.getApplyId() + "'"
//                            + "," +"'" + securityPaper.getExamId() + "'" + ");" +
//                        "update blade_user set hold = " + "'" + user1.getHold() + "'" +
//                            ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" +
//                            ",user_type = " + "'" + user1.getUserType() + "'" +
//                            " " + "where id = " + "'" + user1.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    boolean b = userService.updateById(user1);
                    if (b) {
                        //数据同步
                        String s1 =
                            "update blade_user set hold = " + "'" + user1.getHold() + "'" +
                                ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" +
                                ",user_type = " + "'" + user1.getUserType() + "'" +
                                " " + "where id = " + "'" + user1.getId() + "'";
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                }
            } else {
                //不合格
@@ -236,18 +231,18 @@
            }
            //总成绩
            if (user.getAge() <= 50) {
                if (null!=examScore1.getTheoryGrade()) {
                if (null != examScore1.getTheoryGrade()) {
                    examScore.setAllGrade(Math.round((examScore.getLearnGrade() + examScore1.getTheoryGrade()) / 2));
                }else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade()/2));
                } else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                }
            }
            if (user.getAge() > 50) {
                if (null!=examScore1.getTheoryGrade()) {
                if (null != examScore1.getTheoryGrade()) {
                    examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore1.getTheoryGrade() * 0.5)))
                        + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
                }else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade()/2));
                } else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                }
            }
        }
@@ -257,7 +252,8 @@
                ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                ",qualified = " + "'" + examScore.getQualified() + "'" +
                " " + "where id = " + "'" + examScore.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        //本地修改
        return R.status(examScoreService.updateById(examScore));
@@ -284,7 +280,8 @@
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from exam_score where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(examScoreService.removeByIds(Func.toLongList(ids)));
    }
@@ -338,7 +335,7 @@
     */
    @GetMapping("export-template")
    @ApiOperation(value = "导出模板")
    public void exportExamScore(HttpServletResponse response)throws IOException {
    public void exportExamScore(HttpServletResponse response) throws IOException {
        List<ExamScoreExcel> list = new ArrayList<>();
        ExamScoreExcel examScoreExcel = new ExamScoreExcel();
        examScoreExcel.setExamName("2021年10月**日保安员证培训考试");
@@ -360,7 +357,7 @@
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
            fileName = URLEncoder.encode("实操成绩数据模板"+ DateUtil.time(), Charsets.UTF_8.name());
            fileName = URLEncoder.encode("实操成绩数据模板" + DateUtil.time(), Charsets.UTF_8.name());
            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
            //修改单元格格式为文本格式
            EasyExcel.write(response.getOutputStream(), ExamScoreExcel.class).sheet("实操成绩数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list);
@@ -386,7 +383,7 @@
        List sccj = new ArrayList();
        for (int i = 0; i <= 100; i++) {
            int xb1 = 0,xb2 = 0;
            int xb1 = 0, xb2 = 0;
            for (int j = 0; j < a.size(); j++) {
                if (i == (int) a.get(j).get("fs")) {
@@ -402,31 +399,33 @@
                }
            }
            if (xb1 == 0){
            if (xb1 == 0) {
                llcj.add("0");
            }
            if (xb2 == 0){
            if (xb2 == 0) {
                sccj.add("0");
            }
        }
        cjhz.put("llcj",llcj);
        cjhz.put("sccj",sccj);
        cjhz.put("llcj", llcj);
        cjhz.put("sccj", sccj);
        return R.data(cjhz);
    }
    /**
     * 自定义分页
     *
     * @param query     page,size
     * @param query page,size
     */
    @GetMapping("/score-page")
    public R<IPage<ExamScoreVO>> scorePage(Query query,ExamScoreVO examScore) {
        IPage<ExamScoreVO> pages = examScoreService.scorePage(Condition.getPage(query),examScore);
    public R<IPage<ExamScoreVO>> scorePage(Query query, ExamScoreVO examScore) {
        IPage<ExamScoreVO> pages = examScoreService.scorePage(Condition.getPage(query), examScore);
        return R.data(pages);
    }
    /**
     * 考试成绩及状态修改
     *
     * @param updateParamVo
     */
    @GetMapping("/update-exam-score")
@@ -437,6 +436,7 @@
    /**
     * 考试重置(重考)
     *
     * @param updateParamVo
     */
    @PostMapping("/refreshTrainExamInfo")
@@ -450,15 +450,16 @@
    @GetMapping("export-examScore")
    @ApiOperationSupport(order = 14)
    @ApiOperation(value = "导出成绩")
    public void exportExamScore(HttpServletResponse response,ExamScoreVO examScoreVO) {
    public void exportExamScore(HttpServletResponse response, ExamScoreVO examScoreVO) {
        //按条件查询成绩数据
        List<ExportExamScoreExcel> examScoreExcels = examScoreService.exportExamScoreList(examScoreVO);
        //导出成绩集合数据
        ExcelUtil.export(response, "成绩数据"+DateUtil.time(), "成绩数据表", examScoreExcels, ExportExamScoreExcel.class);
        ExcelUtil.export(response, "成绩数据" + DateUtil.time(), "成绩数据表", examScoreExcels, ExportExamScoreExcel.class);
    }
    /**
     * 考试成绩恢复状态重置(重考)
     *
     * @param
     */
    @GetMapping("/refreshTrainExamScore")
@@ -468,6 +469,7 @@
    /**
     * 考试情况统计,按月统计各个培训学校考试合格人数和不合格人数
     *
     * @param
     */
    @GetMapping("/getExamStatisInfo")
@@ -477,13 +479,13 @@
    /**
     * 获取当前时间
     *
     * @param
     */
    @GetMapping("/getNowDate")
    public R getNowDate() {
        return R.data(System.currentTimeMillis());
    }
}
src/main/java/org/springblade/modules/exam/controller/ExamSubjectChoicesController.java
@@ -156,10 +156,10 @@
        //查询下一题题目详情
        ExamSubjectChoicesVO detail = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices);
        //判断当前题目的答题结果
        if (examSubjectChoices.getPreSubJectId()!=null) {
            if (null!=examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult()!="" && !examSubjectChoices.getPreResult().equals("")) {
                detail.setResult(examSubjectChoicesService.getAnswerResult(examSubjectChoices.getPreSubJectId(),examSubjectChoices.getPreResult(),examSubjectChoices.getScoreId()));
            }else {
        if (examSubjectChoices.getPreSubJectId() != null) {
            if (null != examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult() != "" && !examSubjectChoices.getPreResult().equals("")) {
                detail.setResult(examSubjectChoicesService.getAnswerResult(examSubjectChoices.getPreSubJectId(), examSubjectChoices.getPreResult(), examSubjectChoices.getScoreId()));
            } else {
                //无
                detail.setResult(3);
            }
@@ -181,12 +181,13 @@
     * 修改单项题目分值
     */
    @PostMapping("/updateChoicesValue")
    public R updateChoicesValue(String id,String value) {
        return R.status(examSubjectChoicesService.updateChoicesValue(id,value));
    public R updateChoicesValue(String id, String value) {
        return R.status(examSubjectChoicesService.updateChoicesValue(id, value));
    }
    /**
     * 导入题库
     *
     * @param isCovered 1 覆盖  0不覆盖
     * @return
     */
@@ -219,10 +220,10 @@
        //查询下一题题目详情
        ExamSubjectChoicesVO detail = examSubjectChoicesService.selectExamSubjectChoicesInfo(examSubjectChoices);
        //判断当前题目的答题结果
        if (examSubjectChoices.getPreSubJectId()!=null) {
            if (null!=examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult()!="" && !examSubjectChoices.getPreResult().equals("")) {
                detail.setResult(examSubjectChoicesService.getAnswerResultBySimulate(examSubjectChoices.getPreSubJectId(),examSubjectChoices.getPreResult(),examSubjectChoices.getSimulateExamId()));
            }else {
        if (examSubjectChoices.getPreSubJectId() != null) {
            if (null != examSubjectChoices.getPreResult() && examSubjectChoices.getPreResult() != "" && !examSubjectChoices.getPreResult().equals("")) {
                detail.setResult(examSubjectChoicesService.getAnswerResultBySimulate(examSubjectChoices.getPreSubJectId(), examSubjectChoices.getPreResult(), examSubjectChoices.getSimulateExamId()));
            } else {
                //无
                detail.setResult(3);
            }
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -27,6 +27,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.system.vo.UserVO;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.service.TrainingRegistrationService;
@@ -43,6 +44,7 @@
/**
 * 考试成绩服务实现类
 *
 * @author zhongrj
 */
@Service
@@ -71,22 +73,24 @@
    @Autowired
    private IInformationService informationService;
    @Autowired
    private MyAsyncService myAsyncService;
    /**
     * 自定义分页数据
     * @param page 分页条件
     *
     * @param page      分页条件
     * @param examScore 考试成绩对象
     * @return
     */
    @Override
    public IPage<ExamScoreVO> selectExamScorePage(IPage<ExamScoreVO> page, ExamScoreVO examScore) {
        if (null!=examScore.getExamType()){
            if (examScore.getExamType()==1){
        if (null != examScore.getExamType()) {
            if (examScore.getExamType() == 1) {
                return page.setRecords(baseMapper.selectExamScorePage(page, examScore));
            }
            if (examScore.getExamType()==2){
            if (examScore.getExamType() == 2) {
                return page.setRecords(baseMapper.selectTrainExamScorePage(page, examScore));
            }
        }
@@ -95,6 +99,7 @@
    /**
     * 详情
     *
     * @param examScore 考试成绩信息对象
     */
    @Override
@@ -104,6 +109,7 @@
    /**
     * 保存考试成绩
     *
     * @param examScore 考试成绩信息对象
     * @return
     */
@@ -111,7 +117,7 @@
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveExamScore(ExamScoreVO examScore) {
        //取出考试结果
        if (examScore.getExamResultVOS().size()>0){
        if (examScore.getExamResultVOS().size() > 0) {
            List<ExamResultVO> examResultVOS = examScore.getExamResultVOS();
            //获取试卷的内容(题号,答案)
//            ExamPaper examPaper = new ExamPaper();
@@ -123,16 +129,16 @@
            //声明理论得分
            int theoryGrade = 0;
            for (ExamResultVO examResultVO : examResultVOS) {
                for (ExamSubjectChoices es: list) {
                for (ExamSubjectChoices es : list) {
                    //对比题目id
                    if (examResultVO.getSubjectChoicesId().equals(es.getId())) {
                        //对比答案
                        if (es.getChoicesType() == 2 || es.getChoicesType() == 3){
                        if (es.getChoicesType() == 2 || es.getChoicesType() == 3) {
                            //判断题逻辑
                            if (examResultVO.getValue().equals(es.getAnswer())) {
                                theoryGrade += examResultVO.getGrade();
                            }
                        }else if(es.getChoicesType() == 0 || es.getChoicesType() == 1){
                        } else if (es.getChoicesType() == 0 || es.getChoicesType() == 1) {
                            //处理多选题的答案排序
                            String[] split = examResultVO.getValue().split(",");
                            StringBuilder builder = new StringBuilder();
@@ -143,7 +149,7 @@
                            //利用数组帮助类自动排序
                            Arrays.sort(arrayCh);
                            String sub0 = Arrays.toString(arrayCh);
                            String sub = sub0.substring(1,sub0.length()-1).replaceAll(" ","");
                            String sub = sub0.substring(1, sub0.length() - 1).replaceAll(" ", "");
                            if (sub.equals(es.getAnswer())) {
                                theoryGrade += examResultVO.getGrade();
                            }
@@ -159,7 +165,7 @@
            int age = 0;
            UserVO user = new UserVO();
            //使用准考证号查询报名信息,修改考试状态为已考试
            if(paper.getExamType()==1){
            if (paper.getExamType() == 1) {
                Apply apply = new Apply();
                apply.setCandidateNo(examScore.getCandidateNo());
                Apply apply1 = applyService.getOne(Condition.getQueryWrapper(apply));
@@ -175,13 +181,14 @@
                //数据同步
                String s =
                    "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);
                    "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);
            }
            //模拟考试
            if(paper.getExamType()==2){
            if (paper.getExamType() == 2) {
                TrainingRegistration trainingRegistration = new TrainingRegistration();
                trainingRegistration.setCandidateNo(examScore.getCandidateNo());
                trainingRegistration.setCancel(1);
@@ -198,9 +205,10 @@
                //数据同步
                String s =
                    "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);
                    "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);
            }
            //设置考试ID
@@ -208,16 +216,16 @@
            //设置理论得分
            examScore.setTheoryGrade(theoryGrade);
            //计算总成绩,此时没有实操成绩,总成绩为实操成绩和理论成绩和的一半
            if (age<=50) {
            if (age <= 50) {
                examScore.setAllGrade(Math.round(theoryGrade / 2));
            }
            if (age>50) {
                examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(theoryGrade*0.5))));
            if (age > 50) {
                examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(theoryGrade * 0.5))));
            }
            //设置状态
            if (theoryGrade>=60){
            if (theoryGrade >= 60) {
                examScore.setQualified(2);
            }else {
            } else {
                examScore.setQualified(1);
            }
            //修改成绩数据
@@ -229,10 +237,11 @@
                    ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                    ",exam_end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:dd").format(examScore.getExamEndTime()) + "'" +
                    ",qualified = " + "'" + examScore.getQualified() + "'" +
                    " " +"where id = " + "'" + examScore.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
                    " " + "where id = " + "'" + examScore.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            if (i>0){
            if (i > 0) {
                //返回结果
                return true;
            }
@@ -243,30 +252,31 @@
    /**
     * 导入实操成绩
     *
     * @param examScoreExcelList
     * @param isCovered 是否覆盖
     * @param isCovered          是否覆盖
     */
    @Override
    public void importExamScore(List<ExamScoreExcel> examScoreExcelList, Boolean isCovered) {
        if (examScoreExcelList.size()>0){
        if (examScoreExcelList.size() > 0) {
            List<Object> errorList = new ArrayList<>();
            //导入状态,默认为true ,如果有一个出现问题则为 false
            AtomicBoolean status = new AtomicBoolean(true);
            //遍历
            examScoreExcelList.forEach(examScoreExcel -> {
                if (null!=examScoreExcel.getLearnGrade() && null!=examScoreExcel.getIdCardNo() && examScoreExcel.getIdCardNo()!=""){
                if (null != examScoreExcel.getLearnGrade() && null != examScoreExcel.getIdCardNo() && examScoreExcel.getIdCardNo() != "") {
                    //使用考试名称匹配考试信息
                    List<ExamPaper> examPaperList = examPaperService.getExamInfoByExamName(examScoreExcel.getExamName());
                    ExamPaper examPaper = examPaperList.get(0);
                    //查询出成绩数据
                    if (examPaperList.size()>0){
                    if (examPaperList.size() > 0) {
                        //取第一个
                        List<ExamScore> examScoreList = baseMapper.getExamScoreInfoByIdCardNo(examScoreExcel.getIdCardNo(),new SimpleDateFormat("yyyy-MM-dd").format(examPaper.getStartTime()));
                        if (examScoreList.size()==0){
                        List<ExamScore> examScoreList = baseMapper.getExamScoreInfoByIdCardNo(examScoreExcel.getIdCardNo(), new SimpleDateFormat("yyyy-MM-dd").format(examPaper.getStartTime()));
                        if (examScoreList.size() == 0) {
                            //根据身份证号查询用户
                            User user0 = userService.getUserInfoByIdCardNo(examScoreExcel.getIdCardNo());
                            if (null==user0){
                                throw new ServiceException("没有找到用户:["+examScoreExcel.getIdCardNo()+"]相关考试成绩信息,请检查身份证是否有误!");
                            if (null == user0) {
                                throw new ServiceException("没有找到用户:[" + examScoreExcel.getIdCardNo() + "]相关考试成绩信息,请检查身份证是否有误!");
//                                throw new ServiceException("用户:["+examScoreExcel.getIdCardNo()+"]不存在");
                            }
                        }
@@ -277,12 +287,12 @@
//                            examScore1.setUserId(user0.getId().toString());
//                            //根据准考证号和用户id查询考试成绩
//                            ExamScore examScore = this.getOne(Condition.getQueryWrapper(examScore1));
                            if (null!=examScore) {
                            if (null != examScore) {
                                //查询当前保安信息
                                UserVO user = userService.getUserAgeById(Long.parseLong(examScore.getUserId()));
                                //设置实操成绩
                                examScore.setLearnGrade(examScoreExcel.getLearnGrade());
                                if (null!=examScore.getTheoryGrade()){
                                if (null != examScore.getTheoryGrade()) {
                                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
                                        //合格
                                        examScore.setQualified(0);
@@ -344,7 +354,8 @@
//                                                    ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
//                                                    ",user_type = " + "'" + user.getUserType() + "'" +
//                                                    " " + "where id = " + "'" + user.getId() + "'";
                                            FtpUtil.sqlFileUpload(s1);
                                            //FtpUtil.sqlFileUpload(s1);
                                            myAsyncService.FTP(s1);
                                        }
                                    }
                                } else {
@@ -353,17 +364,17 @@
                                }
                                //总成绩
                                if (user.getAge() <= 50) {
                                    if (null!=examScore.getTheoryGrade()) {
                                    if (null != examScore.getTheoryGrade()) {
                                        examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScoreExcel.getLearnGrade()) / 2));
                                    }else {
                                    } else {
                                        examScore.setAllGrade(Math.round(examScoreExcel.getLearnGrade() / 2));
                                    }
                                }
                                if (user.getAge() > 50) {
                                    if (null!=examScore.getTheoryGrade()) {
                                    if (null != examScore.getTheoryGrade()) {
                                        examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                                            + Integer.parseInt(String.valueOf(Math.round(examScoreExcel.getLearnGrade() * 0.5))));
                                    }else {
                                    } else {
                                        examScore.setAllGrade(Math.round(examScoreExcel.getLearnGrade() / 2));
                                    }
                                }
@@ -374,24 +385,25 @@
                                        ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                                        ",qualified = " + "'" + examScore.getQualified() + "'" +
                                        " " + "where id = " + "'" + examScore.getId() + "'";
                                FtpUtil.sqlFileUpload(s1);
                                //FtpUtil.sqlFileUpload(s1);
                                myAsyncService.FTP(s1);
                                //更新成绩数据
                                baseMapper.updateById(examScore);
                            }else {
                            } else {
                                errorList.add(examScoreExcel.getIdCardNo());
                                status.set(false);
                            }
                        });
                    }else {
                        throw new ServiceException("导入失败!考试名称:["+examScoreExcel.getExamName()+"]不存在!请核对!");
                    } else {
                        throw new ServiceException("导入失败!考试名称:[" + examScoreExcel.getExamName() + "]不存在!请核对!");
                    }
                }
            });
            //如果所有数据导入有一个异常
            if (!status.get()){
            if (!status.get()) {
                String errorAccount = StringUtils.join(errorList, "\\\n");
                throw new ServiceException("用户:["+errorAccount+"]实操成绩导入失败!账号与准考证号不匹配!");
                throw new ServiceException("用户:[" + errorAccount + "]实操成绩导入失败!账号与准考证号不匹配!");
            }
        }
    }
@@ -466,23 +478,25 @@
//    }
    @Override
    public List<Map<String, Object>> scoreStatistics(String deptid,String jurisdiction) {
        return baseMapper.scoreStatistics(deptid,jurisdiction);
    public List<Map<String, Object>> scoreStatistics(String deptid, String jurisdiction) {
        return baseMapper.scoreStatistics(deptid, jurisdiction);
    }
    @Override
    public List<Map<String, Object>> scoreStatisticssc(String deptid,String jurisdiction) {
        return baseMapper.scoreStatisticssc(deptid,jurisdiction);
    public List<Map<String, Object>> scoreStatisticssc(String deptid, String jurisdiction) {
        return baseMapper.scoreStatisticssc(deptid, jurisdiction);
    }
    /**
     * 修改成绩信息
     *
     * @param examScore
     * @return
     */
    @Override
    public boolean updateByIdAndQualifiee(ExamScore examScore) {
        int result = baseMapper.updateByIdAndQualifiee(examScore);
        if (result>0){
        if (result > 0) {
            return true;
        }
        return false;
@@ -490,17 +504,18 @@
    @Override
    public IPage<ExamScoreVO> scorePage(IPage page, ExamScoreVO examScore) {
        return page.setRecords(baseMapper.scorePage(page,examScore));
        return page.setRecords(baseMapper.scorePage(page, examScore));
    }
    /**
     * 考试成绩及状态修改
     *
     * @param updateParamVo
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateExamScore(UpdateParamVo updateParamVo) {
        if (updateParamVo.getType()==1){
        if (updateParamVo.getType() == 1) {
            //查询所有无成绩的数据
            List<ExamScore> noScoreInfoList = baseMapper.getNoScoreInfo();
            noScoreInfoList.forEach(examScore1 -> {
@@ -511,7 +526,7 @@
                //修改考试状态
                trainingRegistration1.setIsExam(2);
                trainingRegistrationService.updateById(trainingRegistration1);
                if (null!=trainingRegistration1){
                if (null != trainingRegistration1) {
                    //修改用户培训状态信息
                    User user = new User();
                    user.setIsTrain(3);
@@ -522,10 +537,10 @@
                //修改考试成绩
                //生成随机数,在60-79 之间
                int score = (int)(Math.random()*20);
                int score = (int) (Math.random() * 20);
                int sc = score + 60;
                examScore1.setTheoryGrade(sc);
                examScore1.setTheoryGrade(score/2);
                examScore1.setTheoryGrade(score / 2);
                //设置为合格
                examScore1.setQualified(2);
                examScore1.setCandidateNo(trainingRegistration1.getCandidateNo());
@@ -541,15 +556,15 @@
            });
        }
        if (updateParamVo.getType()==2) {
        if (updateParamVo.getType() == 2) {
            //查询所有成绩不合格的数据(准考证号)
            List<ExamScore> list = baseMapper.getDisqualificationExamInfo();
            if (list.size() > 0) {
                list.forEach(examScore1 -> {
                    //修改考试成绩为合格
                    //生成随机数,在60-79 之间
                    int score = (int)((Math.random() * 20));
                    int sc = score+60;
                    int score = (int) ((Math.random() * 20));
                    int sc = score + 60;
                    examScore1.setTheoryGrade(sc);
                    //设置为合格
                    examScore1.setQualified(2);
@@ -576,15 +591,15 @@
            }
        }
        if (updateParamVo.getType()==3) {
        if (updateParamVo.getType() == 3) {
            //查询所有成绩不合格的数据(准考证号)
            List<ExamScore> list = baseMapper.getLheoryGradeLess60();
            if (list.size() > 0) {
                list.forEach(examScore1 -> {
                    //修改考试成绩为合格
                    //生成随机数,在60-79 之间
                    int score = (int)((Math.random() * 20));
                    int sc = score+60;
                    int score = (int) ((Math.random() * 20));
                    int sc = score + 60;
                    examScore1.setTheoryGrade(sc);
                    //设置为合格
                    examScore1.setQualified(2);
@@ -601,19 +616,20 @@
    /**
     * 考试重置
     *
     * @param updateParamVo
     * @return
     */
    @Override
    public boolean refreshTrainExamInfo(UpdateParamVo updateParamVo) {
        if (null!=updateParamVo.getScoreId()){
        if (null != updateParamVo.getScoreId()) {
            ExamScore examScore = this.getById(updateParamVo.getScoreId());
            //获取成绩数据,准考证号,用户id,报名培训id,考试id
            if (null!=examScore){
            if (null != examScore) {
                ExamPaper paper = examPaperService.getById(examScore.getExamId());
                //判断考试类型
                //考试
                if (paper.getExamType()==1){
                if (paper.getExamType() == 1) {
                    //1.修改培训报名信息
                    Apply apply = new Apply();
                    apply.setId(examScore.getApplyId());
@@ -634,16 +650,17 @@
                    //4.内网数据同步
                    String s1 =
                        "update sys_apply set is_exam = " + "'" + apply.getIsExam() + "'" +
                            " " + "where id = " + "'" + apply.getId() + "';"+
                            " " + "where id = " + "'" + apply.getId() + "';" +
                            "update blade_user set is_train = " + "'" + user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "';"+
                            " " + "where id = " + "'" + user.getId() + "';" +
                            "delete from exam_score where id = " + "'" + updateParamVo.getScoreId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    return true;
                }
                //培训考试
                if (paper.getExamType()==2){
                if (paper.getExamType() == 2) {
                    //1.修改培训报名信息
                    TrainingRegistration trainingRegistration = new TrainingRegistration();
                    trainingRegistration.setId(examScore.getApplyId());
@@ -664,11 +681,12 @@
                    //4.内网数据同步
                    String s1 =
                        "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
                            " " + "where id = " + "'" + trainingRegistration.getId() + "';"+
                        "update blade_user set is_train = " + "'" + user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "';"+
                        "delete from exam_score where id = " + "'" + updateParamVo.getScoreId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                            " " + "where id = " + "'" + trainingRegistration.getId() + "';" +
                            "update blade_user set is_train = " + "'" + user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "';" +
                            "delete from exam_score where id = " + "'" + updateParamVo.getScoreId() + "'";
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    return true;
                }
@@ -679,6 +697,7 @@
    /**
     * 按条件查询成绩数据
     *
     * @param examScoreVO
     * @return
     */
@@ -690,6 +709,7 @@
    /**
     * 考试状态修改,考试成绩恢复
     *
     * @param
     * @return
     */
@@ -698,14 +718,14 @@
        int a = 654;
        List<Integer> list = new ArrayList<>();
        list.add(a);
        while (a>=654 && a<=702){
        while (a >= 654 && a <= 702) {
            a++;
            list.add(a);
        }
        //遍历集合
        list.forEach(b->{
        list.forEach(b -> {
            //查询考试记录
            if (b!=698) {
            if (b != 698) {
                ExamAnswerRecord examAnswerRecord = new ExamAnswerRecord();
                examAnswerRecord.setScoreId(Long.parseLong(b.toString()));
                //查询考试成绩
@@ -714,23 +734,23 @@
                List<ExamAnswerRecord> examAnswerRecords = examAnswerRecordService.list(Condition.getQueryWrapper(examAnswerRecord));
                //遍历考试记录
                int socre = 2;
                if (examAnswerRecords.size()>0){
                if (examAnswerRecords.size() > 0) {
                    for (ExamAnswerRecord answerRecord : examAnswerRecords) {
                        //计算分数
                        socre = socre + answerRecord.getAnswerScore();
                    }
                    //修改考试成绩
                    examScore.setTheoryGrade(socre);
                    examScore.setAllGrade(socre/2);
                    examScore.setAllGrade(socre / 2);
                    String endDate = "2021-10-16 15:30:25";
                    try {
                        examScore.setExamEndTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endDate));
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
                    if (socre>=60){
                    if (socre >= 60) {
                        examScore.setQualified(2);
                    }else {
                    } else {
                        examScore.setQualified(1);
                    }
                    //更新数据
@@ -753,6 +773,7 @@
    /**
     * 点击了开始考试后超过60分钟后再考试的,计算之前的考试成绩
     *
     * @param examScore
     * @return
     */
@@ -767,11 +788,11 @@
        //设置默认理论成绩为0
        int count = 0;
        //计算成绩
        if (list.size()>0){
        if (list.size() > 0) {
            //成绩相加
            count = list.stream().mapToInt(ExamAnswerRecord::getAnswerScore).sum();
        }else {
        } else {
            //没有考试记录,本次考试理论成绩为 0
            count = 0;
        }
@@ -794,23 +815,24 @@
        //数据同步
        String s =
            "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);
            "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);
        //设置理论得分
        score.setTheoryGrade(count);
        //计算总成绩,此时没有实操成绩,总成绩为实操成绩和理论成绩和的一半
        if (age<=50) {
        if (age <= 50) {
            score.setAllGrade(Math.round(count / 2));
        }
        if (age>50) {
            score.setAllGrade(Integer.parseInt(String.valueOf(Math.round(count*0.5))));
        if (age > 50) {
            score.setAllGrade(Integer.parseInt(String.valueOf(Math.round(count * 0.5))));
        }
        //设置状态
        if (count>=60){
        if (count >= 60) {
            score.setQualified(2);
        }else {
        } else {
            score.setQualified(1);
        }
        //修改成绩数据
@@ -822,10 +844,11 @@
                ",all_grade = " + "'" + score.getAllGrade() + "'" +
                ",exam_end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:dd").format(new Date()) + "'" +
                ",qualified = " + "'" + score.getQualified() + "'" +
                " " +"where id = " + "'" + score.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
                " " + "where id = " + "'" + score.getId() + "'";
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        if (i>0){
        if (i > 0) {
            //返回结果
            return true;
        }
@@ -834,6 +857,7 @@
    /**
     * 考试情况统计,按月统计各个培训学校考试合格人数和不合格人数
     *
     * @param
     */
    @Override
@@ -846,7 +870,7 @@
        List<Object> objectList = new ArrayList<>();
        for (Information information1 : informationList) {
            //查询各个培训学校本年每月考试情况统计,不是测试学校
            if(!information1.getId().equals(469)) {
            if (!information1.getId().equals(469)) {
                //合格和不合格
                ExamSocreStatisVo statisVo = new ExamSocreStatisVo();
                ExamSocreStatisVo statisVo1 = new ExamSocreStatisVo();
src/main/java/org/springblade/modules/exam/service/impl/ExamSubjectChoicesServiceImpl.java
@@ -15,6 +15,7 @@
import org.springblade.modules.exam.vo.ExamSubjectChoicesVO;
import org.springblade.modules.simulateexam.entity.SimulateExamAnswerRecord;
import org.springblade.modules.simulateexam.service.SimulateExamAnswerRecordService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -26,6 +27,7 @@
/**
 * 选择题服务实现类
 *
 * @author zhongrj
 */
@Service
@@ -39,6 +41,8 @@
    @Autowired
    private SimulateExamAnswerRecordService simulateExamAnswerRecordService;
    @Autowired
    private MyAsyncService myAsyncService;
    @Override
@@ -53,6 +57,7 @@
    /**
     * 详情
     *
     * @param examSubjectChoices 选择题信息对象
     */
    @Override
@@ -62,11 +67,12 @@
    @Override
    public boolean updateChoicesValue(String id, String value) {
        return baseMapper.updateChoicesValue(id,value);
        return baseMapper.updateChoicesValue(id, value);
    }
    /**
     * 新增题目及选项信息
     *
     * @param examSubjectChoices 题目信息对象
     * @return
     */
@@ -103,7 +109,7 @@
                });
                return true;
            }
        }else {
        } else {
            //修改
            ExamSubjectChoices subjectChoices = new ExamSubjectChoices();
            subjectChoices.setId(examSubjectChoices.getId());
@@ -154,7 +160,8 @@
    /**
     * 题库导入
     * @param data 导入数据
     *
     * @param data      导入数据
     * @param isCovered
     */
    @Override
@@ -227,7 +234,7 @@
            //多选选项新增
            if (examSubjectExcel.getChoicesType() == 3) {
                //1选项新增
                if (null!=examSubjectExcel.getOptionContentA() && examSubjectExcel.getOptionContentA()!="") {
                if (null != examSubjectExcel.getOptionContentA() && examSubjectExcel.getOptionContentA() != "") {
                    ExamSubjectOption examSubjectOption = new ExamSubjectOption();
                    //选项新增
                    examSubjectOption.setSubjectChoicesId(subjectChoices.getId());
@@ -240,7 +247,7 @@
                }
                //2选项新增
                if (null!=examSubjectExcel.getOptionContentB() && examSubjectExcel.getOptionContentB()!="") {
                if (null != examSubjectExcel.getOptionContentB() && examSubjectExcel.getOptionContentB() != "") {
                    ExamSubjectOption examSubjectOption1 = new ExamSubjectOption();
                    //选项新增
                    examSubjectOption1.setSubjectChoicesId(subjectChoices.getId());
@@ -253,7 +260,7 @@
                }
                //3选项新增
                if (null!=examSubjectExcel.getOptionContentC() && examSubjectExcel.getOptionContentC()!="") {
                if (null != examSubjectExcel.getOptionContentC() && examSubjectExcel.getOptionContentC() != "") {
                    ExamSubjectOption examSubjectOption2 = new ExamSubjectOption();
                    //选项新增
                    examSubjectOption2.setSubjectChoicesId(subjectChoices.getId());
@@ -266,7 +273,7 @@
                }
                //4选项新增
                if (null!=examSubjectExcel.getOptionContentD() && examSubjectExcel.getOptionContentD()!="") {
                if (null != examSubjectExcel.getOptionContentD() && examSubjectExcel.getOptionContentD() != "") {
                    ExamSubjectOption examSubjectOption3 = new ExamSubjectOption();
                    //选项新增
                    examSubjectOption3.setSubjectChoicesId(subjectChoices.getId());
@@ -280,7 +287,7 @@
                //5选项新增
                if (null!=examSubjectExcel.getOptionContentE() && examSubjectExcel.getOptionContentE()!="") {
                if (null != examSubjectExcel.getOptionContentE() && examSubjectExcel.getOptionContentE() != "") {
                    ExamSubjectOption examSubjectOption4 = new ExamSubjectOption();
                    //选项新增
                    examSubjectOption4.setSubjectChoicesId(subjectChoices.getId());
@@ -299,31 +306,32 @@
    /**
     * 判断当前题目的答题结果
     *
     * @param preSubJectId 题目Id
     * @param preResult 提交的结果
     * @param scoreId 成绩id
     * @param preResult    提交的结果
     * @param scoreId      成绩id
     * @return
     */
    @Override
    public Integer getAnswerResult(Long preSubJectId, String preResult,Long scoreId) {
    public Integer getAnswerResult(Long preSubJectId, String preResult, Long scoreId) {
        //查询题目信息
        ExamSubjectChoices choices = this.getById(preSubJectId);
        //对比答案
        if (choices.getChoicesType() == 2 || choices.getChoicesType() == 3){
        if (choices.getChoicesType() == 2 || choices.getChoicesType() == 3) {
            //保存答题记录
            boolean result = preResult.equals(choices.getAnswer());
            int status = 0;
            //判断题逻辑
            if (result){
            if (result) {
                status = 1;
            }else {
            } else {
                status = 2;
            }
            //新增答题记录
            saveExamAns(choices,preSubJectId,preResult,scoreId,result);
            saveExamAns(choices, preSubJectId, preResult, scoreId, result);
            //返回
            return status;
        }else if(choices.getChoicesType() == 0 || choices.getChoicesType() == 1){
        } else if (choices.getChoicesType() == 0 || choices.getChoicesType() == 1) {
            //处理多选题的答案排序
            String[] split = preResult.split(",");
            StringBuilder builder = new StringBuilder();
@@ -334,19 +342,19 @@
            //利用数组帮助类自动排序
            Arrays.sort(arrayCh);
            String sub0 = Arrays.toString(arrayCh);
            String sub = sub0.substring(1,sub0.length()-1).replaceAll(" ","");
            String sub = sub0.substring(1, sub0.length() - 1).replaceAll(" ", "");
            //保存答题记录
            boolean result = sub.equals(choices.getAnswer());
            int status = 0;
            //判断题逻辑
            if (result){
            if (result) {
                status = 1;
            }else {
            } else {
                status = 2;
            }
            //新增答题记录
            saveExamAns(choices,preSubJectId,preResult,scoreId,result);
            saveExamAns(choices, preSubJectId, preResult, scoreId, result);
            //返回
            return status;
        }
@@ -355,13 +363,14 @@
    /**
     * 新增答题记录
     * @param choices 题目
     *
     * @param choices      题目
     * @param preSubJectId 上一题题目id
     * @param preResult 上一题答题结果
     * @param scoreId 成绩 id
     * @param result 答题是否正确
     * @param preResult    上一题答题结果
     * @param scoreId      成绩 id
     * @param result       答题是否正确
     */
    private void saveExamAns(ExamSubjectChoices choices, Long preSubJectId, String preResult, Long scoreId,boolean result) {
    private void saveExamAns(ExamSubjectChoices choices, Long preSubJectId, String preResult, Long scoreId, boolean result) {
        ExamAnswerRecord examAnswerRecord = new ExamAnswerRecord();
        examAnswerRecord.setScoreId(scoreId);
        examAnswerRecord.setAnswerOption(preResult);
@@ -371,10 +380,10 @@
        examAnswerRecord.setAnswerTime(new Date());
        int status = 0;
        //判断题逻辑
        if (result){
        if (result) {
            status = 1;
            examAnswerRecord.setAnswerScore(choices.getScore());
        }else {
        } else {
            status = 2;
            examAnswerRecord.setAnswerScore(0);
        }
@@ -394,11 +403,13 @@
            "," + "'" + examAnswerRecord.getAnswerScore() + "'" +
            "," + "'" + examAnswerRecord.getAnswerResult() + "'" +
            "," + "'" + examAnswerRecord.getScoreId() + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
    }
    /**
     * 随机查询题库120道
     *
     * @return
     */
    @Override
@@ -408,8 +419,9 @@
    /**
     * 判断当前题目的答题结果
     * @param preSubJectId 题目 id
     * @param preResult 提交的结果
     *
     * @param preSubJectId   题目 id
     * @param preResult      提交的结果
     * @param simulateExamId 模拟考试记录 id
     * @return
     */
@@ -418,21 +430,21 @@
        //查询题目信息
        ExamSubjectChoices choices = this.getById(preSubJectId);
        //对比答案
        if (choices.getChoicesType() == 2 || choices.getChoicesType() == 3){
        if (choices.getChoicesType() == 2 || choices.getChoicesType() == 3) {
            //保存答题记录
            boolean result = preResult.equals(choices.getAnswer());
            int status = 0;
            //判断题逻辑
            if (result){
            if (result) {
                status = 1;
            }else {
            } else {
                status = 2;
            }
            //新增模拟考试答题记录
            saveSimulateExamAns(choices,preSubJectId,preResult,simulateExamId,result);
            saveSimulateExamAns(choices, preSubJectId, preResult, simulateExamId, result);
            //返回
            return status;
        }else if(choices.getChoicesType() == 0 || choices.getChoicesType() == 1){
        } else if (choices.getChoicesType() == 0 || choices.getChoicesType() == 1) {
            //处理多选题的答案排序
            String[] split = preResult.split(",");
            StringBuilder builder = new StringBuilder();
@@ -443,19 +455,19 @@
            //利用数组帮助类自动排序
            Arrays.sort(arrayCh);
            String sub0 = Arrays.toString(arrayCh);
            String sub = sub0.substring(1,sub0.length()-1).replaceAll(" ","");
            String sub = sub0.substring(1, sub0.length() - 1).replaceAll(" ", "");
            //保存模拟考试答题记录
            boolean result = sub.equals(choices.getAnswer());
            int status = 0;
            //判断题逻辑
            if (result){
            if (result) {
                status = 1;
            }else {
            } else {
                status = 2;
            }
            //新增模拟考试答题记录
            saveSimulateExamAns(choices,preSubJectId,preResult,simulateExamId,result);
            saveSimulateExamAns(choices, preSubJectId, preResult, simulateExamId, result);
            //返回
            return status;
        }
@@ -464,11 +476,12 @@
    /**
     * 新增模拟考试答题记录
     * @param choices 题目信息
     * @param preSubJectId 题目id
     * @param preResult 提交的答案
     *
     * @param choices        题目信息
     * @param preSubJectId   题目id
     * @param preResult      提交的答案
     * @param simulateExamId 模拟考试id
     * @param result  答题的结果
     * @param result         答题的结果
     */
    private void saveSimulateExamAns(ExamSubjectChoices choices, Long preSubJectId, String preResult, Long simulateExamId, boolean result) {
        SimulateExamAnswerRecord simulateExamAnswerRecord = new SimulateExamAnswerRecord();
@@ -480,10 +493,10 @@
        simulateExamAnswerRecord.setAnswerTime(new Date());
        int status = 0;
        //判断题逻辑
        if (result){
        if (result) {
            status = 1;
            simulateExamAnswerRecord.setAnswerScore(choices.getScore());
        }else {
        } else {
            status = 2;
            simulateExamAnswerRecord.setAnswerScore(0);
        }
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
@@ -18,6 +18,7 @@
import org.springblade.modules.securitypaper.service.SecurityPaperService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.system.vo.UserVO;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.service.TrainingRegistrationService;
@@ -53,6 +54,8 @@
    @Autowired
    private SecurityPaperService securityPaperService;
    @Autowired
    private  MyAsyncService myAsyncService;
    /**
     * 自定义分页
@@ -146,7 +149,8 @@
                        " " + "where id = " + "'" + trainingRegistration.getId() + "';"+
                    "update blade_user set is_train = " + "'" +  user.getIsTrain() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            } else {
                //实操成绩不为空
                if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
@@ -198,7 +202,8 @@
                                + "," + "'" + securityPaper.getUserId() + "'"
                                + "," + "'" + securityPaper.getApplyId() + "'"
                                + "," +"'" + securityPaper.getExamId() + "'" + ")";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                } else {
                    //不合格
@@ -238,7 +243,8 @@
                        ",user_type = " + "'" + user.getUserType() + "'" +
                        ",is_train = " + "'" + user.getIsTrain() + "'" +
                        " " + "where id = " + "'" + user.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        //审核时间
@@ -312,7 +318,8 @@
                            " " + "where id = " + "'" + trainingRegistration.getId() + "';"+
                        "update blade_user set is_train = " + "'" +  user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                } else {
                    //实操成绩不为空
                    if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
@@ -387,7 +394,8 @@
                            ",user_type = " + "'" + user.getUserType() + "'" +
                            ",is_train = " + "'" + user.getIsTrain() + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }
            //审核时间
src/main/java/org/springblade/modules/experience/controller/ExperienceController.java
@@ -34,6 +34,7 @@
import org.springblade.modules.experience.vo.ExperienceVO;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -57,6 +58,7 @@
    private final IUserService userService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -162,7 +164,8 @@
                    + ",companyname = " + "'" + experience.getCompanyname() + "'"
                    + ",securityId = " + "'" + experience.getSecurityid() + "'"
                    + " " + "where id = " + "'" + experience.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }else {
            //新增
@@ -187,7 +190,8 @@
                "," + "'" + experience.getCompanyname() + "'" +
                "," + "'" + experience.getSecurityid() + "'"
                + ")";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
        return R.status(status);
    }
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -53,6 +53,7 @@
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@@ -97,6 +98,7 @@
    private final IUserService userService;
    private final IRoleService roleService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -149,7 +151,7 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入information")
    @Transactional(rollbackFor = Exception.class)
    public R save(@Valid @RequestBody Information information){
    public R save(@Valid @RequestBody Information information) {
        Dept dept = new Dept();
        //自招保安公司
        if (information.getStats().equals("0")) {
@@ -213,62 +215,64 @@
            //分配保安角色
            //如果是本市保安公司,分公司,自招保安公司,分配保安公司管理员角色,如果是培训学校,则分配的是培训公司管理员角色
            Role role = new Role();
            if (information.getStats().equals("1")){
            if (information.getStats().equals("1")) {
                role.setRoleAlias("培训公司管理员");
            }else {
            } else {
                role.setRoleAlias("保安公司管理员");
            }
            Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
            user.setRoleId(oneRole.getId().toString());
            //插入用户数据
            userService.save(user);
            Integer isDeleted = 0;
            //Integer id = information.getId();
            String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                        ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                        " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                        "contacts,contactscell,create_time,create_user_id) " +
                        "values(" + "'" + information.getId() + "'" +
                        "," + "'" + information.getCreditcode() + "'" +
                        "," + "'" + information.getEnterprisename() + "'" +
                        "," + "'" + information.getRepresentative() + "'" +
                        "," + "'" + information.getRegisteredcapital() + "'" +
                        "," + "'" + information.getOrganizationcode() + "'" +
                        "," + "'" + information.getRegistrationnumber() + "'" +
                        "," + "'" + information.getEnterprises() + "'" +
                        "," + "'" + information.getAddress() + "'" +
                        "," + "'" + information.getBusiness() + "'" +
                        "," + "'" + information.getRegion() + "'" +
                        "," + "'" + information.getRegistration() + "'" +
                        "," + "'" + information.getIndustry() + "'" +
                        "," + "'" + information.getDepartmentid() + "'" +
                        "," + "'" + information.getStats() + "'" +
                        "," + "'" + information.getJurisdiction() + "'" +
                        "," + "'" + information.getRepresentativecell() + "'" +
                        "," + "'" + information.getContacts() + "'" +
                        "," + "'" + information.getContactscell() + "'" +
                        "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getCreateTime()) + "'" +
                        "," + "'" + information.getCreateUserId() + "'" + ");" +
            boolean save = userService.save(user);
            if (save) {
                Integer isDeleted = 0;
                String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                    ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                    " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                    "contacts,contactscell,create_time,create_user_id) " +
                    "values(" + "'" + information.getId() + "'" +
                    "," + "'" + information.getCreditcode() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + information.getRepresentative() + "'" +
                    "," + "'" + information.getRegisteredcapital() + "'" +
                    "," + "'" + information.getOrganizationcode() + "'" +
                    "," + "'" + information.getRegistrationnumber() + "'" +
                    "," + "'" + information.getEnterprises() + "'" +
                    "," + "'" + information.getAddress() + "'" +
                    "," + "'" + information.getBusiness() + "'" +
                    "," + "'" + information.getRegion() + "'" +
                    "," + "'" + information.getRegistration() + "'" +
                    "," + "'" + information.getIndustry() + "'" +
                    "," + "'" + information.getDepartmentid() + "'" +
                    "," + "'" + information.getStats() + "'" +
                    "," + "'" + information.getJurisdiction() + "'" +
                    "," + "'" + information.getRepresentativecell() + "'" +
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getCreateTime()) + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ");" +
                    "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + information.getDepartmentid() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                        + "'" + dept.getTenantId() + "'" +
                        "," + "'" + information.getEnterprisename() + "'" +
                        "," + "'" + dept.getAncestors() + "'" +
                        "," + "'" + dept.getDeptCategory() + "'" +
                        "," + "'" + isDeleted + "'" + ");" +
                    + "'" + dept.getTenantId() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + dept.getAncestors() + "'" +
                    "," + "'" + dept.getDeptCategory() + "'" +
                    "," + "'" + isDeleted + "'" + ");" +
                    "insert into blade_user(id,tenant_id,account,password,dept_id,create_user,create_time,update_time,status,is_deleted,role_id) " +
                        "values(" + "'" + user.getId() + "'" +
                        "," + "'" + user.getTenantId() + "'"
                        + "," + "'" + user.getAccount() + "'" +
                        "," + "'" + user.getPassword() + "'" +
                        "," + "'" + user.getDeptId() + "'" +
                        "," + "'" + user.getCreateUser() + "'" +
                        "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                        "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                        "," + "'" + user.getStatus() + "'" +
                        "," + "'" + user.getIsDeleted() + "'" +
                        "," + "'" + user.getRoleId() + "'" + ")";
            FtpUtil.sqlFileUpload(s);
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'"
                    + "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCreateUser() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getRoleId() + "'" + ")";
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            }
        }
        return R.success("成功");
    }
@@ -280,49 +284,52 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入information")
    public R update(@Valid @RequestBody Information information) throws Exception {
        informationService.updateById(information);
        String businessLicense = null;
        String businessLicenses = null;
        String licence = null;
        String licences = null;
        String format = "";
        if (information.getBusinessLicense() != null && !"".equals(information.getBusinessLicense())) {
            businessLicense = information.getBusinessLicense().substring(26, information.getBusinessLicense().length());
            businessLicenses = FtpConfig.ip + businessLicense;
        } else {
            businessLicenses = "";
        boolean b = informationService.updateById(information);
        if (b) {
            String businessLicense = null;
            String businessLicenses = null;
            String licence = null;
            String licences = null;
            String format = "";
            if (information.getBusinessLicense() != null && !"".equals(information.getBusinessLicense())) {
                businessLicense = information.getBusinessLicense().substring(26, information.getBusinessLicense().length());
                businessLicenses = FtpConfig.ip + businessLicense;
            } else {
                businessLicenses = "";
            }
            if (information.getLicence() != null && !"".equals(information.getLicence())) {
                licence = information.getLicence().substring(26, information.getLicence().length());
                licences = FtpConfig.ip + licence;
            } else {
                licences = "";
            }
            if (information.getEstablishtime() != null && !"".equals(information.getEstablishtime())) {
                format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
            }
            //内网同步
            String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
                ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
                ",representative = " + "'" + information.getRepresentative() + "'" +
                ",establishTime = " + "'" + format + "'" +
                ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
                ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
                ",enterprises = " + "'" + information.getEnterprises() + "'" +
                ",address = " + "'" + information.getAddress() + "'" +
                ",business = " + "'" + information.getBusiness() + "'" +
                ",region = " + "'" + information.getRegion() + "'" +
                ",registration = " + "'" + information.getRegistration() + "'" +
                ",industry = " + "'" + information.getIndustry() + "'" +
                ",departmentid = " + "'" + information.getDepartmentid() + "'" +
                ",stats = " + "'" + information.getStats() + "'" +
                ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
                ",contacts = " + "'" + information.getContacts() + "'" +
                ",contactscell = " + "'" + information.getContactscell() + "'" +
                ",business_License = " + "'" + businessLicenses + "'" +
                ",licence = " + "'" + licences + "'" +
                " " + "where id = " + "'" + information.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        if (information.getLicence() != null && !"".equals(information.getLicence())) {
            licence = information.getLicence().substring(26, information.getLicence().length());
            licences = FtpConfig.ip + licence;
        } else {
            licences = "";
        }
        if (information.getEstablishtime() != null && !"".equals(information.getEstablishtime())) {
            format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
        }
        //内网同步
        String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
            ",enterpriseName = " + "'" + information.getEnterprisename() + "'" +
            ",representative = " + "'" + information.getRepresentative() + "'" +
            ",establishTime = " + "'" + format + "'" +
            ",registeredCapital = " + "'" + information.getRegisteredcapital() + "'" +
            ",jurisdiction = " + "'" + information.getJurisdiction() + "'" +
            ",enterprises = " + "'" + information.getEnterprises() + "'" +
            ",address = " + "'" + information.getAddress() + "'" +
            ",business = " + "'" + information.getBusiness() + "'" +
            ",region = " + "'" + information.getRegion() + "'" +
            ",registration = " + "'" + information.getRegistration() + "'" +
            ",industry = " + "'" + information.getIndustry() + "'" +
            ",departmentid = " + "'" + information.getDepartmentid() + "'" +
            ",stats = " + "'" + information.getStats() + "'" +
            ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
            ",contacts = " + "'" + information.getContacts() + "'" +
            ",contactscell = " + "'" + information.getContactscell() + "'" +
            ",business_License = " + "'" + businessLicenses + "'" +
            ",licence = " + "'" + licences + "'" +
            " " + "where id = " + "'" + information.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.success("修改成功");
    }
@@ -355,22 +362,27 @@
            //机构删除
            informationService.deleteDept(s);
            //当前公司下人员逻辑删除
              informationService.deleteUserByDeptId(s);
            informationService.deleteUserByDeptId(s);
            //保安公司信息
            String s1 = "delete from sys_information where departmentid = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            //主要管理人
            String s2 = "delete from sys_shareholder where dept_id = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s2);
            //FtpUtil.sqlFileUpload(s2);
            myAsyncService.FTP(s2);
            //出资人
            String s3 = "delete from sys_member where dept_id = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s3);
            //FtpUtil.sqlFileUpload(s3);
            myAsyncService.FTP(s3);
            //组织机构信息逻辑删除
            String s4 = "update blade_dept set is_deleted  = 1 where id = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s4);
            //FtpUtil.sqlFileUpload(s4);
            myAsyncService.FTP(s4);
            //保安公司人员信息删除
            String s5 = "update blade_user set is_deleted  = 1 where dept_id " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s5);
            //FtpUtil.sqlFileUpload(s5);
            myAsyncService.FTP(s5);
        });
        //返回
        return R.success("删除成功");
@@ -432,7 +444,6 @@
        }
        return R.data(list);
    }
    /**
@@ -516,7 +527,7 @@
     */
    @GetMapping("/export-business-statis")
    public void exportBusinessStatis(HttpServletResponse response, InformationVO information) {
        List<ExportInformationExcel> list= informationService.exportBusinessStatis(information);
        List<ExportInformationExcel> list = informationService.exportBusinessStatis(information);
        ExcelUtil.export(response, "业务统计数据" + DateUtil.time(), "业务统计数据表", list, ExportInformationExcel.class);
    }
@@ -524,7 +535,7 @@
     * 保安员情况统计导出
     */
    @GetMapping("/export-security-statis-info")
    public void exportSecurityStatisInfo(HttpServletResponse response,InformationVO information) {
    public void exportSecurityStatisInfo(HttpServletResponse response, InformationVO information) {
        List<ExportInformationSecurityStatistics> list = informationService.exportSecurityStatisInfo(information);
        ExcelUtil.export(response, "保安员统计数据" + DateUtil.time(), "保安员统计数据表", list, ExportInformationSecurityStatistics.class);
    }
@@ -540,7 +551,8 @@
    /**
     * 查询学历统计信息
     * @param deptid 部门id
     *
     * @param deptid       部门id
     * @param jurisdiction 辖区
     * @return
     */
@@ -551,6 +563,7 @@
    /**
     * 获取部门信息()
     *
     * @param information
     * @return
     */
src/main/java/org/springblade/modules/location/controller/LiveLocationController.java
@@ -16,6 +16,7 @@
import org.springblade.modules.location.vo.LiveLocationVOTest;
import org.springblade.modules.location.vo.LiveLocationVo;
import org.springblade.modules.location.vo.LocusVo;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
@@ -36,12 +37,13 @@
    private final LocusService locusService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     * @param query page,size
     * @param liveLocation 实时位置信息对象
     *
     * @param query        page,size
     * @param liveLocation 实时位置信息对象
     */
    @GetMapping("/page")
    public R<IPage<LiveLocationVo>> page(LiveLocationVo liveLocation, Query query) {
@@ -51,6 +53,7 @@
    /**
     * 新增
     *
     * @param liveLocation 实时位置信息对象
     */
    @PostMapping("/save")
@@ -62,6 +65,7 @@
    /**
     * 实时位置信息新增,同时新增到轨迹表中
     *
     * @param liveLocation 实时位置信息对象
     */
    @PostMapping("/saveLiveLocationAndLocus")
@@ -70,50 +74,55 @@
        //先查询是否已有实时位置信息,如果有,则更新,没有则插入
        LiveLocation liveLocationInfo = liveLocationService.getLiveLocationInfo(liveLocation);
        boolean status = false;
        if (null == liveLocationInfo){
        if (null == liveLocationInfo) {
            //新增
            liveLocation.setRecordTime(new Date());
            status = liveLocationService.save(liveLocation);
            //数据推送
            String s1 =
                "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time,location) " +
                    "values(" + "'" + liveLocation.getId() + "'" + "," +
                    "'" + liveLocation.getType() + "'" + "," +
                    "'" + liveLocation.getWorkerId() + "'" + "," +
                    "'" + liveLocation.getLongitude() + "'" + "," +
                    "'" + liveLocation.getLatitude() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                    "'" +liveLocation.getLocation() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据推送
                String s1 =
                    "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time,location) " +
                        "values(" + "'" + liveLocation.getId() + "'" + "," +
                        "'" + liveLocation.getType() + "'" + "," +
                        "'" + liveLocation.getWorkerId() + "'" + "," +
                        "'" + liveLocation.getLongitude() + "'" + "," +
                        "'" + liveLocation.getLatitude() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                        "'" + liveLocation.getLocation() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            //更新
            liveLocationInfo.setRecordTime(new Date());
            liveLocationInfo.setLongitude(liveLocation.getLongitude());
            liveLocationInfo.setLatitude(liveLocation.getLatitude());
            status = liveLocationService.updateById(liveLocationInfo);
            //内网同步
            String s1 =
                "update sys_live_location set type = " + "'" + liveLocation.getType() + "'" +
                    ",worker_id = " + "'" + liveLocation.getWorkerId() + "'" +
                    ",longitude = " + "'" + liveLocation.getLongitude() + "'" +
                    ",latitude = " + "'" + liveLocation.getLatitude() + "'" +
                    ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" +
                    ",location = " + "'" + liveLocation.getLocation() + "'" +
                    " " +"where id = " + "'" + liveLocation.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_live_location set type = " + "'" + liveLocation.getType() + "'" +
                        ",worker_id = " + "'" + liveLocation.getWorkerId() + "'" +
                        ",longitude = " + "'" + liveLocation.getLongitude() + "'" +
                        ",latitude = " + "'" + liveLocation.getLatitude() + "'" +
                        ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" +
                        ",location = " + "'" + liveLocation.getLocation() + "'" +
                        " " + "where id = " + "'" + liveLocation.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        if (status){
        if (status) {
            //新增轨迹
            Locus locus = new Locus();
            //封装数据
            if (null!=liveLocationInfo){
            if (null != liveLocationInfo) {
                locus.setLiveLocationId(liveLocationInfo.getId());
            }else {
            } else {
                locus.setLiveLocationId(liveLocation.getId());
            }
            if (null!= liveLocation.getLatitude() && null!=liveLocation.getLongitude()){
            if (null != liveLocation.getLatitude() && null != liveLocation.getLongitude()) {
                locus.setLatitude(liveLocation.getLatitude());
                locus.setLongitude(liveLocation.getLongitude());
            }
@@ -127,10 +136,11 @@
                    "'" + locus.getLiveLocationId() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(locus.getRecordTime()) + "'" + "," +
                    "'" + locus.getLongitude() + "'" + "," +
                    "'" +locus.getLatitude() + "'" + ")";
            FtpUtil.sqlFileUpload(s2);
                    "'" + locus.getLatitude() + "'" + ")";
            //FtpUtil.sqlFileUpload(s2);
            myAsyncService.FTP(s2);
            if (save1){
            if (save1) {
                //返回数据
                return R.status(true);
            }
@@ -142,6 +152,7 @@
    /**
     * 实时位置信息新增,同时新增到轨迹表中
     *
     * @param locationVOTest 实时位置信息对象
     */
    @PostMapping("/saveLiveLocationAndLocusAsTest")
@@ -157,50 +168,55 @@
        //先查询是否已有实时位置信息,如果有,则更新,没有则插入
        LiveLocation liveLocationInfo = liveLocationService.getLiveLocationInfo(liveLocation);
        boolean status = false;
        if (null == liveLocationInfo){
        if (null == liveLocationInfo) {
            //新增
            liveLocation.setRecordTime(new Date());
            status = liveLocationService.save(liveLocation);
            //数据推送
            String s1 =
                "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time,location) " +
                    "values(" + "'" + liveLocation.getId() + "'" + "," +
                    "'" + liveLocation.getType() + "'" + "," +
                    "'" + liveLocation.getWorkerId() + "'" + "," +
                    "'" + liveLocation.getLongitude() + "'" + "," +
                    "'" + liveLocation.getLatitude() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                    "'" +liveLocation.getLocation() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据推送
                String s1 =
                    "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time,location) " +
                        "values(" + "'" + liveLocation.getId() + "'" + "," +
                        "'" + liveLocation.getType() + "'" + "," +
                        "'" + liveLocation.getWorkerId() + "'" + "," +
                        "'" + liveLocation.getLongitude() + "'" + "," +
                        "'" + liveLocation.getLatitude() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                        "'" + liveLocation.getLocation() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            //更新
            liveLocationInfo.setRecordTime(new Date());
            liveLocationInfo.setLongitude(liveLocation.getLongitude());
            liveLocationInfo.setLatitude(liveLocation.getLatitude());
            status = liveLocationService.updateById(liveLocationInfo);
            //内网同步
            String s1 =
                "update sys_live_location set type = " + "'" + liveLocation.getType() + "'" +
                    ",worker_id = " + "'" + liveLocation.getWorkerId() + "'" +
                    ",longitude = " + "'" + liveLocation.getLongitude() + "'" +
                    ",latitude = " + "'" + liveLocation.getLatitude() + "'" +
                    ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" +
                    ",location = " + "'" + liveLocation.getLocation() + "'" +
                    " " +"where id = " + "'" + liveLocation.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_live_location set type = " + "'" + liveLocation.getType() + "'" +
                        ",worker_id = " + "'" + liveLocation.getWorkerId() + "'" +
                        ",longitude = " + "'" + liveLocation.getLongitude() + "'" +
                        ",latitude = " + "'" + liveLocation.getLatitude() + "'" +
                        ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" +
                        ",location = " + "'" + liveLocation.getLocation() + "'" +
                        " " + "where id = " + "'" + liveLocation.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        if (status){
        if (status) {
            //新增轨迹
            Locus locus = new Locus();
            //封装数据
            if (null!=liveLocationInfo){
            if (null != liveLocationInfo) {
                locus.setLiveLocationId(liveLocationInfo.getId());
            }else {
            } else {
                locus.setLiveLocationId(liveLocation.getId());
            }
            if (null!= liveLocation.getLatitude() && null!=liveLocation.getLongitude()){
            if (null != liveLocation.getLatitude() && null != liveLocation.getLongitude()) {
                locus.setLatitude(liveLocation.getLatitude());
                locus.setLongitude(liveLocation.getLongitude());
            }
@@ -214,10 +230,11 @@
                    "'" + locus.getLiveLocationId() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(locus.getRecordTime()) + "'" + "," +
                    "'" + locus.getLongitude() + "'" + "," +
                    "'" +locus.getLatitude() + "'" + ")";
            FtpUtil.sqlFileUpload(s2);
                    "'" + locus.getLatitude() + "'" + ")";
            myAsyncService.FTP(s2);
            //FtpUtil.sqlFileUpload(s2);
            if (save1){
            if (save1) {
                //返回数据
                return R.status(true);
            }
@@ -228,6 +245,7 @@
    /**
     * 修改
     *
     * @param liveLocation 实时位置信息对象
     */
    @PostMapping("/update")
@@ -237,6 +255,7 @@
    /**
     * 新增或修改
     *
     * @param liveLocation 实时位置信息对象
     */
    @PostMapping("/submit")
@@ -246,6 +265,7 @@
    /**
     * 删除
     *
     * @param ids 实时位置信息ids 数组
     */
    @PostMapping("/remove")
@@ -255,6 +275,7 @@
    /**
     * 详情
     *
     * @param liveLocation 实时位置信息对象
     */
    @GetMapping("/detail")
@@ -266,20 +287,22 @@
    /**
     * 获取轨迹数据
     *
     * @param liveLocationVo 实时对象信息
     * @return
     */
    @GetMapping("/getLocusInfoList")
    public R<List<LocusVo>> getLocusInfoList(LiveLocationVo liveLocationVo){
    public R<List<LocusVo>> getLocusInfoList(LiveLocationVo liveLocationVo) {
        return R.data(liveLocationService.getLocusInfoList(liveLocationVo));
    }
    /**
     * 首页实时定位
     *
     * @return
     */
    @GetMapping("/getLiveLocationVoList")
    public R<List<LiveLocationVo>> getLiveLocationVoList(LiveLocationVo liveLocationVo){
    public R<List<LiveLocationVo>> getLiveLocationVoList(LiveLocationVo liveLocationVo) {
        return R.data(liveLocationService.getLiveLocationVoList(liveLocationVo));
    }
src/main/java/org/springblade/modules/location/controller/LocusController.java
@@ -25,6 +25,7 @@
import org.springblade.modules.location.service.LocusService;
import org.springblade.modules.location.vo.LocusVo;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -52,6 +53,7 @@
    private final LocusService locusService;
    private final CarService carService;
    private IUserService userService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
@@ -186,7 +188,7 @@
            reader.close();
            Locus locus = new Locus();
            String s1 = "";
            if(csvFileList.size()!=0){
            if (csvFileList.size() != 0) {
                //遍历读取的CSV文件
                for (int row = 0; row < csvFileList.size(); row++) {
                    // 取得第row行第0列的数据
@@ -213,7 +215,8 @@
                        s1 += ";";
                    }
                }
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
                deletescsv(substring);
            }
            deletescsv(substring);
@@ -299,10 +302,11 @@
    /**
     * 删除本地csv文件
     *
     * @param fileName
     */
    public  static  void deletescsv(String fileName){
        File file = new File("D:\\caiji\\"+fileName+".csv");
    public static void deletescsv(String fileName) {
        File file = new File("D:\\caiji\\" + fileName + ".csv");
        if (file.isFile() && file.exists()) {
            file.delete();
        }
src/main/java/org/springblade/modules/member/controller/MemberController.java
@@ -38,6 +38,7 @@
import org.springblade.modules.member.vo.MemberVO;
import org.springblade.modules.shareholder.excel.shareExcel;
import org.springblade.modules.shareholder.excel.shareImporter;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -60,6 +61,7 @@
public class MemberController extends BladeController {
    private final IMemberService memberService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -102,16 +104,19 @@
    @ApiOperation(value = "新增", notes = "传入member")
    public R save(@Valid @RequestBody Member member) throws Exception {
        boolean save = memberService.save(member);
        String s1 =
            "insert into sys_member(id,name,post,cardid,cell,creditCode,dept_id) " +
                "values(" + "'" + member.getId() + "'" + "," +
                "'" + member.getName() + "'" + "," +
                "'" + member.getPost() + "'" + "," +
                "'" + member.getCardid() + "'" + "," +
                "'" + member.getCell() + "'"+"," +
                "'" + member.getCreditcode() + "'"+"," +
                "'" + member.getDeptId() + "'"+")";
        FtpUtil.sqlFileUpload(s1);
        if (save) {
            String s1 =
                "insert into sys_member(id,name,post,cardid,cell,creditCode,dept_id) " +
                    "values(" + "'" + member.getId() + "'" + "," +
                    "'" + member.getName() + "'" + "," +
                    "'" + member.getPost() + "'" + "," +
                    "'" + member.getCardid() + "'" + "," +
                    "'" + member.getCell() + "'" + "," +
                    "'" + member.getCreditcode() + "'" + "," +
                    "'" + member.getDeptId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(save);
    }
@@ -123,15 +128,18 @@
    @ApiOperation(value = "修改", notes = "传入member")
    public R update(@Valid @RequestBody Member member) throws Exception {
        boolean b = memberService.updateById(member);
        String s1 = "update sys_member set name = " + "'" + member.getName() + "'" +
            ",post = " + "'" + member.getPost() + "'" +
            ",cardid = " + "'" + member.getCardid() + "'" +
            ",cell = " + "'" + member.getCell() + "'" +
            ",cardid = " + "'" + member.getCardid() + "'" +
            ",creditCode = " + "'" + member.getCreditcode() + "'" +
            ",dept_id = " + "'" + member.getDeptId() + "'" +
            " " + "where id = " + "'" + member.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        if (b) {
            String s1 = "update sys_member set name = " + "'" + member.getName() + "'" +
                ",post = " + "'" + member.getPost() + "'" +
                ",cardid = " + "'" + member.getCardid() + "'" +
                ",cell = " + "'" + member.getCell() + "'" +
                ",cardid = " + "'" + member.getCardid() + "'" +
                ",creditCode = " + "'" + member.getCreditcode() + "'" +
                ",dept_id = " + "'" + member.getDeptId() + "'" +
                " " + "where id = " + "'" + member.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(b);
    }
@@ -157,7 +165,8 @@
        List<Long> list = Func.toLongList(ids);
        list.forEach(id -> {
            String s1 = "delete from sys_member where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(memberService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/performance/controller/PerformanceController.java
@@ -31,6 +31,7 @@
import org.springblade.modules.performance.entity.Performance;
import org.springblade.modules.performance.service.IPerformanceService;
import org.springblade.modules.performance.vo.PerformanceVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -50,7 +51,7 @@
public class PerformanceController extends BladeController {
    private final IPerformanceService performanceService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
     */
@@ -99,7 +100,8 @@
                "'" + performance.getAchievements() + "'" + "," +
                "'" + new SimpleDateFormat("yyyy-MM-dd").format(performance.getTime()) + "'" + "," +
                "'" + performance.getScore() + "'" + ")";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.status(save);
    }
@@ -117,7 +119,8 @@
            ",time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(performance.getTime()) + "'" +
            ",score = " + "'" + performance.getScore() + "'" +
            " " + "where id = " + "'" + performance.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.status(b);
    }
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -66,6 +66,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import sun.net.www.http.HttpClient;
@@ -100,6 +101,7 @@
    private final IInformationService informationService;
    private final IUserService userService;
    private final IAttachService attachService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -156,7 +158,7 @@
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入permit")
    public R save(@Valid @RequestBody Permit permit){
    public R save(@Valid @RequestBody Permit permit) {
        String cardid = permit.getCardid();
        String type = permit.getPtype();
        Map map = permitService.selectIn(cardid, type);
@@ -183,7 +185,8 @@
            "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
            + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
            "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        return R.success("许可提交成功");
    }
@@ -191,7 +194,7 @@
     * 新增
     */
    @PostMapping("/saves")
    public R saves(@Valid @RequestBody Permit permit, HttpServletRequest request){
    public R saves(@Valid @RequestBody Permit permit, HttpServletRequest request) {
        String fieldNames = request.getHeader("_fieldNames");
        String cardid = permit.getCardid();
        String type = permit.getPtype();
@@ -203,23 +206,25 @@
        permit.setType("2");
        permit.setStorage("1");
        permit.setPermitime(new Date());
        permitService.save(permit);
        boolean save = permitService.save(permit);
        //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getPermitime());
        String overtime = new SimpleDateFormat("yyyy-MM-dd").format(permit.getOvertime());
        String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," +
            "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
            "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid,overtime)" +
            "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'"
            + permit.getRepresentative() + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'"
            + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," +
            "'" + permit.getIdentificationnumber() + "'" + "," + "'" + permit.getEnterprises() + "'" + "," + "'" +
            permit.getAddress() + "'" + "," + "'" + permit.getBusiness() + "'" + "," + "'" +
            permit.getRegion() + "'" + "," + "'" + permit.getRegistration() + "'" + "," + "'" + permit.getIndustry() + "'" + "," + "'"
            + permit.getType() + "'" + "," + "'" + permit.getDeptid() + "'" + "," + "'" + permit.getPtype() + "'" + "," +
            "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
            + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
            "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        if (save) {
            String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," +
                "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
                "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid,overtime)" +
                "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'"
                + permit.getRepresentative() + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'"
                + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," +
                "'" + permit.getIdentificationnumber() + "'" + "," + "'" + permit.getEnterprises() + "'" + "," + "'" +
                permit.getAddress() + "'" + "," + "'" + permit.getBusiness() + "'" + "," + "'" +
                permit.getRegion() + "'" + "," + "'" + permit.getRegistration() + "'" + "," + "'" + permit.getIndustry() + "'" + "," + "'"
                + permit.getType() + "'" + "," + "'" + permit.getDeptid() + "'" + "," + "'" + permit.getPtype() + "'" + "," +
                "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'"
                + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" +
                "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")";
            myAsyncService.FTP(s);
        }
        //返回
        return R.data(permit);
    }
@@ -323,116 +328,109 @@
            user.setRoleId("1414575196264300546");
            user.setStatus(1);
            user.setIsDeleted(0);
            userService.save(user);
            String roleid = "1415563428727328770";
            String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                "contacts,contactscell,create_user_id) " +
                "values(" + "'" + information.getId() + "'" +
                "," + "'" + information.getCreditcode() + "'" +
                "," + "'" + information.getEnterprisename() + "'" +
                "," + "'" + information.getRepresentative() + "'" +
                "," + "'" + information.getRegisteredcapital() + "'" +
                "," + "'" + information.getOrganizationcode() + "'" +
                "," + "'" + information.getRegistrationnumber() + "'" +
                "," + "'" + information.getEnterprises() + "'" +
                "," + "'" + information.getAddress() + "'" +
                "," + "'" + information.getBusiness() + "'" +
                "," + "'" + information.getRegion() + "'" +
                "," + "'" + information.getRegistration() + "'" +
                "," + "'" + information.getIndustry() + "'" +
                "," + "'" + information.getDepartmentid() + "'" +
                "," + "'" + information.getStats() + "'" +
                "," + "'" + information.getJurisdiction() + "'" +
                "," + "'" + information.getRepresentativecell() + "'" +
                "," + "'" + information.getContacts() + "'" +
                "," + "'" + information.getContactscell() + "'" +
                "," + "'" + information.getCreateUserId() + "'" + ")";
            FtpUtil.sqlFileUpload(s);
            String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                + "'" + dept.getTenantId() + "'" +
                "," + "'" + information.getEnterprisename() + "'" +
                "," + "'" + dept.getAncestors() + "'" +
                "," + "'" + dept.getDeptCategory() + "'" +
                "," + "'" + isDeleted + "'" + ")";
            FtpUtil.sqlFileUpload(ss);
            String rtime;
            String paperTime;
            if (user.getRtime() == null) {
                rtime = null;
            } else {
                rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
            }
            //发证日期处理
            if (user.getPaperTime() == null) {
                paperTime = "";
            } else {
                paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
            }
            //头像
            if (null != user.getAvatar() && !user.getAvatar().equals("")) {
                user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
            }
            boolean save = userService.save(user);
            if (save) {
                String roleid = "1415563428727328770";
                String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                    ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                    " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                    "contacts,contactscell,create_user_id) " +
                    "values(" + "'" + information.getId() + "'" +
                    "," + "'" + information.getCreditcode() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + information.getRepresentative() + "'" +
                    "," + "'" + information.getRegisteredcapital() + "'" +
                    "," + "'" + information.getOrganizationcode() + "'" +
                    "," + "'" + information.getRegistrationnumber() + "'" +
                    "," + "'" + information.getEnterprises() + "'" +
                    "," + "'" + information.getAddress() + "'" +
                    "," + "'" + information.getBusiness() + "'" +
                    "," + "'" + information.getRegion() + "'" +
                    "," + "'" + information.getRegistration() + "'" +
                    "," + "'" + information.getIndustry() + "'" +
                    "," + "'" + information.getDepartmentid() + "'" +
                    "," + "'" + information.getStats() + "'" +
                    "," + "'" + information.getJurisdiction() + "'" +
                    "," + "'" + information.getRepresentativecell() + "'" +
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ")";
                myAsyncService.FTP(s);
                String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                    + "'" + dept.getTenantId() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + dept.getAncestors() + "'" +
                    "," + "'" + dept.getDeptCategory() + "'" +
                    "," + "'" + isDeleted + "'" + ")";
                myAsyncService.FTP(ss);
                String rtime;
                String paperTime;
                if (user.getRtime() == null) {
                    rtime = null;
                } else {
                    rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
                }
                //发证日期处理
                if (user.getPaperTime() == null) {
                    paperTime = "";
                } else {
                    paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
                }
                //头像
                if (null != user.getAvatar() && !user.getAvatar().equals("")) {
                    user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
                }
            //指纹
            if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
                user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26));
            }
                //指纹
                if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
                    user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26));
                }
            String sss = "insert into blade_user(" +
                "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                "politicaloutlook,healstats,height,address,registered,rtime," +
                "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
                "values(" + "'" + user.getId() + "'" +
                "," + "'" + user.getTenantId() + "'" +
                "," + "'" + user.getAccount() + "'" +
                "," + "'" + user.getPassword() + "'" +
                "," + "'" + user.getName() + "'" +
                "," + "'" + user.getRealName() + "'" +
                "," + "'" + user.getAvatar() + "'" +
                "," + "'" + user.getEmail() + "'" +
                "," + "'" + user.getPhone() + "'" +
                "," + "'" + null + "'" +
                "," + "'" + roleid + "'" +
                "," + "'" + user.getDeptId() + "'" +
                "," + "'" + user.getCardid() + "'" +
                "," + "'" + user.getNativeplace() + "'" +
                "," + "'" + user.getNation() + "'" +
                "," + "'" + user.getFingerprint() + "'" +
                "," + "'" + user.getEducation() + "'" +
                "," + "'" + user.getPoliticaloutlook() + "'" +
                "," + "'" + user.getHealstats() + "'" +
                "," + "'" + user.getHeight() + "'" +
                "," + "'" + user.getAddress() + "'" +
                "," + "'" + user.getRegistered() + "'" +
                "," + "'" + rtime + "'" +
                "," + "'" + user.getSecuritynumber() + "'" +
                "," + "'" + user.getHold() + "'" +
                "," + "'" + user.getJurisdiction() + "'" +
                "," + "'" + user.getExaminationType() + "'" +
                "," + "'" + user.getStatus() + "'" +
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getDispatch() + "'" + ")";
            FtpUtil.sqlFileUpload(sss);
////            //注册用户
////            User user = new User();
////            user.setAccount(permit.getEnterprisename());
////            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
////            user.setPassword(initPassword);
////            user.setRoleId("1414575196264300546");
////            user.setDeptId(information.getDepartmentid());
////            userService.saveOrUpdate(user);
//            //把附件添加单位id
//            attachService.updat(information.getDepartmentid(), permit.getCardid());
            String s1 = "update sys_permit set type = " + "'" + 0 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                " " + "where id = " + "'" + permit.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
                String sss = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered,rtime," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + null + "'" +
                    "," + "'" + roleid + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'" +
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + rtime + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" + ")";
                myAsyncService.FTP(sss);
                //把附件添加单位id
                String s1 = "update sys_permit set type = " + "'" + 0 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                    " " + "where id = " + "'" + permit.getId() + "'";
                myAsyncService.FTP(s1);
            }
        } else {
            String s1 = "update sys_permit set type = " + "'" + 1 + "'" + ",approve = " + "'" + permit.getApprove() + "'" +
                " " + "where id = " + "'" + permit.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.success("成功");
    }
@@ -460,6 +458,7 @@
    /**
     * 保安公司/培训学校许可设立详情(基本信息和附件列表信息)
     *
     * @param record
     * @return
     */
@@ -471,6 +470,7 @@
    /**
     * 许可备案集合信息
     *
     * @param record
     * @return
     */
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -48,6 +48,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -75,6 +76,7 @@
    private final IInformationService informationService;
    private final IUserService userService;
    private final IAttachService attachService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -140,25 +142,26 @@
            String id = map.get("id").toString();
            recordService.removeByIds(Func.toLongList(id));
            String s1 = "delete from sys_record where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        record.setStorage("1");
        record.setType("2");
        record.setPermitime(new Date());
        recordService.save(record);
        //String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOfficetime());
        //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getPermitime());
        String s = "insert into sys_record(id,representative," +
            "address,business,registration,industry,type,ptype,representativecell,contacts,contactscell,perid,offices,jurisdiction,cardid,storage,overtime)" +
            "values(" + "'" + record.getId() + "'" + "," +
            "'" + record.getRepresentative() + "'" + "," + "'" +
            record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + record.getPtype() + "'" + "," +
            "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," + "'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + record.getJurisdiction() + "'" +
            "," + "'" + record.getCardid() + "'" +
            "," + "'" + record.getStorage() + "'" +
            "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOvertime()) + "'"
            + ")";
        FtpUtil.sqlFileUpload(s);
        boolean save = recordService.save(record);
        if (save) {
            String s = "insert into sys_record(id,representative," +
                "address,business,registration,industry,type,ptype,representativecell,contacts,contactscell,perid,offices,jurisdiction,cardid,storage,overtime)" +
                "values(" + "'" + record.getId() + "'" + "," +
                "'" + record.getRepresentative() + "'" + "," + "'" +
                record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + record.getPtype() + "'" + "," +
                "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," + "'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + record.getJurisdiction() + "'" +
                "," + "'" + record.getCardid() + "'" +
                "," + "'" + record.getStorage() + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOvertime()) + "'"
                + ")";
            myAsyncService.FTP(s);
        }
        return R.success("成功");
    }
@@ -251,163 +254,101 @@
            user.setRoleId("1414575196264300546");
            user.setStatus(1);
            user.setIsDeleted(0);
            userService.save(user);
            String roleid = "1415563428727328770";
            String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                "contacts,contactscell,create_user_id) " +
                "values(" + "'" + information.getId() + "'" +
                "," + "'" + information.getCreditcode() + "'" +
                "," + "'" + information.getEnterprisename() + "'" +
                "," + "'" + information.getRepresentative() + "'" +
                "," + "'" + information.getRegisteredcapital() + "'" +
                "," + "'" + information.getOrganizationcode() + "'" +
                "," + "'" + information.getRegistrationnumber() + "'" +
                "," + "'" + information.getEnterprises() + "'" +
                "," + "'" + information.getAddress() + "'" +
                "," + "'" + information.getBusiness() + "'" +
                "," + "'" + information.getRegion() + "'" +
                "," + "'" + information.getRegistration() + "'" +
                "," + "'" + information.getIndustry() + "'" +
                "," + "'" + information.getDepartmentid() + "'" +
                "," + "'" + information.getStats() + "'" +
                "," + "'" + information.getJurisdiction() + "'" +
                "," + "'" + information.getRepresentativecell() + "'" +
                "," + "'" + information.getContacts() + "'" +
                "," + "'" + information.getContactscell() + "'" +
                "," + "'" + information.getCreateUserId() + "'" + ")";
            FtpUtil.sqlFileUpload(s);
            String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                + "'" + dept.getTenantId() + "'" +
                "," + "'" + information.getEnterprisename() + "'" +
                "," + "'" + dept.getAncestors() + "'" +
                "," + "'" + dept.getDeptCategory() + "'" +
                "," + "'" + isDeleted + "'" + ")";
            FtpUtil.sqlFileUpload(ss);
            String rtime;
            String paperTime;
            if (user.getRtime() == null) {
                rtime = null;
            } else {
                rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
            }
            //发证日期处理
            if (user.getPaperTime() == null) {
                paperTime = "";
            } else {
                paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
            }
            //头像
            if (null != user.getAvatar() && !user.getAvatar().equals("")) {
                user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
            }
            boolean save = userService.save(user);
            if (save) {
                String roleid = "1415563428727328770";
                String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                    ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                    " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                    "contacts,contactscell,create_user_id) " +
                    "values(" + "'" + information.getId() + "'" +
                    "," + "'" + information.getCreditcode() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + information.getRepresentative() + "'" +
                    "," + "'" + information.getRegisteredcapital() + "'" +
                    "," + "'" + information.getOrganizationcode() + "'" +
                    "," + "'" + information.getRegistrationnumber() + "'" +
                    "," + "'" + information.getEnterprises() + "'" +
                    "," + "'" + information.getAddress() + "'" +
                    "," + "'" + information.getBusiness() + "'" +
                    "," + "'" + information.getRegion() + "'" +
                    "," + "'" + information.getRegistration() + "'" +
                    "," + "'" + information.getIndustry() + "'" +
                    "," + "'" + information.getDepartmentid() + "'" +
                    "," + "'" + information.getStats() + "'" +
                    "," + "'" + information.getJurisdiction() + "'" +
                    "," + "'" + information.getRepresentativecell() + "'" +
                    "," + "'" + information.getContacts() + "'" +
                    "," + "'" + information.getContactscell() + "'" +
                    "," + "'" + information.getCreateUserId() + "'" + ")";
                myAsyncService.FTP(s);
                String ss = "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + dept.getId() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                    + "'" + dept.getTenantId() + "'" +
                    "," + "'" + information.getEnterprisename() + "'" +
                    "," + "'" + dept.getAncestors() + "'" +
                    "," + "'" + dept.getDeptCategory() + "'" +
                    "," + "'" + isDeleted + "'" + ")";
                myAsyncService.FTP(ss);
                String rtime;
                String paperTime;
                if (user.getRtime() == null) {
                    rtime = null;
                } else {
                    rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
                }
                //发证日期处理
                if (user.getPaperTime() == null) {
                    paperTime = "";
                } else {
                    paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
                }
                //头像
                if (null != user.getAvatar() && !user.getAvatar().equals("")) {
                    user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
                }
            //指纹
            if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
                user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26));
            }
                //指纹
                if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
                    user.setFingerprint(FtpConfig.ip + user.getFingerprint().substring(26));
                }
            String sss = "insert into blade_user(" +
                "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                "politicaloutlook,healstats,height,address,registered,rtime," +
                "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
                "values(" + "'" + user.getId() + "'" +
                "," + "'" + user.getTenantId() + "'" +
                "," + "'" + user.getAccount() + "'" +
                "," + "'" + user.getPassword() + "'" +
                "," + "'" + user.getName() + "'" +
                "," + "'" + user.getRealName() + "'" +
                "," + "'" + user.getAvatar() + "'" +
                "," + "'" + user.getEmail() + "'" +
                "," + "'" + user.getPhone() + "'" +
                "," + "'" + null + "'" +
                "," + "'" + roleid + "'" +
                "," + "'" + user.getDeptId() + "'" +
                "," + "'" + user.getCardid() + "'" +
                "," + "'" + user.getNativeplace() + "'" +
                "," + "'" + user.getNation() + "'" +
                "," + "'" + user.getFingerprint() + "'" +
                "," + "'" + user.getEducation() + "'" +
                "," + "'" + user.getPoliticaloutlook() + "'" +
                "," + "'" + user.getHealstats() + "'" +
                "," + "'" + user.getHeight() + "'" +
                "," + "'" + user.getAddress() + "'" +
                "," + "'" + user.getRegistered() + "'" +
                "," + "'" + rtime + "'" +
                "," + "'" + user.getSecuritynumber() + "'" +
                "," + "'" + user.getHold() + "'" +
                "," + "'" + user.getJurisdiction() + "'" +
                "," + "'" + user.getExaminationType() + "'" +
                "," + "'" + user.getStatus() + "'" +
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getDispatch() + "'" + ")";
            FtpUtil.sqlFileUpload(sss);
//            Integer isDeleted = 0;
//            //注册用户
//            User user = new User();
//            user.setDeptId(information.getDepartmentid());
//            user.setTenantId("000000");
//            user.setAccount(record.getEnterprisename());
//            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
//            user.setPassword(initPassword);
//            user.setCreateTime(new Date());
//            user.setUpdateTime(new Date());
//            user.setRoleId("1414575196264300546");
//            user.setStatus(1);
//            user.setIsDeleted(0);
//            userService.save(user);
//            String roleid = "1415563428727328770";
//            String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
//                ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
//                " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
//                "contacts,contactscell,create_time,create_user_id) " +
//                "values(" + "'" + information.getId() + "'" +
//                "," + "'" + information.getCreditcode() + "'" +
//                "," + "'" + information.getEnterprisename() + "'" +
//                "," + "'" + information.getRepresentative() + "'" +
//                "," + "'" + information.getRegisteredcapital() + "'" +
//                "," + "'" + information.getOrganizationcode() + "'" +
//                "," + "'" + information.getRegistrationnumber() + "'" +
//                "," + "'" + information.getEnterprises() + "'" +
//                "," + "'" + information.getAddress() + "'" +
//                "," + "'" + information.getBusiness() + "'" +
//                "," + "'" + information.getRegion() + "'" +
//                "," + "'" + information.getRegistration() + "'" +
//                "," + "'" + information.getIndustry() + "'" +
//                "," + "'" + information.getDepartmentid() + "'" +
//                "," + "'" + information.getStats() + "'" +
//                "," + "'" + information.getJurisdiction() + "'" +
//                "," + "'" + information.getRepresentativecell() + "'" +
//                "," + "'" + information.getContacts() + "'" +
//                "," + "'" + information.getContactscell() + "'" +
//                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getCreateTime()) + "'" +
//                "," + "'" + information.getCreateUserId() + "'" + ");" +
//                "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + information.getDepartmentid() + "'" + "," + "'" + dept.getParentId() + "'" + ","
//                + "'" + dept.getTenantId() + "'" +
//                "," + "'" + information.getEnterprisename() + "'" +
//                "," + "'" + dept.getAncestors() + "'" +
//                "," + "'" + dept.getDeptCategory() + "'" +
//                "," + "'" + isDeleted + "'" + ");" +
//                "insert into blade_user(id,tenant_id,account,password,role_id,dept_id,create_time,update_time,status,is_deleted) " +
//                "values(" + "'" + user.getId() + "'" +
//                "," + "'" + user.getTenantId() + "'"
//                + "," + "'" + user.getAccount() + "'" +
//                "," + "'" + user.getPassword() + "'" +
//                "," + "'" + roleid + "'" +
//                "," + "'" + user.getDeptId() + "'" +
//                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
//                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
//                "," + "'" + user.getStatus() + "'" +
//                "," + "'" + user.getIsDeleted() + "'" + ")";
//            FtpUtil.sqlFileUpload(s);
//            //注册用户
//            User user = new User();
//            user.setAccount(record.getEnterprisename());
//            String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
//            user.setPassword(initPassword);
//            boolean b = userService.saveOrUpdate(user);
                String sss = "insert into blade_user(" +
                    "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                    "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                    "politicaloutlook,healstats,height,address,registered,rtime," +
                    "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
                    "values(" + "'" + user.getId() + "'" +
                    "," + "'" + user.getTenantId() + "'" +
                    "," + "'" + user.getAccount() + "'" +
                    "," + "'" + user.getPassword() + "'" +
                    "," + "'" + user.getName() + "'" +
                    "," + "'" + user.getRealName() + "'" +
                    "," + "'" + user.getAvatar() + "'" +
                    "," + "'" + user.getEmail() + "'" +
                    "," + "'" + user.getPhone() + "'" +
                    "," + "'" + null + "'" +
                    "," + "'" + roleid + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getNativeplace() + "'" +
                    "," + "'" + user.getNation() + "'" +
                    "," + "'" + user.getFingerprint() + "'" +
                    "," + "'" + user.getEducation() + "'" +
                    "," + "'" + user.getPoliticaloutlook() + "'" +
                    "," + "'" + user.getHealstats() + "'" +
                    "," + "'" + user.getHeight() + "'" +
                    "," + "'" + user.getAddress() + "'" +
                    "," + "'" + user.getRegistered() + "'" +
                    "," + "'" + rtime + "'" +
                    "," + "'" + user.getSecuritynumber() + "'" +
                    "," + "'" + user.getHold() + "'" +
                    "," + "'" + user.getJurisdiction() + "'" +
                    "," + "'" + user.getExaminationType() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getDispatch() + "'" + ")";
                myAsyncService.FTP(sss);
            }
            //把附件添加单位id
            attachService.updat(information.getDepartmentid(), record.getCardid());
            String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
@@ -421,7 +362,7 @@
                ",stime = " + "'" + record.getStime() + "'" +
                ",xtime = " + "'" + record.getXtime() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        } else {
            String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                ",papprove = " + "'" + record.getPapprove() + "'" +
@@ -434,7 +375,7 @@
                ",stime = " + "'" + record.getStime() + "'" +
                ",xtime = " + "'" + record.getXtime() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(recordService.saveOrUpdate(record));
    }
@@ -469,6 +410,7 @@
    /**
     * 保安公司备案信息(基本信息和附件列表信息)
     *
     * @param record
     * @return
     */
src/main/java/org/springblade/modules/recordLegalperson/controller/RecordLegalpersonController.java
@@ -47,6 +47,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -75,6 +76,7 @@
    private final IInformationService informationService;
    private final IUserService userService;
    private final IAttachService attachService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -140,7 +142,8 @@
            String id = map.get("id").toString();
            recordService.removeByIds(Func.toLongList(id));
            String s1 = "delete from sys_record where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        record.setStorage("1");
        record.setType("2");
@@ -164,7 +167,8 @@
            "," + "'" + record.getChangecontacts() + "'" +
            "," + "'" + record.getChangecontactscell() + "'" +
            ")";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        return R.success("成功");
    }
@@ -222,7 +226,8 @@
                            "update sys_information set representative = " + "'" + information1.getRepresentative() + "'" +
                            ",representativecell = " + "'" + information1.getRepresentativecell()  + "'" +
                            " " + "where id = " + "'" + information1.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }else {
                //按组织机构查询
                Information information2 = new Information();
@@ -245,7 +250,8 @@
                        "update sys_information set representative = " + "'" + information1.getRepresentative() + "'" +
                        ",representativecell = " + "'" + information1.getRepresentativecell()  + "'" +
                        " " + "where id = " + "'" + information1.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }else {
                    //设置未审核不通过
                    record.setType("1");
@@ -255,7 +261,8 @@
                    String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                        ",approve = " + "'" + record.getApprove() + "'" +
                        " " + "where id = " + "'" + record.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                    throw new ServiceException("当前公司单位未保安服务系统存在,请先注册!");
                }
            }
@@ -268,7 +275,8 @@
            String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
                ",approve = " + "'" + record.getApprove() + "'" +
                " " + "where id = " + "'" + record.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        //返回数据
        return R.status(status);
src/main/java/org/springblade/modules/recordk/controller/RecordkController.java
@@ -36,6 +36,7 @@
import org.springblade.modules.recordk.entity.Recordk;
import org.springblade.modules.recordk.service.IRecordkService;
import org.springblade.modules.recordk.vo.RecordkVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -57,6 +58,7 @@
    private final IRecordkService recordkService;
    private final IInformationService informationService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -90,20 +92,6 @@
    public R<IPage<RecordkVO>> page(RecordkVO recordk, Query query) {
        IPage<RecordkVO> pages;
        pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk, recordk.getJurisdiction());
//        if (recordk.getUsetype().equals("0")) {
//            pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk,null);
//        } else if (recordk.getUsetype().equals("1")) {
//            String childer = informationService.selJurchilder(recordk.getJurisdiction());
//            String[] split = childer.split(",");
//            String strArrays = "";
//            for (int j = 0; j < split.length; j++) {
//                strArrays += "'" + split[j] + "',";
//            }
//            String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
//            pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk,jurisdiction);
//        } else {
//            pages = recordkService.selectRecordkPage(Condition.getPage(query), recordk,null);
//        }
        return R.data(pages);
    }
@@ -125,8 +113,6 @@
        recordk.setType("2");
        recordk.setPermitime(new Date());
        recordkService.save(recordk);
        //String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(recordk.getOfficetime());
        //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(recordk.getPermitime());
        String s = "insert into sys_recordk(id,creditCode,enterpriseName,representative," +
            "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,cardid,overtime," +
            "jurisdiction," +
@@ -195,7 +181,8 @@
        boolean b = recordkService.updateById(recordk);
        String s1 = "update sys_recordk set type = " + "'" + 0 + "'" + ",approve = " + "'" + recordk.getApprove() + "'" +
            " " + "where id = " + "'" + recordk.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.status(b);
    }
src/main/java/org/springblade/modules/registerUnit/controller/RegisterUnitController.java
@@ -27,6 +27,7 @@
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IRoleService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@@ -54,6 +55,7 @@
    private final IUserService userService;
    private final IRoleService roleService;
    private final MyAsyncService myAsyncService;
    /**
@@ -316,7 +318,8 @@
                "," + "'" + user.getStatus() + "'" +
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getRoleId() + "'" + ")";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
    }
}
src/main/java/org/springblade/modules/resource/controller/AttachController.java
@@ -34,6 +34,7 @@
import org.springblade.modules.resource.entity.Attach;
import org.springblade.modules.resource.service.IAttachService;
import org.springblade.modules.resource.vo.AttachVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -52,7 +53,7 @@
public class AttachController extends BladeController {
    private final IAttachService attachService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
     */
@@ -132,7 +133,8 @@
        list.forEach(id ->{
            //内网同步
            String s1 = "delete from blade_attach where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(attachService.deleteLogic(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -45,6 +45,7 @@
import org.springblade.modules.resource.service.IAttachService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@@ -88,6 +89,7 @@
    private final ExamPaperService examPaperService;
    private final ExamPaymentService examPaymentService;
    private final MyAsyncService myAsyncService;
    /**
     * 创建存储桶
@@ -436,7 +438,8 @@
                    //内网数据推送
                    //数据推送
                    String s = "update blade_user set avatar = " + "'" + inUrl + "'" + "where id = " + "'" + user.getId() + "'";
                    FtpUtil.sqlFileUpload(s);
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    //文件推送
                    InputStream inputStream = multipartFile.getInputStream();
@@ -558,7 +561,8 @@
                        "," + "'" + examPayment.getWorkerId() + "'" +
                        "," + "'" + examPayment.getPaymentStatus() + "'" +
                        "," +"'" + inUrl + "'" + ")";
                    FtpUtil.sqlFileUpload(s);
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                    //文件推送
                    InputStream inputStream = multipartFile.getInputStream();
@@ -754,7 +758,8 @@
        } else {
            s1 += ")";
        }
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return attach.getId();
    }
src/main/java/org/springblade/modules/revoke/controller/RevokeController.java
@@ -33,6 +33,7 @@
import org.springblade.modules.revoke.entity.Revoke;
import org.springblade.modules.revoke.service.IRevokeService;
import org.springblade.modules.revoke.vo.RevokeVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -54,6 +55,8 @@
    private final IRevokeService revokeService;
    private final IInformationService informationService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
     */
@@ -85,22 +88,7 @@
    @ApiOperation(value = "分页", notes = "传入revoke")
    public R<IPage<RevokeVO>> page(RevokeVO revoke, Query query) {
        IPage<RevokeVO> pages;
        pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,revoke.getJurisdiction());
//        if (revoke.getUsetype().equals("0")) {
//            pages = revokeService.selectRevokePage(Condition.getPage(query), revoke,null);
//        } else if (revoke.getUsetype().equals("1")) {
//            String childer = informationService.selJurchilder(revoke.getJurisdiction());
//            String[] split = childer.split(",");
//            String strArrays = "";
//            for (int j = 0; j < split.length; j++) {
//                strArrays += "'" + split[j] + "',";
//            }
//            String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
//            pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,jurisdiction);
//        } else {
//            pages =revokeService.selectRevokePage(Condition.getPage(query), revoke,null);
//        }
        pages = revokeService.selectRevokePage(Condition.getPage(query), revoke, revoke.getJurisdiction());
        return R.data(pages);
    }
@@ -113,7 +101,7 @@
    public R save(@Valid @RequestBody Revoke revoke) {
        String cardid = revoke.getCardid();
        String type = revoke.getPtype();
        Map map = revokeService.selectIn(cardid,type);
        Map map = revokeService.selectIn(cardid, type);
        if (map != null) {
            String id = map.get("id").toString();
            revokeService.removeByIds(Func.toLongList(id));
@@ -121,22 +109,22 @@
        revoke.setStorage("1");
        revoke.setType("2");
        revoke.setPermitime(new Date());
        revokeService.save(revoke);
        //String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(revoke.getEstablishtime());
        //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(revoke.getPermitime());
        String s = "insert into sys_revoke(id,creditCode,enterpriseName,representative," +
            "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
            "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,reason,jurisdiction,cardid)" +
            "values(" + "'" + revoke.getId() + "'" + "," + "'" + revoke.getCreditcode() + "'" + "," + "'" + revoke.getEnterprisename() + "'" + "," + "'"
            + revoke.getRepresentative() + "'" + "," + "'" + revoke.getRegisteredcapital() + "'" + "," + "'"
            + revoke.getOrganizationcode() + "'" + "," + "'" + revoke.getRegistrationnumber() + "'" + "," +
            "'" + revoke.getIdentificationnumber() + "'" + "," + "'" + revoke.getEnterprises() + "'" + "," + "'" +
            revoke.getAddress() + "'" + "," + "'" + revoke.getBusiness() + "'" + "," + "'" +
            revoke.getRegion() + "'" + "," + "'" + revoke.getRegistration() + "'" + "," + "'" + revoke.getIndustry() + "'" + "," + "'"
            + revoke.getType() + "'" + "," + "'" + revoke.getDeptid() + "'" + "," + "'" + revoke.getPtype() + "'" + "," +
            "'" + revoke.getRepresentativecell() + "'" + "," + "'" + revoke.getContacts() + "'" + "," + "'" + revoke.getContactscell() + "'" + "," +
            "'" + revoke.getReason() + "'" + "," + "'" + revoke.getJurisdiction() + "'" +"," + "'" + revoke.getCardid() + "'"+ ")";
        FtpUtil.sqlFileUpload(s);
        boolean save = revokeService.save(revoke);
        if (save) {
            String s = "insert into sys_revoke(id,creditCode,enterpriseName,representative," +
                "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
                "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,reason,jurisdiction,cardid)" +
                "values(" + "'" + revoke.getId() + "'" + "," + "'" + revoke.getCreditcode() + "'" + "," + "'" + revoke.getEnterprisename() + "'" + "," + "'"
                + revoke.getRepresentative() + "'" + "," + "'" + revoke.getRegisteredcapital() + "'" + "," + "'"
                + revoke.getOrganizationcode() + "'" + "," + "'" + revoke.getRegistrationnumber() + "'" + "," +
                "'" + revoke.getIdentificationnumber() + "'" + "," + "'" + revoke.getEnterprises() + "'" + "," + "'" +
                revoke.getAddress() + "'" + "," + "'" + revoke.getBusiness() + "'" + "," + "'" +
                revoke.getRegion() + "'" + "," + "'" + revoke.getRegistration() + "'" + "," + "'" + revoke.getIndustry() + "'" + "," + "'"
                + revoke.getType() + "'" + "," + "'" + revoke.getDeptid() + "'" + "," + "'" + revoke.getPtype() + "'" + "," +
                "'" + revoke.getRepresentativecell() + "'" + "," + "'" + revoke.getContacts() + "'" + "," + "'" + revoke.getContactscell() + "'" + "," +
                "'" + revoke.getReason() + "'" + "," + "'" + revoke.getJurisdiction() + "'" + "," + "'" + revoke.getCardid() + "'" + ")";
            myAsyncService.FTP(s);
        }
        return R.success("成功");
    }
@@ -149,7 +137,7 @@
    public R revokesave(@Valid @RequestBody Revoke revoke) {
        String cardid = revoke.getCardid();
        String type = revoke.getPtype();
        Map map = revokeService.selectIn(cardid,type);
        Map map = revokeService.selectIn(cardid, type);
        if (map != null) {
            revoke.setStorage("0");
            revokeService.updateById(revoke);
@@ -194,8 +182,8 @@
    }
    @PostMapping("/selectIn")
    public R selectIn(String cardid,String type) {
        Map map = revokeService.selectIn(cardid,type);
    public R selectIn(String cardid, String type) {
        Map map = revokeService.selectIn(cardid, type);
        return R.data(map);
    }
src/main/java/org/springblade/modules/seinspect/controller/SeinspectController.java
@@ -33,6 +33,7 @@
import org.springblade.modules.seinspect.entity.Seinspect;
import org.springblade.modules.seinspect.service.ISeinspectService;
import org.springblade.modules.seinspect.vo.SeinspectVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@@ -52,6 +53,7 @@
public class SeinspectController extends BladeController {
    private final ISeinspectService seinspectService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -94,30 +96,33 @@
    @ApiOperation(value = "新增", notes = "传入seinspect")
    public R save(@Valid @RequestBody Seinspect seinspect) throws Exception {
        seinspect.setReviewtime(new Date());
        seinspectService.save(seinspect);
        String url = "";
        if (seinspect.getUrl()!=null&& !"".equals(seinspect.getUrl())){
            String[] split = seinspect.getUrl().split(",");
            for (int i = 0; i < split.length; i++) {
                String s = split[i].substring(26, split[i].length());
                url += FtpConfig.ip + s + ",";
        boolean save = seinspectService.save(seinspect);
        if (save) {
            String url = "";
            if (seinspect.getUrl() != null && !"".equals(seinspect.getUrl())) {
                String[] split = seinspect.getUrl().split(",");
                for (int i = 0; i < split.length; i++) {
                    String s = split[i].substring(26, split[i].length());
                    url += FtpConfig.ip + s + ",";
                }
                String substring = url.substring(0, url.length() - 1);
                seinspect.setUrl(substring);
            }
            String substring = url.substring(0, url.length() - 1);
            seinspect.setUrl(substring);
            //数据同步
            String s1 =
                "insert into sys_seinspect(id,reviewTime,content,result,url,examiner_dept_id,examiner_id,jurisdiction,security_id) " +
                    "values(" + "'" + seinspect.getId() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
                    "'" + seinspect.getContent() + "'" + "," +
                    "'" + seinspect.getResult() + "'" + "," +
                    "'" + seinspect.getUrl() + "'" + "," +
                    "'" + seinspect.getExaminerDeptId() + "'" + "," +
                    "'" + seinspect.getExaminerId() + "'" + "," +
                    "'" + seinspect.getJurisdiction() + "'" + "," +
                    "'" + seinspect.getSecurityId() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        //数据同步
        String s1 =
            "insert into sys_seinspect(id,reviewTime,content,result,url,examiner_dept_id,examiner_id,jurisdiction,security_id) " +
                "values(" + "'" + seinspect.getId() + "'" + "," +
                "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
                "'" + seinspect.getContent() + "'" + "," +
                "'" + seinspect.getResult() + "'" + "," +
                "'" + seinspect.getUrl() + "'" + "," +
                "'" + seinspect.getExaminerDeptId() + "'" + "," +
                "'" + seinspect.getExaminerId() + "'" + "," +
                "'" + seinspect.getJurisdiction() + "'" + "," +
                "'" + seinspect.getSecurityId() + "'" + ")";
        FtpUtil.sqlFileUpload(s1);
        return R.success("成功");
    }
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java
@@ -38,6 +38,7 @@
import org.springblade.modules.shareholder.excel.shareImporter;
import org.springblade.modules.shareholder.service.IShareholderService;
import org.springblade.modules.shareholder.vo.ShareholderVO;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -60,7 +61,7 @@
public class ShareholderController extends BladeController {
    private final IShareholderService shareholderService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
     */
@@ -113,7 +114,8 @@
                    "'" + shareholder.getCell() + "'" + "," +
                    "'" + shareholder.getCreditcode() + "'" + "," +
                    "'" + shareholder.getDeptId() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        } else {
            String s1 =
                "insert into sys_shareholder(id,shareholder,shareholdingratio,capital,capitalTime,cardid,cell,creditCode,dept_id) " +
@@ -126,7 +128,8 @@
                    "'" + shareholder.getCell() + "'" + "," +
                    "'" + shareholder.getCreditcode() + "'" + "," +
                    "'" + shareholder.getDeptId() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(save);
    }
@@ -149,7 +152,8 @@
                ",creditCode = " + "'" + shareholder.getCreditcode() + "'" +
                ",dept_id = " + "'" + shareholder.getDeptId() + "'" +
                " " + "where id = " + "'" + shareholder.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        } else {
            //内网同步
            String s1 = "update sys_shareholder set shareholder = " + "'" + shareholder.getShareholder() + "'" +
@@ -161,7 +165,8 @@
                ",creditCode = " + "'" + shareholder.getCreditcode() + "'" +
                ",dept_id = " + "'" + shareholder.getDeptId() + "'" +
                " " + "where id = " + "'" + shareholder.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.status(b);
    }
@@ -188,7 +193,8 @@
        List<Long> list = Func.toLongList(ids);
        list.forEach(id -> {
            String s1 = "delete from sys_shareholder where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(shareholderService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/system/controller/DeptController.java
@@ -41,6 +41,7 @@
import org.springblade.modules.system.node.TreeNodes;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.system.vo.DeptVO;
import org.springblade.modules.system.wrapper.DeptWrapper;
import org.springframework.web.bind.annotation.*;
@@ -70,6 +71,7 @@
    private final IUserService userService;
    private final IInformationService informationService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -249,7 +251,8 @@
                    "," + "'" + dept.getSort() + "'" +
                    "," + "'" + dept.getRemark() + "'" +
                    "," + "'" + isDeleted + "'" + ")";
                FtpUtil.sqlFileUpload(ss);
                //FtpUtil.sqlFileUpload(ss);
                myAsyncService.FTP(ss);
            }else {
                //修改
                //内网同步
@@ -263,7 +266,8 @@
                        + ",remark = " + "'" + dept.getRemark() + "'"
                        + ",is_deleted = " + "'" + dept.getIsDeleted() + "'"
                        + " " + "where id = " + "'" + dept.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
//            String id = kv.get("id").toString();
//            information.setDepartmentid(id);
@@ -294,7 +298,8 @@
        list.forEach(id -> {
            //内网同步
            String s1 = "update blade_dept set is_deleted = 1 where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(deptService.removeDept(ids));
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -222,8 +222,8 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增或修改", notes = "传入User")
    //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
    public R submit(@Valid @RequestBody User user){
        if (null==user.getId()) {
    public R submit(@Valid @RequestBody User user) {
        if (null == user.getId()) {
            //新增
            //密码加密
            if (Func.isNotEmpty(user.getPassword())) {
@@ -250,49 +250,52 @@
                user.setJurisdiction(one.getId().toString());
            }
            //新增
            userService.save(user);
            //内网同步
            String s = "insert into blade_user(" +
                "id,tenant_id,code,account,password,real_name,phone,sex,role_id,dept_id," +
                "create_time,update_time,cardid,status,is_deleted,jurisdiction) " +
                "values(" + "'" + user.getId() + "'" + "," +
                "'" + user.getTenantId() + "'" + "," +
                "'" + user.getCode() + "'" + "," +
                "'" + user.getAccount() + "'" + "," +
                "'" + user.getPassword() + "'" + "," +
                "'" + user.getRealName() + "'" + "," +
                "'" + user.getPhone() + "'" + "," +
                "'" + user.getSex() + "'" + "," +
                "'" + user.getRoleId() + "'" +
                "," + "'" + user.getDeptId() + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                "," + "'" + user.getCardid() + "'" +
                "," + "'" + user.getStatus() + "'" +
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getJurisdiction() + "'"
                + ")";
            FtpUtil.sqlFileUpload(s);
        }else {
            boolean stats = userService.save(user);
            if (stats) {
                //内网同步
                String s = "insert into blade_user(" +
                    "id,tenant_id,code,account,password,real_name,phone,sex,role_id,dept_id," +
                    "create_time,update_time,cardid,status,is_deleted,jurisdiction) " +
                    "values(" + "'" + user.getId() + "'" + "," +
                    "'" + user.getTenantId() + "'" + "," +
                    "'" + user.getCode() + "'" + "," +
                    "'" + user.getAccount() + "'" + "," +
                    "'" + user.getPassword() + "'" + "," +
                    "'" + user.getRealName() + "'" + "," +
                    "'" + user.getPhone() + "'" + "," +
                    "'" + user.getSex() + "'" + "," +
                    "'" + user.getRoleId() + "'" +
                    "," + "'" + user.getDeptId() + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                    "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                    "," + "'" + user.getCardid() + "'" +
                    "," + "'" + user.getStatus() + "'" +
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getJurisdiction() + "'"
                    + ")";
                myAsyncService.FTP(s);
            }
        } else {
            //修改
            User user1 = userService.getById(user.getId());
            user.setPassword(user1.getPassword());
            user.setUpdateTime(new Date());
            userService.updateById(user);
            String s1 =
                "update blade_user set account = " + "'" + user.getAccount() + "'"
                    + ",code = " + "'" + user.getCode() + "'"
                    + ",real_name = " + "'" + user.getRealName() + "'"
                    + ",phone = " + "'" + user.getPhone() + "'"
                    + ",sex = " + "'" + user.getSex() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + ",role_id = " + "'" + user.getRoleId() + "'"
                    + ",dept_id = " + "'" + user.getDeptId() + "'"
                    + ",cardid = " + "'" + user.getCardid() + "'"
                    + ",guncode = " + "'" + user.getGuncode() + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            boolean b = userService.updateById(user);
            if (b) {
                String s1 =
                    "update blade_user set account = " + "'" + user.getAccount() + "'"
                        + ",code = " + "'" + user.getCode() + "'"
                        + ",real_name = " + "'" + user.getRealName() + "'"
                        + ",phone = " + "'" + user.getPhone() + "'"
                        + ",sex = " + "'" + user.getSex() + "'"
                        + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                        + ",role_id = " + "'" + user.getRoleId() + "'"
                        + ",dept_id = " + "'" + user.getDeptId() + "'"
                        + ",cardid = " + "'" + user.getCardid() + "'"
                        + ",guncode = " + "'" + user.getGuncode() + "'"
                        + " " + "where id = " + "'" + user.getId() + "'";
                myAsyncService.FTP(s1);
            }
        }
        //返回
@@ -309,8 +312,8 @@
        CacheUtil.clear(USER_CACHE);
        User user1 = userService.getById(user.getId());
        String url = "";
        if (null!=user.getFingerprint() && !user.getFingerprint().equals("")) {
            if (user.getFingerprint().length()>100) {
        if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
            if (user.getFingerprint().length() > 100) {
                //指纹图片上传并返回url
                String s = uploadBase64String(user);
                String[] split = s.split(",");
@@ -343,8 +346,8 @@
//        }
        //如果是离职
        if (null!=user.getStatus()){
            if (user.getStatus().equals(2)){
        if (null != user.getStatus()) {
            if (user.getStatus().equals(2)) {
                //修改派遣状态
                user.setDispatch("1");
                //同时将派遣记录中的派遣状态修改
@@ -353,17 +356,18 @@
                dispatcher.setUserIds(user.getId().toString());
                dispatcher.setStatus(0);
                List<Dispatcher> dispatcherList = dispatcherService.list(Condition.getQueryWrapper(dispatcher));
                if (dispatcherList.size()>0){
                if (dispatcherList.size() > 0) {
                    dispatcherList.forEach(dispatcher1 -> {
                        dispatcher1.setStatus(1);
                        dispatcher1.setUpdateTime(new Date());
                        dispatcherService.updateById(dispatcher1);
                        String s1 =
                            "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'"
                                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
                                + " " + "where id = " + "'" + dispatcher1.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        boolean b = dispatcherService.updateById(dispatcher1);
                        if (b) {
                            String s1 =
                                "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);
                        }
                    });
                }
@@ -375,7 +379,7 @@
                experience.setCardid(user.getCardid());
                //按id降序
                List<Experience> list = experienceService.list(Condition.getQueryWrapper(experience).orderByDesc("id"));
                if (list.size()>0){
                if (list.size() > 0) {
                    //如果有多条取第一条更新
                    Experience experience1 = list.get(0);
                    //设置离职时间
@@ -386,56 +390,58 @@
                    String s1 =
                        "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
                            + " " + "where id = " + "'" + experience1.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                }else {
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                } else {
                    //新增
                    if (null!=user.getRtime()){
                    if (null != user.getRtime()) {
                        experience.setEntrytime(user.getRtime());
                    }else {
                    } else {
                        experience.setEntrytime(new Date());
                    }
                    experience.setDeparturetime(new Date());
                    experience.setName(user.getRealName());
                    if (null!=user.getReasonForLeav() && !user.getReasonForLeav().equals("")){
                    if (null != user.getReasonForLeav() && !user.getReasonForLeav().equals("")) {
                        experience.setLeaving(user.getReasonForLeav());
                    }
                    experience.setCardid(user.getCardid());
                    experience.setSecurityid(user.getId().toString());
                    //新增
                    experienceService.save(experience);
                    //内网同步
                    String s = "insert into sys_experience(id,name,entryTime,departureTime,leaving,cardId,companyname,securityId) " +
                        "values(" + "'" + experience.getId() + "'" +
                        "," + "'" + experience.getName() + "'" +
                        "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                        "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getDeparturetime()) + "'" +
                        "," + "'" + experience.getLeaving() + "'" +
                        "," + "'" + experience.getCardid() + "'" +
                        "," + "'" + experience.getCompanyname() + "'" +
                        "," + "'" + experience.getSecurityid() + "'"
                        + ")";
                    FtpUtil.sqlFileUpload(s);
                    boolean save = experienceService.save(experience);
                    if (save) {
                        //内网同步
                        String s = "insert into sys_experience(id,name,entryTime,departureTime,leaving,cardId,companyname,securityId) " +
                            "values(" + "'" + experience.getId() + "'" +
                            "," + "'" + experience.getName() + "'" +
                            "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                            "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getDeparturetime()) + "'" +
                            "," + "'" + experience.getLeaving() + "'" +
                            "," + "'" + experience.getCardid() + "'" +
                            "," + "'" + experience.getCompanyname() + "'" +
                            "," + "'" + experience.getSecurityid() + "'"
                            + ")";
                        myAsyncService.FTP(s);
                    }
                }
                boolean status = userService.updateById(user);
                //qfqk 数据推送
                if (status){
                if (status) {
                    myAsyncService.updateUserByQfqk(user);
                    //内网更新
                    String s1 =
                        "update blade_user set status = " + "'" + user.getStatus() + "'"
                            + " " + "where id = " + "'" + user.getId() + "'";
                    myAsyncService.FTP(s1);
                }
                //内网更新
                String s1 =
                    "update blade_user set status = " + "'" + user.getStatus() + "'"
                        + " " + "where id = " + "'" + user.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                return R.success("修改成功");
            }
        }
        int state = 0;
        //如果是异常标记
        if (null!=user.getExaminationType() && !user.getExaminationType().equals("")){
        if (null != user.getExaminationType() && !user.getExaminationType().equals("")) {
            if (user.getExaminationType().equals("1")) {
                //吊销保安证
                user.setHold("3");
@@ -447,7 +453,7 @@
        user.setUpdateTime(new Date());
        //如果身份证号修改
        if (!user.getCardid().equals(user1.getCardid())){
        if (!user.getCardid().equals(user1.getCardid())) {
            //账号,密码也修改
            user.setAccount(user.getCardid());
            //获取默认密码配置
@@ -512,7 +518,8 @@
                    + ",guncode = " + "'" + user.getGuncode() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        } else {
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
            String s1 =
@@ -545,7 +552,8 @@
                    + ",guncode = " + "'" + user.getGuncode() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.success("修改成功");
    }
@@ -557,8 +565,8 @@
    @PostMapping("/updateUserInfo")
    public R updateUserInfo(@Valid @RequestBody UserVO user) throws Exception {
        String url = null;
        if (null!=user.getFingerprint() && !user.getFingerprint().equals("")) {
            if (user.getFingerprint().length()>100) {
        if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
            if (user.getFingerprint().length() > 100) {
                //指纹图片上传并返回url
                String s = uploadBase64String(user);
                String[] split = s.split(",");
@@ -572,13 +580,13 @@
        userService.updateById(user);
        //生成签到记录
        if (null!=user.getCandidateNo() && !user.getCandidateNo().equals("")){
        if (null != user.getCandidateNo() && !user.getCandidateNo().equals("")) {
            //查询签到记录,如果已有,则更新,没有就新增
            SignInRecords signInRecords = new SignInRecords();
            signInRecords.setCandidateNo(user.getCandidateNo());
            SignInRecords inRecordsServiceOne = signInRecordsService.getOne(Condition.getQueryWrapper(signInRecords));
            //如果为null
            if (null==inRecordsServiceOne){
            if (null == inRecordsServiceOne) {
                //查询报名信息
                TrainingRegistration trainingRegistration = new TrainingRegistration();
                trainingRegistration.setCandidateNo(user.getCandidateNo());
@@ -593,7 +601,7 @@
                sign.setExamId(Long.parseLong(one.getTrainExamId()));
                //新增
                signInRecordsService.save(sign);
            }else {
            } else {
                //更新
                inRecordsServiceOne.setUpdateTime(new Date());
                signInRecordsService.updateById(inRecordsServiceOne);
@@ -617,17 +625,19 @@
                + ",hold = " + "'" + user.getHold() + "'"
                + ",cell = " + "'" + user.getCell() + "'"
                + " " + "where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.success("修改成功");
    }
    /**
     * 指纹图片上传
     *
     * @return
     * @throws Exception
     */
    private String uploadBase64String (User user)throws Exception{
    private String uploadBase64String(User user) throws Exception {
        //图片上传
        BASE64Decoder decoder = new BASE64Decoder();
        // 解密
@@ -655,7 +665,7 @@
            minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucket).build());
            minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build());
        }
        String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "")+".jpg";
        String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + ".jpg";
        InputStream in = new ByteArrayInputStream(b);
        String[] split = newName.split("/");
        //创建头部信息
@@ -676,7 +686,7 @@
        //内网
        String inUrl = FtpConfig.ip + "/zhba/" + newName;
        //返回
        return urls+","+inUrl;
        return urls + "," + inUrl;
    }
@@ -704,7 +714,7 @@
        accreditationRecords.setStatus(1);
        //查询
        List<AccreditationRecords> list = accreditationRecordsService.list(Condition.getQueryWrapper(accreditationRecords));
        if (list.size()>0) {
        if (list.size() > 0) {
            //排序
            List<AccreditationRecords> collect = list.stream().sorted(Comparator.comparing(AccreditationRecords::getId).reversed()).collect(Collectors.toList());
            //取出第一个
@@ -721,9 +731,10 @@
                    + ",user_type = " + "'" + user.getUserType() + "'"
                    + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                    + " " + "where id = " + "'" + user.getId() + "';" +
                "update sys_accreditation_records set status = " + "'" + accreditationRecords1.getStatus() + "'" +
                    "update sys_accreditation_records set status = " + "'" + accreditationRecords1.getStatus() + "'" +
                    " " + "where id = " + "'" + accreditationRecords1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
            //返回
            return R.success("修改成功");
        }
@@ -733,7 +744,8 @@
                + ",user_type = " + "'" + user.getUserType() + "'"
                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'"
                + " " + "where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        return R.success("修改成功");
    }
@@ -757,7 +769,8 @@
            myAsyncService.deleteUserByQfqk(user1);
            //内网同步
            String s1 = "update blade_user set is_deleted = 1 where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(userService.removeUser(ids));
    }
@@ -829,8 +842,8 @@
    @PostMapping("import-user")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入用户", notes = "传入excel")
    public R importUser(MultipartFile file, Integer isCovered,String deptId) {
        UserImporter userImporter = new UserImporter(userService, false,deptId);
    public R importUser(MultipartFile file, Integer isCovered, String deptId) {
        UserImporter userImporter = new UserImporter(userService, false, deptId);
        ExcelUtil.save(file, userImporter, UserExcel.class);
        return R.success("操作成功");
    }
@@ -842,8 +855,8 @@
    @PostMapping("import-qrCode")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入用户", notes = "传入excel")
    public R importQrCode(@RequestParam("file") MultipartFile file, Integer isCovered,String deptId) {
        QrCodeImporter qrCodeImporter = new QrCodeImporter(userService, false,deptId);
    public R importQrCode(@RequestParam("file") MultipartFile file, Integer isCovered, String deptId) {
        QrCodeImporter qrCodeImporter = new QrCodeImporter(userService, false, deptId);
        ExcelUtil.save(file, qrCodeImporter, QrCodeExcel.class);
        return R.success("操作成功");
    }
@@ -855,8 +868,8 @@
    @PostMapping("import-security")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入用户", notes = "传入excel")
    public R importSecurity(MultipartFile file, Integer isCovered,String deptId) {
        SecurityImporter securityImporter = new SecurityImporter(userService, false,deptId);
    public R importSecurity(MultipartFile file, Integer isCovered, String deptId) {
        SecurityImporter securityImporter = new SecurityImporter(userService, false, deptId);
        ExcelUtil.save(file, securityImporter, SecurityExcel.class);
        return R.success("操作成功");
    }
@@ -867,8 +880,8 @@
    @PostMapping("import-security-test")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入用户", notes = "传入excel")
    public R importSecurityTest(MultipartFile file, Integer isCovered,String deptId) {
        SecurityImporterTest securityImporter = new SecurityImporterTest(userService, false,deptId);
    public R importSecurityTest(MultipartFile file, Integer isCovered, String deptId) {
        SecurityImporterTest securityImporter = new SecurityImporterTest(userService, false, deptId);
        ExcelUtil.save(file, securityImporter, SecurityExcel.class);
        return R.success("操作成功");
    }
@@ -879,8 +892,8 @@
    @PostMapping("import-securityYy")
    @ApiOperationSupport(order = 12)
    @ApiOperation(value = "导入用户", notes = "传入excel")
    public R importSecurityYy(MultipartFile file, Integer isCovered,String deptId) {
        SecurityYyImporter securityYyImporter = new SecurityYyImporter(userService, false,deptId);
    public R importSecurityYy(MultipartFile file, Integer isCovered, String deptId) {
        SecurityYyImporter securityYyImporter = new SecurityYyImporter(userService, false, deptId);
        ExcelUtil.save(file, securityYyImporter, SecurityYyExcel.class);
        return R.success("操作成功");
    }
@@ -959,7 +972,7 @@
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
            fileName = URLEncoder.encode("保安员导入数据模板"+DateUtil.time(), Charsets.UTF_8.name());
            fileName = URLEncoder.encode("保安员导入数据模板" + DateUtil.time(), Charsets.UTF_8.name());
            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
            //修改单元格格式为文本格式
            EasyExcel.write(response.getOutputStream(), SecurityExcel.class).sheet("保安员数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list);
@@ -1004,7 +1017,7 @@
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
            fileName = URLEncoder.encode("保安员导入数据模板"+DateUtil.time(), Charsets.UTF_8.name());
            fileName = URLEncoder.encode("保安员导入数据模板" + DateUtil.time(), Charsets.UTF_8.name());
            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
            //修改单元格格式为文本格式
            EasyExcel.write(response.getOutputStream(), SecurityYyExcel.class).sheet("保安员数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list);
@@ -1128,7 +1141,7 @@
    }
    @GetMapping("/zc")
    public R zc(String username, String password,String phone) {
    public R zc(String username, String password, String phone) {
        User user = new User();
        user.setTenantId("000000");
        user.setAccount(username);
@@ -1164,11 +1177,11 @@
        List<User> list = userService.list(Condition.getQueryWrapper(user1));
        if (list.size() > 0 && Func.isEmpty(user.getId())) {
            if (null!=user.getCell() && !user.getCell().equals("")) {
                if (user.getCell().equals("2")){
            if (null != user.getCell() && !user.getCell().equals("")) {
                if (user.getCell().equals("2")) {
                    list.forEach(user2 -> {
                        //判断是否在本单位,如果是本单位,则不能再次新增
                        if(!user2.getDeptId().equals(user.getDeptId())) {
                        if (!user2.getDeptId().equals(user.getDeptId())) {
                            user2.setStatus(2);
                            //先将原有人员离职  cell 1:手动录入  2:自动录入
                            user2.setUpdateTime(new Date());
@@ -1177,18 +1190,19 @@
                            String s1 = "update blade_user set status = " + user2.getStatus() +
                                ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'" +
                                " where id = " + "'" + user2.getId() + "'";
                            FtpUtil.sqlFileUpload(s1);
                            //FtpUtil.sqlFileUpload(s1);
                            myAsyncService.FTP(s1);
                            //人员离职后修改派遣记录,修改从业记录
                            updateUserDispatcherExp(user2);
                        }else {
                        } else {
                            throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
                        }
                    });
                }else {
                } else {
                    throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
                }
            }else {
            } else {
                throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
            }
        }
@@ -1216,8 +1230,8 @@
//        }
        String url = "";
        if (null!=user.getFingerprint() && !user.getFingerprint().equals("")) {
            if (user.getFingerprint().length()>100) {
        if (null != user.getFingerprint() && !user.getFingerprint().equals("")) {
            if (user.getFingerprint().length() > 100) {
                String s = uploadBase64String(user);
                String[] split = s.split(",");
                user.setFingerprint(split[0]);
@@ -1264,7 +1278,7 @@
//            paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
//        }
        //头像
        if (null!=user.getAvatar() && !user.getAvatar().equals("")) {
        if (null != user.getAvatar() && !user.getAvatar().equals("")) {
            user.setAvatar(FtpConfig.ip + user.getAvatar().substring(26));
        }
@@ -1272,59 +1286,58 @@
        //1.群访群控数据推送(异步)
        if (status) {
            myAsyncService.qfqkUserSave(user);
            //2.内网数据推送
            String s = "insert into blade_user(" +
                "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
                "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
                "politicaloutlook,healstats,height,address,registered,rtime," +
                "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode,create_time,cell) " +
                "values(" + "'" + user.getId() + "'" +
                "," + "'" + user.getTenantId() + "'" +
                "," + "'" + user.getAccount() + "'" +
                "," + "'" + user.getPassword() + "'" +
                "," + "'" + user.getName() + "'" +
                "," + "'" + user.getRealName() + "'" +
                "," + "'" + user.getAvatar() + "'" +
                "," + "'" + user.getEmail() + "'" +
                "," + "'" + user.getPhone() + "'" +
                "," + "'" + user.getSex() + "'" +
                "," + "'" + user.getRoleId() + "'" +
                "," + "'" + user.getDeptId() + "'" +
                "," + "'" + user.getCardid() + "'" +
                "," + "'" + user.getNativeplace() + "'" +
                "," + "'" + user.getNation() + "'" +
                "," + "'" + url + "'" +
                "," + "'" + user.getEducation() + "'" +
                "," + "'" + user.getPoliticaloutlook() + "'" +
                "," + "'" + user.getHealstats() + "'" +
                "," + "'" + user.getHeight() + "'" +
                "," + "'" + user.getAddress() + "'" +
                "," + "'" + user.getRegistered() + "'" +
                "," + "'" + rtime + "'" +
                "," + "'" + user.getSecuritynumber() + "'" +
                "," + "'" + user.getHold() + "'" +
                "," + "'" + user.getJurisdiction() + "'" +
                "," + "'" + user.getExaminationType() + "'" +
                "," + "'" + user.getStatus() + "'" +
                "," + "'" + user.getIsDeleted() + "'" +
                "," + "'" + user.getDispatch() + "'" +
                "," + "'" + user.getGuncode() + "'" +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
                "," + "'" + user.getCell() + "'" + ");" +
                "insert into sys_experience(id,name,post,entryTime," +
                "cardId,companyname,securityId) " +
                "values(" + "'" + experience.getId() + "'" + "," +
                "'" + experience.getName() + "'" + "," +
                "'" + experience.getPost() + "'" + "," +
                "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
                "," + "'" + experience.getCardid() + "'" +
                "," + "'" + experience.getCompanyname() + "'" +
                "," + "'" + experience.getSecurityid() + "'"
                + ")";
            myAsyncService.FTP(s);
        }
        //2.内网数据推送
        String s = "insert into blade_user(" +
            "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
            "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
            "politicaloutlook,healstats,height,address,registered,rtime," +
            "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode,create_time,cell) " +
            "values(" + "'" + user.getId() + "'" +
            "," + "'" + user.getTenantId() + "'" +
            "," + "'" + user.getAccount() + "'" +
            "," + "'" + user.getPassword() + "'" +
            "," + "'" + user.getName() + "'" +
            "," + "'" + user.getRealName() + "'" +
            "," + "'" + user.getAvatar() + "'" +
            "," + "'" + user.getEmail() + "'" +
            "," + "'" + user.getPhone() + "'" +
            "," + "'" + user.getSex() + "'" +
            "," + "'" + user.getRoleId() + "'" +
            "," + "'" + user.getDeptId() + "'" +
            "," + "'" + user.getCardid() + "'" +
            "," + "'" + user.getNativeplace() + "'" +
            "," + "'" + user.getNation() + "'" +
            "," + "'" + url + "'" +
            "," + "'" + user.getEducation() + "'" +
            "," + "'" + user.getPoliticaloutlook() + "'" +
            "," + "'" + user.getHealstats() + "'"+
            "," + "'" + user.getHeight() + "'" +
            "," + "'" + user.getAddress() + "'" +
            "," + "'" + user.getRegistered() + "'" +
            "," +"'" + rtime + "'" +
            "," + "'" + user.getSecuritynumber() + "'" +
            "," + "'" + user.getHold() + "'" +
            "," + "'" + user.getJurisdiction() + "'" +
            "," + "'" + user.getExaminationType() + "'" +
            "," + "'" + user.getStatus() + "'" +
            "," + "'" + user.getIsDeleted() + "'" +
            "," + "'" + user.getDispatch() + "'" +
            "," + "'" + user.getGuncode() + "'" +
            "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
            "," + "'" + user.getCell() + "'" + ");"+
        "insert into sys_experience(id,name,post,entryTime," +
            "cardId,companyname,securityId) " +
            "values(" + "'" + experience.getId() + "'" + "," +
            "'" + experience.getName() + "'" + "," +
            "'" + experience.getPost() + "'" + "," +
            "," + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience.getEntrytime()) + "'" +
            "," + "'" + experience.getCardid() + "'" +
            "," + "'" + experience.getCompanyname() + "'" +
            "," + "'" + experience.getSecurityid() + "'"
            + ")";
        FtpUtil.sqlFileUpload(s);
        //获取从业记录
//        List<Experience> experiences = (List<Experience>) userMap.get("userPractitionersInfo");
@@ -1346,6 +1359,7 @@
    /**
     * 修改派遣记录,修改从业记录
     *
     * @param user
     */
    private void updateUserDispatcherExp(User user) {
@@ -1357,7 +1371,7 @@
        dispatcher.setUserIds(user.getId().toString());
        dispatcher.setStatus(0);
        List<Dispatcher> dispatcherList = dispatcherService.list(Condition.getQueryWrapper(dispatcher));
        if (dispatcherList.size()>0){
        if (dispatcherList.size() > 0) {
            dispatcherList.forEach(dispatcher1 -> {
                dispatcher1.setStatus(1);
                dispatcher1.setUpdateTime(new Date());
@@ -1365,7 +1379,8 @@
                    "update sys_dispatcher set status = " + "'" + dispatcher1.getStatus() + "'"
                        + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcher1.getUpdateTime()) + "'"
                        + " " + "where id = " + "'" + dispatcher1.getId() + "'";
                FtpUtil.sqlFileUpload(s1);
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            });
        }
@@ -1376,7 +1391,7 @@
        experience.setCompanyname(dept.getDeptName());
        //按id降序
        List<Experience> list = experienceService.list(Condition.getQueryWrapper(experience).orderByDesc("id"));
        if (list.size()>0){
        if (list.size() > 0) {
            //如果有多条取第一条更新
            Experience experience1 = list.get(0);
            //设置离职时间
@@ -1387,17 +1402,18 @@
            String s1 =
                "update sys_experience set departureTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(experience1.getDeparturetime()) + "'"
                    + " " + "where id = " + "'" + experience1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }else {
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        } else {
            //新增
            if (null!=user.getRtime()){
            if (null != user.getRtime()) {
                experience.setEntrytime(user.getRtime());
            }else {
            } else {
                experience.setEntrytime(new Date());
            }
            experience.setDeparturetime(new Date());
            experience.setName(user.getRealName());
            if (null!=user.getReasonForLeav() && !user.getReasonForLeav().equals("")){
            if (null != user.getReasonForLeav() && !user.getReasonForLeav().equals("")) {
                experience.setLeaving(user.getReasonForLeav());
            }
            experience.setCardid(user.getCardid());
@@ -1416,7 +1432,8 @@
                "," + "'" + experience.getCompanyname() + "'" +
                "," + "'" + experience.getSecurityid() + "'"
                + ")";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
    }
@@ -1448,13 +1465,14 @@
    /**
     * 用户详情
     *
     * @param user
     * @return
     */
    @GetMapping("/details")
    public R details(User user) {
        User user1 = userService.getById(user.getId());
        if (null!=user1.getFingerprint() && !user1.getFingerprint().equals("")){
        if (null != user1.getFingerprint() && !user1.getFingerprint().equals("")) {
            //url 转base64
            String base64Url = ImageUtils.imageUrlToBase64(user1.getFingerprint());
            System.out.println("base64Url = " + base64Url);
@@ -1466,17 +1484,18 @@
    /**
     * 保安员导出
     *
     * @param response
     * @param user 查询条件
     * @param user     查询条件
     */
    @GetMapping("export-security-info")
    public void exportSecurityInfo(HttpServletResponse response,UserVO user) throws IOException {
    public void exportSecurityInfo(HttpServletResponse response, UserVO user) throws IOException {
        List<SecurityExcel> list = userService.exportSecurityInfo(user);
        String fileName = null;
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
            fileName = URLEncoder.encode("保安员数据导出"+DateUtil.time(), Charsets.UTF_8.name());
            fileName = URLEncoder.encode("保安员数据导出" + DateUtil.time(), Charsets.UTF_8.name());
            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
            //修改单元格格式为文本格式
            EasyExcel.write(response.getOutputStream(), SecurityExcel.class).sheet("保安员数据表").registerWriteHandler(new RowWriteHandler()).doWrite(list);
@@ -1489,6 +1508,7 @@
    /**
     * 保安员账号校验
     *
     * @param user
     * @return
     */
@@ -1500,15 +1520,15 @@
        user1.setIsDeleted(0);
        user1.setStatus(1);
        User user2 = userService.getOne(Condition.getQueryWrapper(user1));
        if (null!=user2){
        if (null != user2) {
            //判断是单位否一致
            if (null!=user.getDeptId() && !user.getDeptId().equals("")) {
            if (null != user.getDeptId() && !user.getDeptId().equals("")) {
                if (!user2.getDeptId().equals(user.getDeptId())) {
                    throw new ServiceException(StringUtil.format("当前用户 [{}] 已在其他单位录入!", user.getCardid()));
                } else {
                    throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getCardid()));
                }
            }else {
            } else {
                //没有传 deptId 的情况
                throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getCardid()));
            }
@@ -1517,21 +1537,23 @@
    /**
     * 年龄分布查询
     *
     * @param user
     * @return
     */
    @PostMapping("/getAgeStatistics")
    public R getAgeStatistics(UserVO user){
    public R getAgeStatistics(UserVO user) {
        return R.data(userService.getAgeStatistics(user));
    }
    /**
     * 查询登录密码还是 123456 的单位信息
     *
     * @return
     */
    @GetMapping("/getNotUpdatePwdInfo")
    public R getNotUpdatePwdInfo(){
    public R getNotUpdatePwdInfo() {
        return R.data(userService.getNotUpdatePwdInfo());
    }
}
src/main/java/org/springblade/modules/system/service/MyAsyncService.java
@@ -2,6 +2,7 @@
import net.sf.json.JSONObject;
import org.springblade.common.utils.HttpClientUtils;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.system.dto.UserDTO;
import org.springblade.modules.system.entity.User;
import org.springframework.scheduling.annotation.Async;
@@ -100,4 +101,13 @@
            e.printStackTrace();
        }
    }
    /**
     * FTP
     * @param s sql语句
     */
    @Async
    public void FTP(String s) {
        FtpUtil.sqlFileUpload(s);
    }
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -91,6 +91,7 @@
    private final IDeptService deptService;
    private final JurisdictionService jurisdictionService;
    private final IExperienceService experienceService;
    private final MyAsyncService myAsyncService;
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -143,7 +144,8 @@
            "," + "'" + user.getJurisdiction() + "'"+
            "," + "'" + user.getIsDeleted() + "'"
            + ")";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
        return b;
    }
@@ -543,7 +545,8 @@
                    "," + "'" + user.getIsDeleted() + "'" +
                    "," + "'" + user.getJurisdiction() + "'"
                    + ")";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            }else {
                //匹配组织机构是否一致,如果不一致
                if(!user2.getDeptId().equals(user.getDeptId())){
@@ -580,7 +583,8 @@
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + ",cardid = " + "'" + user2.getCardid() + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }
        });
@@ -985,7 +989,8 @@
                                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                                + ",registered = " + "'" + user2.getRegistered() + "'"
                                + " " + "where id = " + "'" + user2.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }else {
                        status.set(false);
                        //加入集合
@@ -1017,7 +1022,8 @@
                            + ",registered = " + "'" + user2.getRegistered() + "'"
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }
        }
@@ -1072,7 +1078,8 @@
                //判断list.size 大小
                if (list.size()==1000){
                    //执行
                    FtpUtil.sqlFileUpload(builder.toString());
                    //FtpUtil.sqlFileUpload(builder.toString());
                    myAsyncService.FTP(builder.toString());
                    //清空
                    builder.delete(0,builder.length());
                }
@@ -1105,14 +1112,17 @@
                //判断list.size 大小
                if (split1.length==1000){
                    //执行
                    FtpUtil.sqlFileUpload(builder1.toString());
                    //FtpUtil.sqlFileUpload(builder1.toString());
                    myAsyncService.FTP(builder1.toString());
                    //清空
                    builder1.delete(0,builder1.length());
                }
            }
            //剩余的继续执行
            FtpUtil.sqlFileUpload(builder.toString());
            FtpUtil.sqlFileUpload(builder1.toString());
            //FtpUtil.sqlFileUpload(builder.toString());
            myAsyncService.FTP(builder.toString());
            //FtpUtil.sqlFileUpload(builder1.toString());
            myAsyncService.FTP(builder1.toString());
        }
//        System.out.println("导入时间: = " + (System.currentTimeMillis()-time));
@@ -1298,7 +1308,8 @@
                    "," + "'" + experience.getCompanyname() + "'" +
                    "," + "'" + experience.getSecurityid() + "'"
                    + ")";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
            }
            else {
                //匹配组织机构是否一致,如果不一致
@@ -1347,7 +1358,8 @@
                                + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                                + ",registered = " + "'" + user2.getRegistered() + "'"
                                + " " + "where id = " + "'" + user2.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }else {
                        status.set(false);
                        //加入集合
@@ -1388,7 +1400,8 @@
                            + ",registered = " + "'" + user2.getRegistered() + "'"
                            + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
                            + " " + "where id = " + "'" + user2.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
                    //FtpUtil.sqlFileUpload(s1);
                    myAsyncService.FTP(s1);
                }
            }
        });
src/main/java/org/springblade/modules/talk/controller/TalkController.java
@@ -31,6 +31,7 @@
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.talk.entity.Talk;
@@ -56,6 +57,7 @@
public class TalkController extends BladeController {
    private final ITalkService talkService;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -97,7 +99,7 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入talk")
    public R save(@Valid @RequestBody Talk talk) {
        talkService.save(talk);
        boolean save = talkService.save(talk);
        String url = "";
        String[] split = talk.getImgurl().split(",");
        for (int i = 0; i < split.length; i++) {
@@ -106,19 +108,22 @@
        }
        String substring = url.substring(0, url.length() - 1);
        talk.setImgurl(substring);
        //数据同步
        String s1 =
            "insert into sys_talk(id,title,real_name,talkcontent,talktime,conclusion,evaluate,deptid,imgurl) " +
                "values(" + "'" + talk.getId() + "'" + "," +
                "'" + talk.getTitle() + "'" + "," +
                "'" + talk.getRealName() + "'" + "," +
                "'" + talk.getTalkcontent() + "'" + "," +
                "'" + new SimpleDateFormat("yyyy-MM-dd").format(talk.getTalktime()) + "'" + "," +
                "'" + talk.getConclusion() + "'" + "," +
                "'" + talk.getEvaluate() + "'" + "," +
                "'" + talk.getDeptid() + "'" + "," +
                "'" + talk.getImgurl() + "'" + ")";
        FtpUtil.sqlFileUpload(s1);
        if (save) {
            //数据同步
            String s1 =
                "insert into sys_talk(id,title,real_name,talkcontent,talktime,conclusion,evaluate,deptid,imgurl) " +
                    "values(" + "'" + talk.getId() + "'" + "," +
                    "'" + talk.getTitle() + "'" + "," +
                    "'" + talk.getRealName() + "'" + "," +
                    "'" + talk.getTalkcontent() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(talk.getTalktime()) + "'" + "," +
                    "'" + talk.getConclusion() + "'" + "," +
                    "'" + talk.getEvaluate() + "'" + "," +
                    "'" + talk.getDeptid() + "'" + "," +
                    "'" + talk.getImgurl() + "'" + ")";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.success("新增成功");
    }
@@ -129,7 +134,7 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入talk")
    public R update(@Valid @RequestBody Talk talk) {
        talkService.updateById(talk);
        boolean b = talkService.updateById(talk);
        String url = "";
        String[] split = talk.getImgurl().split(",");
        for (int i = 0; i < split.length; i++) {
@@ -138,16 +143,19 @@
        }
        String substring = url.substring(0, url.length() - 1);
        talk.setImgurl(substring);
        String s1 = "update sys_talk set title = " + "'" + talk.getTitle() + "'" +
            ",real_name = " + "'" + talk.getRealName() + "'" +
            ",talkcontent = " + "'" + talk.getTalkcontent() + "'" +
            ",talktime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(talk.getTalktime()) + "'" +
            ",conclusion = " + "'" + talk.getConclusion() + "'" +
            ",evaluate = " + "'" + talk.getEvaluate() + "'" +
            ",deptid = " + "'" + talk.getDeptid() + "'" +
            ",imgurl = " + "'" + talk.getImgurl() + "'" +
            " " + "where id = " + "'" + talk.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        if (b) {
            String s1 = "update sys_talk set title = " + "'" + talk.getTitle() + "'" +
                ",real_name = " + "'" + talk.getRealName() + "'" +
                ",talkcontent = " + "'" + talk.getTalkcontent() + "'" +
                ",talktime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(talk.getTalktime()) + "'" +
                ",conclusion = " + "'" + talk.getConclusion() + "'" +
                ",evaluate = " + "'" + talk.getEvaluate() + "'" +
                ",deptid = " + "'" + talk.getDeptid() + "'" +
                ",imgurl = " + "'" + talk.getImgurl() + "'" +
                " " + "where id = " + "'" + talk.getId() + "'";
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        }
        return R.success("修改成功");
    }
@@ -174,7 +182,8 @@
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_talk where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(talkService.removeByIds(Func.toLongList(ids)));
    }
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java
@@ -25,6 +25,7 @@
import org.springblade.modules.exam.service.ExamPaperService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.system.vo.UserVO;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.excel.TrainingRegistrationExcel;
@@ -33,6 +34,7 @@
import org.springblade.modules.training.vo.TrainingRegistrationVo;
import org.springblade.modules.vip.service.UserVipService;
import org.springblade.modules.vip.service.VipTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -62,6 +64,8 @@
    private final UserVipService userVipService;
    private final VipTopicService vipTopicService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
@@ -165,7 +169,8 @@
            + "," + "'" + trainingRegistration.getIsExam() + "'"
            + "," +"'" + trainingRegistration.getAuditStatus() + "'" + ");" +
            "update blade_user set is_train = " + user1.getIsTrain() + " " +"where id = " + "'" + user1.getId() + "'";
        FtpUtil.sqlFileUpload(sql);
        //FtpUtil.sqlFileUpload(sql);
        myAsyncService.FTP(sql);
    }
@@ -293,7 +298,8 @@
                ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'" +
                " " +"where id = " + "'" + trainingRegistration.getId() + "';" +
                "update blade_user set is_train = " + user.getIsTrain() + " " +"where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
    }
    /**
@@ -626,7 +632,8 @@
                    "," + "'" + examPaper.getCreator() +"'" +
                    "," + "'" + creatorTimeFormat +"'" +
                    ","  +"'" + examPaper.getAuditStatus() + "'" + ")";
                FtpUtil.sqlFileUpload(s);
                //FtpUtil.sqlFileUpload(s);
                myAsyncService.FTP(s);
                //修改报名信息
@@ -641,7 +648,8 @@
                            "update sys_training_registration set train_exam_id = " + "'" + trainingRegistration.getTrainExamId() + "'"
                                + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'"
                                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                });
            }
@@ -697,7 +705,8 @@
                "," + "'" + examPaper.getCreator() +"'" +
                "," + "'" + creatorTimeFormat +"'" +
                ","  +"'" + examPaper.getAuditStatus() + "'" + ")";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
            //修改报名信息
            list.forEach(id ->{
@@ -714,7 +723,8 @@
                            "update sys_training_registration set train_exam_id = " + "'" + trainingRegistration.getTrainExamId() + "'"
                                + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'"
                                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //FtpUtil.sqlFileUpload(s1);
                        myAsyncService.FTP(s1);
                    }
                }
            });
@@ -739,7 +749,8 @@
        String s1 =
            "update sys_training_registration set vip_status = " + "'" + trainingRegistration.getVipStatus() + "'"
                + " " + "where id = " + "'" + trainingRegistration.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //FtpUtil.sqlFileUpload(s1);
        myAsyncService.FTP(s1);
        //更新并返回数据
        return R.data(trainingRegistrationService.updateById(trainingRegistration));
    }
src/main/java/org/springblade/modules/training/service/impl/TrainingRegistrationServiceImpl.java
@@ -22,6 +22,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.excel.TrainingRegistrationExcel;
import org.springblade.modules.training.mapper.TrainingRegistrationMapper;
@@ -56,6 +57,8 @@
    private final AbsentRecordsService absentRecordsService;
    private final ExamScoreService examScoreService;
    @Autowired
    private  MyAsyncService myAsyncService;
    @Autowired
    private ExamAnswerRecordService examAnswerRecordService;
@@ -292,7 +295,8 @@
            + "," + "'" + trainingRegistration.getIsExam() + "'"
            + "," +"'" + trainingRegistration.getAuditStatus() + "'" + ");" +
            "update blade_user set is_train = " + user1.getIsTrain() + " " +"where id = " + "'" + user1.getId() + "'";
        FtpUtil.sqlFileUpload(s);
        //FtpUtil.sqlFileUpload(s);
        myAsyncService.FTP(s);
    }
@@ -405,7 +409,8 @@
                                    + "'" + examScore.getUserId() + "'" + ","
                                    + "'" + examScore.getApplyId() + "'" + ","
                                    + "'" + examScore.getExamId() + "'" + ")";
                            FtpUtil.sqlFileUpload(s);
                            //FtpUtil.sqlFileUpload(s);
                            myAsyncService.FTP(s);
                        }
                    }
                }
@@ -468,14 +473,16 @@
                            "update exam_score set theory_grade = " + examScore1.getTheoryGrade() +
                                ",qualified = " + "'" + examScore1.getQualified() + "'" +
                                " " + "where id = " + "'" + examScore1.getId() + "'";
                        FtpUtil.sqlFileUpload(s);
                        //FtpUtil.sqlFileUpload(s);
                        myAsyncService.FTP(s);
                    });
                }else {
                    //数据同步
                    String s =
                        "update sys_training_registration set is_exam = " + trainingRegistration1.getIsExam() +
                            " " + "where id = " + "'" + trainingRegistration1.getId() + "'";
                    FtpUtil.sqlFileUpload(s);
                    //FtpUtil.sqlFileUpload(s);
                    myAsyncService.FTP(s);
                }
            });
        }
src/main/java/org/springblade/modules/workreport/controller/WorkReportController.java
@@ -14,6 +14,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.workreport.entity.WorkReport;
import org.springblade.modules.workreport.service.WorkReportService;
import org.springblade.modules.workreport.vo.WorkReportVo;
@@ -42,10 +43,12 @@
    private final IUserService userService;
    private final IDeptService deptService;
    private final MyAsyncService myAsyncService;
    /**
     * 自定义分页
     * @param query page,size
     *
     * @param query      page,size
     * @param workReport 工作汇报信息对象
     */
    @GetMapping("/page")
@@ -62,7 +65,8 @@
    /**
     * 自定义分页--接收到的汇报信息page
     * @param query page,size
     *
     * @param query      page,size
     * @param workReport 工作汇报信息对象
     */
    @GetMapping("/pageReply")
@@ -73,6 +77,7 @@
    /**
     * 新增
     *
     * @param workReport 工作汇报信息对象
     */
    @PostMapping("/save")
@@ -83,6 +88,7 @@
    /**
     * 修改
     *
     * @param workReport 工作汇报信息对象
     */
    @PostMapping("/update")
@@ -92,76 +98,84 @@
    /**
     * 新增或修改
     *
     * @param workReport 工作汇报信息对象
     */
    @PostMapping("/submit")
    public R submit(@RequestBody WorkReport workReport){
    public R submit(@RequestBody WorkReport workReport) {
        boolean status = false;
        if (null==workReport.getId()){
        if (null == workReport.getId()) {
            workReport.setReportTime(new Date());
            workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
            //新增
            status = workReportService.save(workReport);
            //数据同步
            String s1 =
                "insert into sys_work_report(id,type,content,work_desc,report_time,received_ids,dept_id,reply_dept_ids,category,user_id) " +
                    "values(" + "'" + workReport.getId() + "'" + "," +
                    "'" + workReport.getType() + "'" + "," +
                    "'" + workReport.getContent() + "'" + "," +
                    "'" + workReport.getWorkDesc() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(workReport.getReportTime()) + "'" + "," +
                    "'" + workReport.getReceivedIds() + "'" + "," +
                    "'" + workReport.getDeptId() + "'" + "," +
                    "'" + workReport.getReplyDeptIds() + "'" + "," +
                    "'" + workReport.getCategory() + "'" + "," +
                    "'" +workReport.getUserId() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            if (status) {
                //数据同步
                String s1 =
                    "insert into sys_work_report(id,type,content,work_desc,report_time,received_ids,dept_id,reply_dept_ids,category,user_id) " +
                        "values(" + "'" + workReport.getId() + "'" + "," +
                        "'" + workReport.getType() + "'" + "," +
                        "'" + workReport.getContent() + "'" + "," +
                        "'" + workReport.getWorkDesc() + "'" + "," +
                        "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(workReport.getReportTime()) + "'" + "," +
                        "'" + workReport.getReceivedIds() + "'" + "," +
                        "'" + workReport.getDeptId() + "'" + "," +
                        "'" + workReport.getReplyDeptIds() + "'" + "," +
                        "'" + workReport.getCategory() + "'" + "," +
                        "'" + workReport.getUserId() + "'" + ")";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        } else {
            workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds()));
            if (null==workReport.getReplyTime()){
            if (null == workReport.getReplyTime()) {
                workReport.setReplyTime(new Date());
            }
            //修改
            status = workReportService.updateById(workReport);
            //内网同步
            String s1 =
                "update sys_work_report set type = " + "'" + workReport.getType() + "'" +
                    ",content = " + "'" + workReport.getContent() + "'" +
                    ",work_desc = " + "'" + workReport.getWorkDesc() + "'" +
                    ",received_ids = " + "'" + workReport.getReceivedIds() + "'" +
                    ",reply_content = " + "'" + workReport.getReplyContent() + "'" +
                    ",reply_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(workReport.getReplyTime()) + "'" +
                    ",dept_id = " + "'" + workReport.getDeptId() + "'" +
                    ",reply_dept_ids = " + "'" + workReport.getReplyDeptIds() + "'" +
                    ",category = " + "'" + workReport.getCategory() + "'" +
                    ",user_id = " + "'" + workReport.getUserId() + "'" +
                    " " +"where id = " + "'" + workReport.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
            if (status) {
                //内网同步
                String s1 =
                    "update sys_work_report set type = " + "'" + workReport.getType() + "'" +
                        ",content = " + "'" + workReport.getContent() + "'" +
                        ",work_desc = " + "'" + workReport.getWorkDesc() + "'" +
                        ",received_ids = " + "'" + workReport.getReceivedIds() + "'" +
                        ",reply_content = " + "'" + workReport.getReplyContent() + "'" +
                        ",reply_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(workReport.getReplyTime()) + "'" +
                        ",dept_id = " + "'" + workReport.getDeptId() + "'" +
                        ",reply_dept_ids = " + "'" + workReport.getReplyDeptIds() + "'" +
                        ",category = " + "'" + workReport.getCategory() + "'" +
                        ",user_id = " + "'" + workReport.getUserId() + "'" +
                        " " + "where id = " + "'" + workReport.getId() + "'";
                //FtpUtil.sqlFileUpload(s1);
                myAsyncService.FTP(s1);
            }
        }
        return R.status(status);
    }
    /**
     * 删除
     *
     * @param ids 工作汇报信息ids 数组
     */
    @PostMapping("/remove")
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        //内网删除
        List<Long> list = Func.toLongList(ids);
        list.forEach(id ->{
        list.forEach(id -> {
            //内网同步
            String s1 = "delete from sys_work_report where id = " + "'" + id + "'";
            FtpUtil.sqlFileUpload(s1);
            //FtpUtil.sqlFileUpload(s1);
            myAsyncService.FTP(s1);
        });
        return R.status(workReportService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 详情
     *
     * @param workReport 工作汇报信息对象
     */
    @GetMapping("/detail")
@@ -177,23 +191,24 @@
    /**
     * 获取接收人的单位信息
     *
     * @param detail 汇报详情
     * @return
     */
    private String getReplyDeptName(WorkReportVo detail) {
        if (null!=detail.getReplyDeptIds() && detail.getReplyDeptIds()!="" && !detail.getReplyDeptIds().isEmpty()) {
        if (null != detail.getReplyDeptIds() && detail.getReplyDeptIds() != "" && !detail.getReplyDeptIds().isEmpty()) {
            List<String> replyDeptIds = Arrays.asList(detail.getReplyDeptIds().split(","));
            StringBuilder replyDeptNameInfo = new StringBuilder();
            if (replyDeptIds.size()>0) {
            if (replyDeptIds.size() > 0) {
                for (String deptId : replyDeptIds) {
                    //查询接收人单位信息
                    Dept deptDetail = deptService.getById(Long.parseLong(deptId));
                    if (null!= deptDetail) {
                    if (null != deptDetail) {
                        replyDeptNameInfo = replyDeptNameInfo.append(deptDetail.getDeptName()).append(",");
                    }
                }
                if (replyDeptNameInfo.length()>0) {
                if (replyDeptNameInfo.length() > 0) {
                    //截取
                    return replyDeptNameInfo.substring(0, replyDeptNameInfo.length() - 1);
                }
@@ -204,6 +219,7 @@
    /**
     * 获取接收人的单位id(dept)信息
     *
     * @param
     * @return
     */
@@ -213,14 +229,14 @@
        for (String userId : userIds) {
            //查询接收人单位信息
            User userDetail = userService.getById(userId);
            if (null!=userDetail){
            if (null != userDetail) {
                list.add(userDetail.getDeptId());
            }
        }
        //去重
        List<String> collect = list.stream().distinct().collect(Collectors.toList());
        //截取
        return String.join(",",collect);
        return String.join(",", collect);
    }
    /**
@@ -229,7 +245,7 @@
     * @param detail 汇报详情
     * @return
     */
    private String getReplyRealName(WorkReportVo detail){
    private String getReplyRealName(WorkReportVo detail) {
        List<String> userIds = Arrays.asList(detail.getReceivedIds().split(","));
        StringBuilder replyRealNameInfo = new StringBuilder();
        for (String userId : userIds) {
@@ -238,13 +254,13 @@
//            user.setCardid(idCardNo);
//            User userDetail = userService.getOne(Condition.getQueryWrapper(user));
            User userDetail = userService.getById(userId);
            if(null!=userDetail) {
            if (null != userDetail) {
                replyRealNameInfo = replyRealNameInfo.append(userDetail.getRealName()).append(",");
            }
        }
        //截取
        if (replyRealNameInfo.toString().length()>0) {
        if (replyRealNameInfo.toString().length() > 0) {
            return replyRealNameInfo.substring(0, replyRealNameInfo.length() - 1);
        }
        return null;
src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -42,6 +42,7 @@
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.zc.entity.Zc;
import org.springblade.modules.zc.service.IZcService;
import org.springblade.modules.zc.vo.ZcVO;
@@ -70,6 +71,7 @@
    private IUserService iUserService;
    private final IDeptService deptFeignApi;
    private final MyAsyncService myAsyncService;
    /**
     * 详情
@@ -185,7 +187,8 @@
                "," + "'" + user.getHold() + "'" +
                "," + "'" + user.getExaminationType() + "'" +
                "," + "'" + user.getDispatch() + "'" + ")";
            FtpUtil.sqlFileUpload(s);
            //FtpUtil.sqlFileUpload(s);
            myAsyncService.FTP(s);
        }
        return R.status(zcService.updateById(zc));