--- src/main/java/itn/let/mjo/event/web/MjonEventController.java
+++ src/main/java/itn/let/mjo/event/web/MjonEventController.java
... | ... | @@ -193,6 +193,20 @@ |
| 193 | 193 |
|
| 194 | 194 |
}else {
|
| 195 | 195 |
|
| 196 |
+ //결제내역 카운트 조회 |
|
| 197 |
+ int payCnt = mjonPayService.selectMemerPayCount(loginVO.getId()); |
|
| 198 |
+ |
|
| 199 |
+ //System.out.println("첫 결제 회원만 이벤트 신청이 가능합니다.");
|
|
| 200 |
+ //System.out.println(payCnt); |
|
| 201 |
+ //System.out.println(payCnt); |
|
| 202 |
+ //System.out.println(payCnt); |
|
| 203 |
+ |
|
| 204 |
+ if (payCnt>=0) {
|
|
| 205 |
+ modelAndView.addObject("message", "첫 결제 회원만 이벤트 신청이 가능합니다.");
|
|
| 206 |
+ modelAndView.addObject("resultSts", "statusAlreadyPayedFail");
|
|
| 207 |
+ return modelAndView; |
|
| 208 |
+ } |
|
| 209 |
+ |
|
| 196 | 210 |
mjonEventVO.setMberId(loginVO.getId()); |
| 197 | 211 |
mjonEventVO.setMberNm(loginVO.getName()); |
| 198 | 212 |
|
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
... | ... | @@ -4203,6 +4203,48 @@ |
| 4203 | 4203 |
// 개별단가 |
| 4204 | 4204 |
mjonMsgVO.setEachPrice(mjonMsgSendVO.getEachPrice()); |
| 4205 | 4205 |
|
| 4206 |
+ //이벤트 회원인 경우 이벤트 캐시도 함께 차감. |
|
| 4207 |
+ MjonEventVO mjonEventVO = new MjonEventVO(); |
|
| 4208 |
+ mjonEventVO.setMberId(mjonMsgSendVO.getUserId()); |
|
| 4209 |
+ MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO); |
|
| 4210 |
+ |
|
| 4211 |
+ String str = String.valueOf(mjonMsgSendVO.getEachPrice()); |
|
| 4212 |
+ // 소수점 제거 |
|
| 4213 |
+ String EachPrice = str.split("\\.")[0];
|
|
| 4214 |
+ |
|
| 4215 |
+ |
|
| 4216 |
+ if(eventMberInfo != null) {
|
|
| 4217 |
+ String eventShortPrice = String.valueOf(eventMberInfo.getEventShortPrice()); |
|
| 4218 |
+ eventShortPrice = eventShortPrice.split("\\.")[0];
|
|
| 4219 |
+ |
|
| 4220 |
+ String eventLongPrice = String.valueOf(eventMberInfo.getEventLongPrice()); |
|
| 4221 |
+ eventLongPrice = eventLongPrice.split("\\.")[0];
|
|
| 4222 |
+ |
|
| 4223 |
+ String eventPicturePrice = String.valueOf(eventMberInfo.getEventPicturePrice()); |
|
| 4224 |
+ eventPicturePrice = eventPicturePrice.split("\\.")[0];
|
|
| 4225 |
+ |
|
| 4226 |
+ String eventPicture2Price = String.valueOf(eventMberInfo.getEventPicture2Price()); |
|
| 4227 |
+ eventPicture2Price = eventPicture2Price.split("\\.")[0];
|
|
| 4228 |
+ |
|
| 4229 |
+ String eventPicture3Price = String.valueOf(eventMberInfo.getEventPicture3Price()); |
|
| 4230 |
+ eventPicture3Price = eventPicture3Price.split("\\.")[0];
|
|
| 4231 |
+ |
|
| 4232 |
+ if(EachPrice.equals(eventShortPrice)) {
|
|
| 4233 |
+ mjonMsgVO.setEventYn("Y");
|
|
| 4234 |
+ }else if(EachPrice.equals(eventLongPrice)) {
|
|
| 4235 |
+ mjonMsgVO.setEventYn("Y");
|
|
| 4236 |
+ }else if(EachPrice.equals(eventPicturePrice)) {
|
|
| 4237 |
+ mjonMsgVO.setEventYn("Y");
|
|
| 4238 |
+ }else if(EachPrice.equals(eventPicture2Price)) {
|
|
| 4239 |
+ mjonMsgVO.setEventYn("Y");
|
|
| 4240 |
+ }else if(EachPrice.equals(eventPicture3Price)) {
|
|
| 4241 |
+ mjonMsgVO.setEventYn("Y");
|
|
| 4242 |
+ }else {
|
|
| 4243 |
+ mjonMsgVO.setEventYn("N");
|
|
| 4244 |
+ } |
|
| 4245 |
+ } |
|
| 4246 |
+ |
|
| 4247 |
+ |
|
| 4206 | 4248 |
// 전송사 코드 번호를 셋팅해 준다. |
| 4207 | 4249 |
mjonMsgVO.setAgentCode(mjonMsgSendVO.getAgentCode()); |
| 4208 | 4250 |
|
--- src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
+++ src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
... | ... | @@ -79,6 +79,9 @@ |
| 79 | 79 |
@Resource(name = "egovPgMoidGnrService") |
| 80 | 80 |
private EgovIdGnrService idgenPgMoid; |
| 81 | 81 |
|
| 82 |
+ @Resource(name = "mjonPayService") |
|
| 83 |
+ private MjonPayService mjonPayService; |
|
| 84 |
+ |
|
| 82 | 85 |
/** 메모 idgen */ |
| 83 | 86 |
@Resource(name="egovGnrlUserSelectMemoIdGnrService") |
| 84 | 87 |
private EgovIdGnrService memoidgenService; |
... | ... | @@ -2259,13 +2262,16 @@ |
| 2259 | 2262 |
* |
| 2260 | 2263 |
* */ |
| 2261 | 2264 |
|
| 2265 |
+ //결제내역 카운트 조회 |
|
| 2266 |
+ int payCnt = mjonPayService.selectMemerPayCount(mjonPayVO.getUserId()); |
|
| 2267 |
+ |
|
| 2262 | 2268 |
//이벤트 회원 정보 테이블에서 미진행 대상자의 정보를 불러온다. |
| 2263 | 2269 |
MjonEventVO eventMberInfo = selectEventMsgMberDefaultInfo(mjonPayVO.getUserId(), "N"); |
| 2264 | 2270 |
|
| 2265 | 2271 |
// 문자할인여부(1: 할인, 0: 미할인) |
| 2266 | 2272 |
int isMsgSalePrice = selectMsgSalePriceCnt(mjonPayVO.getUserId()); |
| 2267 | 2273 |
|
| 2268 |
- if(eventMberInfo == null) {//일반 결제에 해당하는 경우 정상적 포인트 지급, 이벤트 첫결제에 해당되지 않는 회원
|
|
| 2274 |
+ if(eventMberInfo == null || payCnt > 0) {//일반 결제에 해당하는 경우 정상적 포인트 지급, 이벤트 첫결제에 해당되지 않는 회원
|
|
| 2269 | 2275 |
// 문자 미할인 회원만 포인트 충전 |
| 2270 | 2276 |
if(isMsgSalePrice == 0) {
|
| 2271 | 2277 |
mjonPayDAO.insertPoint(mjonPayVO); //POINT 테이블 |
--- src/main/java/itn/let/module/base/PriceAndPoint.java
+++ src/main/java/itn/let/module/base/PriceAndPoint.java
... | ... | @@ -9,6 +9,9 @@ |
| 9 | 9 |
import org.springframework.stereotype.Component; |
| 10 | 10 |
|
| 11 | 11 |
import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
| 12 |
+import itn.let.mjo.event.service.MjonEventService; |
|
| 13 |
+import itn.let.mjo.event.service.MjonEventVO; |
|
| 14 |
+import itn.let.mjo.event.service.impl.MjonEventDAO; |
|
| 12 | 15 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 13 | 16 |
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO; |
| 14 | 17 |
import itn.let.mjo.pay.service.MjonPayVO; |
... | ... | @@ -37,6 +40,9 @@ |
| 37 | 40 |
|
| 38 | 41 |
@Autowired |
| 39 | 42 |
private MjonPayDAO mjonPayDAO; |
| 43 |
+ |
|
| 44 |
+ @Autowired |
|
| 45 |
+ private MjonEventService mjonEventService; |
|
| 40 | 46 |
|
| 41 | 47 |
@Resource(name = "egovMjonCashIdGnrService") |
| 42 | 48 |
private EgovIdGnrService idgenMjonCashId; |
... | ... | @@ -119,6 +125,36 @@ |
| 119 | 125 |
mjonPayDAO.insertCash(mjonPayVO); //캐시 |
| 120 | 126 |
mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트 |
| 121 | 127 |
|
| 128 |
+ //이벤트 회원인 경우 이벤트 캐시도 함께 차감. |
|
| 129 |
+ MjonEventVO mjonEventVO = new MjonEventVO(); |
|
| 130 |
+ mjonEventVO.setMberId(mjonPayVO.getUserId()); |
|
| 131 |
+ mjonEventVO.setEventStatus("Y");
|
|
| 132 |
+ MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO); |
|
| 133 |
+ |
|
| 134 |
+ if(eventMberInfo != null) {
|
|
| 135 |
+ |
|
| 136 |
+ float evntRemainCash = (float) eventMberInfo.getEventRemainCash(); |
|
| 137 |
+ totPrice = (float) Math.abs(mjonPayVO.getCash()); |
|
| 138 |
+ |
|
| 139 |
+ float totRemainCash = evntRemainCash - totPrice; |
|
| 140 |
+ mjonEventVO.setEventInfoId(eventMberInfo.getEventInfoId()); |
|
| 141 |
+ |
|
| 142 |
+ if(totRemainCash <= 0.0) {//차감액이 남아있지 않으면 이벤트를 종료
|
|
| 143 |
+ |
|
| 144 |
+ //이벤트 상태값을 종료로 변경한다. |
|
| 145 |
+ mjonEventVO.setEventStatus("E");
|
|
| 146 |
+ mjonEventVO.setEventRemainCash(0.0); |
|
| 147 |
+ mjonEventService.updateEventEndStatus(mjonEventVO); |
|
| 148 |
+ |
|
| 149 |
+ }else {//이벤트 회원 캐시 차감시킴
|
|
| 150 |
+ |
|
| 151 |
+ mjonEventVO.setEventRemainCash(totRemainCash); |
|
| 152 |
+ mjonEventService.updateEventRemainCash(mjonEventVO); |
|
| 153 |
+ |
|
| 154 |
+ } |
|
| 155 |
+ |
|
| 156 |
+ } |
|
| 157 |
+ |
|
| 122 | 158 |
} |
| 123 | 159 |
|
| 124 | 160 |
|
--- src/main/webapp/WEB-INF/jsp/web/event/pay/EventPayView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/event/pay/EventPayView.jsp
... | ... | @@ -259,6 +259,12 @@ |
| 259 | 259 |
popStatus = false; |
| 260 | 260 |
return false; |
| 261 | 261 |
|
| 262 |
+ }else if("statusAlreadyPayedFail"==returnData.resultSts){
|
|
| 263 |
+ |
|
| 264 |
+ alert(returnData.message); |
|
| 265 |
+ popStatus = false; |
|
| 266 |
+ return false; |
|
| 267 |
+ |
|
| 262 | 268 |
}else if("statusFail"==returnData.resultSts){
|
| 263 | 269 |
|
| 264 | 270 |
alert(returnData.message); |
--- src/main/webapp/js/web/msgdata/msgDataView.js
+++ src/main/webapp/js/web/msgdata/msgDataView.js
... | ... | @@ -1067,11 +1067,33 @@ |
| 1067 | 1067 |
var eventRemainCash = parseFloat(form.eventRemainCash.value); |
| 1068 | 1068 |
console.log('eventStatus : ', eventStatus);
|
| 1069 | 1069 |
|
| 1070 |
- if(eventStatus == 'Y' |
|
| 1071 |
- && parseFloat(eventRemainCash) < parseFloat(totPriceOnly)) |
|
| 1070 |
+ if(eventStatus == 'Y' && parseFloat(eventRemainCash) < parseFloat(totPriceOnly)) |
|
| 1072 | 1071 |
{
|
| 1072 |
+ |
|
| 1073 |
+ // 이벤트 금액 부족 상태 요청하신 모두 발송할 수 없습니다 |
|
| 1073 | 1074 |
console.log('eventRemainCash : ', eventRemainCash);
|
| 1074 | 1075 |
if(!confirm("고객님의 이벤트 캐시 잔액(" + eventRemainCash + "원) 부족으로 요청하신 문자("+numberWithCommas($selectedData.length)+"건)를 모두 발송할 수 없습니다. 이벤트 캐시 초과 건에 대해서는 일반 단가를 적용하여 발송하시겠습니까?")){
|
| 1076 |
+ return false; |
|
| 1077 |
+ } |
|
| 1078 |
+ |
|
| 1079 |
+ // 이벤트 캐시 초과 건에 대해서는 일반 단가를 적용하여 발송하시겠습니까 |
|
| 1080 |
+ |
|
| 1081 |
+ var evnMsgType = $("#msgType").val(); // 문자전송 타입
|
|
| 1082 |
+ var norEachPrice = getNorEachPrice(evnMsgType); // 일반전송 금액 |
|
| 1083 |
+ var eventEachPrice = getEventEachPrice(evnMsgType); // 이벤트 전송 금액 |
|
| 1084 |
+ var eventCount = eventRemainCash/eventEachPrice; // 이벤트금액으로 전송가능한 수량 |
|
| 1085 |
+ console.log('eventCount : ', parseInt(eventCount));
|
|
| 1086 |
+ var norCount = numberWithCommas($selectedData.length)-parseInt(eventCount); // 일반금액으로 전송수량 |
|
| 1087 |
+ console.log('norCount : ', parseInt(norCount));
|
|
| 1088 |
+ |
|
| 1089 |
+ var norAccount = norCount * norEachPrice; // 일반금액으로 변경한 발송금액 |
|
| 1090 |
+ var totAccount = userMoneyOnly - norAccount // |
|
| 1091 |
+ console.log('norAccount : ', norAccount);
|
|
| 1092 |
+ console.log('userMoneyOnly : ', userMoneyOnly);
|
|
| 1093 |
+ console.log('totAccount : ', totAccount);
|
|
| 1094 |
+ |
|
| 1095 |
+ if(totAccount < 0){
|
|
| 1096 |
+ alert("고객님의 이벤트 캐시 잔액(" + parseInt(totAccount)*-1 + "원) 부족으로 요청하신 문자("+numberWithCommas($selectedData.length)+"건)를 모두 발송할 수 없습니다.");
|
|
| 1075 | 1097 |
return false; |
| 1076 | 1098 |
} |
| 1077 | 1099 |
} |
... | ... | @@ -1411,6 +1433,48 @@ |
| 1411 | 1433 |
return norEachPrice; |
| 1412 | 1434 |
} |
| 1413 | 1435 |
|
| 1436 |
+ |
|
| 1437 |
+//이벤트가 아닌 일반 개별 단가 셋팅해주기 |
|
| 1438 |
+function getEventEachPrice(evnMsgType){
|
|
| 1439 |
+ |
|
| 1440 |
+ var eventEachPrice = 0; |
|
| 1441 |
+ var evnImgCnt = $("#imgCnt").val();
|
|
| 1442 |
+ |
|
| 1443 |
+ //일반 단가로 변경해주기 |
|
| 1444 |
+ if(evnMsgType == '4'){
|
|
| 1445 |
+ |
|
| 1446 |
+ eventEachPrice = $("#sPrice").val();
|
|
| 1447 |
+ console.log("eventEachPrice Short::: "+eventEachPrice);
|
|
| 1448 |
+ |
|
| 1449 |
+ }else if(evnMsgType == '6'){
|
|
| 1450 |
+ |
|
| 1451 |
+ if(evnImgCnt == 0){//장문 가격
|
|
| 1452 |
+ |
|
| 1453 |
+ eventEachPrice = $("#mPrice").val();
|
|
| 1454 |
+ console.log("eventEachPrice Long ::: "+eventEachPrice);
|
|
| 1455 |
+ |
|
| 1456 |
+ }else if(evnImgCnt == 1){
|
|
| 1457 |
+ |
|
| 1458 |
+ eventEachPrice = $("#pPrice").val();
|
|
| 1459 |
+ console.log("eventEachPrice p1 ::: "+eventEachPrice);
|
|
| 1460 |
+ |
|
| 1461 |
+ }else if(evnImgCnt == 2){
|
|
| 1462 |
+ |
|
| 1463 |
+ eventEachPrice = $("#p2Price").val();
|
|
| 1464 |
+ console.log("eventEachPrice p2 ::: "+eventEachPrice);
|
|
| 1465 |
+ |
|
| 1466 |
+ }else if(evnImgCnt == 3){
|
|
| 1467 |
+ |
|
| 1468 |
+ eventEachPrice = $("#p3Price").val();
|
|
| 1469 |
+ console.log("eventEachPrice p3 ::: "+eventEachPrice);
|
|
| 1470 |
+ |
|
| 1471 |
+ } |
|
| 1472 |
+ |
|
| 1473 |
+ } |
|
| 1474 |
+ |
|
| 1475 |
+ return eventEachPrice; |
|
| 1476 |
+} |
|
| 1477 |
+ |
|
| 1414 | 1478 |
//빈 값이나 null 값을 제거하는 함수 |
| 1415 | 1479 |
function removeEmptyValues(obj) {
|
| 1416 | 1480 |
Object.keys(obj).forEach(function(key) {
|
--- src/main/webapp/publish/textingmsg_2025_detail.html
+++ src/main/webapp/publish/textingmsg_2025_detail.html
... | ... | @@ -791,6 +791,10 @@ |
| 791 | 791 |
<dd>2024-07-10 15:25</dd> |
| 792 | 792 |
</dl> |
| 793 | 793 |
<dl> |
| 794 |
+ <dt>제목</dt> |
|
| 795 |
+ <dd>제목테스트제목테스트제목테스트제목테스트</dd> |
|
| 796 |
+ </dl> |
|
| 797 |
+ <dl> |
|
| 794 | 798 |
<dt>형태</dt> |
| 795 | 799 |
<dd>그림</dd> |
| 796 | 800 |
</dl> |
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?