|
@@ -4,6 +4,7 @@ import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
|
|
|
import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
|
import com.ruoyi.ams.task.domain.WcsTask;
|
|
|
import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
|
+import com.ruoyi.ams.xuankuang.domain.form.EmptyPalletLocForm;
|
|
|
import com.ruoyi.ams.xuankuang.domain.form.StackingCompletionForm;
|
|
|
import com.ruoyi.ams.xuankuang.domain.form.TaskStatusForm;
|
|
|
import com.ruoyi.ams.xuankuang.domain.vo.LocationCoordinateVo;
|
|
@@ -110,6 +111,78 @@ public class WcsToWmsApiService {
|
|
|
return AjaxResult.success("仓位获取成功!", locationCoordinateVo);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 空托仓位请求
|
|
|
+ *
|
|
|
+ * @param emptyPalletLocForm
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ public synchronized AjaxResult EmptyPalletLoc(EmptyPalletLocForm emptyPalletLocForm) {
|
|
|
+ // 空托仓位请求类型
|
|
|
+ int taskType = emptyPalletLocForm.getTaskType();
|
|
|
+ // 任务号
|
|
|
+ String wcsNo = emptyPalletLocForm.getWcsNo();
|
|
|
+
|
|
|
+ // 判重
|
|
|
+ WcsTask wcsTaskQuery = new WcsTask();
|
|
|
+ wcsTaskQuery.setExt1("");
|
|
|
+ wcsTaskQuery.setExt2("");
|
|
|
+ wcsTaskQuery.setExt3(wcsNo);
|
|
|
+ WcsTask wcsTask = iWcsTaskService.selectWcsTaskByModel(wcsTaskQuery);
|
|
|
+ if (wcsTask != null) {
|
|
|
+ String locationTo = wcsTask.getLocationTo();
|
|
|
+ BaseLocationInfo baseLocationInfo = iBaseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationTo, Constant.WAREHOUSE_ID);
|
|
|
+ LocationCoordinateVo locationCoordinateVo = new LocationCoordinateVo();
|
|
|
+ locationCoordinateVo.setTaskNo(wcsTask.getTaskNo());
|
|
|
+ locationCoordinateVo.setLocationId(baseLocationInfo.getLocationNo());
|
|
|
+ locationCoordinateVo.setFloor(Integer.valueOf(baseLocationInfo.getShiftNo()));
|
|
|
+ locationCoordinateVo.setCol(Integer.valueOf(baseLocationInfo.getRowNo()));
|
|
|
+ locationCoordinateVo.setRow(Integer.valueOf(baseLocationInfo.getRowIndex()));
|
|
|
+ return AjaxResult.success("仓位获取成功!", locationCoordinateVo);
|
|
|
+ }
|
|
|
+ BaseLocationLotattVO baseLocationLotattVO = new BaseLocationLotattVO();
|
|
|
+ if (taskType == 1) {
|
|
|
+ // 推荐目标库位
|
|
|
+ baseLocationLotattVO = baseLocationInfoSubService.recommendAReceiptLocation(Constant.PALLET_TYPE);
|
|
|
+ if (baseLocationLotattVO == null) {
|
|
|
+ AjaxResult.error("没有可以推荐的目标库位!");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ baseLocationLotattVO = baseLocationInfoSubService.recommendAReceiptLocation(Constant.PALLET_TYPE1);
|
|
|
+ if (baseLocationLotattVO == null) {
|
|
|
+ AjaxResult.error("没有可以推荐的目标库位!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成任务
|
|
|
+ String taskNo = "";
|
|
|
+ AjaxResult ajaxResult = wcsTaskSubService.addWcsTask(Constant.LOC_STAGE_CACHE.toString()
|
|
|
+ , baseLocationLotattVO.getId().toString()
|
|
|
+ , ""
|
|
|
+ , ""
|
|
|
+ , wcsNo);
|
|
|
+ if (!ajaxResult.isSuccess()) {
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+ taskNo = ajaxResult.get("data").toString();
|
|
|
+ if (taskType ==1){
|
|
|
+ // 入库缓存位生成库存
|
|
|
+ InvLotLocIdSubService.initInv(Constant.LOC_STAGE_CACHE.toString(), Constant.PALLET_TYPE, "", "", taskNo, 1.0);
|
|
|
+ }else {
|
|
|
+ // 入库缓存位生成库存
|
|
|
+ InvLotLocIdSubService.initInv(Constant.LOC_STAGE_CACHE.toString(), Constant.PALLET_TYPE1, "", "", taskNo, 1.0);
|
|
|
+ }
|
|
|
+ // 反馈
|
|
|
+ LocationCoordinateVo locationCoordinateVo = new LocationCoordinateVo();
|
|
|
+ locationCoordinateVo.setTaskNo(taskNo);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 任务状态反馈
|