Modules/mip_helper_special_cases.pck - correction to rule OM-4
Modules/mip_quotation.pck - add prty_id and owner_prty_id to quote status procedures to record the relevant roles. Add debug routine 'pl' to write a log file of processing. Tidy-up email wording. Modules/mip_regions.pck - convert given postcode to uppercase before processing. Modules/mip_virus_check.pck - started work on the virus checking module. So far, just have the ability to write a document to the filesystem. Added new directory, 'WEBMIP_VIRUS' to store these files in. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3381 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -55,7 +55,7 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
|
|||||||
IF p_rec.enty_code IN
|
IF p_rec.enty_code IN
|
||||||
('INSTALL', 'STD INSTALL')
|
('INSTALL', 'STD INSTALL')
|
||||||
AND
|
AND
|
||||||
(p_rec.required_ip_mbar IS NULL AND p_rec.required_ip_details IS NULL) THEN
|
(p_rec.mprn IS NULL AND p_rec.mprn_alt IS NULL) THEN
|
||||||
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
|
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
|
||||||
,p_field_name => 'MPRN'
|
,p_field_name => 'MPRN'
|
||||||
,p_error_message => 'Either MPRN or Additional Information must be completed.');
|
,p_error_message => 'Either MPRN or Additional Information must be completed.');
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -81,22 +81,23 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
FUNCTION valid_postcode_format(p_postcode IN VARCHAR2) RETURN BOOLEAN IS
|
FUNCTION valid_postcode_format(p_postcode IN VARCHAR2) RETURN BOOLEAN IS
|
||||||
l_return BOOLEAN := TRUE;
|
l_return BOOLEAN := TRUE;
|
||||||
l_postcode_format VARCHAR2(8);
|
l_postcode_format VARCHAR2(8);
|
||||||
|
l_postcode VARCHAR2(80) := upper(p_postcode);
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
IF p_postcode = 'GIR 0AA' THEN
|
IF l_postcode = 'GIR 0AA' THEN
|
||||||
l_return := TRUE;
|
l_return := TRUE;
|
||||||
ELSIF length(p_postcode) NOT IN (6
|
ELSIF length(l_postcode) NOT IN (6
|
||||||
,7
|
,7
|
||||||
,8) THEN
|
,8) THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
ELSE
|
ELSE
|
||||||
l_postcode_format := reformat_postcode_string(p_postcode);
|
l_postcode_format := reformat_postcode_string(l_postcode);
|
||||||
|
|
||||||
IF l_postcode_format IS NULL THEN
|
IF l_postcode_format IS NULL THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
ELSE
|
ELSE
|
||||||
IF instr('QVX'
|
IF instr('QVX'
|
||||||
,substr(p_postcode
|
,substr(l_postcode
|
||||||
,1
|
,1
|
||||||
,1)) > 0 THEN
|
,1)) > 0 THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
@@ -104,7 +105,7 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
,2
|
,2
|
||||||
,1) = 'A'
|
,1) = 'A'
|
||||||
AND instr('IJZ'
|
AND instr('IJZ'
|
||||||
,substr(p_postcode
|
,substr(l_postcode
|
||||||
,2
|
,2
|
||||||
,1)) > 0 THEN
|
,1)) > 0 THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
@@ -112,7 +113,7 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
,3
|
,3
|
||||||
,1) = 'A'
|
,1) = 'A'
|
||||||
AND instr('ABCDEFGHJKSTUW'
|
AND instr('ABCDEFGHJKSTUW'
|
||||||
,substr(p_postcode
|
,substr(l_postcode
|
||||||
,3
|
,3
|
||||||
,1)) = 0 THEN
|
,1)) = 0 THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
@@ -120,7 +121,7 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
,4
|
,4
|
||||||
,1) = 'A'
|
,1) = 'A'
|
||||||
AND instr('ABCDEFGHJKSTUW'
|
AND instr('ABCDEFGHJKSTUW'
|
||||||
,substr(p_postcode
|
,substr(l_postcode
|
||||||
,4
|
,4
|
||||||
,1)) = 0 THEN
|
,1)) = 0 THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
@@ -132,7 +133,7 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
,l_idx
|
,l_idx
|
||||||
,1) = 'A'
|
,1) = 'A'
|
||||||
AND instr('CIKMOV'
|
AND instr('CIKMOV'
|
||||||
,substr(p_postcode
|
,substr(l_postcode
|
||||||
,l_idx
|
,l_idx
|
||||||
,1)) > 0 THEN
|
,1)) > 0 THEN
|
||||||
l_return := FALSE;
|
l_return := FALSE;
|
||||||
@@ -153,6 +154,7 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
FUNCTION get_region_for_postcode(p_postcode IN VARCHAR2)
|
FUNCTION get_region_for_postcode(p_postcode IN VARCHAR2)
|
||||||
RETURN postcodes.regi_code%TYPE IS
|
RETURN postcodes.regi_code%TYPE IS
|
||||||
l_regi_code postcodes.regi_code%TYPE;
|
l_regi_code postcodes.regi_code%TYPE;
|
||||||
|
l_postcode VARCHAR2(80) := upper(p_postcode);
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT regi_code
|
SELECT regi_code
|
||||||
INTO l_regi_code
|
INTO l_regi_code
|
||||||
@@ -160,14 +162,14 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
|
|||||||
,outcode
|
,outcode
|
||||||
,incode
|
,incode
|
||||||
,decode(outcode || ' ' || incode
|
,decode(outcode || ' ' || incode
|
||||||
,p_postcode
|
,l_postcode
|
||||||
,1
|
,1
|
||||||
,999) AS accuracy
|
,999) AS accuracy
|
||||||
FROM postcodes t
|
FROM postcodes t
|
||||||
WHERE (outcode || ' ' || incode = p_postcode)
|
WHERE (outcode || ' ' || incode = l_postcode)
|
||||||
OR (outcode = substr(p_postcode
|
OR (outcode = substr(l_postcode
|
||||||
,1
|
,1
|
||||||
,instr(p_postcode
|
,instr(l_postcode
|
||||||
,' ') - 1) AND incode IS NULL)
|
,' ') - 1) AND incode IS NULL)
|
||||||
ORDER BY 4)
|
ORDER BY 4)
|
||||||
WHERE rownum < 2;
|
WHERE rownum < 2;
|
||||||
|
|||||||
77
Modules/mip_virus_check.pck
Normal file
77
Modules/mip_virus_check.pck
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
CREATE OR REPLACE PACKAGE mip_virus_check IS
|
||||||
|
|
||||||
|
-- Author : HARDYA
|
||||||
|
-- Created : 23/01/2008 09:55:52
|
||||||
|
-- Purpose : Virus checking package
|
||||||
|
PROCEDURE write_file(p_name IN wwv_flow_files.NAME%TYPE
|
||||||
|
,p_location IN VARCHAR2 DEFAULT 'WEBMIP_VIRUS'
|
||||||
|
,p_fs_name IN VARCHAR2);
|
||||||
|
END mip_virus_check;
|
||||||
|
/
|
||||||
|
CREATE OR REPLACE PACKAGE BODY mip_virus_check IS
|
||||||
|
|
||||||
|
PROCEDURE write_file(p_name IN wwv_flow_files.NAME%TYPE
|
||||||
|
,p_location IN VARCHAR2 DEFAULT 'WEBMIP_VIRUS'
|
||||||
|
,p_fs_name IN VARCHAR2) IS
|
||||||
|
l_lob_loc BLOB;
|
||||||
|
l_buffer RAW(32767);
|
||||||
|
l_buffer_size BINARY_INTEGER;
|
||||||
|
l_amount BINARY_INTEGER;
|
||||||
|
l_offset NUMBER(38) := 1;
|
||||||
|
l_chunksize INTEGER;
|
||||||
|
l_out_file utl_file.file_type;
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
SELECT blob_content
|
||||||
|
INTO l_lob_loc
|
||||||
|
FROM wwv_flow_files
|
||||||
|
WHERE NAME = p_name;
|
||||||
|
|
||||||
|
l_chunksize := dbms_lob.getchunksize(l_lob_loc);
|
||||||
|
|
||||||
|
IF (l_chunksize < 32767) THEN
|
||||||
|
l_buffer_size := l_chunksize;
|
||||||
|
ELSE
|
||||||
|
l_buffer_size := 32767;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
l_amount := l_buffer_size;
|
||||||
|
|
||||||
|
dbms_lob.OPEN(l_lob_loc
|
||||||
|
,dbms_lob.lob_readonly);
|
||||||
|
|
||||||
|
l_out_file := utl_file.fopen(location => p_location
|
||||||
|
,filename => p_fs_name
|
||||||
|
,open_mode => 'wb'
|
||||||
|
,max_linesize => 32767);
|
||||||
|
|
||||||
|
WHILE l_amount >= l_buffer_size LOOP
|
||||||
|
|
||||||
|
dbms_lob.READ(lob_loc => l_lob_loc
|
||||||
|
,amount => l_amount
|
||||||
|
,offset => l_offset
|
||||||
|
,buffer => l_buffer);
|
||||||
|
|
||||||
|
l_offset := l_offset + l_amount;
|
||||||
|
|
||||||
|
utl_file.put_raw(file => l_out_file
|
||||||
|
,buffer => l_buffer
|
||||||
|
,autoflush => TRUE);
|
||||||
|
|
||||||
|
--utl_file.fflush(file => l_out_file);
|
||||||
|
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
utl_file.fflush(file => l_out_file);
|
||||||
|
|
||||||
|
utl_file.fclose(l_out_file);
|
||||||
|
|
||||||
|
dbms_lob.CLOSE(l_lob_loc);
|
||||||
|
END write_file;
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
-- Initialization
|
||||||
|
NULL;
|
||||||
|
END mip_virus_check;
|
||||||
|
/
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
-- Create directory
|
|
||||||
create or replace directory WEBMIP_BULK_LOAD
|
create or replace directory WEBMIP_BULK_LOAD
|
||||||
as 'c:\webmip\bulk_load';
|
as 'c:\webmip\bulk_load';
|
||||||
|
create or replace directory WEBMIP_VIRUS
|
||||||
|
as 'c:\webmip\virus';
|
||||||
|
|||||||
Reference in New Issue
Block a user