소스 정리

main
mjkhan21 8 months ago
parent fb562f2c45
commit ca42d158f2

@ -2005,26 +2005,21 @@ public class Sndb01Controller extends ApplicationController {
// 고지서 출력 대상 자료 조회 // 고지서 출력 대상 자료 조회
List<DataObject> list = sndngDtlService.getSndngTrgtDtlIds(req); List<DataObject> list = sndngDtlService.getSndngTrgtDtlIds(req);
String[] crdnIds = list.stream().map(row -> row.string("CRDN_ID")).toList().toArray(new String[list.size()]); String[] crdnIds = list.stream().map(row -> row.string("CRDN_ID")).toList().toArray(new String[list.size()]);
UserInfo userInfo = currentUser();
ogdpBean.initUserInfo(userInfo);
// 단속 대장 조회 // 단속 대장 조회
SprtQuery sprtQuery = new SprtQuery() List<DataObject> crdnList = integrationSearchMapper.selectIntegrationDataList(new SprtQuery().setCrdnIds(crdnIds));
.setCrdnIds(crdnIds); Map<String, List<DataObject>> crdnFiles = fileBean.getFileList(new FileQuery().setInfoType(Crdn.INF_TYPE).setInfoKeys(crdnIds)).stream()
List<DataObject>dataObjectList = integrationSearchMapper.selectIntegrationDataList(sprtQuery); .collect(Collectors.groupingBy(row -> row.string("INF_KEY")));
for (DataObject dataObject: dataObjectList) { for (DataObject dataObject: crdnList) {
String crdnId = dataObject.string("CRDN_ID"); List<DataObject> fileList = crdnFiles.get(dataObject.string("CRDN_ID"));
if (isEmpty(fileList)) continue;
FileQuery fileQuery = new FileQuery() for (int i = 0; i < fileList.size(); i++) {
.setInfoType(Crdn.INF_TYPE) DataObject fileInfo = fileList.get(i);
.setInfoKeys(crdnId); dataObject.set("CRDN_PHOTO"+(i+1), fileInfo.string("URL"));
List<DataObject> fileInfoList = fileBean.getFileList(fileQuery);
for (int j=0; j<fileInfoList.size(); j++) {
DataObject fileInfo = fileInfoList.get(j);
dataObject.set("CRDN_PHOTO"+(j+1), fileInfo.string("URL"));
String fileID = fileInfo.string("FILE_ID"); String fileID = fileInfo.string("FILE_ID");
dataObject.set("CRDN_PHOTO"+(j+1)+"KEY", fileID); dataObject.set("CRDN_PHOTO"+(i+1)+"KEY", fileID);
List<DataObject> mosSet = mediaBean.getMosaicList(fileID); List<DataObject> mosSet = mediaBean.getMosaicList(fileID);
if (!isEmpty(mosSet)) if (!isEmpty(mosSet))
@ -2032,6 +2027,8 @@ public class Sndb01Controller extends ApplicationController {
} }
} }
UserInfo userInfo = currentUser();
ogdpBean.initUserInfo(userInfo);
Print print = new Print(); Print print = new Print();
print.setPrintRequestUserInfo(userInfo); print.setPrintRequestUserInfo(userInfo);
@ -2062,7 +2059,7 @@ public class Sndb01Controller extends ApplicationController {
globalVariable.put("bcrnImgPath", otptBscStng.string("BCRN_IMG_PATH")); globalVariable.put("bcrnImgPath", otptBscStng.string("BCRN_IMG_PATH"));
} }
printOption.setGlobalVariable(globalVariable); printOption.setGlobalVariable(globalVariable);
Map<String, Object> result = new Nht(print,printOption,otptBscStng,otptArtclStngList,paperSeCd,dataObjectList).makeFile(); Map<String, Object> result = new Nht(print,printOption,otptBscStng,otptArtclStngList,paperSeCd,crdnList).makeFile();
return new ModelAndView("downloadView") return new ModelAndView("downloadView")
.addAllObjects(result); .addAllObjects(result);

Loading…
Cancel
Save