|
@@ -41,18 +41,17 @@ public class TscFreegiftService {
|
|
|
*/
|
|
*/
|
|
|
public Collection<Order> getOrderFreegift(Order order) {
|
|
public Collection<Order> getOrderFreegift(Order order) {
|
|
|
|
|
|
|
|
- Collection<Order> freegiftList = new ArrayList<Order>();
|
|
|
|
|
-
|
|
|
|
|
// 1. 장바구니 담긴 상품으로 적용된 사은품 프로모션 정보 조회 (with 상품금액)
|
|
// 1. 장바구니 담긴 상품으로 적용된 사은품 프로모션 정보 조회 (with 상품금액)
|
|
|
Collection<Order> fregiftGoodsApplyAmtList = freegiftDao.getFreeGiftGoodsApplyAmt(order);
|
|
Collection<Order> fregiftGoodsApplyAmtList = freegiftDao.getFreeGiftGoodsApplyAmt(order);
|
|
|
|
|
|
|
|
int[] freegiftSqArr = new int[fregiftGoodsApplyAmtList.size()];
|
|
int[] freegiftSqArr = new int[fregiftGoodsApplyAmtList.size()];
|
|
|
|
|
|
|
|
- int i= 0;
|
|
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
|
|
|
// 사은품시퀀스(FREEGIFT_SQ), 사은품시퀀스합계금액(FREEGIFT_AMT)
|
|
// 사은품시퀀스(FREEGIFT_SQ), 사은품시퀀스합계금액(FREEGIFT_AMT)
|
|
|
for (Order fregiftGoodsApplyAmt : fregiftGoodsApplyAmtList) {
|
|
for (Order fregiftGoodsApplyAmt : fregiftGoodsApplyAmtList) {
|
|
|
freegiftSqArr[i] = fregiftGoodsApplyAmt.getFreegiftSq();
|
|
freegiftSqArr[i] = fregiftGoodsApplyAmt.getFreegiftSq();
|
|
|
|
|
+ i++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
order.setFreegiftSqArr(freegiftSqArr);
|
|
order.setFreegiftSqArr(freegiftSqArr);
|
|
@@ -62,29 +61,32 @@ public class TscFreegiftService {
|
|
|
|
|
|
|
|
int[] freegiftSectionSqArr = new int[fregiftGoodsApplyAmtList.size()];
|
|
int[] freegiftSectionSqArr = new int[fregiftGoodsApplyAmtList.size()];
|
|
|
|
|
|
|
|
|
|
+ int tempFreegiftSectionSq = 0;
|
|
|
|
|
+ int k = 0;
|
|
|
|
|
+
|
|
|
// 사은품시퀀스(FREEGIFT_SQ), 사은품시퀀스합계금액(FREEGIFT_AMT)
|
|
// 사은품시퀀스(FREEGIFT_SQ), 사은품시퀀스합계금액(FREEGIFT_AMT)
|
|
|
for (Order fregiftGoodsApplyAmt : fregiftGoodsApplyAmtList) {
|
|
for (Order fregiftGoodsApplyAmt : fregiftGoodsApplyAmtList) {
|
|
|
-
|
|
|
|
|
- int freegiftAmt = fregiftGoodsApplyAmt.getFreegiftAmt();
|
|
|
|
|
- int freegiftSq = fregiftGoodsApplyAmt.getFreegiftSq();
|
|
|
|
|
|
|
+ int freegiftAmt = fregiftGoodsApplyAmt.getFreegiftAmt();
|
|
|
|
|
|
|
|
// 사은풐구간시퀀스(FREEGIFT_SECTION_SQ, 사은품시퀀스(FREEGIFT_SQ), 사은풐구간금액(SECTION_VAL)
|
|
// 사은풐구간시퀀스(FREEGIFT_SECTION_SQ, 사은품시퀀스(FREEGIFT_SQ), 사은풐구간금액(SECTION_VAL)
|
|
|
for (Order freegiftGoodsApplySection : freegiftGoodsApplySectionList) {
|
|
for (Order freegiftGoodsApplySection : freegiftGoodsApplySectionList) {
|
|
|
- int freegiftSectionSq = freegiftGoodsApplySection.getFreegiftSectionSq();
|
|
|
|
|
- int sectionVal = freegiftGoodsApplySection.getSectionVal();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ int freegiftSectionSq = freegiftGoodsApplySection.getFreegiftSectionSq();
|
|
|
|
|
+ int sectionVal = freegiftGoodsApplySection.getSectionVal();
|
|
|
|
|
|
|
|
|
|
+ if (freegiftAmt > sectionVal) {
|
|
|
|
|
+ tempFreegiftSectionSq = freegiftSectionSq;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ freegiftSectionSqArr[k] = tempFreegiftSectionSq;
|
|
|
|
|
+ k++;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 3. 사은품 적용구간 의 적용 사은품정보조회
|
|
|
|
|
+ order.setFreegiftSectionSqArr(freegiftSectionSqArr);
|
|
|
|
|
+ Collection<Order> freegiftGoodsApplyValList = freegiftDao.getFreeGiftGoodsApplyVal(order);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- return freegiftList;
|
|
|
|
|
|
|
+ return freegiftGoodsApplyValList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|