Project

General

Profile

Actions

Non-Function #562

closed

[SYSTEM] 스토리오더 주문상태 변경 시 제한 추가

Added by Jisoo Choi 28 days ago. Updated 23 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
08/23/2024
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

 

현재 주문 상태가 '주문확인중'일 때, 15분 동안 확인을 하지 않으면 자동으로 '매장취소(주문취소)'하는 건과 관련된 수정입니다.

주문상태나 결제상태 변경에 대한 수정은 없고, 해당 수정 과정에서 제한을 추가하는 이슈입니다.

 

 


 

(현재)

주문상태 확인 스케줄러가 정해진 시간마다 돌면서

주문시간이 15분 이상 지난 SS01(주문확인중) 주문이 있는 경우,

자동으로 SS10(매장취소(주문취소))로 상태를 변경함

*SS10(매장취소(주문취소))로 상태가 변경될 경우 결제도 취소됨

(주문상태) SS01 -> SS10

(결제상태) PS10 -> PS11

단, 현재 주문상태가 SS01이 아닌 경우에도 주문 시간만 보고 취소되고 있을 수도 있음 (확인 필요)

 

 

(수정)

(1) 스케줄러를 통해 주문상태 확인 후, 자동으로 주문상태를 SS10으로 변경할 때, 현재 주문상태가 SS01이 아닌 경우, 변경할 수 없도록 제한 + alert 메시지 "'매장취소(주문취소)'는 현재 주문상태가 '주문확인중'일 때에만 가능합니다."

(2) 스케줄러를 통해 주문상태 확인 후, 자동으로 주문상태를 SS10으로 변경할 때, 주문일시가 조회 시점으로부터 1시간 이내가 아닌 경우, 변경할 수 없도록 제한 + alert 메시지 "'매장취소(주문취소)'는 주문일자가 1시간 이내인 경우에만 가능합니다."

*ADMIN, AGENT 모두 수동 변경할 때에도 현재 상태가 SS01인 경우에만 SS10로 변경할 수 있고, 다른 주문 상태인 경우에는 SS11(매장 취소(환불))로 변경하는 것이기 때문에 일괄적으로 제한되어도 괜찮을 것 같습니다.

**쿼리에 넣는 게 아니라 DB에서 데이터를 갖고 온 상태에서 프로세스 로직상으로 validation 체크를 부탁드립니다.

 

 

+ 로그 관련 확인 필요

(1) 정상으로 시스템 로그가 남은 경우

http://plus.storyway.co.kr/admin/storeOrder/240805100306UWEL?menuCode=M7005&page=6&productName=%EB%B8%94%EB%9F%AD&smartOrderStatus=SS10

(2) 시스템 로그가 남지 않은 경우

http://plus.storyway.co.kr/admin/storeOrder/240430151403PGDL?menuCode=M7005®StartDate=2024-02-01®EndDate=2024-04-30

 

 

Actions #1

Updated by Jisoo Choi 28 days ago

 

 

240823 비정상 취소 쿼리 로그

 

# at 11931
#240823  0:40:03 server id 1  end_log_pos 12328         Query   thread_id=49    exec_time=0     error_code=0
SET TIMESTAMP=1724341203.340306/*!*/;
update st_order_payment
     SET cancel_amount = 2000,
        cancel_reason = '기타',
        payment_status = 'PS11',
        cancel_proc_date = '2024-08-23 00:40:03',
        mod_date = NOW()
    where order_no = '231127080923UECA'
/*!*/;
# at 12328
#240823  0:40:03 server id 1  end_log_pos 12355         Xid = 10231
COMMIT/*!*/;
# at 12355
#240823  0:40:03 server id 1  end_log_pos 12393         GTID 0-1-2293815 trans
/*!100001 SET @@session.gtid_seq_no=2293815*//*!*/;
BEGIN
/*!*/;
# at 12393
#240823  0:40:03 server id 1  end_log_pos 12571         Query   thread_id=49    exec_time=0     error_code=0
SET TIMESTAMP=1724341203/*!*/;
UPDATE st_product
        SET
            stock_count = 1
        WHERE product_code = '216456-77780521797'
/*!*/;
# at 12571
#240823  0:40:03 server id 1  end_log_pos 12749         Query   thread_id=49    exec_time=0     error_code=0
SET TIMESTAMP=1724341203/*!*/;
UPDATE st_product
        SET
            stock_count = 1
        WHERE product_code = '216456-77780521803'
/*!*/;
# at 12749
#240823  0:40:03 server id 1  end_log_pos 12776         Xid = 10242
COMMIT/*!*/;
# at 12776
#240823  0:40:03 server id 1  end_log_pos 12814         GTID 0-1-2293816 trans
/*!100001 SET @@session.gtid_seq_no=2293816*//*!*/;
BEGIN
/*!*/;


UPDATE st_order
         SET smart_order_status = 'SS10',
                auto_cancel_yn = 'Y',
            mod_date = NOW()
        WHERE order_no = '231127080923UECA'
/*!*/;
# at 13417
 

 

Actions #2

Updated by Jisoo Choi 28 days ago

 

정상 취소 쿼리 로그

 

SET TIMESTAMP=1724124840.424080/*!*/;
INSERT INTO st_order_change (
          job_type
        , scheduler_name
        , order_no
        , smart_order_status_before
        , smart_order_status_after

        , order_status_before
        , order_status_after
        , payment_status_before
        , payment_status_after

        , reg_user_seq
        , reg_date
          )
      VALUES (
          'agent'
        , null
        , '240820122937AONE'
        , 'SS01'
        , 'SS10'

        , null
        , null
        , 'PS10'
        , 'PS11'

        , 2191
        , NOW()
          )
/*!*/;
# at 4367649
와 같이 로그를 남기는 기록이 없이 위에 쿼리만 반복되어 실행되었습니다

 

 

Actions #3

Updated by Deca Park 27 days ago

[ADMIN] Scheduler > changeSmartOrderStatus() 

1.logic (change)

  1) loop {target order list}

    a) validate
      a-1) if current {smart_order_status} != 'SS01' (주문확인중)
        - INFO log: "[Scheduler] changeSmartOrderStatus skip: order_no={value}, smart_order_status={value}, error="매장취소(주문취소)'는 현재 주문상태가 '주문확인중'일 때에만 가능합니다."
        - SKIP
      a-2) if {st_order.reg_date} + 1 hour < Now
        - INFO log: "[Scheduler] changeSmartOrderStatus skip: order_no={value}, smart_order_status={value}, error="매장취소(주문취소)'는 주문일자가 1시간 이내인 경우에만 가능합니다."
        - SKIP

  b) after process
      b-1) leave INFO log
        - "[Scheduler] changeSmartOrderStatus success: order_no={value}, before smart_order_status={value}, after smart_order_status={value}")

Actions #4

Updated by Deca Park 27 days ago

  • Assignee changed from Deca Park to bryant bryant
Actions #5

Updated by bryant bryant 27 days ago

  • Status changed from New to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #6

Updated by Deca Park 23 days ago

  • Assignee changed from Deca Park to Jisoo Choi
Actions #7

Updated by Jisoo Choi 23 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF