Selaa lähdekoodia

PDA辅料搬运接口

k 1 vuosi sitten
vanhempi
commit
9ca936ded4

+ 31 - 0
ruoyi-admin/src/main/java/com/ruoyi/nieyan/controller/pda/PdaAgvCallController.java

@@ -1,9 +1,14 @@
 package com.ruoyi.nieyan.controller.pda;
 
 import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO;
+import com.ruoyi.ams.inv.domain.form.InvLotLocIdMoveForm;
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
 import com.ruoyi.ams.nieyan.domain.form.AgvCallForm;
 import com.ruoyi.ams.nieyan.service.AgvCallProxyService;
+import com.ruoyi.base.constant.Constant;
+import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -31,6 +36,8 @@ public class PdaAgvCallController {
 
     @Autowired
     private AgvCallProxyService agvCallProxyService;
+    @Autowired
+    private IInvLotLocIdService invLotLocIdService;
 
     /**
      * 补空托(空托暂存区)
@@ -287,4 +294,28 @@ public class PdaAgvCallController {
         return agvCallProxyService.productsOutboundLHN(locationFrom, locationTo, createUser);
     }
 
+    /**
+     * 辅料搬运
+     * 出库接驳位
+     *
+     * @param invLotLocIdMoveForm
+     */
+    @ApiOperation("辅料搬运")
+    @PostMapping("accessoriesMove")
+    public AjaxResult accessoriesMove(@RequestBody InvLotLocIdMoveForm invLotLocIdMoveForm) {
+        invLotLocIdMoveForm.setUpdateBy(StringUtils.isEmpty(invLotLocIdMoveForm.getUpdateBy()) ?
+                "pda" : invLotLocIdMoveForm.getUpdateBy());
+        invLotLocIdMoveForm.setWarehouseId(Constant.WAREHOUSE_ID);
+
+        if (StringUtils.isEmpty(invLotLocIdMoveForm.getLocationFrom())) {
+            return AjaxResult.error("起始库位不能为空");
+        }
+
+        if (StringUtils.isEmpty(invLotLocIdMoveForm.getLocationTo())) {
+            return AjaxResult.error("目标库位不能为空");
+        }
+
+        return invLotLocIdService.accessoriesMove(invLotLocIdMoveForm);
+    }
+
 }

+ 7 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java

@@ -83,6 +83,13 @@ public interface IInvLotLocIdService {
      */
     AjaxResult adj(InvLotLocIdAdjForm invLotLocIdAdjForm);
 
+    /**
+     * 辅料搬运
+     *
+     * @return
+     */
+    AjaxResult accessoriesMove(InvLotLocIdMoveForm invLotLocIdMoveForm);
+
     /**
      * 库存移动
      *

+ 29 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -184,6 +185,34 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
      * @param invLotLocIdMoveForm
      * @return
      */
+    @Transactional
+    @Override
+    public AjaxResult accessoriesMove(InvLotLocIdMoveForm invLotLocIdMoveForm) {
+        AjaxResult move = move(invLotLocIdMoveForm);
+        if (!move.isSuccess()) {
+            return move;
+        }
+        // 起始点增加辅料库存
+        BaseLocationInfo baseLocationFrom = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(invLotLocIdMoveForm.getLocationFrom()
+                , Constant.WAREHOUSE_ID);
+        invLotLocIdService.deleteInvLotLocIdById(baseLocationFrom.getId());
+        AgvCallDTO agvCallDTO = new AgvCallDTO();
+        List<AgvCallItemDTO> agvCallItemDTOList = new ArrayList<>();
+        AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO();
+        agvCallItemDTO.setSku("辅料");
+        agvCallItemDTOList.add(agvCallItemDTO);
+        agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList);
+        invLotLocIdService.initInv(baseLocationFrom.getId().toString(), agvCallDTO);
+        return AjaxResult.success();
+    }
+
+    /**
+     * 库存移动
+     *
+     * @param invLotLocIdMoveForm
+     * @return
+     */
+    @Transactional
     @Override
     public AjaxResult move(InvLotLocIdMoveForm invLotLocIdMoveForm) {
         String locationFrom = invLotLocIdMoveForm.getLocationFrom();