발송현황 관련 기능 수정/추가

main
mjkhan21 3 months ago
parent 398c2037e7
commit ea140ae482

@ -15,6 +15,7 @@ import org.springframework.stereotype.Component;
import cokr.xit.base.user.service.bean.UserBean;
import cokr.xit.fims.FimsConf;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.crdn.dao.CrdnUpdtMapper;
import cokr.xit.fims.levy.Levy;
import cokr.xit.fims.levy.LevyQuery;
@ -56,6 +57,8 @@ public class SnisBean extends AbstractBean {
/** 과태료 대장 단속 정보 등록 정보 DAO */
@Resource(name = "nisA01Mapper")
private NisA01Mapper nisA01Mapper;
@Resource(name = "crdnInfoMapper")
private CrdnInfoMapper crdnInfoMapper;
/** 단속 대장 수정 정보 DAO */
@Resource(name = "crdnUpdtMapper")
private CrdnUpdtMapper crdnUpdtMapper;
@ -265,38 +268,17 @@ public class SnisBean extends AbstractBean {
notice -> notice
));
List<String> nxrpLevyKeys = noticeMap.keySet().stream().toList();
// 부과정보 업데이트
List<Levy> levies = levyMapper.selectLevys(new LevyQuery().setNxrpLevyKeys(nxrpLevyKeys));
levies.forEach(levy -> {
for (Levy levy: levies) {
Ye22NoticeInfoDTO notice = noticeMap.get(levy.getNxrpLevyKey());
if (notice == null) return;
levy.setSggCd(notice.getSiguCd()); // 시군구 코드
levy.setDeptCd(notice.getBuseoCd()); // 부서코드
String semokCd = notice.getSemokCd();
if (!semokCd.contains(levy.getTxitmCd()))
levy.setTxitmCd(semokCd); // 세목코드
levy.setLevyNo(notice.getTaxNo()); // 부과번호
levy.setLevyYmd(notice.getTaxYmd()); // 부과일자
levy.setDudtYmd(notice.getNapgiYmd()); // 납기일자
levy.setRcvmtYmd(notice.getNapbuYmd()); // 수납일자
levy.setLevyPcptax((int)notice.getTaxAmt()); // 부과본세 <- 과세금액
levy.setLevyAdamt((int)notice.gasanAmt()); // 부과가산금
levy.setLastAmt((int)notice.totalAmt()); // 최종금액
levy.setDudtAftrAmt(null);
levy.setDudtAftrYmd(notice.getNapgiAftYmd()); // 납기후일자
levy.setTxtnThing(notice.getMulNm()); // 물건이름
levy.setSzrYmd(notice.getApYmd()); // 압류일자
levy.setEpayno(notice.getEnapbuNo()); // 전자납부번호
// levy.setNxrpLevyKey(Long.toString(notice.getBuAk())); // 세외수입 부과키
if (notice == null) continue;
setBankAccounts(notice.accountGetters(), levy.bankAccountSetters()); // 은행 / 계좌번호
});
int affected = levyMapper.updateLevies(levies);
update(notice, levy);
}
levyMapper.updateLevies(levies);
// 발송상세 업데이트
List<SndngDtl> details = sndngDtlMapper.selectSndngDetails(new SndbQuery().setSndngDtlIds(sndngDtl.getSndngDtlId()));
details.forEach(detail -> {
Ye22NoticeInfoDTO notice = noticeMap.get(detail.getLinkMngKey());
@ -323,7 +305,89 @@ public class SnisBean extends AbstractBean {
detail.setSndngDtlSttsCd("02"); // 발송 상태 코드(FIM050) 02:가상계좌취득
});
for (SndngDtl detail: details) {
affected += sndngDtlMapper.updateSndngDtl(detail);
sndngDtlMapper.updateSndngDtl(detail);
}
}
private void update(Ye22NoticeInfoDTO notice, Levy levy) {
levy.setSggCd(notice.getSiguCd()); // 시군구 코드
levy.setDeptCd(notice.getBuseoCd()); // 부서코드
String semokCd = notice.getSemokCd();
if (!semokCd.contains(levy.getTxitmCd()))
levy.setTxitmCd(semokCd); // 세목코드
levy.setLevyNo(notice.getTaxNo()); // 부과번호
levy.setLevyYmd(notice.getTaxYmd()); // 부과일자
levy.setDudtYmd(notice.getNapgiYmd()); // 납기일자
levy.setRcvmtYmd(notice.getNapbuYmd()); // 수납일자
levy.setLevyPcptax((int)notice.getTaxAmt()); // 부과본세 <- 과세금액
levy.setLevyAdamt((int)notice.gasanAmt()); // 부과가산금
levy.setLastAmt((int)notice.totalAmt()); // 최종금액
levy.setDudtAftrAmt(null);
levy.setDudtAftrYmd(notice.getNapgiAftYmd()); // 납기후일자
levy.setTxtnThing(notice.getMulNm()); // 물건이름
levy.setSzrYmd(notice.getApYmd()); // 압류일자
levy.setEpayno(notice.getEnapbuNo()); // 전자납부번호
// levy.setNxrpLevyKey(Long.toString(notice.getBuAk())); // 세외수입 부과키
setBankAccounts(notice.accountGetters(), levy.bankAccountSetters()); // 은행 / 계좌번호
}
private void update(List<Ye22NoticeInfoDTO> notices) {
if (isEmpty(notices)) return;
// 세외수입 연계키별 부과정보
Map<String, Levy> levies = levyMapper.selectLevys(new LevyQuery().setNxrpLevyKeys(notices.stream().map(notice -> Long.toString(notice.getBuAk())).toList()))
.stream().collect(Collectors.toMap(
Levy::getNxrpLevyKey,
levy -> levy
));
// 단속ID별 단속정보 <- 부과정보
List<String> crdnIDs = levies.values().stream().map(Levy::getCrdnId).toList();
Map<String, Crdn> crdns = crdnInfoMapper.selectCrdns(crdnIDs).stream().collect(Collectors.toMap(
Crdn::getCrdnId,
crdn -> crdn
));
// '부과'상태 사전통보 포함여부
boolean bugwa = notices.stream()
.filter(notice -> "0".equals(notice.getBuStatusCd()))
.count() > 0;
// 세외수입 연계키별 발송상세 정보
List<SndngDtl> sndngDtls = bugwa ? sndngDtlMapper.selectSndngDetails(new SndbQuery().setCrdnIds(crdnIDs.toArray(new String[crdnIDs.size()]))) : Collections.emptyList();
Map<String, SndngDtl> sndngDetails = sndngDtls.stream().collect(Collectors.toMap(
SndngDtl::getLinkMngKey,
sndngDtl -> sndngDtl
));
for (Ye22NoticeInfoDTO notice: notices) {
String status = notice.getBuStatusCd(); // 과태료 상태
String linkMngKey = Long.toString(notice.getBuAk()); // 세외수입 연계키
Levy levy = levies.get(linkMngKey);
if (levy != null) // 부과정보에 적용
update(notice, levy);
Crdn crdn = crdns.get(levy.getCrdnId());
if (crdn != null) { // 단속정보에 적용
if ("1".equals(status)) { // '완납' 상태일 경우
crdn.setRcvmtAmt((int)notice.totalAmt()); // 수납금액
notice.getNapbuYmd(); // 납부일자
String crdnStatus = switch (crdn.getCrdnSttsCd()) {
case "23", "31", "42", "43", "44", "45" -> "71"; // 사전통보수납
case "51" -> "72"; // 부과수납
case "52" -> "73"; // 독촉수납
case "53", "54" -> "74"; // 압류예정수납
case "55" -> "75"; // 압류수납
default -> null;
};
if (crdnStatus != null)
crdn.setCrdnSttsCd(crdnStatus);
}
}
}
}

@ -223,4 +223,6 @@ public interface SndngDtlMapper extends AbstractMapper {
* @return
*/
int deleteSndngDtlSvbtc(SndngDtl sndngDtl);
List<DataObject> selectDetailList(List<String> sndngIDs);
}

@ -105,4 +105,6 @@ public interface SndngDtlService {
* </ul>
*/
String removeSndbk(SndngDtl sndngDtl);
List<DataObject> getDetailList(List<String> sndngIDs);
}

@ -420,10 +420,11 @@ public class SndngDtlBean extends AbstractBean {
if (!("03,05".contains(sndbkInfo.string("SNDNG_DTL_STTS_CD"))))
return "[F] 반송 등록 대상자료가 아닙니다.";
// 등기 번호가 있는지 확인
if (sndbkInfo.string("RG_NO").equals(""))
String rgNo = blankIfEmpty(sndbkInfo.string("RG_NO"));
if (rgNo.isEmpty())
return "[F] 등기번호가 존재하지 않습니다.";
// 등기 번호가 13자리인지 확인
if (sndbkInfo.string("RG_NO").length() != 13)
if (rgNo.length() != 13)
return "[F] 등기번호 자릿수(13)가 맞지 않습니다.";
// 전자우편 배달 결과 조회
@ -553,4 +554,8 @@ public class SndngDtlBean extends AbstractBean {
return "[S] 작업이 정상 처리 되었습니다.";
}
public List<DataObject> getDetailList(List<String> sndngIDs) {
return sndngDtlMapper.selectDetailList(sndngIDs);
}
}

@ -106,4 +106,9 @@ public class SndngDtlServiceBean extends AbstractServiceBean implements SndngDtl
public String removeSndbk(SndngDtl sndngDtl) {
return sndngDtlBean.removeSndbk(sndngDtl);
}
@Override
public List<DataObject> getDetailList(List<String> sndngIDs) {
return sndngDtlBean.getDetailList(sndngIDs);
}
}

@ -53,9 +53,6 @@ import cokr.xit.fims.sprt.dao.IntegrationSearchMapper;
import cokr.xit.fims.sprt.service.IntegrationSearchService;
import cokr.xit.fims.sprt.service.bean.MediaBean;
import cokr.xit.fims.task.Task;
import cokr.xit.fims.wpm.WoopyonMoaRequest;
import cokr.xit.fims.wpm.service.WoopyonMoaService;
import cokr.xit.foundation.Downloadable;
import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.DataObject;
@ -167,8 +164,6 @@ public class Sndb01Controller extends ApplicationController {
protected OutsourcingStngBean outsourcingStngBean;
@Resource(name="integrationSearchMapper")
private IntegrationSearchMapper integrationSearchMapper;
@Resource(name="woopyonMoaService")
private WoopyonMoaService woopyonMoaService;
/** (sndb/sndb01/010-main) .
* @return /sndb/sndb01/010-main
@ -440,61 +435,47 @@ public class Sndb01Controller extends ApplicationController {
return setPagingInfo(new ModelAndView("jsonView"), result, "");
} else {
List<DataObject> list = sndngDtlService.getSndngDtlList(req.setFetchSize(0));
String template = req.getType();
if (isEmpty(template)) {
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("발송상태", format.of("SNDNG_DTL_STTS_NM").style(center));
valueMap.put("등기번호", format.of("RG_NO").style(center));
valueMap.put("발송일자", FormatMaker.yyyy_mm_dd(format, "SNDNG_YMD").style(dateYMD));
valueMap.put("납기일자", FormatMaker.yyyy_mm_dd(format, "SNDNG_END_YMD").style(dateYMD));
valueMap.put("성명", format.of("RCPN_NM"));
valueMap.put("우편번호", format.of("RCPN_ZIP").style(center));
valueMap.put("주소", format.of("RCPN_ADDR"));
valueMap.put("상세주소", format.of("RCPN_DTL_ADDR"));
valueMap.put("배달일자", FormatMaker.yyyy_mm_dd(format, "DLVR_YMD").style(dateYMD));
valueMap.put("배달시각", format.of("DLVR_TM").style(center));
valueMap.put("미배달사유", format.of("UNDLVR_RSN_NM"));
valueMap.put("수령인", format.of("ACTL_RCPN_NM"));
valueMap.put("수령인관계", format.of("RCPN_REL_NM"));
valueMap.put("단속일시", format.of("CRDN_DT").style(center));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("계고장 발송 상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if (i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("계고장 발송상세" + "_목록_" + now() + ".xlsx"));
} else {
WoopyonMoaRequest wreq = new WoopyonMoaRequest()
.setTemplate(template)
.setSndngDtlList(list)
.setStandardYN("규격")
.setWeight(25)
.setPieceCount(1)
.setSndngId(req.getSndngId());
Downloadable downloadable = woopyonMoaService.downloadRequest(wreq);
return new ModelAndView("downloadView")
.addObject("download", downloadable.setFilename("우편등록_" + now() + ".xls"));
}
List<CellDef> cellDefs = fromJson(req.getCellDefs(), CellDef.listType());
XLSWriter xlsx = new XLSWriter().worksheet(0);
Format format = new Format(xlsx);
CellStyle center = format.cellStyle(Style.CENTER);
CellStyle numeric = format.n_nn0();
CellStyle dateYMD = format.yyyy_mm_dd();
CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss();
Map<String,Object> valueMap = new HashMap<String,Object>();
valueMap.put("발송상태", format.of("SNDNG_DTL_STTS_NM").style(center));
valueMap.put("등기번호", format.of("RG_NO").style(center));
valueMap.put("발송일자", FormatMaker.yyyy_mm_dd(format, "SNDNG_YMD").style(dateYMD));
valueMap.put("납기일자", FormatMaker.yyyy_mm_dd(format, "SNDNG_END_YMD").style(dateYMD));
valueMap.put("성명", format.of("RCPN_NM"));
valueMap.put("우편번호", format.of("RCPN_ZIP").style(center));
valueMap.put("주소", format.of("RCPN_ADDR"));
valueMap.put("상세주소", format.of("RCPN_DTL_ADDR"));
valueMap.put("배달일자", FormatMaker.yyyy_mm_dd(format, "DLVR_YMD").style(dateYMD));
valueMap.put("배달시각", format.of("DLVR_TM").style(center));
valueMap.put("미배달사유", format.of("UNDLVR_RSN_NM"));
valueMap.put("수령인", format.of("ACTL_RCPN_NM"));
valueMap.put("수령인관계", format.of("RCPN_REL_NM"));
valueMap.put("단속일시", format.of("CRDN_DT").style(center));
valueMap.put("차량번호", format.of("VHRNO"));
valueMap.put("단속법정동", format.of("CRDN_STDG_NM"));
valueMap.put("단속장소", format.of("CRDN_PLC"));
valueMap.put("과태료금액", format.of("FFNLG_AMT").style(numeric));
valueMap.put("등록일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "REG_DT").style(dateDT));
valueMap.put("등록사용자", format.of("RGTR_NM").style(center));
valueMap.put("수정일시", FormatMaker.yyyy_mm_dd_hh_mm_ss(format, "MDFCN_DT").style(dateDT));
valueMap.put("수정사용자", format.of("MDFR_NM").style(center));
CellDef.setValues(cellDefs, valueMap);
xlsx.cell(0, 0).value("계고장 발송 상세").value(center).merge(0, cellDefs.size() - 1)
.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx)))
.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if (i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList()));
return new ModelAndView("downloadView")
.addObject("download", xlsx.getDownloadable().setFilename("계고장 발송상세" + "_목록_" + now() + ".xlsx"));
}
}

@ -23,6 +23,8 @@ public class WoopyonMoaRequest extends ServiceRequest {
private int pieceCount;
/** 발송 아이디 */
private String sndngId;
/** 취급구분 */
private String divKb;
/** 발송상세목록 */
private List<DataObject> sndngDtlList;
}

@ -45,6 +45,7 @@ public class WoopyonMoaBean extends AbstractBean {
sndng.setDivKb(epostRcptReg.getDivKb()); // 취급 구분
// sndng.setEpostNoticeId(); // 전자우편 안내문 ID
*/
sndng.setDivKb(req.getDivKb()); // 취급 구분
sndng.setSndngSttsCd("03"); // 발송 상태 코드(FIM049) - 03 전송, 01 발송 대기
sndng.setSndngId(req.getSndngId()); // 발송 ID

@ -1,5 +1,7 @@
package cokr.xit.fims.wpm.web;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
@ -8,15 +10,44 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.sndb.SndbQuery;
import cokr.xit.fims.sndb.service.SndngDtlService;
import cokr.xit.fims.wpm.WoopyonMoaRequest;
import cokr.xit.fims.wpm.service.WoopyonMoaService;
import cokr.xit.foundation.Downloadable;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.AbstractController;
@Controller
@RequestMapping("/woopyonmoa")
public class WoopyonMoaController extends AbstractController {
/**발송 상세 서비스*/
@Resource(name="sndngDtlService")
private SndngDtlService sndngDtlService;
@Resource(name = "woopyonMoaService")
private WoopyonMoaService woopyonMoaService;
@PostMapping(name="발송정보 다운로드", value="/download.do")
public ModelAndView downloadRequest(WoopyonMoaRequest req) {
List<DataObject> list = sndngDtlService.getSndngDtlList(
new SndbQuery().setSndngId(req.getSndngId()).setFetchAll(true)
);
Downloadable downloadable = woopyonMoaService.downloadRequest(
req.setStandardYN("규격")
.setWeight(25)
.setPieceCount(1)
.setSndngDtlList(list)
);
return new ModelAndView("downloadView")
.addObject("download", downloadable.setFilename("우편등록_" + now() + ".xls"));
}
private String now() {
return dateFormats.format("yyyyMMdd_HHmmss", System.currentTimeMillis());
}
@PostMapping(name="발송정보 업데이트", value="/update.do")
public ModelAndView updateStatus(MultipartFile upload) {
try {

File diff suppressed because it is too large Load Diff

@ -74,6 +74,7 @@
, L.ACNTG_SE_CD <!-- 회계 구분 -->
, L.TXITM_CD <!-- 세목 코드 -->
, L.LEVY_NO <!-- 부과 번호 -->
, L.NXRP_LEVY_KEY <!-- 세외수입 부과키 -->
, L.ISPY_SN <!-- 분납 일련번호 -->
, CONCAT(L.FYR, '-', L.LEVY_NO) AS GOJI_NO
, L.LEVY_SE_CD <!-- 부과 구분 코드 -->
@ -134,15 +135,9 @@ LEFT OUTER JOIN TB_PAYER P ON (C.RTPYR_ID = P.RTPYR_ID) <!-- 납부자
LEFT OUTER JOIN TB_PAYER_ADDR PA ON (C.RTPYR_ID = PA.RTPYR_ID AND C.ADDR_SN = PA.ADDR_SN) <!-- 납부자 주소 대장 -->
LEFT OUTER JOIN TB_LEVY L ON (C.CRDN_ID = L.CRDN_ID AND L.DEL_YN = 'N') <!-- 부과 대장 -->
WHERE C.DEL_YN = 'N'
<if test='crdnIds != null'>
AND C.CRDN_ID IN (<foreach collection="crdnIds" item="CRDN_ID" separator=",">#{CRDN_ID}</foreach>)
</if>
<if test='sggCd != null'>
AND C.SGG_CD = #{sggCd}
</if>
<if test="taskSeCd != null">
AND C.TASK_SE_CD = #{taskSeCd}
</if>
<if test='crdnIds != null'> AND C.CRDN_ID IN (<foreach collection="crdnIds" item="crdnId" separator=",">#{crdnId}</foreach>)</if>
<if test='sggCd != null'> AND C.SGG_CD = #{sggCd}</if>
<if test="taskSeCd != null"> AND C.TASK_SE_CD = #{taskSeCd}</if>
<!-- 통합조회 키워드 -->
<if test="ischKeywordSet != null">

Loading…
Cancel
Save