parent
f5c07f7086
commit
79b32bf50d
@ -1,40 +0,0 @@
|
||||
package cokr.xit.ens.modules.nice.service;
|
||||
|
||||
import org.springframework.stereotype.*;
|
||||
import org.springframework.transaction.annotation.*;
|
||||
|
||||
import cokr.xit.ens.modules.nice.mapper.*;
|
||||
import cokr.xit.ens.modules.nice.model.*;
|
||||
import lombok.*;
|
||||
import lombok.extern.slf4j.*;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* description :
|
||||
* packageName : cokr.xit.ens.modules.nice.service
|
||||
* fileName : NiceCiBillHistoryService
|
||||
* author : limju
|
||||
* date : 2024 9월 27
|
||||
* ======================================================================
|
||||
* 변경일 변경자 변경 내용
|
||||
* ----------------------------------------------------------------------
|
||||
* 2024 9월 27 limju 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class NiceCiBillHistoryService {
|
||||
private final INiceCiBillHistoryMapper mapper;
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void insertBillHistory(final NiceCiDTO.BillHistDTO histDTO){
|
||||
mapper.insertBillHistory(histDTO);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void updateBillHistory(final NiceCiDTO.BillHistDTO histDTO){
|
||||
mapper.updateBillHistory(histDTO);
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cokr.xit.ens.modules.nice.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.springframework.stereotype.*;
|
||||
import org.springframework.transaction.annotation.*;
|
||||
|
||||
import cokr.xit.ens.modules.nice.mapper.*;
|
||||
import cokr.xit.ens.modules.nice.model.*;
|
||||
import lombok.*;
|
||||
import lombok.extern.slf4j.*;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* description : NICE CI 에서 트랜잭션 분리 처리가 필요한 서비스
|
||||
* packageName : cokr.xit.ens.modules.nice.service
|
||||
* fileName : NiceCiNewTransactionService
|
||||
* author : limju
|
||||
* date : 2024 9월 27
|
||||
* ======================================================================
|
||||
* 변경일 변경자 변경 내용
|
||||
* ----------------------------------------------------------------------
|
||||
* 2024 9월 27 limju 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class NiceCiNewTransactionService {
|
||||
private final INiceCiNewTransactionMapper mapper;
|
||||
|
||||
// accept /////////////////////////////////////////////////////
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void insertBillHistory(final NiceCiDTO.BillHistDTO histDTO){
|
||||
mapper.insertBillHistory(histDTO);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void updateBillHistory(final NiceCiDTO.BillHistDTO histDTO){
|
||||
mapper.updateBillHistory(histDTO);
|
||||
}
|
||||
// accept /////////////////////////////////////////////////////
|
||||
|
||||
// status /////////////////////////////////////////////////////
|
||||
@Transactional(readOnly = true)
|
||||
public Optional<NiceCiDTO.SendResult> findDataIdFromSendResult(final NiceCiApiResult result){
|
||||
return mapper.selectDataIdFromSendResult(result);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public int insertNiceSmsSndngInquireResponseRepeats(final List<NiceCiApiResult> resultList){
|
||||
return mapper.insertNiceSmsSndngInquireResponseRepeats(resultList);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public int insertSendResults(final List<NiceCiDTO.SendResult> sendResults){
|
||||
return mapper.insertSendResults(sendResults);
|
||||
}
|
||||
// status /////////////////////////////////////////////////////
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cokr.xit.ens.modules.nice.mapper.INiceCiBillHistoryMapper">
|
||||
|
||||
<insert id="insertBillHistory" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillHistDTO">
|
||||
/** iup-niceci-bill-history-mapper|insertBillHistory-Bill API(NICE CI) call history save|julim */
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
||||
SELECT NVL(MAX(id), 0) + 1
|
||||
FROM ens_bill_his
|
||||
</selectKey>
|
||||
INSERT INTO ens_bill_his (
|
||||
id,
|
||||
linked_uuid,
|
||||
org_cd,
|
||||
req_se,
|
||||
bill_se,
|
||||
request_data,
|
||||
regist_dt
|
||||
) VALUES (
|
||||
#{id},
|
||||
#{linkedUuid},
|
||||
#{orgCd},
|
||||
#{reqSe},
|
||||
#{billSe},
|
||||
#{requestData},
|
||||
sysdate
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateBillHistory" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillHistDTO">
|
||||
/** iup-niceci-bill-history-mapper|updateBillHistory-Bill API(NICE CI) call history save|julim */
|
||||
UPDATE ens_bill_his
|
||||
SET bill_uid = #{billUid}
|
||||
, response_data = #{responseData}
|
||||
, error_code = #{errorCode}
|
||||
, error_message = #{errorMessage}
|
||||
, last_updt_dt = sysdate
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cokr.xit.ens.modules.nice.mapper.INiceCiNewTransactionMapper">
|
||||
|
||||
<!-- =================================================================================== -->
|
||||
<!-- ================================ accept =========================================== -->
|
||||
<!-- =================================================================================== -->
|
||||
<insert id="insertBillHistory" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillHistDTO">
|
||||
/** iup-niceci-new-transaction-mapper|insertBillHistory-Bill API(NICE CI) call history save|julim */
|
||||
<selectKey keyProperty="id" resultType="long" order="BEFORE">
|
||||
SELECT NVL(MAX(id), 0) + 1
|
||||
FROM ens_bill_his
|
||||
</selectKey>
|
||||
INSERT INTO ens_bill_his (
|
||||
id,
|
||||
linked_uuid,
|
||||
org_cd,
|
||||
req_se,
|
||||
bill_se,
|
||||
request_data,
|
||||
regist_dt
|
||||
) VALUES (
|
||||
#{id},
|
||||
#{linkedUuid},
|
||||
#{orgCd},
|
||||
#{reqSe},
|
||||
#{billSe},
|
||||
#{requestData},
|
||||
sysdate
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateBillHistory" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillHistDTO">
|
||||
/** iup-niceci-new-transaction-mapper|updateBillHistory-Bill API(NICE CI) call history save|julim */
|
||||
UPDATE ens_bill_his
|
||||
SET bill_uid = #{billUid}
|
||||
, response_data = #{responseData}
|
||||
, error_code = #{errorCode}
|
||||
, error_message = #{errorMessage}
|
||||
, last_updt_dt = sysdate
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<!-- =================================================================================== -->
|
||||
<!-- ================================ accept =========================================== -->
|
||||
<!-- =================================================================================== -->
|
||||
|
||||
|
||||
<!-- =================================================================================== -->
|
||||
<!-- ================================ status =========================================== -->
|
||||
<!-- =================================================================================== -->
|
||||
<insert id="insertNiceSmsSndngInquireResponseRepeats" parameterType="list">
|
||||
/** iup-new-transaction-mapper|insertNiceSmsSndngInquireResponseRepeats-nice ci Send response 반복부 생성|julim */
|
||||
<!-- //FIXME: oracle인 경우 Insert ALL SELECT ... DUAL 사용해야 함 -->
|
||||
<foreach collection="list" item="item" index="index" open="INSERT ALL" close="SELECT 1 FROM DUAL">
|
||||
INTO tb_nice_sms_sndng_inqire_repti (
|
||||
nice_sms_sndng_inqire_id,
|
||||
sn,
|
||||
inqire_dt,
|
||||
indvdl_bsnm_cpr_se,
|
||||
ihidnum,
|
||||
nm,
|
||||
rank_cttpc_1,
|
||||
rank_cttpc_2,
|
||||
rank_cttpc_3,
|
||||
result_se,
|
||||
sms_sndng_requst_se,
|
||||
sndng_mssage,
|
||||
dsptch_no,
|
||||
sms_sndng_cttpc_rank,
|
||||
sms_sndng_cttpc_no,
|
||||
sms_sndng_dt,
|
||||
opetr_id,
|
||||
cttpc_inqire_se,
|
||||
mssage_sndng_result_se,
|
||||
rspns_reptit_blnk,
|
||||
creat_dt,
|
||||
crtr
|
||||
) VALUES (
|
||||
#{item.niceSmsSndngInqireId},
|
||||
(#{index} + 1),
|
||||
#{item.inqireDt},
|
||||
#{item.indvdlBsnmCprSe},
|
||||
#{item.ihidnum},
|
||||
#{item.nm},
|
||||
#{item.rankCttpc_1},
|
||||
#{item.rankCttpc_2},
|
||||
#{item.rankCttpc_3},
|
||||
#{item.resultSe},
|
||||
#{item.smsSndngRequstSe},
|
||||
#{item.sndngMssage},
|
||||
#{item.dsptchNo},
|
||||
#{item.smsSndngCttpcRank},
|
||||
#{item.smsSndngCttpcNo},
|
||||
#{item.smsSndngDt},
|
||||
#{item.opetrId},
|
||||
#{item.cttpcInqireSe},
|
||||
#{item.mssageSndngResultSe},
|
||||
#{item.rspnsReptitBlnk},
|
||||
sysdate,
|
||||
'ENS_SYS'
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectDataIdFromSendResult" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiResult" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$SendResult">
|
||||
/** iup-new-transaction-mapper|selectDataIdFromSendResult-상태조회 발송결과응답 데이타로 API 요청 데이타 조회|julim */
|
||||
SELECT tix.lnk_input_id
|
||||
, tidx.data_id
|
||||
, tix.send_type
|
||||
, tix.run_dt
|
||||
, tix.expires_dt
|
||||
, 'N' AS prcsYn
|
||||
, tnssr.ihidnum
|
||||
FROM tb_nice_sms_sndng_requst tnssr
|
||||
JOIN tb_input_data_xit tidx
|
||||
ON tnssr.data_id = tidx.data_id
|
||||
JOIN tb_input_xit tix
|
||||
ON tidx.lnk_input_id = tix.lnk_input_id
|
||||
WHERE tnssr.ihidnum = #{ihidnum} -- 응답받은 주민번호
|
||||
AND REGEXP_REPLACE(tnssr.sndng_mssage, '[[:space:]]+', '') = REGEXP_REPLACE(#{sndngMssage}, '[[:space:]]+', '') -- 응답받은 발송메시지
|
||||
</select>
|
||||
|
||||
<insert id="insertSendResults" parameterType="list">
|
||||
/** iup-new-transaction-mapper|insertSendResults-nice ci 전송 상태 조회 결과 생성|julim */
|
||||
<!-- //FIXME: oracle인 경우 Insert ALL SELECT ... DUAL 사용해야 함 -->
|
||||
<foreach collection="list" item="item" index="index" open="INSERT ALL" close="SELECT 1 FROM DUAL">
|
||||
INTO tb_send_result (
|
||||
lnk_input_id,
|
||||
data_id,
|
||||
run_dt,
|
||||
send_type,
|
||||
expires_dt,
|
||||
biz_err_msg,
|
||||
prcs_yn,
|
||||
reg_dt,
|
||||
reg_id
|
||||
) VALUES (
|
||||
#{lnkInputId}
|
||||
, #{dataId}
|
||||
, #{runDt}
|
||||
, #{sendType}
|
||||
, #{expiresDt}
|
||||
, #{bizErrMsg}
|
||||
, #{prcsYn}
|
||||
, sysdate
|
||||
, 'ENS_SYS'
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- =================================================================================== -->
|
||||
<!-- ================================ status =========================================== -->
|
||||
<!-- =================================================================================== -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue