|
|
@@ -1083,7 +1083,7 @@ public class TssGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 공지사항 저장
|
|
|
- *
|
|
|
+ *
|
|
|
* @param notice - 공지사항 정보
|
|
|
* @return
|
|
|
* @author eskim
|
|
|
@@ -1132,7 +1132,7 @@ public class TssGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 공지사항 상품 삭제
|
|
|
- *
|
|
|
+ *
|
|
|
* @param noticeGoods
|
|
|
* @return
|
|
|
* @author eskim
|
|
|
@@ -1170,7 +1170,7 @@ public class TssGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 상품이미지 저장 처리
|
|
|
- *
|
|
|
+ *
|
|
|
* @param goodsImgList - 상품이미지 목록
|
|
|
* @throws
|
|
|
* @author eskim
|
|
|
@@ -1195,7 +1195,7 @@ public class TssGoodsService {
|
|
|
}
|
|
|
goodsDao.createGoodsImage(goodsImg);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// "정보부족"인 상태의 상품 중 기본이미지가 생성될 경우 승인대기상태로 변경
|
|
|
if (goodsImg.getMode().equals("C") && goodsImg.getDefaultImgYn().equals("Y")) {
|
|
|
goods = new Goods();
|
|
|
@@ -1209,8 +1209,8 @@ public class TssGoodsService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 상품이미지 저장 처리
|
|
|
- *
|
|
|
+ * 상품이미지 대량저장 처리
|
|
|
+ *
|
|
|
* @param goodsImgList - 상품이미지 목록
|
|
|
* @throws
|
|
|
* @author eskim
|
|
|
@@ -1219,20 +1219,79 @@ public class TssGoodsService {
|
|
|
@Transactional("shopTxnManager")
|
|
|
public void saveGoodsImageMassList(Collection<GoodsImg> goodsImgList) {
|
|
|
Goods goods;
|
|
|
+ String comGoodsCd = "";
|
|
|
+ String comGoodsColor = "";
|
|
|
+ int index = 0;
|
|
|
for (GoodsImg goodsImg : goodsImgList) {
|
|
|
-
|
|
|
- goodsDao.deleteGoodsImage(goodsImg);
|
|
|
+
|
|
|
+ if (index == 0) {
|
|
|
+ comGoodsCd = goodsImg.getGoodsCd();
|
|
|
+ comGoodsColor = goodsImg.getColorCd();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!comGoodsCd.equals(goodsImg.getGoodsCd()) ||
|
|
|
+ (comGoodsCd.equals(goodsImg.getGoodsCd()) && comGoodsColor.equals(goodsImg.getColorCd()))
|
|
|
+ ) {
|
|
|
+ //정렬순서, 기본이미지순번, 마우스오버순번 변경
|
|
|
+ GoodsImg params = new GoodsImg();
|
|
|
+ params.setGoodsCd(comGoodsCd);
|
|
|
+ params.setColorCd(comGoodsColor);
|
|
|
+ Collection<GoodsImg> updateGoodsImgList = goodsDao.getGoodsImageNewDispOrdList(params);
|
|
|
+
|
|
|
+ if (updateGoodsImgList != null && !updateGoodsImgList.isEmpty()) {
|
|
|
+ for(GoodsImg paramsGoodsImg : updateGoodsImgList) {
|
|
|
+ paramsGoodsImg.setUpdNo(TssSession.getInfo().getUserNo());
|
|
|
+ goodsDao.updateGoodsImageDispOrd(paramsGoodsImg);
|
|
|
+ }
|
|
|
+
|
|
|
+ // "정보부족"인 상태의 상품 중 기본이미지가 생성될 경우 승인대기상태로 변경
|
|
|
+ goods = new Goods();
|
|
|
+ goods.setChGoodsStatYn("Y");
|
|
|
+ goods.setGoodsCd(goodsImg.getGoodsCd());
|
|
|
+ goods.setGoodsStat("G008_40");
|
|
|
+ goods.setUpdNo(TssSession.getInfo().getUserNo());
|
|
|
+ goodsDao.updateGoodsStatOnly(goods);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ comGoodsCd = goodsImg.getGoodsCd();
|
|
|
+ comGoodsColor = goodsImg.getColorCd();
|
|
|
+ }
|
|
|
+ //goodsDao.deleteGoodsImage(goodsImg); //20210827 막음
|
|
|
goodsDao.createGoodsImage(goodsImg);
|
|
|
-
|
|
|
+
|
|
|
+ // "정보부족"인 상태의 상품 중 기본이미지가 생성될 경우 승인대기상태로 변경
|
|
|
+// if(goodsImg.getDefaultImgYn().equals("Y")) {
|
|
|
+// goods = new Goods();
|
|
|
+// goods.setChGoodsStatYn("Y");
|
|
|
+// goods.setGoodsCd(goodsImg.getGoodsCd());
|
|
|
+// goods.setGoodsStat("G008_40");
|
|
|
+// goods.setUpdNo(TssSession.getInfo().getUserNo());
|
|
|
+// goodsDao.updateGoodsStatOnly(goods);
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 마지막 상품 정보 변경처리
|
|
|
+ //정렬순서, 기본이미지순번, 마우스오버순번 변경
|
|
|
+ GoodsImg params = new GoodsImg();
|
|
|
+ params.setGoodsCd(comGoodsCd);
|
|
|
+ params.setColorCd(comGoodsColor);
|
|
|
+ Collection<GoodsImg> updateGoodsImgList = goodsDao.getGoodsImageNewDispOrdList(params);
|
|
|
+
|
|
|
+ if (updateGoodsImgList != null && !updateGoodsImgList.isEmpty()) {
|
|
|
+ for(GoodsImg paramsGoodsImg : updateGoodsImgList) {
|
|
|
+ paramsGoodsImg.setUpdNo(TssSession.getInfo().getUserNo());
|
|
|
+ goodsDao.updateGoodsImageDispOrd(paramsGoodsImg);
|
|
|
+ }
|
|
|
+
|
|
|
// "정보부족"인 상태의 상품 중 기본이미지가 생성될 경우 승인대기상태로 변경
|
|
|
- if(goodsImg.getDefaultImgYn().equals("Y")) {
|
|
|
goods = new Goods();
|
|
|
goods.setChGoodsStatYn("Y");
|
|
|
- goods.setGoodsCd(goodsImg.getGoodsCd());
|
|
|
+ goods.setGoodsCd(comGoodsCd); // 마지막 상품 코드
|
|
|
goods.setGoodsStat("G008_40");
|
|
|
goods.setUpdNo(TssSession.getInfo().getUserNo());
|
|
|
goodsDao.updateGoodsStatOnly(goods);
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1290,7 +1349,7 @@ public class TssGoodsService {
|
|
|
if (!StringUtils.isBlank(gagaMap.getString("niContent" + (index + 1)))) {
|
|
|
goodsNotiInfo.setNiContent(gagaMap.getString("niContent" + (index + 1)));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
index++;
|
|
|
}
|
|
|
|
|
|
@@ -1300,7 +1359,7 @@ public class TssGoodsService {
|
|
|
this.setGoodsRegResult(goods, goodsMass, procJob);
|
|
|
return goods.getGoodsStat(); //continue
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 할인율
|
|
|
goods.setDcRate((int)(this.getDcRate(goods.getListPrice(), goods.getCurrPrice())));
|
|
|
|
|
|
@@ -1478,7 +1537,7 @@ public class TssGoodsService {
|
|
|
return goods;
|
|
|
}
|
|
|
goods.setBrandCd(goodsMass.getBrandCd().trim().toUpperCase()); // 브랜드 코드
|
|
|
-
|
|
|
+
|
|
|
// wms 상품 정보 확인
|
|
|
WmsGoods wmsGoodsInfo = goodsDao.getWmsGoodsInfo(goods);
|
|
|
if (wmsGoodsInfo == null) {
|
|
|
@@ -1720,7 +1779,7 @@ public class TssGoodsService {
|
|
|
return goods;
|
|
|
}
|
|
|
goods.setOriginNm(originCdList.iterator().next().getCdNm()); //고시정보 적용용
|
|
|
-
|
|
|
+
|
|
|
//고시분류
|
|
|
if (StringUtils.isBlank(goodsMass.getNiClsfCd())) {
|
|
|
goods.setGoodsRegMsg("고시분류 오류");
|
|
|
@@ -1857,7 +1916,7 @@ public class TssGoodsService {
|
|
|
}
|
|
|
index++;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return goods;
|
|
|
}
|
|
|
|
|
|
@@ -1915,7 +1974,7 @@ public class TssGoodsService {
|
|
|
|
|
|
//배송비 정책 코드
|
|
|
goods.setDelvFeeCd(delvFeeCd);
|
|
|
-
|
|
|
+
|
|
|
// 상품고시정보 - 항목및 기본값
|
|
|
Collection<GoodsNotiInfo> goodsNotiList = goodsDao.getItemkindNotiInfoList(goods);
|
|
|
if (goodsNotiList == null || goodsNotiList.isEmpty()) {
|
|
|
@@ -1924,14 +1983,14 @@ public class TssGoodsService {
|
|
|
this.setGoodsRegResult(goods, goodsMass, procJob);
|
|
|
return goods.getGoodsStat();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
int index = 0;
|
|
|
// 상품 등록시 고시정보 처리
|
|
|
for (GoodsNotiInfo goodsNotiInfo : goodsNotiList) {
|
|
|
if (!StringUtils.isBlank(gagaMap.getString("niContent" + (index + 1)))) {
|
|
|
goodsNotiInfo.setNiContent(gagaMap.getString("niContent" + (index + 1)));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
index++;
|
|
|
}
|
|
|
|
|
|
@@ -2474,7 +2533,7 @@ public class TssGoodsService {
|
|
|
return goods;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//고시분류
|
|
|
if (StringUtils.isBlank(goodsMass.getNiClsfCd())) {
|
|
|
goods.setGoodsRegMsg("고시분류 오류");
|
|
|
@@ -2493,7 +2552,7 @@ public class TssGoodsService {
|
|
|
return goods;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//성인용품여부
|
|
|
if (StringUtils.isBlank(goodsMass.getAdultYn())) {
|
|
|
@@ -3701,7 +3760,7 @@ public class TssGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 사은품 정보 수정
|
|
|
- *
|
|
|
+ *
|
|
|
* @param goodsImgList - 상품이미지 목록
|
|
|
* @throws AdmBizException
|
|
|
* @author eskim
|
|
|
@@ -3779,9 +3838,9 @@ public class TssGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 상품정보고시 항목 목록
|
|
|
- *
|
|
|
+ *
|
|
|
* @param
|
|
|
- * @throws
|
|
|
+ * @throws
|
|
|
* @author eskim
|
|
|
* @since 2021. 04. 21
|
|
|
*/
|
|
|
@@ -3838,11 +3897,11 @@ public class TssGoodsService {
|
|
|
if (goods.getListPrice() < goods.getCurrPrice()) {
|
|
|
throw new IllegalStateException("판매가를 올바르게 입력해주세요.");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isEmpty(goods.getDelvLocCd())) {
|
|
|
throw new IllegalStateException("출고처코드를 입력해주세요.");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isEmpty(goods.getDelvFeeCd ())) {
|
|
|
throw new IllegalStateException("배송비정책코드를 입력해주세요.");
|
|
|
}
|
|
|
@@ -4241,7 +4300,7 @@ public class TssGoodsService {
|
|
|
// 판매가
|
|
|
goods.setCurrPrice(0); // 기본처리
|
|
|
// 원가
|
|
|
- goods.setCostPrice(0); // 기본처리
|
|
|
+ goods.setCostPrice(0); // 기본처리
|
|
|
|
|
|
// 판매수수료율
|
|
|
SupplyCompany supplyCompany = new SupplyCompany();
|
|
|
@@ -4281,7 +4340,7 @@ public class TssGoodsService {
|
|
|
goods.setDistributionGb(distributionGb);
|
|
|
|
|
|
//출고처 코드
|
|
|
- goods.setDelvLocCd(TscConstants.WMS_DELV_LOC_CD); // 자사상품 출고처 코드 고정
|
|
|
+ goods.setDelvLocCd(TscConstants.WMS_DELV_LOC_CD); // 자사상품 출고처 코드 고정
|
|
|
|
|
|
// 기본정보 생성
|
|
|
goodsDao.createGoods(goods); // 상품기본 저장
|