2023-05-31 16:38 api 처리 내용 수정
This commit is contained in:
parent
2508460283
commit
d8ebd7db2a
@ -32,5 +32,7 @@ public class AccessKeyVO implements Serializable {
|
|||||||
|
|
||||||
//for call_info
|
//for call_info
|
||||||
private String callInfo; //access_token 고유번호
|
private String callInfo; //access_token 고유번호
|
||||||
|
|
||||||
|
private String remainMsgCnt;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,10 +1,13 @@
|
|||||||
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
package com.itn.mjonApi.mjon.api.inqry.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.catalina.connector.Response;
|
import org.apache.catalina.connector.Response;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.itn.mjonApi.cmn.apiServer.ApiService;
|
import com.itn.mjonApi.cmn.apiServer.ApiService;
|
||||||
|
import com.itn.mjonApi.mjon.api.access.mapper.domain.AccessKeyVO;
|
||||||
import com.itn.mjonApi.mjon.api.inqry.mapper.HstryMapper;
|
import com.itn.mjonApi.mjon.api.inqry.mapper.HstryMapper;
|
||||||
import com.itn.mjonApi.mjon.api.inqry.service.HstryService;
|
import com.itn.mjonApi.mjon.api.inqry.service.HstryService;
|
||||||
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||||
@ -49,10 +52,34 @@ public class HstryServiceImpl implements HstryService {
|
|||||||
//page 계산
|
//page 계산
|
||||||
hstryVO.setPage(_calcPage(hstryVO.getPage(), hstryVO.getPageSize()));
|
hstryVO.setPage(_calcPage(hstryVO.getPage(), hstryVO.getPageSize()));
|
||||||
|
|
||||||
|
//
|
||||||
|
List<AccessKeyVO> accessKeyVOList= hstryMapper.selectApiInqryHstry(hstryVO);
|
||||||
|
|
||||||
|
System.out.println("accessKeyVOList");
|
||||||
|
System.out.println(accessKeyVOList);
|
||||||
|
System.out.println(accessKeyVOList.size());
|
||||||
|
|
||||||
|
//다음페이지 여부
|
||||||
|
String s_next_yn = "N";
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (accessKeyVOList!=null) {
|
||||||
|
System.out.println("accessKeyVOList1");
|
||||||
|
System.out.println(accessKeyVOList.get(0).getRemainMsgCnt());
|
||||||
|
if (!accessKeyVOList.get(0).getRemainMsgCnt().equals("0")) s_next_yn = "Y";
|
||||||
|
System.out.println("accessKeyVOList2");
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
System.out.println("accessKeyVOList3");
|
||||||
|
System.out.println(s_next_yn);
|
||||||
|
System.out.println(s_next_yn);
|
||||||
|
|
||||||
//전체 발송 이력 가져오기
|
//전체 발송 이력 가져오기
|
||||||
hstryResponseVO = HstryResponseVO.builder()
|
hstryResponseVO = HstryResponseVO.builder()
|
||||||
.objectList(hstryMapper.selectApiInqryHstry(hstryVO))
|
.objectList(accessKeyVOList)
|
||||||
|
.next_yn(s_next_yn)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -98,9 +98,10 @@ public class SendServiceImpl implements SendService {
|
|||||||
, String.class
|
, String.class
|
||||||
);
|
);
|
||||||
log.info("munjaSendResponse : [{}]", munjaSendResponse.toString());
|
log.info("munjaSendResponse : [{}]", munjaSendResponse.toString());
|
||||||
|
log.info("munjaSendResponse : [{}]", munjaSendResponse.getResult());
|
||||||
|
|
||||||
// convertMjonDataToApiResponse => MjonResponseVO 데이터를 ApiResponse 데이터로 변환하는 메소드
|
// convertMjonDataToApiResponse => MjonResponseVO 데이터를 ApiResponse 데이터로 변환하는 메소드
|
||||||
if(munjaSendResponse.getResult() != "fail"){ // 성공
|
if(!munjaSendResponse.getResult().equals("fail")){ // 성공
|
||||||
return new RestResponse(SendSuccessRestResponse.convertMjonDataToApiResponse(munjaSendResponse));
|
return new RestResponse(SendSuccessRestResponse.convertMjonDataToApiResponse(munjaSendResponse));
|
||||||
}else{ // 실패
|
}else{ // 실패
|
||||||
return new RestResponse(this.convertMjonDataToApiResponse(munjaSendResponse));
|
return new RestResponse(this.convertMjonDataToApiResponse(munjaSendResponse));
|
||||||
@ -465,7 +466,11 @@ public class SendServiceImpl implements SendService {
|
|||||||
*/
|
*/
|
||||||
public static String convertMjonDataToApiResponse(MjonResponseVO mjonResponseVO) {
|
public static String convertMjonDataToApiResponse(MjonResponseVO mjonResponseVO) {
|
||||||
String result = mjonResponseVO.getResult();
|
String result = mjonResponseVO.getResult();
|
||||||
|
log.info("convertMjonDataToApiResponse : [{}]", result);
|
||||||
|
|
||||||
String message = mjonResponseVO.getMessage();
|
String message = mjonResponseVO.getMessage();
|
||||||
|
log.info("convertMjonDataToApiResponse : [{}]", message);
|
||||||
|
|
||||||
String statCode = "";
|
String statCode = "";
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case "statusFail" : statCode = "1070"; // 회원 정지
|
case "statusFail" : statCode = "1070"; // 회원 정지
|
||||||
@ -475,16 +480,18 @@ public class SendServiceImpl implements SendService {
|
|||||||
case "fail" : // 문자온 프로젝트에서 result가 fail로 다양한 에러가 리턴하여 분기처리함
|
case "fail" : // 문자온 프로젝트에서 result가 fail로 다양한 에러가 리턴하여 분기처리함
|
||||||
if(message.indexOf("문자 치환 후 전송 문자 길이를 초과하였습니다.")>-1)
|
if(message.indexOf("문자 치환 후 전송 문자 길이를 초과하였습니다.")>-1)
|
||||||
statCode = "1050"; // 치환 후 문자 길이 초과
|
statCode = "1050"; // 치환 후 문자 길이 초과
|
||||||
if(message.indexOf("치환문자 데이터가 없습니다")>-1)
|
else if(message.indexOf("치환문자 데이터가 없습니다")>-1)
|
||||||
statCode = "1040"; // 치환 데이터 오류
|
statCode = "1040"; // 치환 데이터 오류
|
||||||
if(message.indexOf("치환 후 전송 문자 길이를 초과")>-1)
|
else if(message.indexOf("치환 후 전송 문자 길이를 초과")>-1)
|
||||||
statCode = "1050"; // 치환 데이터 오류
|
statCode = "1050"; // 치환 데이터 오류
|
||||||
|
else
|
||||||
|
statCode = "1099"; // 기타 시스템 오류
|
||||||
break;
|
break;
|
||||||
default: statCode = "1099"; // 기타 시스템 오류
|
default: statCode = "1099"; // 기타 시스템 오류
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return statCode;
|
return "STAT_"+statCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,7 +96,10 @@
|
|||||||
AND a.ACCESS_KEY = #{accessKey}
|
AND a.ACCESS_KEY = #{accessKey}
|
||||||
AND a.MBER_ID = #{mberId}
|
AND a.MBER_ID = #{mberId}
|
||||||
AND a.ACCESS_no = b.ACCESS_NO
|
AND a.ACCESS_no = b.ACCESS_NO
|
||||||
AND b.CALL_INFO LIKE CONCAT(#{callInfo}, '%')
|
/*
|
||||||
|
AND b.CALL_INFO LIKE CONCAT({callInfo}, '%')
|
||||||
|
*/
|
||||||
|
AND #{callInfo} LIKE CONCAT(b.CALL_INFO, '%')
|
||||||
limit 1
|
limit 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,8 @@
|
|||||||
/* 문자온 발송결과 페이지 쿼리를 그대로 사용함 - http://localhost:9080/web/mjon/msgsent/selectMsgSentView.do */
|
/* 문자온 발송결과 페이지 쿼리를 그대로 사용함 - http://localhost:9080/web/mjon/msgsent/selectMsgSentView.do */
|
||||||
SELECT
|
SELECT
|
||||||
AAA.totMsgCnt
|
AAA.totMsgCnt
|
||||||
|
, if(AAA.totMsgCnt - ${pageSize} - ${page}>0,AAA.totMsgCnt - ${pageSize} - ${page},0) remainMsgCnt
|
||||||
|
|
||||||
, AAA.userId
|
, AAA.userId
|
||||||
, AAA.callFrom
|
, AAA.callFrom
|
||||||
, AAA.msgGroupId
|
, AAA.msgGroupId
|
||||||
@ -342,6 +344,7 @@
|
|||||||
/* 문자온 발송결과 페이지 실패 건수 팝업을 변형해서 사용함 - http://localhost:9080/web/mjon/msgsent/selectMsgSFDetailListAjax.do */
|
/* 문자온 발송결과 페이지 실패 건수 팝업을 변형해서 사용함 - http://localhost:9080/web/mjon/msgsent/selectMsgSFDetailListAjax.do */
|
||||||
|
|
||||||
SELECT COUNT(USER_ID) OVER() AS totMsgCnt ,
|
SELECT COUNT(USER_ID) OVER() AS totMsgCnt ,
|
||||||
|
if(COUNT(USER_ID) OVER() - ${pageSize} - ${page}>0,COUNT(USER_ID) OVER() - ${pageSize} - ${page},0) remainMsgCnt ,
|
||||||
/*
|
/*
|
||||||
USER_ID AS userId ,
|
USER_ID AS userId ,
|
||||||
IFNULL(ADDR_NM, '-') AS addrNm ,
|
IFNULL(ADDR_NM, '-') AS addrNm ,
|
||||||
@ -365,15 +368,36 @@
|
|||||||
DEL_FLAG AS delFlag ,
|
DEL_FLAG AS delFlag ,
|
||||||
*/
|
*/
|
||||||
MSG_TYPE AS msgType ,
|
MSG_TYPE AS msgType ,
|
||||||
|
|
||||||
|
CASE
|
||||||
|
WHEN MSG_TYPE = '6'
|
||||||
|
AND FILE_CNT > 0
|
||||||
|
THEN '그림(MMS)'
|
||||||
|
WHEN MSG_TYPE = '6'
|
||||||
|
AND FILE_CNT = 0
|
||||||
|
THEN '장문(LMS)'
|
||||||
|
ELSE '단문(SMS)'
|
||||||
|
END msgTypeName ,
|
||||||
|
CASE
|
||||||
|
WHEN MSG_TYPE = '6'
|
||||||
|
AND FILE_CNT > 0
|
||||||
|
THEN '3'
|
||||||
|
WHEN MSG_TYPE = '6'
|
||||||
|
AND FILE_CNT = 0
|
||||||
|
THEN '2'
|
||||||
|
ELSE '1'
|
||||||
|
END orderByCode ,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FILE_CNT AS fileCnt ,
|
FILE_CNT AS fileCnt ,
|
||||||
AGENT_CODE AS agentCode ,
|
AGENT_CODE AS agentCode ,
|
||||||
*/
|
*/
|
||||||
RESERVE_C_YN AS reserveCYn ,
|
RESERVE_C_YN AS reserveCYn ,
|
||||||
|
MSG_ID AS msgId ,
|
||||||
/*
|
/*
|
||||||
CANCELDATE AS cancelDate ,
|
CANCELDATE AS cancelDate ,
|
||||||
MSG_ID AS msgId ,
|
MSG_ID AS msgId ,
|
||||||
MSG_SEQ AS msgSeq ,
|
MSG_SEQ AS msgSeq ,
|
||||||
*/
|
*/
|
||||||
RESULT AS msgResult
|
RESULT AS msgResult
|
||||||
FROM (SELECT MGD.USER_ID ,
|
FROM (SELECT MGD.USER_ID ,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user