--- src/main/java/itn/let/module/base/PriceAndPoint.java
+++ src/main/java/itn/let/module/base/PriceAndPoint.java
... | ... | @@ -1,17 +1,19 @@ |
| 1 | 1 |
package itn.let.module.base; |
| 2 |
- |
|
| 2 |
+ |
|
| 3 | 3 |
import java.math.BigDecimal; |
| 4 | 4 |
import java.math.RoundingMode; |
| 5 |
-import java.util.List; |
|
| 6 | 5 |
|
| 7 | 6 |
import javax.annotation.Resource; |
| 8 | 7 |
|
| 9 | 8 |
import org.springframework.stereotype.Component; |
| 10 | 9 |
|
| 10 |
+import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
|
| 11 | 11 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 12 | 12 |
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO; |
| 13 |
+import itn.let.mjo.pay.service.MjonPayVO; |
|
| 14 |
+import itn.let.mjo.pay.service.impl.MjonPayDAO; |
|
| 13 | 15 |
import itn.let.uss.umt.service.MberManageVO; |
| 14 |
- |
|
| 16 |
+ |
|
| 15 | 17 |
/** |
| 16 | 18 |
* |
| 17 | 19 |
* @author : 이호영 |
... | ... | @@ -28,22 +30,40 @@ |
| 28 | 30 |
*/ |
| 29 | 31 |
@Component |
| 30 | 32 |
public class PriceAndPoint {
|
| 31 |
- |
|
| 33 |
+ |
|
| 32 | 34 |
@Resource(name="MjonMsgDataDAO") |
| 33 | 35 |
private MjonMsgDataDAO mjonMsgDataDAO; |
| 34 |
- |
|
| 36 |
+ |
|
| 37 |
+ /** |
|
| 38 |
+ * @methodName : getBefCash |
|
| 39 |
+ * @author : 이호영 |
|
| 40 |
+ * @date : 2023.03.30 |
|
| 41 |
+ * @description : 사용자 보유 잔액 |
|
| 42 |
+ * @param userId |
|
| 43 |
+ * @return |
|
| 44 |
+ * @throws Exception |
|
| 45 |
+ */ |
|
| 35 | 46 |
public String getBefCash(String userId) throws Exception {
|
| 36 | 47 |
MjonMsgVO mjonMsgVO = new MjonMsgVO(); |
| 37 | 48 |
mjonMsgVO.setUserId(userId); |
| 38 | 49 |
return mjonMsgDataDAO.selectBeforeCashData(mjonMsgVO); |
| 39 | 50 |
} |
| 40 |
- |
|
| 51 |
+ |
|
| 52 |
+ /** |
|
| 53 |
+ * @methodName : getBefPoint |
|
| 54 |
+ * @author : 이호영 |
|
| 55 |
+ * @date : 2023.03.30 |
|
| 56 |
+ * @description : 사용자 보유 포인트 |
|
| 57 |
+ * @param userId |
|
| 58 |
+ * @return |
|
| 59 |
+ * @throws Exception |
|
| 60 |
+ */ |
|
| 41 | 61 |
public String getBefPoint(String userId) throws Exception {
|
| 42 | 62 |
MjonMsgVO mjonMsgVO = new MjonMsgVO(); |
| 43 | 63 |
mjonMsgVO.setUserId(userId); |
| 44 | 64 |
return mjonMsgDataDAO.selectBeforePointData(mjonMsgVO); |
| 45 | 65 |
} |
| 46 |
- |
|
| 66 |
+ |
|
| 47 | 67 |
/** |
| 48 | 68 |
* @methodName : getUserMoney |
| 49 | 69 |
* @author : 이호영 |
... | ... | @@ -57,6 +77,44 @@ |
| 57 | 77 |
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId); |
| 58 | 78 |
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN); |
| 59 | 79 |
return userMoney; |
| 60 |
- } |
|
| 61 |
- |
|
| 62 |
-} |
|
| 80 |
+ } |
|
| 81 |
+ |
|
| 82 |
+ |
|
| 83 |
+ |
|
| 84 |
+ /** |
|
| 85 |
+ * @methodName : insertCashAndPoint |
|
| 86 |
+ * @author : 이호영 |
|
| 87 |
+ * @date : 2024.03.26 |
|
| 88 |
+ * @description : |
|
| 89 |
+ * @param mjonPayDAO |
|
| 90 |
+ * @param idgenMjonCashId |
|
| 91 |
+ * @param userId |
|
| 92 |
+ * @param totPrice |
|
| 93 |
+ * @param memo |
|
| 94 |
+ * @param msgGroupId |
|
| 95 |
+ * @throws Exception |
|
| 96 |
+ */ |
|
| 97 |
+ public static void insertCashAndPoint( |
|
| 98 |
+ MjonPayDAO mjonPayDAO |
|
| 99 |
+ , EgovIdGnrService idgenMjonCashId |
|
| 100 |
+ , String userId |
|
| 101 |
+ , float totPrice |
|
| 102 |
+ , String memo |
|
| 103 |
+ , String msgGroupId |
|
| 104 |
+ ) throws Exception {
|
|
| 105 |
+ |
|
| 106 |
+ MjonPayVO mjonPayVO = new MjonPayVO(); |
|
| 107 |
+ mjonPayVO.setCashId(idgenMjonCashId.getNextStringId()); |
|
| 108 |
+ mjonPayVO.setUserId(userId); |
|
| 109 |
+ mjonPayVO.setCash(totPrice); |
|
| 110 |
+ mjonPayVO.setFrstRegisterId(userId); |
|
| 111 |
+ mjonPayVO.setMemo(memo); |
|
| 112 |
+ mjonPayVO.setMsgGroupId(msgGroupId); |
|
| 113 |
+ |
|
| 114 |
+ mjonPayDAO.insertCash(mjonPayVO); //캐시 |
|
| 115 |
+ mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트 |
|
| 116 |
+ |
|
| 117 |
+ } |
|
| 118 |
+ |
|
| 119 |
+ |
|
| 120 |
+}(No newline at end of file) |
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?