diff --git a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java index 4fc07a7..dd02dfd 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java +++ b/src/main/java/cokr/xit/adds/biz/nims/dao/BizNimsMapper.java @@ -70,7 +70,7 @@ public interface BizNimsMapper extends AbstractMapper { NimsApiDto.DsuseRptInfo selectDsuseRptInfoByUsrRptIdNo(final Map map); // 이미지 업로드시 이전 이미지 삭제를 위한 fileId 조회 - String selectFileId(Map map); + List selectFileId(Map map); //List selectDsuseRptInfoDtls(final Map map); diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java b/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java index cf3c477..c51c9ef 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java +++ b/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java @@ -1,7 +1,7 @@ package cokr.xit.adds.biz.nims.service.bean; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -985,12 +985,12 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe * */ private String uploadFileAndSave(String infType, String infKey, String subType, MultipartFile mf) { - String fileId = bizNimsMapper.selectFileId(Map.of("infType", infType, "infKey", infKey, "subType", subType)); - if(!isEmpty(fileId)){ - fileService.delete(new String[]{fileId}); + List fileIds = bizNimsMapper.selectFileId(Map.of("infType", infType, "infKey", infKey, "subType", subType)); + if(!fileIds.isEmpty()){ + fileService.delete(fileIds.toArray(new String[0])); } - MultipartFile[] uploads = Arrays.asList(mf).toArray(new MultipartFile[0]); + MultipartFile[] uploads = Collections.singletonList(mf).toArray(new MultipartFile[0]); List files = (new FileInfoFactory()).makeFileInfos((new FileInfo.Relation()).setInfoType(infType).setInfoKey(infKey).setSubType(subType), uploads); fileService.create(files);