钟日健
2022-04-29 6e32e696a686b3b70920f9a0e9236b120bc5036f
保安员审查修改,审查完毕将结果同步到外网
1 files modified
17 ■■■■ changed files
src/main/java/org/springblade/modules/FTP/MyAsyncService.java 17 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/MyAsyncService.java
@@ -37,6 +37,7 @@
     * FTP
     * @param s sql语句
     */
    @Async
    public void FTP(String s) {
        FtpUtil.sqlFileUpload(s);
    }
@@ -52,7 +53,7 @@
        if (user0.getRoleId().equals("1412226235153731586")){
            //创建用户对象
            User user = new User();
            user.setId(user.getId());
            user.setId(user0.getId());
            //远程调用接口
            String body = InvestigateUtil.httpGetOne(user0.getCardid());
            JSONObject jsonObject = new JSONObject(body);
@@ -61,6 +62,7 @@
            JSONArray res = jsonData.getJSONArray("res");
            //设置审核时间
            user.setAuditTime(new Date());
            //如果有结果返回
            if (res.length() == 0) {
                //没有数据正常
                user.setExaminationType("0");
@@ -74,7 +76,7 @@
                    ) {
                        user.setExaminationMx(res.getJSONObject(i).get("zdrylbjh").toString());
                        //更新用户数据
                        userService.updateById(user);
//                        userService.updateById(user);
                        break;
                    }
                    if (res.getJSONObject(i).get("zdryxlmc").toString() != null
@@ -83,7 +85,7 @@
                    ) {
                        user.setExaminationMx(res.getJSONObject(i).get("zdryxlmc").toString());
                        //更新用户数据
                        userService.updateById(user);
//                        userService.updateById(user);
                        break;
                    }
                    if (res.getJSONObject(i).get("ztrylx").toString() != null
@@ -92,7 +94,7 @@
                    ) {
                        user.setExaminationMx(res.getJSONObject(i).get("ztrylx").toString());
                        //更新用户数据
                        userService.updateById(user);
//                        userService.updateById(user);
                        break;
                    }
                    count++;
@@ -100,12 +102,17 @@
                    if (count==res.length()){
                        //更新用户数据,设为正常
                        user.setExaminationType("0");
                        userService.updateById(user);
//                        userService.updateById(user);
                    }
                }
            }
            //更新用户数据
            userService.updateById(user);
            //同时更新外网用户信息
            String s1 = "update blade_user set examination_type = " + user.getExaminationType() +
                ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getUpdateTime()) + "'" +
                " where id = " + "'" + user.getId() + "'";
            FTP(s1);
        }
    }