Sunteți pe pagina 1din 8

Yard Management System

App_Watcher
CurrWnd Long
Length Long
TaskName String
Parent Long
Running_YN int
Running_LP int

Location Picker
Trigger_Count int
Used in Process Trigger_Point int
Last_Read_Date string

MySize As Long
sFileText String
iFileNo int
For Log comp String
loc int
dt_val String
t String

Read Triggering Point


from Oracle
DB (Unit is in Minutes)

Trigger_Timer_Timer()

Fetcch last run time


from oracle
Fetch newly arrived Sheets
Create Location from MYSQL& Update the
Entry Date same in Oracle

Sheets arrived after last


handshaking

Load Plan

Read Triggering Point


from Oracle
(Unit is in Minutes)

coil As String
loc_id As String
For Trigeer Timer sql_insert_count As Integer
ora_update_count As Integer
Update_YN As Integer
Insert_YN As Integer
Fin As Integer

Trigger_Count = 0
Starting Handshaking
Fetch newly arrived
Sheets
from MYSQL& Update Loading Plan Entry
Date and Time
the
same in Oracle

IF recordcount>0
Fresh Loading Plan
For Insert
Fresh Loading Plan
Inserted
to MYSQL --" &
sql_insert_count

Updated Loading Plan


are --" &
ora_rs.RecordCount sql_insert_count = 0

If Insert_YN > 0
Yard Management System

Starts from Zero


Reaching Point in Minutes
Last Successful handshaking b/w MYSQL & Oracle

select range1 from common_master where


comp_code = @ comp and loc_code =@loc
and common_name = 'YMS_INTERVAL'

coil String
loc_id String
ora_upcount Integer
Update_YN Integer
UID Long

select to_char(max(loc_entry_date) - 1/24 ,'DD/MM/YYYY HH:MI PM') dt Given val


from fg_location comp,
where comp_code = "comp" and loc_code = "loc" loc
select id,upper(materialid) materialid,
upper(locationid) locationid
from tblfginventory where flag = " & "0"

Check in MySQL for Entry is present - Read

Check LocationID
MaterialID
UID

IF Update_YN=0
update fg_location set
location = @sql_id,
loc_entry_date = @dt_val
where comp_code ="comp" and loc_code ="loc" and coil_pkt_no = "sql_coil"

If Update_YN>0 Given val


update tblfginventory set flag = 1 where ID = "UID" , materialid ="sql_coil" comp,
loc ,
sql_coil,UID

select (range1/2) range1 from common_master Given val


where comp_code = "comp" and loc_code = "loc" comp,
and common_name = 'YMS_INTERVAL loc

select fin_year from financial_year where


sysdate between start_date and (end_date +1).
Select l.COMP_CODE,l.LOC_CODE ,l.FIN_YEAR ,l.DO_SERIES ,
l.DO_NO ,l.DO_SL_NO, to_char(h.DO_DATE,'DD/MM/YYYY') do_date,
l.Plan_no,h.pARTY_CODE ,h.PARTY_LOC_CODE,pp.PARTY_NAME,p.CITY
,l.STATUS , l.product_code, l.COIL_PKT_NO ,l.GAUGE ,l.WIDTH ,l.LENGTH ,
l.WEIGHT ,l.GROSS_WEIGHT ,l.user_ID , to_char(sysdate,'DD/MM/YYYY
HH24:MI:SS') UPLOADED_DATE_TIME, l.IS_ACTIVE, l.token_no ,l.vehicle_no,
l.vehicle_capacity

from
Do__Head h, loading_plan l , Party_mast_detail p,
party_mast_head pp

where l.comp_code = "comp"


and l.loc_code = " loc "
and l.fin_year = "Fin"
and l.trf_yms = "N"
and h.comp_Code = l.comp_code
and h.loc_code = l.loc_code
and h.fin_year = l.fin _year
and h.do_series = l.do_series
and h.do_no = l.do_no
and p.party_code = h.party_code
and p.loc_code = h.party_loc_code
and pp.party_code = p.party_code

INSERT INTO dbisclnew.tbldispatch


( COMP_CODE, LOC_CODE, FIN_YEAR, DO_SERIES,DO_NO, DO_SL_NO,
DO_DATE, PLAN_NO, PARTY_CODE, PARTY_LOC_CODE, PARTY_NAME, CITY,
PRODUCT_CODE, COIL_PKT_NO, GAUGE, WIDTH, WEIGHT, GROSS_WEIGHT,
MATERIAL_TYPE, VEHICLE_NO, STATUS, UPLOADED_BY,
ADED_DATE_TIME, Flag, TOKEN_NO, TOTAL_CAPACITY)
Values
(comp_code,loc_code,fin_year,do_series,do_no,do_sl_no,do_date,
plan_no,party_code,party_loc_code,party_name,city,product_code,
coil_pkt_no,gauge,width,weight,gross_weight,NULL,Vehicle_no,
user_ID,uploaded_date_time,1,Token_NO,vehicle_capacity

)
Select l.COMP_CODE,l.LOC_CODE ,l.FIN_YEAR ,l.DO_SERIES , l.DO_NO ,
l.DO_SL_NO,to_char(h.DO_DATE,'DD/MM/YYYY') do_date,
l.Plan_no,h.pARTY_CODE ,h.PARTY_LOC_CODE,pp.PARTY_NAME,p.CITY ,
l.STATUS , l.product_code, l.COIL_PKT_NO ,l.GAUGE ,l.WIDTH ,l.LENGTH ,
l.WEIGHT ,l.GROSS_WEIGHT , l.user_ID ,
to_char(sysdate,'DD/MM/YYYY HH24:MI:SS') UPLOADED_DATE_TIME,
l.IS_ACTIVE, l.token_no ,l.vehicle_no, l.vehicle_capacity, l.update_user_id
, to_char(l.update_date,'DD/MM/YYYY HH24:MI:SS')

update_DATE_TIME from Do__Head h, loading_plan l , Party_mast_detail p,


party_mast_head pp
where l.comp_code = "comp"
and l.loc_code = "loc" and l.fin_year = "Fin" and l.trf_yms = "U"
and h.comp_Code = l.comp_code and h.loc_code = l.loc_code
and h.fin_year = l.fin_year and h.do_series = l.do_series
and h.do_no = l.do_no and p.party_code = h.party_code
and p.loc_code = h.party_loc_code and pp.party_code = p.party_code"

update dbisclnew.tbldispatch
set do_series = "do_series" , do_no = "do_no"
, do_sl_no = "do_sl_no", do_date ="do_date" party_code = "party_code"
, party_loc_code = "party_loc_code", party_name = "party_name"
, city ="city" , product_code = "NULL", gauge = "gauge", width = "width"
, weight = "weight") , gross_weight = "gross_weight" ,
material_type = "NULL" , vehicle_no = "Vehicle_no" , status = 1
, is_active ="is_active", updated_by = "update_user_id", updated_date_time =
"update_date_time , token_no = "Token_NO" , total_capacity =
"vehicle_capacity"
where comp_code ="comp_code") and loc_code ="loc_code")
and fin_year ="fin_year") and plan_no = "plan_no")
and coil_pkt_no = "coil_pkt_no"

update loading_plan
set trf_yms = 'Y'
where comp_code = "comp_code"
and loc_code = "loc_code"
and fin_year = "fin_year"
and plan_no = "plan_no"
and coil_pkt_no ="coil_pkt_no"

S-ar putea să vă placă și