--- src/main/java/itn/let/kakao/user/sent/service/KakaoSentVO.java
+++ src/main/java/itn/let/kakao/user/sent/service/KakaoSentVO.java
... | ... | @@ -6,9 +6,11 @@ |
| 6 | 6 |
import itn.let.uss.umt.service.UserDefaultVO; |
| 7 | 7 |
import lombok.Getter; |
| 8 | 8 |
import lombok.Setter; |
| 9 |
+import lombok.ToString; |
|
| 9 | 10 |
|
| 10 | 11 |
@Getter |
| 11 | 12 |
@Setter |
| 13 |
+@ToString |
|
| 12 | 14 |
public class KakaoSentVO extends UserDefaultVO{
|
| 13 | 15 |
|
| 14 | 16 |
private static final long serialVersionUID = 1L; |
--- src/main/java/itn/let/kakao/user/sent/service/impl/KakaoSentServiceImpl.java
+++ src/main/java/itn/let/kakao/user/sent/service/impl/KakaoSentServiceImpl.java
... | ... | @@ -39,7 +39,9 @@ |
| 39 | 39 |
import itn.let.kakao.user.sent.service.KakaoSentService; |
| 40 | 40 |
import itn.let.kakao.user.sent.service.KakaoSentVO; |
| 41 | 41 |
import itn.let.mjo.msgsent.service.MjonMsgSentVO; |
| 42 |
+import lombok.extern.slf4j.Slf4j; |
|
| 42 | 43 |
|
| 44 |
+@Slf4j |
|
| 43 | 45 |
@Service("KakaoSentService")
|
| 44 | 46 |
public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements KakaoSentService{
|
| 45 | 47 |
|
... | ... | @@ -290,15 +292,27 @@ |
| 290 | 292 |
* */ |
| 291 | 293 |
private KakaoSentVO setPriceNCode(KakaoSentVO result) {
|
| 292 | 294 |
|
| 295 |
+ log.info("=============================== setPriceNCode ================================");
|
|
| 296 |
+ |
|
| 293 | 297 |
//성공 건수 세팅 |
| 294 | 298 |
KakaoSentVO eachCnt = new KakaoSentVO(); |
| 295 | 299 |
eachCnt.setMsgGroupId(result.getMsgGroupId()); |
| 296 | 300 |
eachCnt.setBizKakaoResendYn("Y".equals(result.getBizKakaoResendYn()) ? "Y" : "N");
|
| 301 |
+ eachCnt.setMsgType(result.getMsgType()); |
|
| 302 |
+ eachCnt.setBizKakaoImageType(result.getBizKakaoImageType()); |
|
| 303 |
+ eachCnt.setBizKakaoResendType(result.getBizKakaoResendType()); |
|
| 304 |
+ |
|
| 297 | 305 |
try {
|
| 306 |
+ log.info("eachCnt.getMsgType() :: [{}]", eachCnt.getMsgType());
|
|
| 307 |
+ log.info("eachCnt.getBizKakaoImageType() :: [{}]", eachCnt.getBizKakaoImageType());
|
|
| 308 |
+ log.info("eachCnt.getBizKakaoResendType() :: [{}]", eachCnt.getBizKakaoResendType());
|
|
| 309 |
+ |
|
| 298 | 310 |
eachCnt = kakaoSentDAO.selectKakaoSentCntEachCnt_advc(eachCnt); |
| 299 | 311 |
} catch (Exception e) {
|
| 300 | 312 |
System.out.println("setPriceNCode error!!");
|
| 301 | 313 |
} |
| 314 |
+ log.info(" + eachCnt.toString() :: [{}]", eachCnt.toString());
|
|
| 315 |
+// log.info(" + eachCnt.getSuccessPrice() :: [{}]", eachCnt.getSuccessPrice());
|
|
| 302 | 316 |
|
| 303 | 317 |
result.setSuccessCount(eachCnt.getSuccessCount()); |
| 304 | 318 |
result.setWaitCount(eachCnt.getWaitCount()); |
... | ... | @@ -331,9 +345,9 @@ |
| 331 | 345 |
|
| 332 | 346 |
//총금액 시작 |
| 333 | 347 |
//======================================================= |
| 334 |
- // TotPrice : 성공건수에 대한 금액 곱하기 |
|
| 335 |
- BigDecimal atPrice = new BigDecimal(successPrice); |
|
| 336 |
- BigDecimal kakaoResendPrice = new BigDecimal(kakaoResendSuccPrice); |
|
| 348 |
+ // TotPrice : 성공건수에 대한 금액 곱하기 ? : null 처리 |
|
| 349 |
+ BigDecimal atPrice = successPrice != null ? new BigDecimal(successPrice) : BigDecimal.ZERO; |
|
| 350 |
+ BigDecimal kakaoResendPrice = kakaoResendSuccPrice != null ? new BigDecimal(kakaoResendSuccPrice) : BigDecimal.ZERO; |
|
| 337 | 351 |
BigDecimal totalPrice = atPrice.add(kakaoResendPrice); |
| 338 | 352 |
// 소수점 한 자리로 설정 (반올림)// totalPrice 값을 소수점 한 자리까지 반올림하여 roundedTotalPrice에 저장 |
| 339 | 353 |
// RoundingMode.HALF_UP: 반올림 방식으로, 소수점 기준 5 이상이면 올림, 그렇지 않으면 내림 |
--- src/main/resources/egovframework/sqlmap/let/mjo/kakao/KakaoSent_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/mjo/kakao/KakaoSent_SQL_Mysql.xml
... | ... | @@ -1399,6 +1399,7 @@ |
| 1399 | 1399 |
A.BIZ_KAKAO_RESEND_DATA as bizKakaoResendData, |
| 1400 | 1400 |
B.AD_FLAG as adFlag , |
| 1401 | 1401 |
B.BIZ_KAKAO_IMAGE_TYPE as bizKakaoImageType , |
| 1402 |
+ B.BIZ_KAKAO_RESEND_TYPE as bizKakaoResendType , |
|
| 1402 | 1403 |
CASE |
| 1403 | 1404 |
WHEN B.AT_DELAY_YN = 'Y' AND B.AT_DELAY_COMPLETE_YN = 'N' |
| 1404 | 1405 |
THEN DATE_ADD(B.REQ_DATE, INTERVAL -30 MINUTE) |
... | ... | @@ -1670,23 +1671,96 @@ |
| 1670 | 1671 |
</select> |
| 1671 | 1672 |
|
| 1672 | 1673 |
<select id="KakaoSentDAO.selectKakaoSentCntEachCnt_advc" parameterClass="kakaoSentVO" resultClass="kakaoSentVO"> |
| 1674 |
+ /* KakaoSentDAO.selectKakaoSentCntEachCnt_advc */ |
|
| 1673 | 1675 |
SELECT |
| 1674 |
- a.MSG_GROUP_ID AS msgGroupId |
|
| 1675 |
- , a.successCount |
|
| 1676 |
- , a.waitCount |
|
| 1677 |
- , a.failCount |
|
| 1678 |
- , a.divideYn |
|
| 1679 |
- <isEqual property="bizKakaoResendYn" compareValue="Y"> |
|
| 1680 |
- , a.kakaoResendSuccCount |
|
| 1681 |
- , a.kakaoResendFailCount |
|
| 1682 |
- , a.successCount * bkp.BIZ_KAKAO_AT_PRICE AS successPrice |
|
| 1683 |
- , (a.smsCnt * bkp.BIZ_SMS_PRICE) + (a.mmsCnt * bkp.BIZ_MMS_PRICE) AS kakaoResendSuccPrice |
|
| 1684 |
- </isEqual> |
|
| 1685 |
- <isNotEqual property="bizKakaoResendYn" compareValue="Y"> |
|
| 1686 |
- , 0 AS kakaoResendSuccCount |
|
| 1687 |
- , 0 AS kakaoResendFailCount |
|
| 1688 |
- , 0 AS successPrice |
|
| 1689 |
- , 0 AS kakaoResendSuccPrice |
|
| 1676 |
+ a.MSG_GROUP_ID AS msgGroupId |
|
| 1677 |
+ , a.successCount |
|
| 1678 |
+ , a.waitCount |
|
| 1679 |
+ , a.failCount |
|
| 1680 |
+ , a.divideYn |
|
| 1681 |
+ <isEqual property="bizKakaoResendYn" compareValue="Y"> |
|
| 1682 |
+ , a.kakaoResendSuccCount |
|
| 1683 |
+ , a.kakaoResendFailCount |
|
| 1684 |
+ |
|
| 1685 |
+ |
|
| 1686 |
+ <isEqual property="msgType" compareValue="8"> |
|
| 1687 |
+ , a.successCount * bkp.BIZ_KAKAO_AT_PRICE AS successPrice |
|
| 1688 |
+ , (a.smsCnt * bkp.BIZ_SMS_PRICE) + (a.mmsCnt * bkp.BIZ_MMS_PRICE) AS kakaoResendSuccPrice |
|
| 1689 |
+ |
|
| 1690 |
+ </isEqual> |
|
| 1691 |
+ |
|
| 1692 |
+ |
|
| 1693 |
+ |
|
| 1694 |
+ <isEqual property="msgType" compareValue="9"> |
|
| 1695 |
+ |
|
| 1696 |
+ <!-- bizKakaoImageType 있음 + MMS --> |
|
| 1697 |
+ <isNotEmpty property="bizKakaoImageType"> |
|
| 1698 |
+ |
|
| 1699 |
+ |
|
| 1700 |
+ <!-- 와이드 이미지인 경우 --> |
|
| 1701 |
+ <isEqual property="bizKakaoImageType" compareValue="W"> |
|
| 1702 |
+ , a.successCount * bkp.BIZ_KAKAO_FT_WIDE_IMG_PRICE AS successPrice |
|
| 1703 |
+ </isEqual> |
|
| 1704 |
+ |
|
| 1705 |
+ <!-- 일반 이미지인 경우 --> |
|
| 1706 |
+ <isEqual property="bizKakaoImageType" compareValue="I"> |
|
| 1707 |
+ , a.successCount * bkp.BIZ_KAKAO_FT_IMG_PRICE AS successPrice |
|
| 1708 |
+ </isEqual> |
|
| 1709 |
+ |
|
| 1710 |
+ , (a.smsCnt * bkp.BIZ_SMS_PRICE) + (a.mmsCnt * bkp.BIZ_PICTURE_PRICE) AS kakaoResendSuccPrice |
|
| 1711 |
+ </isNotEmpty> |
|
| 1712 |
+ |
|
| 1713 |
+ |
|
| 1714 |
+ <!-- 이미지 없음 --> |
|
| 1715 |
+ <isEmpty property="bizKakaoImageType"> |
|
| 1716 |
+ |
|
| 1717 |
+ |
|
| 1718 |
+ , a.successCount * bkp.BIZ_KAKAO_FT_PRICE AS successPrice |
|
| 1719 |
+ <isEqual property="bizKakaoResendType" compareValue="MMS"> |
|
| 1720 |
+ , (a.smsCnt * bkp.BIZ_SMS_PRICE) + (a.mmsCnt * bkp.BIZ_MMS_PRICE) AS kakaoResendSuccPrice |
|
| 1721 |
+ </isEqual> |
|
| 1722 |
+ |
|
| 1723 |
+ <isEqual property="bizKakaoResendType" compareValue="SMS"> |
|
| 1724 |
+ , (a.smsCnt * bkp.BIZ_SMS_PRICE) + (a.mmsCnt * 0) AS kakaoResendSuccPrice |
|
| 1725 |
+ </isEqual> |
|
| 1726 |
+ |
|
| 1727 |
+ <!-- 예외: bizKakaoResendType 이 MMS, SMS 둘 다 아닐 경우 --> |
|
| 1728 |
+ <isNotEqual property="bizKakaoResendType" compareValue="MMS"> |
|
| 1729 |
+ <isNotEqual property="bizKakaoResendType" compareValue="SMS"> |
|
| 1730 |
+ , 0 AS kakaoResendSuccPrice |
|
| 1731 |
+ </isNotEqual> |
|
| 1732 |
+ </isNotEqual> |
|
| 1733 |
+ </isEmpty> |
|
| 1734 |
+ </isEqual> |
|
| 1735 |
+ </isEqual> |
|
| 1736 |
+ <isNotEqual property="bizKakaoResendYn" compareValue="Y"> |
|
| 1737 |
+ , 0 AS kakaoResendSuccCount |
|
| 1738 |
+ , 0 AS kakaoResendFailCount |
|
| 1739 |
+ <isEqual property="msgType" compareValue="8"> |
|
| 1740 |
+ , a.successCount * bkp.BIZ_KAKAO_AT_PRICE AS successPrice |
|
| 1741 |
+ </isEqual> |
|
| 1742 |
+ |
|
| 1743 |
+ <isEqual property="msgType" compareValue="9"> |
|
| 1744 |
+ |
|
| 1745 |
+ <!-- 와이드 이미지인 경우 --> |
|
| 1746 |
+ <isEqual property="bizKakaoImageType" compareValue="W"> |
|
| 1747 |
+ , a.successCount * bkp.BIZ_KAKAO_FT_WIDE_IMG_PRICE AS successPrice |
|
| 1748 |
+ </isEqual> |
|
| 1749 |
+ |
|
| 1750 |
+ <!-- 일반 이미지인 경우 --> |
|
| 1751 |
+ <isEqual property="bizKakaoImageType" compareValue="I"> |
|
| 1752 |
+ , a.successCount * bkp.BIZ_KAKAO_FT_IMG_PRICE AS successPrice |
|
| 1753 |
+ </isEqual> |
|
| 1754 |
+ |
|
| 1755 |
+ <!-- 텍스트형(이미지 없음)인 경우 --> |
|
| 1756 |
+ <isNotEqual property="bizKakaoImageType" compareValue="W"> |
|
| 1757 |
+ <isNotEqual property="bizKakaoImageType" compareValue="I"> |
|
| 1758 |
+ , a.successCount * bkp.BIZ_KAKAO_FT_PRICE AS successPrice |
|
| 1759 |
+ </isNotEqual> |
|
| 1760 |
+ </isNotEqual> |
|
| 1761 |
+ |
|
| 1762 |
+ </isEqual> |
|
| 1763 |
+ , 0 AS kakaoResendSuccPrice |
|
| 1690 | 1764 |
</isNotEqual> |
| 1691 | 1765 |
FROM ( |
| 1692 | 1766 |
SELECT |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?