Przeglądaj źródła

Merge branch 'develop' into card007

card007 4 lat temu
rodzic
commit
65f25be43c

+ 9 - 0
src/main/java/com/style24/core/biz/dao/TscOrderDao.java

@@ -1004,6 +1004,15 @@ public interface TscOrderDao {
 	 * @since 2021. 09. 02
 	 * @since 2021. 09. 02
 	 */
 	 */
 	int getExtmallOrderChk(Payment param);
 	int getExtmallOrderChk(Payment param);
+	
+	/**
+	 * 자동품절취소실패목록
+	 * @param Order
+	 * @return
+	 * @author jsh77b
+	 * @since 2021. 09. 11
+	 */
+	Collection<Order> getSoldOutCnclFailList(Order order);
 }
 }
 
 
 
 

+ 5 - 1
src/main/java/com/style24/core/biz/service/TscOrderOcmService.java

@@ -454,6 +454,9 @@ public class TscOrderOcmService {
 		int dtlCnt = orderDetailList.size();
 		int dtlCnt = orderDetailList.size();
 		int succCnt = 0;
 		int succCnt = 0;
 		int stockFailCnt = 0;
 		int stockFailCnt = 0;
+		
+		failGoodsAdmMsg += "\n쇼핑몰주문번호: "+order.getExtmallOrderId();
+		failGoodsAdmMsg += "\n샵링커주문번호: ";
 		for (ExtmallOrder orderDetail : orderDetailList) {
 		for (ExtmallOrder orderDetail : orderDetailList) {
 
 
 			GagaMap resultMap = this.checkGoodsInfo(orderDetail);
 			GagaMap resultMap = this.checkGoodsInfo(orderDetail);
@@ -467,7 +470,8 @@ public class TscOrderOcmService {
 				// 알림톡 발송 할 목록
 				// 알림톡 발송 할 목록
 				if("Y".equals(resultMap.get("sendNotiYn"))){
 				if("Y".equals(resultMap.get("sendNotiYn"))){
 					failGoods += resultMap.get("goodsNm") + ",";
 					failGoods += resultMap.get("goodsNm") + ",";
-					failGoodsAdmMsg += "\n"+resultMap.get("goodsNm")+"("+resultMap.get("optCd")+ "),";
+					failGoodsAdmMsg += orderDetail.getAgentOrderId()+" ,";
+					//failGoodsAdmMsg += "\n상품:"+resultMap.get("goodsNm")+"("+resultMap.get("optCd")+ "),";
 					stockFailCnt ++;
 					stockFailCnt ++;
 				}
 				}
 			}
 			}

+ 17 - 3
src/main/java/com/style24/core/biz/service/TscOrderService.java

@@ -2943,12 +2943,14 @@ public class TscOrderService {
 					idx++;
 					idx++;
 
 
 					try {
 					try {
+						// 2021.09.11 태영아 이소스는 뭘까? 알려주삼
+						// 네이버페이 주문형 정보일때 사용하는것으로 판단됨
 						if ("scm".equals(env.getProperty("server.site.name"))) {
 						if ("scm".equals(env.getProperty("server.site.name"))) {
-							naverPayService.sendNaverPayExchangeCollectComplete(vo, userNo);    // 교환재배송
+							naverPayService.sendNaverPayExchangeCollectComplete(vo, userNo);		// 교환재배송
 						} else {
 						} else {
-							// naverPayService.sendNaverPayExchangeReDelivery(change, userNo);    // 교환재배송
+							// naverPayService.sendNaverPayExchangeReDelivery(change, userNo);    	// 교환재배송
 							String addUrl = "/naverpay/send/exchange/collect/complete?ordDtlNo=" + vo.getOrdDtlNo() + "&userNo=" + userNo;
 							String addUrl = "/naverpay/send/exchange/collect/complete?ordDtlNo=" + vo.getOrdDtlNo() + "&userNo=" + userNo;
-							naverPayService.sendScmServerForNaverpay(addUrl);                        // 교환 반려
+							naverPayService.sendScmServerForNaverpay(addUrl);						// 교환 반려
 						}
 						}
 					} catch (Exception e) {
 					} catch (Exception e) {
 						e.printStackTrace();
 						e.printStackTrace();
@@ -3290,6 +3292,18 @@ public class TscOrderService {
 	public Order getEntryNo(Order order) {
 	public Order getEntryNo(Order order) {
 		return orderDao.getEntryNo(order);
 		return orderDao.getEntryNo(order);
 	}
 	}
+	
+	/**
+	 * 자동품절취소실패목록
+	 *
+	 * @param order - 주문 정보
+	 * @return Collection<Order>
+	 * @author jsh77b
+	 * @since 2021. 09. 11
+	 */
+	public Collection<Order> getSoldOutCnclFailList(Order order) {
+		return orderDao.getSoldOutCnclFailList(order);
+	}
 }
 }
 
 
 
 

+ 0 - 20
src/main/java/com/style24/core/biz/service/TscPointService.java

@@ -127,26 +127,6 @@ public class TscPointService {
 		pointDao.createOrderDecisionPoint(point);
 		pointDao.createOrderDecisionPoint(point);
 		// 3.구매확정 포인트 히스토리 수정
 		// 3.구매확정 포인트 히스토리 수정
 		pointDao.updateOrderDecisionPointHst(point);
 		pointDao.updateOrderDecisionPointHst(point);
-
-		// 3-1 알림톡 추가 (배송완료(상품평등록안내)알림톡) 2021-09-08 박중재팀장님 요청!!  
-		try {
-			// 배송완료(상품평등록안내)알림톡
-			Order sweetTracker = new Order();
-			sweetTracker.setOrdDtlNo(point.getOrdDtlNo());
-			Order info = deliveryDao.getOrdNoInfoKakao(sweetTracker);
-			if("Y".equals(info.getAllYn())) {
-				if(MallGb.SELFMALL.value().equals(info.getMallGb()) && "O".equals(info.getOrdExchGb())) {
-					Order orderSend = new Order();
-					orderSend.setOrdNo(info.getOrdNo());
-					orderSend.setCustNo(info.getCustNo());
-					orderSend.setOrdNm(info.getOrdNm());
-					orderSend.setOrdPhnno(info.getOrdPhnno());
-					kakaotalkService.sendDeliveryComplete(orderSend, point.getRegNo());
-				}
-			}
-		}catch(Exception e) {
-			log.debug("배송완료 알림톡 Exception ordDtlNo: "+point.getOrdDtlNo()+" "+e.getStackTrace());
-		}
 		
 		
 		// 4.주문상세 상태 변경 및 히스토리 생성
 		// 4.주문상세 상태 변경 및 히스토리 생성
 		Order order = new Order();
 		Order order = new Order();

+ 5 - 0
src/main/java/com/style24/persistence/domain/Order.java

@@ -806,4 +806,9 @@ public class Order extends TscBaseDomain {
 		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.phoneNo(getOrderPhnno()) : getOrderPhnno();
 		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.phoneNo(getOrderPhnno()) : getOrderPhnno();
 	}
 	}
 	
 	
+	private int exceptionQty;		// 품절수량
+	private String reasonCd;		// 사유
+	
+	private String cnclsmsSendYn;	// 취소문자발송여부(Y:제휴몰에서발송, N:자사몰에서발송)
+	
 }
 }

+ 117 - 0
src/main/java/com/style24/persistence/mybatis/shop/TscOrder.xml

@@ -5451,6 +5451,123 @@
 		AND    P.PAY_GB = 'O'
 		AND    P.PAY_GB = 'O'
 		AND    P.ORD_NO = #{ordNo}
 		AND    P.ORD_NO = #{ordNo}
 	</select>
 	</select>
+	
+	<!-- 자동품절취소실패목록 -->
+	<select id="getSoldOutCnclFailList" parameterType="Order" resultType="Order">
+		/* order.getSoldOutCnclFailList */
+		SELECT AA.ORD_NO
+		     , AA.ORD_DTL_NO
+		     , AA.ORD_DTL_STAT
+		     , AA.GOODS_CD
+		     , AA.GOODS_NM
+		     , GROUP_CONCAT(AA.OPT_CD ORDER BY AA.ORD_DTL_ITEM_SQ) AS OPT_CD
+			 , GROUP_CONCAT(AA.OPT_CD1 ORDER BY AA.ORD_DTL_ITEM_SQ) AS OPT_CD1
+			 , GROUP_CONCAT(AA.OPT_CD2 ORDER BY AA.ORD_DTL_ITEM_SQ) AS OPT_CD2
+		     , AA.ORD_QTY
+		     , AA.CNCL_RTN_QTY 
+		     , AA.EXCEPTION_QTY
+		     , AA.REASON_CD
+		     , AA.PAY_MEANS_NM
+		     , AA.PG_TID 
+		     , AA.REG_DT
+		     , AA.UPD_DT
+		     , AA.DELV_FEE_CD
+		     , AA.DELV_FEE_CD_GRP
+		     , AA.ORD_EXCH_GB
+		FROM (
+			SELECT OD.ORD_NO
+			     , OD.ORD_DTL_NO
+			     , OD.ORD_DTL_STAT
+			     , G.GOODS_CD
+			     , G.GOODS_NM
+			     , ODI.ORD_DTL_ITEM_SQ 
+			     , ODI.OPT_CD
+			     , ODI.OPT_CD1
+			     , ODI.OPT_CD2
+			     , OD.ORD_QTY
+			     , OD.CNCL_RTN_QTY 
+			     , A.EXCEPTION_QTY
+			     , A.REASON_CD
+			     , CASE WHEN P.PG_GB IN ('KCP') THEN (SELECT CD_NM FROM TB_COMMON_CODE X WHERE X.CD = P.PAY_MEANS)
+			            WHEN P.PG_GB IN ('KAKAO') THEN '카카오'
+			            WHEN P.PG_GB IN ('NAVER') THEN '네이버'
+			            WHEN P.PG_GB IN ('PAYCO') THEN '페이코'
+			            ELSE '외부몰입금'
+			            END PAY_MEANS_NM  
+			     , P.PG_TID 
+			     , OD.REG_DT
+			     , OD.UPD_DT
+			     , OD.DELV_FEE_CD
+			     , OD.DELV_FEE_CD AS DELV_FEE_CD_GRP
+			     , OD.ORD_EXCH_GB
+			FROM   TB_ORDER_DETAIL OD
+			INNER  JOIN TB_ORDER O
+			ON     OD.ORD_NO = O.ORD_NO
+			INNER  JOIN TB_ORDER_DETAIL_ITEM ODI
+			ON     OD.ORD_DTL_NO = ODI.ORD_DTL_NO
+			INNER  JOIN TB_GOODS G
+			ON     OD.GOODS_CD = G.GOODS_CD
+			INNER  JOIN (
+				SELECT ODEI.ORD_DTL_NO
+				     , ODEI.REASON_CD
+				     , ODEI.EXCEPTION_QTY
+				FROM   TB_ORDER_DELIVERY_EXCEPTION ODE
+				INNER  JOIN TB_ORDER_DELIVERY_EXCEPTION_ITEM ODEI
+				ON     ODE.DELIVERY_EXCEPTION_SQ = ODEI.DELIVERY_EXCEPTION_SQ 
+				WHERE  1=1
+				AND    ODEI.REASON_CD IN ('재고부족')
+				UNION  ALL
+				SELECT OREI.ORDER_DTL_NO 
+				     , OREI.REASON_CD
+				     , OREI.EXCEPTION_QTY
+				FROM   TB_ORDER_RECALL_EXCEPTION ORE
+				INNER  JOIN TB_ORDER_RECALL_EXCEPTION_ITEM OREI
+				ON     ORE.RECALL_EXCEPTION_NO = OREI.RECALL_EXCEPTION_NO
+				WHERE  1=1
+				AND    OREI.REASON_CODE IN ('08', '10')
+				AND    ORE.RECALL_STAT = 'P'
+			) A
+			ON     OD.ORD_DTL_NO = A.ORD_DTL_NO
+			LEFT   JOIN TB_ORDER_CHANGE_DETAIL OCD
+			ON     A.ORD_DTL_NO = OCD.ORD_DTL_NO
+			INNER  JOIN TB_PAYMENT P
+			ON     OD.ORD_NO = P.ORD_NO
+			AND    P.PAY_GB = 'O'
+			WHERE  1=1
+			AND    OCD.ORD_DTL_NO IS NULL
+			<if test='ordNo != null and ordNo != ""'>
+			AND    OD.ORD_NO = #{ordNo}
+			</if>
+			<if test='ordNm != null and ordNm != ""'>
+			AND    O.ORD_NM = #{ordNm}
+			</if>
+			<if test='goodsCd != null and goodsCd != ""'>
+			AND    OD.GOODS_CD = #{goodsCd}
+			</if>
+			<if test='stDate != null and stDate != ""'>
+				<if test='searchDateGb != null and searchDateGb == "ordDt"'>
+			       AND O.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+			       AND O.REG_DT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+				</if>
+			</if>
+		) AA
+		GROUP  BY AA.ORD_NO
+		     , AA.ORD_DTL_NO
+		     , AA.ORD_DTL_STAT
+		     , AA.GOODS_CD
+		     , AA.GOODS_NM
+		     , AA.ORD_QTY
+		     , AA.CNCL_RTN_QTY 
+		     , AA.EXCEPTION_QTY
+		     , AA.REASON_CD
+		     , AA.PAY_MEANS_NM
+		     , AA.PG_TID 
+		     , AA.REG_DT
+		     , AA.UPD_DT
+		     , AA.DELV_FEE_CD
+		     , AA.DELV_FEE_CD_GRP
+		     , AA.ORD_EXCH_GB
+	</select>
 </mapper>
 </mapper>
 
 
 
 

+ 27 - 3
src/main/java/com/style24/persistence/mybatis/shop/TscScm.xml

@@ -53,6 +53,12 @@
 		<if test='supplyCompCd != null and supplyCompCd != ""'>
 		<if test='supplyCompCd != null and supplyCompCd != ""'>
 		AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 		AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 		</if>
 		</if>
+		<if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+		AND    OD.SUPPLY_COMP_CD IN
+			<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+		           #{item}
+			</foreach>
+		</if>
 		<if test="multiBrand != null and multiBrand != ''">
 		<if test="multiBrand != null and multiBrand != ''">
 		AND    G.BRAND_CD IN
 		AND    G.BRAND_CD IN
 			<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
 			<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
@@ -179,10 +185,16 @@
 		            <if test='supplyCompCd != null and supplyCompCd != ""'>
 		            <if test='supplyCompCd != null and supplyCompCd != ""'>
 		            AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 		            AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 		            </if>
 		            </if>
+		            <if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+		                   AND OD.SUPPLY_COMP_CD IN
+						<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+		                       #{item}
+						</foreach>
+					</if>
 		            <if test="multiBrand != null and multiBrand != ''">
 		            <if test="multiBrand != null and multiBrand != ''">
 		            AND    G.BRAND_CD IN
 		            AND    G.BRAND_CD IN
 		            	<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
 		            	<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-		            		#{item}
+		                       #{item}
 		            	</foreach>
 		            	</foreach>
 		            </if>
 		            </if>
 		            <if test="ordDtlStat != null and ordDtlStat != ''">
 		            <if test="ordDtlStat != null and ordDtlStat != ''">
@@ -494,10 +506,16 @@
 		<if test='supplyCompCd != null and supplyCompCd != ""'>
 		<if test='supplyCompCd != null and supplyCompCd != ""'>
 		AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 		AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 		</if>
 		</if>
+		<if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+		AND    OD.SUPPLY_COMP_CD IN
+			<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+		    #{item}
+			</foreach>
+		</if>
 		<if test="multiBrand != null and multiBrand != ''">
 		<if test="multiBrand != null and multiBrand != ''">
 		AND    G.BRAND_CD IN
 		AND    G.BRAND_CD IN
 			<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
 			<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-				#{item}
+		    #{item}
 			</foreach>
 			</foreach>
 		</if>
 		</if>
 		<if test='chgGb != null and chgGb != ""'>
 		<if test='chgGb != null and chgGb != ""'>
@@ -602,10 +620,16 @@
 				<if test='supplyCompCd != null and supplyCompCd != ""'>
 				<if test='supplyCompCd != null and supplyCompCd != ""'>
 				AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 				AND    OD.SUPPLY_COMP_CD = #{supplyCompCd}
 				</if>
 				</if>
+				<if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+				AND OD.SUPPLY_COMP_CD IN
+					<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+				    #{item}
+					</foreach>
+				</if>
 				<if test="multiBrand != null and multiBrand != ''">
 				<if test="multiBrand != null and multiBrand != ''">
 				AND    G.BRAND_CD IN
 				AND    G.BRAND_CD IN
 					<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
 					<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-						#{item}
+				    #{item}
 					</foreach>
 					</foreach>
 				</if>
 				</if>
 				<if test='chgGb != null and chgGb != ""'>
 				<if test='chgGb != null and chgGb != ""'>