From ab18ecb1c25613535c2047467cf8c14d3b41b047 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期二, 07 五月 2024 15:46:58 +0800 Subject: [PATCH] #空桶入库完成 --- src/main/java/com/zy/asrs/utils/Utils.java | 74 +++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java index d1ee128..141b18a 100644 --- a/src/main/java/com/zy/asrs/utils/Utils.java +++ b/src/main/java/com/zy/asrs/utils/Utils.java @@ -6,7 +6,9 @@ import java.text.DecimalFormat; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Created by vincent on 2020/8/27 @@ -14,6 +16,21 @@ public class Utils { private static final DecimalFormat fmt = new DecimalFormat("##0.00"); + + public static short getRgvEndStaNo(Integer rgvNo,Integer staNo){ + Map<Integer, Short> rgv1Map = new HashMap<>(); + Map<Integer, Short> rgv2Map = new HashMap<>(); + Map<Integer, Short> rgv3Map = new HashMap<>(); + switch (rgvNo){ + case 1: + return rgv1Map.get(staNo); + case 2: + return rgv2Map.get(staNo); + case 3: + return rgv3Map.get(staNo); + } + return 0; + } public static float scale(Float f){ if (f == null || f == 0f || Float.isNaN(f)) { @@ -186,6 +203,63 @@ return 0; } + //鑾峰彇RGV鏀捐揣绔欑偣 + public static Integer getRgvStaNo(Integer rgvNo, Integer sourceStaNo, Integer staNo, Boolean pakIn) { + if (pakIn) { + return getRgvStaNoPakIn(rgvNo, sourceStaNo, staNo); + } else { + return getRgvStaNoPakOut(rgvNo, sourceStaNo, staNo); + } + } + + private static Integer getRgvStaNoPakIn(Integer rgvNo, Integer sourceStaNo, Integer staNo) { + //鑾峰彇RGV鏀捐揣绔欑偣 + Integer rgvStaNo = null; + if (rgvNo == 1) { + switch (staNo) { + case 1022: + rgvStaNo = 1020; + break; + case 1025: + rgvStaNo = 1023; + break; + } + } else if (rgvNo == 2) { + rgvStaNo = 2402; + } else if (rgvNo == 3) { + if (sourceStaNo == 2102) { + rgvStaNo = 2103; + } else if (sourceStaNo == 4007 || sourceStaNo == 4016) { + rgvStaNo = 2301; + } + } + + return rgvStaNo; + } + + private static Integer getRgvStaNoPakOut(Integer rgvNo, Integer sourceStaNo, Integer staNo) { + //鑾峰彇RGV鏀捐揣绔欑偣 + Integer rgvStaNo = null; + if (rgvNo == 1) { + if (staNo == 3007 || staNo == 3012) { + rgvStaNo = 2401; + }else { + rgvStaNo = 2013; + } + } else if (rgvNo == 2) { + rgvStaNo = 3001; + } else if (rgvNo == 3) { + if (sourceStaNo == 2003 && staNo == 2001) { + rgvStaNo = 2002; + } else if (sourceStaNo == 2003 && staNo == 4001) { + rgvStaNo = 4001; + } else if (sourceStaNo == 2003 && staNo == 4010) { + rgvStaNo = 4010; + } + } + return rgvStaNo; + } + public static void main(String[] args) { SlaveProperties slaveProperties = new SlaveProperties(); slaveProperties.setDoubleDeep(true); -- Gitblit v1.9.1