|
|
@@ -6,11 +6,18 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import com.style24.core.biz.dao.TscOrderChangeDao;
|
|
|
import com.style24.core.biz.dao.TscOrderDao;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
+import com.style24.core.support.env.TscConstants.OrderDetailStat;
|
|
|
+import com.style24.core.support.env.TscConstants.OrderChangeStat;
|
|
|
+
|
|
|
import com.style24.scm.biz.dao.TssDeliveryDao;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
import com.style24.persistence.domain.SweetTracker;
|
|
|
+import com.style24.persistence.domain.OrderChange;
|
|
|
+
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
/**
|
|
|
@@ -26,6 +33,9 @@ public class TssDeliveryService {
|
|
|
@Autowired
|
|
|
private TscMessageByLocale message;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TscOrderChangeDao orderChangeDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
private TssDeliveryDao deliveryDao;
|
|
|
|
|
|
@@ -37,16 +47,20 @@ public class TssDeliveryService {
|
|
|
* @param SweetTracker
|
|
|
* @return
|
|
|
* @author moon
|
|
|
- * @since 2020. 12. 08
|
|
|
+ * @since 2021. 04. 13
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
public void saveDelvStat(SweetTracker sweetTracker) {
|
|
|
|
|
|
+ // 배송완료건 상태값 변경
|
|
|
if(6 == sweetTracker.getLevel()) {
|
|
|
// 주문상세번호 조회
|
|
|
Collection<SweetTracker> list = deliveryDao.getOrdDtlNoList(sweetTracker);
|
|
|
for(SweetTracker data : list) {
|
|
|
// 주문상태값 변경
|
|
|
+ data.setUpdNo(0);
|
|
|
+ data.setRegNo(0);
|
|
|
+ data.setOrdDtlStat(OrderDetailStat.DELIVERY_COMPLETE.value()); // 배송완료 G013_60
|
|
|
deliveryDao.updateTbOrderDtlStat(data);
|
|
|
// 주문상세이력
|
|
|
Order order = new Order();
|
|
|
@@ -55,14 +69,31 @@ public class TssDeliveryService {
|
|
|
order.setRegNo(0);
|
|
|
orderDao.createOrderDetailHst(order);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ // 주문변경번호 조회
|
|
|
+ Collection<SweetTracker> chgList = deliveryDao.getOrdChgSqList(sweetTracker);
|
|
|
+ for(SweetTracker chgSq : chgList ) {
|
|
|
+
|
|
|
+ // 주문상세변경 상태값 변경
|
|
|
+ chgSq.setUpdNo(0);
|
|
|
+ chgSq.setRegNo(0);
|
|
|
+ chgSq.setChgStat(OrderChangeStat.WITHDRAW_GOODS_CHECK.value()); // 상품검수중 G685_31
|
|
|
+ deliveryDao.updateOrdChgSqStat(chgSq);
|
|
|
+
|
|
|
+ // 주문상세변경 이력
|
|
|
+ OrderChange ordChg = new OrderChange();
|
|
|
+ ordChg.setRegNo(0);
|
|
|
+ ordChg.setUpdNo(0);
|
|
|
+ ordChg.setOrdChgSq(chgSq.getOrdChgSq());
|
|
|
+ ordChg.setOrdDtlNo(chgSq.getOrdDtlNo());
|
|
|
+ orderChangeDao.createOrderChangeDetailHst(ordChg);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
// TB_SWEET_TRACKER 등록
|
|
|
- sweetTracker.setDelvLevel(sweetTracker.getLevel());
|
|
|
+ sweetTracker.setDelvLevel(sweetTracker.getLevel()+"");
|
|
|
sweetTracker.setDelvWhere(sweetTracker.getWhere());
|
|
|
deliveryDao.insertTbSweetTracker(sweetTracker);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|