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/DateUtils.java |  410 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 215 insertions(+), 195 deletions(-)

diff --git a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/DateUtils.java b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/DateUtils.java
index 3145824..565ab70 100644
--- a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/DateUtils.java
+++ b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/common/DateUtils.java
@@ -1,195 +1,215 @@
-package com.zy.asrs.framework.common;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 鏃堕棿宸ュ叿绫�
- * Created by vincent on 2019-04-15
- */
-public class DateUtils {
-
-    public final static String yyyyMMdd_C="yyyy骞碝M鏈坉d鏃�";
-    public final static String yyyyMM_F="yyyy-MM";
-    public final static String yyyyMMdd_F="yyyy-MM-dd";
-    public final static String yyyyMMddHHmmss_F="yyyy-MM-dd HH:mm:ss";
-    public final static String yyyyMMddHHmmsssss_F="yyyy-MM-dd HH:mm:ss,SSS";
-    public final static String yyyy="yyyy";
-    public final static String yyyyMM="yyyyMM";
-    public final static String yyyyMMdd="yyyyMMdd";
-    public final static String yyyyMMddHH="yyyyMMddHH";
-    public final static String yyyyMMddHHmmss="yyyyMMddHHmmss";
-    public final static String YYMMDDHHMMSS="YYMMDDHHMMSS";
-    public final static String yyyyMMddHHmmsssss="yyyyMMddHHmmssSSS";
-
-    /**
-     * date ==>> string
-     */
-    public static String convert(Date date, String pattern){
-        return new SimpleDateFormat(pattern).format(date);
-    }
-
-    public static String convert(Date date){
-        return convert(date, yyyyMMddHHmmss_F);
-    }
-
-    /**
-     * string ==>> date
-     */
-    public static Date convert(String str, String pattern){
-        if (str.length() < pattern.length()){
-            throw new RuntimeException("鏃堕棿瑙f瀽澶辫触 ==>> "+str);
-        }
-        if (str.length() > pattern.length()){
-            str = str.substring(0, pattern.length());
-        }
-        SimpleDateFormat format = new SimpleDateFormat(pattern);
-        Date date;
-        try {
-            date = format.parse(str);
-        } catch (ParseException e) {
-            throw new RuntimeException("鏃堕棿瑙f瀽澶辫触 ==>> "+str);
-        }
-        return date;
-    }
-
-    public static Date convert(String str){
-        return convert(str, yyyyMMddHHmmss_F);
-    }
-
-    /**
-     * 涓や釜date涔嬮棿鐩稿樊鐨勫ぉ鏁帮紝涓嶆弧涓�澶╃畻涓�澶�
-     */
-    public static int diff(Date date1, Date date2){
-        return getDaysByTimestamp(Math.abs(date2.getTime() - date1.getTime()));
-    }
-
-    public static long diffToMinute(Date date1, Date date2){
-        return Math.abs(date2.getTime() - date1.getTime())/1000/60;
-    }
-
-    public static long diffToSeconds(Date date1, Date date2){
-        return Math.abs(date2.getTime() - date1.getTime())/1000;
-    }
-
-    private static int getDaysByTimestamp(long timestamp){
-        double daysPoint = Arith.divides(2, timestamp, (1000 * 3600 * 24));
-        int daysPoint1 = (int) daysPoint;
-        double daysPoint2 = (double) daysPoint1;
-        if (daysPoint > daysPoint2){
-            return daysPoint1 + 1;
-        }
-        return daysPoint1;
-    }
-
-    /**
-     * 鍏ュ弬date璺濈鐜板湪鐨勭鏁�
-     */
-    public static int diffToNow(Date date){
-        long diff = new Date().getTime() - date.getTime();
-        return (int) (Math.abs(diff) / 1000);
-    }
-
-    /**
-     * 褰撳墠鏃堕棿鎴筹紙鍗曚綅锛氱锛�
-     */
-    public static String createTimeStamp() {
-        return Long.toString(System.currentTimeMillis() / 1000);
-    }
-
-    /**
-     * 鏃堕棿璁$畻鍑芥暟
-     * @param date 琚绠楁椂闂村疄渚�
-     * @param val 璁$畻鍊�
-     * @param timeUnit 璁$畻鍊煎崟浣�
-     * @param subtraction 鍑忔硶甯冨皵 true锛氬綋鍓嶅嚱鏁颁负鍑忔硶璁$畻锛宖alse锛氬弽涔�
-     * @return 璁$畻缁撴灉 Date
-     */
-    public static Date calculate(Date date, Long val, TimeUnit timeUnit, boolean subtraction){
-        if (Objects.isNull(date) || Objects.isNull(val) || Objects.isNull(timeUnit)){
-            return null;
-        }
-        return new Date(subtraction?date.getTime()-timeUnit.toMillis(val):date.getTime()+timeUnit.toMillis(val));
-    }
-
-    public static Date calculate(Date date, Long val, TimeUnit timeUnit){
-        return calculate(date, val, timeUnit, false);
-    }
-
-    /**
-     * 鏃堕棿瀵硅薄DateEntity
-     */
-    public static DateEntity getDateEntity(Date date){
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        DateEntity dateEntity = new DateEntity();
-        dateEntity.setYear(cal.get(Calendar.YEAR));
-        dateEntity.setMonth(cal.get(Calendar.MONTH));
-        dateEntity.setDay(cal.get(Calendar.DATE));
-        dateEntity.setHour(cal.get(Calendar.HOUR_OF_DAY));
-        dateEntity.setMinute(cal.get(Calendar.MINUTE));
-        dateEntity.setSecond(cal.get(Calendar.SECOND));
-        return dateEntity;
-    }
-
-    static class DateEntity {
-        int year;
-        int month;
-        int day;
-        int hour;
-        int minute;
-        int second;
-
-        public int getYear() {
-            return year;
-        }
-
-        public void setYear(final int year) {
-            this.year = year;
-        }
-
-        public int getMonth() {
-            return month;
-        }
-
-        public void setMonth(final int month) {
-            this.month = month + 1;
-        }
-
-        public int getDay() {
-            return day;
-        }
-
-        public void setDay(final int day) {
-            this.day = day;
-        }
-
-        public int getHour() {
-            return hour;
-        }
-
-        public void setHour(final int hour) {
-            this.hour = hour;
-        }
-
-        public int getMinute() {
-            return minute;
-        }
-
-        public void setMinute(final int minute) {
-            this.minute = minute;
-        }
-
-        public int getSecond() {
-            return second;
-        }
-
-        public void setSecond(final int second) {
-            this.second = second;
-        }
-    }
-}
+package com.zy.asrs.framework.common;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 鏃堕棿宸ュ叿绫�
+ * Created by vincent on 2019-04-15
+ */
+public class DateUtils {
+
+    public final static String yyyyMMdd_C="yyyy骞碝M鏈坉d鏃�";
+    public final static String yyyyMM_F="yyyy-MM";
+    public final static String yyyyMMdd_F="yyyy-MM-dd";
+    public final static String yyyyMMddHHmmss_F="yyyy-MM-dd HH:mm:ss";
+    public final static String yyyyMMddHHmmsssss_F="yyyy-MM-dd HH:mm:ss,SSS";
+    public final static String yyyy="yyyy";
+    public final static String yyyyMM="yyyyMM";
+    public final static String yyyyMMdd="yyyyMMdd";
+    public final static String yyyyMMddHH="yyyyMMddHH";
+    public final static String yyyyMMddHHmmss="yyyyMMddHHmmss";
+    public final static String YYMMDDHHMMSS="YYMMDDHHMMSS";
+    public final static String yyyyMMddHHmmsssss="yyyyMMddHHmmssSSS";
+
+    /**
+     * date ==>> string
+     */
+    public static String convert(Date date, String pattern){
+        return new SimpleDateFormat(pattern).format(date);
+    }
+
+    public static String convert(Date date){
+        return convert(date, yyyyMMddHHmmss_F);
+    }
+
+    /**
+     * string ==>> date
+     */
+    public static Date convert(String str, String pattern){
+        if (str.length() < pattern.length()){
+            throw new RuntimeException("鏃堕棿瑙f瀽澶辫触 ==>> "+str);
+        }
+        if (str.length() > pattern.length()){
+            str = str.substring(0, pattern.length());
+        }
+        SimpleDateFormat format = new SimpleDateFormat(pattern);
+        Date date;
+        try {
+            date = format.parse(str);
+        } catch (ParseException e) {
+            throw new RuntimeException("鏃堕棿瑙f瀽澶辫触 ==>> "+str);
+        }
+        return date;
+    }
+
+    public static Date convert(String str){
+        return convert(str, yyyyMMddHHmmss_F);
+    }
+
+    /**
+     * 涓や釜date涔嬮棿鐩稿樊鐨勫ぉ鏁帮紝涓嶆弧涓�澶╃畻涓�澶�
+     */
+    public static int diff(Date date1, Date date2){
+        return getDaysByTimestamp(Math.abs(date2.getTime() - date1.getTime()));
+    }
+
+    public static long diffToMinute(Date date1, Date date2){
+        return Math.abs(date2.getTime() - date1.getTime())/1000/60;
+    }
+
+    public static long diffToSeconds(Date date1, Date date2){
+        return Math.abs(date2.getTime() - date1.getTime())/1000;
+    }
+
+    private static int getDaysByTimestamp(long timestamp){
+        double daysPoint = Arith.divides(2, timestamp, (1000 * 3600 * 24));
+        int daysPoint1 = (int) daysPoint;
+        double daysPoint2 = (double) daysPoint1;
+        if (daysPoint > daysPoint2){
+            return daysPoint1 + 1;
+        }
+        return daysPoint1;
+    }
+
+    /**
+     * 鍏ュ弬date璺濈鐜板湪鐨勭鏁�
+     */
+    public static int diffToNow(Date date){
+        long diff = new Date().getTime() - date.getTime();
+        return (int) (Math.abs(diff) / 1000);
+    }
+
+    /**
+     * 褰撳墠鏃堕棿鎴筹紙鍗曚綅锛氱锛�
+     */
+    public static String createTimeStamp() {
+        return Long.toString(System.currentTimeMillis() / 1000);
+    }
+
+    /**
+     * 鏃堕棿璁$畻鍑芥暟
+     * @param date 琚绠楁椂闂村疄渚�
+     * @param val 璁$畻鍊�
+     * @param timeUnit 璁$畻鍊煎崟浣�
+     * @param subtraction 鍑忔硶甯冨皵 true锛氬綋鍓嶅嚱鏁颁负鍑忔硶璁$畻锛宖alse锛氬弽涔�
+     * @return 璁$畻缁撴灉 Date
+     */
+    public static Date calculate(Date date, Long val, TimeUnit timeUnit, boolean subtraction){
+        if (Objects.isNull(date) || Objects.isNull(val) || Objects.isNull(timeUnit)){
+            return null;
+        }
+        return new Date(subtraction?date.getTime()-timeUnit.toMillis(val):date.getTime()+timeUnit.toMillis(val));
+    }
+
+    public static Date calculate(Date date, Long val, TimeUnit timeUnit){
+        return calculate(date, val, timeUnit, false);
+    }
+
+    public static Date getStartOfDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+    public static Date getEndOfDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        calendar.set(Calendar.MILLISECOND, 999);
+        return calendar.getTime();
+    }
+
+    /**
+     * 鏃堕棿瀵硅薄DateEntity
+     */
+    public static DateEntity getDateEntity(Date date){
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        DateEntity dateEntity = new DateEntity();
+        dateEntity.setYear(cal.get(Calendar.YEAR));
+        dateEntity.setMonth(cal.get(Calendar.MONTH));
+        dateEntity.setDay(cal.get(Calendar.DATE));
+        dateEntity.setHour(cal.get(Calendar.HOUR_OF_DAY));
+        dateEntity.setMinute(cal.get(Calendar.MINUTE));
+        dateEntity.setSecond(cal.get(Calendar.SECOND));
+        return dateEntity;
+    }
+
+    static class DateEntity {
+        int year;
+        int month;
+        int day;
+        int hour;
+        int minute;
+        int second;
+
+        public int getYear() {
+            return year;
+        }
+
+        public void setYear(final int year) {
+            this.year = year;
+        }
+
+        public int getMonth() {
+            return month;
+        }
+
+        public void setMonth(final int month) {
+            this.month = month + 1;
+        }
+
+        public int getDay() {
+            return day;
+        }
+
+        public void setDay(final int day) {
+            this.day = day;
+        }
+
+        public int getHour() {
+            return hour;
+        }
+
+        public void setHour(final int hour) {
+            this.hour = hour;
+        }
+
+        public int getMinute() {
+            return minute;
+        }
+
+        public void setMinute(final int minute) {
+            this.minute = minute;
+        }
+
+        public int getSecond() {
+            return second;
+        }
+
+        public void setSecond(final int second) {
+            this.second = second;
+        }
+    }
+}

--
Gitblit v1.9.1