이호영 이호영 2023-07-04
feat:api 요청에 의한 문자발송부분 최신화
@4ddae8d6ebe265e5d721f013bc4179382d7a5cb1
src/main/java/itn/let/mjo/test/web/TestController.java
--- src/main/java/itn/let/mjo/test/web/TestController.java
+++ src/main/java/itn/let/mjo/test/web/TestController.java
@@ -1157,21 +1157,10 @@
 				
 		try {
 			
-			LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
-	    	userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
-
-
-	    	// api인지 확인
-    		ApiKeyVO apiKeyVO = new ApiKeyVO();
-    		apiKeyVO.setAccessKey(mjonMsgVO.getAccessKey());
-    		List<ApiKeyVO> resultList = apiKeyMngService.selectCheckApiKeyDup(apiKeyVO);
-    		
-    		if(resultList.size() >= 1) {
-    			userId = resultList.get(0).getMberId();
-    		}
-
+//			LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
+//	    	userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
 	    	
-	    	
+			userId = mjonMsgVO.getMberId();
         	if(userId.equals("")) {
         		
         		modelAndView.addObject("message", "로그인 후 이용이 가능합니다.");
@@ -1388,6 +1377,9 @@
     			
     		}
     		
+    		// 토탈금액 "," 리플레이스 처리
+    		mjonMsgVO.setTotPrice(mjonMsgVO.getTotPrice().replaceAll(",", ""));
+    		
         	float tmpOrgEachPrice = Float.parseFloat(mjonMsgVO.getEachPrice());
         	float tmpOrgTotPrice = Float.parseFloat(mjonMsgVO.getTotPrice());
         	
@@ -1517,8 +1509,6 @@
         		shortMsgVO = mjonMsgVO;
         		longMsgVO = mjonMsgVO;
         		imgMsgVO = mjonMsgVO;
-        		System.out.println("shortMsgVO :: "+ shortMsgVO.getsPrice());
-        		System.out.println("mjonMsgVO :: "+ mjonMsgVO.getsPrice());
         		
         		int shortMsgCnt = Integer.parseInt(mjonMsgVO.getShortMsgCnt());
         		int longMsgCnt = Integer.parseInt(mjonMsgVO.getLongMsgCnt());
@@ -1768,7 +1758,14 @@
         			imgMsgVO.setRep4List(imgRep4);
         			
         			//개별단가 계산하기
-        			String eachPrice = shortMsgVO.getsPrice();
+        			String eachPrice = imgMsgVO.getpPrice();
+        			
+        			//api 서버에서 pPrice 값이 없는 경우가 있어서 오류 방지를위해서 추가
+        			if(eachPrice == null) {
+        				
+        				eachPrice = imgMsgVO.getEachPrice();
+        				
+        			}
         			
         			/**
         			 * 그림문자에 치환 내용이 포함되어 있는 경우 단가 계산하기.
@@ -1813,9 +1810,12 @@
         			
         			//개별단가 계산하기
         			String eachPrice = shortMsgVO.getsPrice();
-        			if(StringUtils.isEmpty(eachPrice))
-        			{
+        			
+        			//api 서버에서 sPrice 값이 없는 경우가 있어서 오류 방지를위해서 추가
+        			if(eachPrice == null) {
+        				
         				eachPrice = shortMsgVO.getEachPrice();
+        				
         			}
         			
         			/**
@@ -1845,7 +1845,6 @@
         				shortMsgVO.setMsgType("4");
         			}
         			
-        			System.out.println("shortMsgVO.getEachPrice() :: "+ shortMsgVO.getEachPrice());
         			//총금액 계산하기
         			Float sTotPrice = Float.parseFloat(shortMsgVO.getEachPrice()) * shortCnt;
         			shortMsgVO.setTotPrice(sTotPrice.toString());
@@ -1870,6 +1869,13 @@
         			 * */
         			
         			String eachPrice = longMsgVO.getmPrice();
+        			
+        			//api 서버에서 mPrice 값이 없는 경우가 있어서 오류 방지를위해서 추가
+        			if(eachPrice == null) {
+        				
+        				eachPrice = longMsgVO.getEachPrice();
+        				
+        			}
         			
         			if(fileCount > 2) {//그림 이미지가 3개
             			
@@ -2001,9 +2007,7 @@
         	}else {
         		
         		//문자발송 함수 호출 - 일괄변환이 없거나, 그림문자 일괄변환의 경우 한번에 전송 처리
-        		System.out.println("???????");
         		modelAndView = fncSendMsg(mjonMsgVO);
-        		System.out.println("!!!!!!!!!!!!");
         		
         	}
         	
@@ -2060,16 +2064,13 @@
 				// 법인폰 알람여부 체크
 				JoinSettingVO joinSettingVO = new JoinSettingVO();
 				joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
-				// SMS 체크
-				if (joinSettingVO != null && joinSettingVO.getSmsNoti().equals("Y")) {
-//					getAdminPhoneSendMsgData(mjonMsgVO);	
-				}				
 				
 				// SLACK 체크
 				if (joinSettingVO != null && joinSettingVO.getSlackNoti().equals("Y")) {
 					//Slack으로 메세지 전송 처리
 					MjonCommon comm = new MjonCommon();
-					comm.getAdminSandSlack(mjonMsgVO);
+					System.out.println("slack noti");
+//					comm.getAdminSandSlack(mjonMsgVO);
 				}
 			}
 			
@@ -2079,11 +2080,6 @@
 		}
 		
  		return modelAndView;
-	
-		
-		
-		
-		
 	}
 	/**
 	 * 문자발송시 치환문자가 있거나 단문, 장문 일경우 타는 로직
Add a comment
List