Compare commits

...

7 Commits

Author SHA1 Message Date
Jonguk. Lim c489ccc2b2 Merge branch 'main-prdAndseq-api-feat'
# Conflicts:
#	src/main/java/cokr/xit/adds/biz/nims/service/BizNimsService.java
#	src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java
4 weeks ago
Jonguk. Lim b081d12dfc feat: 폐기보고 확인시 제품 시리얼 일치 여부 비교 제외 4 weeks ago
Jonguk. Lim c96cfd8def feat: 폐기결과의 폐기장소 일괄 변경 적용 4 weeks ago
Jonguk. Lim ebbf803a1e feat: 업체조회(페이징 처리) 반영
제품조회(페이징 처리) 반영
      업체 및 제품 조회시 DB 저장 제거
4 weeks ago
Jonguk. Lim 4b00bc7c58 feat: 업체조회(페이징 처리) 반영 4 weeks ago
Jonguk. Lim 5d751cab85 feat: 일련번호 조회(seqinfo_pub) API 적용
제품조회 반영(업체의 제품 조회 되도록)
1 month ago
Jonguk. Lim 37052ea41c feat: 일련번호 조회(seqinfo_pub) API 적용
제품조회 반영(업체의 제품 조회 되도록)
3 months ago

@ -1,17 +1,12 @@
package cokr.xit.adds.biz.nims.dao; package cokr.xit.adds.biz.nims.dao;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.Optional;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import cokr.xit.adds.biz.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.foundation.component.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto;
import cokr.xit.adds.inf.nims.model.NimsApiRequest;
import cokr.xit.foundation.component.AbstractMapper;
/** /**
* <pre> * <pre>
@ -36,7 +31,7 @@ public interface BizNimsMapper extends AbstractMapper {
void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto); void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto);
List<NimsApiDto.BsshInfoSt> selectBsshInfos(final NimsApiRequest.BsshInfoReq dto); List<NimsApiDto.BsshInfoSt> selectBsshInfos(final NimsApiRequest.BsshInfoReq dto);
void mergeProductInfoKd(final NimsApiDto.ProductInfoKd dto); <T> void mergeProductInfoKd(final T t);
List<NimsApiDto.ProductInfoKd> selectProductInfos(final NimsApiRequest.ProductInfoReq dto); List<NimsApiDto.ProductInfoKd> selectProductInfos(final NimsApiRequest.ProductInfoReq dto);
void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto); void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto);
@ -49,6 +44,9 @@ public interface BizNimsMapper extends AbstractMapper {
int insertDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto); int insertDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto);
int updateDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto); int updateDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto);
Optional<String> selectCheckDsuseLocBydscdmngId(final String dscdmngId);
void updateDsuseLocOfDsuseMgt(final BizNimsRequest.DsuseMgtRsltReq dto);
int updateDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq dto); int updateDsuseMgtRslt(final BizNimsRequest.DsuseMgtRsltReq dto);
int insertDsuseMgtDtl(final BizNimsDto.DsuseMgtDtl dto); int insertDsuseMgtDtl(final BizNimsDto.DsuseMgtDtl dto);

@ -31,10 +31,11 @@ public interface BizNimsService {
// NIMS API CALL // NIMS API CALL
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> getBsshInfoSt(final NimsApiRequest.BsshInfoReq reqDto); ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> getBsshInfoSt(final NimsApiRequest.BsshInfoReq reqDto);
List<NimsApiDto.BsshInfoSt> saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto); List<NimsApiDto.BsshInfoSt> saveBsshInfoStQueryBsshInfoByBsshCd(final NimsApiRequest.BsshInfoReq dto);
List<NimsApiDto.ProductInfoKd> saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo); ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
List<NimsApiDto.ProductInfoKd> saveProductInfoKdQueryProductByProductId(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
ApiBaseResponse<List<NimsApiDto.MnfSeqInfo>> getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto); ApiBaseResponse<List<NimsApiDto.MnfSeqInfo>> getMnfSeqInfo(final NimsApiRequest.MnfSeqInfoReq dto);
List<NimsApiDto.MnfSeqInfo> getMnfSeqInfo2(final NimsApiRequest.MnfSeqInfoReq dto); // List<NimsApiDto.MnfSeqInfo> getMnfSeqInfo2(final NimsApiRequest.MnfSeqInfoReq dto);
List<NimsApiDto.JurisdictionGovInfo> getJurisdictionGovInfo(final NimsApiRequest.JurisdictionGovInfoReq dto); List<NimsApiDto.JurisdictionGovInfo> getJurisdictionGovInfo(final NimsApiRequest.JurisdictionGovInfoReq dto);
List<NimsApiDto.DsuseRptInfo> getNimsDsuseRptInfo(final NimsApiRequest.DsuseRptInfoReq dto); List<NimsApiDto.DsuseRptInfo> getNimsDsuseRptInfo(final NimsApiRequest.DsuseRptInfoReq dto);
@ -42,7 +43,7 @@ public interface BizNimsService {
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS BIZ // NIMS BIZ
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto, final List<BizNimsDto.DsuseMgtDtl> dtls, List<MultipartFile> files); BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List<BizNimsDto.DsuseMgtDtl> dtls, final List<MultipartFile> files, final NimsApiDto.BsshInfoSt bsshInfoSt, final List<NimsApiDto.ProductInfoKdSaveDTO> prdList);
BizNimsRequest.DsuseMgtReceiptReq modifyDsuseMgtReceiptMstInfo(final BizNimsRequest.DsuseMgtReceiptReq reqDto); BizNimsRequest.DsuseMgtReceiptReq modifyDsuseMgtReceiptMstInfo(final BizNimsRequest.DsuseMgtReceiptReq reqDto);

@ -1,32 +1,22 @@
package cokr.xit.adds.biz.nims.web; package cokr.xit.adds.biz.nims.web;
import java.util.List; import java.util.*;
import org.springframework.http.MediaType; import org.springframework.http.*;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.multipart.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import cokr.xit.adds.biz.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.service.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.core.model.*;
import cokr.xit.adds.biz.nims.service.BizNimsService; import cokr.xit.adds.core.util.*;
import cokr.xit.adds.core.model.ApiBaseResponse; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.core.util.XingUtils; import cokr.xit.foundation.data.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto; import io.swagger.v3.oas.annotations.*;
import cokr.xit.adds.inf.nims.model.NimsApiRequest; import io.swagger.v3.oas.annotations.media.*;
import cokr.xit.foundation.data.JSON; import lombok.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import lombok.RequiredArgsConstructor;
/** /**
* <pre> * <pre>
@ -58,7 +48,15 @@ public class BizNimsController {
public ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> getNimsBsshInfoSt( public ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> getNimsBsshInfoSt(
@ModelAttribute NimsApiRequest.BsshInfoReq dto @ModelAttribute NimsApiRequest.BsshInfoReq dto
) { ) {
return ApiBaseResponse.of(bizNimsService.saveBsshInfoSt(dto)); return bizNimsService.getBsshInfoSt(dto);
}
@Operation(summary = "NIMS 마약류 취급자 정보 조회(취급자코드로)", description = "마약류 취급자 정보 조회(취급자코드로)<br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>bc - 취급자식별번호<br>userId - 사용자ID<br><strong>bc 필수</strong>", tags = { "NIMS API" })
@RequestMapping(value = "/saveBsshInfoStQueryBsshInfoByBsshCd", method = { RequestMethod.POST, RequestMethod.GET })
public ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> saveBsshInfoStQueryBsshInfoByBsshCd(
@ModelAttribute NimsApiRequest.BsshInfoReq dto
) {
return ApiBaseResponse.of(bizNimsService.saveBsshInfoStQueryBsshInfoByBsshCd(dto));
} }
@Operation(summary = "NIMS 마약류 제품 조회", description = "마약류 제품 조회<br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br> pn - 제품명<br> dbSkipYn - N:db조회후 결과 없는경우만 API호출, Y:API 호출<br> userId - 사용자ID<br><strong>p, pn중 하나는 필수</strong>", tags = { "NIMS API" }) @Operation(summary = "NIMS 마약류 제품 조회", description = "마약류 제품 조회<br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br> pn - 제품명<br> dbSkipYn - N:db조회후 결과 없는경우만 API호출, Y:API 호출<br> userId - 사용자ID<br><strong>p, pn중 하나는 필수</strong>", tags = { "NIMS API" })
@ -66,7 +64,7 @@ public class BizNimsController {
public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getNimsMnfSeqInfo( public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getNimsMnfSeqInfo(
@ModelAttribute NimsApiRequest.ProductInfoReq dto @ModelAttribute NimsApiRequest.ProductInfoReq dto
) { ) {
return ApiBaseResponse.of(bizNimsService.saveProductInfoKd(dto, false)); return bizNimsService.getProductInfoKd(dto, false);
} }
@Operation(summary = "NIMS 마약류 상품 정보 & 제조번호 조회", description = "마약류 상품정보 & 제조번호 조회<br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br> pn - 제품명<br> dbSkipYn - N:db조회후 결과 없는경우만 API호출, Y:API 호출<br> userId - 사용자ID<br><strong>p, pn중 하나는 필수</strong>", tags = { "NIMS API" }) @Operation(summary = "NIMS 마약류 상품 정보 & 제조번호 조회", description = "마약류 상품정보 & 제조번호 조회<br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br> pn - 제품명<br> dbSkipYn - N:db조회후 결과 없는경우만 API호출, Y:API 호출<br> userId - 사용자ID<br><strong>p, pn중 하나는 필수</strong>", tags = { "NIMS API" })
@ -74,7 +72,7 @@ public class BizNimsController {
public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getNimsProductInfoKdAndMnfSeqInfo( public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getNimsProductInfoKdAndMnfSeqInfo(
@ModelAttribute NimsApiRequest.ProductInfoReq dto @ModelAttribute NimsApiRequest.ProductInfoReq dto
) { ) {
return ApiBaseResponse.of(bizNimsService.saveProductInfoKd(dto, true)); return bizNimsService.getProductInfoKd(dto, true);
} }
@Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회<br>NIMS API 호출 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br>userId - 사용자ID", tags = { "NIMS API" }) @Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회<br>NIMS API 호출 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br>userId - 사용자ID", tags = { "NIMS API" })
@ -85,13 +83,13 @@ public class BizNimsController {
return bizNimsService.getMnfSeqInfo(dto); return bizNimsService.getMnfSeqInfo(dto);
} }
@Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회<br>NIMS API 호출 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br>userId - 사용자ID", tags = { "NIMS API" }) // @Operation(summary = "NIMS 제조 일련 번호 정보 조회", description = "제보 일련 번호 정보 조회<br>NIMS API 호출 결과 Return<br><br><strong>아래 항목만 set</strong><br>p - 제품번호<br>userId - 사용자ID", tags = { "NIMS API" })
@RequestMapping(value = "/getNimsMnfSeqInfo2", method = { RequestMethod.POST, RequestMethod.GET }) // @RequestMapping(value = "/getNimsMnfSeqInfo2", method = { RequestMethod.POST, RequestMethod.GET })
public ApiBaseResponse<List<NimsApiDto.MnfSeqInfo>> getNimsMnfSeqInfo2( // public ApiBaseResponse<List<NimsApiDto.MnfSeqInfo>> getNimsMnfSeqInfo2(
@ModelAttribute NimsApiRequest.MnfSeqInfoReq dto // @ModelAttribute NimsApiRequest.MnfSeqInfoReq dto
) { // ) {
return ApiBaseResponse.of(bizNimsService.getMnfSeqInfo2(dto)); // return ApiBaseResponse.of(bizNimsService.getMnfSeqInfo2(dto));
} // }
@Operation(summary = "NIMS 관할 허가 관청 정보 조회", description = "관할 허가 관청 정보 조회<br><br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>onm - 기관명<br>ocd - 기관코드<br>adr - 주소<br>dbSkipYn - N : db조회후 결과 없는경우만 API호출, Y : API 호출<br>userId - 사용자ID<br><strong>onm, ocd, adr중 하나는 필수</strong>", tags = { "NIMS API" }) @Operation(summary = "NIMS 관할 허가 관청 정보 조회", description = "관할 허가 관청 정보 조회<br><br>NIMS API 호출 결과를 DB에 저장후 결과 Return<br><br><strong>아래 항목만 set</strong><br>onm - 기관명<br>ocd - 기관코드<br>adr - 주소<br>dbSkipYn - N : db조회후 결과 없는경우만 API호출, Y : API 호출<br>userId - 사용자ID<br><strong>onm, ocd, adr중 하나는 필수</strong>", tags = { "NIMS API" })
@RequestMapping(value = "/getNimsJurisdictionGovInfo", method = { RequestMethod.POST, RequestMethod.GET }) @RequestMapping(value = "/getNimsJurisdictionGovInfo", method = { RequestMethod.POST, RequestMethod.GET })
@ -128,9 +126,11 @@ public class BizNimsController {
@RequestParam(value = "dsusePrdImgFiles", required = false) List<MultipartFile> dsusePrdImgFiles @RequestParam(value = "dsusePrdImgFiles", required = false) List<MultipartFile> dsusePrdImgFiles
) { ) {
JSON json = new JSON(); JSON json = new JSON();
NimsApiDto.BsshInfoSt bsshInfoSt = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
BizNimsRequest.DsuseMgtReceiptReq receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {}); BizNimsRequest.DsuseMgtReceiptReq receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
List<NimsApiDto.ProductInfoKdSaveDTO> productInfoKds = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
List<BizNimsDto.DsuseMgtDtl> dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {}); List<BizNimsDto.DsuseMgtDtl> dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles)); return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles, bsshInfoSt, productInfoKds));
} }
@Operation(summary = "사고 마약류 폐기 관리 폐기 신청서 마스터 정보 변경", description = "사고 마약류 폐기 관리 폐기 신청서 접수 마스터 정보 변경", tags = { "BIZ API" }) @Operation(summary = "사고 마약류 폐기 관리 폐기 신청서 마스터 정보 변경", description = "사고 마약류 폐기 관리 폐기 신청서 접수 마스터 정보 변경", tags = { "BIZ API" })

@ -1,59 +1,32 @@
package cokr.xit.adds.inf.mois.service.bean; package cokr.xit.adds.inf.mois.service.bean;
import java.io.File; import java.io.*;
import java.io.FileNotFoundException; import java.nio.file.*;
import java.io.FileOutputStream; import java.nio.file.attribute.*;
import java.io.IOException; import java.util.*;
import java.io.PrintWriter;
import java.io.StringReader; import javax.xml.parsers.*;
import java.io.UnsupportedEncodingException; import javax.xml.transform.*;
import java.nio.file.FileVisitResult; import javax.xml.transform.dom.*;
import java.nio.file.Files; import javax.xml.transform.stream.*;
import java.nio.file.Path;
import java.nio.file.Paths; import org.apache.commons.lang3.*;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.*;
import org.w3c.dom.Attr; import org.w3c.dom.*;
import org.w3c.dom.DOMException; import org.xml.sax.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element; import cokr.xit.adds.biz.nims.service.*;
import org.w3c.dom.Node; import cokr.xit.adds.core.*;
import org.w3c.dom.NodeList; import cokr.xit.adds.core.spring.exception.*;
import org.xml.sax.InputSource; import cokr.xit.adds.core.util.*;
import org.xml.sax.SAXException; import cokr.xit.adds.inf.mois.model.*;
import cokr.xit.adds.inf.mois.service.*;
import cokr.xit.adds.biz.nims.service.BizNimsService; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.core.Constants; import cokr.xit.foundation.component.*;
import cokr.xit.adds.core.spring.exception.ApiCustomException; import lombok.*;
import cokr.xit.adds.core.util.DateUtils; import lombok.extern.slf4j.*;
import cokr.xit.adds.inf.mois.model.MoisExchangeRequest;
import cokr.xit.adds.inf.mois.model.PackDto;
import cokr.xit.adds.inf.mois.service.InfMoisService;
import cokr.xit.adds.inf.nims.model.NimsApiDto;
import cokr.xit.adds.inf.nims.model.NimsApiRequest;
import cokr.xit.foundation.component.AbstractServiceBean;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
@ -343,7 +316,7 @@ public class InfMoisServiceBean extends AbstractServiceBean implements InfMoisSe
} }
private NimsApiDto.BsshInfoSt getBsshInfo(MoisExchangeRequest reqDto) { private NimsApiDto.BsshInfoSt getBsshInfo(MoisExchangeRequest reqDto) {
List<NimsApiDto.BsshInfoSt> list = bizNimsService.saveBsshInfoSt( List<NimsApiDto.BsshInfoSt> list = bizNimsService.saveBsshInfoStQueryBsshInfoByBsshCd(
NimsApiRequest.BsshInfoReq.builder() NimsApiRequest.BsshInfoReq.builder()
.fg("1") .fg("1")
.pg("1") .pg("1")

@ -1,30 +1,21 @@
package cokr.xit.adds.inf.nims.model; package cokr.xit.adds.inf.nims.model;
import java.io.IOException; import java.io.*;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects; import javax.validation.*;
import javax.validation.Valid; import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.*;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer; import cokr.xit.adds.biz.nims.model.*;
import com.fasterxml.jackson.databind.SerializerProvider; import cokr.xit.adds.core.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import cokr.xit.adds.core.model.*;
import cokr.xit.adds.core.spring.exception.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import lombok.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import lombok.experimental.*;
import cokr.xit.adds.core.Constants;
import cokr.xit.adds.core.model.AuditDto;
import cokr.xit.adds.core.spring.exception.ApiCustomException;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
/** /**
* <pre> * <pre>
@ -210,6 +201,88 @@ public class NimsApiDto {
private List<NimsApiDto.MnfSeqInfo> mnfSeqInfos = new ArrayList<>(); private List<NimsApiDto.MnfSeqInfo> mnfSeqInfos = new ArrayList<>();
} }
/**
* DTO
*/
@Getter
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public static class ProductInfoKdSaveDTO extends AuditDto {
/**
*
*/
@JsonAlias("PRDUCT_CD")
private String prductCd;
/**
*
*/
@JsonAlias("PRDLST_MST_CD")
private String prdlstMstCd;
/**
*
*/
@JsonAlias("PRDUCT_NM")
private String prductNm;
/**
* /
*/
@JsonAlias("NRCD_SE_NM")
private String nrcdSeNm;
/**
* /
*/
@JsonAlias("PRTM_SE_NM")
private String prtmSeNm;
/**
*
* ( = 1)
*/
@JsonAlias("minDistbQy")
private Integer prdMinDistbQy;
/**
*
*/
@JsonAlias("minDistbUnit")
private String stdPackngStleNm;
/**
*
*/
@JsonAlias("pceQy")
private Integer prdTotPceQy;
/**
*
*/
@JsonAlias("pceUnit")
private String pceCoUnitNm;
/**
*
*/
@JsonAlias("BSSH_CD")
private String bsshCd;
/**
*
*/
@JsonAlias("RGS_DT")
private String rgsDt;
/**
*
*/
@JsonAlias("UPD_DT")
private String updDt;;
}
/** /**
* response * response
*/ */
@ -497,9 +570,10 @@ public class NimsApiDto {
&& Objects.equals( && Objects.equals(
Objects.toString(rptDtl.getPrdValidDe(), "").replaceAll("-", ""), Objects.toString(rptDtl.getPrdValidDe(), "").replaceAll("-", ""),
Objects.toString(mgtDtl.getPrdValidDe(), "").replaceAll("-", "")) Objects.toString(mgtDtl.getPrdValidDe(), "").replaceAll("-", ""))
&& Objects.equals( // FIXME:: NIMS 데이타 일치여부 체크 - 제조번호 제외
Objects.toString(rptDtl.getMnfSeq(), "").replaceAll("-", ""), // && Objects.equals(
Objects.toString(mgtDtl.getMnfSeq(), "").replaceAll("-", "")) // Objects.toString(rptDtl.getMnfSeq(), "").replaceAll("-", ""),
// Objects.toString(mgtDtl.getMnfSeq(), "").replaceAll("-", ""))
&& Objects.equals(rptDtl.getDsuseQy(), mgtDtl.getDsuseQy())) { && Objects.equals(rptDtl.getDsuseQy(), mgtDtl.getDsuseQy())) {
rptDtl.setMatchYn("Y"); rptDtl.setMatchYn("Y");
break; break;
@ -678,4 +752,3 @@ public class NimsApiDto {
private String bassDtlAdres; private String bassDtlAdres;
} }
} }

@ -2,17 +2,13 @@ package cokr.xit.adds.inf.nims.model;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*; import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.*;
import javax.validation.constraints.Pattern;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.*;
import cokr.xit.adds.core.Constants; import cokr.xit.adds.core.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.*;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* <pre> * <pre>
@ -114,9 +110,9 @@ public class NimsApiRequest {
* true DB skip * true DB skip
* </pre> * </pre>
*/ */
@Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N") // @Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N")
@Builder.Default // @Builder.Default
private String dbSkipYn = "N"; // private String dbSkipYn = "N";
/** /**
* <pre> * <pre>
@ -198,15 +194,11 @@ public class NimsApiRequest {
/** /**
* <pre> * <pre>
* DB skip *
* DB NIMS API
* true DB skip
*
* </pre> * </pre>
*/ */
@Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N") @Schema(title = "마약류취급자번호", description = "마약류취급자번호", example = " ")
@Builder.Default private String bc;
private String dbSkipYn = "N";
/** /**
* <pre> * <pre>
@ -384,11 +376,17 @@ public class NimsApiRequest {
@Pattern(regexp = "^$|[A-Z0-9]{1,}", message = "번호는 영숫자(A~Z, 0~9)만 입력가능합니다") @Pattern(regexp = "^$|[A-Z0-9]{1,}", message = "번호는 영숫자(A~Z, 0~9)만 입력가능합니다")
private String t = StringUtils.EMPTY; private String t = StringUtils.EMPTY;
/**
*
*/
@Schema(title = "마약류 취급자 식별 번호", description = "마약류 취급자 식별 번호", example = " ")
private String bc;
/** /**
* *
*/ */
@Schema(title = "유효기간", description = "유효기간", example = " ") @Schema(title = "유효기간", description = "유효기간", example = " ")
private String prdValidDe; private String vd;
/** /**
* <pre> * <pre>

@ -1,23 +1,20 @@
package cokr.xit.adds.inf.nims.service.bean; package cokr.xit.adds.inf.nims.service.bean;
import javax.validation.Validation; import javax.validation.*;
import javax.validation.Validator;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.*;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.*;
import cokr.xit.adds.core.spring.exception.ApiCustomException; import cokr.xit.adds.core.spring.exception.*;
import cokr.xit.adds.core.util.ApiUtil; import cokr.xit.adds.core.util.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.inf.nims.model.NimsApiRequest; import cokr.xit.adds.inf.nims.service.*;
import cokr.xit.adds.inf.nims.model.NimsApiResult; import cokr.xit.foundation.component.*;
import cokr.xit.adds.inf.nims.service.InfNimsService; import cokr.xit.foundation.data.*;
import cokr.xit.foundation.component.AbstractServiceBean; import lombok.*;
import cokr.xit.foundation.data.JSON; import lombok.extern.slf4j.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
@ -57,7 +54,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
private String productinfoKd; private String productinfoKd;
/** /**
* API URL * API URL
*/ */
@Value("${app.inf.nims.api.seqinfo}") @Value("${app.inf.nims.api.seqinfo}")
private String seqinfo; private String seqinfo;
@ -95,13 +92,18 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
ApiUtil.validate(dto, null, validator); ApiUtil.validate(dto, null, validator);
if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null); if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
//FIXME: 운영기 반영 이후 주석 제거
String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto); String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
NimsApiResult<NimsApiDto.ProductInfoKd> result = json.parse(rslt, new TypeReference<>() {}); NimsApiResult<NimsApiDto.ProductInfoKd> result = json.parse(rslt, new TypeReference<>() {});
return result.getResponse(); return result.getResponse();
} }
/**
* API URL
* @param dto NimsApiRequest.MnfSeqInfoReq
* @return NimsApiResult.Response<NimsApiDto.MnfSeqInfo>
*/
@Override @Override
//@TraceLogging
public NimsApiResult.Response<NimsApiDto.MnfSeqInfo> getMnfSeqInfo(NimsApiRequest.MnfSeqInfoReq dto) { public NimsApiResult.Response<NimsApiDto.MnfSeqInfo> getMnfSeqInfo(NimsApiRequest.MnfSeqInfoReq dto) {
ApiUtil.validate(dto, null, validator); ApiUtil.validate(dto, null, validator);
if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null); if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);

@ -52,7 +52,7 @@ public class InfNimsController {
return ApiBaseResponse.of(infNimsService.getProductInfoKd(dto)); return ApiBaseResponse.of(infNimsService.getProductInfoKd(dto));
} }
@Operation(summary = "제조 일련 번호 정보 조회", description = "제조 일련 번호 정보 조회") @Operation(summary = "제조 일련 번호 정보 조회(업체별)", description = "제조 일련 번호 정보 조회(업체별)")
@PostMapping("/getMnfSeqInfo") @PostMapping("/getMnfSeqInfo")
public ApiBaseResponse<NimsApiResult.Response<NimsApiDto.MnfSeqInfo>> getMnfSeqInfo( public ApiBaseResponse<NimsApiResult.Response<NimsApiDto.MnfSeqInfo>> getMnfSeqInfo(
@RequestBody NimsApiRequest.MnfSeqInfoReq dto @RequestBody NimsApiRequest.MnfSeqInfoReq dto

@ -4,7 +4,7 @@ app:
api: api:
bsshinfoStV1: /api/bsshinfo_st_v1.do bsshinfoStV1: /api/bsshinfo_st_v1.do
productinfoKd: /api/productinfo_kd.do productinfoKd: /api/productinfo_kd.do
seqinfo: /api/seqinfo.do seqinfo: /api/seqinfo_pub.do
officeinfo: /api/officeinfo.do officeinfo: /api/officeinfo.do
placeinfoV1: /api/placeinfo_v1.do placeinfoV1: /api/placeinfo_v1.do
dsuseresult: /api/dsuseresult.do dsuseresult: /api/dsuseresult.do

@ -44,21 +44,21 @@
) )
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
bssh_nm = #{bsshNm}, /* 마약류취급자명 */ bssh_nm = #{bsshNm}, /* 마약류취급자명 */
induty_nm = #{indutyNm}, /* 업종명 */ bizrno = #{bizrno}, /* 사업자등록번호 */
hdnt_cd = #{hdntCd}, /* 의료업자구분 */ rprsntv_nm = #{rprsntvNm}, /* 대표자명 */
hdnt_nm = #{hdntNm}, /* 의료업자구분명 */ prmisn_no = #{prmisnNo}, /* 허가번호 */
bizrno = #{bizrno}, /* 사업자등록번호 */ induty_nm = CASE WHEN induty_nm != IFNULL(#{indutyNm}, '') AND IFNULL(#{indutyNm}, '') != '' THEN #{indutyNm} ELSE induty_nm END, /* 업종명 */
rprsntv_nm = #{rprsntvNm}, /* 대표자명 */ hdnt_cd = CASE WHEN hdnt_cd != IFNULL(#{hdntCd}, '') AND IFNULL(#{hdntCd}, '') != '' THEN #{hdntCd} ELSE hdnt_cd END, /* 의료업자구분 */
chrg_nm = #{chrgNm}, /* 담당자명 */ hdnt_nm = CASE WHEN hdnt_nm != IFNULL(#{hdntNm}, '') AND IFNULL(#{hdntNm}, '') != '' THEN #{hdntNm} ELSE hdnt_nm END, /* 의료업자구분명 */
hptl_no = #{hptlNo}, /* 요약기관번호 */ chrg_nm = CASE WHEN chrg_nm != IFNULL(#{chrgNm}, '') AND IFNULL(#{chrgNm}, '') != '' THEN #{chrgNm} ELSE chrg_nm END, /* 담당자명 */
join_yn = #{joinYn}, /* 가입여부 */ hptl_no = CASE WHEN hptl_no != IFNULL(#{hptlNo}, '') AND IFNULL(#{hptlNo}, '') != '' THEN #{hptlNo} ELSE hptl_no END, /* 요약기관번호 */
bssh_stts_nm = #{bsshSttusNm}, /* 마약류취급자상태명 */ join_yn = CASE WHEN join_yn != IFNULL(#{joinYn}, '') AND IFNULL(#{joinYn}, '') != '' THEN #{joinYn} ELSE join_yn END, /* 가입여부 */
prmisn_no = #{prmisnNo}, /* 허가번호 */ bssh_stts_nm = CASE WHEN bssh_stts_nm != IFNULL(#{bsshSttusNm}, '') AND IFNULL(#{bsshSttusNm}, '') != '' THEN #{bsshSttusNm} ELSE bssh_stts_nm END, /* 마약류취급자상태명 */
mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'), mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
mdfr = #{rgtr} mdfr = #{rgtr}
</insert> </insert>
<insert id="mergeProductInfoKd" parameterType="cokr.xit.adds.inf.nims.model.NimsApiDto$ProductInfoKd"> <insert id="mergeProductInfoKd">
/** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim */ /** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim */
INSERT INTO tb_prduct_info( INSERT INTO tb_prduct_info(
prduct_cd, /* 제품코드 */ prduct_cd, /* 제품코드 */
@ -87,24 +87,24 @@
#{prdTotPceQy}, #{prdTotPceQy},
#{pceCoUnitNm}, #{pceCoUnitNm},
#{bsshCd}, #{bsshCd},
#{rgsDt}, NULLIF(#{rgsDt}, ''),
#{updDt}, NULLIF(#{updDt}, ''),
'Y', 'Y',
DATE_FORMAT(now(), '%Y%m%d%H%i%s'), DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
#{rgtr} #{rgtr}
) )
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
prdlst_mst_cd = #{prdlstMstCd}, /* 제품대표코드 */
prduct_nm = #{prductNm}, /* 제품명 */ prduct_nm = #{prductNm}, /* 제품명 */
nrcd_se_nm = #{nrcdSeNm}, /* 마약항정구분 */
prtm_se_nm = #{prtmSeNm}, /* 중점일반구분 */
prd_min_distb_qy = #{prdMinDistbQy}, /* 최소유통단위수량 - 제품규격정보(고정값=1) */ prd_min_distb_qy = #{prdMinDistbQy}, /* 최소유통단위수량 - 제품규격정보(고정값=1) */
std_packng_stle_nm = #{stdPackngStleNm}, /* 제품최소유통단위 */ std_packng_stle_nm = #{stdPackngStleNm}, /* 제품최소유통단위 */
prd_tot_pce_qy = #{prdTotPceQy}, /* 제품총낱개단위수량 */ prd_tot_pce_qy = #{prdTotPceQy}, /* 제품총낱개단위수량 */
pce_co_unit_nm = #{pceCoUnitNm}, /* 제품낱개단위 */ pce_co_unit_nm = #{pceCoUnitNm}, /* 제품낱개단위 */
bssh_cd = #{bsshCd}, /* 마약류취급자식별번호 */ prdlst_mst_cd = CASE WHEN prdlst_mst_cd != IFNULL(#{prdlstMstCd}, '') AND IFNULL(#{prdlstMstCd}, '') != '' THEN #{prdlstMstCd} ELSE prdlst_mst_cd END, /* 제품대표코드 */
rgs_dt = #{rgsDt}, /* 등록일 */ nrcd_se_nm = CASE WHEN nrcd_se_nm != IFNULL(#{nrcdSeNm}, '') AND IFNULL(#{nrcdSeNm}, '') != '' THEN #{nrcdSeNm} ELSE nrcd_se_nm END, /* 마약항정구분 */
upd_dt = #{updDt}, /* 변경일 */ prtm_se_nm = CASE WHEN prtm_se_nm != IFNULL(#{prtmSeNm}, '') AND IFNULL(#{prtmSeNm}, '') != '' THEN #{prtmSeNm} ELSE prtm_se_nm END, /* 중점일반구분 */
bssh_cd = CASE WHEN bssh_cd != IFNULL(#{bsshCd}, '') AND IFNULL(#{bsshCd}, '') != '' THEN #{bsshCd} ELSE bssh_cd END, /* 마약류취급자식별번호 */
rgs_dt = CASE WHEN rgs_dt != NULLIF(#{rgsDt}, '') AND IFNULL(#{rgsDt}, '') != '' THEN NULLIF(#{rgsDt}, '') ELSE rgs_dt END, /* 등록일 */
upd_dt = CASE WHEN upd_dt != NULLIF(#{updDt}, '') AND IFNULL(#{updDt}, '') != '' THEN NULLIF(#{updDt}, '') ELSE upd_dt END, /* 변경일 */
mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'), mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
mdfr = #{rgtr} mdfr = #{rgtr}
</insert> </insert>
@ -295,6 +295,28 @@
WHERE dscdmng_id = #{dscdmngId} WHERE dscdmng_id = #{dscdmngId}
</update> </update>
<select id="selectCheckDsuseLocBydscdmngId" parameterType="string" resultType="string">
/** nims-mysql-mapper|selectCheckDsuseLocBydscdmngId-폐기관리 결과의 폐기장소 조회|julim */
SELECT dsuse_loc
FROM tb_dsuse_mgt
WHERE dscdmng_id = #{dscdmngId}
</select>
<update id="updateDsuseLocOfDsuseMgt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgtRsltReq">
/** nims-mysql-mapper|updateDsuseLocOfDsuseMgt-폐기관리 결과의 폐기장소 변경|julim */
UPDATE tb_dsuse_mgt
SET dsuse_loc = #{dsuseLoc}
, mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s')
, mdfr = #{rgtr}
WHERE use_yn = 'Y'
AND dept_cd = (SELECT dept_cd FROM tb_user WHERE user_acnt = #{userId})
AND dsuse_mth_cd = #{dsuseMthCd}
AND dsuse_se_cd = #{dsuseSeCd}
AND dsuse_de = #{dsuseDe}
AND tb_dsuse_mgt.dscdmng_id != #{dscdmngId}
</update>
<update id="updateDsuseMgtRslt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgtRsltReq"> <update id="updateDsuseMgtRslt" parameterType="cokr.xit.adds.biz.nims.model.BizNimsRequest$DsuseMgtRsltReq">
/** nims-mysql-mapper|updateDsuseMgtRslt-폐기관리 정보 변경|julim */ /** nims-mysql-mapper|updateDsuseMgtRslt-폐기관리 정보 변경|julim */
UPDATE tb_dsuse_mgt UPDATE tb_dsuse_mgt

Loading…
Cancel
Save