|
|
@@ -116,7 +116,7 @@ public class TsaGoodsService {
|
|
|
private static final String UPDATE_NO_PATTERN = "X";
|
|
|
|
|
|
private static final String SELF_GOOODS_AFTER = "STY";
|
|
|
-
|
|
|
+
|
|
|
private static final int EXCEL_ROW_COUNT = 500;
|
|
|
|
|
|
/**
|
|
|
@@ -416,7 +416,7 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, "상품 정보", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
|
|
|
} catch (Exception e) {
|
|
|
@@ -630,7 +630,7 @@ public class TsaGoodsService {
|
|
|
public Collection<Goods> getGoodsDetailOrderGradeList(Goods goods) {
|
|
|
return goodsDao.getGoodsDetailOrderGradeList(goods);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품 안전인증 조회
|
|
|
*
|
|
|
@@ -642,8 +642,6 @@ public class TsaGoodsService {
|
|
|
public GoodsSafeNo getGoodsDetailSafe(Goods goods) {
|
|
|
return goodsDao.getGoodsDetailSafe(goods);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 구성상품 목록
|
|
|
@@ -683,7 +681,7 @@ public class TsaGoodsService {
|
|
|
try {
|
|
|
//인증대상
|
|
|
if ("G083_1".equals(goodsSafeNo.getCertTargetGb())) {
|
|
|
-
|
|
|
+
|
|
|
//인증형태 (방송통신, 위해) or 인증타입 - 공급자적합성
|
|
|
if ("G084_4".equals(goodsSafeNo.getCertFormGb()) || "G084_5".equals(goodsSafeNo.getCertFormGb()) || "G081_3".equals(goodsSafeNo.getCertType())) {
|
|
|
goodsSafeNo.setCertDt("");
|
|
|
@@ -694,7 +692,7 @@ public class TsaGoodsService {
|
|
|
goodsSafeNo.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsSafeNo.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsDao.saveGoodsSafeNo(goodsSafeNo);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
GagaMap result = safetyKoreaApi.getKoreaCertifyDetail(goodsSafeNo.getCertNum());
|
|
|
if (result != null || !StringUtil.isNullOrEmpty(result.get("certNum").toString())) {
|
|
|
goodsSafeNo.setCertDt(result.get("certDt").toString());
|
|
|
@@ -704,11 +702,11 @@ public class TsaGoodsService {
|
|
|
goodsSafeNo.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsSafeNo.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsDao.saveGoodsSafeNo(goodsSafeNo);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new IllegalStateException(message.getMessage("FAIL_1001"));
|
|
|
}
|
|
|
}
|
|
|
- }else { //인증대상 그외 - 인증처리 안해도 됨
|
|
|
+ } else { //인증대상 그외 - 인증처리 안해도 됨
|
|
|
goodsSafeNo.setCertDt("");
|
|
|
// goodsSafeNo.setCertNum("");
|
|
|
goodsSafeNo.setCertState("");
|
|
|
@@ -718,7 +716,7 @@ public class TsaGoodsService {
|
|
|
goodsSafeNo.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsDao.saveGoodsSafeNo(goodsSafeNo);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -838,10 +836,9 @@ public class TsaGoodsService {
|
|
|
|
|
|
//건수
|
|
|
if (goodsList != null && goodsList.size() > EXCEL_ROW_COUNT) {
|
|
|
- throw new IllegalStateException("엑셀 파일의 건수를 " +EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
+ throw new IllegalStateException("엑셀 파일의 건수를 " + EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
int index = 0;
|
|
|
String goodsCdFlag = "";
|
|
|
String goodsNumFlag = "";
|
|
|
@@ -1061,11 +1058,10 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 판매기간설정 eskim
|
|
|
- goods.setSellStdt(goods.getSellStYMD().replaceAll("-","") + goods.getSellStHH() + "0000");
|
|
|
- goods.setSellEddt(goods.getSellEdYMD().replaceAll("-","") + goods.getSellEdHH() + "5959");
|
|
|
-
|
|
|
+ goods.setSellStdt(goods.getSellStYMD().replaceAll("-", "") + goods.getSellStHH() + "0000");
|
|
|
+ goods.setSellEddt(goods.getSellEdYMD().replaceAll("-", "") + goods.getSellEdHH() + "5959");
|
|
|
|
|
|
// 기본정보 변경
|
|
|
if ("Y".equals(goods.getChDataYn())) {
|
|
|
@@ -1415,6 +1411,7 @@ public class TsaGoodsService {
|
|
|
regGoods.setItemkindCd(extendGoods.getItemkindCd());
|
|
|
regGoods.setSupplyCompCd(extendGoods.getSupplyCompCd());
|
|
|
regGoods.setFormalGb(extendGoods.getFormalGb());
|
|
|
+ regGoods.setSelfGoodsYn(extendGoods.getSelfGoodsYn());
|
|
|
}
|
|
|
|
|
|
if ("Y".equals(goodsCompose.getRepYn())) {
|
|
|
@@ -1496,6 +1493,7 @@ public class TsaGoodsService {
|
|
|
regGoods.setGoodsNum(extendGoods.getGoodsNum());
|
|
|
regGoods.setSupplyCompCd(extendGoods.getSupplyCompCd());
|
|
|
regGoods.setFormalGb(extendGoods.getFormalGb());
|
|
|
+ regGoods.setSelfGoodsYn(extendGoods.getSelfGoodsYn());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1541,7 +1539,7 @@ public class TsaGoodsService {
|
|
|
regGoods.setPntPrate(pntPrate); // 포인트적립율(PC)
|
|
|
regGoods.setPntMrate(pntMrate); // 포인트적립율(MOBILE)
|
|
|
|
|
|
- regGoods.setSelfGoodsYn("Y");
|
|
|
+ //regGoods.setSelfGoodsYn("Y");
|
|
|
|
|
|
SupplyCompany supplyCompany = new SupplyCompany();
|
|
|
supplyCompany.setSupplyCompCd(regGoods.getSupplyCompCd());
|
|
|
@@ -1551,7 +1549,6 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
regGoods.setSellFeeRate(supplyCompanyList.iterator().next().getSellFeeRate()); // 판매수수료율
|
|
|
|
|
|
-
|
|
|
DelvFeePolicy delvFeePolicy = new DelvFeePolicy();
|
|
|
delvFeePolicy.setSupplyCompCd(regGoods.getSupplyCompCd());
|
|
|
Collection<DelvFeePolicy> deliveryFeePolicyList = businessService.getDeliveryFeePolicyList(delvFeePolicy);
|
|
|
@@ -1562,9 +1559,9 @@ public class TsaGoodsService {
|
|
|
|
|
|
// 스타일 연도
|
|
|
regGoods.setStyleYear(regGoods.getStyleYear());
|
|
|
-
|
|
|
+
|
|
|
// 판매기간설정
|
|
|
- regGoods.setSellStdt(GagaDateUtil.getToday()+"000000");
|
|
|
+ regGoods.setSellStdt(GagaDateUtil.getToday() + "000000");
|
|
|
regGoods.setSellEddt("30001231235959");
|
|
|
regGoods.setTobeFormYn("Y");
|
|
|
|
|
|
@@ -2089,10 +2086,9 @@ public class TsaGoodsService {
|
|
|
}
|
|
|
//건수
|
|
|
if (goodsPriceList != null && goodsPriceList.size() > EXCEL_ROW_COUNT) {
|
|
|
- throw new IllegalStateException("엑셀 파일의 건수를 " +EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
+ throw new IllegalStateException("엑셀 파일의 건수를 " + EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 입력값 확인
|
|
|
String goodsPriceResvCheck = getGoodsPriceResvCheck(goodsPriceList);
|
|
|
if (!"SUCC".equals(goodsPriceResvCheck)) {
|
|
|
@@ -2230,13 +2226,13 @@ public class TsaGoodsService {
|
|
|
public void saveGoodsVideo(GoodsVideo goodsVideo) {
|
|
|
goodsVideo.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
goodsVideo.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
-
|
|
|
+
|
|
|
if (goodsVideo.getVideoSq() == null || goodsVideo.getVideoSq() == 0) {
|
|
|
goodsDao.createGoodsVideo(goodsVideo);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
goodsDao.updateGoodsVideo(goodsVideo);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -3443,7 +3439,7 @@ public class TsaGoodsService {
|
|
|
delvFeePolicy.setSupplyCompCd(goods.getSupplyCompCd());
|
|
|
delvFeePolicy.setDelvFeeCd(goods.getDelvFeeCd());
|
|
|
delvFeePolicy.setUseYn("Y");
|
|
|
- Collection<DelvFeePolicy> deliveryFeePolicyList = businessService.getDeliveryFeePolicyList(delvFeePolicy);
|
|
|
+ Collection<DelvFeePolicy> deliveryFeePolicyList = businessService.getDeliveryFeePolicyList(delvFeePolicy);
|
|
|
if (deliveryFeePolicyList != null && !deliveryFeePolicyList.isEmpty()) {
|
|
|
goods.setGoodsRegMsg("배송비정책코드 오류");
|
|
|
goods.setGoodsStat("10");
|
|
|
@@ -3590,11 +3586,11 @@ public class TsaGoodsService {
|
|
|
//log.info("[saveSizeInfo] sizeInfo {}", sizeInfo);
|
|
|
String sizeCate1Cd = "";
|
|
|
String sizeCate2Cd = "";
|
|
|
- if ("1".equals(sizeInfo.getSizeGb()) ){
|
|
|
+ if ("1".equals(sizeInfo.getSizeGb())) {
|
|
|
|
|
|
if (StringUtils.isBlank(sizeInfo.getSizeCate1Cd())) {
|
|
|
sizeCate1Cd = "00";
|
|
|
- if ("Y".equals(sizeInfo.getSelfYn())){
|
|
|
+ if ("Y".equals(sizeInfo.getSelfYn())) {
|
|
|
sizeCate1Cd = sizeInfo.getBrandCd();
|
|
|
}
|
|
|
sizeInfo.setSizeCate1Cd(sizeCate1Cd);
|
|
|
@@ -3605,7 +3601,7 @@ public class TsaGoodsService {
|
|
|
sizeInfo.setSizeCate2Cd(sizeCate2Cd);
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
|
|
|
if (StringUtils.isBlank(sizeInfo.getSizeCate1Cd())) {
|
|
|
sizeCate1Cd = commonService.getNextSequence("SEQ_CATE").toString();
|
|
|
@@ -3656,12 +3652,12 @@ public class TsaGoodsService {
|
|
|
if (goods.getArrGoodsCd().length <= 0) {
|
|
|
throw new IllegalStateException(message.getMessage("FAIL_1001"));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
GoodsSearch search = new GoodsSearch();
|
|
|
search.setConditionList(goods.getArrGoodsCd());
|
|
|
search.setSearch("searchGoodsCd");
|
|
|
int cnt = getGoodsListCount(search);
|
|
|
- if (cnt < goods.getArrGoodsCd().length ) {
|
|
|
+ if (cnt < goods.getArrGoodsCd().length) {
|
|
|
throw new IllegalStateException("상품코드를 확인해주세요.");
|
|
|
}
|
|
|
|
|
|
@@ -3709,25 +3705,25 @@ public class TsaGoodsService {
|
|
|
this.deleteExceluploadFile(targetPath, excelFilename);
|
|
|
throw new IllegalStateException(message.getMessage("FAIL_1001"));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//건수
|
|
|
if (goodsList != null && goodsList.size() > EXCEL_ROW_COUNT) {
|
|
|
- throw new IllegalStateException("엑셀 파일의 건수를 " +EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
+ throw new IllegalStateException("엑셀 파일의 건수를 " + EXCEL_ROW_COUNT + "건 이하로 사용하세요.");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 검증
|
|
|
GoodsSearch search = new GoodsSearch();
|
|
|
search.setSearch("searchGoodsCd");
|
|
|
-
|
|
|
+
|
|
|
int index = 0;
|
|
|
for (Goods goods : goodsList) {
|
|
|
-
|
|
|
+
|
|
|
search.setGoodsCd(goods.getGoodsCd());
|
|
|
int cnt = getGoodsListCount(search);
|
|
|
- if (cnt == 0 ) {
|
|
|
+ if (cnt == 0) {
|
|
|
throw new IllegalStateException("상품코드를 확인해주세요.");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
goods.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
// 엑셀조회를 위한 SEARCH 테이블 생성
|
|
|
@@ -3742,12 +3738,12 @@ public class TsaGoodsService {
|
|
|
commonService.createExceluploadSearch(searchData);
|
|
|
|
|
|
goodsDao.createGoodsQuikDeleverySkip(goods);
|
|
|
-
|
|
|
+
|
|
|
index++;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품 모델 정보
|
|
|
*
|
|
|
@@ -3759,7 +3755,7 @@ public class TsaGoodsService {
|
|
|
public GoodsImg getGoodsModelInfo(GoodsImg goodsImg) {
|
|
|
return goodsDao.getGoodsModelInfo(goodsImg);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품 모델 정보 저장
|
|
|
*
|
|
|
@@ -3772,5 +3768,5 @@ public class TsaGoodsService {
|
|
|
public void saveGoodsModelInfo(GoodsImg goodsImg) {
|
|
|
goodsDao.saveGoodsModelInfo(goodsImg);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|