|
|
|
|
@ -114,10 +114,11 @@ public class JasperController extends AbstractController {
|
|
|
|
|
|
|
|
|
|
@RequestMapping(name="사전통지서 미리보기", value="/prenotice.do")
|
|
|
|
|
public ModelAndView previewPrenotice(SndbQuery req, FimsPrintOption printOption) {
|
|
|
|
|
List<DataObject> crdnList = getCrdnList(req);
|
|
|
|
|
String[] crdnIds = crdnList.stream().map(row -> row.string("CRDN_ID")).toList().toArray(new String[crdnList.size()]);
|
|
|
|
|
List<DataObject> dtlList = sndngDtlService.getDetailList(List.of(req.getSndngId()));
|
|
|
|
|
String[] crdnIds = dtlList.stream().map(row -> row.string("CRDN_ID")).toList().toArray(new String[dtlList.size()]);
|
|
|
|
|
Map<String, List<FileInfo>> crdnFiles = fileBean.getFilesOf(Crdn.INF_TYPE, crdnIds).stream()
|
|
|
|
|
.collect(Collectors.groupingBy(row -> row.getInfoKey()));
|
|
|
|
|
setBankAccounts(dtlList);
|
|
|
|
|
|
|
|
|
|
String today = dateFormats.format("yyyyMMdd", System.currentTimeMillis()),
|
|
|
|
|
year = today.substring(0, 4),
|
|
|
|
|
@ -127,7 +128,7 @@ public class JasperController extends AbstractController {
|
|
|
|
|
String userName = user.getName(),
|
|
|
|
|
userPhoneNo = user.getPhoneNo(),
|
|
|
|
|
userEmail = user.getEmailAddress();
|
|
|
|
|
List<InputStream> inputStreams = crdnList.stream()
|
|
|
|
|
List<InputStream> inputStreams = dtlList.stream()
|
|
|
|
|
.flatMap(crdn -> {
|
|
|
|
|
crdn.set("CRDN_YMD_TM", DataFormat.yyyy_mm_dd(crdn.get("CRDN_YMD")) + " " + DataFormat.hh_mm_ss(crdn.get("CRDN_TM")))
|
|
|
|
|
.set("ADVNTCE_DUDT_YMD", DataFormat.yyyy_mm_dd(crdn.get("ADVNTCE_DUDT_YMD")))
|
|
|
|
|
@ -155,14 +156,49 @@ public class JasperController extends AbstractController {
|
|
|
|
|
};
|
|
|
|
|
return new ModelAndView("jasperView")
|
|
|
|
|
.addObject("jasper", jasper)
|
|
|
|
|
.addObject("dataMap", crdnList)
|
|
|
|
|
.addObject("dataMap", dtlList)
|
|
|
|
|
.addObject("filename", "prenotice.pdf")
|
|
|
|
|
.addObject("closables", inputStreams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setBankAccounts(List<DataObject> list) {
|
|
|
|
|
if (isEmpty(list)) return;
|
|
|
|
|
|
|
|
|
|
for (DataObject row: list) {
|
|
|
|
|
for (int i = 0; i < 20; ++i) {
|
|
|
|
|
String suffix = i < 1 ? "" : Integer.toString(i + 1),
|
|
|
|
|
bankKey = "BANK_NM" + suffix,
|
|
|
|
|
bankField = switch (row.string(bankKey)) {
|
|
|
|
|
case "신한" -> "SAccountNo";
|
|
|
|
|
case "우리" -> "WAccountNo";
|
|
|
|
|
case "하나" -> "HAccountNo";
|
|
|
|
|
case "국민" -> "KAccountNo";
|
|
|
|
|
case "기업" -> "IAccountNo";
|
|
|
|
|
case "우체국" -> "PAccountNo";
|
|
|
|
|
case "씨티" -> "CAccountNo";
|
|
|
|
|
case "농협" -> "NAccountNo";
|
|
|
|
|
case "수협" -> "FAccountNo";
|
|
|
|
|
case "카카오" -> "OAccountNo";
|
|
|
|
|
case "K뱅크" -> "QAccountNo";
|
|
|
|
|
case "토스뱅크" -> "TAccountNo";
|
|
|
|
|
default -> null;
|
|
|
|
|
};
|
|
|
|
|
if (bankField == null) continue;
|
|
|
|
|
|
|
|
|
|
String accountKey = "VR_ACTNO" + suffix,
|
|
|
|
|
accountNo = row.string(accountKey);
|
|
|
|
|
|
|
|
|
|
row.remove(bankKey);
|
|
|
|
|
row.remove(accountKey);
|
|
|
|
|
row.put(bankField, accountNo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(name="고지서 미리보기", value="/notice.do")
|
|
|
|
|
public ModelAndView previewNotice(SndbQuery req, FimsPrintOption printOption) {
|
|
|
|
|
List<DataObject> crdnList = getCrdnList(req);
|
|
|
|
|
List<DataObject> crdnList = sndngDtlService.getDetailList(List.of(req.getSndngId())); //getCrdnList(req);
|
|
|
|
|
setBankAccounts(crdnList);
|
|
|
|
|
|
|
|
|
|
String today = dateFormats.format("yyyyMMdd", System.currentTimeMillis());
|
|
|
|
|
FimsUser user = (FimsUser)currentUser().getUser();
|
|
|
|
|
|