금액 포인트 class 수정
This commit is contained in:
parent
7d2ce518aa
commit
6d974cae65
@ -1,17 +1,19 @@
|
||||
package itn.let.module.base;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
import itn.let.mjo.pay.service.impl.MjonPayDAO;
|
||||
import itn.let.uss.umt.service.MberManageVO;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
@ -28,22 +30,40 @@ import itn.let.uss.umt.service.MberManageVO;
|
||||
*/
|
||||
@Component
|
||||
public class PriceAndPoint {
|
||||
|
||||
|
||||
@Resource(name="MjonMsgDataDAO")
|
||||
private MjonMsgDataDAO mjonMsgDataDAO;
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getBefCash
|
||||
* @author : 이호영
|
||||
* @date : 2023.03.30
|
||||
* @description : 사용자 보유 잔액
|
||||
* @param userId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String getBefCash(String userId) throws Exception {
|
||||
MjonMsgVO mjonMsgVO = new MjonMsgVO();
|
||||
mjonMsgVO.setUserId(userId);
|
||||
return mjonMsgDataDAO.selectBeforeCashData(mjonMsgVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getBefPoint
|
||||
* @author : 이호영
|
||||
* @date : 2023.03.30
|
||||
* @description : 사용자 보유 포인트
|
||||
* @param userId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String getBefPoint(String userId) throws Exception {
|
||||
MjonMsgVO mjonMsgVO = new MjonMsgVO();
|
||||
mjonMsgVO.setUserId(userId);
|
||||
return mjonMsgDataDAO.selectBeforePointData(mjonMsgVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getUserMoney
|
||||
* @author : 이호영
|
||||
@ -57,6 +77,44 @@ public class PriceAndPoint {
|
||||
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId);
|
||||
BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN);
|
||||
return userMoney;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : insertCashAndPoint
|
||||
* @author : 이호영
|
||||
* @date : 2024.03.26
|
||||
* @description :
|
||||
* @param mjonPayDAO
|
||||
* @param idgenMjonCashId
|
||||
* @param userId
|
||||
* @param totPrice
|
||||
* @param memo
|
||||
* @param msgGroupId
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void insertCashAndPoint(
|
||||
MjonPayDAO mjonPayDAO
|
||||
, EgovIdGnrService idgenMjonCashId
|
||||
, String userId
|
||||
, float totPrice
|
||||
, String memo
|
||||
, String msgGroupId
|
||||
) throws Exception {
|
||||
|
||||
MjonPayVO mjonPayVO = new MjonPayVO();
|
||||
mjonPayVO.setCashId(idgenMjonCashId.getNextStringId());
|
||||
mjonPayVO.setUserId(userId);
|
||||
mjonPayVO.setCash(totPrice);
|
||||
mjonPayVO.setFrstRegisterId(userId);
|
||||
mjonPayVO.setMemo(memo);
|
||||
mjonPayVO.setMsgGroupId(msgGroupId);
|
||||
|
||||
mjonPayDAO.insertCash(mjonPayVO); //캐시
|
||||
mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user