Merge branch 'master' into 4891_발송결과_속도개선
This commit is contained in:
commit
4d320f7401
@ -193,6 +193,20 @@ public class MjonEventController {
|
||||
|
||||
}else {
|
||||
|
||||
//결제내역 카운트 조회
|
||||
int payCnt = mjonPayService.selectMemerPayCount(loginVO.getId());
|
||||
|
||||
//System.out.println("첫 결제 회원만 이벤트 신청이 가능합니다.");
|
||||
//System.out.println(payCnt);
|
||||
//System.out.println(payCnt);
|
||||
//System.out.println(payCnt);
|
||||
|
||||
if (payCnt>=0) {
|
||||
modelAndView.addObject("message", "첫 결제 회원만 이벤트 신청이 가능합니다.");
|
||||
modelAndView.addObject("resultSts", "statusAlreadyPayedFail");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
mjonEventVO.setMberId(loginVO.getId());
|
||||
mjonEventVO.setMberNm(loginVO.getName());
|
||||
|
||||
|
||||
@ -4203,6 +4203,48 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
// 개별단가
|
||||
mjonMsgVO.setEachPrice(mjonMsgSendVO.getEachPrice());
|
||||
|
||||
//이벤트 회원인 경우 이벤트 캐시도 함께 차감.
|
||||
MjonEventVO mjonEventVO = new MjonEventVO();
|
||||
mjonEventVO.setMberId(mjonMsgSendVO.getUserId());
|
||||
MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO);
|
||||
|
||||
String str = String.valueOf(mjonMsgSendVO.getEachPrice());
|
||||
// 소수점 제거
|
||||
String EachPrice = str.split("\\.")[0];
|
||||
|
||||
|
||||
if(eventMberInfo != null) {
|
||||
String eventShortPrice = String.valueOf(eventMberInfo.getEventShortPrice());
|
||||
eventShortPrice = eventShortPrice.split("\\.")[0];
|
||||
|
||||
String eventLongPrice = String.valueOf(eventMberInfo.getEventLongPrice());
|
||||
eventLongPrice = eventLongPrice.split("\\.")[0];
|
||||
|
||||
String eventPicturePrice = String.valueOf(eventMberInfo.getEventPicturePrice());
|
||||
eventPicturePrice = eventPicturePrice.split("\\.")[0];
|
||||
|
||||
String eventPicture2Price = String.valueOf(eventMberInfo.getEventPicture2Price());
|
||||
eventPicture2Price = eventPicture2Price.split("\\.")[0];
|
||||
|
||||
String eventPicture3Price = String.valueOf(eventMberInfo.getEventPicture3Price());
|
||||
eventPicture3Price = eventPicture3Price.split("\\.")[0];
|
||||
|
||||
if(EachPrice.equals(eventShortPrice)) {
|
||||
mjonMsgVO.setEventYn("Y");
|
||||
}else if(EachPrice.equals(eventLongPrice)) {
|
||||
mjonMsgVO.setEventYn("Y");
|
||||
}else if(EachPrice.equals(eventPicturePrice)) {
|
||||
mjonMsgVO.setEventYn("Y");
|
||||
}else if(EachPrice.equals(eventPicture2Price)) {
|
||||
mjonMsgVO.setEventYn("Y");
|
||||
}else if(EachPrice.equals(eventPicture3Price)) {
|
||||
mjonMsgVO.setEventYn("Y");
|
||||
}else {
|
||||
mjonMsgVO.setEventYn("N");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 전송사 코드 번호를 셋팅해 준다.
|
||||
mjonMsgVO.setAgentCode(mjonMsgSendVO.getAgentCode());
|
||||
|
||||
|
||||
@ -79,6 +79,9 @@ public class MjonPayServiceImpl extends EgovAbstractServiceImpl implements MjonP
|
||||
@Resource(name = "egovPgMoidGnrService")
|
||||
private EgovIdGnrService idgenPgMoid;
|
||||
|
||||
@Resource(name = "mjonPayService")
|
||||
private MjonPayService mjonPayService;
|
||||
|
||||
/** 메모 idgen */
|
||||
@Resource(name="egovGnrlUserSelectMemoIdGnrService")
|
||||
private EgovIdGnrService memoidgenService;
|
||||
@ -2259,13 +2262,16 @@ public class MjonPayServiceImpl extends EgovAbstractServiceImpl implements MjonP
|
||||
*
|
||||
* */
|
||||
|
||||
//결제내역 카운트 조회
|
||||
int payCnt = mjonPayService.selectMemerPayCount(mjonPayVO.getUserId());
|
||||
|
||||
//이벤트 회원 정보 테이블에서 미진행 대상자의 정보를 불러온다.
|
||||
MjonEventVO eventMberInfo = selectEventMsgMberDefaultInfo(mjonPayVO.getUserId(), "N");
|
||||
|
||||
// 문자할인여부(1: 할인, 0: 미할인)
|
||||
int isMsgSalePrice = selectMsgSalePriceCnt(mjonPayVO.getUserId());
|
||||
|
||||
if(eventMberInfo == null) {//일반 결제에 해당하는 경우 정상적 포인트 지급, 이벤트 첫결제에 해당되지 않는 회원
|
||||
if(eventMberInfo == null || payCnt > 0) {//일반 결제에 해당하는 경우 정상적 포인트 지급, 이벤트 첫결제에 해당되지 않는 회원
|
||||
// 문자 미할인 회원만 포인트 충전
|
||||
if(isMsgSalePrice == 0) {
|
||||
mjonPayDAO.insertPoint(mjonPayVO); //POINT 테이블
|
||||
|
||||
@ -9,6 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.let.mjo.event.service.MjonEventService;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import itn.let.mjo.event.service.impl.MjonEventDAO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
@ -37,6 +40,9 @@ public class PriceAndPoint {
|
||||
|
||||
@Autowired
|
||||
private MjonPayDAO mjonPayDAO;
|
||||
|
||||
@Autowired
|
||||
private MjonEventService mjonEventService;
|
||||
|
||||
@Resource(name = "egovMjonCashIdGnrService")
|
||||
private EgovIdGnrService idgenMjonCashId;
|
||||
@ -119,6 +125,36 @@ public class PriceAndPoint {
|
||||
mjonPayDAO.insertCash(mjonPayVO); //캐시
|
||||
mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트
|
||||
|
||||
//이벤트 회원인 경우 이벤트 캐시도 함께 차감.
|
||||
MjonEventVO mjonEventVO = new MjonEventVO();
|
||||
mjonEventVO.setMberId(mjonPayVO.getUserId());
|
||||
mjonEventVO.setEventStatus("Y");
|
||||
MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO);
|
||||
|
||||
if(eventMberInfo != null) {
|
||||
|
||||
float evntRemainCash = (float) eventMberInfo.getEventRemainCash();
|
||||
totPrice = (float) Math.abs(mjonPayVO.getCash());
|
||||
|
||||
float totRemainCash = evntRemainCash - totPrice;
|
||||
mjonEventVO.setEventInfoId(eventMberInfo.getEventInfoId());
|
||||
|
||||
if(totRemainCash <= 0.0) {//차감액이 남아있지 않으면 이벤트를 종료
|
||||
|
||||
//이벤트 상태값을 종료로 변경한다.
|
||||
mjonEventVO.setEventStatus("E");
|
||||
mjonEventVO.setEventRemainCash(0.0);
|
||||
mjonEventService.updateEventEndStatus(mjonEventVO);
|
||||
|
||||
}else {//이벤트 회원 캐시 차감시킴
|
||||
|
||||
mjonEventVO.setEventRemainCash(totRemainCash);
|
||||
mjonEventService.updateEventRemainCash(mjonEventVO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -259,6 +259,12 @@ function pgOpenerPopup(){
|
||||
popStatus = false;
|
||||
return false;
|
||||
|
||||
}else if("statusAlreadyPayedFail"==returnData.resultSts){
|
||||
|
||||
alert(returnData.message);
|
||||
popStatus = false;
|
||||
return false;
|
||||
|
||||
}else if("statusFail"==returnData.resultSts){
|
||||
|
||||
alert(returnData.message);
|
||||
|
||||
@ -1067,13 +1067,35 @@ function fn_sendMsgData(){
|
||||
var eventRemainCash = parseFloat(form.eventRemainCash.value);
|
||||
console.log('eventStatus : ', eventStatus);
|
||||
|
||||
if(eventStatus == 'Y'
|
||||
&& parseFloat(eventRemainCash) < parseFloat(totPriceOnly))
|
||||
if(eventStatus == 'Y' && parseFloat(eventRemainCash) < parseFloat(totPriceOnly))
|
||||
{
|
||||
|
||||
// 이벤트 금액 부족 상태 요청하신 모두 발송할 수 없습니다
|
||||
console.log('eventRemainCash : ', eventRemainCash);
|
||||
if(!confirm("고객님의 이벤트 캐시 잔액(" + eventRemainCash + "원) 부족으로 요청하신 문자("+numberWithCommas($selectedData.length)+"건)를 모두 발송할 수 없습니다. 이벤트 캐시 초과 건에 대해서는 일반 단가를 적용하여 발송하시겠습니까?")){
|
||||
return false;
|
||||
}
|
||||
|
||||
// 이벤트 캐시 초과 건에 대해서는 일반 단가를 적용하여 발송하시겠습니까
|
||||
|
||||
var evnMsgType = $("#msgType").val(); // 문자전송 타입
|
||||
var norEachPrice = getNorEachPrice(evnMsgType); // 일반전송 금액
|
||||
var eventEachPrice = getEventEachPrice(evnMsgType); // 이벤트 전송 금액
|
||||
var eventCount = eventRemainCash/eventEachPrice; // 이벤트금액으로 전송가능한 수량
|
||||
console.log('eventCount : ', parseInt(eventCount));
|
||||
var norCount = numberWithCommas($selectedData.length)-parseInt(eventCount); // 일반금액으로 전송수량
|
||||
console.log('norCount : ', parseInt(norCount));
|
||||
|
||||
var norAccount = norCount * norEachPrice; // 일반금액으로 변경한 발송금액
|
||||
var totAccount = userMoneyOnly - norAccount //
|
||||
console.log('norAccount : ', norAccount);
|
||||
console.log('userMoneyOnly : ', userMoneyOnly);
|
||||
console.log('totAccount : ', totAccount);
|
||||
|
||||
if(totAccount < 0){
|
||||
alert("고객님의 이벤트 캐시 잔액(" + parseInt(totAccount)*-1 + "원) 부족으로 요청하신 문자("+numberWithCommas($selectedData.length)+"건)를 모두 발송할 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(' !!! imgFilePath : ', imgFilePath);
|
||||
@ -1411,6 +1433,48 @@ function getNorEachPrice(evnMsgType){
|
||||
return norEachPrice;
|
||||
}
|
||||
|
||||
|
||||
//이벤트가 아닌 일반 개별 단가 셋팅해주기
|
||||
function getEventEachPrice(evnMsgType){
|
||||
|
||||
var eventEachPrice = 0;
|
||||
var evnImgCnt = $("#imgCnt").val();
|
||||
|
||||
//일반 단가로 변경해주기
|
||||
if(evnMsgType == '4'){
|
||||
|
||||
eventEachPrice = $("#sPrice").val();
|
||||
console.log("eventEachPrice Short::: "+eventEachPrice);
|
||||
|
||||
}else if(evnMsgType == '6'){
|
||||
|
||||
if(evnImgCnt == 0){//장문 가격
|
||||
|
||||
eventEachPrice = $("#mPrice").val();
|
||||
console.log("eventEachPrice Long ::: "+eventEachPrice);
|
||||
|
||||
}else if(evnImgCnt == 1){
|
||||
|
||||
eventEachPrice = $("#pPrice").val();
|
||||
console.log("eventEachPrice p1 ::: "+eventEachPrice);
|
||||
|
||||
}else if(evnImgCnt == 2){
|
||||
|
||||
eventEachPrice = $("#p2Price").val();
|
||||
console.log("eventEachPrice p2 ::: "+eventEachPrice);
|
||||
|
||||
}else if(evnImgCnt == 3){
|
||||
|
||||
eventEachPrice = $("#p3Price").val();
|
||||
console.log("eventEachPrice p3 ::: "+eventEachPrice);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return eventEachPrice;
|
||||
}
|
||||
|
||||
//빈 값이나 null 값을 제거하는 함수
|
||||
function removeEmptyValues(obj) {
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
|
||||
@ -790,6 +790,10 @@
|
||||
<dt>등록일시</dt>
|
||||
<dd>2024-07-10 15:25</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>제목</dt>
|
||||
<dd>제목테스트제목테스트제목테스트제목테스트</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>형태</dt>
|
||||
<dd>그림</dd>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user