Преглед изворни кода

Merge branch 'sowon' into develop

sowon4187 пре 5 година
родитељ
комит
1a5ed959be

+ 40 - 0
src/main/java/com/style24/core/biz/service/TscKakaotalkService.java

@@ -14,6 +14,7 @@ import com.style24.core.support.env.TscConstants;
 import com.style24.persistence.domain.CustContactHst;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.GiftCard;
+import com.style24.persistence.domain.Point;
 import com.style24.persistence.domain.SsgDirectMessage;
 
 import lombok.extern.slf4j.Slf4j;
@@ -188,6 +189,45 @@ public class TscKakaotalkService {
 		}
 
 	}
+	
+
+	/**
+	 *  포인트 기간만료 알림톡(30일)
+	 * @param point - 상품권 정보
+	 * @param senderNo - 발송자번호(고객번호)
+	 * @author sowon
+	 * @since 2021. 5. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void sendPointExpectNotify(Point point, Integer senderNo) {
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(senderNo)); // 발송자NO
+		dm.setFdestine(point.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", siteNm);
+		replaceInfo.setString("custNm", point.getCustNm());
+		replaceInfo.setString("rmPntAmt", Integer.toString(point.getRmPntAmt()));
+		replaceInfo.setString("expBeDt", point.getExpBeDt());
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.POINT_EXTNC_EXPECT.value(), dm, replaceInfo);
+		
+		try {
+			// 고객접촉이력 정보
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.POINT_EXTNC_EXPECT.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); 		// 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setContactContents("포인트소멸예정");
+			custContactHst.setReceiverNo(point.getCustNo());
+			custContactHst.setSenderNo(senderNo);
+			custContactHst.setRegNo(senderNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+
+	}
 
 
 //	/**

+ 13 - 0
src/main/java/com/style24/persistence/domain/Point.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.style24.core.support.util.CryptoUtils;
 import com.style24.persistence.TscBaseDomain;
 import lombok.Data;
 
@@ -15,6 +16,8 @@ import lombok.Data;
 public class Point extends TscBaseDomain {
 	private Integer custPntSq;	// 고객포인트일련번호
 	private Integer custNo;		// 고객번호
+	private String custNm;		// 고객이름
+	private String cellPhnno;	// 휴대전화번호(탈퇴 시 NULL로 처리)
 	private String expBeDt;		// 만료예정일시
 	private String expCmpDt;	// 만료완료일시
 	private int gvPntAmt;		// 지급포인트
@@ -43,4 +46,14 @@ public class Point extends TscBaseDomain {
 	private String searchDt;			// 검색일자
 	private int buyPointExpireDays;		// 구매포인트소멸일
 	private int autoBuyConfirmDays;		// 자동구매확정일
+	
+	// 암호화 대상 복호화 처리
+	public String getCustNm() {
+		this.custNm = CryptoUtils.decryptAES(this.custNm);
+		return this.custNm;
+	}
+	public String getCellPhnno() {
+		this.cellPhnno = CryptoUtils.decryptAES(this.cellPhnno);
+		return this.cellPhnno;
+	}
 }