|
|
@@ -30,6 +30,7 @@ import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.env.TscConstants.OrderChangeGb;
|
|
|
import com.style24.core.support.env.TscConstants.OrderChangeStat;
|
|
|
import com.style24.core.support.env.TscConstants.OrderDetailStat;
|
|
|
+import com.style24.core.support.env.TscConstants.OrdDtlItemStat;
|
|
|
import com.style24.persistence.domain.Delivery;
|
|
|
import com.style24.persistence.domain.Erp;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
@@ -86,21 +87,33 @@ public class TsbDeliveryService {
|
|
|
|
|
|
/**
|
|
|
* 총알배송 권역정보 갱신
|
|
|
- * @param Collection<Delivery>
|
|
|
+ * @param Delivery
|
|
|
* @return
|
|
|
* @author moon
|
|
|
* @since 2020. 12. 08
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
- public void mergeDailyDeliveryZone(Collection<Delivery> dailyDeliZoneList) {
|
|
|
+ public void mergeDailyDeliveryZone(Delivery data) {
|
|
|
|
|
|
deliveryDao.deleteDailyDeliveryZone();
|
|
|
|
|
|
- for (Delivery delivery : dailyDeliZoneList) {
|
|
|
- deliveryDao.mergeDailyDeliveryZone(delivery);
|
|
|
- }
|
|
|
+ deliveryDao.mergeDailyDeliveryZone(data);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 총알배송 권역정보 갱신 초기화
|
|
|
+ * @param Delivery
|
|
|
+ * @return
|
|
|
+ * @author moon
|
|
|
+ * @since 2020. 12. 08
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public void deleteDailyDeliveryZone() {
|
|
|
+
|
|
|
+ deliveryDao.deleteDailyDeliveryZone();
|
|
|
+
|
|
|
+ }
|
|
|
/**
|
|
|
* 회수예외 등록
|
|
|
* @param Collection<Delivery>
|
|
|
@@ -194,40 +207,85 @@ public class TsbDeliveryService {
|
|
|
* @since 2021. 03. 09
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
- public void updateTbOrderDtlStat(Collection<Delivery> list, String statGb) {
|
|
|
+ public void updateTbOrderDtlStat(Collection<Delivery> List, String statGb) {
|
|
|
// TB_ORDER_DETAIL , TB_ORDER_DETAIL_ITEM 상태값 변경
|
|
|
- for (Delivery data : list) {
|
|
|
+ for(Delivery data : List) {
|
|
|
if ("SHIPPING".equals(statGb)) {
|
|
|
data.setInvoiceSendYn("Y");
|
|
|
data.setOrdDtlStat(OrderDetailStat.SHIPPING.value());
|
|
|
} else if ("PREPARE".equals(statGb)) {
|
|
|
data.setOrdDtlStat(OrderDetailStat.GOODS_PREPARE.value());
|
|
|
}
|
|
|
-
|
|
|
- if (99999999 == data.getOrderdtlno()) {
|
|
|
+
|
|
|
+ if (999999999 == data.getOrderdtlno()) {
|
|
|
Delivery dtlNo = deliveryDao.getOrdDtlno(data);
|
|
|
data.setOrdDtlNo(dtlNo.getOrdDtlNo());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
data.setUpdNo(TsbConstants.REG_NO);
|
|
|
data.setRegNo(TsbConstants.REG_NO);
|
|
|
- deliveryDao.updateTbOrderDtlStat(data);
|
|
|
+ int rtn = deliveryDao.updateTbOrderDtlStat(data);
|
|
|
+
|
|
|
+ if(rtn > 0) {
|
|
|
+ // 주문상세이력
|
|
|
+ Order order = new Order();
|
|
|
+ order.setOrdDtlNo(data.getOrderdtlno());
|
|
|
+ order.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ order.setRegNo(TsbConstants.REG_NO);
|
|
|
+ orderDao.createOrderDetailHst(order);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 출고결과 반영
|
|
|
+ * @param Collection<Delivery>
|
|
|
+ * @return
|
|
|
+ * @author moon
|
|
|
+ * @since 2021. 03. 09
|
|
|
+ */
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
+ public void updateTbOrderDtlStat(Delivery data, String statGb) {
|
|
|
+ // TB_ORDER_DETAIL , TB_ORDER_DETAIL_ITEM 상태값 변경
|
|
|
+ if ("SHIPPING".equals(statGb)) {
|
|
|
+ data.setInvoiceSendYn("Y");
|
|
|
+ data.setOrdDtlStat(OrderDetailStat.SHIPPING.value());
|
|
|
+ } else if ("PREPARE".equals(statGb)) {
|
|
|
+ data.setOrdDtlStat(OrderDetailStat.GOODS_PREPARE.value());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (999999999 == data.getOrderdtlno()) {
|
|
|
+ Delivery dtlNo = deliveryDao.getOrdDtlno(data);
|
|
|
+ data.setOrdDtlNo(dtlNo.getOrdDtlNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ data.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ data.setRegNo(TsbConstants.REG_NO);
|
|
|
+ int rtn = deliveryDao.updateTbOrderDtlStat(data);
|
|
|
+
|
|
|
+ if(rtn > 0) {
|
|
|
// 주문상세이력
|
|
|
Order order = new Order();
|
|
|
order.setOrdDtlNo(data.getOrderdtlno());
|
|
|
order.setUpdNo(TsbConstants.REG_NO);
|
|
|
order.setRegNo(TsbConstants.REG_NO);
|
|
|
orderDao.createOrderDetailHst(order);
|
|
|
-
|
|
|
- if ("SHIPPING".equals(statGb)) {
|
|
|
- // core쪽으로 교체!!
|
|
|
- //data.setOrdDtlNo(data.getOrderdtlno());
|
|
|
- //deliveryDao.createOrderDetailItemHst(data);
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 정산관련 등록 TB_ORDER_DETAIL_ITEM_HST [G720_20] 판매-배송완료
|
|
|
+
|
|
|
+ Collection<Delivery> itemList = deliveryDao.getOrdDtlItemSq(data);
|
|
|
+ for(Delivery item : itemList) {
|
|
|
+ Order ordItem = new Order();
|
|
|
+ ordItem.setRegNo(TsbConstants.REG_NO);
|
|
|
+ ordItem.setUpdNo(TsbConstants.REG_NO);
|
|
|
+ ordItem.setOrdDtlItemSq(item.getOrdDtlItemSq());
|
|
|
+ ordItem.setOrdDtlStat(OrdDtlItemStat.SALE_SHIPPING.value()); // [G720_20] 판매-배송완료
|
|
|
+ orderDao.createOrderDetailItemHst(ordItem);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 회수결과 처리
|
|
|
* @param Delivery
|
|
|
@@ -457,7 +515,7 @@ public class TsbDeliveryService {
|
|
|
index++;
|
|
|
}
|
|
|
|
|
|
- // 교환주문 상세 수성
|
|
|
+ // 교환주문 상세 수정
|
|
|
vo.setOrdDtlStat(OrderDetailStat.PAYMENT_COMPLETE.value()); // 교환주문상세 결제완료
|
|
|
vo.setOrdDtlNo(data.getChgOrdDtlNo());
|
|
|
vo.setWdBfSendYn(data.getWdBfSendYn());
|
|
|
@@ -550,7 +608,7 @@ public class TsbDeliveryService {
|
|
|
orderDetailItem.setOrdDtlStat(vo.getOrdDtlStat());
|
|
|
|
|
|
// 2021.06.25 WMS 회수정보 수집 (교환결제완료) (정산구분값추가)
|
|
|
- orderDetailItem.setOrdDtlStat(TscConstants.OrdDtlItemStat.SALE_PAYMENT_COMPLETE.value());
|
|
|
+ orderDetailItem.setOrdDtlStat(TscConstants.OrdDtlItemStat.SALE_PAYMENT_COMPLETE.value()); // G720_10 판매-결제완료
|
|
|
orderDetailItem.setCnclRtnQty(0);
|
|
|
orderDetailItem.setOrdChgSq(ordInfo.getOrdChgSq());
|
|
|
orderChangeDao.createOrderDetailItemHst(orderDetailItem);
|
|
|
@@ -1004,29 +1062,30 @@ public class TsbDeliveryService {
|
|
|
|
|
|
/**
|
|
|
* 주문변경상세 상태값 변경
|
|
|
- * @param Collection<Delivery>
|
|
|
+ * @param Delivery
|
|
|
* @return
|
|
|
* @author moon
|
|
|
* @since 2021. 04. 08
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
- public void updateTbOrderChaneDetailStat(Collection<Delivery> list) {
|
|
|
+ public void updateTbOrderChaneDetailStat(Delivery data) {
|
|
|
|
|
|
- for (Delivery data : list) {
|
|
|
- data.setUpdNo(TsbConstants.REG_NO);
|
|
|
-
|
|
|
- if("N".equals(data.getWdTargetYn())) {
|
|
|
+
|
|
|
+ data.setUpdNo(TsbConstants.REG_NO);
|
|
|
+
|
|
|
+ if("N".equals(data.getWdTargetYn())) {
|
|
|
+ data.setChgStat(OrderChangeStat.WITHDRAW_GOODS_CHECK.value()); // 상품검수중
|
|
|
+ } else {
|
|
|
+ if ("W".equals(data.getWdGb())) {// 회수요청
|
|
|
+ data.setChgStat(OrderChangeStat.WITHDRAW.value()); // 회수요청
|
|
|
+ } else { // 직접배송 - 상태값 상품검수중
|
|
|
data.setChgStat(OrderChangeStat.WITHDRAW_GOODS_CHECK.value()); // 상품검수중
|
|
|
- } else {
|
|
|
- if ("W".equals(data.getWdGb())) {// 회수요청
|
|
|
- data.setChgStat(OrderChangeStat.WITHDRAW.value()); // 회수요청
|
|
|
- } else { // 직접배송 - 상태값 상품검수중
|
|
|
- data.setChgStat(OrderChangeStat.WITHDRAW_GOODS_CHECK.value()); // 상품검수중
|
|
|
- }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- deliveryDao.updateTbOrderChaneDetailStat(data);
|
|
|
+ int rtn = deliveryDao.updateTbOrderChaneDetailStat(data);
|
|
|
|
|
|
+ if(rtn > 0) {
|
|
|
// 주문상세변경 이력
|
|
|
OrderChange ordChg = new OrderChange();
|
|
|
ordChg.setRegNo(0);
|
|
|
@@ -1036,6 +1095,7 @@ public class TsbDeliveryService {
|
|
|
ordChg.setChgStat(data.getChgStat());
|
|
|
orderChangeDao.createOrderChangeDetailHst(ordChg);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|