去掉main函数
This commit is contained in:
parent
5355f98591
commit
5fcf0b1298
|
@ -615,126 +615,6 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> 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<String> 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<String> 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 = "";
|
||||
|
|
Loading…
Reference in New Issue