Compare commits
No commits in common. "53093875ebd87cf25be2ba16c731e9d5fff12574" and "ef4874962ef786254a24b0e0dd76681bec02235b" have entirely different histories.
53093875eb
...
ef4874962e
@ -2,209 +2,19 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-12-15 14:08:28
|
* @Date: 2022-12-15 14:08:28
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2022-12-16 17:57:06
|
* @LastEditTime: 2022-12-15 15:27:53
|
||||||
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\myutils\account\CpicXIMStaffInfo.java
|
* @FilePath: \AdminSys\src\main\java\com\cpicxim\myutils\account\CpicXIMStaffInfo.java
|
||||||
* @Description: 产险厦门分公司员工信息对象
|
* @Description: 产险厦门分公司员工信息对象
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
package com.cpic.xim.myutils.account;
|
package com.cpic.xim.myutils.account;
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
|
|
||||||
/*****************************************************
|
|
||||||
* 厦门太保员工信息
|
|
||||||
* 使用工厂函数创建。
|
|
||||||
*****************************************************/
|
|
||||||
public class CpicXIMStaffInfo
|
public class CpicXIMStaffInfo
|
||||||
{
|
{
|
||||||
/*****************************************************
|
|
||||||
* 查询员工信息
|
|
||||||
* @param uidOrCode p13账号或p09账号
|
|
||||||
* @return 员工信息对象
|
|
||||||
*****************************************************/
|
|
||||||
public static CpicXIMStaffInfo getStaffInfo( String uidOrCode )
|
|
||||||
throws SQLException, ClassNotFoundException
|
|
||||||
{
|
|
||||||
CpicXIMStaffInfo info = null;
|
|
||||||
|
|
||||||
Connection connection = null;
|
|
||||||
PreparedStatement stmt = null;
|
|
||||||
ResultSet result = null;
|
|
||||||
|
|
||||||
String jdbcURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
|
||||||
String userName = "dataex";
|
|
||||||
String password = "cpic123456";
|
|
||||||
String querySQL = "SELECT ry.staff_code,ry.staff_name,ry.p13uid,"
|
|
||||||
+ " ry.department_code, bm.department_name,"
|
|
||||||
+ " ry.section_office_code,ks.section_office_name "
|
|
||||||
+ " FROM idst0.rydm_t ry,idst0.ks_t ks,idst0.bm_t bm "
|
|
||||||
+ " WHERE ry.account_status = 0 AND (ry.staff_code = ? OR ry.p13uid = ?) "
|
|
||||||
+ " and ry.section_office_code = ks.section_office_code "
|
|
||||||
+ " and ry.department_code = bm.department_code ";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Class.forName( "oracle.jdbc.driver.OracleDriver" );
|
|
||||||
|
|
||||||
connection = DriverManager.getConnection( jdbcURL, userName, password );
|
|
||||||
stmt = connection.prepareStatement( querySQL );
|
|
||||||
stmt.setString( 1, uidOrCode );
|
|
||||||
stmt.setString( 2, uidOrCode );
|
|
||||||
|
|
||||||
result = stmt.executeQuery();
|
|
||||||
|
|
||||||
if ( result.next())
|
|
||||||
{
|
|
||||||
info = new CpicXIMStaffInfo();
|
|
||||||
|
|
||||||
info.code = result.getString( 1 );
|
|
||||||
info.name = result.getString( 2 );
|
|
||||||
info.p13UID = result.getString( 3 );
|
|
||||||
info.departmentCode = result.getString( 4 );
|
|
||||||
info.departmentName = result.getString( 5 );
|
|
||||||
info.sectionOfficeCode = result.getString( 6 );
|
|
||||||
info.setctionOfficeName = result.getString( 7 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( result != null)
|
|
||||||
{
|
|
||||||
result.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch ( Exception exception )
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( stmt != null)
|
|
||||||
{
|
|
||||||
stmt.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch ( Exception exception )
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( connection != null)
|
|
||||||
{
|
|
||||||
connection.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch ( Exception exception )
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private CpicXIMStaffInfo()
|
|
||||||
{}
|
|
||||||
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName( String name )
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode()
|
|
||||||
{
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCode( String code )
|
|
||||||
{
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getP13UID()
|
|
||||||
{
|
|
||||||
return p13UID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setP13UID( String p13uid )
|
|
||||||
{
|
|
||||||
p13UID = p13uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDepartmentCode()
|
|
||||||
{
|
|
||||||
return departmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDepartmentCode( String departmentCode )
|
|
||||||
{
|
|
||||||
this.departmentCode = departmentCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDepartmentName()
|
|
||||||
{
|
|
||||||
return departmentName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDepartmentName( String departmentName )
|
|
||||||
{
|
|
||||||
this.departmentName = departmentName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSectionOfficeCode()
|
|
||||||
{
|
|
||||||
return sectionOfficeCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSectionOfficeCode( String sectionOfficeCode )
|
|
||||||
{
|
|
||||||
this.sectionOfficeCode = sectionOfficeCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSetctionOfficeName()
|
|
||||||
{
|
|
||||||
return setctionOfficeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSetctionOfficeName( String setctionOfficeName )
|
|
||||||
{
|
|
||||||
this.setctionOfficeName = setctionOfficeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonProperty( "name")
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@JsonProperty( "code")
|
|
||||||
private String code;
|
private String code;
|
||||||
|
private String p13Code;
|
||||||
@JsonProperty( "p13uid")
|
|
||||||
private String p13UID;
|
|
||||||
|
|
||||||
@JsonProperty( "department_code")
|
|
||||||
private String departmentCode;
|
private String departmentCode;
|
||||||
|
|
||||||
@JsonProperty( "department_name")
|
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
|
|
||||||
@JsonProperty( "section_office_code")
|
|
||||||
private String sectionOfficeCode;
|
|
||||||
|
|
||||||
@JsonProperty( "section_office_name")
|
|
||||||
private String setctionOfficeName;
|
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-12-15 09:51:12
|
* @Date: 2022-12-15 09:51:12
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2022-12-16 15:29:34
|
* @LastEditTime: 2022-12-16 10:57:38
|
||||||
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\myutils\account\LdapAccountCheck.java
|
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\myutils\account\LdapAccountCheck.java
|
||||||
* @Description: P13验证相关方法。
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
@ -21,12 +21,6 @@ public class LdapAccountCheck
|
|||||||
{
|
{
|
||||||
private static String ldapServerUrl = "ldap://10.39.0.205:389";
|
private static String ldapServerUrl = "ldap://10.39.0.205:389";
|
||||||
|
|
||||||
/*****************************************************
|
|
||||||
* 对p13账号密码提交AD域服务器进行验证
|
|
||||||
* @param userName p13uid
|
|
||||||
* @param password p13密码
|
|
||||||
* @return 返回验证结果,true为成功,false失败。
|
|
||||||
*****************************************************/
|
|
||||||
public static boolean ldapLogin( String userName, String password )
|
public static boolean ldapLogin( String userName, String password )
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: Kane
|
* @Author: Kane
|
||||||
* @Date: 2022-12-15 11:11:21
|
* @Date: 2022-12-15 11:11:21
|
||||||
* @LastEditors: Kane
|
* @LastEditors: Kane
|
||||||
* @LastEditTime: 2022-12-16 15:25:23
|
* @LastEditTime: 2022-12-16 10:17:24
|
||||||
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\web\controllers\account\P13AccountCheckController.java
|
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\web\controllers\account\P13AccountCheckController.java
|
||||||
* @Description: P13账号验证用Controller。
|
* @Description: P13账号验证用Controller。
|
||||||
*
|
*
|
||||||
@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping( path = "/account")
|
@RequestMapping( path = "/account")
|
||||||
@SuppressWarnings( "unused")
|
|
||||||
public class P13AccountCheckController
|
public class P13AccountCheckController
|
||||||
{
|
{
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user