智慧保安后台管理-外网-验收版本
Administrator
2021-08-31 08363052cecb30230a2c8b3eba791ca8d1be00a5
二维码生成地址修改,保安证编码生成修改
7 files modified
76 ■■■■ changed files
src/main/java/org/springblade/modules/apply/controller/ApplyController.java 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 4 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/qrcode/QrCodeController.java 4 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 30 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -738,13 +738,13 @@
        //内网同步
        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,user_id,exam_id,apply_id) " +
            "values(" + "'" + sid + "'" + "," + "'" +
            format + "'" + "," + "'" +
            examScore.getUserId() +"'" + ","  +"'" +
            examScore.getExamId() +"'" + ","  +"'" +
            examScore.getApplyId() + "'" + ")";
        FtpUtil.sqlFileUpload(s);
//        String s = "insert into exam_score(id,exam_time,user_id,exam_id,apply_id) " +
//            "values(" + "'" + sid + "'" + "," + "'" +
//            format + "'" + "," + "'" +
//            examScore.getUserId() +"'" + ","  +"'" +
//            examScore.getExamId() +"'" + ","  +"'" +
//            examScore.getApplyId() + "'" + ")";
//        FtpUtil.sqlFileUpload(s);
        return examScore;
    }
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -461,9 +461,9 @@
            apply1.setIsExam(3);
            baseMapper.updateById(apply1);
            String s1 =
                "update sys_apply set is_exam = " + apply1.getIsExam() + " " +"where id = " + "'" + apply1.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
//            String s1 =
//                "update sys_apply set is_exam = " + apply1.getIsExam() + " " +"where id = " + "'" + apply1.getId() + "'";
//            FtpUtil.sqlFileUpload(s1);
        }
        //模拟考
        if (apply.getExamType()==2){
@@ -473,9 +473,9 @@
            trainingRegistration.setIsExam(3);
            trainingRegistrationService.updateById(trainingRegistration);
            String s1 =
                "update sys_training_registration set is_exam = " + trainingRegistration.getIsExam() + " " +"where id = " + "'" + trainingRegistration.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
//            String s1 =
//                "update sys_training_registration set is_exam = " + trainingRegistration.getIsExam() + " " +"where id = " + "'" + trainingRegistration.getId() + "'";
//            FtpUtil.sqlFileUpload(s1);
        }
    }
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -135,14 +135,16 @@
                    //去生成保安证编号
                    String pre = SecurityPaperUtil.getSecurityPaper();
                    //查询当前年份已有的保安证编号
                    int count = userService.getSecurityPaperCount(pre);
                    int max = userService.getSecurityPaperCount(pre);
                    String result = null;
                    if (count == 0) {
                    if (max == 0) {
                        result = pre + "00000";
                    } else {
                        //格式化
                        DecimalFormat decimalFormat = new DecimalFormat("00000");
                        result = pre + (decimalFormat.format(count++));
                        max++;
                        System.out.println("max = " + max);
                        result = pre + (decimalFormat.format(max));
                    }
                    user.setSecuritynumber(result);
                    //发证日期
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -260,7 +260,9 @@
                                } else {
                                    //格式化
                                    DecimalFormat decimalFormat = new DecimalFormat("00000");
                                    result = pre + (decimalFormat.format(count++));
                                    count++;
                                    System.out.println("count = " + count);
                                    result = pre + (decimalFormat.format(count));
                                }
                                user.setSecuritynumber(result);
                                //发证日期
src/main/java/org/springblade/modules/qrcode/QrCodeController.java
@@ -55,6 +55,7 @@
            ResponseEntity<byte[]> aEntity = null;
            try {
                URLEncoder.encode(content,"utf-8");
                System.out.println("content = " + content);
                byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350);
                // Set headers
                final HttpHeaders headers = new HttpHeaders();
@@ -78,7 +79,8 @@
     */
    @GetMapping("/getQrCodeBase64")
    public String getQrCodeBase64(String securityNumber) throws Exception{
        String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html";
//        String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html";
        String url = "http://223.82.109.183:2080/securityInfo.html";
        if (null!=securityNumber) {
            String content = url + "?securityNumber=" + securityNumber;
            byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350);
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -334,9 +334,9 @@
          </if>
    </select>
    <!--查询当前年份已有的保安证编号-->
    <!--查询当前年份已有的保安证编号,取倒数5位的最大值-->
    <select id="getSecurityPaperCount" resultType="java.lang.Integer">
        select count(*) from blade_user
        select ifnull(max(0+RIGHT(securitynumber,5)),0) from blade_user
        where securitynumber like concat('%', #{pre},'%')
    </select>
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -327,20 +327,17 @@
            if (null != userExcel.getHold() && userExcel.getHold() != "") {
                if (userExcel.getHold().equals("是")) {
                    user.setHold("1");
                    //分配保安角色
                    Role role = new Role();
                    role.setRoleAlias("保安");
                    Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
                    user.setRoleId(oneRole.getId().toString());
                }
                if(userExcel.getHold().equals("否")) {
                    user.setHold("2");
                    Role role = new Role();
                    role.setRoleAlias("未持证保安");
                    Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
                    user.setRoleId(oneRole.getId().toString());
                }
            }
            //分配保安角色
            Role role = new Role();
            role.setRoleAlias("保安");
            Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
            user.setRoleId(oneRole.getId().toString());
            //性别
            if (null!=userExcel.getSex()) {
                if (userExcel.getSex().equals("男")) {
                    user.setSex(1);
@@ -572,20 +569,17 @@
            if (null != userExcel.getHold() && userExcel.getHold() != "") {
                if (userExcel.getHold().equals("是")) {
                    user.setHold("1");
                    //分配保安角色
                    Role role = new Role();
                    role.setRoleAlias("保安");
                    Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
                    user.setRoleId(oneRole.getId().toString());
                }
                if(userExcel.getHold().equals("否")) {
                    user.setHold("2");
                    Role role = new Role();
                    role.setRoleAlias("未持证保安");
                    Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
                    user.setRoleId(oneRole.getId().toString());
                }
            }
            //分配保安角色
            Role role = new Role();
            role.setRoleAlias("保安");
            Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
            user.setRoleId(oneRole.getId().toString());
            if (null!=userExcel.getSex()) {
                if (userExcel.getSex().equals("男")) {
                    user.setSex(1);