diff --git a/src/main/java/itn/let/mjo/msgagent/service/impl/MjonMsgAgentStsServiceImpl.java b/src/main/java/itn/let/mjo/msgagent/service/impl/MjonMsgAgentStsServiceImpl.java index 250cf12a..c91d0591 100644 --- a/src/main/java/itn/let/mjo/msgagent/service/impl/MjonMsgAgentStsServiceImpl.java +++ b/src/main/java/itn/let/mjo/msgagent/service/impl/MjonMsgAgentStsServiceImpl.java @@ -11,6 +11,8 @@ import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; import egovframework.rte.fdl.idgnr.EgovIdGnrService; import itn.let.mjo.msgagent.service.MjonMsgAgentStsService; import itn.let.mjo.msgagent.service.MjonMsgAgentStsVO; +import itn.let.mjo.pay.service.MjonPayVO; +import itn.let.mjo.pay.service.impl.MjonPayDAO; import itn.let.uat.uia.service.impl.MberManageDAO; import itn.let.uss.umt.service.MberManageVO; @@ -24,12 +26,19 @@ public class MjonMsgAgentStsServiceImpl extends EgovAbstractServiceImpl implemen @Resource(name="mberManageDAO") private MberManageDAO mberManageDAO; + @Resource(name="mjonPayDAO") + private MjonPayDAO mjonPayDAO; + @Resource(name = "mjonMsgAgentStsService") private MjonMsgAgentStsService mjonMsgAgentStsService; /** 메모 idgen */ @Resource(name="egovGnrlUserSelectMemoIdGnrService") private EgovIdGnrService memoidgenService; + + + @Resource(name = "egovMjonPointIdGnrService") + private EgovIdGnrService idgenMjonPointId; @Override public List selectMjonMsgAgentStsList() throws Exception{ @@ -172,13 +181,57 @@ public class MjonMsgAgentStsServiceImpl extends EgovAbstractServiceImpl implemen int result = 0; + try { + //회원의 전용 전송사 조회 + String mberId = mberManageVO.getMberId(); + MberManageVO tmpMberManageVO = mberManageDAO.selectMber(mberId); + String befHotLineCode = tmpMberManageVO.getHotlineAgentCode(); //수정 전 전용 전송사 정보 + String afterHotLineCode = mberManageVO.getHotlineAgentCode(); //수정 후 전용 전송사 정보 + String userPoint = tmpMberManageVO.getUserPoint(); //회원 보유 포인트 조회 + result = mjonMsgAgentStsDAO.updateMberHotlineAgentCodeInfo(mberManageVO); // B선라인 일경우 회원테이블 업데이트 int uCnt = mberManageDAO.updateUserBlineCodeByAdm(mberManageVO); + //B선 회원 전환에 따른 포인트 차감 처리 + MjonPayVO mjonPayVO = new MjonPayVO(); + + if(!befHotLineCode.equals("08") && !befHotLineCode.equals("09") && (afterHotLineCode.equals("08") || afterHotLineCode.equals("09"))) { + System.out.println("일반 회원 --> B선 회원 전환"); + //보유 포인트 0으로 차감 + if(!userPoint.equals("0")) { + + mjonPayVO.setPointId(idgenMjonPointId.getNextStringId()); + mjonPayVO.setUserId(mberId); + String point = "-"+ userPoint; + mjonPayVO.setPoint(Integer.parseInt(point)); + mjonPayVO.setPointMemo("B선 회원 전환으로 인한 기존 포인트 차감"); + mjonPayVO.setFrstRegisterId(mberManageVO.getAdmUserId()); + + mjonPayDAO.insertPoint(mjonPayVO); //POINT 테이블 + mjonPayDAO.updateMemberPoint(mjonPayVO); //회원정보 업데이트 + + } + + }else if((befHotLineCode.equals("08") || befHotLineCode.equals("09")) && (!afterHotLineCode.equals("08") && !afterHotLineCode.equals("09"))) { + System.out.println("B선 회원 --> 일반회원 전환"); + + String lastPoint = mjonPayDAO.selectPointLatestOnePoint(mberId); + + mjonPayVO.setPointId(idgenMjonPointId.getNextStringId()); + mjonPayVO.setUserId(mberId); + mjonPayVO.setPoint(Integer.parseInt(lastPoint.replace("-", ""))); + mjonPayVO.setPointMemo("일반 회원 전환으로 인한 포인트 복구"); + mjonPayVO.setFrstRegisterId(mberManageVO.getAdmUserId()); + + mjonPayDAO.insertPoint(mjonPayVO); //POINT 테이블 + mjonPayDAO.updateMemberPoint(mjonPayVO); //회원정보 업데이트 + + } + //보내는 아이디 회원 메모 insert String memo = ""; memo = "전용전송사 변경 : " + mberManageVO.getHotlineAgentName() + "(" + mberManageVO.getHotlineAgentCode() + ")"; @@ -187,6 +240,7 @@ public class MjonMsgAgentStsServiceImpl extends EgovAbstractServiceImpl implemen mberManageVO.setMemoCn(memo); mberManageVO.setFrstRegisterId(mberManageVO.getAdmUserId()); mberManageDAO.insertMberMemo(mberManageVO); + } catch (Exception e) { System.out.println("+++++++++++ updateMberHotlineAgentCodeInfo Service Imple Error!!! " + e); } diff --git a/src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java b/src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java index 20678af5..ab25a946 100644 --- a/src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java +++ b/src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java @@ -291,4 +291,11 @@ public class MjonPayDAO extends EgovAbstractDAO { public List selectPointInfoList(String userId) throws Exception{ return (List)list("mjonPayDAO.selectPointInfoList", userId); } + + public String selectPointLatestOnePoint(String userId) { + + return (String) select("mjonPayDAO.selectPointLatestOnePoint", userId); + + } + } diff --git a/src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml b/src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml index e691b08d..0b4376c5 100644 --- a/src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml +++ b/src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml @@ -2259,4 +2259,16 @@ MBER_ID = #userId# ]]> + + + + \ No newline at end of file diff --git a/src/main/resources/egovframework/sqlmap/let/uss/umt/EgovMberManage_SQL_Mysql.xml b/src/main/resources/egovframework/sqlmap/let/uss/umt/EgovMberManage_SQL_Mysql.xml index 3a23e02b..18749ebe 100644 --- a/src/main/resources/egovframework/sqlmap/let/uss/umt/EgovMberManage_SQL_Mysql.xml +++ b/src/main/resources/egovframework/sqlmap/let/uss/umt/EgovMberManage_SQL_Mysql.xml @@ -759,7 +759,8 @@ A.EXCEPT_SPAM_YN AS exceptSpamYn, A.HOTLINE_AGENT_CODE AS hotlineAgentCode, A.AT_SMISHING_YN atSmishingYn, - A.SPAM_YN spamYn + A.SPAM_YN spamYn, + A.USER_POINT AS userPoint FROM LETTNGNRLMBER A LEFT JOIN MJ_CANDIDATE_INFO MCI ON A.MBER_ID = MCI.MBER_ID diff --git a/src/main/webapp/WEB-INF/jsp/uss/ion/pay/PayList.jsp b/src/main/webapp/WEB-INF/jsp/uss/ion/pay/PayList.jsp index 38fddf9e..92ab05a6 100644 --- a/src/main/webapp/WEB-INF/jsp/uss/ion/pay/PayList.jsp +++ b/src/main/webapp/WEB-INF/jsp/uss/ion/pay/PayList.jsp @@ -422,7 +422,11 @@ function fnSmishingUpdate(flag, id) { 카드() - + 카드(결제취소) diff --git a/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp b/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp index 28856e43..1a4af6fa 100644 --- a/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp @@ -122,7 +122,7 @@ function getMberSettingDetailByNotLogin_Header() { success: function (data) { if (data.isSuccess) { var reqURL = "${pageContext.request.requestURL}"; - var mainURL = "web/main/mainPage.do"; + var mainURL = "/web/main/mainPage.do"; if (reqURL.lastIndexOf(mainURL) > -1) { // 문자(등급별 요금 안내) $("#priceTopBanner").show(); diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 1ad0ec08..ced78fd8 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -42,7 +42,7 @@ - +