|
@@ -1,8 +1,12 @@
|
|
|
package com.ruoyi.ams.xuankuang.service;
|
|
|
|
|
|
import com.ruoyi.ams.xuankuang.domain.form.StackingCompletionForm;
|
|
|
+import com.ruoyi.ams.xuankuang.domain.vo.LocationCoordinateVo;
|
|
|
+import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
|
|
|
+import com.ruoyi.base.service.IBaseSkuService;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
/**
|
|
@@ -14,6 +18,10 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
public class WcsToWmsApiService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IBaseSkuService iBaseSkuService;
|
|
|
+ @Autowired
|
|
|
+ private BaseLocationInfoSubService baseLocationInfoSubService;
|
|
|
|
|
|
/**
|
|
|
* 组盘上报
|
|
@@ -22,9 +30,36 @@ public class WcsToWmsApiService {
|
|
|
* @return
|
|
|
*/
|
|
|
public AjaxResult stackingCompletion(StackingCompletionForm stackingCompletion) {
|
|
|
+ // 上报类型
|
|
|
+ int reportType = stackingCompletion.getReportType();
|
|
|
+ // 托盘号
|
|
|
+ String palletNo = stackingCompletion.getPalletNo();
|
|
|
+ // Wcs物料类型
|
|
|
+ String materialType = stackingCompletion.getMaterialType();
|
|
|
+ // wms物料编码
|
|
|
+ String sku = iBaseSkuService.selectBaseSkuByMaterialType(materialType).getSku();
|
|
|
+ // 数量
|
|
|
+ int qty = stackingCompletion.getQty();
|
|
|
+ // 入库单号
|
|
|
+ String asnNo = stackingCompletion.getRelatedWmsNo();
|
|
|
|
|
|
+ // 推荐目标库位
|
|
|
+ BaseLocationLotattVO baseLocationLotattVO = baseLocationInfoSubService.recommendAReceiptLocation(sku);
|
|
|
+ if (baseLocationLotattVO == null) {
|
|
|
+ AjaxResult.error("没有可以推荐的目标库位!");
|
|
|
+ }
|
|
|
|
|
|
- return AjaxResult.success();
|
|
|
+ // todo 生成任务
|
|
|
+ // todo 入库缓存位生成库存
|
|
|
+ // todo 修改入库单收货数量
|
|
|
+
|
|
|
+ // 反馈
|
|
|
+ LocationCoordinateVo locationCoordinateVo = new LocationCoordinateVo();
|
|
|
+ locationCoordinateVo.setLocationId(baseLocationLotattVO.getLocationNo());
|
|
|
+ locationCoordinateVo.setFloor(Integer.valueOf(baseLocationLotattVO.getShiftNo()));
|
|
|
+ locationCoordinateVo.setCol(Integer.valueOf(baseLocationLotattVO.getRowNo()));
|
|
|
+ locationCoordinateVo.setRow(Integer.valueOf(baseLocationLotattVO.getRowIndex()));
|
|
|
+ return AjaxResult.success("仓位获取成功!", locationCoordinateVo);
|
|
|
}
|
|
|
|
|
|
|