Ver código fonte

1、agv呼叫实体类
2、agv入库出库service
3、agv调用接口

LZH 1 ano atrás
pai
commit
946c5d3790

+ 67 - 0
ruoyi-admin/src/main/java/com/ruoyi/xuankuang/controller/PdaAgvCallController.java

@@ -0,0 +1,67 @@
+package com.ruoyi.xuankuang.controller;
+
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
+import com.ruoyi.ams.xuankuang.domain.form.AgvCallForm;
+import com.ruoyi.ams.xuankuang.service.AgvCallProxyService;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Jwk
+ * @version 1.0
+ * @date 2023/6/6 13:26
+ */
+@Api("选矿PDA接口")
+@Slf4j
+@RestController
+@RequestMapping("/pda/agvCall")
+public class PdaAgvCallController {
+
+    @Autowired
+    private AgvCallProxyService agvCallProxyService;
+    @Autowired
+    private IInvLotLocIdService invLotLocIdService;
+    /**
+     * 桶装入库
+     *
+     * @param agvCallForm
+     * @return
+     */
+    @ApiOperation("桶装入库")
+    @PostMapping("/theBucketIsLoadedIntoTheLibrary")
+    public AjaxResult theBucketIsLoadedIntoTheLibrary(@RequestBody AgvCallForm agvCallForm) {
+        if (StringUtils.isEmpty(agvCallForm.getLocationFrom())) {
+            return AjaxResult.error("起始库位为空!");
+        }
+        String locationFrom = agvCallForm.getLocationFrom();
+        String locationTo = agvCallForm.getLocationTo();
+        Double qty = agvCallForm.getAgvCallItemDTOList().get(0).getQty();
+        String palletNo = agvCallForm.getAgvCallItemDTOList().get(0).getLotattDTO().getLotatt07();
+        return agvCallProxyService.theBucketIsLoadedIntoTheLibrary(locationFrom, locationTo, qty,palletNo);
+    }
+
+    /**
+     * 桶装出库
+     *
+     * @param agvCallForm
+     * @return
+     */
+    @ApiOperation("桶装出库")
+    @PostMapping("/barrelsOutOfStorage")
+    public AjaxResult barrelsOutOfStorage(@RequestBody AgvCallForm agvCallForm) {
+        if (StringUtils.isEmpty(agvCallForm.getLocationTo())) {
+            return AjaxResult.error("目标库位为空!");
+        }
+        String locationFrom = agvCallForm.getLocationFrom();
+        String locationTo = agvCallForm.getLocationTo();
+        return agvCallProxyService.barrelsOutOfStorage(locationFrom, locationTo,"","");
+    }
+}

+ 44 - 0
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/domain/form/AgvCallForm.java

@@ -0,0 +1,44 @@
+package com.ruoyi.ams.xuankuang.domain.form;
+
+import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author JWK
+ * @version 1.0
+ * @date 2023/5/25 18:00
+ */
+@Data
+public class AgvCallForm {
+
+    /**
+     * 起始库位
+     */
+    private String locationFrom;
+    /**
+     * 目标库位
+     */
+    private String locationTo;
+    /**
+     * 创建人
+     */
+    private String createUser = "PDA";
+    /**
+     * 是否裹膜
+     */
+    private Boolean theWrapped;
+    /**
+     * 是否复称
+     */
+    private Boolean theWeighing;
+
+
+    /**
+     * 物料信息
+     */
+    private List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+
+}

+ 95 - 0
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/AgvCallProxyService.java

@@ -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);
+    }
+}