친구톡 발송금액 처리 완료
This commit is contained in:
parent
cf249034a6
commit
667df023db
@ -975,6 +975,10 @@ public class KakaoSendUtil {
|
||||
//카카오 친구톡 개인 단가가 없는 경우 시스템 단가로
|
||||
if(mberManageVO.getKakaoFtPrice() == 0.0f)
|
||||
mberManageVO.setKakaoFtPrice(sysJoinSetVO.getKakaoFtPrice());
|
||||
if(mberManageVO.getKakaoFtImgPrice() == 0.0f)
|
||||
mberManageVO.setKakaoFtImgPrice(sysJoinSetVO.getKakaoFtImgPrice());
|
||||
if(mberManageVO.getKakaoFtWideImgPrice() == 0.0f)
|
||||
mberManageVO.setKakaoFtWideImgPrice(sysJoinSetVO.getKakaoFtWideImgPrice());
|
||||
|
||||
|
||||
// SMS 인경우
|
||||
|
||||
@ -120,114 +120,109 @@ public class KakaoFriendsTalkSendController {
|
||||
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
try {
|
||||
|
||||
if(!userId.equals("") && !author.equals("ROLE_ADMIN")) {
|
||||
if(!"".equals(userId) && !"ROLE_ADMIN".equals(author)) {
|
||||
|
||||
//사용자 등록 발신프로필 정보 조회해오기
|
||||
kakaoVO.setUserId(userId);
|
||||
List<KakaoVO> resultProfileList = kakaoApiService.selectKakaoProfileList(kakaoVO);
|
||||
model.addAttribute("resultProfileList", resultProfileList);
|
||||
|
||||
//사용자 등록 발신프로필 정보 조회해오기
|
||||
kakaoVO.setUserId(userId);
|
||||
List<KakaoVO> resultProfileList = kakaoApiService.selectKakaoProfileList(kakaoVO);
|
||||
model.addAttribute("resultProfileList", resultProfileList);
|
||||
|
||||
// 특수문자 리스트 불러오기
|
||||
MjonSymbolVO symbolVO = new MjonSymbolVO();
|
||||
List<MjonSymbolVO> symbolList = mjonSymbolService.selectMjonSymbolList(symbolVO);
|
||||
model.addAttribute("symbolList", symbolList);
|
||||
|
||||
//아이디 발신번호 리스트 불러오기.
|
||||
List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId);
|
||||
List<String> resultPhonList = new ArrayList<String>();
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
for(String phone : resultSendPhonList) {
|
||||
resultPhonList.add(mjUtil.addDash(phone));
|
||||
}
|
||||
model.addAttribute("resultPhonList", resultPhonList);
|
||||
|
||||
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
|
||||
model.addAttribute("atSmishingYn", mberManageVO.getAtSmishingYn());
|
||||
|
||||
//3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용
|
||||
/*Float shortPrice = mberManageVO.getShortPrice();
|
||||
Float longPrice = mberManageVO.getLongPrice();
|
||||
Float picturePrice = mberManageVO.getPicturePrice();
|
||||
Float picture2Price = mberManageVO.getPicture2Price();
|
||||
Float picture3Price = mberManageVO.getPicture3Price();*/
|
||||
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
|
||||
|
||||
model.addAttribute("userMoney", userMoney);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//최근 전송 내역
|
||||
MjonMsgDataVO searchVO = new MjonMsgDataVO();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date now = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
|
||||
cal.setTime(now);
|
||||
cal.add(Calendar.DATE, -3);
|
||||
String chkDate = format.format(cal.getTime());
|
||||
searchVO.setUserId(userId);
|
||||
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
|
||||
// 특수문자 리스트 불러오기
|
||||
MjonSymbolVO symbolVO = new MjonSymbolVO();
|
||||
List<MjonSymbolVO> symbolList = mjonSymbolService.selectMjonSymbolList(symbolVO);
|
||||
model.addAttribute("symbolList", symbolList);
|
||||
|
||||
//아이디 발신번호 리스트 불러오기.
|
||||
List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId);
|
||||
List<String> resultPhonList = new ArrayList<String>();
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
for(String phone : resultSendPhonList) {
|
||||
resultPhonList.add(mjUtil.addDash(phone));
|
||||
}
|
||||
model.addAttribute("resultPhonList", resultPhonList);
|
||||
|
||||
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
|
||||
model.addAttribute("atSmishingYn", mberManageVO.getAtSmishingYn());
|
||||
|
||||
//3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용
|
||||
/*Float shortPrice = mberManageVO.getShortPrice();
|
||||
Float longPrice = mberManageVO.getLongPrice();
|
||||
Float picturePrice = mberManageVO.getPicturePrice();
|
||||
Float picture2Price = mberManageVO.getPicture2Price();
|
||||
Float picture3Price = mberManageVO.getPicture3Price();*/
|
||||
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
|
||||
|
||||
model.addAttribute("userMoney", userMoney);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//최근 전송 내역
|
||||
MjonMsgDataVO searchVO = new MjonMsgDataVO();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date now = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
|
||||
cal.setTime(now);
|
||||
cal.add(Calendar.DATE, -3);
|
||||
String chkDate = format.format(cal.getTime());
|
||||
searchVO.setUserId(userId);
|
||||
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
|
||||
// model.addAttribute("resultLatestMsgList", mjonMsgDataService.selectLatestMsgList(searchVO));
|
||||
|
||||
//자주보내는 번호
|
||||
|
||||
//자주보내는 번호
|
||||
// model.addAttribute("resultBookMarkMsgList", mjonMsgDataService.selectBookMarkMsgList(searchVO));
|
||||
|
||||
// 사용자 정의 단가 정보 불러오기(시스템 단가 혹은 협의 단가)
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
|
||||
|
||||
//사용자 템플릿 정보 조회
|
||||
String friendId = kakaoVO.getFriendId();
|
||||
KakaoVO resultTemplateVO = new KakaoVO();
|
||||
|
||||
if(friendId != null) {
|
||||
resultTemplateVO = kakaoFtTemplateService.selectKakaoFriendsTemplateDetail(kakaoVO);
|
||||
}
|
||||
model.addAttribute("resultTemplateVO", resultTemplateVO);
|
||||
|
||||
|
||||
//친구톡 발송시간 체크 하기 - 20:50 ~ 익일 08:00 사이에는 발송 금지
|
||||
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Date nows = new Date();
|
||||
String nowDate = sdf1.format(nows);
|
||||
cal.setTime(nows);
|
||||
|
||||
int hours = cal.get(Calendar.HOUR_OF_DAY);
|
||||
int minuts = cal.get(Calendar.MINUTE);
|
||||
|
||||
// 사용자 정의 단가 정보 불러오기(시스템 단가 혹은 협의 단가)
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
|
||||
|
||||
//사용자 템플릿 정보 조회
|
||||
String friendId = kakaoVO.getFriendId();
|
||||
KakaoVO resultTemplateVO = new KakaoVO();
|
||||
|
||||
if(friendId != null) {
|
||||
resultTemplateVO = kakaoFtTemplateService.selectKakaoFriendsTemplateDetail(kakaoVO);
|
||||
}
|
||||
model.addAttribute("resultTemplateVO", resultTemplateVO);
|
||||
|
||||
|
||||
//친구톡 발송시간 체크 하기 - 20:50 ~ 익일 08:00 사이에는 발송 금지
|
||||
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Date nows = new Date();
|
||||
String nowDate = sdf1.format(nows);
|
||||
cal.setTime(nows);
|
||||
|
||||
int hours = cal.get(Calendar.HOUR_OF_DAY);
|
||||
int minuts = cal.get(Calendar.MINUTE);
|
||||
|
||||
boolean sendStatus = true;
|
||||
boolean sendStatus = true;
|
||||
|
||||
if(hours >= 20) {
|
||||
|
||||
if(hours >= 20) {
|
||||
if(minuts >= 50) {
|
||||
|
||||
if(minuts >= 50) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
sendStatus = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(hours < 8) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
sendStatus = false;
|
||||
|
||||
}
|
||||
|
||||
System.out.println("발송상태는 ::: "+sendStatus);
|
||||
model.addAttribute("sendStatus", sendStatus);
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(" kakaoFriendsTalkMsgDataViewDataRegist Error ::: " + e);
|
||||
if(hours < 8) {
|
||||
|
||||
System.out.println("발송금지 시간" + hours + ":" + minuts);
|
||||
sendStatus = false;
|
||||
|
||||
}
|
||||
|
||||
System.out.println("발송상태는 ::: "+sendStatus);
|
||||
model.addAttribute("sendStatus", sendStatus);
|
||||
|
||||
}
|
||||
|
||||
return "web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView";
|
||||
|
||||
@ -27,10 +27,14 @@ var _fileForm2 = new Array();
|
||||
var fileExt = ""; // 첨부파일 확장자
|
||||
var excelAddr = []; //엑셀 불러오기에서 내용 저장하는 배열 변수
|
||||
|
||||
var KAKAO_FT_PRICE = $('#kakaoFtPrice').val();
|
||||
var KAKAO_FT_PRICE;
|
||||
var KAKAO_FT_IMG_PRICE;
|
||||
var KAKAO_FT_WIDE_IMG_PRICE;
|
||||
$(document).ready(function (){
|
||||
|
||||
KAKAO_FT_PRICE = $('#kakaoFtPrice').val();
|
||||
KAKAO_FT_IMG_PRICE = $('#kakaoFtImgPrice').val();
|
||||
KAKAO_FT_WIDE_IMG_PRICE = $('#kakaoFtWideImgPrice').val();
|
||||
//화면 초기 로딩시 화면 처리해주기 - 템플릿 불러오기 했을 경우를 위함
|
||||
initFormChk();
|
||||
|
||||
@ -170,6 +174,10 @@ $(document).ready(function (){
|
||||
$("input[name='img_file_add']").change(function () {
|
||||
|
||||
imageInit();
|
||||
|
||||
|
||||
//결제 금액 구하기
|
||||
totalFtPriceSum(tableL.getRows().length);
|
||||
});
|
||||
|
||||
// 최근 전송내역
|
||||
@ -1594,6 +1602,8 @@ function updateButtons(){
|
||||
|
||||
<!-- 각 금액 단가 -->
|
||||
<input type="hidden" id="kakaoFtPrice" value="<c:out value='${sendPrice.kakaoFtPrice}' />"> <!-- 친구톡 단가 -->
|
||||
<input type="hidden" id="kakaoFtImgPrice" value="<c:out value='${sendPrice.kakaoFtImgPrice}' />"> <!-- 친구톡 이미지 단가 -->
|
||||
<input type="hidden" id="kakaoFtWideImgPrice" value="<c:out value='${sendPrice.kakaoFtWideImgPrice}' />"> <!-- 친구톡 와이드이미지 단가 -->
|
||||
<input type="hidden" id="longPrice" value="<c:out value='${sendPrice.longPrice}' />"> <!-- mms 단가 -->
|
||||
<input type="hidden" id="shortPrice" value="<c:out value='${sendPrice.shortPrice}' />"> <!-- sms 단가 -->
|
||||
|
||||
@ -1636,7 +1646,6 @@ function updateButtons(){
|
||||
<input type="hidden" id="callFrom" name="callFrom" value=""/>
|
||||
|
||||
<!-- 친구톡 발송 단가 정보 -->
|
||||
<input type="hidden" id="kakaoFtPrice" name="kakaoFtPrice" value="<c:out value='${sendPrice.kakaoFtPrice}' />"/>
|
||||
<!-- <input type="hidden" id="eachPrice" name="eachPrice" value="0"/> -->
|
||||
<!-- <input type="hidden" id="totPrice" name="totalPrice" value="0"/> -->
|
||||
|
||||
|
||||
@ -36,7 +36,18 @@ $('document').ready(function(){
|
||||
function totalFtPriceSum(totRows){
|
||||
|
||||
var collNumCnt = parseInt(totRows); //받는사람 건수
|
||||
var price = $("#kakaoFtPrice").val(); //개별 건수 금액
|
||||
var price;
|
||||
|
||||
|
||||
if ($("input[name='img_file_add']:checked").attr("id") == "img_file_1") {
|
||||
price = KAKAO_FT_IMG_PRICE;
|
||||
} else if ($("input[name='img_file_add']:checked").attr("id") == "img_file_2") {
|
||||
price = KAKAO_FT_WIDE_IMG_PRICE;
|
||||
} else {
|
||||
price = KAKAO_FT_PRICE; //개별 건수 금액
|
||||
}
|
||||
|
||||
|
||||
var totalPrice = 0; //전체 금액
|
||||
var totalStr = "0"; //전체 합계 금액
|
||||
var userMoney = $('#hdUserMoney').text(); //헤더 영역 보유 금액 불러오기
|
||||
|
||||
Loading…
Reference in New Issue
Block a user