fix: prod fix

dev
jiho83 1 year ago
parent d81da9bf1d
commit bdd8dade6e

@ -166,6 +166,9 @@ $ c:\tools\java\azul-17.0.1\java -jar -Dspring.profiles.active=local .\mens-api.
$ mvnw clean package -pl mens-api -am -P local $ mvnw clean package -pl mens-api -am -P local
# -amd : 의존성 있는 타 프로젝트 빌드 - C가 A를 디펜던시로 가지고 있는 경우 A를 빌드 하면 A -> C 순으로 빌드 # -amd : 의존성 있는 타 프로젝트 빌드 - C가 A를 디펜던시로 가지고 있는 경우 A를 빌드 하면 A -> C 순으로 빌드
$ mvnw clean package -pl mens-core -amd -P local $ mvnw clean package -pl mens-core -amd -P local
mvn clean package -pl mens-batch -am -P prod
``` ```
### 스프링 배치 DB schema ### 스프링 배치 DB schema
[mysql DDL 스크립트](./document/batch-schema-mysql.sql) [mysql DDL 스크립트](./document/batch-schema-mysql.sql)

@ -1,6 +1,7 @@
package kr.xit.biz.mbl.service; package kr.xit.biz.mbl.service;
import kr.xit.biz.ens.model.kakao.KkopayDocDTO; import kr.xit.biz.ens.model.kakao.KkopayDocDTO;
import kr.xit.biz.ens.model.kt.KtCommonDTO;
import kr.xit.biz.ens.model.kt.KtTokenDTO; import kr.xit.biz.ens.model.kt.KtTokenDTO;
import kr.xit.biz.mbl.mapper.IMobilePageMapper; import kr.xit.biz.mbl.mapper.IMobilePageMapper;
import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage; import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage;
@ -13,6 +14,7 @@ import kr.xit.core.support.utils.Checks;
import kr.xit.ens.kakao.service.IKkopayEltrcDocService; import kr.xit.ens.kakao.service.IKkopayEltrcDocService;
import kr.xit.ens.kt.service.IKtMmsService; import kr.xit.ens.kt.service.IKtMmsService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -31,6 +33,7 @@ import org.springframework.stereotype.Service;
* *
* </pre> * </pre>
*/ */
@Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
public class MobilePageService extends EgovAbstractServiceImpl implements IMobilePageService { public class MobilePageService extends EgovAbstractServiceImpl implements IMobilePageService {
@ -89,23 +92,22 @@ public class MobilePageService extends EgovAbstractServiceImpl implements IMobil
* </pre> * </pre>
*/ */
@Override @Override
@TraceLogging //@TraceLogging
public MobilePageManage findKtMblPage(final KtTokenDTO.KtTokenConfirmRequest reqDTO) { public MobilePageManage findKtMblPage(final KtTokenDTO.KtTokenConfirmRequest reqDTO) {
//TODO::테스트 //TODO::테스트
return mapper.selectKtMobilePage("srcKey"); //return mapper.selectKtMobilePage("srcKey");
//TODO::실운영시 코멘트 제거 //TODO::실운영시 코멘트 제거
/*
if (Checks.isEmpty(reqDTO.getAccessToken())) if (Checks.isEmpty(reqDTO.getAccessToken()))
throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다."); throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
final String signguCode = reqDTO.getSignguCode(); final String signguCode = reqDTO.getSignguCode();
final String ffnlgCode = reqDTO.getFfnlgCode(); final String ffnlgCode = reqDTO.getFfnlgCode();
final KtTokenConfirmResponse cfmRes = ktMmsService.cfmToken(reqDTO); final KtTokenDTO.KtTokenConfirmResponse cfmRes = ktMmsService.cfmToken(reqDTO);
if(cfmRes.getResultCd().equals("00")){ if(cfmRes.getResultCd().equals("00")){
KtCommonResponse readRes = ktMmsService.readToken( KtCommonDTO.KtCommonResponse readRes = ktMmsService.readToken(
KtTokenReadRequest.builder() KtTokenDTO.KtTokenReadRequest.builder()
.signguCode(signguCode) .signguCode(signguCode)
.ffnlgCode(ffnlgCode) .ffnlgCode(ffnlgCode)
.accessToken(reqDTO.getAccessToken()) .accessToken(reqDTO.getAccessToken())
@ -114,12 +116,16 @@ public class MobilePageService extends EgovAbstractServiceImpl implements IMobil
if(readRes.getResultCd().equals("00")){ if(readRes.getResultCd().equals("00")){
String srcKey = cfmRes.getSrcKey(); String srcKey = cfmRes.getSrcKey();
log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", readRes.getResultCd());
return mapper.selectKtMobilePage(srcKey); return mapper.selectKtMobilePage(srcKey);
} }
log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ read token result - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", readRes.getResultCd());
log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ read token result error - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", readRes.toStringErrorMsg());
throw BizRuntimeException.create(readRes.getResultCd(), readRes.toStringErrorMsg()); throw BizRuntimeException.create(readRes.getResultCd(), readRes.toStringErrorMsg());
} }
log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ token confirm result - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", cfmRes.getResultCd());
log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ token confirm result error - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", cfmRes.toStringErrorMsg());
throw BizRuntimeException.create(cfmRes.getResultCd(), cfmRes.toStringErrorMsg()); throw BizRuntimeException.create(cfmRes.getResultCd(), cfmRes.toStringErrorMsg());
*/
} }
} }

@ -55,9 +55,11 @@ public class CmmKtMmsUtils {
if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageSource.getMessage("fail.api.rlaybsnm.info")); if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageSource.getMessage("fail.api.rlaybsnm.info"));
// 토큰 유효기간 체크 // 토큰 유효기간 체크
if(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo( //if(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo(
Objects.requireNonNull(dto.getKtTokenExpiresIn(), () -> messageSource.getMessage("fail.api.kt.token.invalid.expired"))) < 0) return dto; // Objects.requireNonNull(dto.getKtTokenExpiresIn(), () -> messageSource.getMessage("fail.api.kt.token.invalid.expired"))) < 0) return dto;
return dto;
/*
ktMmsService.requestToken( ktMmsService.requestToken(
KtMnsRequest.builder() KtMnsRequest.builder()
.signguCode(signguCode) .signguCode(signguCode)
@ -66,6 +68,8 @@ public class CmmKtMmsUtils {
.build() .build()
); );
return cacheService.getRlaybsnmInfoCache(ensDTO); return cacheService.getRlaybsnmInfoCache(ensDTO);
*/
} }

@ -38,9 +38,9 @@ contract:
ci: /digital/niceid/cert/v1.0/ipin/addinfo/ci ci: /digital/niceid/cert/v1.0/ipin/addinfo/ci
kt: kt:
# vpn 사용 # vpn 사용
#host: http://172.16.0.13:10210/ONLWeb host: http://172.16.0.13:10210/ONLWeb
# 운영 # 운영
host: http://172.16.1.182:10210/ONLWeb #host: http://172.16.11.182:10210/ONLWeb
api: api:
# 토큰발행 # 토큰발행
generate-token: /oauth/token generate-token: /oauth/token

@ -66,7 +66,7 @@ app:
data: data:
root: root:
#path: /Users/minuk/data #path: /Users/minuk/data
path: d:/data path: c:/data
#--------------------------------------------------------------- #---------------------------------------------------------------
# log 설정 # log 설정

@ -19,9 +19,9 @@ spring:
springdoc: springdoc:
api-docs: api-docs:
enabled: false enabled: true
swagger-ui: swagger-ui:
enabled: false enabled: true
logging: logging:
level: level:
@ -41,7 +41,7 @@ logging:
# Spring Security cors 설정 :: CorsConfiguration 설정 값 # Spring Security cors 설정 :: CorsConfiguration 설정 값
cors: cors:
allowed-origins: http://localhost:8080, http://${app.api-ip}:8080, http://localhost:8082, http://${app.api-ip}:8082 allowed-origins: http://localhost, http://${app.api-ip}, http://localhost:8082, http://${app.api-ip}:8082, https://ens.sisul.or.kr
# ================================================================================================================== # ==================================================================================================================
# SQL logging lib setting # SQL logging lib setting
@ -52,9 +52,9 @@ decorator:
enable-logging: true enable-logging: true
app: app:
api-ip: 127.0.0.1 api-ip: 103.145.215.46
# swagger url # swagger url
url: 'http://localhost:${server.port}${server.servlet.context-path:}/' url: 'http://103.145.215.46:${server.port}${server.servlet.context-path:}/'
data: data:
root: root:
path: /data path: /data
@ -70,10 +70,10 @@ app:
log: log:
request: request:
common-enabled: true common-enabled: true
response-enabled: false response-enabled: true
# MDC logging trace 활성 # MDC logging trace 활성
mdc: mdc:
enabled: true enabled: false
# slack # slack
slack-webhook: slack-webhook:

@ -143,6 +143,16 @@ public interface IEnsBatchMapper {
*/ */
<T> int insertMobilePageManage(final T t); <T> int insertMobilePageManage(final T t);
/**
* <pre>
* Kt
* - tb_ens_mobile_page_manage
* @param t T
* @return int
* </pre>
*/
<T> int insertKtMobilePageManage(final T t);
/** /**
* <pre> * <pre>
* *

@ -351,6 +351,10 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
throw e; throw e;
} }
sendReqs.forEach(d -> mapper.insertKtMobilePageManage(d.getSrcKey()));
final List<List<KtMainSendReqData>> partitions = ListUtils.partition(sendReqs, bulkKtMaxCnt); final List<List<KtMainSendReqData>> partitions = ListUtils.partition(sendReqs, bulkKtMaxCnt);
List<ApiResponseDTO> apiResults = partitions.stream() List<ApiResponseDTO> apiResults = partitions.stream()
.map(bulkSendList -> { .map(bulkSendList -> {
@ -362,6 +366,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
ApiResponseDTO.class, ApiResponseDTO.class,
CmmEnsBizUtils.getHeadeMap()); CmmEnsBizUtils.getHeadeMap());
} }
) )
.toList(); .toList();
@ -378,6 +383,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
isSuccess = true; isSuccess = true;
dto.setErrorMssage("정상"); dto.setErrorMssage("정상");
}else{ }else{
//TODO:: 모바일 콘텐츠 삭제
errList.addAll(resDTO.getErrors()); errList.addAll(resDTO.getErrors());
} }

@ -21,9 +21,9 @@ spring:
springdoc: springdoc:
api-docs: api-docs:
enabled: false enabled: true
swagger-ui: swagger-ui:
enabled: false enabled: true
logging: logging:
level: level:
@ -40,7 +40,7 @@ logging:
# Spring Security cors 설정 :: CorsConfiguration 설정 값 # Spring Security cors 설정 :: CorsConfiguration 설정 값
cors: cors:
allowed-origins: http://localhost allowed-origins: http://localhost, https://ens.sisul.or.kr, http://103.145.215.46
# ================================================================================================================== # ==================================================================================================================
# SQL logging lib setting # SQL logging lib setting
@ -51,9 +51,9 @@ decorator:
enable-logging: true enable-logging: true
app: app:
api-ip: 127.0.0.1 api-ip: 103.145.215.46
# swagger url # swagger url
url: 'http://localhost:${server.port}${server.servlet.context-path:}/' url: 'http://103.145.215.46:${server.port}${server.servlet.context-path:}/'
data: data:
root: root:
path: /data path: /data
@ -70,7 +70,7 @@ app:
log: log:
request: request:
custom-enabled: true custom-enabled: true
response-enabled: false response-enabled: true
# MDC logging trace 활성 # MDC logging trace 활성
mdc: mdc:
enabled: true enabled: true

@ -853,6 +853,27 @@
AND signgu_code = #{signguCode} AND signgu_code = #{signguCode}
AND ffnlg_code = #{ffnlgCode} AND ffnlg_code = #{ffnlgCode}
</update> </update>
<insert id="insertKtMobilePageManage">
/** ens-mysql-mapper|insertKtMobilePageManage-모바일페이지관리 데이타 생성|julim */
INSERT
INTO tb_ens_mobile_page_manage (
sndng_detail_id, /* 발송상세 ID*/
sndng_se_code, /* 발송 구분 코드 */
mobile_page_cn, /* 모바일 페이지 내용 */
regist_dt,
register
)
SELECT tekbd.sndng_detail_id
, 'KT-BC'
, teusd.mobile_page_cn
, date_format(now(), '%Y%m%d%H%i%s')
, 'batch'
FROM tb_ens_kt_bc_detail tekbd
JOIN tb_ens_unity_sndng_detail teusd
ON tekbd.unity_sndng_detail_id = teusd.unity_sndng_detail_id
WHERE teusd.unity_sndng_detail_id = #{unitySndngDetailId}
</insert>
<!-- =================================================================================== --> <!-- =================================================================================== -->
<!-- ================================ send ============================================= --> <!-- ================================ send ============================================= -->
<!-- =================================================================================== --> <!-- =================================================================================== -->

@ -8,19 +8,19 @@
<form> <form>
<fieldset> <fieldset>
<legend>선택</legend> <legend>선택</legend>
<label for="sysSeCode">시스템구분</label> <label for="signguCode">시스템구분</label>
<select id="sysSeCode"> <select id="signguCode">
<option value="01">공영주차장</option> <option value="88328">공영주차장</option>
<option value="02">장사시설</option> <option value="88316">장사시설</option>
</select><br/> </select><br/>
<label for="sndngSeCode">발송구분</label> <!-- <label for="sndngSeCode">발송구분</label>
<select id="sndngSeCode"> <select id="sndngSeCode">
<option value="KKO-MY-DOC">카카오</option> <option value="KKO-MY-DOC">카카오</option>
<option value="KT-BC">공인알림문자</option> <option value="KT-BC">공인알림문자</option>
<option value="E-GREEN">e-그린</option> <option value="E-GREEN">e-그린</option>
</select><br/> </select><br/>
<label>전송일</label> <label>전송일</label>
<input type="date" id="sndngDt" required/><br/> <input type="date" id="sndngDt" required/><br/>-->
<input type="file" <input type="file"
accept="application/vnd.ms-excel, accept="application/vnd.ms-excel,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@ -33,24 +33,25 @@
<script> <script>
function handleSubmit() { function handleSubmit() {
const form = document.querySelector("form"); const form = document.querySelector("form");
let sndngDt = document.querySelector("#sndngDt").value.replaceAll("-", "") // let sndngDt = document.querySelector("#sndngDt").value.replaceAll("-", "")
let file = document.querySelector("#files").files[0]; let file = document.querySelector("#files").files[0];
if(!sndngDt){ /*if(!sndngDt){
alert('전송일을 선택하세요'); alert('전송일을 선택하세요');
return false; return false;
} }*/
if(!file){ /*if(!file){
alert('업로드할 파일을 선택하세요'); alert('업로드할 파일을 선택하세요');
return false; return false;
} }*/
const fd = new FormData(); const fd = new FormData();
fd.append('sysSeCode', document.querySelector("#sysSeCode").value); fd.append('signguCode', document.querySelector("#signguCode").value);
fd.append('sndngSeCode', document.querySelector("#sndngSeCode").value); // fd.append('sndngSeCode', document.querySelector("#sndngSeCode").value);
fd.append('sndngDt', document.querySelector("#sndngDt").value.replaceAll("-", "")); fd.append('register', 'admin');
fd.append('files', document.querySelector("#files").files[0]); fd.append('files', document.querySelector("#files").files[0]);
$.ajax({ $.ajax({
url: 'http://localhost:8081/api/biz/sisul/v1/fmcExcelUpload', url: 'http://103.145.215.46:8081/api/biz/sisul/v1/fmcExcelUpload',
data: fd, data: fd,
cache: false, cache: false,
contentType: false, contentType: false,

@ -135,7 +135,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
* Post request(stream) logging * Post request(stream) logging
* @return * @return
*/ */
@Bean //@Bean
public FilterRegistrationBean readableRequestWrapperFilter() { public FilterRegistrationBean readableRequestWrapperFilter() {
ReadableRequestWrapperFilter readableRequestWrapperFilter = new ReadableRequestWrapperFilter(); ReadableRequestWrapperFilter readableRequestWrapperFilter = new ReadableRequestWrapperFilter();

@ -130,7 +130,7 @@ cors:
# 리소스 접근을 허용하는 HTTP 메서드를 지정 # 리소스 접근을 허용하는 HTTP 메서드를 지정
allowed-methods: GET, POST, PUT, DELETE allowed-methods: GET, POST, PUT, DELETE
# 요청을 허용하는 해더 # 요청을 허용하는 해더
allowed-headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, X-Csrftoken, Authorization allowed-headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, X-Csrftoken, Authorization, Content-Security-Policy
# 클라이언트에서 preflight 의 요청 결과를 저장할 기간을 지정 # 클라이언트에서 preflight 의 요청 결과를 저장할 기간을 지정
# 60초 동안 preflight 요청을 캐시하는 설정으로, 첫 요청 이후 60초 동안은 OPTIONS 메소드를 사용하는 예비 요청을 보내지 않는다. # 60초 동안 preflight 요청을 캐시하는 설정으로, 첫 요청 이후 60초 동안은 OPTIONS 메소드를 사용하는 예비 요청을 보내지 않는다.
max-Age: 60 max-Age: 60

Loading…
Cancel
Save