fix: 폐기결과[통보] 변경 파일 처리 변경

-> 파일 변경여부 파라메터 추가
dev
Jonguk. Lim 5 months ago
parent cf889c8dbf
commit b734e89830

@ -42,7 +42,7 @@ public interface BizNimsService {
// NIMS BIZ
//------------------------------------------------------------------------------------------------------
BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto, final List<BizNimsDto.DsuseMgtDtl> dtls, List<MultipartFile> files);
BizNimsRequest.DsuseMgtRsltReq saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq dto, List<MultipartFile> files);
BizNimsRequest.DsuseMgtRsltReq saveDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq dto, final List<MultipartFile> files, final String fileChangeYn);
List<BizNimsResponse.DsuseMgtRes> getDsuseMgts(final BizNimsRequest.DsuseMgtInqReq dto, final boolean isForDoc);
void modifyPrgsSttsOfDsuseMgt(final BizNimsDto.DsuseMgt dto);
NimsApiDto.ProductInfoKd getPrdMnfSeqInfoOfBarcode(final String barcodeStr);

@ -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 {

@ -151,11 +151,12 @@ public class BizNimsController {
@PostMapping(value = "/saveDsuseMgtRslt")
public ApiBaseResponse<BizNimsRequest.DsuseMgtRsltReq> saveDsuseMgtRslt(
@RequestParam("dsuseMgtRsltJsonStr") String dsuseMgtRsltJsonStr,
@RequestParam(value = "dsuseDsuseImgFiles", required = false) List<MultipartFile> dsuseDsuseImgFiles
@RequestParam(value = "dsuseDsuseImgFiles", required = false) List<MultipartFile> dsuseDsuseImgFiles,
@RequestParam("fileChangeYn") String fileChangeYn
) {
JSON json = new JSON();
BizNimsRequest.DsuseMgtRsltReq rsltDto = json.parse(dsuseMgtRsltJsonStr, new TypeReference<>() {});
return ApiBaseResponse.of(bizNimsService.saveDsuseMgtRslt(rsltDto, dsuseDsuseImgFiles));
return ApiBaseResponse.of(bizNimsService.saveDsuseMgtRslt(rsltDto, dsuseDsuseImgFiles, fileChangeYn));
}
@Operation(summary = "폐기 보고 조회(NIMS API 폐기보고 조회)", description = "업체의 폐기 보고 정보 목록 조회<br><br>NIMS API 호출 결과를 DB에 저장후 Return", tags = { "BIZ NIMS API" })

Loading…
Cancel
Save