|
|
@@ -61,7 +61,6 @@ public class TsfGoodsService {
|
|
|
@Autowired
|
|
|
private ObjectMapper mapper;
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 상품뷰이력 생성
|
|
|
*
|
|
|
@@ -453,14 +452,14 @@ public class TsfGoodsService {
|
|
|
* @since 2021. 3. 22
|
|
|
*/
|
|
|
public int getGoodsSetStockQty(GoodsStock goodsStock) {
|
|
|
-
|
|
|
+
|
|
|
// input param
|
|
|
// arrGoodsOption : goodsOption // [{goodsCd|optCd|qty},{goodsCd|optCd|qty}]
|
|
|
// ,minOrdQty : minOrdQty
|
|
|
// ,maxOrdQty : maxOrdQty
|
|
|
// ,goodsCd : mGoodsCd
|
|
|
// ,selfGoodsYn : selfGoodsYn
|
|
|
-
|
|
|
+
|
|
|
int result = 0;
|
|
|
int index = 0; // 상품순서
|
|
|
//int masterStoreCnt = 0;
|
|
|
@@ -468,16 +467,16 @@ public class TsfGoodsService {
|
|
|
boolean returnFlag = false;
|
|
|
//String[][] arrGoodsStoreList = null; // 상품코드, 매장코드, 상품별 주문수량
|
|
|
|
|
|
- log.info("[getGoodsSetStockQty] goodsStock = {}", goodsStock);
|
|
|
+ //log.info("[getGoodsSetStockQty] goodsStock = {}", goodsStock);
|
|
|
|
|
|
// 예약상품 여부 확인
|
|
|
int goodsResSellCount = goodsDao.getGoodsResSellCount(goodsStock.getGoodsCd());
|
|
|
-
|
|
|
+
|
|
|
int ableOrderCnt = 0;
|
|
|
for (String arrGoodsCd : goodsStock.getArrGoodsOption()) { // [{goodsCd|optCd|qty},{goodsCd|optCd|qty}]
|
|
|
|
|
|
String[] goodsSizeInfo = arrGoodsCd.split("\\|");
|
|
|
- log.info("[getGoodsSetStockQty] goodsSizeInfo = {}", goodsSizeInfo);
|
|
|
+ //log.info("[getGoodsSetStockQty] goodsSizeInfo = {}", goodsSizeInfo);
|
|
|
if (goodsSizeInfo.length == 3) {
|
|
|
|
|
|
GoodsStock tmpStock = new GoodsStock();
|
|
|
@@ -491,8 +490,8 @@ public class TsfGoodsService {
|
|
|
} else {
|
|
|
stockByGoodsSize = goodsDao.getGoodsStoreStockQty(tmpStock);
|
|
|
}
|
|
|
-
|
|
|
- log.info("[getGoodsSetStockQty] stockByGoodsSize = {}", stockByGoodsSize);
|
|
|
+
|
|
|
+ //log.info("[getGoodsSetStockQty] stockByGoodsSize = {}", stockByGoodsSize);
|
|
|
if (stockByGoodsSize <= 0) {
|
|
|
returnFlag = true;
|
|
|
break;
|
|
|
@@ -507,7 +506,7 @@ public class TsfGoodsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.info("[getGoodsSetStockQty] ableOrderCnt = {}", ableOrderCnt);
|
|
|
+ //log.info("[getGoodsSetStockQty] ableOrderCnt = {}", ableOrderCnt);
|
|
|
} else {
|
|
|
returnFlag = true;
|
|
|
break;
|
|
|
@@ -574,57 +573,59 @@ public class TsfGoodsService {
|
|
|
public Collection<Goods> getTmtbGoodsList(Goods goods) {
|
|
|
goods.setArrTmtbSq(null); // 배열 사용하여 진행시에 IN절에 걸려 query timeout 걸려 null처리
|
|
|
Collection<Goods> result = new ArrayList<Goods>();
|
|
|
-
|
|
|
+
|
|
|
Collection<Tmtb> tmtbSqList = goodsDao.getTmtbSqList(goods);
|
|
|
if (tmtbSqList == null || tmtbSqList.isEmpty()) {
|
|
|
return result;
|
|
|
}
|
|
|
- log.info("[tmtbSqList]={}",tmtbSqList);
|
|
|
- log.info("[goods]={}",goods);
|
|
|
+ //log.info("[tmtbSqList]={}",tmtbSqList);
|
|
|
+ //log.info("[goods]={}",goods);
|
|
|
int rCount = 0; //다다익선 조회수
|
|
|
int tCount = goods.getMaxRownum(); //리턴 잔여수
|
|
|
- if (tCount == 0) tCount = 20;
|
|
|
-
|
|
|
- for (Tmtb tmtb: tmtbSqList) {
|
|
|
-
|
|
|
+ if (tCount == 0) {
|
|
|
+ tCount = 20;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (Tmtb tmtb : tmtbSqList) {
|
|
|
+
|
|
|
goods.setTmtbSq(tmtb.getTmtbSq());
|
|
|
Collection<Goods> tmtbGoodsList = goodsDao.getTmtbGoodsList(goods);
|
|
|
if (tmtbGoodsList == null || tmtbGoodsList.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (tCount <= 0) { //잔여수가 없으면 종료
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//다다익선 조회 상품 수
|
|
|
rCount = tmtbGoodsList.size();
|
|
|
-
|
|
|
+
|
|
|
if (tCount > rCount) { //조회수보다 잔여수가 클경우
|
|
|
result.addAll(tmtbGoodsList);
|
|
|
tCount = tCount - rCount; //남은 잔여수 계산
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if (tCount == rCount) { //잔여 수량과 조회수가 같은면 종료
|
|
|
result.addAll(tmtbGoodsList);
|
|
|
break;
|
|
|
- }else {
|
|
|
-
|
|
|
- for (int i=0; i<tCount; i++) { //잔여수량만큼 loop
|
|
|
+ } else {
|
|
|
+
|
|
|
+ for (int i = 0; i < tCount; i++) { //잔여수량만큼 loop
|
|
|
int tmtbGoodsListCnt = 0;
|
|
|
- for(Goods tmtbGoods: tmtbGoodsList) {
|
|
|
+ for (Goods tmtbGoods : tmtbGoodsList) {
|
|
|
if (i == tmtbGoodsListCnt) {
|
|
|
result.add(tmtbGoods);
|
|
|
- tCount --;
|
|
|
+ tCount--;
|
|
|
break;
|
|
|
}
|
|
|
- tmtbGoodsListCnt ++;
|
|
|
+ tmtbGoodsListCnt++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -714,10 +715,10 @@ public class TsfGoodsService {
|
|
|
* @date 2021. 3. 10
|
|
|
*/
|
|
|
public Collection<Measurement> getMeasurementList(Goods goods) {
|
|
|
-
|
|
|
- return goodsDao.getMeasurementList(goods);
|
|
|
+
|
|
|
+ return goodsDao.getMeasurementList(goods);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 실측사이즈 조회
|
|
|
*
|
|
|
@@ -731,14 +732,14 @@ public class TsfGoodsService {
|
|
|
// 행, 열 변환
|
|
|
Collection<Measurement> measurementList = goodsDao.getMeasurementList(goods);
|
|
|
Collection<MeasurementStyle> measurementStyleList = new ArrayList<MeasurementStyle>();
|
|
|
-
|
|
|
+
|
|
|
if (measurementList == null || measurementList.isEmpty()) {
|
|
|
return measurementStyleList;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
int colSize = measurementList.size(); // 열 column
|
|
|
int rowSize = 5; // 상의하위포함 최대사이즈
|
|
|
-
|
|
|
+
|
|
|
String[][] arrMeasurementList = new String[rowSize + 1][colSize + 1];
|
|
|
|
|
|
// 사이즈 설정
|
|
|
@@ -747,7 +748,7 @@ public class TsfGoodsService {
|
|
|
arrMeasurementList[0][0] = measurement.getTypecd();
|
|
|
yIndex++;
|
|
|
arrMeasurementList[0][yIndex] = measurement.getOptCd2();
|
|
|
-
|
|
|
+
|
|
|
// 부위명 설정
|
|
|
arrMeasurementList[1][0] = measurement.getTypecd();
|
|
|
arrMeasurementList[2][0] = measurement.getTypecd();
|
|
|
@@ -759,7 +760,7 @@ public class TsfGoodsService {
|
|
|
arrMeasurementList[3][yIndex] = String.valueOf(measurement.getValue3());
|
|
|
arrMeasurementList[4][yIndex] = String.valueOf(measurement.getValue4());
|
|
|
arrMeasurementList[5][yIndex] = String.valueOf(measurement.getValue5());
|
|
|
-
|
|
|
+
|
|
|
// arrMeasurementList = [[하의, 100, 110, 120, 130, 140, 150],
|
|
|
// [하의, 42.0, 44.0, 46.0, 48.0, 52.0, 54.0],
|
|
|
// [하의, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
|
|
|
@@ -768,43 +769,85 @@ public class TsfGoodsService {
|
|
|
// [하의, 51.0, 60.0, 65.0, 75.0, 79.0, 87.0]]
|
|
|
//
|
|
|
}
|
|
|
-
|
|
|
- for(int i=0; i< 6; i++) {
|
|
|
+
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
MeasurementStyle measurementStyle = new MeasurementStyle();
|
|
|
measurementStyle.setGoodsCd(goods.getGoodsCd());
|
|
|
measurementStyle.setSizeCount(colSize);
|
|
|
-
|
|
|
- log.info("arrMeasurementList[0].length = {}", arrMeasurementList[0].length);
|
|
|
- for(int j=0; j<arrMeasurementList[0].length; j++) {
|
|
|
- switch(j) {
|
|
|
- case 0: measurementStyle.setTypecd(arrMeasurementList[i][j]); break;
|
|
|
- case 1: measurementStyle.setSize1(arrMeasurementList[i][j]); break;
|
|
|
- case 2: measurementStyle.setSize2(arrMeasurementList[i][j]); break;
|
|
|
- case 3: measurementStyle.setSize3(arrMeasurementList[i][j]); break;
|
|
|
- case 4: measurementStyle.setSize4(arrMeasurementList[i][j]); break;
|
|
|
- case 5: measurementStyle.setSize5(arrMeasurementList[i][j]); break;
|
|
|
- case 6: measurementStyle.setSize6(arrMeasurementList[i][j]); break;
|
|
|
- case 7: measurementStyle.setSize7(arrMeasurementList[i][j]); break;
|
|
|
- case 8: measurementStyle.setSize8(arrMeasurementList[i][j]); break;
|
|
|
- case 9: measurementStyle.setSize9(arrMeasurementList[i][j]); break;
|
|
|
- case 10: measurementStyle.setSize10(arrMeasurementList[i][j]); break;
|
|
|
- case 11: measurementStyle.setSize11(arrMeasurementList[i][j]); break;
|
|
|
- case 12: measurementStyle.setSize12(arrMeasurementList[i][j]); break;
|
|
|
- case 13: measurementStyle.setSize13(arrMeasurementList[i][j]); break;
|
|
|
- case 14: measurementStyle.setSize14(arrMeasurementList[i][j]); break;
|
|
|
- case 15: measurementStyle.setSize15(arrMeasurementList[i][j]); break;
|
|
|
- case 16: measurementStyle.setSize16(arrMeasurementList[i][j]); break;
|
|
|
- case 17: measurementStyle.setSize17(arrMeasurementList[i][j]); break;
|
|
|
- case 18: measurementStyle.setSize18(arrMeasurementList[i][j]); break;
|
|
|
- case 19: measurementStyle.setSize19(arrMeasurementList[i][j]); break;
|
|
|
- case 20: measurementStyle.setSize20(arrMeasurementList[i][j]); break;
|
|
|
+
|
|
|
+ //log.info("arrMeasurementList[0].length = {}", arrMeasurementList[0].length);
|
|
|
+ for (int j = 0; j < arrMeasurementList[0].length; j++) {
|
|
|
+ switch (j) {
|
|
|
+ case 0:
|
|
|
+ measurementStyle.setTypecd(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ measurementStyle.setSize1(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ measurementStyle.setSize2(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ measurementStyle.setSize3(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ measurementStyle.setSize4(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ measurementStyle.setSize5(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ measurementStyle.setSize6(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ measurementStyle.setSize7(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ measurementStyle.setSize8(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ measurementStyle.setSize9(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ measurementStyle.setSize10(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 11:
|
|
|
+ measurementStyle.setSize11(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 12:
|
|
|
+ measurementStyle.setSize12(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 13:
|
|
|
+ measurementStyle.setSize13(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 14:
|
|
|
+ measurementStyle.setSize14(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 15:
|
|
|
+ measurementStyle.setSize15(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 16:
|
|
|
+ measurementStyle.setSize16(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 17:
|
|
|
+ measurementStyle.setSize17(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 18:
|
|
|
+ measurementStyle.setSize18(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 19:
|
|
|
+ measurementStyle.setSize19(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
+ case 20:
|
|
|
+ measurementStyle.setSize20(arrMeasurementList[i][j]);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
measurementStyleList.add(measurementStyle);
|
|
|
}
|
|
|
|
|
|
- log.info("measurementStyleList = {}", measurementStyleList);
|
|
|
-
|
|
|
+ //log.info("measurementStyleList = {}", measurementStyleList);
|
|
|
+
|
|
|
return measurementStyleList;
|
|
|
}
|
|
|
|
|
|
@@ -843,9 +886,9 @@ public class TsfGoodsService {
|
|
|
*/
|
|
|
public Collection<GoodsCompose> getGoodsSetComposeList(Goods goods) {
|
|
|
Collection<GoodsCompose> getGoodsSetComposeList = goodsDao.getGoodsSetComposeList(goods);
|
|
|
- for (GoodsCompose goodsExtend : getGoodsSetComposeList) {
|
|
|
+ for (GoodsCompose goodsCompose : getGoodsSetComposeList) {
|
|
|
Goods tmpGoods = new Goods();
|
|
|
- tmpGoods.setGoodsCd(goodsExtend.getCompsGoodsCd());
|
|
|
+ tmpGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
|
|
|
tmpGoods.setSupplyCompCd(goods.getSupplyCompCd());
|
|
|
tmpGoods.setFrontGb(goods.getFrontGb());
|
|
|
tmpGoods.setIsApp(goods.getIsApp());
|
|
|
@@ -856,24 +899,24 @@ public class TsfGoodsService {
|
|
|
// 상품상세
|
|
|
Goods resultGoods = this.getGoodsDesc(tmpGoods);
|
|
|
if (resultGoods != null) {
|
|
|
- goodsExtend.setGoodsTitle(resultGoods.getGoodsTitle());
|
|
|
- goodsExtend.setGoodsTitleDesc(resultGoods.getGoodsTitleDesc());
|
|
|
- goodsExtend.setGoodsSpecialDesc(resultGoods.getGoodsSpecialDesc());
|
|
|
- goodsExtend.setGoodsTopDesc(resultGoods.getGoodsTopDesc());
|
|
|
- goodsExtend.setGoodsDownDesc(resultGoods.getGoodsDownDesc());
|
|
|
- goodsExtend.setGoodsDesc(resultGoods.getGoodsDesc());
|
|
|
+// goodsCompose.setGoodsTitle(resultGoods.getGoodsTitle());
|
|
|
+// goodsCompose.setGoodsTitleDesc(resultGoods.getGoodsTitleDesc());
|
|
|
+// goodsCompose.setGoodsSpecialDesc(resultGoods.getGoodsSpecialDesc());
|
|
|
+// goodsCompose.setGoodsTopDesc(resultGoods.getGoodsTopDesc());
|
|
|
+// goodsCompose.setGoodsDownDesc(resultGoods.getGoodsDownDesc());
|
|
|
+ goodsCompose.setGoodsDesc(resultGoods.getGoodsDesc());
|
|
|
}
|
|
|
|
|
|
// 상품 옵션1(색상) 정보
|
|
|
- goodsExtend.setGoodsOption1List(goodsDao.getGoodsOption1List(tmpGoods));
|
|
|
+ goodsCompose.setGoodsOption1List(goodsDao.getGoodsOption1List(tmpGoods));
|
|
|
// 상품 옵션2(사이즈) 정보
|
|
|
//goodsExtend.setGoodsOption2List(goodsDao.getGoodsOption2List(tmpGoods));
|
|
|
// 고시 정보
|
|
|
- goodsExtend.setGoodsNotiList(goodsDao.getGoodsNotiList(tmpGoods));
|
|
|
+ goodsCompose.setGoodsNotiList(goodsDao.getGoodsNotiList(tmpGoods));
|
|
|
// 이미지 정보
|
|
|
- goodsExtend.setGoodsImgList(goodsDao.getGoodsImgList(tmpGoods));
|
|
|
+ goodsCompose.setGoodsImgList(goodsDao.getGoodsImgList(tmpGoods));
|
|
|
// 상품 안전인증 정보
|
|
|
- goodsExtend.setGoodsSafeNo(goodsDao.getGoodsSafeNo(tmpGoods));
|
|
|
+ goodsCompose.setGoodsSafeNo(goodsDao.getGoodsSafeNo(tmpGoods));
|
|
|
|
|
|
}
|
|
|
return getGoodsSetComposeList;
|
|
|
@@ -943,9 +986,9 @@ public class TsfGoodsService {
|
|
|
cate.setCate1No(null);
|
|
|
}
|
|
|
|
|
|
- if(cate.getContentsLoc().equals("SCM002") ){
|
|
|
+ if (cate.getContentsLoc().equals("SCM002")) {
|
|
|
goodsList.addAll(goodsDao.getCategoryMainNewGoodsList(cate));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
goodsList.addAll(goodsDao.getContentsCategoryNewGoodsList(cate));
|
|
|
}
|
|
|
}
|
|
|
@@ -965,7 +1008,7 @@ public class TsfGoodsService {
|
|
|
temp.setBenefitArr(temp.getIcon().split(","));
|
|
|
}
|
|
|
}
|
|
|
- } else if(cate.getContentsLoc().equals("SOM003")){
|
|
|
+ } else if (cate.getContentsLoc().equals("SOM003")) {
|
|
|
goodsList = goodsDao.getContentsCategoryGoodsList(cate);
|
|
|
for (Goods temp : goodsList) {
|
|
|
if (temp.getSizes() != null) {
|