From d0226747665355acecd5b4f2b5c0beb020586729 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 17 一月 2025 15:37:32 +0800
Subject: [PATCH] # 23. PDA拣货单据,勾选或点击确认按钮后,完成当前单据 (已完成) 24. PDA出库成功后,界面数据重置,避免重复操作  (已修复) 25. PDA接口请求,添加一个Loading遮档  (已修复) 27. 非平库单据,在平库可做入库操作  (已修复) 28. 平库已组拖数据,组拖完成后依然可组拖  (已修复) 29. 平库入库后,订单明细没有添加(已修复) 30. 平库入库后,单据类型没有修改(已修复) 31. 没有绑定播种位,不能进行播种,前后端都需加判定(已修复) 33. 平库入库未修改入库已完成数量(已修复) 34. cacheSite缓存站点逻辑需重新梳理,入库生成波次时(已完成) 35. PDA添加发货确认,默认全选 (已修复) 36. 大屏获取任务时,是由容器到达的拖盘码确认通知 (已修复) 37. 拣货单序号不显示 问题修复 (已修复) 42. pda发货确认,添加不同颜色区分是否全部完成拣货,绿色全部拣货完成,红色完成部分拣货(已修复) 43. CTU入库完成后,订单明细没有删除,执行中数量清空(已修复) 44. 平库入库完成后,历史档明细完成数量没有更新 (已修复) 45. PDA料号不显示  (已修复) 46. 发货完成后,波次管理数据未加入历史档 (已修复)

---
 zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/Cools.java |  736 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 368 insertions(+), 368 deletions(-)

diff --git a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/Cools.java b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/Cools.java
index f8f4a79..0c27ede 100644
--- a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/Cools.java
+++ b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/Cools.java
@@ -1,368 +1,368 @@
-package com.zy.asrs.framework.common;
-
-import com.zy.asrs.framework.annotations.CoolTranslate;
-
-import java.lang.reflect.*;
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Created by vincent on 2019-06-09
- */
-public class Cools {
-
-    public static boolean isEmpty(Object... objects) {
-        for (Object obj : objects){
-            if (isEmpty(obj)){
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @SuppressWarnings("rawtypes")
-    public static boolean isEmpty(Object o) {
-        if (o == null) {
-            return true;
-        }
-        if (o instanceof String) {
-            if (o.toString().trim().equals("")) {
-                return true;
-            }
-        } else if (o instanceof List) {
-            if (((List) o).size() == 0) {
-                return true;
-            }
-        } else if (o instanceof Map) {
-            if (((Map) o).size() == 0) {
-                return true;
-            }
-        } else if (o instanceof Set) {
-            if (((Set) o).size() == 0) {
-                return true;
-            }
-        } else if (o instanceof Object[]) {
-            if (((Object[]) o).length == 0) {
-                return true;
-            }
-        } else if (o instanceof int[]) {
-            if (((int[]) o).length == 0) {
-                return true;
-            }
-        } else if (o instanceof long[]) {
-            if (((long[]) o).length == 0) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static int sqlLimitIndex(Integer pageIndex, Integer pageSize){
-        return (pageIndex - 1) * pageSize;
-    }
-
-    public static String enToken(String username, String password){
-        return AesUtils.encrypt(username, zerofill(password, 16));
-    }
-
-    public static String deTokn(String token, String password){
-        return AesUtils.decrypt(token, zerofill(password, 16));
-    }
-
-    public static String zerofill(String msg, Integer count){
-        if (msg.length() == count){
-            return msg;
-        } else if (msg.length() > count){
-            return msg.substring(0, 16);
-        } else {
-            StringBuilder msgBuilder = new StringBuilder(msg);
-            for (int i = 0; i<count-msg.length(); i++){
-                msgBuilder.append("0");
-            }
-            return msgBuilder.toString();
-        }
-    }
-
-    /**
-     * 鎴彇瀛楃涓�(榛樿end=true)
-     * @param str 琚埅瀛楃涓�
-     * @param end true:鏈�鍚庝竴涓瓧绗� / false:绗竴涓瓧绗�
-     */
-    public static String deleteChar(String str, boolean end){
-        if (isEmpty(str)){
-            return "";
-        }
-        if (end){
-            return str.substring(0, str.length()-1);
-        } else {
-            return str.substring(1);
-        }
-    }
-
-    public static String deleteChar(String str){
-        return deleteChar(str, true);
-    }
-
-
-    /**
-     * map 杞� 瀵硅薄
-     */
-    public static <T> T conver(Map<? extends String, ?> map, Class<T> cls){
-        T instance = null;
-        try {
-            Constructor<T> constructor = cls.getDeclaredConstructor();
-            boolean constructorAccessible = constructor.isAccessible();
-            constructor.setAccessible(true);
-            instance = constructor.newInstance();
-            constructor.setAccessible(constructorAccessible);
-        } catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
-            e.printStackTrace();
-        }
-        Class<?> prototype = cls;
-        do {
-            for (Field field : prototype.getDeclaredFields()){
-                if (Modifier.isFinal(field.getModifiers())
-                        || Modifier.isStatic(field.getModifiers())
-                        || Modifier.isTransient(field.getModifiers())){
-                    continue;
-                }
-                String fieldName = field.getName();
-                Object val = null;
-                if (map.containsKey(fieldName)){
-                    val = map.get(fieldName);
-                }
-                if (val != null){
-                    boolean fieldAccessible = field.isAccessible();
-                    field.setAccessible(true);
-                    Class<?> type = field.getType();
-                    try {
-                        Constructor<?> constructor = type.getDeclaredConstructor(String.class);
-                        boolean constructorAccessible = constructor.isAccessible();
-                        constructor.setAccessible(true);
-                        field.set(instance, constructor.newInstance(String.valueOf(val)));
-                        constructor.setAccessible(constructorAccessible);
-                    } catch (IllegalAccessException
-                            | InstantiationException
-                            | InvocationTargetException
-                            | NoSuchMethodException e) {
-                        System.err.println("convert error ===> Class["+prototype+"],Field:["+fieldName+"],Type:["+type+"],Value:["+val+"]");
-                    }
-                    field.setAccessible(fieldAccessible);
-                }
-            }
-            prototype = prototype.getSuperclass();
-        } while (!Object.class.equals(prototype));
-        return instance;
-    }
-
-    /**
-     * 瀵硅薄 杞� map
-     */
-    public static Map<String, Object> conver(Object obj){
-        Class<?> cls = obj.getClass();
-        Field[] fields = getAllFields(cls);
-        Map<String, Object> map = new HashMap<>();
-        for (Field field : fields) {
-            if (Modifier.isFinal(field.getModifiers())
-                    || Modifier.isStatic(field.getModifiers())
-                    || Modifier.isTransient(field.getModifiers())){
-                continue;
-            }
-            String key = field.getName();
-            boolean flag = field.isAccessible();
-            field.setAccessible(true);
-            Object val = null;
-            try {
-                val = field.get(obj);
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            }
-            field.setAccessible(flag);
-            if (val != null){
-                map.put(key, val);
-            }
-        }
-        return map;
-    }
-
-    /**
-     * 鑾峰彇鎸囧畾Class锛堝強鍏禨uperClass锛夌殑鎴愬憳鍙橀噺
-     */
-    public static Field[] getAllFields(Class<?> cls){
-        return getAllFields(cls, null);
-    }
-
-    /**
-     * 閫掑綊鍚堝苟鍩虹被Field
-     */
-    private static Field[] getAllFields(Class<?> cls, Field[] params){
-        Field[] fields = (params == null) ? cls.getDeclaredFields() : params;
-        Class<?> superCls = cls.getSuperclass();
-        if (superCls == null || superCls == Object.class){
-            return fields;
-        }
-        Field[] superClsFields = superCls.getDeclaredFields();
-        fields = addAll(fields, superClsFields);
-        return getAllFields(superCls, fields);
-    }
-
-    /**
-     * 鏍规嵁fieldName鑾峰彇Field瀵硅薄
-     */
-    public static Field getField(Class<?> cls, String fieldName) {
-        Field[] allFields = getAllFields(cls);
-        for (Field field : allFields) {
-            if (field.getName().equals(fieldName)) {
-                return field;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 鑾峰彇瀵硅薄涓煇涓狥ield鐨勫��
-     */
-    public static Object getFieldValue(Object obj, Field field) {
-        if (null == field) {
-            return null;
-        } else {
-            if (obj instanceof Class) {
-                obj = null;
-            }
-            if (!field.isAccessible()) {
-                field.setAccessible(true);
-            }
-            try {
-                return field.get(obj);
-            } catch (IllegalAccessException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    /**
-     * 鏁扮粍鍙犲姞
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T[] addAll(T[] array1, T... array2) {
-        if (array1 == null) {
-            return clone(array2);
-        } else if (array2 == null) {
-            return clone(array1);
-        } else {
-            Class<?> cls = array1.getClass().getComponentType();
-            T[] joinedArray = (T[]) Array.newInstance(cls, array1.length + array2.length);
-            System.arraycopy(array1, 0, joinedArray, 0, array1.length);
-
-            try {
-                System.arraycopy(array2, 0, joinedArray, array1.length, array2.length);
-                return joinedArray;
-            } catch (ArrayStoreException e) {
-                Class<?> type2 = array2.getClass().getComponentType();
-                if (!cls.isAssignableFrom(type2)) {
-                    throw new RuntimeException("Cannot store " + type2.getName() + " in an array of " + cls.getName(), e);
-                } else {
-                    throw e;
-                }
-            }
-        }
-    }
-
-    /**
-     * 鍏嬮殕
-     */
-    private static <T> T[] clone(T[] array) {
-        return array == null ? null : array.clone();
-    }
-
-    /**
-     * map鎿嶄綔
-     */
-    public static CoolMap add(String key,Object value){
-        CoolMap map = new CoolMap();
-        map.put(key, value);
-        return map;
-    }
-
-    public static class CoolMap extends HashMap<String, Object>{
-
-        public CoolMap add(String key,Object value){
-            this.put(key, value);
-            return this;
-        }
-
-        public CoolMap $(String key,Object value){
-            this.put(key, value);
-            return this;
-        }
-
-    }
-
-    public static String md5(String string){
-        try{
-            MessageDigest md5 = MessageDigest.getInstance("MD5");
-            byte[] bytes = md5.digest(string.getBytes(StandardCharsets.UTF_8));
-            char[] chars = new char[bytes.length * 2];
-            for (int i = 0; i < bytes.length; i++) {
-                int b = bytes[i];
-                chars[i * 2] = hexDigits[(b & 0xF0) >> 4];
-                chars[i * 2 + 1] = hexDigits[b & 0x0F];
-            }
-            return new String(chars).toLowerCase();
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new RuntimeException("md5鍔犲瘑澶辫触,str=".concat(string));
-        }
-    }
-
-    private static char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-
-    public static Map<String, Object> translate(Object obj){
-        Class<?> cls = obj.getClass();
-        Field[] fields = getAllFields(cls);
-        Map<String, Object> map = new HashMap<>();
-        for (Field field : fields) {
-            String key = field.getName();
-            if (field.isAnnotationPresent(CoolTranslate.class)){
-                CoolTranslate annotation = field.getAnnotation(CoolTranslate.class);
-                if (!isEmpty(annotation.value())) {
-                    key = annotation.value();
-                }
-            }
-            boolean flag = field.isAccessible();
-            field.setAccessible(true);
-            Object val = null;
-            try {
-                val = field.get(obj);
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            }
-            field.setAccessible(flag);
-            if (val != null){
-                map.put(key, val);
-            }
-        }
-        return map;
-    }
-
-    public static boolean eq(String str, String str0) {
-        if (Cools.isEmpty(str) && Cools.isEmpty(str0)) {
-            return true;
-        }
-        if (Cools.isEmpty(str) && !Cools.isEmpty(str0)) {
-            return false;
-        }
-        if (Cools.isEmpty(str0) && !Cools.isEmpty(str)) {
-            return false;
-        }
-        if (str.equals(str0)) {
-            return true;
-        }
-        return false;
-    }
-
-}
+package com.zy.asrs.framework.common;
+
+import com.zy.asrs.framework.annotations.CoolTranslate;
+
+import java.lang.reflect.*;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by vincent on 2019-06-09
+ */
+public class Cools {
+
+    public static boolean isEmpty(Object... objects) {
+        for (Object obj : objects){
+            if (isEmpty(obj)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @SuppressWarnings("rawtypes")
+    public static boolean isEmpty(Object o) {
+        if (o == null) {
+            return true;
+        }
+        if (o instanceof String) {
+            if (o.toString().trim().equals("")) {
+                return true;
+            }
+        } else if (o instanceof List) {
+            if (((List) o).size() == 0) {
+                return true;
+            }
+        } else if (o instanceof Map) {
+            if (((Map) o).size() == 0) {
+                return true;
+            }
+        } else if (o instanceof Set) {
+            if (((Set) o).size() == 0) {
+                return true;
+            }
+        } else if (o instanceof Object[]) {
+            if (((Object[]) o).length == 0) {
+                return true;
+            }
+        } else if (o instanceof int[]) {
+            if (((int[]) o).length == 0) {
+                return true;
+            }
+        } else if (o instanceof long[]) {
+            if (((long[]) o).length == 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static int sqlLimitIndex(Integer pageIndex, Integer pageSize){
+        return (pageIndex - 1) * pageSize;
+    }
+
+    public static String enToken(String username, String password){
+        return AesUtils.encrypt(username, zerofill(password, 16));
+    }
+
+    public static String deTokn(String token, String password){
+        return AesUtils.decrypt(token, zerofill(password, 16));
+    }
+
+    public static String zerofill(String msg, Integer count){
+        if (msg.length() == count){
+            return msg;
+        } else if (msg.length() > count){
+            return msg.substring(0, 16);
+        } else {
+            StringBuilder msgBuilder = new StringBuilder(msg);
+            for (int i = 0; i<count-msg.length(); i++){
+                msgBuilder.append("0");
+            }
+            return msgBuilder.toString();
+        }
+    }
+
+    /**
+     * 鎴彇瀛楃涓�(榛樿end=true)
+     * @param str 琚埅瀛楃涓�
+     * @param end true:鏈�鍚庝竴涓瓧绗� / false:绗竴涓瓧绗�
+     */
+    public static String deleteChar(String str, boolean end){
+        if (isEmpty(str)){
+            return "";
+        }
+        if (end){
+            return str.substring(0, str.length()-1);
+        } else {
+            return str.substring(1);
+        }
+    }
+
+    public static String deleteChar(String str){
+        return deleteChar(str, true);
+    }
+
+
+    /**
+     * map 杞� 瀵硅薄
+     */
+    public static <T> T conver(Map<? extends String, ?> map, Class<T> cls){
+        T instance = null;
+        try {
+            Constructor<T> constructor = cls.getDeclaredConstructor();
+            boolean constructorAccessible = constructor.isAccessible();
+            constructor.setAccessible(true);
+            instance = constructor.newInstance();
+            constructor.setAccessible(constructorAccessible);
+        } catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) {
+            e.printStackTrace();
+        }
+        Class<?> prototype = cls;
+        do {
+            for (Field field : prototype.getDeclaredFields()){
+                if (Modifier.isFinal(field.getModifiers())
+                        || Modifier.isStatic(field.getModifiers())
+                        || Modifier.isTransient(field.getModifiers())){
+                    continue;
+                }
+                String fieldName = field.getName();
+                Object val = null;
+                if (map.containsKey(fieldName)){
+                    val = map.get(fieldName);
+                }
+                if (val != null){
+                    boolean fieldAccessible = field.isAccessible();
+                    field.setAccessible(true);
+                    Class<?> type = field.getType();
+                    try {
+                        Constructor<?> constructor = type.getDeclaredConstructor(String.class);
+                        boolean constructorAccessible = constructor.isAccessible();
+                        constructor.setAccessible(true);
+                        field.set(instance, constructor.newInstance(String.valueOf(val)));
+                        constructor.setAccessible(constructorAccessible);
+                    } catch (IllegalAccessException
+                            | InstantiationException
+                            | InvocationTargetException
+                            | NoSuchMethodException e) {
+                        System.err.println("convert error ===> Class["+prototype+"],Field:["+fieldName+"],Type:["+type+"],Value:["+val+"]");
+                    }
+                    field.setAccessible(fieldAccessible);
+                }
+            }
+            prototype = prototype.getSuperclass();
+        } while (!Object.class.equals(prototype));
+        return instance;
+    }
+
+    /**
+     * 瀵硅薄 杞� map
+     */
+    public static Map<String, Object> conver(Object obj){
+        Class<?> cls = obj.getClass();
+        Field[] fields = getAllFields(cls);
+        Map<String, Object> map = new HashMap<>();
+        for (Field field : fields) {
+            if (Modifier.isFinal(field.getModifiers())
+                    || Modifier.isStatic(field.getModifiers())
+                    || Modifier.isTransient(field.getModifiers())){
+                continue;
+            }
+            String key = field.getName();
+            boolean flag = field.isAccessible();
+            field.setAccessible(true);
+            Object val = null;
+            try {
+                val = field.get(obj);
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+            field.setAccessible(flag);
+            if (val != null){
+                map.put(key, val);
+            }
+        }
+        return map;
+    }
+
+    /**
+     * 鑾峰彇鎸囧畾Class锛堝強鍏禨uperClass锛夌殑鎴愬憳鍙橀噺
+     */
+    public static Field[] getAllFields(Class<?> cls){
+        return getAllFields(cls, null);
+    }
+
+    /**
+     * 閫掑綊鍚堝苟鍩虹被Field
+     */
+    private static Field[] getAllFields(Class<?> cls, Field[] params){
+        Field[] fields = (params == null) ? cls.getDeclaredFields() : params;
+        Class<?> superCls = cls.getSuperclass();
+        if (superCls == null || superCls == Object.class){
+            return fields;
+        }
+        Field[] superClsFields = superCls.getDeclaredFields();
+        fields = addAll(fields, superClsFields);
+        return getAllFields(superCls, fields);
+    }
+
+    /**
+     * 鏍规嵁fieldName鑾峰彇Field瀵硅薄
+     */
+    public static Field getField(Class<?> cls, String fieldName) {
+        Field[] allFields = getAllFields(cls);
+        for (Field field : allFields) {
+            if (field.getName().equals(fieldName)) {
+                return field;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 鑾峰彇瀵硅薄涓煇涓狥ield鐨勫��
+     */
+    public static Object getFieldValue(Object obj, Field field) {
+        if (null == field) {
+            return null;
+        } else {
+            if (obj instanceof Class) {
+                obj = null;
+            }
+            if (!field.isAccessible()) {
+                field.setAccessible(true);
+            }
+            try {
+                return field.get(obj);
+            } catch (IllegalAccessException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
+    /**
+     * 鏁扮粍鍙犲姞
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T[] addAll(T[] array1, T... array2) {
+        if (array1 == null) {
+            return clone(array2);
+        } else if (array2 == null) {
+            return clone(array1);
+        } else {
+            Class<?> cls = array1.getClass().getComponentType();
+            T[] joinedArray = (T[]) Array.newInstance(cls, array1.length + array2.length);
+            System.arraycopy(array1, 0, joinedArray, 0, array1.length);
+
+            try {
+                System.arraycopy(array2, 0, joinedArray, array1.length, array2.length);
+                return joinedArray;
+            } catch (ArrayStoreException e) {
+                Class<?> type2 = array2.getClass().getComponentType();
+                if (!cls.isAssignableFrom(type2)) {
+                    throw new RuntimeException("Cannot store " + type2.getName() + " in an array of " + cls.getName(), e);
+                } else {
+                    throw e;
+                }
+            }
+        }
+    }
+
+    /**
+     * 鍏嬮殕
+     */
+    private static <T> T[] clone(T[] array) {
+        return array == null ? null : array.clone();
+    }
+
+    /**
+     * map鎿嶄綔
+     */
+    public static CoolMap add(String key,Object value){
+        CoolMap map = new CoolMap();
+        map.put(key, value);
+        return map;
+    }
+
+    public static class CoolMap extends HashMap<String, Object>{
+
+        public CoolMap add(String key,Object value){
+            this.put(key, value);
+            return this;
+        }
+
+        public CoolMap $(String key,Object value){
+            this.put(key, value);
+            return this;
+        }
+
+    }
+
+    public static String md5(String string){
+        try{
+            MessageDigest md5 = MessageDigest.getInstance("MD5");
+            byte[] bytes = md5.digest(string.getBytes(StandardCharsets.UTF_8));
+            char[] chars = new char[bytes.length * 2];
+            for (int i = 0; i < bytes.length; i++) {
+                int b = bytes[i];
+                chars[i * 2] = hexDigits[(b & 0xF0) >> 4];
+                chars[i * 2 + 1] = hexDigits[b & 0x0F];
+            }
+            return new String(chars).toLowerCase();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("md5鍔犲瘑澶辫触,str=".concat(string));
+        }
+    }
+
+    private static char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+
+    public static Map<String, Object> translate(Object obj){
+        Class<?> cls = obj.getClass();
+        Field[] fields = getAllFields(cls);
+        Map<String, Object> map = new HashMap<>();
+        for (Field field : fields) {
+            String key = field.getName();
+            if (field.isAnnotationPresent(CoolTranslate.class)){
+                CoolTranslate annotation = field.getAnnotation(CoolTranslate.class);
+                if (!isEmpty(annotation.value())) {
+                    key = annotation.value();
+                }
+            }
+            boolean flag = field.isAccessible();
+            field.setAccessible(true);
+            Object val = null;
+            try {
+                val = field.get(obj);
+            } catch (IllegalAccessException e) {
+                e.printStackTrace();
+            }
+            field.setAccessible(flag);
+            if (val != null){
+                map.put(key, val);
+            }
+        }
+        return map;
+    }
+
+    public static boolean eq(String str, String str0) {
+        if (Cools.isEmpty(str) && Cools.isEmpty(str0)) {
+            return true;
+        }
+        if (Cools.isEmpty(str) && !Cools.isEmpty(str0)) {
+            return false;
+        }
+        if (Cools.isEmpty(str0) && !Cools.isEmpty(str)) {
+            return false;
+        }
+        if (str.equals(str0)) {
+            return true;
+        }
+        return false;
+    }
+
+}

--
Gitblit v1.9.1