|
@@ -0,0 +1,95 @@
|
|
|
+package com.ruoyi.ams.xuankuang.service;
|
|
|
+
|
|
|
+import com.ruoyi.ams.business.IBusinessService;
|
|
|
+import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
|
|
|
+import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO;
|
|
|
+import com.ruoyi.ams.config.domain.dto.LotattDTO;
|
|
|
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
|
+import com.ruoyi.base.constant.Constant;
|
|
|
+import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
|
|
|
+import com.ruoyi.base.service.IBaseLocationInfoService;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author Jwk
|
|
|
+ * @version 1.0
|
|
|
+ * @date 2023/6/6 13:35
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+public class AgvCallProxyService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBusinessService iBusinessService;
|
|
|
+ @Autowired
|
|
|
+ private IInvLotLocIdService invLotLocIdService;
|
|
|
+ @Autowired
|
|
|
+ private IBaseLocationInfoService baseLocationInfoService;
|
|
|
+ @Autowired
|
|
|
+ BaseLocationInfoSubService baseLocationInfoSubService;
|
|
|
+ @Autowired
|
|
|
+ WmsDocAsnSubService wmsDocAsnSubService;
|
|
|
+ /**
|
|
|
+ * 桶装入库
|
|
|
+ *
|
|
|
+ * @param locationFrom
|
|
|
+ * @param locationTo
|
|
|
+ * @param createUser
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult theBucketIsLoadedIntoTheLibrary(String locationFrom, String locationTo, Double qty,String palletNo) {
|
|
|
+ // todo 查询是否有可用库位,无可用库位直接结束,pda提示仓库内无可用库位
|
|
|
+ String sku = "C4H9O2PSSNH4";
|
|
|
+ BaseLocationLotattVO baseLocationLotattVO = baseLocationInfoSubService.recommendAReceiptLocation(sku);
|
|
|
+ if (baseLocationLotattVO == null){
|
|
|
+ AjaxResult.error("没有可以推荐的目标库位!");
|
|
|
+ }
|
|
|
+ AgvCallDTO agvCallDTO = new AgvCallDTO();
|
|
|
+ agvCallDTO.setLocationFrom(locationFrom);
|
|
|
+ agvCallDTO.setLocationTo(locationTo);
|
|
|
+ List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
|
|
|
+ AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
|
|
|
+ LotattDTO lotattDTO = new LotattDTO();
|
|
|
+ agvCallItemDTO.setSku("C4H9O2PSSNH4"); // 丁铵黑药
|
|
|
+ agvCallItemDTO.setQty(qty);
|
|
|
+ lotattDTO.setLotatt07(palletNo);
|
|
|
+ agvCallItemDTO.setLotattDTO(lotattDTO);
|
|
|
+ agvCallItemDTOList.add(agvCallItemDTO);
|
|
|
+ agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
|
|
|
+ AjaxResult ajaxResult = iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.TWO.getValue(), agvCallDTO);
|
|
|
+ if (ajaxResult.isSuccess()){
|
|
|
+ wmsDocAsnSubService.agvInTask(palletNo,qty);
|
|
|
+ }
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 桶装出库
|
|
|
+ *
|
|
|
+ * @param locationFrom
|
|
|
+ * @param locationTo
|
|
|
+ * @param createUser
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AjaxResult barrelsOutOfStorage(String locationFrom, String locationTo,String palletNo,String wcsId) {
|
|
|
+ AgvCallDTO agvCallDTO = new AgvCallDTO();
|
|
|
+ agvCallDTO.setLocationFrom(locationFrom);
|
|
|
+ agvCallDTO.setLocationTo(locationTo);
|
|
|
+ List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
|
|
|
+ LotattDTO lotattDTO = new LotattDTO();
|
|
|
+ lotattDTO.setLotatt07(palletNo);
|
|
|
+ lotattDTO.setLotatt08(wcsId);
|
|
|
+ AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
|
|
|
+ agvCallItemDTO.setSku("C4H9O2PSSNH4"); // 丁铵黑药
|
|
|
+ agvCallItemDTO.setLotattDTO(lotattDTO);
|
|
|
+ agvCallItemDTOList.add(agvCallItemDTO);
|
|
|
+ agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
|
|
|
+ return iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.ONE.getValue(), agvCallDTO);
|
|
|
+ }
|
|
|
+}
|