From 33c92176d9ff451cfe5ab03620c586410892eb62 Mon Sep 17 00:00:00 2001 From: JoJH Date: Fri, 15 Nov 2024 17:43:07 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=98=EC=86=A1=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fims/sndb/service/bean/SndngDtlBean.java | 16 +++------------ .../xit/fims/sndb/web/Sndb01Controller.java | 20 +++++++++++++++++-- .../sql/mapper/fims/sndb/svbtc-mapper.xml | 4 ++-- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/main/java/cokr/xit/fims/sndb/service/bean/SndngDtlBean.java b/src/main/java/cokr/xit/fims/sndb/service/bean/SndngDtlBean.java index a923dfdf..7a6fbb5f 100644 --- a/src/main/java/cokr/xit/fims/sndb/service/bean/SndngDtlBean.java +++ b/src/main/java/cokr/xit/fims/sndb/service/bean/SndngDtlBean.java @@ -691,20 +691,10 @@ public class SndngDtlBean extends AbstractBean { rtnMsg = "[F] 작업 중 대상 자료가 존재하지 않습니다."; return rtnMsg; } - if (sndbkInfo.size() == 1) { - rtnMsg = "[F] 작업 중 대상 자료가 1건이 아닙니다."; - return rtnMsg; - } - // 이전 발송상세 상태 코드가 발송확인(04) 이라면.. - if (sndbkInfo.string("BFR_SNDNG_DTL_STTS_CD").equals("04")) { - sndngDtl.setDlvrYmd(sndbkInfo.string("BFR_DLVR_YMD")); - sndngDtl.setDlvrTm(sndbkInfo.string("BFR_DLVR_HR")); - sndngDtl.setSndngDtlSttsCd(sndbkInfo.string("BFR_SNDNG_DTL_STTS_CD")); - } else { - sndngDtl.setDlvrYmd(""); - sndngDtl.setDlvrTm(""); - } + sndngDtl.setDlvrYmd(sndbkInfo.string("BFR_DLVR_YMD")); + sndngDtl.setDlvrTm(sndbkInfo.string("BFR_DLVR_HR")); + sndngDtl.setSndngDtlSttsCd(sndbkInfo.string("BFR_SNDNG_DTL_STTS_CD")); // 발송 상세(TB_SNDNG_DTL) 대장에 반송 정보를 삭제한다. rtnNocs = sndngDtlMapper.deleteSndbk(sndngDtl); diff --git a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java index 6fbab535..ae7f4ab9 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -1548,10 +1548,26 @@ public class Sndb01Controller extends ApplicationController { * } */ @Task - @RequestMapping(name="발송상세의 반송 정보 삭제", value=METHOD_URL.removeSendBack) + @RequestMapping(name="발송 상세의 반송 정보 삭제", value=METHOD_URL.removeSendBack) public ModelAndView removeSendBack(SndngDtl sndngDtl) { boolean saved = false; - String rtnMsg = sndngDtlService.removeSndbk(sndngDtl); + String rtnMsg = ""; + + // 발송상세의 반송 정보 삭제 + if (sndngDtl.getSndngDtlIds() == null || sndngDtl.getSndngDtlIds().length < 1) { + rtnMsg = sndngDtlService.removeSndbk(sndngDtl); + } else { + // 발송상세 IDs 만큼 반송 삭제 반복.. + for (String sndngDtlId : sndngDtl.getSndngDtlIds()) { + SndngDtl deltSndngDtl = new SndngDtl(); + deltSndngDtl.setSndngDtlId(sndngDtlId); + + // 반송 삭제 호출 + rtnMsg = sndngDtlService.removeSndbk(deltSndngDtl); + if (!rtnMsg.contains("[S]")) // 오류가 발생하였으면 종료.. + break; + } + } if (rtnMsg.contains("[S]")) { saved = true; diff --git a/src/main/resources/sql/mapper/fims/sndb/svbtc-mapper.xml b/src/main/resources/sql/mapper/fims/sndb/svbtc-mapper.xml index c14aa226..048f99e0 100644 --- a/src/main/resources/sql/mapper/fims/sndb/svbtc-mapper.xml +++ b/src/main/resources/sql/mapper/fims/sndb/svbtc-mapper.xml @@ -32,9 +32,9 @@ SELECT SV.SVBTC_ID , SV.SGG_CD , SV.TASK_SE_CD - , (GET_CODE_NM('FIM054', SV.TASK_SE_CD)) AS TASK_SE_NM + , (GET_CODE_NM('FIM054', SV.TASK_SE_CD)) AS TASK_SE_NM , SV.SNDNG_SE_CD - , (GET_CODE_NM('FIM047', SV.SNDNG_SE_CD)) AS SNDNG_SE_NM + , (GET_CODE_NM('FIM047', SV.SNDNG_SE_CD)) AS SNDNG_SE_NM , SV.SVBTC_YMD , SV.SVBTC_END_YMD , SV.TTL_NM