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 #1

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Toby Pham about 1 year ago

  • Status changed from New to In Progress
Actions #3

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #4

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #5

Updated by Deca Park about 1 year ago

2.Scheduler - KRS Store Product DB (1)

  • make Scheduler with 3 (STORE / GOODS / SALEITEM)

  1) logic
    a) SELECT KRS DB (VI_APP_GOODS_STORY)
       columns: set according to following mapping info (not use *)
       condition:
         - TRANS_YN = 'N'
       sort : ITEM_CD ASC, DEPT_CD ASC
    b) mapping
      ------------------------------------------------------------
      KRS: VI_APP_GOODS_STORY  ->  KORAIL: st_product
           (PK: DEPT_CD+ITEM_CD)         (PK: product_code)
      ------------------------------------------------------------
      DEPT_CD -> mall_code
      ITEM_CD -> krs_item_cd (NEW)
                    -> product_code : set by "{DEPT_CD}-{ITEM_CD}" - ex) "204623-7000427"
      ITEM_NM -> product_name
      BAR_CD -> krs_bar_cd (NEW)
      SALE_PRICE -> price
      SALE_PRICE_DC -> sale_price (temporarily, set same with price)
                              -> if SALE_PRICE > SALE_PRICE_DC, set discount_type = 'amount', discount_amount = SALE_PRICE - SALE_PRICE_DC
                              -> when UPDATE, if NOT (SALE_PRICE > SALE_PRICE_DC), set discount_type = NULL, discount_amount = NULL
      NORMAL_JAEGO_QTY -> stock_count
      IMG_URL -> krs_img_url (NEW)
      MEM_DC_RATE -> staff_discount_rate
      MEM_SALE_PRICE -> staff_sale_price
                     -> staff_discount_type : if MEM_DC_RATE is NOT NULL, set by 'rate'

    c) INSERT/UPDATE KORAIL DB (st_product)
      c-1) if data is NOT existed (with mall_code & krs_item_cd) , INSERT st_product
        - product_type : 'general'
        - reg_date : current date
      c-2) if data is existed, UPDATE st_product
        - mod_date : current date
    d) if KRS data is committed into KORAIL DB (st_product)
      - UPDATE VI_APP_GOODS_STORY
        SET TRANS_YN = 'Y' 
        WHERE DEPT_CD = {mall_code} AND ITEM_CD = {krs_item_cd}
      - if TRANS_YN = 'Y', this data is excluded on next time

Actions #6

Updated by Deca Park about 1 year ago

3.Scheduler - KRS Store Product DB (2)

  • make Scheduler with 3 (STORE / GOODS / SALEITEM)

  1) logic
    a) SELECT KRS DB (VI_APP_SALEITEM_STORY)
       columns: set according to following mapping info (not use *)
       condition:
         - TRANS_YN = 'N'
       sort : ITEM_CD ASC, DEPT_CD ASC
    b) mapping
      ------------------------------------------------------------
      KRS: VI_APP_SALEITEM_STORY -> KORAIL: st_product
              (PK: DEPT_CD+PLU_CD)                 (PK: product_code)
      ------------------------------------------------------------
      DEPT_CD -> mall_code
      PLU_CD -> krs_bar_cd (NEW)
                  -> product_code : set by "{DEPT_CD}-{PLU_CD}" - ex) "204623-2021747800430"
      ITEM_CD -> krs_item_cd (NEW)
      PLU_NM -> product_name
      SALE_PRICE -> price / sale_price
      IMG_URL -> krs_img_url (NEW)
      APP_SALE_YN -> show_yn
      MEM_DC_RATE -> staff_discount_rate
      MEM_SALE_PRICE -> staff_sale_price
                     -> staff_discount_type : if MEM_DC_RATE is NOT NULL, set by 'rate'
                                                        (when UPDATE, MEM_DC_RATE is NULL, set staff_discount_type = NULL)

    c) INSERT/UPDATE KORAIL DB (st_product)
      c-1) if data is NOT existed (with mall_code & krs_bar_cd) , INSERT st_product
        - product_type : 'general'
        - reg_date : current date
      c-2) if data is existed, UPDATE st_product
        - mod_date : current date
    d) if KRS data is committed into KORAIL DB (st_product)
      - UPDATE VI_APP_SALEITEM_STORY
        SET TRANS_YN = 'Y' 
        WHERE DEPT_CD = {mall_code} AND PLU_CD = {krs_bar_cd}
      - if TRANS_YN = 'Y', this data is excluded on next time

Actions #7

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #8

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #9

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #10

Updated by Toby Pham about 1 year ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #11

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to In Progress
  • Assignee changed from Deca Park to Toby Pham

[KRS scheduler]

1.Add URL to run scheduler manually
  1) URL: /krsScheduler/run
    - required admin Login
  2) parameters
    - type: store/goods/saleitem
  3) page
    - show confirm message("KRS 스케줄러를 실행하시겠습니까?")
    - if YES, run the scheduler and show progress bar 
    - if done, alert msg.("스케줄러 작업이 완료되었습니다.")

2.scheduler
  1) leave log (level: info)
    - "[Scheduler-{schedulerName}] start"
    - "[Scheduler-{schedulerName}] applied data count: {count}"
    - "[Scheduler-{schedulerName}] end"
  2) error log
    - append prefix like "[Scheduler-{schedulerName}] "

Actions #12

Updated by Deca Park about 1 year ago

  • Status changed from In Progress to Feedback
Actions #13

Updated by Toby Pham about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #14

Updated by Deca Park about 1 year ago

  • Description updated (diff)
  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to Toby Pham
Actions #15

Updated by Toby Pham about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #16

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #17

Updated by Toby Pham about 1 year ago

1. URL scheduler manually [KRS STORE]

  • /krsScheduler/run?type=store

2. URL scheduler manually [KRS GOODS]

  • /krsScheduler/run?type=goods

3. URL scheduler manually [KRS SALEITEM]

  • /krsScheduler/run?type=saleitem
Actions #18

Updated by Deca Park about 1 year ago

[KRS Scheduler]

1.crontab

  1) store scheduler
    - everyday 4 AM

  2) store product (goods AND saleitem) scheduler
    - everyday 4:15 AM

Actions #19

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #20

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #21

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to Toby Pham

[kRS Store DB scheduler]

1.mapping
  a) store_category_code
    - if BSNS_SE_CD = '102', set by 'SO01' (편의점)
    - if BSNS_SE_CD = '002', set by STORE_LCLAS_CD as current
  b) business_hours
    - set by "00~10분 이내" (default)

Actions #22

Updated by Toby Pham about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #23

Updated by Deca Park about 1 year ago

[KRS GOODS/SALEITEM DB scheduler]

1.DB (st_product)
  1) krs_taxn_se_cd (NEW)
    - if GOODS scheduler, set by TAXN_SE_CD
    - if SALEITEM scheduler, set by TAX_GUB

  2) reg_user_seq
    - don't set by 0 (DB column is changed by NULL)

  3) sold_out_yn
    - set by 'N' (default)

  4) max_order_count
    - set by 5 (defautl)

Actions #24

Updated by Deca Park 11 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to bryant bryant

[Scheduler - KRS Store DB]

1.mapping
  - KRS: VI_APP_STORE_STORY -> KORAIL: st_mall
  1) add 3 fields
    a) BSNM_NO -> mall_biz_no
    b) RPRSNTV_NM -> mall_ceo
    c) ADDR_TY_CD -> mall_location (mall_location revert)

    d) if ADDR_TY_CD = 'L' (구주소)
         - set "ADDR1 + ' ' + ADDR2" into mall_address
       else if ADDR_TY_CD = 'R' (신주소)
         - set "RN_ADDR1 + ' ' + RN_DETAIL_ADDR" into mall_address

------------- bug (2023-12-05) ---------------

1.mall_location
   - set by STORE_LC_NM 
     (currently, ADDR_TY_CD is set wrong)

2.mall_address
 - if value is NULL, value is set like 'null null' 
 - don't set by 'null' string 
   (check other Scheduler's string set logic too)

Actions #25

Updated by bryant bryant 11 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #26

Updated by Deca Park 11 months ago

[ADMIN] 스토리 오더 관리 > 매장 관리 (/store)

1.KRS 수동 업데이트 button
  - if login st_user.auth = 'AU00' or 'AU01', show it
    else hide it

[ADMIN] 스토리 오더 관리 > 상품 관리 (/storeProduct)

1.편의점 KRS 수동 업데이트 / 전문점 KRS 수동 업데이트 button
   - if login st_user.auth = 'AU00' or 'AU01', show it
    else hide it

Actions #27

Updated by Deca Park 10 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to Toby Pham
Actions #28

Updated by Toby Pham 10 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #29

Updated by Deca Park 8 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF