소스 정리

main
이범준 8 months ago
parent 7e144c5c83
commit 1aec5b95ac

@ -96,7 +96,7 @@ public class OutsourcingFileWriter {
File modifiedFile = new File(modifiedFilePath); File modifiedFile = new File(modifiedFilePath);
if(dataObject.get("MOS"+fileKey) != null) { if(dataObject.get("MOS"+fileKey) != null) {
CmmnUtil.createMaskedImage(orgnFileInputStream, modifiedFile, (List<DataObject>)dataObject.get("MOS"+fileKey)); CmmnUtil.createMaskedImage(orgnFileInputStream, modifiedFile, CmmnUtil.getDataObjectListFromMap(dataObject,"MOS"+fileKey));
} else { } else {
Files.copy(orgnFileInputStream, modifiedFile.toPath(), StandardCopyOption.REPLACE_EXISTING); Files.copy(orgnFileInputStream, modifiedFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
} }

@ -14,6 +14,7 @@ import java.text.SimpleDateFormat;
import java.time.DayOfWeek; import java.time.DayOfWeek;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.TextStyle; import java.time.format.TextStyle;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
@ -41,6 +42,22 @@ import cokr.xit.foundation.data.DataObject;
public class CmmnUtil { public class CmmnUtil {
public static List<DataObject> getDataObjectListFromMap(Map<String,?> map, String key) {
ArrayList<DataObject> dataObjectList = new ArrayList<>();
Object list = map.get(key);
if(list == null) {
return null;
}
if(list instanceof ArrayList<?>) {
for(Object o : (ArrayList<?>) list) {
if(o instanceof DataObject) {
dataObjectList.add((DataObject)o);
}
}
}
return dataObjectList;
}
/** /**
* HTML . * HTML .
* @param HTML * @param HTML

@ -3,6 +3,7 @@ package cokr.xit.fims.cmmn.pdf.print.format;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.Print; import cokr.xit.fims.cmmn.Print;
import cokr.xit.fims.cmmn.PrintOption; import cokr.xit.fims.cmmn.PrintOption;
import cokr.xit.fims.cmmn.pdf.print.DefaultOtptArtclStng; import cokr.xit.fims.cmmn.pdf.print.DefaultOtptArtclStng;
@ -113,8 +114,10 @@ public abstract class PDFPrintFormat {
public abstract DataObject createSampleData(); public abstract DataObject createSampleData();
public List<DataObject> getMosSet(String imageKey, DataObject dataObject) { public List<DataObject> getMosSet(String imageKey, DataObject dataObject) {
if((List<DataObject>)dataObject.get("MOS"+imageKey) != null) { List<DataObject> list = CmmnUtil.getDataObjectListFromMap(dataObject,"MOS"+imageKey);
return (List<DataObject>)dataObject.get("MOS"+imageKey);
if(list != null) {
return list;
} else { } else {
return null; return null;
} }

@ -19,6 +19,7 @@ import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.Team; import cokr.xit.fims.crdn.Team;
import cokr.xit.fims.crdn.dao.CrdnTeamMapper; import cokr.xit.fims.crdn.dao.CrdnTeamMapper;
@ -100,7 +101,7 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ
Map<String, Object> dividedInfo = this.divideInformation(linkFileInfoList, fileGroupType); Map<String, Object> dividedInfo = this.divideInformation(linkFileInfoList, fileGroupType);
DataObject metaFileInfo = (DataObject) dividedInfo.get("metaInfo"); DataObject metaFileInfo = (DataObject) dividedInfo.get("metaInfo");
List<DataObject> imageFileInfoList = (List<DataObject>) dividedInfo.get("imageInfo"); List<DataObject> imageFileInfoList = CmmnUtil.getDataObjectListFromMap(dividedInfo,"imageInfo");
DataObject bgngData = (DataObject) dividedInfo.get("bgngData"); DataObject bgngData = (DataObject) dividedInfo.get("bgngData");
DataObject endData = (DataObject) dividedInfo.get("endData"); DataObject endData = (DataObject) dividedInfo.get("endData");

@ -12,6 +12,7 @@ import cokr.xit.base.code.CommonCode;
import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.cvlc.CrdnCvlcpt;
@ -77,9 +78,9 @@ public class Cvlc05Controller extends ApplicationController {
Map<String, Object> info = crdnCvlcptService.getCvlcptAnswerWordsInfo(crdnQuery); Map<String, Object> info = crdnCvlcptService.getCvlcptAnswerWordsInfo(crdnQuery);
DataObject basicInfo = (DataObject) info.get("basic"); DataObject basicInfo = (DataObject) info.get("basic");
List<DataObject> levyCaseList = (List<DataObject>) info.get("levyCaseList"); List<DataObject> levyCaseList = CmmnUtil.getDataObjectListFromMap(info,"levyCaseList");
List<DataObject> warningCaseList = (List<DataObject>) info.get("warningCaseList"); List<DataObject> warningCaseList = CmmnUtil.getDataObjectListFromMap(info,"warningCaseList");
List<DataObject> nonlevyCaseList = (List<DataObject>) info.get("nonlevyCaseList"); List<DataObject> nonlevyCaseList = CmmnUtil.getDataObjectListFromMap(info,"nonlevyCaseList");
if(basicInfo == null){ if(basicInfo == null){
mav.addObject("headerCn", ""); mav.addObject("headerCn", "");

Loading…
Cancel
Save