Project

General

Profile

Actions

New Function #100

closed

[ADMIN] KRS DB import scheduler

Added by Deca Park about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
08/24/2023
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

1.description
  1) crontab
    - everyday 4 AM
    - get store / store product data from KRS DB
  2) KRS DB info (define as properties)
    - IP : 222.108.149.24
    - DBMS : Oracle11g
    - SID : orahi
    - USER : US_STORYAPP
    - PW : sApp8800!

2.Scheduler - KRS Store DB
  1) logic
    a) SELECT KRS DB (VI_APP_STORE_STORY)
       columns: set according to following mapping info (not use *)
       condition:
         - BSNS_SE_CD IN ('102','002') // 102: 편의점, 002: 전문점
         - TRANS_YN = 'N'
       sort: DEPT_CD ASC
    b) mapping
      KRS: VI_APP_STORE_STORY -> KORAIL: st_mall
      ------------------------------------------------------------
      DEPT_CD -> mall_code
                    -> mall_name (if BSNS_SE_CD = '002', set DEPT_NM_PR
                                              else, SET DEPT_NM)
                    -> mall_detail_name (NEW) (if BSNS_SE_CD = '002', set DEPT_NM
                                              else, SET NULL)  

      APP_STATN_CD -> station_code
      STORE_LCLAS_CD -> store_category_code
      STORE_LC_NM -> mall_location
      CTTPC_NO -> mall_phone
      IMG_URL -> krs_img_url (NEW)
      BSNS_SE_CD -> krs_bsns_se_cd (NEW)

      KRS: VI_APP_STORE_STORY -> KORAIL: st_mall_hour
      ------------------------------------------------------------
      START_TM -> start_hour (convert: 0600 -> 06:00)
      END_TM -> end_hour (convert: 0600 -> 06:00)

    c) INSERT/UPDATE KORAIL DB (st_mall)
      c-1) if data is NOT existed (with mall_code) , INSERT st_mall
        - mall_type : 'store' (when UPDATE, SKIP)
        - product_receive_method : 'PR01,PR02' (when UPDATE, SKIP)
        - reg_date : current date
      c-2) if data is existed, UPDATE st_mall
        - mod_date : current date
    c) INSERT/UPDATE KORAIL DB (st_mall_hour)
      c-1) if data is NOT existed, INSERT st_mall_hour
        - sort_no : 1
        - hour_type : 'HT01'
      c-2) if data is existed, UPDATE st_mall_hour
    d) if KRS data s committed into KORAIL DB (st_mall/st_mall_hour)
      - UPDATE VI_APP_STORE_STORY
        SET TRANS_YN = 'Y' 
        WHERE DEPT_CD = {mall_code}
      - if TRANS_YN = 'Y', this data is excluded on next time

3.Scheduler - KRS Store Product DB

Actions

Also available in: Atom PDF