|
@@ -1,9 +1,14 @@
|
|
|
package com.emato.cus.supervise.biz.acqGoodsSeat;
|
|
|
|
|
|
import com.emato.cus.supervise.biz.CusWmsTask;
|
|
|
+import com.emato.cus.supervise.biz.acqInventoryInfo.AcqInventoryInfoOmsData;
|
|
|
import com.emato.cus.supervise.constant.EmtRecordTimeEnum;
|
|
|
import com.emato.cus.supervise.domain.WmsAcqGoodsOnSeat;
|
|
|
+import com.emato.cus.supervise.domainOms.OmsAcqInventoryInfo;
|
|
|
+import com.emato.cus.supervise.util.GsonUtil;
|
|
|
import com.emato.cus.supervise.util.LocalDateTimeUtils;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -11,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 库位货物数据 业务
|
|
@@ -31,6 +37,12 @@ public class AcqGoodsSeatBiz implements CusWmsTask {
|
|
|
@Autowired
|
|
|
private AcqGoodsOnSeatCusData acqGoodsOnSeatCusData;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AcqGoodsOnSeatDataConversion acqGoodsOnSeatDataConversion;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AcqInventoryInfoOmsData acqInventoryInfoOmsData;
|
|
|
+
|
|
|
private static final String DATA_TYPE_INFO = "[" + EmtRecordTimeEnum.ACQ_GOODS_ON_SEAT.getCode() + "]" + EmtRecordTimeEnum.ACQ_GOODS_ON_SEAT.getName();
|
|
|
|
|
|
|
|
@@ -60,9 +72,27 @@ public class AcqGoodsSeatBiz implements CusWmsTask {
|
|
|
LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN));
|
|
|
return;
|
|
|
}
|
|
|
+ List<String> merchSnList = Lists.newArrayList();
|
|
|
+
|
|
|
+ wmsList.forEach(i -> merchSnList.add(i.getMerchSn()));
|
|
|
+
|
|
|
+ // 根据sku查询oms系统数据。
|
|
|
+ List<OmsAcqInventoryInfo> omsList = acqInventoryInfoOmsData.getOmsData(merchSnList);
|
|
|
|
|
|
+ if (omsList == null || omsList.isEmpty()) {
|
|
|
+ logger.error("wms扫描到的数据" + GsonUtil.toJson(wmsList));
|
|
|
+ logger.info("--- 【" + DATA_TYPE_INFO + "】获取到本次扫描OMS数据为空, 不执行写数据操作, 本次扫描提前结束!!!");
|
|
|
+ //下次扫描时间
|
|
|
+ acqGoodsOnSeatRecordTime.updateWmsRecordTime(LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN),
|
|
|
+ LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map params = Maps.newHashMap();
|
|
|
+ params.put("wmsList", wmsList);
|
|
|
+ params.put("omsList", omsList);
|
|
|
+ List cusList = acqGoodsOnSeatDataConversion.conversion(params);
|
|
|
// 写CUS 数据
|
|
|
- int res = acqGoodsOnSeatCusData.insertCus(wmsList);
|
|
|
+ int res = acqGoodsOnSeatCusData.insertCus(cusList);
|
|
|
|
|
|
// 更新扫描时间
|
|
|
boolean bl = acqGoodsOnSeatRecordTime.updateWmsRecordTime(LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN),
|