feat: 업체조회(페이징 처리) 반영

제품조회(페이징 처리) 반영
      업체 및 제품 조회시 DB 저장 제거
main
Jonguk. Lim 4 weeks ago
parent 4b00bc7c58
commit ebbf803a1e

@ -31,7 +31,7 @@ public interface BizNimsMapper extends AbstractMapper {
void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto);
List<NimsApiDto.BsshInfoSt> selectBsshInfos(final NimsApiRequest.BsshInfoReq dto);
void mergeProductInfoKd(final NimsApiDto.ProductInfoKdSaveDTO dto);
<T> void mergeProductInfoKd(final T t);
List<NimsApiDto.ProductInfoKd> selectProductInfos(final NimsApiRequest.ProductInfoReq dto);
void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto);

@ -28,8 +28,9 @@ public interface BizNimsService {
// NIMS API CALL
//------------------------------------------------------------------------------------------------------
ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> getBsshInfoSt(final NimsApiRequest.BsshInfoReq reqDto);
List<NimsApiDto.BsshInfoSt> saveBsshInfoSt(final NimsApiRequest.BsshInfoReq dto);
List<NimsApiDto.ProductInfoKd> saveProductInfoKd(final NimsApiRequest.ProductInfoReq dto, boolean isMnfSeqInfo);
List<NimsApiDto.BsshInfoSt> saveBsshInfoStQueryBsshInfoByBsshCd(final NimsApiRequest.BsshInfoReq dto);
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);
// List<NimsApiDto.MnfSeqInfo> getMnfSeqInfo2(final NimsApiRequest.MnfSeqInfoReq dto);
List<NimsApiDto.JurisdictionGovInfo> getJurisdictionGovInfo(final NimsApiRequest.JurisdictionGovInfoReq dto);

@ -67,75 +67,56 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
// DB 조회
List<BsshInfoSt> list = new ArrayList<>();
// if("N".equals(reqDto.getDbSkipYn())) {
// list = bizNimsMapper.selectBsshInfos(reqDto);
// if (!isEmpty(list)){
// //return list;
// ApiBaseResponse<List<BsshInfoSt>> res = ApiBaseResponse.of(list);
// res.setTotalCount(list.size());
// return res;
// }
// }
if(isEmpty(reqDto.getK())){
reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
}
reqDto.setFg("1"); // 조회범위(1-전체,2-내거래처)
//reqDto.setPg("1"); // 조회페이지
reqDto.setFg2("1"); // 조회범위2(1:NK(취급승인)포함 - default, 2:NK(취급승인)제외)
boolean isRprsntvNm = !isEmpty(reqDto.getRprsntvNm());//while(true) {
int totalCount = 0;
do {
// 마약류취급자식별번호로 마약류취급자정보 조회
NimsApiResult.Response<BsshInfoSt> rslt = infNimsService.getBsshInfoSt(reqDto);
List<BsshInfoSt> curList = rslt.getResult();
// 마약류취급자식별번호로 마약류취급자정보 조회
NimsApiResult.Response<BsshInfoSt> rslt = infNimsService.getBsshInfoSt(reqDto);
List<BsshInfoSt> curList = rslt.getResult();
for (BsshInfoSt d : curList) {
if(isEmpty(d.getBsshCd())) continue;
d.setRgtr(reqDto.getUserId());
bizNimsMapper.mergeBsshInfoSt(d);
// 대표자 검색조건이 있는 경우
if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
list.add(d);
if (!isRprsntvNm) {
totalCount = rslt.getBody().getTotalCount();
list.addAll(curList);
break;
}
}
if (!isRprsntvNm){
list.addAll(curList);
}
// 대표자 검색이 있는 경우 NIMS 데이타 전체 조회
list.addAll(
curList.stream()
.filter(d -> !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm()))
.toList());
totalCount = list.size();
if(rslt.isEndYn()) break;
reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1));
} while(true);
ApiBaseResponse<List<BsshInfoSt>> res = ApiBaseResponse.of(list);
res.setTotalCount(list.size());
res.setTotalCount(totalCount);
return res;
}
/**
* <pre>
* DB (dbSkipYn = 'Y' DB skip)
* -> API
* DB
* - (3 )
* DB
* -
* @param reqDto NimsApiRequest.BsshInfoRequest
* @return List<NimsApiDto.BsshInfoSt>
* </pre>
*/
@Override
public List<BsshInfoSt> saveBsshInfoSt(BsshInfoReq reqDto) {
public List<BsshInfoSt> saveBsshInfoStQueryBsshInfoByBsshCd(BsshInfoReq reqDto) {
if(isEmpty(reqDto.getBc()) && isEmpty(reqDto.getBi()) && isEmpty(reqDto.getBn())){
throw ApiCustomException.create("업체[사업자] 번호 또는 명, 사업자등록번호 중 하나는 필수 입니다");
}
if(!isEmpty(reqDto.getBn()) && reqDto.getBn().length() < 3) {
throw ApiCustomException.create("업체[사업자]명은 3자 이상 으로 조회해 주세요");
}
// DB 조회
List<BsshInfoSt> list = new ArrayList<>();
// FIXME: API 적용 - db 조회 skip
// if("N".equals(reqDto.getDbSkipYn())) {
// list = bizNimsMapper.selectBsshInfos(reqDto);
// if (!isEmpty(list)) return list;
// }
if(isEmpty(reqDto.getK())){
reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
@ -144,38 +125,44 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
reqDto.setPg("1"); // 조회페이지
reqDto.setFg2("1"); // 조회범위2(1:NK(취급승인)포함 - default, 2:NK(취급승인)제외)
boolean isRprsntvNm = !isEmpty(reqDto.getRprsntvNm());
while(true) {
// 마약류취급자식별번호로 마약류취급자정보 조회
NimsApiResult.Response<BsshInfoSt> rslt = infNimsService.getBsshInfoSt(reqDto);
List<BsshInfoSt> curList = rslt.getResult();
// 마약류취급자식별번호로 마약류취급자정보 조회
NimsApiResult.Response<BsshInfoSt> rslt = infNimsService.getBsshInfoSt(reqDto);
List<BsshInfoSt> curList = rslt.getResult();
if (isEmpty(curList))
break;
for (BsshInfoSt d : curList) {
d.setRgtr(reqDto.getUserId());
bizNimsMapper.mergeBsshInfoSt(d);
}
return curList;
}
// FIXME: API 적용 - db 저장 skip
// for (BsshInfoSt d : curList) {
// d.setRgtr(reqDto.getUserId());
// bizNimsMapper.mergeBsshInfoSt(d);
// // 대표자 검색조건이 있는 경우
// if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
// list.add(d);
// }
// }
if (!isRprsntvNm){
list.addAll(curList);
}else{
list.addAll(
curList.stream()
.filter(d -> !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm()))
.toList());
}
@Override
public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getProductInfoKd(NimsApiRequest.ProductInfoReq reqDto, boolean isMnfSeqInfo) {
if(isEmpty(reqDto.getP()) && isEmpty(reqDto.getPn())){
throw ApiCustomException.create("상품번호 또는 상품명중 하나는 필수 입니다");
}
if(rslt.isEndYn()) break;
reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1));
if(!isEmpty(reqDto.getPn()) && reqDto.getPn().length() < 2){
throw ApiCustomException.create("상품명은 2자 이상 으로 조회해 주세요");
}
return list;
if(isEmpty(reqDto.getK())){
reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
}
reqDto.setFg("1"); // 조회범위(1-전체,2-내거래처품목,3-청구코드매핑)
reqDto.setFg2(""); // 중점일반구분(all, 1:중점, 2:일반)
// 제품코드로 제품정보 조회
NimsApiResult.Response<NimsApiDto.ProductInfoKd> rslt = infNimsService.getProductInfoKd(reqDto);
List<NimsApiDto.ProductInfoKd> curList = rslt.getResult();
if(isEmpty(curList)) return ApiBaseResponse.of(curList);
// 제조 번호, 일련번호, 유효기간 정보 목록 추가
if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK());
ApiBaseResponse<List<ProductInfoKd>> res = ApiBaseResponse.of(curList);
res.setTotalCount(rslt.getBody().getTotalCount());
return res;
}
/**
@ -191,7 +178,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* </pre>
*/
@Override
public List<NimsApiDto.ProductInfoKd> saveProductInfoKd(NimsApiRequest.ProductInfoReq reqDto, boolean isMnfSeqInfo) {
public List<NimsApiDto.ProductInfoKd> saveProductInfoKdQueryProductByProductId(NimsApiRequest.ProductInfoReq reqDto, boolean isMnfSeqInfo) {
if(isEmpty(reqDto.getP()) && isEmpty(reqDto.getPn())){
throw ApiCustomException.create("상품번호 또는 상품명중 하나는 필수 입니다");
}
@ -200,25 +187,6 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
throw ApiCustomException.create("상품명은 2자 이상 으로 조회해 주세요");
}
List<NimsApiDto.ProductInfoKd> list = new ArrayList<>();
////////////////////////////////////////////////////////////////////////////////////////
// FIXME: 신규 API 적용 - DB 조회 skip 처리
// if("N".equals(reqDto.getDbSkipYn())) {
// list = bizNimsMapper.selectProductInfos(reqDto);
// if (!isEmpty(list)){
// if(isMnfSeqInfo){
// if(isEmpty(reqDto.getK())){
// productInfoaddMnfSeqs(list, reqDto.getBc(), getApiInfInfo(reqDto.getUserId()).get("apiKey"));
// }else {
// productInfoaddMnfSeqs(list, reqDto.getBc(), reqDto.getK());
// }
// }
// return list;
// }
// }
///////////////////////////////////////////////////////////////
if(isEmpty(reqDto.getK())){
reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
}
@ -226,27 +194,21 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
reqDto.setPg("1"); // 조회페이지
reqDto.setFg2(""); // 중점일반구분(all, 1:중점, 2:일반)
while(true) {
// 제품코드로 제품정보 조회
NimsApiResult.Response<NimsApiDto.ProductInfoKd> rslt = infNimsService.getProductInfoKd(reqDto);
List<NimsApiDto.ProductInfoKd> curList = rslt.getResult();
if(isEmpty(curList)) break;
// 제품코드로 제품정보 조회
NimsApiResult.Response<NimsApiDto.ProductInfoKd> rslt = infNimsService.getProductInfoKd(reqDto);
List<NimsApiDto.ProductInfoKd> curList = rslt.getResult();
// FIXME: 신규 API 적용 - 조회 결과 저장 skip
// for (NimsApiDto.ProductInfoKd d : curList) {
// d.setRgtr(reqDto.getUserId());
// bizNimsMapper.mergeProductInfoKd(d);
// }
if(isEmpty(curList)) return curList;
// 제조 번호, 일련번호, 유효기간 정보 목록 추가
if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK());
list.addAll(curList);
if(rslt.isEndYn()) break;
reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1));
//FIXME: 신규 API 적용 - 조회 결과 저장 skip
for (NimsApiDto.ProductInfoKd d : curList) {
d.setRgtr(reqDto.getUserId());
bizNimsMapper.mergeProductInfoKd(d);
}
return list;
// 제조 번호, 일련번호, 유효기간 정보 목록 추가
if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK());
return curList;
}
@Override
@ -453,7 +415,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
Map<String, String> map = new HashMap<>();
map.put("dscdmngId", dto.getDscdmngId());
List<BizNimsResponse.DsuseMgtDtlRes> dsuseRptInfoDtls = bizNimsMapper.selectDsuseMgtDtls(map);
if(isForDoc) setDsuseMgtDtlAddProductInfo(dsuseRptInfoDtls, dto.getBsshCd(), reqDto.getUserId(), apiKey);
if(isForDoc) setDsuseMgtDtlAddProductInfo(dsuseRptInfoDtls, reqDto.getUserId(), apiKey);
dto.getDsuseMgtDtls().addAll(dsuseRptInfoDtls);
}
@ -577,7 +539,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
.p(mnfSeqInfo.getPrductCd())
.userId(userId)
.build();
List<NimsApiDto.ProductInfoKd> productInfoKds = saveProductInfoKd(prdReq, false);
List<NimsApiDto.ProductInfoKd> productInfoKds = saveProductInfoKdQueryProductByProductId(prdReq, false);
if(productInfoKds.size() != 1) {
throw ApiCustomException.create(String.format("제품정보 오류<br>[Barcode 제품[%s]의 정보가 NIMS에 등록되지 않은 데이타 입니다]", mnfSeqInfo.getPrductCd()));
}
@ -619,13 +581,12 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* @param dtlList <NimsApiDto.DsuseRptInfoDtl>
* </pre>
*/
private void setDsuseMgtDtlAddProductInfo(List<BizNimsResponse.DsuseMgtDtlRes> dtlList, String bsshCd, String userId, String apiKey) {
private void setDsuseMgtDtlAddProductInfo(List<BizNimsResponse.DsuseMgtDtlRes> dtlList, String userId, String apiKey) {
for (BizNimsResponse.DsuseMgtDtlRes r : dtlList) {
// 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm)
if (isEmpty(r.getNrcdSeNm()) || isEmpty(r.getPrtmSeNm())) {
//NimsApiResult.Response<NimsApiDto.ProductInfoKd> result = infNimsService.getProductInfoKd(
List<NimsApiDto.ProductInfoKd> list = saveProductInfoKd(
List<NimsApiDto.ProductInfoKd> list = saveProductInfoKdQueryProductByProductId(
NimsApiRequest.ProductInfoReq.builder()
.k(apiKey)
.fg("1")
@ -646,7 +607,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
// 제조수입자명(bsshNm)
if (isEmpty(r.getBsshNm()) && !isEmpty(r.getBsshCd())) {
List<BsshInfoSt> list = saveBsshInfoSt(
List<BsshInfoSt> list = saveBsshInfoStQueryBsshInfoByBsshCd(
BsshInfoReq.builder()
.k(apiKey)
.fg("1")
@ -916,7 +877,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
for (NimsApiDto.ProductInfoKd d : list) {
productCd = d.getPrductCd();
List<NimsApiDto.MnfSeqInfo> mnfList = getMnfSeqInfo2(
List<NimsApiDto.MnfSeqInfo> mnfList = getMnfSeqInfoAll(
NimsApiRequest.MnfSeqInfoReq.builder()
.k(apiKey)
.fg("1")
@ -1008,7 +969,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
return files.get(0).getId();
}
private List<NimsApiDto.MnfSeqInfo> getMnfSeqInfo2(NimsApiRequest.MnfSeqInfoReq reqDto) {
private List<NimsApiDto.MnfSeqInfo> getMnfSeqInfoAll(NimsApiRequest.MnfSeqInfoReq reqDto) {
if(isEmpty(reqDto.getK())){
reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
}

@ -48,7 +48,15 @@ public class BizNimsController {
public ApiBaseResponse<List<NimsApiDto.BsshInfoSt>> getNimsBsshInfoSt(
@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" })
@ -56,7 +64,7 @@ public class BizNimsController {
public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getNimsMnfSeqInfo(
@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" })
@ -64,7 +72,7 @@ public class BizNimsController {
public ApiBaseResponse<List<NimsApiDto.ProductInfoKd>> getNimsProductInfoKdAndMnfSeqInfo(
@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" })

@ -1,63 +1,36 @@
package cokr.xit.adds.inf.mois.service.bean;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
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 java.io.*;
import java.nio.file.*;
import java.nio.file.attribute.*;
import java.util.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import org.apache.commons.lang3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import cokr.xit.adds.biz.nims.service.BizNimsService;
import cokr.xit.adds.core.Constants;
import cokr.xit.adds.core.spring.exception.ApiCustomException;
import cokr.xit.adds.core.util.DateUtils;
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;
import org.springframework.stereotype.*;
import org.springframework.web.multipart.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import cokr.xit.adds.biz.nims.service.*;
import cokr.xit.adds.core.*;
import cokr.xit.adds.core.spring.exception.*;
import cokr.xit.adds.core.util.*;
import cokr.xit.adds.inf.mois.model.*;
import cokr.xit.adds.inf.mois.service.*;
import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.foundation.component.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* description :
* packageName : cokr.xit.adds.inf.mois.service.bean
* fileName : InfMoisServiceBean
* author : limju
@ -343,7 +316,7 @@ public class InfMoisServiceBean extends AbstractServiceBean implements InfMoisSe
}
private NimsApiDto.BsshInfoSt getBsshInfo(MoisExchangeRequest reqDto) {
List<NimsApiDto.BsshInfoSt> list = bizNimsService.saveBsshInfoSt(
List<NimsApiDto.BsshInfoSt> list = bizNimsService.saveBsshInfoStQueryBsshInfoByBsshCd(
NimsApiRequest.BsshInfoReq.builder()
.fg("1")
.pg("1")

@ -1,27 +1,24 @@
package cokr.xit.adds.inf.nims.service.bean;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.*;
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.util.ApiUtil;
import cokr.xit.adds.inf.nims.model.NimsApiDto;
import cokr.xit.adds.inf.nims.model.NimsApiRequest;
import cokr.xit.adds.inf.nims.model.NimsApiResult;
import cokr.xit.adds.inf.nims.service.InfNimsService;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.JSON;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import cokr.xit.adds.core.spring.exception.*;
import cokr.xit.adds.core.util.*;
import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.inf.nims.service.*;
import cokr.xit.foundation.component.*;
import cokr.xit.foundation.data.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* description :
*
* packageName : cokr.xit.adds.inf.nims.service.bean
* fileName : InfNimsServiceBean
@ -96,9 +93,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
//FIXME: 운영기 반영 이후 주석 제거
//String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
dto.setK("998003699950fa950b798c9edea1b38f3cfbcf3b77e03e419");
String rslt = ApiUtil.callNimsApi("https://test.nims.or.kr" + productinfoKd, dto);
String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto);
NimsApiResult<NimsApiDto.ProductInfoKd> result = json.parse(rslt, new TypeReference<>() {});
return result.getResponse();
}
@ -113,12 +108,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe
ApiUtil.validate(dto, null, validator);
if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null);
//FIXME: 운영기 반영 이후 주석 제거
//String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto);
//dto.setK("1d6646562470902a61fc334c83a249cdcc5dc753426942138ee04342e66c8128");
dto.setK("998003699950fa950b798c9edea1b38f3cfbcf3b77e03e419");
dto.setBc("");
String rslt = ApiUtil.callNimsApi("https://test.nims.or.kr" + seqinfo, dto);
String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto);
NimsApiResult<NimsApiDto.MnfSeqInfo> result = json.parse(rslt, new TypeReference<>() {});
return result.getResponse();
}

@ -58,7 +58,7 @@
mdfr = #{rgtr}
</insert>
<insert id="mergeProductInfoKd" parameterType="cokr.xit.adds.inf.nims.model.NimsApiDto$ProductInfoKdSaveDTO">
<insert id="mergeProductInfoKd">
/** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim */
INSERT INTO tb_prduct_info(
prduct_cd, /* 제품코드 */

Loading…
Cancel
Save