Project

General

Profile

Actions

Non-Function #124

closed

[ADMIN] kakao 알림톡 (kakao message)

Added by Deca Park 12 months ago. Updated 9 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
09/29/2023
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

[Scheduler - kakao send message]

1.kakao send message

  • crontab: 2 AM (every day)

[process logic]

1.dormant user (msg_template_id = 'ap0003') case

  1) get target dormant user list
    [logic]
    DB: st_user
    conditions:
      - auth='AU02' AND user_status != 'US04' AND last_login_date (Date) <= {curren Date - 335 days} // because message is sent before 30days from 1 year

  2) send message process
    a) if {hp} of target user_no is empty(NULL), SKIP
    a-1) if kakao message was sent into taget user within recent 30 days, SKIP
      [check logic]
      DB: st_kakao_message_send
      conditions: msg_template_id='ap0003' AND receive_user_seq = {taget user_seq} AND current DATE <= user_dormant_date 

    b) get message template 
        - DB: st_kakao_message_template
        - conditions: msg_template_id='ap0003'
    c) call kakao message send
      c-1) get message after set values of {st_kakao_message_template.msg_content}
        - "userName" : user name of target user_no
        - "dormantDate" : last_login_date (yyyymmdd) + 365 days (format: 'yyyy-mm-dd')
      c-2) call ORACLE procedure
         - refer to attach txt file 
         - use ORACLE DB properites of config
    d) INSERT DB (st_kakao_message_send)
        - msg_template_id: 'ap0003'
        - receive_user_seq: target user_no
        - receive_tel_no: {hp} of target user_no
        - msg_send_date : current datetime
        - msg_content : send message content
        - user_dormant_date : {dormantDate}
        - user_dormant_proc_yn: 'N'

  3) server log
    - level: INFO
    - message: "[Scheduler] 알림톡 휴면회원안내(ap0003): " + "total Kakao message send count: {total count}"


Files

Actions #1

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #2

Updated by Deca Park 12 months ago

  • Description updated (diff)

[Scheduler - dormant user process]

1.crontab: 3 AM (every day)
   - combine this with Scheduler - kakao send message

2.process
  1) get target users
    [logic]
    DB: st_user
    conditions:
      - auth='AU02' AND user_status != 'US04' AND last_login_date (yyyymmdd) <= {curren_date - 365 days}

    [changed logic]
    DB: st_kakao_message_send
    conditions: msg_template_id='ap0003' AND user_dormant_date <= current DATE AND user_dormant_proc_yn = 'N'

  2) UPDATE (1)
     
DB: st_user
     condition: user_seq = {target user_seq}
      - user_status = 'US04', mod_date={current date}

  3) UPDATE (2)
      DB: st_kakao_message_send
      conditions: msg_code = {target msg_code}
        - user_dormant_proc_yn = 'Y'

  4) server log
    - level: INFO
    - message: "[Scheduler] 알림톡 휴면회원안내(ap0003): " + "total DB process count: {total count}"

Actions #4

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #5

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #6

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #7

Updated by Deca Park 12 months ago

[Scheduler - dormant user process]

1.Logic conditions (to get dormant users)
  1) add condition

  • auth='AU02'

  2) when compare last_login_date, just check with yyyymmdd (exclude time)

Actions #8

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #9

Updated by bryant bryant 12 months ago

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

Updated by Deca Park 12 months ago

[ADMIN] kakao message manual send page

0.URL : /kakaoMessage/

1.page definition

  1) sub title: "Kakao 알림톡 수동 발송"

  2) Table
    a) column name
      - 알림톡 명 / 발송
    b) rows
      - 2 rows (hard-coding)
      b-1) 알림톡 명 (message type)
        - 포인트소멸안내 : point expire message (call sendUserPointExpireMessage())
        - 휴면회원안내 : dormant member message
      b-2) 발송
        - add 발송(send) button
        - if the button clicks
          + show confirm msg("해당 알림톡을 발송 처리 하시겠습니까?")
          + if YES, call the process
          + if done, show complete msg.("알림톡 발송 처리가 완료되었습니다.")
          + if error, show common server error msg.

Actions #11

Updated by Deca Park 12 months ago

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

Updated by bryant bryant 12 months ago

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

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #14

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #15

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #16

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #17

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #18

Updated by Deca Park 12 months ago

  • Description updated (diff)
Actions #19

Updated by Deca Park 12 months ago

[Scheduler - kakao send message & DB process]

1.kakao send message (point expire) : msg_template_id = 'ap0002' (포인트소멸안내)

  1) logic
    a) get st_user_save_point SUM based with expire days
      [logic]
      DB: st_user_save_point
      select: SUM(save_point)
      conditions: DATE(save_date) <= (current DATE - 365 days)
      group by: user_seq
    b) get st_user_use_point SUM
      [logic]
      DB: st_user_use_point
      select: SUM(use_point)
      conditions: DATE(reg_date) <= (current DATE)
      group by: user_seq
    c) if a) SUM(save_point) <= b) SUM(use_point), SKIP
       else a) SUM(save_point) > b) SUM(use_point)
         - send message & DB process

  2) send message
    a) if {hp} of target user_no is empty(NULL), SKIP
    b) if kakao message was sent into taget user within recent 7 days, SKIP
      [check logic]
      DB: st_kakao_message_send
      conditions: msg_template_id='ap0002' AND receive_user_seq = {taget user_seq} AND current DATE <= point_expire_date 
    c) get message template 
        - DB: st_kakao_message_template
        - conditions: msg_template_id='ap0002'
    d) call kakao message send
      d-1) get message after set values of {st_kakao_message_template.msg_content}
        - "userName" : user name of target user_no
        - "expirePoint" : a) SUM(save_point) - b) SUM(use_point) (from No 1)
        - "pointExpireDate" : set by {current DATE + 7 days} (format: yyyy-mm-dd)
        - "baseDate" : set by current DATE (format: yyyy-mm-dd)
      d-2) call ORACLE procedure
         - refer to attach txt file 
         - use ORACLE DB properites of config
    e) INSERT DB (st_kakao_message_send)
        - msg_template_id: 'ap0002'
        - receive_user_seq: target user_no
        - receive_tel_no: {hp} of target user_no
        - msg_send_date : current datetime
        - msg_content : send message content
        - point_expire_date : {pointExpireDate}
        - expire_point : {expirePoint}
        - point_expire_proc_yn: 'N'

  3) server log
    - level: INFO
    - message: "[Scheduler] 알림톡 포인트소멸안내(ap0002): " + "total Kakao message send count: {total count}"


2.DB process (point expire) : msg_template_id = 'ap0002' (포인트소멸안내)
  1) logic
    DB: st_kakao_message_send
    conditions: msg_template_id='ap0002' AND point_expire_date <= current DATE AND point_expire_proc_yn = 'N'

  2) INSERT
     DB: st_user_save_point
     set
       - user_seq : {target user_seq}
       - save_point : -{expire_point} (minus value)
       - save_date : current date
       - reg_date : current date
       - reg_user_seq : {target user_seq}
       - admin_add_yn: 'Y'
       - admin_save_reason: "사용 기간 만료"

  3) UPDATE
      DB: st_kakao_message_send
      conditions: msg_code = {target msg_code}
        - point_expire_proc_yn = 'Y'

  4) server log
    - level: INFO
    - message: "[Scheduler] 알림톡-포인트소멸안내(ap0002): " + "total DB process count: {total count}"

Actions #20

Updated by Deca Park 12 months ago

[Scheduler - kakao send message & DB process]

1.kakao send message (delivery message) : msg_template_id = 'ap0001' (배송알림)

  1) [ADMIN] 스토리 쇼핑 관리 > 주문/배송 관리 (/onlineOrder) > 상세(Modify)
    a) 저장(save) button
      a-1) if 주문 상태 (order_status) is updated with 'OS02' (배송중)
        - send kakao message

  2) send kakao message
    a) if {hp} of target user_no is empty(NULL), SKIP
    a-1) if delivery_company_code OR delivery_invoice_no is empty(NULL), SKIP
    b) get message template 
        - DB: st_kakao_message_template
        - conditions: msg_template_id='ap0001'
    c) call kakao message send
      c-1) get message after set values of {st_kakao_message_template.msg_content}
        - "userName" : user name of target user_no
        - "productName" : refer to [API] GET /api/agent/store_order_list
           "{first product_name} {first order_count}개 외 {other produnct count except first}건"
            ex) "상품 1개 외 2건"
        - "orderNo" : {order_no}
        - "deliveryCompanyName" : {delivery_company_code} code name (Code: DC)
        - "deliveryInvoiceNo" : {delivery_invoice_no}
        - "deliveryViewUrl" : "http://info.sweettracker.co.kr/tracking/4?t_key=&amp;t_code=&amp;t_invoice=&quot;
          [parameter value]
          t_key : {delivery.api.key} property
          t_code : {delivery_company_code}
          t_invoice : {delivery_invoice_no}
      c-2) call ORACLE procedure
         - refer to attach txt file 
         - use ORACLE DB properites of config
    d) INSERT DB (st_kakao_message_send)
        - msg_template_id: 'ap0001'
        - receive_user_seq: target user_no
        - receive_tel_no: {hp} of target user_no
        - msg_send_date : current datetime
        - msg_content : send message content

  3) server log
    - level: INFO
    - message: "[Scheduler] 알림톡 배송알림(ap0001): " + "total Kakao message send count: {total count}"
 

Actions #21

Updated by Deca Park 11 months ago

  • File 1012_코레일유통_반영필요사항_en_20231013.pptx added
Actions #22

Updated by Deca Park 11 months ago

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

Updated by Deca Park 11 months ago

  • File deleted (1012_코레일유통_반영필요사항_en_20231013.pptx)
Actions #24

Updated by Deca Park 11 months ago

  • File 1012_코레일유통_반영필요사항_msg_en_20231013.pptx added
Actions #25

Updated by Deca Park 11 months ago

  • File deleted (1012_코레일유통_반영필요사항_msg_en_20231013.pptx)
Actions #26

Updated by Deca Park 11 months ago

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

Updated by Deca Park 8 months ago

  • Status changed from Resolved to Closed
Actions #28

Updated by Jisoo Choi 16 days ago

  • Tracker changed from New Function to Non-Function
  • Status changed from Closed to In Progress

 

 

현재 개발 서버에서도 알림톡이 발송되고 있는데, msg_template_id 'ap0001', 'ap0002', 'ap0003', 'ap0004' 전체에 대해 개발 서버에서의 알림톡 발송 중단을 부탁드립니다.

*운영 변동 x

 

 

 

 

 

 

Actions #29

Updated by Deca Park 12 days ago

  • Assignee changed from Deca Park to Toby Pham

[ADMIN] send kakao message(알림톡)

1.properties
  1) config-dev.properties
  #kakao.message send flag
  kakao.message.send=N

  2) config-prod.properties
  #kakao.message send flag
  kakao.message.send=Y

2.logic (add)
  1) when call following target function
    a) if kakao.message.send=Y
      - call the function (kakao message send)
    b) else
      - skip

  2) target function

  sendUserPointExpireMessage() 
  sendDeliveryMessage()
  sendDormantUserMessage()
  processReceiveWait()

[Test Result]

1.sendUserPointExpireMessage() 

  - although kakao.message.send = "N", kakao message is sent on dev server (I don't know why)
    (refer to st_kakao_message_send data)

2.Source

  @Value("${kakao.message.send}")
  private String kakaoMessageSend;  --> change variable name bcz kakaoMessageSend is used on other function

  if (kakaoMessageSend == "N")  --> use equals()

Actions #30

Updated by Deca Park 12 days ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Toby Pham to Jisoo Choi
Actions #31

Updated by Jisoo Choi 11 days ago

  • Status changed from Resolved to Closed
Actions #32

Updated by Deca Park 9 days ago

  • Status changed from Closed to Feedback
  • Assignee changed from Jisoo Choi to Toby Pham
Actions #33

Updated by Toby Pham 9 days ago

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

Updated by Deca Park 9 days ago

  • Status changed from Resolved to Closed
  • Assignee changed from Deca Park to Jisoo Choi
Actions

Also available in: Atom PDF