관리자 B선회원 전환시 보유 포인트 차감, B선회원 일반회원 전환시 기존 보유 포인트로 복구 처리
@d745102bfa62e7b668c517e5e1e44b54cb6034de
--- src/main/java/itn/let/mjo/msgagent/service/impl/MjonMsgAgentStsServiceImpl.java
+++ src/main/java/itn/let/mjo/msgagent/service/impl/MjonMsgAgentStsServiceImpl.java
... | ... | @@ -11,6 +11,8 @@ |
| 11 | 11 |
import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
| 12 | 12 |
import itn.let.mjo.msgagent.service.MjonMsgAgentStsService; |
| 13 | 13 |
import itn.let.mjo.msgagent.service.MjonMsgAgentStsVO; |
| 14 |
+import itn.let.mjo.pay.service.MjonPayVO; |
|
| 15 |
+import itn.let.mjo.pay.service.impl.MjonPayDAO; |
|
| 14 | 16 |
import itn.let.uat.uia.service.impl.MberManageDAO; |
| 15 | 17 |
import itn.let.uss.umt.service.MberManageVO; |
| 16 | 18 |
|
... | ... | @@ -24,12 +26,19 @@ |
| 24 | 26 |
@Resource(name="mberManageDAO") |
| 25 | 27 |
private MberManageDAO mberManageDAO; |
| 26 | 28 |
|
| 29 |
+ @Resource(name="mjonPayDAO") |
|
| 30 |
+ private MjonPayDAO mjonPayDAO; |
|
| 31 |
+ |
|
| 27 | 32 |
@Resource(name = "mjonMsgAgentStsService") |
| 28 | 33 |
private MjonMsgAgentStsService mjonMsgAgentStsService; |
| 29 | 34 |
|
| 30 | 35 |
/** 메모 idgen */ |
| 31 | 36 |
@Resource(name="egovGnrlUserSelectMemoIdGnrService") |
| 32 | 37 |
private EgovIdGnrService memoidgenService; |
| 38 |
+ |
|
| 39 |
+ |
|
| 40 |
+ @Resource(name = "egovMjonPointIdGnrService") |
|
| 41 |
+ private EgovIdGnrService idgenMjonPointId; |
|
| 33 | 42 |
|
| 34 | 43 |
@Override |
| 35 | 44 |
public List<MjonMsgAgentStsVO> selectMjonMsgAgentStsList() throws Exception{
|
... | ... | @@ -172,12 +181,56 @@ |
| 172 | 181 |
|
| 173 | 182 |
int result = 0; |
| 174 | 183 |
|
| 184 |
+ |
|
| 175 | 185 |
try {
|
| 186 |
+ |
|
| 187 |
+ //회원의 전용 전송사 조회 |
|
| 188 |
+ String mberId = mberManageVO.getMberId(); |
|
| 189 |
+ MberManageVO tmpMberManageVO = mberManageDAO.selectMber(mberId); |
|
| 190 |
+ String befHotLineCode = tmpMberManageVO.getHotlineAgentCode(); //수정 전 전용 전송사 정보 |
|
| 191 |
+ String afterHotLineCode = mberManageVO.getHotlineAgentCode(); //수정 후 전용 전송사 정보 |
|
| 192 |
+ String userPoint = tmpMberManageVO.getUserPoint(); //회원 보유 포인트 조회 |
|
| 176 | 193 |
|
| 177 | 194 |
result = mjonMsgAgentStsDAO.updateMberHotlineAgentCodeInfo(mberManageVO); |
| 178 | 195 |
|
| 179 | 196 |
// B선라인 일경우 회원테이블 업데이트 |
| 180 | 197 |
int uCnt = mberManageDAO.updateUserBlineCodeByAdm(mberManageVO); |
| 198 |
+ |
|
| 199 |
+ //B선 회원 전환에 따른 포인트 차감 처리 |
|
| 200 |
+ MjonPayVO mjonPayVO = new MjonPayVO(); |
|
| 201 |
+ |
|
| 202 |
+ if(!befHotLineCode.equals("08") && !befHotLineCode.equals("09") && (afterHotLineCode.equals("08") || afterHotLineCode.equals("09"))) {
|
|
| 203 |
+ System.out.println("일반 회원 --> B선 회원 전환");
|
|
| 204 |
+ //보유 포인트 0으로 차감 |
|
| 205 |
+ if(!userPoint.equals("0")) {
|
|
| 206 |
+ |
|
| 207 |
+ mjonPayVO.setPointId(idgenMjonPointId.getNextStringId()); |
|
| 208 |
+ mjonPayVO.setUserId(mberId); |
|
| 209 |
+ String point = "-"+ userPoint; |
|
| 210 |
+ mjonPayVO.setPoint(Integer.parseInt(point)); |
|
| 211 |
+ mjonPayVO.setPointMemo("B선 회원 전환으로 인한 기존 포인트 차감");
|
|
| 212 |
+ mjonPayVO.setFrstRegisterId(mberManageVO.getAdmUserId()); |
|
| 213 |
+ |
|
| 214 |
+ mjonPayDAO.insertPoint(mjonPayVO); //POINT 테이블 |
|
| 215 |
+ mjonPayDAO.updateMemberPoint(mjonPayVO); //회원정보 업데이트 |
|
| 216 |
+ |
|
| 217 |
+ } |
|
| 218 |
+ |
|
| 219 |
+ }else if((befHotLineCode.equals("08") || befHotLineCode.equals("09")) && (!afterHotLineCode.equals("08") && !afterHotLineCode.equals("09"))) {
|
|
| 220 |
+ System.out.println("B선 회원 --> 일반회원 전환");
|
|
| 221 |
+ |
|
| 222 |
+ String lastPoint = mjonPayDAO.selectPointLatestOnePoint(mberId); |
|
| 223 |
+ |
|
| 224 |
+ mjonPayVO.setPointId(idgenMjonPointId.getNextStringId()); |
|
| 225 |
+ mjonPayVO.setUserId(mberId); |
|
| 226 |
+ mjonPayVO.setPoint(Integer.parseInt(lastPoint.replace("-", "")));
|
|
| 227 |
+ mjonPayVO.setPointMemo("일반 회원 전환으로 인한 포인트 복구");
|
|
| 228 |
+ mjonPayVO.setFrstRegisterId(mberManageVO.getAdmUserId()); |
|
| 229 |
+ |
|
| 230 |
+ mjonPayDAO.insertPoint(mjonPayVO); //POINT 테이블 |
|
| 231 |
+ mjonPayDAO.updateMemberPoint(mjonPayVO); //회원정보 업데이트 |
|
| 232 |
+ |
|
| 233 |
+ } |
|
| 181 | 234 |
|
| 182 | 235 |
//보내는 아이디 회원 메모 insert |
| 183 | 236 |
String memo = ""; |
... | ... | @@ -187,6 +240,7 @@ |
| 187 | 240 |
mberManageVO.setMemoCn(memo); |
| 188 | 241 |
mberManageVO.setFrstRegisterId(mberManageVO.getAdmUserId()); |
| 189 | 242 |
mberManageDAO.insertMberMemo(mberManageVO); |
| 243 |
+ |
|
| 190 | 244 |
} catch (Exception e) {
|
| 191 | 245 |
System.out.println("+++++++++++ updateMberHotlineAgentCodeInfo Service Imple Error!!! " + e);
|
| 192 | 246 |
} |
--- src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java
+++ src/main/java/itn/let/mjo/pay/service/impl/MjonPayDAO.java
... | ... | @@ -291,4 +291,11 @@ |
| 291 | 291 |
public List<MjonPayVO> selectPointInfoList(String userId) throws Exception{
|
| 292 | 292 |
return (List<MjonPayVO>)list("mjonPayDAO.selectPointInfoList", userId);
|
| 293 | 293 |
} |
| 294 |
+ |
|
| 295 |
+ public String selectPointLatestOnePoint(String userId) {
|
|
| 296 |
+ |
|
| 297 |
+ return (String) select("mjonPayDAO.selectPointLatestOnePoint", userId);
|
|
| 298 |
+ |
|
| 299 |
+ } |
|
| 300 |
+ |
|
| 294 | 301 |
} |
--- src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/pay/MjonPay_SQL_mysql.xml
... | ... | @@ -2259,4 +2259,16 @@ |
| 2259 | 2259 |
MBER_ID = #userId# |
| 2260 | 2260 |
]]> |
| 2261 | 2261 |
</select> |
| 2262 |
+ |
|
| 2263 |
+ |
|
| 2264 |
+ <select id="mjonPayDAO.selectPointLatestOnePoint" parameterClass="String" resultClass="String"> |
|
| 2265 |
+ |
|
| 2266 |
+ SELECT POINT |
|
| 2267 |
+ FROM MJ_POINT |
|
| 2268 |
+ WHERE USER_ID = #userId# |
|
| 2269 |
+ ORDER BY POINT_ID DESC |
|
| 2270 |
+ LIMIT 1 |
|
| 2271 |
+ |
|
| 2272 |
+ </select> |
|
| 2273 |
+ |
|
| 2262 | 2274 |
</sqlMap>(No newline at end of file) |
--- src/main/resources/egovframework/sqlmap/let/uss/umt/EgovMberManage_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/uss/umt/EgovMberManage_SQL_Mysql.xml
... | ... | @@ -759,7 +759,8 @@ |
| 759 | 759 |
A.EXCEPT_SPAM_YN AS exceptSpamYn, |
| 760 | 760 |
A.HOTLINE_AGENT_CODE AS hotlineAgentCode, |
| 761 | 761 |
A.AT_SMISHING_YN atSmishingYn, |
| 762 |
- A.SPAM_YN spamYn |
|
| 762 |
+ A.SPAM_YN spamYn, |
|
| 763 |
+ A.USER_POINT AS userPoint |
|
| 763 | 764 |
FROM LETTNGNRLMBER A |
| 764 | 765 |
LEFT JOIN MJ_CANDIDATE_INFO MCI |
| 765 | 766 |
ON A.MBER_ID = MCI.MBER_ID |
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?