--- src/main/java/itn/let/mjo/pay/service/MjonPayService.java
+++ src/main/java/itn/let/mjo/pay/service/MjonPayService.java
... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 |
package itn.let.mjo.pay.service; |
| 2 | 2 |
|
| 3 | 3 |
import java.util.List; |
| 4 |
+import java.util.Map; |
|
| 4 | 5 |
|
| 5 | 6 |
import javax.servlet.http.HttpServletRequest; |
| 6 | 7 |
|
... | ... | @@ -140,4 +141,6 @@ |
| 140 | 141 |
//누적 납부금액 조회 (후불회원이 사용금액을 실 납부한 금액 합산 - 미납 금액 제외한 총 합산 금액) |
| 141 | 142 |
public String selectTotSumPaymentAfterPay(String userId) throws Exception; |
| 142 | 143 |
|
| 144 |
+ Map<String, Object> payUserSWList(MjonPayVO mjonPayVO) throws Exception; |
|
| 145 |
+ |
|
| 143 | 146 |
} |
--- src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
+++ src/main/java/itn/let/mjo/pay/service/impl/MjonPayServiceImpl.java
... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 |
import java.util.HashMap; |
| 13 | 13 |
import java.util.Iterator; |
| 14 | 14 |
import java.util.List; |
| 15 |
+import java.util.Map; |
|
| 15 | 16 |
|
| 16 | 17 |
import javax.annotation.Resource; |
| 17 | 18 |
import javax.servlet.http.HttpServletRequest; |
... | ... | @@ -25,11 +26,14 @@ |
| 25 | 26 |
import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
| 26 | 27 |
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; |
| 27 | 28 |
import itn.com.cmm.LoginVO; |
| 29 |
+import itn.com.cmm.util.DateUtils; |
|
| 28 | 30 |
import itn.com.cmm.util.MJUtil; |
| 29 | 31 |
import itn.com.utl.fcc.service.EgovStringUtil; |
| 30 | 32 |
import itn.let.mjo.event.service.MjonEventVO; |
| 31 | 33 |
import itn.let.mjo.event.service.impl.MjonEventDAO; |
| 32 | 34 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 35 |
+import itn.let.mjo.msgcampain.service.MjonCandidateVO; |
|
| 36 |
+import itn.let.mjo.msgcampain.service.impl.MjonCandidateDAO; |
|
| 33 | 37 |
import itn.let.mjo.msgdata.service.MjonMsgDataService; |
| 34 | 38 |
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO; |
| 35 | 39 |
import itn.let.mjo.pay.service.MjonPayService; |
... | ... | @@ -93,6 +97,10 @@ |
| 93 | 97 |
/* 등급제 */ |
| 94 | 98 |
@Resource(name = "mberGrdService") |
| 95 | 99 |
MberGrdService mberGrdService; |
| 100 |
+ |
|
| 101 |
+ @Resource(name="mjonCandidateDAO") |
|
| 102 |
+ private MjonCandidateDAO mjonCandidateDAO; |
|
| 103 |
+ |
|
| 96 | 104 |
|
| 97 | 105 |
@Override |
| 98 | 106 |
public List<MjonPayVO> selectPayList(MjonPayVO mjonPayVO) throws Exception {
|
... | ... | @@ -2839,6 +2847,99 @@ |
| 2839 | 2847 |
|
| 2840 | 2848 |
} |
| 2841 | 2849 |
|
| 2850 |
+ @Override |
|
| 2851 |
+ public Map<String, Object> payUserSWList(MjonPayVO mjonPayVO) throws Exception{
|
|
| 2852 |
+ |
|
| 2853 |
+ |
|
| 2854 |
+ String userId = mjonPayVO.getUserId(); |
|
| 2855 |
+ |
|
| 2856 |
+ // 총 사용금액 |
|
| 2857 |
+ List<MjonPayVO> usedCashTotList = mjonPayDAO.selectUsedCashWithKakaoTotCnt(mjonPayVO); |
|
| 2858 |
+ |
|
| 2859 |
+ // 사용가능한 금액 |
|
| 2860 |
+ // mberManageVO.prePaymentYn 선불 후불 회원 구분으로 인해 select함 |
|
| 2861 |
+ MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId); |
|
| 2862 |
+ // 선거 후보자 정보 조회 |
|
| 2863 |
+ MjonCandidateVO mjonCandidateVO = new MjonCandidateVO(); |
|
| 2864 |
+ if("p".equals(mberManageVO.getDept())) { //개인회원 선거 후보자 정보 불러오기
|
|
| 2865 |
+ mjonCandidateVO = mjonCandidateDAO.selectCandidateDataInfo(userId); |
|
| 2866 |
+ if(mjonCandidateVO != null) {
|
|
| 2867 |
+ mjonCandidateVO.setRegidentNo1(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo1())); |
|
| 2868 |
+ mjonCandidateVO.setRegidentNo2(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo2())); |
|
| 2869 |
+ } |
|
| 2870 |
+ } |
|
| 2871 |
+ |
|
| 2872 |
+ |
|
| 2873 |
+ /** |
|
| 2874 |
+ * 후불제 회원 관련 사용 요금 내역 정보 조회하기 |
|
| 2875 |
+ * 20231228 우영두 추가 |
|
| 2876 |
+ * 누적사용금액, 누적 납부금액, 당월 납부 예상금액 정보 조회 |
|
| 2877 |
+ * |
|
| 2878 |
+ * */ |
|
| 2879 |
+ //누적 사용금액 조회 (캐시 테이블에서 현재까지 사용된 금액 합산 - 캐시 테이블에서 "-"로 사용된 금액만 합산) |
|
| 2880 |
+ String totSumCashAfterPay = mjonPayDAO.selectTotalSumCashForAfterPay(userId); |
|
| 2881 |
+ |
|
| 2882 |
+ //누적 사용 포인트 조회 (포인트 테이블에서 현재까지 사용된 포인트 합산 - 회원 포인트 정보 업데이트시 사용되는 쿼리 이용) |
|
| 2883 |
+ String totSumPointAfterPay = mjonPayDAO.selectTotalSumPointForAfterPay(userId); |
|
| 2884 |
+ |
|
| 2885 |
+ //누적 납부금액 조회 (후불회원이 사용금액을 실 납부한 금액 합산 - 미납 금액 제외한 총 합산 금액) |
|
| 2886 |
+ String totSumPaymentAfterPay = mjonPayDAO.selectTotSumPaymentAfterPay(userId); |
|
| 2887 |
+ |
|
| 2888 |
+ //누적 납부 포인트 조회 ( 누적 납부금액 합산에 대한 2% 포인트 정보 계산) |
|
| 2889 |
+ float p_i_re_point = 0; |
|
| 2890 |
+ JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo(); |
|
| 2891 |
+ if (sysJoinSetVO != null) {
|
|
| 2892 |
+ p_i_re_point = sysJoinSetVO.getPointPer(); |
|
| 2893 |
+ } |
|
| 2894 |
+ int paymentPointAfterPay = Math.round((Float.parseFloat(totSumPaymentAfterPay) * p_i_re_point / 100)); |
|
| 2895 |
+ |
|
| 2896 |
+ //당월 납부 예상금액 (누적 사용금액 합산 - 누적 납부금액 합산 정보 계산) |
|
| 2897 |
+ float unPaymentAfterPay = Float.parseFloat(totSumCashAfterPay) - Float.parseFloat(totSumPaymentAfterPay); |
|
| 2898 |
+ |
|
| 2899 |
+ //당월 납부 예상 포인트 (당월 납부 예상 금액에 대한 2% 포인트 정보 계산) |
|
| 2900 |
+ int unPaymentPointAfterPay = Math.round((unPaymentAfterPay * p_i_re_point / 100)); |
|
| 2901 |
+ |
|
| 2902 |
+ /* |
|
| 2903 |
+ * 2024.02.06 후불제 회원 중 협의단가를 사용하는 회원은 포인트 적립이 되지 않아야함. |
|
| 2904 |
+ * 후불제 협의 단가 여부 체크 |
|
| 2905 |
+ * 모든 협의 단가 금액을 합산하여 0보다 크면 협의단가 있음. |
|
| 2906 |
+ * */ |
|
| 2907 |
+ float shortPrice = mberManageVO.getShortPrice(); |
|
| 2908 |
+ float longPrice = mberManageVO.getLongPrice(); |
|
| 2909 |
+ float picturePrice = mberManageVO.getPicturePrice() + mberManageVO.getPicture2Price() + mberManageVO.getPicture3Price(); |
|
| 2910 |
+ float kakaoAtPrice = mberManageVO.getKakaoAtPrice(); |
|
| 2911 |
+ float kakaoFtPrice = mberManageVO.getKakaoFtPrice(); |
|
| 2912 |
+ float totPrice = shortPrice + longPrice + picturePrice + kakaoAtPrice + kakaoFtPrice; |
|
| 2913 |
+ String negoPriceYn = "N"; |
|
| 2914 |
+ |
|
| 2915 |
+ if(totPrice > 0) {
|
|
| 2916 |
+ negoPriceYn = "Y"; |
|
| 2917 |
+ } |
|
| 2918 |
+ |
|
| 2919 |
+ |
|
| 2920 |
+ |
|
| 2921 |
+ Map<String, Object> returnData = new HashMap<>(); |
|
| 2922 |
+ |
|
| 2923 |
+ |
|
| 2924 |
+ returnData.put("usedCashTotList", usedCashTotList);
|
|
| 2925 |
+ returnData.put("mberManageVO", mberManageVO);
|
|
| 2926 |
+ returnData.put("mjonCandidateVO", mjonCandidateVO);
|
|
| 2927 |
+ returnData.put("totSumCashAfterPay", totSumCashAfterPay);
|
|
| 2928 |
+ returnData.put("totSumPointAfterPay", totSumPointAfterPay);
|
|
| 2929 |
+ returnData.put("totSumPaymentAfterPay", totSumPaymentAfterPay);
|
|
| 2930 |
+ returnData.put("sumPaymentPointAfterPay", paymentPointAfterPay);
|
|
| 2931 |
+ returnData.put("unPaymentAfterPay", unPaymentAfterPay);
|
|
| 2932 |
+ returnData.put("unPaymentPointAfterPay", unPaymentPointAfterPay);
|
|
| 2933 |
+ returnData.put("negoPriceYn", negoPriceYn);
|
|
| 2934 |
+ // 초기 날짜 셋팅 |
|
| 2935 |
+ returnData.put("startDate", DateUtils.getDateMonthsAgo(12));
|
|
| 2936 |
+ returnData.put("endDate", DateUtils.getCurrentDate());
|
|
| 2937 |
+ |
|
| 2938 |
+ |
|
| 2939 |
+ // TODO Auto-generated method stub |
|
| 2940 |
+ return returnData; |
|
| 2941 |
+ } |
|
| 2942 |
+ |
|
| 2842 | 2943 |
|
| 2843 | 2944 |
|
| 2844 | 2945 |
} |
--- src/main/java/itn/let/mjo/pay/web/MjonPayController.java
+++ src/main/java/itn/let/mjo/pay/web/MjonPayController.java
... | ... | @@ -2612,6 +2612,7 @@ |
| 2612 | 2612 |
MberManageVO mberManageVO, RedirectAttributes redirectAttributes, |
| 2613 | 2613 |
HttpServletRequest request, |
| 2614 | 2614 |
ModelMap model) throws Exception{
|
| 2615 |
+ |
|
| 2615 | 2616 |
|
| 2616 | 2617 |
/*LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();*/ |
| 2617 | 2618 |
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; |
... | ... | @@ -2621,133 +2622,25 @@ |
| 2621 | 2622 |
return "redirect:/web/user/login/login.do"; |
| 2622 | 2623 |
} |
| 2623 | 2624 |
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
| 2624 |
- mjonMsgVO.setUserId(userId); |
|
| 2625 |
+ mjonPayVO.setUserId(userId); |
|
| 2625 | 2626 |
|
| 2626 | 2627 |
|
| 2627 |
- // 비즈니스 로직 부분 |
|
| 2628 |
-// Map<String, Object> resultMap = mjonPayService.payUserSWList(mjonPayVO); |
|
| 2628 |
+// // 비즈니스 로직 부분 |
|
| 2629 |
+ Map<String, Object> resultMap = mjonPayService.payUserSWList(mjonPayVO); |
|
| 2629 | 2630 |
|
| 2630 | 2631 |
|
| 2631 |
- |
|
| 2632 |
- |
|
| 2633 |
- /* |
|
| 2634 |
- { // 충전캐시
|
|
| 2635 |
- String sumPayMoney = mjonPayService.selectAgentSumPayMoney(userId); |
|
| 2636 |
- model.addAttribute("sumPayMoney", sumPayMoney);
|
|
| 2637 |
- } |
|
| 2638 |
- |
|
| 2639 |
- { // 충전포인트
|
|
| 2640 |
- String sumPoint = mjonPayService.selectSumPoint(userId); |
|
| 2641 |
- model.addAttribute("sumPoint", sumPoint);
|
|
| 2642 |
- } |
|
| 2643 |
- */ |
|
| 2644 |
- |
|
| 2645 |
- { // 총 사용금액
|
|
| 2646 |
- mjonPayVO.setUserId(userId); |
|
| 2647 |
- List<MjonPayVO> usedCashTotList = mjonPayService.selectUsedCashWithKakaoTotCnt(mjonPayVO); |
|
| 2648 |
- model.addAttribute("usedCashTotList", usedCashTotList);
|
|
| 2649 |
- } |
|
| 2650 |
- { // 사용가능한 금액
|
|
| 2651 |
- // mberManageVO.prePaymentYn 선불 후불 회원 구분으로 인해 select함 |
|
| 2652 |
- mberManageVO = mjonMsgDataService.selectMberManageInfo(userId); |
|
| 2653 |
- model.addAttribute("mberManageVO", mberManageVO);
|
|
| 2654 |
- } |
|
| 2655 |
- /* |
|
| 2656 |
- { // 발송건수
|
|
| 2657 |
- mjonMsgVO.setReserveYn("N");
|
|
| 2658 |
- List<MjonMsgVO> sendTotList = mjonMsgService.selectWithKakaoSendTotCnt(mjonMsgVO); |
|
| 2659 |
- model.addAttribute("sendTotList", sendTotList);
|
|
| 2660 |
- } |
|
| 2661 |
- |
|
| 2662 |
- { // 예약건수
|
|
| 2663 |
- mjonMsgVO.setReserveYn("Y");
|
|
| 2664 |
- List<MjonMsgVO> reservToList = mjonMsgService.selectWithKakaoSendTotCnt(mjonMsgVO); |
|
| 2665 |
- model.addAttribute("reservToList", reservToList);
|
|
| 2666 |
- } |
|
| 2667 |
- */ |
|
| 2668 |
- {// 선거 후보자 정보 조회
|
|
| 2669 |
- MjonCandidateVO mjonCandidateVO = new MjonCandidateVO(); |
|
| 2670 |
- if("p".equals(mberManageVO.getDept())) { //개인회원 선거 후보자 정보 불러오기
|
|
| 2671 |
- mjonCandidateVO = mjonCandidateService.selectCandidateDataInfo(userId); |
|
| 2672 |
- if(mjonCandidateVO != null) {
|
|
| 2673 |
- mjonCandidateVO.setRegidentNo1(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo1())); |
|
| 2674 |
- mjonCandidateVO.setRegidentNo2(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo2())); |
|
| 2675 |
- } |
|
| 2676 |
- } |
|
| 2677 |
- model.addAttribute("mjonCandidateVO", mjonCandidateVO);
|
|
| 2678 |
- } |
|
| 2679 |
- |
|
| 2680 |
- |
|
| 2681 |
- {
|
|
| 2682 |
- /** |
|
| 2683 |
- * 후불제 회원 관련 사용 요금 내역 정보 조회하기 |
|
| 2684 |
- * 20231228 우영두 추가 |
|
| 2685 |
- * 누적사용금액, 누적 납부금액, 당월 납부 예상금액 정보 조회 |
|
| 2686 |
- * |
|
| 2687 |
- * */ |
|
| 2688 |
- |
|
| 2689 |
- //누적 사용금액 조회 (캐시 테이블에서 현재까지 사용된 금액 합산 - 캐시 테이블에서 "-"로 사용된 금액만 합산) |
|
| 2690 |
- String totSumCashAfterPay = mjonPayService.selectTotalSumCashForAfterPay(userId); |
|
| 2691 |
- model.addAttribute("totSumCashAfterPay", totSumCashAfterPay);
|
|
| 2692 |
- |
|
| 2693 |
- //누적 사용 포인트 조회 (포인트 테이블에서 현재까지 사용된 포인트 합산 - 회원 포인트 정보 업데이트시 사용되는 쿼리 이용) |
|
| 2694 |
- String totSumPointAfterPay = mjonPayService.selectTotalSumPointForAfterPay(userId); |
|
| 2695 |
- model.addAttribute("totSumPointAfterPay", totSumPointAfterPay);
|
|
| 2696 |
- |
|
| 2697 |
- //누적 납부금액 조회 (후불회원이 사용금액을 실 납부한 금액 합산 - 미납 금액 제외한 총 합산 금액) |
|
| 2698 |
- String totSumPaymentAfterPay = mjonPayService.selectTotSumPaymentAfterPay(userId); |
|
| 2699 |
- model.addAttribute("totSumPaymentAfterPay", totSumPaymentAfterPay);
|
|
| 2700 |
- |
|
| 2701 |
- //누적 납부 포인트 조회 ( 누적 납부금액 합산에 대한 2% 포인트 정보 계산) |
|
| 2702 |
- float p_i_re_point = 0; |
|
| 2703 |
- JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo(); |
|
| 2704 |
- if (sysJoinSetVO != null) {
|
|
| 2705 |
- p_i_re_point = sysJoinSetVO.getPointPer(); |
|
| 2706 |
- } |
|
| 2707 |
- int paymentPointAfterPay = Math.round((Float.parseFloat(totSumPaymentAfterPay) * p_i_re_point / 100)); |
|
| 2708 |
- model.addAttribute("sumPaymentPointAfterPay", paymentPointAfterPay);
|
|
| 2709 |
- |
|
| 2710 |
- //당월 납부 예상금액 (누적 사용금액 합산 - 누적 납부금액 합산 정보 계산) |
|
| 2711 |
- |
|
| 2712 |
- float unPaymentAfterPay = Float.parseFloat(totSumCashAfterPay) - Float.parseFloat(totSumPaymentAfterPay); |
|
| 2713 |
- model.addAttribute("unPaymentAfterPay", unPaymentAfterPay);
|
|
| 2714 |
- |
|
| 2715 |
- //당월 납부 예상 포인트 (당월 납부 예상 금액에 대한 2% 포인트 정보 계산) |
|
| 2716 |
- int unPaymentPointAfterPay = Math.round((unPaymentAfterPay * p_i_re_point / 100)); |
|
| 2717 |
- model.addAttribute("unPaymentPointAfterPay", unPaymentPointAfterPay);
|
|
| 2718 |
- |
|
| 2719 |
- /* |
|
| 2720 |
- * 2024.02.06 후불제 회원 중 협의단가를 사용하는 회원은 포인트 적립이 되지 않아야함. |
|
| 2721 |
- * 후불제 협의 단가 여부 체크 |
|
| 2722 |
- * 모든 협의 단가 금액을 합산하여 0보다 크면 협의단가 있음. |
|
| 2723 |
- * */ |
|
| 2724 |
- float shortPrice = mberManageVO.getShortPrice(); |
|
| 2725 |
- float longPrice = mberManageVO.getLongPrice(); |
|
| 2726 |
- float picturePrice = mberManageVO.getPicturePrice() + mberManageVO.getPicture2Price() + mberManageVO.getPicture3Price(); |
|
| 2727 |
- float kakaoAtPrice = mberManageVO.getKakaoAtPrice(); |
|
| 2728 |
- float kakaoFtPrice = mberManageVO.getKakaoFtPrice(); |
|
| 2729 |
- float totPrice = shortPrice + longPrice + picturePrice + kakaoAtPrice + kakaoFtPrice; |
|
| 2730 |
- String negoPriceYn = "N"; |
|
| 2731 |
- |
|
| 2732 |
- if(totPrice > 0) {
|
|
| 2733 |
- negoPriceYn = "Y"; |
|
| 2734 |
- } |
|
| 2735 |
- model.addAttribute("negoPriceYn", negoPriceYn);
|
|
| 2736 |
- |
|
| 2737 |
- } |
|
| 2738 |
- {
|
|
| 2739 |
- // 초기 날짜 셋팅 |
|
| 2740 |
- model.addAttribute("startDate", DateUtils.getDateMonthsAgo(12));
|
|
| 2741 |
- model.addAttribute("endDate", DateUtils.getCurrentDate());
|
|
| 2742 |
- } |
|
| 2743 |
- |
|
| 2744 |
- |
|
| 2745 |
- |
|
| 2746 |
- |
|
| 2747 |
- |
|
| 2748 |
- |
|
| 2749 |
- |
|
| 2750 |
- |
|
| 2632 |
+ model.addAttribute("usedCashTotList", resultMap.get("usedCashTotList"));
|
|
| 2633 |
+ model.addAttribute("mjonCandidateVO", resultMap.get("mjonCandidateVO"));
|
|
| 2634 |
+ model.addAttribute("mberManageVO", resultMap.get("mberManageVO"));
|
|
| 2635 |
+ model.addAttribute("totSumCashAfterPay", resultMap.get("totSumCashAfterPay"));
|
|
| 2636 |
+ model.addAttribute("totSumPointAfterPay", resultMap.get("totSumPointAfterPay"));
|
|
| 2637 |
+ model.addAttribute("totSumPaymentAfterPay", resultMap.get("totSumPaymentAfterPay"));
|
|
| 2638 |
+ model.addAttribute("sumPaymentPointAfterPay", resultMap.get("sumPaymentPointAfterPay"));
|
|
| 2639 |
+ model.addAttribute("unPaymentAfterPay", resultMap.get("unPaymentAfterPay"));
|
|
| 2640 |
+ model.addAttribute("unPaymentPointAfterPay", resultMap.get("unPaymentPointAfterPay"));
|
|
| 2641 |
+ model.addAttribute("negoPriceYn", resultMap.get("negoPriceYn"));
|
|
| 2642 |
+ model.addAttribute("startDate", resultMap.get("startDate"));
|
|
| 2643 |
+ model.addAttribute("endDate", resultMap.get("endDate"));
|
|
| 2751 | 2644 |
|
| 2752 | 2645 |
|
| 2753 | 2646 |
return "/web/pay/PayUserSWList"; |
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?