...
This commit is contained in:
parent
944e6f9284
commit
a1e6e71ebc
@ -413,6 +413,8 @@ public class DataImport
|
|||||||
String password,
|
String password,
|
||||||
ArrayList<TelsalePolicyRecord> policyList )
|
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.
|
* Created by Kane on 2017/3/28.
|
||||||
|
* 准备废弃
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -19,25 +20,26 @@ public class StaffInfo
|
|||||||
|
|
||||||
private static String oracleURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
private static String oracleURL = "jdbc:oracle:thin:@10.39.0.86:1521:xmcx1";
|
||||||
|
|
||||||
public StaffInfo(String staffCode) throws
|
public StaffInfo( String staffCode )
|
||||||
StaffCodeNotExistException,
|
throws StaffCodeNotExistException,
|
||||||
OracleConnectionException,
|
OracleConnectionException,
|
||||||
ClassNotFoundException,
|
ClassNotFoundException,
|
||||||
SQLException
|
SQLException
|
||||||
{
|
{
|
||||||
if (staffCode.length() < 3) {
|
if ( staffCode.length() < 3 )
|
||||||
throw new StaffCodeNotExistException(staffCode + "不存在。");
|
{
|
||||||
|
throw new StaffCodeNotExistException( staffCode + "不存在。" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//url要改成可配置的
|
//url要改成可配置的
|
||||||
//String oracleURL = "jdbc:oracle:thin:@10.187.11.164:1521:xmcx1";
|
//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 oracleUserName = "idst0";
|
||||||
String oraclePassword = "cpic123456";
|
String oraclePassword = "cpic123456";
|
||||||
|
|
||||||
this.staffCode = staffCode;
|
this.staffCode = staffCode;
|
||||||
|
|
||||||
Class.forName("oracle.jdbc.driver.OracleDriver");
|
Class.forName( "oracle.jdbc.driver.OracleDriver" );
|
||||||
|
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
@ -56,32 +58,43 @@ public class StaffInfo
|
|||||||
" AND ry.department_code = bm.department_code\n" +
|
" AND ry.department_code = bm.department_code\n" +
|
||||||
" AND ry.section_office_code = ksh.section_office_code";
|
" AND ry.section_office_code = ksh.section_office_code";
|
||||||
|
|
||||||
try {
|
try
|
||||||
conn = DriverManager.getConnection(oracleURL, oracleUserName, oraclePassword);
|
{
|
||||||
stmt = conn.prepareStatement(sql);
|
conn = DriverManager.getConnection( oracleURL, oracleUserName, oraclePassword );
|
||||||
stmt.setString(1, staffCode);
|
stmt = conn.prepareStatement( sql );
|
||||||
|
stmt.setString( 1, staffCode );
|
||||||
result = stmt.executeQuery();
|
result = stmt.executeQuery();
|
||||||
|
|
||||||
if (result.next()) {
|
if ( result.next() )
|
||||||
staffName = result.getString("staff_name");
|
{
|
||||||
sectionOfficeCode = result.getString("section_office_code");
|
staffName = result.getString( "staff_name" );
|
||||||
sectionOfficeName = result.getString("section_office_name");
|
sectionOfficeCode = result.getString( "section_office_code" );
|
||||||
departmentCode = result.getString("department_code");
|
sectionOfficeName = result.getString( "section_office_name" );
|
||||||
departmentName = result.getString("department_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());
|
catch ( SQLException error )
|
||||||
} finally {
|
{
|
||||||
try {
|
throw new OracleConnectionException( error.getMessage() );
|
||||||
if (conn != null) {
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if ( conn != null )
|
||||||
|
{
|
||||||
conn.close();
|
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_CODE CONSTANT INTEGER := -20000;
|
||||||
POLICYNO_NOT_EXIST_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '保单号不存在。';
|
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) := '经办人工号不存在。';
|
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) := '录入人工号不存在。';
|
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) := '经办人工号所在科室与保单归属不匹配。';
|
OPERATOE_CODE_NOT_MATCH_EXCEPT_TEXT CONSTANT VARCHAR2(100) := '经办人工号所在科室与保单归属不匹配。';
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
@ -176,36 +180,43 @@ CREATE OR REPLACE PACKAGE BODY telsale_policy_check_pkg IS
|
|||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
--没错误后,保存记录
|
--没错误后,保存记录
|
||||||
INSERT INTO telsale.电销保单信息表
|
BEGIN
|
||||||
(保单号,
|
INSERT INTO telsale.电销保单信息表
|
||||||
经办人代码,
|
(保单号,
|
||||||
经办人名称,
|
经办人代码,
|
||||||
经办人科室代码,
|
经办人名称,
|
||||||
经办人科室名称,
|
经办人科室代码,
|
||||||
经办人部门代码,
|
经办人科室名称,
|
||||||
经办人部门名称,
|
经办人部门代码,
|
||||||
操作员代码,
|
经办人部门名称,
|
||||||
操作员名称,
|
操作员代码,
|
||||||
操作员科室代码,
|
操作员名称,
|
||||||
操作员科室名称,
|
操作员科室代码,
|
||||||
操作员部门代码,
|
操作员科室名称,
|
||||||
操作员部门名称,
|
操作员部门代码,
|
||||||
操作日期)
|
操作员部门名称,
|
||||||
VALUES
|
操作日期)
|
||||||
(a_policy_no,
|
VALUES
|
||||||
a_operator_code,
|
(a_policy_no,
|
||||||
a_operator_name,
|
a_operator_code,
|
||||||
a_operator_sectionoffice_code,
|
a_operator_name,
|
||||||
a_operator_sectionoffice_name,
|
a_operator_sectionoffice_code,
|
||||||
a_operator_department_code,
|
a_operator_sectionoffice_name,
|
||||||
a_operator_department_name,
|
a_operator_department_code,
|
||||||
a_entry_staff_code,
|
a_operator_department_name,
|
||||||
a_entry_staff_name,
|
a_entry_staff_code,
|
||||||
a_entry_staff_sectionoffice_code,
|
a_entry_staff_name,
|
||||||
a_entry_staff_sectionoffice_name,
|
a_entry_staff_sectionoffice_code,
|
||||||
a_entry_staff_department_code,
|
a_entry_staff_sectionoffice_name,
|
||||||
a_entry_staff_department_name,
|
a_entry_staff_department_code,
|
||||||
SYSDATE);
|
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;
|
END;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -4,22 +4,34 @@ PL/SQL Developer Project Desktop
|
|||||||
SavePath=D:\develop\projects_win\2018\telsale_management_2017\´úÂë\oracle\ÏîÄ¿\
|
SavePath=D:\develop\projects_win\2018\telsale_management_2017\´úÂë\oracle\ÏîÄ¿\
|
||||||
|
|
||||||
Index=1
|
Index=1
|
||||||
Filename=D:\develop\projects_win\2018\telsale_management_2017\´úÂë\oracle\ÏîÄ¿\°ü\telsale_policy_check_pkg.pck
|
|
||||||
VCSDBObject=0
|
|
||||||
Connection=282441544404455840724370446043583456492241804558450434903180323832003290342849744968477032763302336047784788
|
|
||||||
DPI=96
|
DPI=96
|
||||||
Left=0
|
Left=0
|
||||||
Top=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
|
Height=719
|
||||||
State=0
|
State=0
|
||||||
Type=3
|
Type=3
|
||||||
ChildListIndex=1
|
ChildListIndex=1
|
||||||
Pinned=0
|
Pinned=0
|
||||||
|
|
||||||
Index=2
|
Index=3
|
||||||
Filename=
|
Filename=
|
||||||
Connection=226450024772463846324866505249184048433046445054493639223676363836323754389245424568427437403734382438343844
|
Connection=288540874337449141654431439345473389501542414363446935513241329932613223336131153141342348734899482948394721
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user