Bladeren bron

Merge remote-tracking branch 'origin/jsh77b' into xodud1202

xodud1202 5 jaren geleden
bovenliggende
commit
7dff0a91a1

+ 43 - 10
src/main/java/com/style24/core/biz/service/TscOrderService.java

@@ -844,6 +844,28 @@ public class TscOrderService {
 		return cartApplyCpnList;
 	}
 	
+	/**
+	 * 배송비쿠폰단위 상품 등록 
+	 *
+	 * @param Order
+	 * @author jsh77b
+	 * @since 2021. 02. 02
+	 */
+	public Collection<Order> getDelvCpnApplyList(Collection<Order> delvFeeCdList, Collection<Order> delvCpnAllList) {
+		
+		// 배송비가 있으면 배소업체코드, 배송비 배송비쿠폰에 설정
+		for (Order delvCpn : delvCpnAllList) {
+			for (Order delvFeeCd : delvFeeCdList) {
+				if (delvFeeCd.getDelvFee() > 0) {
+					delvCpn.setCpnDcAmt(delvFeeCd.getDelvFee());
+					delvCpn.setDelvFeeCd(delvFeeCd.getDelvFeeCd());
+				}
+			}
+		}
+		
+		return delvCpnAllList;
+	}
+	
 	// 쿠폰할인금액이 높은순으로 정렬 함수
 	private List<Order> getListSort(List<Order> goodsCpnList) {
 		int cnt 			= 0;
@@ -905,24 +927,34 @@ public class TscOrderService {
 		
 		GagaMap resultMap = new GagaMap();
 		
-		int prePntDcAmt 	= 0;
-		int goodsSumAmt 	= 0;
+		int orgGoodsSumAmt	= 0;
+		int currGoodsSumAmt	= 0;
 		int tmtbDcSumAmt 	= 0;
-		
+		int cpn1DcSumAmt	= 0;
+		int prePntDcAmt 	= 0;
+		int savePntSumAmt 	= 0;
+
 		// 상품금액, 배송비, 할인금액, 다다익선할인금액, 쿠폰할인금액, 선포인트사용, 포인트사용, 상품권사용
 		for (Order tmtbGoodsApply : tmtbGoodsApplyList) {
-			prePntDcAmt 	= prePntDcAmt + tmtbGoodsApply.getPrePntDcAmt();
-			goodsSumAmt 	= goodsSumAmt + ((tmtbGoodsApply.getCurrPrice() + tmtbGoodsApply.getOptAddPrice()) * tmtbGoodsApply.getGoodsQty());
-
+			orgGoodsSumAmt 		= orgGoodsSumAmt + ((tmtbGoodsApply.getOrgCurrPrice() + tmtbGoodsApply.getOptAddPrice()) * tmtbGoodsApply.getGoodsQty());	// 상품가
+			currGoodsSumAmt 	= currGoodsSumAmt + ((tmtbGoodsApply.getCurrPrice() + tmtbGoodsApply.getOptAddPrice()) * tmtbGoodsApply.getGoodsQty());		// 즉시할인상품가
+			cpn1DcSumAmt		= cpn1DcSumAmt + (orgGoodsSumAmt - currGoodsSumAmt);																		// 즉시할인금액
+			savePntSumAmt		= savePntSumAmt + tmtbGoodsApply.getSavePntAmt();																			// 적립에정포인트
+			
 			// 다다익선 할인금액이 있을때 적용
 			if (tmtbGoodsApply.getTmtbDcAmt() > 0) {
 				tmtbDcSumAmt = tmtbDcSumAmt + (((tmtbGoodsApply.getCurrPrice() + tmtbGoodsApply.getOptAddPrice()) * tmtbGoodsApply.getGoodsQty()) - tmtbGoodsApply.getTmtbDcAmt());
 			}
+			
+			// 선포인트 사용가능 금액
+			prePntDcAmt 		= prePntDcAmt + tmtbGoodsApply.getPrePntDcAmt();
 		}
 
-		resultMap.set("prePntDcAmt"		, prePntDcAmt);
-		resultMap.set("goodsSumAmt"		, goodsSumAmt);
-		resultMap.set("tmtbDcSumAmt"	, tmtbDcSumAmt);
+		resultMap.set("orgGoodsSumAmt"		, orgGoodsSumAmt);
+		resultMap.set("cpn1DcSumAmt"		, cpn1DcSumAmt);
+		resultMap.set("tmtbDcSumAmt"		, tmtbDcSumAmt);
+		resultMap.set("prePntDcAmt"			, prePntDcAmt);
+		resultMap.set("savePntSumAmt"		, savePntSumAmt);
 		
 		return resultMap;
 	}
@@ -1080,7 +1112,8 @@ public class TscOrderService {
 		resultMap.set("delvAllCartList"		, delvAllCartList);		// 전체배송목록 sort
 		resultMap.set("delvCartList"		, delvCartList);		// 입점업체상품목록
 		resultMap.set("sumDelvFee"			, sumDelvFee);			// 배송비합계
-				
+		resultMap.set("delvFeeCdList"		, delvFeeCdList);		// 배송업체목록
+		
 		return resultMap;
 	}
 	

+ 2 - 1
src/main/java/com/style24/persistence/mybatis/shop/TscOrder.xml

@@ -1813,7 +1813,8 @@
 		  FROM TB_CUST_POINT CP
 		 WHERE 1=1
 		   AND CP.CUST_NO = #{custNo}
-		   AND CP.EXP_BE_DT <![CDATA[>]]> NOW()
+		   AND CP.EXP_BE_DT <![CDATA[<]]> NOW()
+		   AND CP.EXP_CMP_DT <![CDATA[>=]]> NOW()
 	</select>
 	
 	<!-- 상품권정보 조회 -->