diff --git a/src/main/java/cokr/xit/fims/crdn/service/ImportService.java b/src/main/java/cokr/xit/fims/crdn/service/ImportService.java index f595e5a2..12935b33 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/ImportService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/ImportService.java @@ -1,5 +1,6 @@ package cokr.xit.fims.crdn.service; +import java.util.HashMap; import java.util.List; import cokr.xit.foundation.data.DataObject; @@ -18,5 +19,5 @@ public interface ImportService { * @param dataObject 연계 파일 정보 * @return 저장 여부 */ - boolean createCrdnByEquipmentLinkFile(String entType, List linkFileInfoList); + HashMap createCrdnByEquipmentLinkFile(String entType, List linkFileInfoList); } \ No newline at end of file diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java index e7a9049d..02d6b711 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java @@ -1,5 +1,6 @@ package cokr.xit.fims.crdn.service.bean; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -65,7 +66,10 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ } @Override - public boolean createCrdnByEquipmentLinkFile(String entType, List linkFileInfoList) { + public HashMap createCrdnByEquipmentLinkFile(String entType, List linkFileInfoList) { + HashMap resultMap = new HashMap<>(); + + resultMap.put("saved", false); Crdn crdn = new Crdn(); @@ -74,7 +78,7 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ } - return true; + return resultMap; } } \ No newline at end of file diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index a3c134e4..a629d89d 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -239,16 +239,30 @@ public class Crdn05Controller extends ApplicationController { */ public ModelAndView createCrdnByLinkFile(String entType, String[] linkFileInfos) { ModelAndView mav = new ModelAndView("jsonView"); - boolean saved = false; + List linkFileInfoList = new ArrayList(); for(String linkFileInfo : linkFileInfos) { linkFileInfoList.add(fromJson(linkFileInfo, DataObject.class)); } - saved = importService.createCrdnByEquipmentLinkFile(entType, linkFileInfoList); + HashMap resultMap = importService.createCrdnByEquipmentLinkFile(entType, linkFileInfoList); + boolean saved = (boolean) resultMap.get("saved"); mav.addObject("saved", saved); + + if(!ifEmpty(resultMap.get("alertMessage"), () -> "").equals("")) { + mav.addObject("alertMessage", resultMap.get("alertMessage")); + } + + if(!saved) { + if(!ifEmpty(resultMap.get("failReason"), () -> "").equals("")) { + mav.addObject("failReason", resultMap.get("failReason")); + } else { + mav.addObject("failReason", "알 수 없는 오류"); + } + } + return mav; } diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp index 9403082f..a9325e74 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp @@ -153,6 +153,8 @@ +
+