--- src/main/java/itn/com/cmm/MjonMsgSendVO.java
+++ src/main/java/itn/com/cmm/MjonMsgSendVO.java
... | ... | @@ -108,7 +108,13 @@ |
| 108 | 108 |
private String filePath3; |
| 109 | 109 |
|
| 110 | 110 |
|
| 111 |
+ |
|
| 112 |
+ /** |
|
| 113 |
+ * @description : 개별단가 |
|
| 114 |
+ */ |
|
| 115 |
+ private String eachPrice; |
|
| 111 | 116 |
|
| 117 |
+ |
|
| 112 | 118 |
|
| 113 | 119 |
|
| 114 | 120 |
|
--- src/main/java/itn/com/cmm/util/MsgSendUtils.java
+++ src/main/java/itn/com/cmm/util/MsgSendUtils.java
... | ... | @@ -3,7 +3,12 @@ |
| 3 | 3 |
import java.io.UnsupportedEncodingException; |
| 4 | 4 |
import java.math.BigDecimal; |
| 5 | 5 |
import java.math.RoundingMode; |
| 6 |
+import java.text.SimpleDateFormat; |
|
| 7 |
+import java.util.ArrayList; |
|
| 8 |
+import java.util.Calendar; |
|
| 9 |
+import java.util.Date; |
|
| 6 | 10 |
import java.util.HashMap; |
| 11 |
+import java.util.Iterator; |
|
| 7 | 12 |
import java.util.List; |
| 8 | 13 |
import java.util.Map; |
| 9 | 14 |
import java.util.Objects; |
... | ... | @@ -21,6 +26,8 @@ |
| 21 | 26 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 22 | 27 |
import itn.let.mjo.spammsg.web.ComGetSpamStringParser; |
| 23 | 28 |
import itn.let.module.base.PriceAndPoint; |
| 29 |
+import itn.let.sym.site.service.JoinSettingVO; |
|
| 30 |
+import itn.let.uss.umt.service.MberManageVO; |
|
| 24 | 31 |
import lombok.extern.slf4j.Slf4j; |
| 25 | 32 |
|
| 26 | 33 |
/** |
... | ... | @@ -58,7 +65,7 @@ |
| 58 | 65 |
String smsCont = smsTxt.replace("\r\n", "\n");
|
| 59 | 66 |
smsBytes = smsCont.getBytes(charset).length; |
| 60 | 67 |
} |
| 61 |
- log.info(" + smsBytes :: [{}]", smsBytes);
|
|
| 68 |
+// log.info(" + smsBytes :: [{}]", smsBytes);
|
|
| 62 | 69 |
return smsBytes; |
| 63 | 70 |
} |
| 64 | 71 |
|
... | ... | @@ -180,11 +187,37 @@ |
| 180 | 187 |
public static Boolean populateSendLists(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendListVO, StatusResponse statusResponse, List<String> resultSpamTxt) throws Exception{
|
| 181 | 188 |
|
| 182 | 189 |
log.info(" :: populateSendLists :: ");
|
| 190 |
+ |
|
| 191 |
+ |
|
| 192 |
+ log.info(" + 예약여부 [{}]", mjonMsgVO.getReserveYn()); // 예약 여부
|
|
| 193 |
+ log.info(" + 시간 [{}]", mjonMsgVO.getReqDate()); // 시간
|
|
| 194 |
+ log.info(" + 분할체크 [{}]", mjonMsgVO.getDivideChk()); // 분할체크
|
|
| 195 |
+ log.info(" + 간격(분) [{}]", mjonMsgVO.getDivideTime()); // 간격
|
|
| 196 |
+ log.info(" + 몇 건씩 [{}]", mjonMsgVO.getDivideCnt()); // 몇 건식
|
|
| 183 | 197 |
|
| 198 |
+ |
|
| 199 |
+ // 예약 시간 기본값 설정 |
|
| 200 |
+ Date now = new Date(); |
|
| 201 |
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
| 202 |
+ |
|
| 203 |
+ // ReqDate가 비어 있으면 현재 시간으로 설정, 그렇지 않으면 ReqDate로 설정 |
|
| 204 |
+ Date baseDate; |
|
| 205 |
+ if (StringUtils.isEmpty(mjonMsgVO.getReqDate())) {
|
|
| 206 |
+ mjonMsgVO.setReqDate(sdf.format(now)); // ReqDate에 현재 시간 설정 |
|
| 207 |
+ baseDate = now; |
|
| 208 |
+ } else {
|
|
| 209 |
+ baseDate = sdf.parse(mjonMsgVO.getReqDate()); // ReqDate를 baseDate로 설정 |
|
| 210 |
+ } |
|
| 211 |
+ |
|
| 212 |
+ Calendar calendar = Calendar.getInstance(); |
|
| 213 |
+ calendar.setTime(baseDate); // calendar에 baseDate 설정 |
|
| 214 |
+ int counter = 0; // 분할 건수 카운터 |
|
| 215 |
+ |
|
| 216 |
+ // 데이터 모두다 스팸 체크를 안하고 건별로 갯수를 정해서 스팸체크를 한다. |
|
| 184 | 217 |
int spamChkSize = getSpamChkSize(mjonMsgSendListVO.size()); |
| 185 | 218 |
int sampleCounter = 0; |
| 186 | 219 |
|
| 187 |
- String smsTxtTemp = mjonMsgVO.getSmsTxt(); |
|
| 220 |
+ |
|
| 188 | 221 |
|
| 189 | 222 |
// 치환 구문과 필드 getter 매핑 |
| 190 | 223 |
Map<String, Function<MjonMsgSendVO, String>> placeholders = new HashMap<>(); |
... | ... | @@ -196,6 +229,8 @@ |
| 196 | 229 |
|
| 197 | 230 |
boolean hasPerformedSpamCheck = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어 |
| 198 | 231 |
boolean hasPerformedMsgType = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어 |
| 232 |
+ |
|
| 233 |
+ String smsTxtTemp = mjonMsgVO.getSmsTxt(); |
|
| 199 | 234 |
Boolean replaceYN = getReplaceYN(smsTxtTemp); |
| 200 | 235 |
|
| 201 | 236 |
String msgTypeResult = null; |
... | ... | @@ -231,7 +266,6 @@ |
| 231 | 266 |
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt); |
| 232 | 267 |
sampleCounter++; |
| 233 | 268 |
} |
| 234 |
- log.info(" ++ smsTxt:: [{}]", smsTxt);
|
|
| 235 | 269 |
sendVO.setSmsTxt(smsTxt); |
| 236 | 270 |
|
| 237 | 271 |
// 이미지 셋팅 |
... | ... | @@ -239,7 +273,6 @@ |
| 239 | 273 |
|
| 240 | 274 |
|
| 241 | 275 |
// msgType 셋팅 및 문자열 체크 |
| 242 |
- log.info(" + smsTxt :: [{}]", smsTxt);
|
|
| 243 | 276 |
if (!replaceYN && !hasPerformedMsgType) {
|
| 244 | 277 |
log.info(" 치환 X ");
|
| 245 | 278 |
// byte 체크와 msgType 구하기 |
... | ... | @@ -260,6 +293,30 @@ |
| 260 | 293 |
} |
| 261 | 294 |
|
| 262 | 295 |
sendVO.setMsgType(msgTypeResult); |
| 296 |
+ |
|
| 297 |
+ |
|
| 298 |
+ |
|
| 299 |
+ |
|
| 300 |
+ // 예약 여부 확인 |
|
| 301 |
+ if ("Y".equalsIgnoreCase(mjonMsgVO.getReserveYn())) {
|
|
| 302 |
+ // 분할 발송일 경우 |
|
| 303 |
+ if ("on".equalsIgnoreCase(mjonMsgVO.getDivideChk())) {
|
|
| 304 |
+ if (counter == Integer.parseInt(mjonMsgVO.getDivideCnt())) { // 지정된 건수마다 간격 추가
|
|
| 305 |
+ counter = 0; |
|
| 306 |
+ calendar.add(Calendar.MINUTE, Integer.parseInt(mjonMsgVO.getDivideTime())); |
|
| 307 |
+ } |
|
| 308 |
+ counter++; |
|
| 309 |
+ } |
|
| 310 |
+ // 예약 시간 설정 |
|
| 311 |
+ sendVO.setReqDate(sdf.format(calendar.getTime())); // 분할된 시간 설정 또는 기본 예약 시간 사용 |
|
| 312 |
+ } else {
|
|
| 313 |
+ // 예약 여부가 N일 경우에도 기본 예약 시간 설정 |
|
| 314 |
+ sendVO.setReqDate(sdf.format(calendar.getTime())); |
|
| 315 |
+ } |
|
| 316 |
+ |
|
| 317 |
+ |
|
| 318 |
+ |
|
| 319 |
+ |
|
| 263 | 320 |
|
| 264 | 321 |
} |
| 265 | 322 |
|
... | ... | @@ -426,5 +483,94 @@ |
| 426 | 483 |
return array == null || array.length == 0; |
| 427 | 484 |
} |
| 428 | 485 |
|
| 486 |
+ public static void setPriceforVO(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendVOList, JoinSettingVO sysJoinSetVO, |
|
| 487 |
+ MberManageVO mberManageVO) {
|
|
| 488 |
+ |
|
| 489 |
+ // 사용자 단가 정보 설정 (협의 단가가 없을 경우 시스템 단가를 적용) |
|
| 490 |
+ float shortPrice = MsgSendUtils.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice()); |
|
| 491 |
+ float longPrice = MsgSendUtils.getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice()); |
|
| 492 |
+ float picturePrice = MsgSendUtils.getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice()); |
|
| 493 |
+ float picture2Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture2Price(), sysJoinSetVO.getPicture2Price()); |
|
| 494 |
+ float picture3Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture3Price(), sysJoinSetVO.getPicture3Price()); |
|
| 495 |
+ |
|
| 496 |
+ // 각 메시지 타입에 따라 사용자 단가 설정 및 총 단가 계산 |
|
| 497 |
+ float totalPrice = 0.0f; |
|
| 498 |
+ |
|
| 499 |
+ for (MjonMsgSendVO sendVO : mjonMsgSendVOList) {
|
|
| 500 |
+ String msgType = sendVO.getMsgType(); |
|
| 501 |
+ String eachPrice; |
|
| 429 | 502 |
|
| 503 |
+ switch (msgType) {
|
|
| 504 |
+ case "4": // 단문 메시지 타입 |
|
| 505 |
+ eachPrice = Float.toString(shortPrice); |
|
| 506 |
+ break; |
|
| 507 |
+ |
|
| 508 |
+ case "6": // 장문 또는 이미지 메시지 타입 |
|
| 509 |
+ eachPrice = getPicturePrice(sendVO, longPrice, picturePrice, picture2Price, picture3Price); |
|
| 510 |
+ break; |
|
| 511 |
+ |
|
| 512 |
+ default: |
|
| 513 |
+ // 기본값이 필요하다면 추가 가능 |
|
| 514 |
+ eachPrice = "0"; |
|
| 515 |
+ break; |
|
| 516 |
+ } |
|
| 517 |
+ |
|
| 518 |
+ sendVO.setEachPrice(eachPrice); |
|
| 519 |
+// log.info(" eachPrice :: [{}]", eachPrice);
|
|
| 520 |
+ |
|
| 521 |
+ // 각 가격을 합산 |
|
| 522 |
+ totalPrice += Float.parseFloat(eachPrice); |
|
| 523 |
+ } |
|
| 524 |
+ mjonMsgVO.setTotalPrice(totalPrice); |
|
| 525 |
+ |
|
| 526 |
+// log.debug("총 단가 합계: [{}]", totalPrice);
|
|
| 527 |
+ |
|
| 528 |
+ } |
|
| 529 |
+ |
|
| 530 |
+ /** |
|
| 531 |
+ * 이미지 파일 경로를 기준으로 적절한 가격을 반환하는 헬퍼 메소드. |
|
| 532 |
+ */ |
|
| 533 |
+ private static String getPicturePrice(MjonMsgSendVO sendVO, float longPrice, float picturePrice, float picture2Price, float picture3Price) {
|
|
| 534 |
+ if (StringUtils.isNotEmpty(sendVO.getFilePath3())) {
|
|
| 535 |
+ return Float.toString(picture3Price); |
|
| 536 |
+ } else if (StringUtils.isNotEmpty(sendVO.getFilePath2())) {
|
|
| 537 |
+ return Float.toString(picture2Price); |
|
| 538 |
+ } else if (StringUtils.isNotEmpty(sendVO.getFilePath1())) {
|
|
| 539 |
+ return Float.toString(picturePrice); |
|
| 540 |
+ } else {
|
|
| 541 |
+ return Float.toString(longPrice); |
|
| 542 |
+ } |
|
| 543 |
+ } |
|
| 544 |
+ |
|
| 545 |
+ public static List<MjonMsgSendVO> getOptimalMsgList(double totalPrice, double eventRemainCash, |
|
| 546 |
+ List<MjonMsgSendVO> mjonMsgSendVOList) {
|
|
| 547 |
+ |
|
| 548 |
+ double targetCash = eventRemainCash; |
|
| 549 |
+ |
|
| 550 |
+ // 최적의 리스트를 구성하기 위한 빈 리스트 생성 |
|
| 551 |
+ List<MjonMsgSendVO> optimalList = new ArrayList<>(); |
|
| 552 |
+ double sum = 0.0; |
|
| 553 |
+ |
|
| 554 |
+ // 원본 리스트의 요소를 순회하며 조건에 맞는 항목을 최적 리스트에 추가 |
|
| 555 |
+ Iterator<MjonMsgSendVO> iterator = mjonMsgSendVOList.iterator(); |
|
| 556 |
+ while (iterator.hasNext()) {
|
|
| 557 |
+ MjonMsgSendVO msg = iterator.next(); |
|
| 558 |
+ double eachPrice = Double.parseDouble(msg.getEachPrice()); |
|
| 559 |
+ |
|
| 560 |
+ // sum + eachPrice가 정확히 targetCash와 같거나 작을 때만 추가하고 원본에서 제거 |
|
| 561 |
+ if (sum + eachPrice <= targetCash) {
|
|
| 562 |
+ sum += eachPrice; |
|
| 563 |
+ optimalList.add(msg); |
|
| 564 |
+ iterator.remove(); // 원본 리스트에서 해당 요소 제거 |
|
| 565 |
+ } else {
|
|
| 566 |
+ break; // 초과하지 않도록, 더 이상 추가할 수 없는 경우 종료 |
|
| 567 |
+ } |
|
| 568 |
+ } |
|
| 569 |
+ log.info(" + targetCash :: [{}]", targetCash);
|
|
| 570 |
+ log.info(" + sum :: [{}]", sum);
|
|
| 571 |
+ |
|
| 572 |
+ // 최적 리스트 반환 |
|
| 573 |
+ return optimalList; |
|
| 574 |
+ |
|
| 575 |
+ } |
|
| 430 | 576 |
} |
--- src/main/java/itn/let/mjo/event/service/MjonEventService.java
+++ src/main/java/itn/let/mjo/event/service/MjonEventService.java
... | ... | @@ -38,4 +38,6 @@ |
| 38 | 38 |
|
| 39 | 39 |
//현재 진행중 이벤트 상태 정보 불러오기 |
| 40 | 40 |
MjonEventCheckVO selectEventStatus(MjonEventCheckVO p_MjonEventCheckVO) throws Exception; |
| 41 |
+ |
|
| 42 |
+ MjonEventVO selectEventMsgMberDefaultInfo_advc(String userId) throws Exception; |
|
| 41 | 43 |
} |
--- src/main/java/itn/let/mjo/event/service/MjonEventVO.java
+++ src/main/java/itn/let/mjo/event/service/MjonEventVO.java
... | ... | @@ -1,5 +1,12 @@ |
| 1 | 1 |
package itn.let.mjo.event.service; |
| 2 | 2 |
|
| 3 |
+import lombok.Getter; |
|
| 4 |
+import lombok.Setter; |
|
| 5 |
+import lombok.ToString; |
|
| 6 |
+ |
|
| 7 |
+@Getter |
|
| 8 |
+@Setter |
|
| 9 |
+@ToString |
|
| 3 | 10 |
public class MjonEventVO {
|
| 4 | 11 |
|
| 5 | 12 |
|
... | ... | @@ -32,220 +39,4 @@ |
| 32 | 39 |
private String userId; //사용자 아이디 |
| 33 | 40 |
private String frstRegisterId; //등록자 아이디 |
| 34 | 41 |
|
| 35 |
- public double getEventRemainOriginCash() {
|
|
| 36 |
- return eventRemainOriginCash; |
|
| 37 |
- } |
|
| 38 |
- |
|
| 39 |
- public void setEventRemainOriginCash(double eventRemainOriginCash) {
|
|
| 40 |
- this.eventRemainOriginCash = eventRemainOriginCash; |
|
| 41 |
- } |
|
| 42 |
- |
|
| 43 |
- public String getEventInfoId() {
|
|
| 44 |
- return eventInfoId; |
|
| 45 |
- } |
|
| 46 |
- |
|
| 47 |
- public void setEventInfoId(String eventInfoId) {
|
|
| 48 |
- this.eventInfoId = eventInfoId; |
|
| 49 |
- } |
|
| 50 |
- |
|
| 51 |
- public String getUniqId() {
|
|
| 52 |
- return uniqId; |
|
| 53 |
- } |
|
| 54 |
- |
|
| 55 |
- public void setUniqId(String uniqId) {
|
|
| 56 |
- this.uniqId = uniqId; |
|
| 57 |
- } |
|
| 58 |
- |
|
| 59 |
- public String getMberId() {
|
|
| 60 |
- return mberId; |
|
| 61 |
- } |
|
| 62 |
- |
|
| 63 |
- public void setMberId(String mberId) {
|
|
| 64 |
- this.mberId = mberId; |
|
| 65 |
- } |
|
| 66 |
- |
|
| 67 |
- public String getMberNm() {
|
|
| 68 |
- return mberNm; |
|
| 69 |
- } |
|
| 70 |
- |
|
| 71 |
- public void setMberNm(String mberNm) {
|
|
| 72 |
- this.mberNm = mberNm; |
|
| 73 |
- } |
|
| 74 |
- |
|
| 75 |
- public String getEventNttId() {
|
|
| 76 |
- return eventNttId; |
|
| 77 |
- } |
|
| 78 |
- |
|
| 79 |
- public void setEventNttId(String eventNttId) {
|
|
| 80 |
- this.eventNttId = eventNttId; |
|
| 81 |
- } |
|
| 82 |
- |
|
| 83 |
- public String getEventBbsId() {
|
|
| 84 |
- return eventBbsId; |
|
| 85 |
- } |
|
| 86 |
- |
|
| 87 |
- public void setEventBbsId(String eventBbsId) {
|
|
| 88 |
- this.eventBbsId = eventBbsId; |
|
| 89 |
- } |
|
| 90 |
- |
|
| 91 |
- public String getEventStartDate() {
|
|
| 92 |
- return eventStartDate; |
|
| 93 |
- } |
|
| 94 |
- |
|
| 95 |
- public void setEventStartDate(String eventStartDate) {
|
|
| 96 |
- this.eventStartDate = eventStartDate; |
|
| 97 |
- } |
|
| 98 |
- |
|
| 99 |
- public String getEventEndDate() {
|
|
| 100 |
- return eventEndDate; |
|
| 101 |
- } |
|
| 102 |
- |
|
| 103 |
- public void setEventEndDate(String eventEndDate) {
|
|
| 104 |
- this.eventEndDate = eventEndDate; |
|
| 105 |
- } |
|
| 106 |
- |
|
| 107 |
- public double getEventFrstCash() {
|
|
| 108 |
- return eventFrstCash; |
|
| 109 |
- } |
|
| 110 |
- |
|
| 111 |
- public void setEventFrstCash(double eventFrstCash) {
|
|
| 112 |
- this.eventFrstCash = eventFrstCash; |
|
| 113 |
- } |
|
| 114 |
- |
|
| 115 |
- public double getEventRemainCash() {
|
|
| 116 |
- return eventRemainCash; |
|
| 117 |
- } |
|
| 118 |
- |
|
| 119 |
- public void setEventRemainCash(double eventRemainCash) {
|
|
| 120 |
- this.eventRemainCash = eventRemainCash; |
|
| 121 |
- } |
|
| 122 |
- |
|
| 123 |
- public String getEventPgMoid() {
|
|
| 124 |
- return eventPgMoid; |
|
| 125 |
- } |
|
| 126 |
- |
|
| 127 |
- public void setEventPgMoid(String eventPgMoid) {
|
|
| 128 |
- this.eventPgMoid = eventPgMoid; |
|
| 129 |
- } |
|
| 130 |
- |
|
| 131 |
- public String getEventShortPrice() {
|
|
| 132 |
- return eventShortPrice; |
|
| 133 |
- } |
|
| 134 |
- |
|
| 135 |
- public void setEventShortPrice(String eventShortPrice) {
|
|
| 136 |
- this.eventShortPrice = eventShortPrice; |
|
| 137 |
- } |
|
| 138 |
- |
|
| 139 |
- public String getEventLongPrice() {
|
|
| 140 |
- return eventLongPrice; |
|
| 141 |
- } |
|
| 142 |
- |
|
| 143 |
- public void setEventLongPrice(String eventLongPrice) {
|
|
| 144 |
- this.eventLongPrice = eventLongPrice; |
|
| 145 |
- } |
|
| 146 |
- |
|
| 147 |
- public String getEventPicturePrice() {
|
|
| 148 |
- return eventPicturePrice; |
|
| 149 |
- } |
|
| 150 |
- |
|
| 151 |
- public void setEventPicturePrice(String eventPicturePrice) {
|
|
| 152 |
- this.eventPicturePrice = eventPicturePrice; |
|
| 153 |
- } |
|
| 154 |
- |
|
| 155 |
- public String getEventPicture2Price() {
|
|
| 156 |
- return eventPicture2Price; |
|
| 157 |
- } |
|
| 158 |
- |
|
| 159 |
- public void setEventPicture2Price(String eventPicture2Price) {
|
|
| 160 |
- this.eventPicture2Price = eventPicture2Price; |
|
| 161 |
- } |
|
| 162 |
- |
|
| 163 |
- public String getEventPicture3Price() {
|
|
| 164 |
- return eventPicture3Price; |
|
| 165 |
- } |
|
| 166 |
- |
|
| 167 |
- public void setEventPicture3Price(String eventPicture3Price) {
|
|
| 168 |
- this.eventPicture3Price = eventPicture3Price; |
|
| 169 |
- } |
|
| 170 |
- |
|
| 171 |
- public String getEventPolicyYn() {
|
|
| 172 |
- return eventPolicyYn; |
|
| 173 |
- } |
|
| 174 |
- |
|
| 175 |
- public void setEventPolicyYn(String eventPolicyYn) {
|
|
| 176 |
- this.eventPolicyYn = eventPolicyYn; |
|
| 177 |
- } |
|
| 178 |
- |
|
| 179 |
- public String getEventSmsYn() {
|
|
| 180 |
- return eventSmsYn; |
|
| 181 |
- } |
|
| 182 |
- |
|
| 183 |
- public void setEventSmsYn(String eventSmsYn) {
|
|
| 184 |
- this.eventSmsYn = eventSmsYn; |
|
| 185 |
- } |
|
| 186 |
- |
|
| 187 |
- public String getEventStatus() {
|
|
| 188 |
- return eventStatus; |
|
| 189 |
- } |
|
| 190 |
- |
|
| 191 |
- public void setEventStatus(String eventStatus) {
|
|
| 192 |
- this.eventStatus = eventStatus; |
|
| 193 |
- } |
|
| 194 |
- |
|
| 195 |
- public String getEventMemo() {
|
|
| 196 |
- return eventMemo; |
|
| 197 |
- } |
|
| 198 |
- |
|
| 199 |
- public void setEventMemo(String eventMemo) {
|
|
| 200 |
- this.eventMemo = eventMemo; |
|
| 201 |
- } |
|
| 202 |
- |
|
| 203 |
- public String getFrstRegistPnttm() {
|
|
| 204 |
- return frstRegistPnttm; |
|
| 205 |
- } |
|
| 206 |
- |
|
| 207 |
- public void setFrstRegistPnttm(String frstRegistPnttm) {
|
|
| 208 |
- this.frstRegistPnttm = frstRegistPnttm; |
|
| 209 |
- } |
|
| 210 |
- |
|
| 211 |
- public String getLastUpdtPnttm() {
|
|
| 212 |
- return lastUpdtPnttm; |
|
| 213 |
- } |
|
| 214 |
- |
|
| 215 |
- public void setLastUpdtPnttm(String lastUpdtPnttm) {
|
|
| 216 |
- this.lastUpdtPnttm = lastUpdtPnttm; |
|
| 217 |
- } |
|
| 218 |
- |
|
| 219 |
- public String getPayCount() {
|
|
| 220 |
- return payCount; |
|
| 221 |
- } |
|
| 222 |
- |
|
| 223 |
- public void setPayCount(String payCount) {
|
|
| 224 |
- this.payCount = payCount; |
|
| 225 |
- } |
|
| 226 |
- |
|
| 227 |
- public String getPoint() {
|
|
| 228 |
- return point; |
|
| 229 |
- } |
|
| 230 |
- |
|
| 231 |
- public void setPoint(String point) {
|
|
| 232 |
- this.point = point; |
|
| 233 |
- } |
|
| 234 |
- |
|
| 235 |
- public String getUserId() {
|
|
| 236 |
- return userId; |
|
| 237 |
- } |
|
| 238 |
- |
|
| 239 |
- public void setUserId(String userId) {
|
|
| 240 |
- this.userId = userId; |
|
| 241 |
- } |
|
| 242 |
- |
|
| 243 |
- public String getFrstRegisterId() {
|
|
| 244 |
- return frstRegisterId; |
|
| 245 |
- } |
|
| 246 |
- |
|
| 247 |
- public void setFrstRegisterId(String frstRegisterId) {
|
|
| 248 |
- this.frstRegisterId = frstRegisterId; |
|
| 249 |
- } |
|
| 250 |
- |
|
| 251 | 42 |
} |
--- src/main/java/itn/let/mjo/event/service/impl/MjonEventServiceImpl.java
+++ src/main/java/itn/let/mjo/event/service/impl/MjonEventServiceImpl.java
... | ... | @@ -45,6 +45,14 @@ |
| 45 | 45 |
return mjonEventDAO.selectEventMsgMberDefaultInfo(mjonEventVO); |
| 46 | 46 |
} |
| 47 | 47 |
|
| 48 |
+ |
|
| 49 |
+ @Override |
|
| 50 |
+ public MjonEventVO selectEventMsgMberDefaultInfo_advc(String userId) throws Exception{
|
|
| 51 |
+ MjonEventVO mjonEventVO = new MjonEventVO(); |
|
| 52 |
+ mjonEventVO.setMberId(userId); |
|
| 53 |
+ return mjonEventDAO.selectEventMsgMberDefaultInfo(mjonEventVO); |
|
| 54 |
+ } |
|
| 55 |
+ |
|
| 48 | 56 |
//등록된 이벤트 회원정보 조회 |
| 49 | 57 |
@Override |
| 50 | 58 |
public int selectEventMsgMberDefaultInfoCnt(MjonEventVO mjonEventVO) throws Exception{
|
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
... | ... | @@ -4043,38 +4043,11 @@ |
| 4043 | 4043 |
* 파라미터로 넘어온 개별단가(eachPrice), 총 결제캐시(totPrice)를 비요하여 동일하지 않으면 컨트롤러에서 계산한 금액으로 입력해줌. |
| 4044 | 4044 |
*/ |
| 4045 | 4045 |
|
| 4046 |
-// int smsTxtByte = MsgSendUtils.getSmsTxtBytes(mjonMsgVO.getSmsTxt()); |
|
| 4047 |
-// if(smsTxtByte > 2000) {
|
|
| 4048 |
-// return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 내용은 2000Byte를 넘을 수 없습니다."); |
|
| 4049 |
-// } |
|
| 4050 |
- |
|
| 4051 |
- // MSG_TYPE 설정 |
|
| 4052 |
-// String msgType = MsgSendUtils.getMsgType(mjonMsgVO, smsTxtByte); |
|
| 4053 |
-// if ("INVALID".equals(msgType)) {
|
|
| 4054 |
-// return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 내용은 2000Byte를 넘을 수 없습니다."); |
|
| 4055 |
-// } |
|
| 4056 |
-// mjonMsgVO.setMsgType(msgType); |
|
| 4057 |
- |
|
| 4058 | 4046 |
|
| 4059 | 4047 |
///////////////////////////////////////////////////////////////////////////// |
| 4060 | 4048 |
// 금액 관련은 끝에서 이벤트 발송 / 기존금액 박송으로 나눠야하기 때문에 나중에 수정 |
| 4061 | 4049 |
///////////////////////////////////////////////////////////////////////////// |
| 4062 | 4050 |
/* |
| 4063 |
- //1.시스템 기본 단가 정보 불러오기 |
|
| 4064 |
- JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo(); |
|
| 4065 |
- |
|
| 4066 |
- |
|
| 4067 |
- //2.사용자 개인 단가 정보 불러오기 |
|
| 4068 |
- MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId); |
|
| 4069 |
- |
|
| 4070 |
- |
|
| 4071 |
- // 3. 사용자 단가 정보 설정 |
|
| 4072 |
- //협의 단가가 없는 경우 시스템 단가 적용해 주기 |
|
| 4073 |
- float shortPrice = MsgSendUtils.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice()); |
|
| 4074 |
- float longPrice = MsgSendUtils.getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice()); |
|
| 4075 |
- float picturePrice = MsgSendUtils.getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice()); |
|
| 4076 |
- float picture2Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture2Price(), sysJoinSetVO.getPicture2Price()); |
|
| 4077 |
- float picture3Price = MsgSendUtils.getValidPrice(mberManageVO.getPicture3Price(), sysJoinSetVO.getPicture3Price()); |
|
| 4078 | 4051 |
|
| 4079 | 4052 |
|
| 4080 | 4053 |
// 기존 소수점 2째자리에서 반올림하였으나, 정책 변경으로 소수점 버림 처리함 |
... | ... | @@ -4141,9 +4114,23 @@ |
| 4141 | 4114 |
// return statusResponse; // 유효성 검사 실패 시 처리 |
| 4142 | 4115 |
// } |
| 4143 | 4116 |
|
| 4144 |
- |
|
| 4145 | 4117 |
|
| 4146 |
- log.info(" ++ mjonMsgVO.getSpamStatus() :: [{}]", mjonMsgVO.getSpamStatus());
|
|
| 4118 |
+ // 삭제 전 리스트 크기 저장 |
|
| 4119 |
+ int initialSize = mjonMsgSendVOList.size(); |
|
| 4120 |
+ |
|
| 4121 |
+ // 수신목록 셋팅 |
|
| 4122 |
+ List<String> userBlockList = mjonMsgDAO.selectUserBlockList(mjonMsgVO); |
|
| 4123 |
+ mjonMsgSendVOList.removeIf(vo -> userBlockList.contains(vo.getPhone())); |
|
| 4124 |
+// log.info(" !! mjonMsgSendVOList.size() :: [{}]",mjonMsgSendVOList.size());
|
|
| 4125 |
+ // 삭제 후 리스트 크기 저장 |
|
| 4126 |
+ int finalSize = mjonMsgSendVOList.size(); |
|
| 4127 |
+ // 삭제된 건 수 계산 |
|
| 4128 |
+ int deletedCount = initialSize - finalSize; |
|
| 4129 |
+// log.info(" +삭제된 건수 :: [{}]",deletedCount);
|
|
| 4130 |
+ |
|
| 4131 |
+ |
|
| 4132 |
+// long startTime = System.nanoTime(); // 시작 시간 측정 |
|
| 4133 |
+ |
|
| 4147 | 4134 |
// smstxt 치환 및 스팸체크 후 mjonMsgSendVOList 에 add() |
| 4148 | 4135 |
List<String> resultSpamTxt = mjonMsgDataService.selectSpamKeywordList(); |
| 4149 | 4136 |
if(!MsgSendUtils.populateSendLists(mjonMsgVO, mjonMsgSendVOList, statusResponse, resultSpamTxt)) {;
|
... | ... | @@ -4151,31 +4138,52 @@ |
| 4151 | 4138 |
//문자 치환 중 오류가 발생하였습니다. |
| 4152 | 4139 |
return statusResponse; |
| 4153 | 4140 |
} |
| 4154 |
- log.info(" ++ mjonMsgVO.getSpamStatus() :: [{}]", mjonMsgVO.getSpamStatus());
|
|
| 4141 |
+ mjonMsgSendVOList.stream().forEach(t-> System.out.println(" + ReqDate :: "+t.getReqDate()));
|
|
| 4142 |
+ |
|
| 4143 |
+// long endTime = System.nanoTime(); // 종료 시간 측정 |
|
| 4144 |
+// long duration = endTime - startTime; // 실행 시간 계산 (나노초) |
|
| 4145 |
+ |
|
| 4146 |
+// // 나노초를 초와 분으로 변환 |
|
| 4147 |
+// long seconds = duration / 1_000_000_000; |
|
| 4148 |
+// long minutes = seconds / 60; |
|
| 4149 |
+// seconds = seconds % 60; // 분으로 나누고 남은 초 계산 |
|
| 4150 |
+ |
|
| 4151 |
+// System.out.println("Execution time: " + minutes + " minutes " + seconds + " seconds");
|
|
| 4152 |
+ |
|
| 4153 |
+ |
|
| 4154 |
+ |
|
| 4155 |
+ |
|
| 4155 | 4156 |
|
| 4156 | 4157 |
|
| 4157 |
- // 수신목록 셋팅 |
|
| 4158 |
+ |
|
| 4159 |
+ |
|
| 4160 |
+ |
|
| 4158 | 4161 |
|
| 4159 | 4162 |
|
| 4160 | 4163 |
|
| 4161 |
- // 수신거부 목록 불러오기 |
|
| 4162 |
- List<String> userBlockList = mjonMsgDAO.selectUserBlockList(mjonMsgVO); |
|
| 4163 |
- |
|
| 4164 |
- List<String> dupliBlockList = MJUtil.getDuplicateList(userBlockList); |
|
| 4165 |
- int usrBlockCnt = dupliBlockList.size(); |
|
| 4164 |
+ //1.시스템 기본 단가 정보 불러오기 |
|
| 4165 |
+ JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo(); |
|
| 4166 |
+ //2.사용자 개인 단가 정보 불러오기 |
|
| 4167 |
+ MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId); |
|
| 4168 |
+ MsgSendUtils.setPriceforVO(mjonMsgVO, mjonMsgSendVOList, sysJoinSetVO, mberManageVO); |
|
| 4166 | 4169 |
|
| 4167 | 4170 |
|
| 4168 | 4171 |
|
| 4172 |
+ // 이벤트 영역 |
|
| 4173 |
+ MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo_advc(userId); |
|
| 4169 | 4174 |
|
| 4175 |
+ List<MjonMsgSendVO> optimalMsgList = MsgSendUtils.getOptimalMsgList(mjonMsgVO.getTotalPrice(), eventMberInfo.getEventRemainCash(), mjonMsgSendVOList); |
|
| 4170 | 4176 |
|
| 4177 |
+ log.info(" + optimalMsgList :: [{}]", optimalMsgList.size());
|
|
| 4178 |
+ log.info(" + mjonMsgSendVOList :: [{}]", mjonMsgSendVOList.size());
|
|
| 4179 |
+// log.info("mjonMsgVO.getTotalPrice() :: [{}]", mjonMsgVO.getTotalPrice());
|
|
| 4171 | 4180 |
|
| 4181 |
+// log.info(" + userId :: [{}]", userId);
|
|
| 4182 |
+// log.info(" + priceAndPoint.getBefCash(userId) :: [{}]", priceAndPoint.getBefCash(userId));
|
|
| 4172 | 4183 |
|
| 4184 |
+ |
|
| 4173 | 4185 |
|
| 4174 |
- |
|
| 4175 |
- |
|
| 4176 |
- |
|
| 4177 |
- |
|
| 4178 |
- |
|
| 4186 |
+// mjonMsgSendVOList.stream().forEach(t-> System.out.println(t.getEachPrice())); |
|
| 4179 | 4187 |
// mjonMsgSendVOList.stream().forEach(t-> System.out.println(t.toString())); |
| 4180 | 4188 |
|
| 4181 | 4189 |
// mjonMsgSendVOList.stream() |
--- src/main/java/itn/let/mjo/rejt/web/MjonRejectController.java
+++ src/main/java/itn/let/mjo/rejt/web/MjonRejectController.java
... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 |
package itn.let.mjo.rejt.web; |
| 2 | 2 |
|
| 3 |
+import java.util.Arrays; |
|
| 3 | 4 |
import java.util.HashMap; |
| 4 | 5 |
import java.util.List; |
| 5 | 6 |
|
... | ... | @@ -89,6 +90,52 @@ |
| 89 | 90 |
} |
| 90 | 91 |
|
| 91 | 92 |
|
| 93 |
+ @ResponseBody |
|
| 94 |
+ @RequestMapping(value = "/mjonRejectReceive_advc.do") |
|
| 95 |
+ public HashMap<String, String> mjonRejectReceive_advc(@RequestBody MjonRejectVO rejectVO) throws Exception {
|
|
| 96 |
+ |
|
| 97 |
+ |
|
| 98 |
+ //ModelAndView mv = new ModelAndView(); |
|
| 99 |
+ //mv.setViewName("jsonView");
|
|
| 100 |
+ |
|
| 101 |
+ //System.out.println(rejectVO.getPhone()+"=============="); |
|
| 102 |
+ //System.out.println(rejectVO.getInsertDate()+"=============="); |
|
| 103 |
+ //System.out.println(rejectVO.getCallId()+"=============="); |
|
| 104 |
+ |
|
| 105 |
+ HashMap<String, String> map = new HashMap<String, String>(); |
|
| 106 |
+ |
|
| 107 |
+ try {
|
|
| 108 |
+ // 1. mj_reject_log 테이블에 로그 insert |
|
| 109 |
+// String rejectLogId = mjonRejectService.insertRejectLog(rejectVO); |
|
| 110 |
+ |
|
| 111 |
+ MjonBlockVO blockVO = new MjonBlockVO(); |
|
| 112 |
+ List<String> phoneNumberList = Arrays.asList( |
|
| 113 |
+ "01083584250", |
|
| 114 |
+ "01030266269", |
|
| 115 |
+ "01012341234", |
|
| 116 |
+ "01030266222", |
|
| 117 |
+ "01012341237" |
|
| 118 |
+ ); |
|
| 119 |
+ |
|
| 120 |
+ |
|
| 121 |
+ for(String aa : phoneNumberList ) {
|
|
| 122 |
+// blockVO.setRejectLogId(rejectLogId); |
|
| 123 |
+ blockVO.setUserId("hylee250");
|
|
| 124 |
+ blockVO.setPhone(aa); |
|
| 125 |
+ blockVO.setBlockType(1); // 080 수신거부 |
|
| 126 |
+ mjonBlockService.insertBlock(blockVO); |
|
| 127 |
+ } |
|
| 128 |
+ map.put("result", "100");
|
|
| 129 |
+ |
|
| 130 |
+ } catch(Exception e) {
|
|
| 131 |
+ e.printStackTrace(); |
|
| 132 |
+ map.put("result", "error");
|
|
| 133 |
+ } |
|
| 134 |
+ |
|
| 135 |
+ return map; |
|
| 136 |
+ } |
|
| 137 |
+ |
|
| 138 |
+ |
|
| 92 | 139 |
/** |
| 93 | 140 |
* 080수신거부 테스트 페이지 |
| 94 | 141 |
* @return |
--- src/main/java/itn/let/module/base/PriceAndPoint.java
+++ src/main/java/itn/let/module/base/PriceAndPoint.java
... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 |
|
| 6 | 6 |
import javax.annotation.Resource; |
| 7 | 7 |
|
| 8 |
+import org.springframework.beans.factory.annotation.Autowired; |
|
| 8 | 9 |
import org.springframework.stereotype.Component; |
| 9 | 10 |
|
| 10 | 11 |
import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
... | ... | @@ -31,7 +32,7 @@ |
| 31 | 32 |
@Component |
| 32 | 33 |
public class PriceAndPoint {
|
| 33 | 34 |
|
| 34 |
- @Resource(name="MjonMsgDataDAO") |
|
| 35 |
+ @Autowired |
|
| 35 | 36 |
private MjonMsgDataDAO mjonMsgDataDAO; |
| 36 | 37 |
|
| 37 | 38 |
/** |
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp
... | ... | @@ -1189,6 +1189,43 @@ |
| 1189 | 1189 |
}else{
|
| 1190 | 1190 |
form.msgKind.value = "N"; //일반문자 종류 설정 |
| 1191 | 1191 |
} |
| 1192 |
+ |
|
| 1193 |
+ // 예약 확인 |
|
| 1194 |
+ var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인
|
|
| 1195 |
+ form.reserveYn.value = reserYn; // 즉시 / 예약 문자 선택 여부 |
|
| 1196 |
+ |
|
| 1197 |
+ if(reserYn == 'Y'){
|
|
| 1198 |
+ |
|
| 1199 |
+ var date = $(".resDate").val();//form.msgResDate.value;
|
|
| 1200 |
+ var hour = form.msgResHour.value; |
|
| 1201 |
+ var min = form.msgResMin.value; |
|
| 1202 |
+ |
|
| 1203 |
+ if(date == ""){
|
|
| 1204 |
+ |
|
| 1205 |
+ alert("예약전송 날짜를 선택해 주세요.");
|
|
| 1206 |
+ return false; |
|
| 1207 |
+ |
|
| 1208 |
+ }else{
|
|
| 1209 |
+ |
|
| 1210 |
+ var now = new Date(); |
|
| 1211 |
+ var reqDate = date + " " + hour + ":" + min + ":00"; |
|
| 1212 |
+ var gapDate = getGapDayTime(date, hour, min); |
|
| 1213 |
+ |
|
| 1214 |
+ if(gapDate < 0){ // 음수이면 이전날짜, 크면 이후 날짜.
|
|
| 1215 |
+ alert("예약 날짜는 현재 시간 이후의 날짜 및 시간을 선택해 주세요.");
|
|
| 1216 |
+ return false; |
|
| 1217 |
+ }else{
|
|
| 1218 |
+ form.reqDate.value = reqDate; //예약일자 파라미터 저장 |
|
| 1219 |
+ } |
|
| 1220 |
+ } |
|
| 1221 |
+ |
|
| 1222 |
+ }else{
|
|
| 1223 |
+ |
|
| 1224 |
+ form.reqDate.value = ""; |
|
| 1225 |
+ |
|
| 1226 |
+ } |
|
| 1227 |
+ |
|
| 1228 |
+ |
|
| 1192 | 1229 |
|
| 1193 | 1230 |
//발송 Ajax 호출해주기 |
| 1194 | 1231 |
sendMsgAjax_advc(); |
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?