|
|
@@ -5,7 +5,13 @@ import com.style24.core.biz.dao.TscDeliveryDao;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.persistence.domain.WmsDelivery;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
+import com.style24.persistence.domain.ErpStock;
|
|
|
+
|
|
|
+import com.style24.core.biz.service.TscErpService;
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -28,7 +34,59 @@ public class TscWmsService {
|
|
|
@Autowired
|
|
|
private TscDeliveryDao deliveryDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TscErpService erpService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 실시간 재고조회(WMS&ERP)
|
|
|
+ * @param Delivery
|
|
|
+ * @return Collection<WmsDelivery> stockLoc:WH-wms 외 매장코드 locQty: 수량
|
|
|
+ * @author moon
|
|
|
+ * @since 2021. 03. 28
|
|
|
+ */
|
|
|
+ public Collection<WmsDelivery> getRealStock(Integer productNo, String skuCode, String styleCd, String colorCd, String sizeCd) {
|
|
|
+
|
|
|
+ //// 임시
|
|
|
+ //productNo = 14475554;
|
|
|
+ //skuCode = "13096364-5"; // "13096364-5"
|
|
|
+ //styleCd = "COF0GABL02";
|
|
|
+ //colorCd = "CE"; //"CE"
|
|
|
+ //sizeCd = "150";
|
|
|
+ //////
|
|
|
+
|
|
|
+ Collection<WmsDelivery> list = new ArrayList();
|
|
|
+ String chk1 = "N";
|
|
|
+ String chk2 = "N";
|
|
|
+
|
|
|
+
|
|
|
+ WmsDelivery wmsRtn = getWmsRealStock(productNo, skuCode);
|
|
|
+
|
|
|
+ Collection<ErpStock> erpRtnList = erpService.getErpRealStock(styleCd, colorCd, sizeCd);
|
|
|
+
|
|
|
+ if(wmsRtn != null ) {
|
|
|
+ list.add(wmsRtn);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ chk1 = "Y";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!"".equals(erpRtnList) && erpRtnList != null) {
|
|
|
+ for(ErpStock data : erpRtnList) {
|
|
|
+ WmsDelivery tmp = new WmsDelivery();
|
|
|
+ tmp.setStockLoc(data.getStockLoc());
|
|
|
+ tmp.setLocQty(data.getLocQty());
|
|
|
+ list.add(tmp);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ chk2 = "Y";
|
|
|
+ }
|
|
|
+
|
|
|
+ if("Y".equals(chk1) && "Y".equals(chk2)) {
|
|
|
+ list = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* WMS 실재고 조회
|