智慧保安后台管理-外网项目备份
src/main/java/org/springblade/modules/dataSync/MysqlCenlint.java
@@ -15,6 +15,7 @@
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
@Component
@@ -85,7 +86,7 @@
   public static void inster(String sql) {
      sqlConnect(sql,2);
      try {
         Thread.sleep(300);
         Thread.sleep(500);
         //对比 sql 字符串,如果是是往用户表里插入保安员数据,则调用公安审查接口
         String insertUserSql = "insert into blade_user";
         if (sql.contains(insertUserSql)){
@@ -145,27 +146,45 @@
                  && res.getJSONObject(i).get("zdrylbjh").toString() != ""
                  && res.getJSONObject(i).get("zdrylbjh").toString() != "null"
               ) {
                  user.setExaminationMx(res.getJSONObject(i).get("zdrylbjh").toString());
//                  user.setExaminationMx(res.getJSONObject(i).get("zdrylbjh").toString());
                  //更新用户数据
                  mysqlCenlint.userService.updateById(user);
                  //同步内网
                  String sql = "update blade_user set examination_type = " + user.getExaminationType() + " "
                     + ",examination_mx = " + "'" + res.getJSONObject(i).get("zdrylbjh").toString() + "'"
                     + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
                     + " " + "where id = " + "'" + user.getId() + "'";
                  update(sql);
                  break;
               }
               if (res.getJSONObject(i).get("zdryxlmc").toString() != null
                  && res.getJSONObject(i).get("zdryxlmc").toString() != ""
                  && res.getJSONObject(i).get("zdryxlmc").toString() != "null"
               ) {
                  user.setExaminationMx(res.getJSONObject(i).get("zdryxlmc").toString());
//                  user.setExaminationMx(res.getJSONObject(i).get("zdryxlmc").toString());
                  //更新用户数据
                  mysqlCenlint.userService.updateById(user);
                  //同步内网
                  String sql = "update blade_user set examination_type = " + user.getExaminationType() + " "
                     + ",examination_mx = " + "'" + res.getJSONObject(i).get("zdryxlmc").toString() + "'"
                     + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
                     + " " + "where id = " + "'" + user.getId() + "'";
                  update(sql);
                  break;
               }
               if (res.getJSONObject(i).get("ztrylx").toString() != null
                  && res.getJSONObject(i).get("ztrylx").toString() != ""
                  && res.getJSONObject(i).get("ztrylx").toString() != "null"
               ) {
                  user.setExaminationMx(res.getJSONObject(i).get("ztrylx").toString());
//                  user.setExaminationMx(res.getJSONObject(i).get("ztrylx").toString());
                  //更新用户数据
                  mysqlCenlint.userService.updateById(user);
                  //同步内网
                  String sql = "update blade_user set examination_type = " + user.getExaminationType() + " "
                     + ",examination_mx = " + "'" + res.getJSONObject(i).get("ztrylx").toString() + "'"
                     + ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'"
                     + " " + "where id = " + "'" + user.getId() + "'";
                  update(sql);
                  break;
               }
//                  if (res.getJSONObject(i).get("ajlbmc").toString() != null