Changes made to support Bulk Load.
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3255 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
54
Modules/MIP_DIRLIST.jsp
Normal file
54
Modules/MIP_DIRLIST.jsp
Normal file
@@ -0,0 +1,54 @@
|
||||
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED DirList AS
|
||||
import java.io.*;
|
||||
import java.sql.*;
|
||||
import java.util.Date;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
|
||||
public class DirList
|
||||
{
|
||||
public static void getList(String directory)
|
||||
throws SQLException
|
||||
{
|
||||
File path = new File( directory );
|
||||
String[] list = path.list();
|
||||
String element;
|
||||
|
||||
for(int i = 0; i < list.length; i++)
|
||||
{
|
||||
element = list[i];
|
||||
|
||||
|
||||
String fpath=directory+"/"+list[i];
|
||||
|
||||
File f = new File(fpath);
|
||||
|
||||
long len;
|
||||
Date date;
|
||||
|
||||
String ftype;
|
||||
String sqldate;
|
||||
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss");
|
||||
|
||||
if (f.isFile()) {
|
||||
|
||||
len = f.length();
|
||||
date = new Date(f.lastModified());
|
||||
sqldate = df.format(date) ;
|
||||
ftype = "F";
|
||||
|
||||
} else {
|
||||
|
||||
len = 0;
|
||||
sqldate = null;
|
||||
ftype = "D";
|
||||
}
|
||||
|
||||
#sql { INSERT INTO GTT_DIR_LIST (FILENAME, filelength, filetype, filemodified)
|
||||
VALUES (:element, :len, :ftype, to_date(:sqldate,'YYYY-MM-DD HH24:MI:SS')) };
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/
|
||||
@@ -3,16 +3,14 @@ set define off
|
||||
|
||||
@@gen_mandatory.prc
|
||||
|
||||
begin
|
||||
gen_mandatory;
|
||||
end;
|
||||
/
|
||||
exec gen_mandatory
|
||||
|
||||
@@mip_mandatory.pck
|
||||
|
||||
@@mip_files.pck
|
||||
@@mip_security.pck
|
||||
@@mip_parties.pck
|
||||
@@mip_quotation_document.pck
|
||||
@@mip_quotation.pck
|
||||
@@mip_enquiry.pck
|
||||
@@mip_regions.pck
|
||||
@@ -20,6 +18,8 @@ end;
|
||||
@@cout_err.pck
|
||||
@@cout_system_configuration.pck
|
||||
@@mip_contact_details.pck
|
||||
@@mip_dirlist.jsp
|
||||
@@get_quote_items.fnc
|
||||
|
||||
exit
|
||||
@@mip_bulk_Load.pck
|
||||
@@compile.sql
|
||||
exit
|
||||
|
||||
31
Modules/compile.sql
Normal file
31
Modules/compile.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
set define on
|
||||
|
||||
PROMPT *
|
||||
PROMPT * Compile Schema
|
||||
|
||||
exec dbms_utility.compile_schema(USER)
|
||||
|
||||
SET SCAN ON
|
||||
SET DEFINE ON
|
||||
SET ARRAYSIZE 1
|
||||
SET FEEDBACK OFF
|
||||
SET LINESIZE 116
|
||||
SET PAGESIZE 50
|
||||
|
||||
SET SERVEROUTPUT ON
|
||||
|
||||
COLUMN LABEL NEW_VALUE LABEL_VALUE NOPRINT
|
||||
COLUMN RTYPE NOPRINT
|
||||
COLUMN SEQ NOPRINT
|
||||
COLUMN TEXT FORMAT A70 TRUNCATE
|
||||
COLUMN TYPE FORMAT A2
|
||||
COLUMN COL FORMAT A3
|
||||
COLUMN DLINE FORMAT 99999 HEADING LINE
|
||||
COLUMN ELINE NOPRINT
|
||||
|
||||
DEFINE LABEL_VALUE = "There were no errors"
|
||||
REM Create the compilation report
|
||||
TTITLE SKIP 2 CENTER 'COMPILATION REPORT' SKIP 1
|
||||
SET HEADING OFF
|
||||
SELECT NULL FROM DUAL
|
||||
/
|
||||
3
Modules/get_dir_list.prc
Normal file
3
Modules/get_dir_list.prc
Normal file
@@ -0,0 +1,3 @@
|
||||
CREATE OR REPLACE PROCEDURE get_dir_list(p_directory IN VARCHAR2) AS
|
||||
LANGUAGE JAVA NAME 'DirList.getList( java.lang.String )';
|
||||
/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,41 @@ CREATE OR REPLACE PACKAGE mip_quotation IS
|
||||
%param p_id the id of the enquiry to be checked
|
||||
*/
|
||||
PROCEDURE produce_quotes(p_id IN enquiries.id%TYPE);
|
||||
|
||||
/** Accept a quote
|
||||
%param p_qute_id id of the quote to be accepted
|
||||
%param p_description optional description to be recorded with the event
|
||||
%param p_event_date optional date for this event (defaults to now)
|
||||
*/
|
||||
PROCEDURE accept_quote(p_qute_id IN quotes.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE);
|
||||
/** Reject a quote
|
||||
%param p_qute_id id of the quote to be rejected
|
||||
%param p_description optional description to be recorded with the event
|
||||
%param p_event_date optional date for this event (defaults to now)
|
||||
*/
|
||||
PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE);
|
||||
|
||||
/** Reject all quotes associated with enquiry
|
||||
%param p_enqu_id id of the enquiry for qhich all quotes are to be rejected
|
||||
%param p_description optional description to be recorded with the event
|
||||
%param p_event_date optional date for this event (defaults to now)
|
||||
*/
|
||||
PROCEDURE reject_all_quotes(p_enqu_id IN enquiries.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE);
|
||||
/** Select a quote for detailed quotation
|
||||
%param p_qute_id id of the quote to be selected
|
||||
%param p_description optional description to be recorded with the event
|
||||
%param p_event_date optional date for this event (defaults to now)
|
||||
*/
|
||||
PROCEDURE select_quote(p_qute_id IN quotes.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE);
|
||||
|
||||
END mip_quotation;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
@@ -53,6 +88,71 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
,cost_price costs.cost_price%TYPE
|
||||
,delivery_cost costs.delivery_cost%TYPE);
|
||||
|
||||
PROCEDURE add_quote_event(p_qute_id IN quotes.id%TYPE
|
||||
,p_qust_code quote_statuses.code%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date DATE DEFAULT SYSDATE) IS
|
||||
BEGIN
|
||||
NULL; --IF p_qust_code = 'ACCEPTED' THEN;
|
||||
END add_quote_event;
|
||||
|
||||
PROCEDURE accept_quote(p_qute_id IN quotes.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE) IS
|
||||
BEGIN
|
||||
add_quote_event(p_qute_id => p_qute_id
|
||||
,p_qust_code => 'ACCEPTED'
|
||||
,p_event_date => p_event_date
|
||||
,p_description => p_description);
|
||||
|
||||
END accept_quote;
|
||||
|
||||
PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE) IS
|
||||
BEGIN
|
||||
add_quote_event(p_qute_id => p_qute_id
|
||||
,p_qust_code => 'REJECTED'
|
||||
,p_event_date => p_event_date
|
||||
,p_description => p_description);
|
||||
END reject_quote;
|
||||
|
||||
PROCEDURE reject_all_quotes(p_enqu_id IN enquiries.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE) IS
|
||||
BEGIN
|
||||
FOR l_rec IN (SELECT id
|
||||
FROM quotes
|
||||
WHERE enqu_id = p_enqu_id) LOOP
|
||||
add_quote_event(p_qute_id => l_rec.id
|
||||
,p_qust_code => 'REJECTED'
|
||||
,p_event_date => p_event_date
|
||||
,p_description => p_description);
|
||||
END LOOP;
|
||||
END reject_all_quotes;
|
||||
|
||||
PROCEDURE select_quote(p_qute_id IN quotes.id%TYPE
|
||||
,p_description quote_events.description%TYPE DEFAULT NULL
|
||||
,p_event_date IN DATE DEFAULT SYSDATE) IS
|
||||
BEGIN
|
||||
add_quote_event(p_qute_id => p_qute_id
|
||||
,p_qust_code => 'SELECTED'
|
||||
,p_event_date => p_event_date
|
||||
,p_description => p_description);
|
||||
|
||||
FOR l_rec IN (SELECT id
|
||||
FROM quotes
|
||||
WHERE enqu_id = (SELECT enqu_id
|
||||
FROM quotes
|
||||
WHERE id = p_qute_id)
|
||||
AND id <> p_qute_id) LOOP
|
||||
add_quote_event(p_qute_id => l_rec.id
|
||||
,p_qust_code => 'SELREJ'
|
||||
,p_event_date => p_event_date);
|
||||
END LOOP;
|
||||
|
||||
END select_quote;
|
||||
|
||||
PROCEDURE request_manual_quote(p_enqu_id IN enquiries.id%TYPE) IS
|
||||
l_qute_id quotes.id%TYPE;
|
||||
BEGIN
|
||||
@@ -576,8 +676,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
|
||||
AND modu.outlet_pressure =
|
||||
p_enqu.required_metering_pressure
|
||||
AND metr.code = modu.metr_code
|
||||
AND metr.qmax >= p_enqu.qmax
|
||||
) LOOP
|
||||
AND metr.qmax >= p_enqu.qmax) LOOP
|
||||
l_this_is_automatic_quote := TRUE;
|
||||
add_quote_reason(p_enqu.id
|
||||
,p_reason => 'Considering module : ' ||
|
||||
|
||||
Reference in New Issue
Block a user