fix: 파일 이미지 변경 처리 fix

dev
Jonguk. Lim 5 months ago
parent bc320c58ff
commit cd555937a9

@ -84,7 +84,7 @@ public interface BizNimsMapper extends AbstractMapper {
NimsApiDto.DsuseRptInfo selectDsuseRptInfoByUsrRptIdNo(final Map<String, String> map);
// 이미지 업로드시 이전 이미지 삭제를 위한 fileId 조회
List<String> selectFileId(Map<String, String> map);
String[] selectFileId(Map<String, String> map);
void deleteDsuseMgtDtl(final String dscdmngId);

@ -290,10 +290,11 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
bizNimsMapper.updateDsuseMgtReceipt(reqDto);
// 파일 삭제
List<String> fileIds = bizNimsMapper.selectFileId(
String[] fileIds = bizNimsMapper.selectFileId(
Map.of("infType", Constants.FILE_INF_TYPE.DSUSE_PRD_IMG.getCode(), "infKey", reqDto.getDscdmngId()));
if (!fileIds.isEmpty()) {
fileService.delete(fileIds.toArray(new String[0]));
if (fileIds.length > 0) {
fileService.delete(fileIds);
}
// 폐기관리 상세 삭제
@ -325,10 +326,10 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
if(bizNimsMapper.updateDsuseMgtRslt(reqDto) == 1){
if("Y".equals(fileChangeYn)) {
// 파일 삭제
List<String> fileIds = bizNimsMapper.selectFileId(
String[] fileIds = bizNimsMapper.selectFileId(
Map.of("infType", Constants.FILE_INF_TYPE.DSUSE_IMG.getCode(), "infKey", reqDto.getDscdmngId()));
if (!fileIds.isEmpty()) {
fileService.delete(fileIds.toArray(new String[0]));
if (fileIds.length > 0) {
fileService.delete(fileIds);
}
int idx = 1;
@ -948,9 +949,9 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* </pre>
*/
private String uploadFileDeleteAndSave(String infType, String infKey, String subType, MultipartFile mf) {
List<String> fileIds = bizNimsMapper.selectFileId(Map.of("infType", infType, "infKey", infKey, "subType", subType));
if(!fileIds.isEmpty()){
fileService.delete(fileIds.toArray(new String[0]));
String[] fileIds = bizNimsMapper.selectFileId(Map.of("infType", infType, "infKey", infKey, "subType", subType));
if(fileIds.length > 0){
fileService.delete(fileIds);
}
return uploadFileSave(infType, infKey, subType, mf);
@ -975,28 +976,4 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
return files.get(0).getId();
}
// @Override
// public List<NimsApiDto.StorageInfo> saveStorageInfo(NimsApiRequest.StorageInfoRequest dto) {
// NimsApiResult.Response<NimsApiDto.StorageInfo> result = infNimsService.getStorageInfo(dto);
// List<NimsApiDto.StorageInfo> list = result.getResultOrThrow();
//
// for (NimsApiDto.StorageInfo d : list) {
// d.setRgtr(Constants.NIMS_API_USER_ID);
// bizNimsMapper.mergeStorgeInfo(d);
// }
// return list;
// }
}

Loading…
Cancel
Save