|
|
@@ -192,45 +192,83 @@ public class TsbDeliveryOrderJob extends TsbAbstractJob<Collection<Delivery>, Co
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- // 주문상세번호 조회
|
|
|
- Collection<Delivery> ordDtlNoWmsList = deliveryService.getOrderDtlNoList(ordNoData);
|
|
|
- int chkCnt = 0;
|
|
|
- for(Delivery wmsOrdDtlData : ordDtlNoWmsList) {
|
|
|
- // 주문상세아이템 조회
|
|
|
- Collection<Delivery> itemList = deliveryService.getOrderDtlItemList(wmsOrdDtlData);
|
|
|
-
|
|
|
- for(Delivery item : itemList) {
|
|
|
- // WMS 재고체크
|
|
|
- WmsDelivery wmsStock = deliveryService.getWmsRealStockChk(item);
|
|
|
- if(wmsStock !=null) {
|
|
|
- if(wmsStock.getLocQty() >= item.getOrdQty()) {
|
|
|
- chkCnt = chkCnt+1;
|
|
|
+ if(!"NAVER_ORDER".equals(ordNoData.getPgGb())) {
|
|
|
+ // 주문상세번호 조회
|
|
|
+ Collection<Delivery> ordDtlNoWmsList = deliveryService.getOrderDtlNoList(ordNoData);
|
|
|
+ int chkCnt = 0;
|
|
|
+ for(Delivery wmsOrdDtlData : ordDtlNoWmsList) {
|
|
|
+ // 주문상세아이템 조회
|
|
|
+ Collection<Delivery> itemList = deliveryService.getOrderDtlItemList(wmsOrdDtlData);
|
|
|
+
|
|
|
+ for(Delivery item : itemList) {
|
|
|
+ // WMS 재고체크
|
|
|
+ WmsDelivery wmsStock = deliveryService.getWmsRealStockChk(item);
|
|
|
+ if(wmsStock !=null) {
|
|
|
+ if(wmsStock.getLocQty() >= item.getOrdQty()) {
|
|
|
+ chkCnt = chkCnt+1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if(chkCnt > 0) {
|
|
|
+ if(chkCnt > 0) {
|
|
|
+ for(Delivery wmsOrdDtlData : ordDtlNoWmsList) {
|
|
|
+ wmsOrdDtlData.setDelvLocCd("DL001");
|
|
|
+
|
|
|
+ // 출고처등록 및 history 등록 (TB_DELIVERY_ASSIGN & TB_DELIVERY_ASSIGN_HST)
|
|
|
+ wmsOrdDtlData.setDelvArGb("Y"); // 수락
|
|
|
+ deliveryService.saveDeliveryAssign(wmsOrdDtlData);
|
|
|
+
|
|
|
+ // 주문상태변경 및 출고처코드 등록 (TB_ORDER_DETAIL & TB_ORDER_DETAIL_HST)
|
|
|
+ wmsOrdDtlData.setOrdDtlStat("G013_35"); // 출고처지정
|
|
|
+ wmsOrdDtlData.setDelvAssignStat("Y"); // 출고처지정상태
|
|
|
+ deliveryService.updateTbOrderDtlAssign(wmsOrdDtlData);
|
|
|
+
|
|
|
+ // 주문상세아이템 조회
|
|
|
+ Collection<Delivery> itemList = deliveryService.getOrderDtlItemList(wmsOrdDtlData);
|
|
|
+ // wms 재고차감 등록(TB_SELL_QTY)
|
|
|
+ for(Delivery data : itemList) {
|
|
|
+ wmsDeliveryService.insertWmsTbIfDelifixQty(data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 주문상세번호 조회
|
|
|
+ Collection<Delivery> ordDtlNoWmsList = deliveryService.getOrderDtlNoList(ordNoData);
|
|
|
+
|
|
|
for(Delivery wmsOrdDtlData : ordDtlNoWmsList) {
|
|
|
- wmsOrdDtlData.setDelvLocCd("DL001");
|
|
|
-
|
|
|
- // 출고처등록 및 history 등록 (TB_DELIVERY_ASSIGN & TB_DELIVERY_ASSIGN_HST)
|
|
|
- wmsOrdDtlData.setDelvArGb("Y"); // 수락
|
|
|
- deliveryService.saveDeliveryAssign(wmsOrdDtlData);
|
|
|
-
|
|
|
- // 주문상태변경 및 출고처코드 등록 (TB_ORDER_DETAIL & TB_ORDER_DETAIL_HST)
|
|
|
- wmsOrdDtlData.setOrdDtlStat("G013_35"); // 출고처지정
|
|
|
- wmsOrdDtlData.setDelvAssignStat("Y"); // 출고처지정상태
|
|
|
- deliveryService.updateTbOrderDtlAssign(wmsOrdDtlData);
|
|
|
-
|
|
|
// 주문상세아이템 조회
|
|
|
Collection<Delivery> itemList = deliveryService.getOrderDtlItemList(wmsOrdDtlData);
|
|
|
- // wms 재고차감 등록(TB_SELL_QTY)
|
|
|
- for(Delivery data : itemList) {
|
|
|
- wmsDeliveryService.insertWmsTbIfDelifixQty(data);
|
|
|
+ int chkCnt = 0;
|
|
|
+ for(Delivery item : itemList) {
|
|
|
+ // WMS 재고체크
|
|
|
+ WmsDelivery wmsStock = deliveryService.getWmsRealStockChk(item);
|
|
|
+ if(wmsStock !=null) {
|
|
|
+ if(wmsStock.getLocQty() >= item.getOrdQty()) {
|
|
|
+ chkCnt = chkCnt+1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(chkCnt > 0) {
|
|
|
+ wmsOrdDtlData.setDelvLocCd("DL001");
|
|
|
+
|
|
|
+ // 출고처등록 및 history 등록 (TB_DELIVERY_ASSIGN & TB_DELIVERY_ASSIGN_HST)
|
|
|
+ wmsOrdDtlData.setDelvArGb("Y"); // 수락
|
|
|
+ deliveryService.saveDeliveryAssign(wmsOrdDtlData);
|
|
|
+
|
|
|
+ // 주문상태변경 및 출고처코드 등록 (TB_ORDER_DETAIL & TB_ORDER_DETAIL_HST)
|
|
|
+ wmsOrdDtlData.setOrdDtlStat("G013_35"); // 출고처지정
|
|
|
+ wmsOrdDtlData.setDelvAssignStat("Y"); // 출고처지정상태
|
|
|
+ deliveryService.updateTbOrderDtlAssign(wmsOrdDtlData);
|
|
|
+
|
|
|
+ // wms 재고차감 등록(TB_SELL_QTY)
|
|
|
+ for(Delivery data : itemList) {
|
|
|
+ wmsDeliveryService.insertWmsTbIfDelifixQty(data);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
} // for(Delivery ordNoData : ordnoList)
|