|
@@ -115,28 +115,6 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
|
|
//用来过滤权限的时候使用,当过滤的code已在其中的时候就不进行过滤;
|
|
//用来过滤权限的时候使用,当过滤的code已在其中的时候就不进行过滤;
|
|
private Set<String> businessCodes;
|
|
private Set<String> businessCodes;
|
|
|
|
|
|
-
|
|
|
|
- Connection coon = null;
|
|
|
|
- Connection coon1 = null;
|
|
|
|
- @Value("com.mysql.jdbc.Driver")
|
|
|
|
- private String driverClassName;
|
|
|
|
- @Value("jdbc:mysql://47.100.3.209:3306/talk-portal?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true")
|
|
|
|
- private String url;
|
|
|
|
- @Value("root")
|
|
|
|
- private String username;
|
|
|
|
- @Value("Ccj841968545")
|
|
|
|
- private String password;
|
|
|
|
- @Value("wxce2e964b11803018")
|
|
|
|
- private String gzhAppId;
|
|
|
|
- @Value("122059c777309ff3efc7448ec8794fd5")
|
|
|
|
- private String gzhAppSecret;
|
|
|
|
- @Value("jdbc:mysql://47.100.3.209:3306/talk-core?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true")
|
|
|
|
- private String url1;
|
|
|
|
- @Value("root")
|
|
|
|
- private String username1;
|
|
|
|
- @Value("Ccj841968545")
|
|
|
|
- private String password1;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 注册
|
|
* 注册
|
|
*
|
|
*
|
|
@@ -473,9 +451,6 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (commonUser.getPhone() != null) {
|
|
if (commonUser.getPhone() != null) {
|
|
- DBConnection();
|
|
|
|
- String sUserId = null;
|
|
|
|
- String password = null;
|
|
|
|
this.updateById(userDO);
|
|
this.updateById(userDO);
|
|
}
|
|
}
|
|
//返回用户DTO
|
|
//返回用户DTO
|
|
@@ -579,9 +554,6 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
|
|
userDO.setCid(commonUser.getCid());
|
|
userDO.setCid(commonUser.getCid());
|
|
}
|
|
}
|
|
if (commonUser.getPhone() != null) {
|
|
if (commonUser.getPhone() != null) {
|
|
- DBConnection();
|
|
|
|
- String sUserId = null;
|
|
|
|
- password = null;
|
|
|
|
this.updateById(userDO);
|
|
this.updateById(userDO);
|
|
}
|
|
}
|
|
//返回用户DTO
|
|
//返回用户DTO
|
|
@@ -619,138 +591,6 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
|
|
return user;
|
|
return user;
|
|
}
|
|
}
|
|
|
|
|
|
- public void DBConnection() {
|
|
|
|
- try {
|
|
|
|
- //加载驱动程序
|
|
|
|
- Class.forName(driverClassName);
|
|
|
|
- coon = (Connection) DriverManager.getConnection(url, username, password);
|
|
|
|
- if (!coon.isClosed()) {
|
|
|
|
- System.out.println("成功连接数据库!");
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 查询s_user表
|
|
|
|
- public String excSelect2(String sql, Connection coon) {
|
|
|
|
- try {
|
|
|
|
- Statement stmt = (Statement) coon.createStatement();
|
|
|
|
- ResultSet rs = (ResultSet) stmt.executeQuery(sql);//得到的是结果的集合
|
|
|
|
-
|
|
|
|
- while (rs.next()) {
|
|
|
|
- String id = rs.getString("ID");
|
|
|
|
- if (id != null && !id.isEmpty()) {
|
|
|
|
- return id;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- stmt.close();
|
|
|
|
- return null;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 增加数据
|
|
|
|
- public void excInsert(String sql, Connection coon) {
|
|
|
|
- try {
|
|
|
|
- PreparedStatement preStmt = (PreparedStatement) coon.prepareStatement(sql);
|
|
|
|
- preStmt.executeUpdate();
|
|
|
|
- System.out.println("插入数据成功!");
|
|
|
|
- preStmt.close();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- System.out.println("粮信插入数据异常!");
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 查询t_user表
|
|
|
|
- public String excSelect1(String sql, Connection coon) {
|
|
|
|
- try {
|
|
|
|
- Statement stmt = (Statement) coon.createStatement();
|
|
|
|
- ResultSet rs = (ResultSet) stmt.executeQuery(sql);//得到的是结果的集合
|
|
|
|
-
|
|
|
|
- while (rs.next()) {
|
|
|
|
- String id = rs.getString("OPER_ID");
|
|
|
|
- if (id != null && !id.isEmpty()) {
|
|
|
|
- return id;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- stmt.close();
|
|
|
|
- return null;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void close() {
|
|
|
|
- try {
|
|
|
|
- this.coon.close();
|
|
|
|
- System.out.println("成功关闭数据库连接!");
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- System.out.println("关闭数据库连接异常!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void close1() {
|
|
|
|
- try {
|
|
|
|
- this.coon1.close();
|
|
|
|
- System.out.println("成功关闭数据库连接!");
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- System.out.println("关闭数据库连接异常!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 更改数据
|
|
|
|
- public void excUpdate(String sql, Connection coon) {
|
|
|
|
- try {
|
|
|
|
- PreparedStatement prestmt = (PreparedStatement) coon.prepareStatement(sql);
|
|
|
|
- prestmt.executeUpdate();
|
|
|
|
- System.out.println("更改数据成功!");
|
|
|
|
- prestmt.close();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- System.out.println("粮信更改数据异常!");
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 查询t_user表
|
|
|
|
- public Long excSelect(String sql, Connection coon) {
|
|
|
|
- try {
|
|
|
|
- Statement stmt = (Statement) coon.createStatement();
|
|
|
|
- ResultSet rs = (ResultSet) stmt.executeQuery(sql);//得到的是结果的集合
|
|
|
|
-
|
|
|
|
- while (rs.next()) {
|
|
|
|
- Long name = rs.getLong("USER_ID");
|
|
|
|
- if (name != null && name > 0) {
|
|
|
|
- return name;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- stmt.close();
|
|
|
|
- return -1l;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- return -1l;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void DBConnection1() {
|
|
|
|
- try {
|
|
|
|
- //加载驱动程序
|
|
|
|
- Class.forName(driverClassName);
|
|
|
|
- coon1 = (Connection) DriverManager.getConnection(url1, username1, password1);
|
|
|
|
- if (!coon1.isClosed()) {
|
|
|
|
- System.out.println("成功连接数据库!");
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 验证码抽取校验
|
|
* 验证码抽取校验
|
|
*
|
|
*
|