list = saveBsshInfoSt(
+ BsshInfoReq.builder()
+ .fg("1")
+ .pg("1")
+ .bc(r.getBsshCd())
+ .build()
+ );
+ if (isEmpty(list)) {
+ // FIXME : 데이타 정상 흐름 확인후 comment 제거
+ continue;
+ //throw ApiCustomException.create(String.format("데이타 오류(마약류취급자식별번호[%s]에 해당하는 데이타가 없습니다)", r.getBsshCd()));
+ }
+ r.setPrmisnNo(list.get(0).getPrmisnNo());
+ r.setRprsntvNm(list.get(0).getRprsntvNm());
+ }
+ }
+ }
/**
*
@@ -925,29 +991,29 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
*/
private void setAddProductInfo(List dtlList) {
- for (NimsApiDto.DsuseRptInfoDtl r : dtlList) {//if()
- // 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm)
+ for (NimsApiDto.DsuseRptInfoDtl r : dtlList) {//if()
+ // 마약항정구분(nrcdSeNm), 중점일반구분(prtmSenm)
if (isEmpty(r.getNrcdSeNm()) || isEmpty(r.getPrtmSeNm())) {
- //NimsApiResult.Response result = infNimsService.getProductInfoKd(
+ //NimsApiResult.Response result = infNimsService.getProductInfoKd(
- List list = saveProductInfoKd(
- NimsApiRequest.ProductInfoReq.builder()
- .fg("1")
- .pg("1")
- .p(r.getPrductCd())
- .build(),
+ List list = saveProductInfoKd(
+ NimsApiRequest.ProductInfoReq.builder()
+ .fg("1")
+ .pg("1")
+ .p(r.getPrductCd())
+ .build(),
false
- );
- if (isEmpty(list)) {
- // FIXME : 데이타 정상 흐름 확인후 comment 제거
- continue;
- //throw ApiCustomException.create(String.format("데이타 오류(제품코드[%s]에 해당하는 데이타가 없습니다)", r.getPrductCd()));
- }
- r.setNrcdSeNm(list.get(0).getNrcdSeNm());
- r.setPrtmSeNm(list.get(0).getPrtmSeNm());
+ );
+ if (isEmpty(list)) {
+ // FIXME : 데이타 정상 흐름 확인후 comment 제거
+ continue;
+ //throw ApiCustomException.create(String.format("데이타 오류(제품코드[%s]에 해당하는 데이타가 없습니다)", r.getPrductCd()));
+ }
+ r.setNrcdSeNm(list.get(0).getNrcdSeNm());
+ r.setPrtmSeNm(list.get(0).getPrtmSeNm());
r.setStdPackngStleNm(list.get(0).getStdPackngStleNm());
r.setPceCoUnitNm(list.get(0).getPceCoUnitNm());
- }
+ }
// 제조수입자명(bsshNm)
if (isEmpty(r.getBsshNm()) && !isEmpty(r.getBsshCd())) {
@@ -965,50 +1031,9 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
}
r.setBsshNm(list.get(0).getBsshNm());
}
- }
- }
-
- /**
- *
- * 상품정보에 제조번호 목록 추가
- * @param list List
- *
- */
- private void productInfoaddMnfSeqs(List list) {
- String productCd = "";
-
- try {
-
- for (NimsApiDto.ProductInfoKd d : list) {
- productCd = d.getPrductCd();
-
- List mnfList = getMnfSeqInfo(
- NimsApiRequest.MnfSeqInfoReq.builder()
- .fg("1")
- .pg("1")
- .p(d.getPrductCd())
- .build()
- );
- d.getMnfSeqInfos().addAll(mnfList);
- }
-
- }catch (Exception e){
- if( e instanceof ApiCustomException){
- throw ApiCustomException.create(String.format("[%s]의 제조번호 정보를 찾을수 없습니다.", productCd));
- }
- throw ApiCustomException.create(e.getMessage());
}
}
-
-
-
-
-
-
-
-
-
// @Override
// public List getJurisdictionGovInfo(NimsApiRequest.JurisdictionGovInfoRequest dto) {
// NimsApiResult.Response result = infNimsService.getJurisdictionGovInfo(dto);
diff --git a/src/main/java/cokr/xit/base/FileController.java b/src/main/java/cokr/xit/base/FileController.java
new file mode 100644
index 0000000..2d6605a
--- /dev/null
+++ b/src/main/java/cokr/xit/base/FileController.java
@@ -0,0 +1,6 @@
+package cokr.xit.base;
+
+import org.springframework.stereotype.Controller;
+
+@Controller
+public class FileController extends cokr.xit.base.file.web.FileController {}
\ No newline at end of file
diff --git a/src/main/resources/sql/mapper/base/file-mapper.xml b/src/main/resources/sql/mapper/base/file-mapper.xml
new file mode 100644
index 0000000..e48c2a1
--- /dev/null
+++ b/src/main/resources/sql/mapper/base/file-mapper.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+SELECT INF_TYPE
+ , CONCAT('d:/data/adds/files/', '2024050001', '/', DIR) DIR
+ FROM (
+ SELECT '00' INF_TYPE, 'attachment/' DIR FROM DUAL UNION
+ SELECT '01' INF_TYPE, 'document/' DIR FROM DUAL UNION
+ SELECT '02' INF_TYPE, 'article/' DIR FROM DUAL UNION
+
+ SELECT '100' INF_TYPE, '' DIR FROM DUAL UNION /* 폐기상품이미지 */
+ SELECT '110' INF_TYPE, '' DIR FROM DUAL UNION /* 폐기 이미지 */
+ SELECT '200' INF_TYPE, '' DIR FROM DUAL /* 폐기보고 문서 */
+ ) FILE_DIRS
+
+
+
+SELECT A.*, FILE_PATH URL
+ FROM TB_FILE A
+ WHERE FILE_ID IN (#{fileID})
+ ORDER BY FILE_ID
+
+SELECT A.*, FILE_PATH URL
+ FROM TB_FILE A
+
+ AND A.INF_TYPE = #{infoType}
+ AND INF_KEY IN (#{infoKey})
+ AND USE_YN = 'Y'
+
+
+
+
+
+
+
+
+
+
+/* 파일 등록(fileMapper.insertFile) */
+
+SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH
+ FROM (
+ SELECT NVL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID
+ FROM TB_FILE A, () B
+ WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%')
+ ) T1, (
+
+ WHERE INF_TYPE = #{file.infoType}
+ ) T2
+INSERT INTO TB_FILE (
+ FILE_ID
+ , INF_TYPE
+ , INF_KEY
+ , SUB_TYPE
+ , FILE_NM
+ , FILE_PATH
+ , MIME_TYPE
+ , FILE_SIZE
+ , DNLD_CNT
+ , SRT_ORD
+ , RGTR
+ , REG_DT
+ , USE_YN
+) VALUES (
+ #{file.id}
+ , #{file.infoType}
+ , #{file.infoKey}
+ , #{file.subType}
+ , #{file.name}
+ , #{file.path}
+ , #{file.mimeType}
+ , #{file.size}
+ , #{file.downloadCount}
+ , #{file.sortOrder}
+ , #{currentUser.id}
+ ,
+ , 'Y'
+)
+
+
+/* 파일 순서 변경(fileMapper.reorder) */
+UPDATE TB_FILE SET
+ SRT_ORD = CASE FILE_ID
+ WHEN #{fileID} THEN #{index}
+
+ ELSE SRT_ORD END
+WHERE FILE_ID IN (#{fileID})
+
+/* 다운로드 횟수 증가(fileMapper.updateDownloadCount) */
+UPDATE TB_FILE SET
+ DNLD_CNT = DNLD_CNT + 1
+ WHERE USE_YN = 'Y'
+ AND FILE_ID IN (#{fileID})
+
+/* 파일 제거(fileMapper.removeFiles) */
+UPDATE TB_FILE SET
+ USE_YN = 'N'
+ WHERE USE_YN = 'Y'
+ AND FILE_ID IN (#{fileID})
+
+ AND INF_TYPE = #{infoType}
+ AND INF_KEY IN (#{infoKey})
+
+/* 파일 삭제(fileMapper.deleteFiles) */
+DELETE FROM TB_FILE
+WHERE FILE_ID IN (#{fileID})
+
+
+
diff --git a/src/main/resources/sql/mapper/base/utility.xml b/src/main/resources/sql/mapper/base/utility.xml
new file mode 100644
index 0000000..7f335db
--- /dev/null
+++ b/src/main/resources/sql/mapper/base/utility.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+SELECT QROWS.* FROM (
+ SELECT ROW_NUMBER() OVER() ROW_NUM
+ , COUNT(*) OVER() TOT_CNT, QBODY.*
+ FROM (
+
+ ) QBODY
+ ) QROWS
+WHERE ROW_NUM BETWEEN ((#{pageNum} - 1) * #{fetchSize}) + 1 AND (#{pageNum} * #{fetchSize})
+
+
+
+ORDER BY ${orderBy}
+
+
+
+DATE_FORMAT(CURRENT_TIMESTAMP, '%Y%m%d%H%i%s')
+TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS')
+
+SELECTNOW FROM DUAL
+
+DATE_FORMAT(CURRENT_DATE, '%Y%m%d')
+TO_CHAR(CURRENT_DATE, 'YYYYMMDD')
+
+SELECTTODAY FROM DUAL
+
+NVL(#{thisDay},)
+
+SELECTTHIS_DAY FROM DUAL
+
+
\ No newline at end of file