...
This commit is contained in:
parent
944e6f9284
commit
a1e6e71ebc
@ -413,6 +413,8 @@ public class DataImport
|
||||
String password,
|
||||
ArrayList<TelsalePolicyRecord> policyList )
|
||||
{
|
||||
Connection conn = null;
|
||||
CallableStatement statement = null;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.cpic.util.staff;
|
||||
|
||||
/**
|
||||
* Created by Kane on 2017/3/28.
|
||||
* 准备废弃
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
@ -19,25 +20,26 @@ public class StaffInfo
|
||||
|
||||
private static String oracleURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
||||
|
||||
public StaffInfo(String staffCode) throws
|
||||
StaffCodeNotExistException,
|
||||
public StaffInfo( String staffCode )
|
||||
throws StaffCodeNotExistException,
|
||||
OracleConnectionException,
|
||||
ClassNotFoundException,
|
||||
SQLException
|
||||
{
|
||||
if (staffCode.length() < 3) {
|
||||
throw new StaffCodeNotExistException(staffCode + "不存在。");
|
||||
if ( staffCode.length() < 3 )
|
||||
{
|
||||
throw new StaffCodeNotExistException( staffCode + "不存在。" );
|
||||
}
|
||||
|
||||
//url要改成可配置的
|
||||
//String oracleURL = "jdbc:oracle:thin:@10.187.11.164:1521:xmcx1";
|
||||
//String oracleURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
||||
String oracleURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
||||
String oracleUserName = "idst0";
|
||||
String oraclePassword = "cpic123456";
|
||||
|
||||
this.staffCode = staffCode;
|
||||
|
||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
||||
Class.forName( "oracle.jdbc.driver.OracleDriver" );
|
||||
|
||||
Connection conn = null;
|
||||
PreparedStatement stmt = null;
|
||||
@ -56,32 +58,43 @@ public class StaffInfo
|
||||
" AND ry.department_code = bm.department_code\n" +
|
||||
" AND ry.section_office_code = ksh.section_office_code";
|
||||
|
||||
try {
|
||||
conn = DriverManager.getConnection(oracleURL, oracleUserName, oraclePassword);
|
||||
stmt = conn.prepareStatement(sql);
|
||||
stmt.setString(1, staffCode);
|
||||
try
|
||||
{
|
||||
conn = DriverManager.getConnection( oracleURL, oracleUserName, oraclePassword );
|
||||
stmt = conn.prepareStatement( sql );
|
||||
stmt.setString( 1, staffCode );
|
||||
result = stmt.executeQuery();
|
||||
|
||||
if (result.next()) {
|
||||
staffName = result.getString("staff_name");
|
||||
sectionOfficeCode = result.getString("section_office_code");
|
||||
sectionOfficeName = result.getString("section_office_name");
|
||||
departmentCode = result.getString("department_code");
|
||||
departmentName = result.getString("department_name");
|
||||
if ( result.next() )
|
||||
{
|
||||
staffName = result.getString( "staff_name" );
|
||||
sectionOfficeCode = result.getString( "section_office_code" );
|
||||
sectionOfficeName = result.getString( "section_office_name" );
|
||||
departmentCode = result.getString( "department_code" );
|
||||
departmentName = result.getString( "department_name" );
|
||||
}
|
||||
|
||||
if (staffName.isEmpty() == true) {
|
||||
if ( staffName.isEmpty() == true )
|
||||
{
|
||||
//没查到数据
|
||||
throw new StaffCodeNotExistException("工号" + staffCode + "不存在。");
|
||||
throw new StaffCodeNotExistException( "工号" + staffCode + "不存在。" );
|
||||
}
|
||||
} catch (SQLException error) {
|
||||
throw new OracleConnectionException(error.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null) {
|
||||
}
|
||||
catch ( SQLException error )
|
||||
{
|
||||
throw new OracleConnectionException( error.getMessage() );
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( conn != null )
|
||||
{
|
||||
conn.close();
|
||||
}
|
||||
} catch (SQLException error) {
|
||||
}
|
||||
catch ( SQLException error )
|
||||
{
|
||||
//不处理了
|
||||
}
|
||||
}
|
||||
|
@ -10,16 +10,20 @@ CREATE OR REPLACE PACKAGE telsale_policy_check_pkg IS
|
||||
POLICYNO_NOT_EXIST_EXCEPT_CODE CONSTANT INTEGER := -20000;
|
||||
POLICYNO_NOT_EXIST_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '保单号不存在。';
|
||||
|
||||
--保单号已存在
|
||||
POLICYNO_IS_EXIST_EXCEPT_CODE CONSTANT INTEGER := -20001;
|
||||
POLICYNO_IS_EXIST_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '保单号重复。';
|
||||
|
||||
--经办人不存在
|
||||
OPERATOE_CODE_NOT_EXIST_EXCEPT_CODE CONSTANT INTEGER := -20001;
|
||||
OPERATOE_CODE_NOT_EXIST_EXCEPT_CODE CONSTANT INTEGER := -20002;
|
||||
OPERATOE_CODE_NOT_EXIST_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '经办人工号不存在。';
|
||||
|
||||
--录入人不存在
|
||||
ENTRY_STAFF_CODE_NOT_EXIST_EXCEPT_CODE CONSTANT INTEGER := -20002;
|
||||
ENTRY_STAFF_CODE_NOT_EXIST_EXCEPT_CODE CONSTANT INTEGER := -20003;
|
||||
ENTRY_STAFF_CODE_NOT_EXIST_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '录入人工号不存在。';
|
||||
|
||||
--经办人工号所在科室与保单不匹配
|
||||
OPERATOE_CODE_NOT_MATCH_EXCEPT_CODE CONSTANT INTEGER := -20003;
|
||||
OPERATOE_CODE_NOT_MATCH_EXCEPT_CODE CONSTANT INTEGER := -20004;
|
||||
OPERATOE_CODE_NOT_MATCH_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '经办人工号所在科室与保单归属不匹配。';
|
||||
|
||||
/***************************************************************************/
|
||||
@ -176,6 +180,7 @@ CREATE OR REPLACE PACKAGE BODY telsale_policy_check_pkg IS
|
||||
END IF;
|
||||
|
||||
--没错误后,保存记录
|
||||
BEGIN
|
||||
INSERT INTO telsale.电销保单信息表
|
||||
(保单号,
|
||||
经办人代码,
|
||||
@ -206,6 +211,12 @@ CREATE OR REPLACE PACKAGE BODY telsale_policy_check_pkg IS
|
||||
a_entry_staff_department_code,
|
||||
a_entry_staff_department_name,
|
||||
SYSDATE);
|
||||
EXCEPTION
|
||||
--保单号重复
|
||||
WHEN DUP_VAL_ON_INDEX THEN
|
||||
raise_application_error(POLICYNO_IS_EXIST_EXCEPT_CODE,
|
||||
POLICYNO_IS_EXIST_EXCEPT_TEXT);
|
||||
END;
|
||||
END;
|
||||
|
||||
BEGIN
|
||||
|
@ -4,22 +4,34 @@ PL/SQL Developer Project Desktop
|
||||
SavePath=D:\develop\projects_win\2018\telsale_management_2017\´úÂë\oracle\ÏîÄ¿\
|
||||
|
||||
Index=1
|
||||
Filename=D:\develop\projects_win\2018\telsale_management_2017\´úÂë\oracle\ÏîÄ¿\°ü\telsale_policy_check_pkg.pck
|
||||
VCSDBObject=0
|
||||
Connection=282441544404455840724370446043583456492241804558450434903180323832003290342849744968477032763302336047784788
|
||||
DPI=96
|
||||
Left=0
|
||||
Top=0
|
||||
Width=1329
|
||||
Width=1550
|
||||
Height=719
|
||||
State=0
|
||||
Type=0
|
||||
ChildListIndex=3
|
||||
WindowName=TELSALE.든饋괏데斤口깊@DEV01
|
||||
Pinned=0
|
||||
|
||||
Index=2
|
||||
Filename=D:\develop\projects_win\2018\telsale_management_2017\덜쯤\oracle\淃커\관\telsale_policy_check_pkg.pck
|
||||
VCSDBObject=0
|
||||
Connection=284741774427458141914393448343813479491342034357449534493235319731913185332349975023472932994861479148014811
|
||||
DPI=96
|
||||
Left=0
|
||||
Top=0
|
||||
Width=1550
|
||||
Height=719
|
||||
State=0
|
||||
Type=3
|
||||
ChildListIndex=1
|
||||
Pinned=0
|
||||
|
||||
Index=2
|
||||
Index=3
|
||||
Filename=
|
||||
Connection=226450024772463846324866505249184048433046445054493639223676363836323754389245424568427437403734382438343844
|
||||
Connection=288540874337449141654431439345473389501542414363446935513241329932613223336131153141342348734899482948394721
|
||||
|
||||
[Files]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user