|
|
|
@ -305,21 +305,25 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
|
|
|
|
|
* @return BizNimsRequest.DsuseMgtRslt 생성된 폐기관리 정보
|
|
|
|
|
* </pre>
|
|
|
|
|
*/
|
|
|
|
|
public BizNimsRequest.DsuseMgtRsltReq saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq reqDto, final List<MultipartFile> files) {
|
|
|
|
|
public BizNimsRequest.DsuseMgtRsltReq saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq reqDto, final List<MultipartFile> files, final String fileChangeYn) {
|
|
|
|
|
ApiUtil.validate(reqDto, null, validator);
|
|
|
|
|
reqDto.setRgtr(reqDto.getUserId());
|
|
|
|
|
|
|
|
|
|
if(bizNimsMapper.updateDsuseMgtRslt(reqDto) == 1){
|
|
|
|
|
// 파일 삭제
|
|
|
|
|
List<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("Y".equals(fileChangeYn)) {
|
|
|
|
|
// 파일 삭제
|
|
|
|
|
List<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]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int idx = 1;
|
|
|
|
|
for (MultipartFile mf : files) {
|
|
|
|
|
uploadFileSave(Constants.FILE_INF_TYPE.DSUSE_IMG.getCode(), reqDto.getDscdmngId(), String.valueOf(idx), mf);
|
|
|
|
|
idx++;
|
|
|
|
|
int idx = 1;
|
|
|
|
|
for (MultipartFile mf : files) {
|
|
|
|
|
uploadFileSave(Constants.FILE_INF_TYPE.DSUSE_IMG.getCode(), reqDto.getDscdmngId(),
|
|
|
|
|
String.valueOf(idx), mf);
|
|
|
|
|
idx++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|