Selaa lähdekoodia

PDA移库修改

k 1 vuosi sitten
vanhempi
commit
7e2474bffb

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/pda/PdaInvLotLocIdController.java

@@ -111,7 +111,7 @@ public class PdaInvLotLocIdController {
 
         // 判断是否叫车
         if (invLotLocIdMoveForm.getIsCallCar() == null
-                || invLotLocIdMoveForm.getIsCallCar().equals(Constant.IS_YES.Y.getValue())) {
+                || invLotLocIdMoveForm.getIsCallCar().equals(Constant.IS_YES.Y.name())) {
             return invLotLocIdService.move(invLotLocIdMoveForm);
         } else {
             return invLotLocIdService.moveDirect(invLotLocIdMoveForm);

+ 6 - 2
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -268,6 +268,12 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         baseLocationFrom = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationFrom, warehouseId);
         baseLocationTo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(locationTo, warehouseId);
 
+        // 验证起始库位必须有货
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattByLocationId(baseLocationFrom.getId());
+        if (invLotLocIdLotattVOList.size() == 0) {
+            return AjaxResult.error("起始库位需要有库存!");
+        }
+
         // 转移库存
         int stockTransfer = invLotLocIdService.stockTransfer(baseLocationFrom.getId(), invLotLocIdMoveForm.getPalletNo(), baseLocationTo.getId());
         if (stockTransfer <= 0) {
@@ -278,8 +284,6 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         // 更新目标库位空闲有货
         baseLocationInfoService.updateLocationIdleAndNoEmpty(baseLocationTo.getId(), warehouseId, updateBy);
 
-        // todo 事务
-
         return AjaxResult.success("操作成功!");
     }