From 5fcf0b129845861d0e8bcf664b389976df873618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Tue, 9 Jul 2024 21:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89main=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrdersServiceImpl.java | 120 ------------------ 1 file changed, 120 deletions(-) diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java index 65aa9ac..2aec50b 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java @@ -615,126 +615,6 @@ public class OrdersServiceImpl extends ServiceImpl implements } } - public static void main(String[] args) { - String value1 = "是"; - Integer duration = 90; - int beforeTimeInt = 0; - int afterTimeInt = 30; - int jyMinuteInt = 30; - Integer tripWay = 1; - int cxsjInt = 0; - if(Objects.nonNull(tripWay)){ - if(tripWay.equals(1)){ - cxsjInt = 60; - } - if(tripWay.equals(2)){ - cxsjInt = 30; - } - if(tripWay.equals(3)){ - cxsjInt = 60; - } - } - beforeTimeInt = beforeTimeInt + cxsjInt; //服务时间前锁单时间 - int minute=0; - int i = 0; - int f = 0; - int a = 0; - if ("是".equals(value1)) { - minute = jyMinuteInt; - if (duration % minute == 0) { - i = duration / minute; - } else { - i = duration / minute; - i++; - } - if (beforeTimeInt % minute == 0) { - f = beforeTimeInt / minute; - } else { - f = beforeTimeInt / minute; - f++; - } - if (afterTimeInt % minute == 0) { - a = afterTimeInt / minute; - } else { - a = afterTimeInt / minute; - a++; - } - } - String serveTime = "2024-07-08 15:30"; - List allTime = new ArrayList<>(); - Date parse = DateUtils.stringToDate(serveTime,"yyyy-MM-dd HH:mm"); - if (f > 0) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(parse); - for (int j = 0; j < f; j++) { - calendar.add(Calendar.MINUTE, -minute); - String format = DateUtils.format(calendar.getTime(),"yyyy-MM-dd HH:mm"); - allTime.add(format); - } - } - //服务时间后锁单时间判断 - if (i > 0) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(parse); - for (int j = 0; j < i; j++) { - calendar.add(Calendar.MINUTE, minute); - String format = DateUtils.format(calendar.getTime(),"yyyy-MM-dd HH:mm"); - allTime.add(format); - } - } - if (a > 0) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(parse); - calendar.add(Calendar.MINUTE, minute*i); - for (int j = 0; j < a; j++) { - calendar.add(Calendar.MINUTE, minute); - String format = DateUtils.format(calendar.getTime(),"yyyy-MM-dd HH:mm"); - allTime.add(format); - } - } - allTime.add(serveTime); - allTime.sort(Comparator.naturalOrder()); - for(String item : allTime){ - System.out.println(item); - } - - Integer duration2 = 110; - int ii = 0; - if ("是".equals(value1)) { - minute = jyMinuteInt; - if (duration2 % minute == 0) { - ii = duration2 / minute; - } else { - ii = duration2 / minute; - ii++; - } - } - - String serveTime2 = "2024-07-08 17:30"; - String date1 = serveTime2.substring(0, 10); - String time1 = serveTime2.substring(11, 16); - System.out.println(date1); - System.out.println(time1); - List allTime2 = new ArrayList<>(); - Date parse2 = DateUtils.stringToDate(serveTime2,"yyyy-MM-dd HH:mm"); - //服务时间后锁单时间判断 - if (ii > 0) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(parse2); - for (int j = 0; j < ii; j++) { - calendar.add(Calendar.MINUTE, minute); - String format = DateUtils.format(calendar.getTime(),"yyyy-MM-dd HH:mm"); - allTime2.add(format); - } - } - - allTime2.sort(Comparator.naturalOrder()); - for(String item : allTime2){ - System.out.println(item); - } - - } - @Override public Result insertOrders(Orders orders) { String msg = "";