数据库相关

This commit is contained in:
李玉东 2025-09-28 14:41:55 +08:00
parent e9ac9d5f99
commit d44b61e030
26 changed files with 642 additions and 268 deletions

View File

@ -29,7 +29,7 @@ public class MockMessageTip implements Delayed {
return unit.convert(diff, TimeUnit.MILLISECONDS);
}
// 定义任务的优先级排序较早到期的任务排在前面
@Override
public int compareTo(Delayed o) {
if (this.expireTime < ((MockMessageTip) o).expireTime) {

View File

@ -219,6 +219,9 @@ public class LoginController extends BaseController {
newUser.setNickName(user.getNickName());
newUser.setSuperFlag(1);
userService.save(newUser);
} else {
userInDb.setPassword(new BCryptPasswordEncoder().encode(user.getPassword()));
userService.updateById(userInDb);
}
LoginForm loginForm = new LoginForm();
loginForm.setUsername(user.getUserName());

View File

@ -3,124 +3,161 @@ package com.hshh.nation.mock.service;
import com.hshh.Global;
import com.hshh.nation.common.MockMessageTip;
import com.hshh.nation.common.SpringContextHolder;
import com.hshh.nation.fuel.service.impl.*;
import com.hshh.nation.fuel.service.impl.FuelBoatServiceImpl;
import com.hshh.nation.fuel.service.impl.FuelMetalJarServiceImpl;
import com.hshh.nation.fuel.service.impl.FuelPlaneServiceImpl;
import com.hshh.nation.fuel.service.impl.FuelSoftJarServiceImpl;
import com.hshh.nation.fuel.service.impl.FuelTruckServiceImpl;
import com.hshh.nation.mock.bean.FuelAirMockBean;
import com.hshh.nation.mock.bean.FuelReceiveMockBean;
import com.hshh.nation.mock.bean.FuelSendMockBean;
import com.hshh.nation.mock.bean.FuelTransMockBean;
import com.hshh.nation.mock.bean.MedicalCasualtyBackToBean;
import com.hshh.nation.mock.bean.MedicalSupplyBean;
import com.hshh.nation.mock.bean.TransportLoadMockBean;
import com.hshh.nation.mock.bean.TransportSeaBean;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.atomic.AtomicInteger;
public abstract class AbtActionMockBase implements ActionMockService {
//相邻两条信息的间隔时间
protected final long interValTime = 500;//ms
protected DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
protected final String validate_label = "验证参数:";
protected final String action_start_label = "行动开始:";
protected final String actioning_label = "行动中:";
protected final String action_finished_label = "行动完成:";
@Override
public <T> void start(T input, AtomicInteger count, long now, String actionName) {
MockMessageTip firstMessage = MockMessageTip.createMessage(LocalDateTime.now().format(dateTimeFormat), "", "", 0, count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(firstMessage);
//发送开始提示
String message = "";
switch (actionName) {
case "receive":
message = "油料接收";
break;
case "send":
message = "油料发放";
break;
case "trans":
message = "油料输送";
break;
case "plane":
message = "飞机油料补给";
break;
case "boat":
message = "舰艇油料补给";
break;
case "casualtyTakeBackTo":
message = "伤病员后送";
break;
case "medicalSupply":
message = "医疗物资补给";
break;
case "load":
message = "装载";
break;
case "unload":
message = "卸载";
break;
case "transportSea":
message = "海上输送";
break;
case "transportPlane":
message = "空中输送行动";
break;
default:
break;
}
//相邻两条信息的间隔时间
protected final long interValTime = 500;//ms
protected DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
protected final String validate_label = "验证参数:";
protected final String action_start_label = "行动开始:";
protected final String actioning_label = "行动中:";
protected final String action_finished_label = "行动完成:";
sendMessage(message, count, now);
@Override
public <T> void start(T input, AtomicInteger count, long now, String actionName) {
MockMessageTip firstMessage = MockMessageTip.createMessage(
LocalDateTime.now().format(dateTimeFormat), "", "", 0,
count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(firstMessage);
String startTime = LocalDateTime.now().format(dateTimeFormat);
//发送开始提示
String message = "";
switch (actionName) {
case "receive":
message = "油料接收";
startTime = ((FuelReceiveMockBean) input).getStartTime();
break;
case "send":
startTime = ((FuelSendMockBean) input).getStartTime();
message = "油料发放";
break;
case "trans":
startTime = ( (FuelTransMockBean) input).getStartTime();
message = "油料输送";
break;
case "plane":
startTime = ( (FuelAirMockBean) input).getStartTime();
message = "飞机油料补给";
break;
case "boat":
startTime = ((FuelAirMockBean) input).getStartTime();
message = "舰艇油料补给";
break;
case "casualtyTakeBackTo":
startTime = ( (MedicalCasualtyBackToBean) input).getStartTime();
message = "伤病员后送";
break;
case "medicalSupply":
startTime =( (MedicalSupplyBean) input).getStartTime();
message = "医疗物资补给";
break;
case "load":
startTime = ( (TransportLoadMockBean) input).getStartTime();
message = "装载";
break;
case "unload":
startTime = ( (TransportLoadMockBean) input).getStartTime();
message = "卸载";
break;
case "transportSea":
startTime = ((TransportSeaBean) input).getStartTime();
message = "海上输送";
break;
case "transportPlane":
startTime = ((TransportSeaBean) input).getStartTime();
message = "空中输送行动";
break;
default:
break;
}
/**
* 发送前端信息
*
* @param message message
* @param count count
* @param now now
*/
sendStartMessage(startTime, message, count, now);
}
protected void sendMessage(String message, AtomicInteger count, long now) {
MockMessageTip startMessage = MockMessageTip.createMessage(LocalDateTime.now().format(dateTimeFormat), "开始行动", message, 1, count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(startMessage);
}
/**
* 发送前端信息
*
* @param message message
* @param count count
* @param now now
*/
/**
* 获取油罐对象
*
* @param jarInfo jarInfo
* @return 罐对象
*/
protected Object getJar(String jarInfo) {
String[] info = jarInfo.split("\\|");
Integer id = Integer.parseInt(info[0]);
switch (info[1]) {
case "1":
return SpringContextHolder.getBean(FuelMetalJarServiceImpl.class).getById(id);
case "2":
return SpringContextHolder.getBean(FuelSoftJarServiceImpl.class).getById(id);
default:
return null;
protected void sendMessage(String message, AtomicInteger count, long now) {
MockMessageTip startMessage = MockMessageTip.createMessage(
LocalDateTime.now().format(dateTimeFormat), "开始行动", message, 1,
count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(startMessage);
}
}
}
protected void sendStartMessage(String startTime, String message, AtomicInteger count, long now) {
MockMessageTip startMessage = MockMessageTip.createMessage(startTime, "开始行动", message, 1,
count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(startMessage);
}
/**
* 获取装备信息
* @param equipInfo
* @return
*/
protected Object getEquip(String equipInfo) {
String[] equip = equipInfo.split("\\|");
Integer equipId = Integer.parseInt(equip[0]);
if (equip[1].equalsIgnoreCase("3")) {
return SpringContextHolder.getBean(FuelTruckServiceImpl.class).getById(equipId);
}
if (equip[1].equalsIgnoreCase("4")) {
return SpringContextHolder.getBean(FuelBoatServiceImpl.class).getById(equipId);
}
if (equip[1].equalsIgnoreCase("5")) {
return SpringContextHolder.getBean(FuelPlaneServiceImpl.class).getById(equipId);
}
/**
* 获取油罐对象
*
* @param jarInfo jarInfo
* @return 罐对象
*/
protected Object getJar(String jarInfo) {
String[] info = jarInfo.split("\\|");
Integer id = Integer.parseInt(info[0]);
switch (info[1]) {
case "1":
return SpringContextHolder.getBean(FuelMetalJarServiceImpl.class).getById(id);
case "2":
return SpringContextHolder.getBean(FuelSoftJarServiceImpl.class).getById(id);
default:
return null;
}
}
/**
* 获取装备信息
*
* @param equipInfo
* @return
*/
protected Object getEquip(String equipInfo) {
String[] equip = equipInfo.split("\\|");
Integer equipId = Integer.parseInt(equip[0]);
if (equip[1].equalsIgnoreCase("3")) {
return SpringContextHolder.getBean(FuelTruckServiceImpl.class).getById(equipId);
}
if (equip[1].equalsIgnoreCase("4")) {
return SpringContextHolder.getBean(FuelBoatServiceImpl.class).getById(equipId);
}
if (equip[1].equalsIgnoreCase("5")) {
return SpringContextHolder.getBean(FuelPlaneServiceImpl.class).getById(equipId);
}
return null;
}
}

View File

@ -64,15 +64,15 @@ public class FuelAirplaneSupplyMockServiceImpl extends AbtMockGeneralService imp
String toEquipInfo = bean.getToEquipIdInfo();
Object toEquip = getEquip(toEquipInfo);
if (toEquip instanceof FuelTruck) {
FuelTruck equip = (FuelTruck) fromEquip;
FuelTruck equip = (FuelTruck) toEquip;
tips.append("被补给装备当前油量").append(equip.getCurrentCapacity() + Double.parseDouble(fuelCount.getCount()));
}
if (toEquip instanceof FuelBoat) {
FuelBoat equip = (FuelBoat) fromEquip;
FuelBoat equip = (FuelBoat) toEquip;
tips.append("被补给装备当前油量").append(equip.getCurrentCapacity() + Double.parseDouble(fuelCount.getCount()));
}
if (toEquip instanceof FuelPlane) {
FuelPlane equip = (FuelPlane) fromEquip;
FuelPlane equip = (FuelPlane) toEquip;
tips.append("被补给装备当前油量").append(equip.getCurrentCapacity() + Double.parseDouble(fuelCount.getCount()));
}
// sendMessage(String time, String title, String message, AtomicInteger counter, long now, int order)

View File

@ -64,15 +64,15 @@ public class FuelBoatSupplyMockServiceImpl extends AbtMockGeneralService impleme
String toEquipInfo = bean.getToEquipIdInfo();
Object toEquip = getEquip(toEquipInfo);
if (toEquip instanceof FuelTruck) {
FuelTruck equip = (FuelTruck) fromEquip;
FuelTruck equip = (FuelTruck) toEquip;
tips.append("被补给装备当前油量" + (equip.getCurrentCapacity() + Double.parseDouble(fuelCount.getCount())));
}
if (toEquip instanceof FuelBoat) {
FuelBoat equip = (FuelBoat) fromEquip;
FuelBoat equip = (FuelBoat) toEquip;
tips.append("被补给装备当前油量" + (equip.getCurrentCapacity() + Double.parseDouble(fuelCount.getCount())));
}
if (toEquip instanceof FuelPlane) {
FuelPlane equip = (FuelPlane) fromEquip;
FuelPlane equip = (FuelPlane) toEquip;
tips.append("被补给装备当前油量" + (equip.getCurrentCapacity() + Double.parseDouble(fuelCount.getCount())));
}
// sendMessage(String time, String title, String message, AtomicInteger counter, long now, int order)

View File

@ -1,167 +1,180 @@
package com.hshh.nation.mock.service.impl;
import com.hshh.nation.mock.bean.FuelCountBean;
import com.hshh.nation.mock.bean.FuelReceiveMockBean;
import com.hshh.nation.mock.service.AbtActionMockBase;
import com.hshh.Global;
import com.hshh.nation.common.MockMessageTip;
import com.hshh.nation.common.Utility;
import com.hshh.nation.fuel.entity.FuelMetalJar;
import com.hshh.nation.fuel.entity.FuelSoftJar;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.hshh.nation.mock.bean.FuelCountBean;
import com.hshh.nation.mock.bean.FuelReceiveMockBean;
import com.hshh.nation.mock.service.AbtActionMockBase;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service("fuel-receive-mock")
@Slf4j
public class FuelReceiveMockServiceImpl extends AbtActionMockBase {
@Override
public <T> boolean validate(T input, AtomicInteger count, long now, String action) {
FuelReceiveMockBean bean = (FuelReceiveMockBean) input;
//确定是否选择了油罐
if (bean.getJarInfoList() == null || bean.getJarInfoList().isEmpty()) {
sendMessage("请选择一个油罐", count, now);
return true;
}
//获取油罐信息
String jarInfo = bean.getJarInfoList().get(0);
Object jarObj = getJar(jarInfo);
if (jarObj == null) {
sendMessage("数据错误", count, now);
return true;
} else {
//获取要接收的油料信息
FuelCountBean fuelCount = bean.getFuelInfoList().get(0);
Integer fuelTypeId = fuelCount.getFuelTypeId();
double fuelTotal = Double.parseDouble(fuelCount.getCount());
if (jarObj instanceof FuelSoftJar) {
FuelSoftJar jar = (FuelSoftJar) jarObj;
if (!Objects.equals(jar.getJarFuelType(), fuelTypeId)) {
sendMessage(validate_label + "油品类型不一致", count, now);
return true;
}
double remain = jar.getJarCapacity() - jar.getJarCurrentCapacity();
if (remain < fuelTotal) {
sendMessage(validate_label + "油罐容量不足", count, now);
return true;
}
}
if (jarObj instanceof FuelMetalJar) {
FuelMetalJar jar = (FuelMetalJar) jarObj;
if (!Objects.equals(jar.getJarFuelType(), fuelTypeId)) {
sendMessage(validate_label + "油品类型不一致", count, now);
return true;
}
double remain = jar.getJarCapacity() - jar.getJarCurrentCapacity();
if (remain < fuelTotal) {
sendMessage(validate_label + "油罐容量不足", count, now);
return true;
}
}
}
//验证工作线路
if (bean.getWorker() <= 0) {
sendMessage(validate_label + "工作线路必须大于0", count, now);
return true;
}
return false;
@Override
public <T> boolean validate(T input, AtomicInteger count, long now, String action) {
FuelReceiveMockBean bean = (FuelReceiveMockBean) input;
//确定是否选择了油罐
if (bean.getJarInfoList() == null || bean.getJarInfoList().isEmpty()) {
sendMessage("请选择一个油罐", count, now);
return true;
}
@Override
public <T> LocalDateTime handle(T input, String action, AtomicInteger count, long now) {
FuelReceiveMockBean bean = (FuelReceiveMockBean) input;
LocalDateTime startTime = LocalDateTime.parse(bean.getStartTime(), dateTimeFormat);
//获取油罐信息
String jarInfo = bean.getJarInfoList().get(0);
Object jarObj = getJar(jarInfo);
startTime = startTime.plusMinutes(bean.getInspectTime());
sendMessage(action_start_label + ":验收油品完成", count, now);
if (jarObj == null) {
sendMessage("数据错误", count, now);
return true;
} else {
startTime = startTime.plusMinutes(bean.getQualityTime());
sendMessage(action_start_label + ":质检油品完成", count, now);
startTime = startTime.plusMinutes(bean.getMeasureTime());
sendMessage(action_start_label + ":计量油品完成", count, now);
FuelCountBean fuelCount = bean.getFuelInfoList().get(0);
//接收油料总数
double total = Double.parseDouble(fuelCount.getCount());
//获取加注能力
double plump = 0;
String jarInfo = bean.getJarInfoList().get(0);
Object jarObj = getJar(jarInfo);
if (jarObj instanceof FuelSoftJar) {
plump = ((FuelSoftJar) jarObj).getJarReceiveAbility();
//获取要接收的油料信息
FuelCountBean fuelCount = bean.getFuelInfoList().get(0);
Integer fuelTypeId = fuelCount.getFuelTypeId();
double fuelTotal = Double.parseDouble(fuelCount.getCount());
if (jarObj instanceof FuelSoftJar) {
FuelSoftJar jar = (FuelSoftJar) jarObj;
if (!Objects.equals(jar.getJarFuelType(), fuelTypeId)) {
sendMessage(validate_label + "油品类型不一致", count, now);
return true;
}
if (jarObj instanceof FuelMetalJar) {
plump = ((FuelMetalJar) jarObj).getJarReceiveAbility();
double remain = jar.getJarCapacity() - jar.getJarCurrentCapacity();
if (remain < fuelTotal) {
sendMessage(validate_label + "油罐容量不足", count, now);
return true;
}
int worker = bean.getWorker();
}
//总加注能力
double totalWorkAbility = plump * worker;
if (totalWorkAbility > 0) {
double estimateTime = total / totalWorkAbility;//单位是小时
if (estimateTime < bean.getIntervalTime()) {
startTime = startTime.plusMinutes((long) (estimateTime * 60.0));
sendMessage(actioning_label + "完成所有加注,总油量:" + total, count, now);
if (jarObj instanceof FuelMetalJar) {
FuelMetalJar jar = (FuelMetalJar) jarObj;
if (!Objects.equals(jar.getJarFuelType(), fuelTypeId)) {
sendMessage(validate_label + "油品类型不一致", count, now);
return true;
}
double remain = jar.getJarCapacity() - jar.getJarCurrentCapacity();
if (remain < fuelTotal) {
sendMessage(validate_label + "油罐容量不足", count, now);
return true;
}
}
} else {
double remain = total;
while (remain > 0) {
remain = (remain - totalWorkAbility) > 0 ? (remain - totalWorkAbility) : 0;
startTime = startTime.plusHours(bean.getIntervalTime());
sendMessage(actioning_label + "加注中,剩余油量:" + remain, count, now);
}
//验证工作线路
if (bean.getWorker() <= 0) {
sendMessage(validate_label + "工作线路必须大于0", count, now);
}
}
return true;
}
return false;
}
@Override
public <T> LocalDateTime handle(T input, String action, AtomicInteger count, long now) {
FuelReceiveMockBean bean = (FuelReceiveMockBean) input;
LocalDateTime startTime = LocalDateTime.parse(bean.getStartTime(), dateTimeFormat);
startTime = startTime.plusMinutes(bean.getInspectTime());
acting(startTime, action_start_label + ":验收油品完成",count,now,action_start_label);
startTime = startTime.plusMinutes(bean.getQualityTime());
acting(startTime,action_start_label + ":质检油品完成",count,now,action_start_label);
startTime = startTime.plusMinutes(bean.getMeasureTime());
acting(startTime,action_start_label + ":计量油品完成",count,now,action_start_label);
FuelCountBean fuelCount = bean.getFuelInfoList().get(0);
//接收油料总数
double total = Double.parseDouble(fuelCount.getCount());
//获取加注能力
double plump = 0;
String jarInfo = bean.getJarInfoList().get(0);
Object jarObj = getJar(jarInfo);
if (jarObj instanceof FuelSoftJar) {
plump = ((FuelSoftJar) jarObj).getJarReceiveAbility();
}
if (jarObj instanceof FuelMetalJar) {
plump = ((FuelMetalJar) jarObj).getJarReceiveAbility();
}
int worker = bean.getWorker();
//总加注能力
double totalWorkAbility = plump * worker;
if (totalWorkAbility > 0) {
double estimateTime = total / totalWorkAbility;//单位是小时
if (estimateTime < bean.getIntervalTime()) {
startTime = startTime.plusMinutes((long) (estimateTime * 60.0));
acting(startTime,actioning_label + "完成所有加注,总油量:" + total, count, now,actioning_label);
} else {
double remain = total;
while (remain > 0) {
remain = (remain - totalWorkAbility) > 0 ? (remain - totalWorkAbility) : 0;
startTime = startTime.plusHours(bean.getIntervalTime());
acting(startTime,actioning_label + "加注中,剩余油量:" + remain, count, now,actioning_label);
}
}
return startTime;
}
@Override
public <T> void finish(LocalDateTime endTime, T input, String action, AtomicInteger count, long now) {
FuelReceiveMockBean bean = (FuelReceiveMockBean) input;
LocalDateTime startTime = LocalDateTime.parse(bean.getStartTime(), dateTimeFormat);
long minutes = Math.abs(Duration.between(endTime, startTime).toMinutes());
String jarInfo = bean.getJarInfoList().get(0);
Object jarObj = getJar(jarInfo);
FuelCountBean fuelCount = bean.getFuelInfoList().get(0);
double total = Double.parseDouble(fuelCount.getCount());
if (jarObj instanceof FuelSoftJar) {
sendMessage(action_finished_label + "消耗时间:" + Utility.convertTime((int) minutes) + ",接收油量:" + total +
((FuelSoftJar) jarObj).getJarNo() + "当前油量:" + (((FuelSoftJar) jarObj).getJarCurrentCapacity() + total),
count,
now);
return startTime;
}
@Override
public <T> void finish(LocalDateTime endTime, T input, String action, AtomicInteger count,
long now) {
FuelReceiveMockBean bean = (FuelReceiveMockBean) input;
LocalDateTime startTime = LocalDateTime.parse(bean.getStartTime(), dateTimeFormat);
long minutes = Math.abs(Duration.between(endTime, startTime).toMinutes());
String jarInfo = bean.getJarInfoList().get(0);
Object jarObj = getJar(jarInfo);
FuelCountBean fuelCount = bean.getFuelInfoList().get(0);
double total = Double.parseDouble(fuelCount.getCount());
if (jarObj instanceof FuelSoftJar) {
acting(endTime,
action_finished_label + "消耗时间:" + Utility.convertTime((int) minutes) + ",接收油量:"
+ total +
((FuelSoftJar) jarObj).getJarNo() + "当前油量:" + (
((FuelSoftJar) jarObj).getJarCurrentCapacity() + total),
count,
now,action_finished_label);
}
if (jarObj instanceof FuelMetalJar) {
sendMessage(action_finished_label + "消耗时间:" + Utility.convertTime((int) minutes) + ",接收油量:" + total +
((FuelMetalJar) jarObj).getJarNo() + "当前油量:" + (((FuelMetalJar) jarObj).getJarCurrentCapacity() + total),
count,
now);
}
}
if (jarObj instanceof FuelMetalJar) {
acting(endTime,
action_finished_label + "消耗时间:" + Utility.convertTime((int) minutes) + ",接收油量:"
+ total +
((FuelMetalJar) jarObj).getJarNo() + "当前油量:" + (
((FuelMetalJar) jarObj).getJarCurrentCapacity() + total),
count,
now,action_finished_label);
}
}
private void acting(LocalDateTime arrivedTime, String message,AtomicInteger count,long now,String label) {
MockMessageTip startMessage = MockMessageTip.createMessage(arrivedTime.format(dateTimeFormat), label,
message, 1, count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(startMessage);
}
}

View File

@ -1,5 +1,7 @@
package com.hshh.nation.mock.service.impl;
import com.hshh.Global;
import com.hshh.nation.common.MockMessageTip;
import com.hshh.nation.common.Utility;
import com.hshh.nation.fuel.entity.FuelBoat;
import com.hshh.nation.fuel.entity.FuelMetalJar;
@ -126,13 +128,13 @@ public class FuelSendMockServiceImpl extends AbtActionMockBase {
startTime = startTime.plusHours(bean.getIntervalTime());
total = total - amountPerIntervalTime;
already = already + amountPerIntervalTime;
sendMessage(actioning_label + "已发放油量:" + already, count, now);
acting(startTime,actioning_label + "已发放油量:" + already, count, now,actioning_label);
}
if (total >= 0) {
long minutes = (long) (total * 60 / (bean.getWorker() * bean.getPerAmount()));
already = already + total;
startTime = startTime.plusMinutes(minutes);
sendMessage(actioning_label + "已发放油量:" + already, count, now);
acting(startTime,actioning_label + "已发放油量:" + already, count, now,actioning_label);
}
return startTime;
}
@ -175,8 +177,13 @@ public class FuelSendMockServiceImpl extends AbtActionMockBase {
LocalDateTime.parse(bean.getStartTime(), dateTimeFormat));
String message = "消耗时间" + ((Utility.convertTime((int) Math.abs(duration.toMinutes()))));
message = message + ",油罐剩余" + jarRemain + ",装备当前油量" + equipCurrent;
sendMessage(message, count, now);
acting(endTime,message, count, now,action_finished_label);
}
private void acting(LocalDateTime arrivedTime, String message,AtomicInteger count,long now,String label) {
MockMessageTip startMessage = MockMessageTip.createMessage(arrivedTime.format(dateTimeFormat), label,
message, 1, count.addAndGet(1) * interValTime + now);
Global.delayQueue.add(startMessage);
}
}

View File

@ -236,7 +236,7 @@ public class TransportSeaMockServiceImpl extends AbtMockGeneralService implement
String toLocation = bean.getToLocation();
LocalDateTime startTime = LocalDateTime.parse(bean.getStartTime(), dateTimeFormat);
duringLogAndReturnArriveTime(startTime, counter, now, fromLocation, toLocation, bean.getSpeed(),
startTime = duringLogAndReturnArriveTime(startTime, counter, now, fromLocation, toLocation, bean.getSpeed(),
bean.getIntervalTime(), "");
return startTime;
}

View File

@ -7,7 +7,7 @@
* Copyright 2018-2023 codecalm.net Paweł Kuna
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
-->
<html lang="en">
<html lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
@ -18,6 +18,7 @@
<link th:href="@{/css/tabler-flags.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<style>
.mermaid {
visibility: hidden;
@ -187,7 +188,7 @@
<div class="card-body">
<div class="mb-3 ">
<label class="col-6 col-form-label required">行动名称</label>
<label class="col-6 col-form-label required" for="actionName">行动名称</label>
<div class="col">
<input type="text" class="form-control" placeholder=""
value="飞机油料补给行动"
@ -198,7 +199,7 @@
</div>
<div class="mb-4 ">
<label class="col-6 col-form-label required">补给方式</label>
<label class="col-6 col-form-label required" for="supplyType">补给方式</label>
<div class="col">
<select class="form-select" name="supplyType" id="supplyType">
<option value="">选择</option>
@ -213,7 +214,7 @@
<div class="mb-3 ">
<label class="col-6 col-form-label required">出发地位置</label>
<label class="col-6 col-form-label required" for="fromLocation">出发地位置</label>
<div class="col">
<input type="text" class="form-control" placeholder="" value="127.7700,26.3400"
name="fromLocation" id="fromLocation"/>
@ -222,7 +223,7 @@
</div>
<div class="mb-3 ">
<label class="col-6 col-form-label required">目的地位置</label>
<label class="col-6 col-form-label required" for="toLocation">目的地位置</label>
<div class="col">
<input type="text" class="form-control" placeholder="" value="127.0500,37.0600"
name="toLocation" id="toLocation"/>
@ -231,7 +232,7 @@
</div>
<div class="mb-3 ">
<label class="col-6 col-form-label required">补给装备行进速度</label>
<label class="col-6 col-form-label required" for="supplySpeed">补给装备行进速度</label>
<div class="col">
<input type="text" class="form-control" placeholder=""
value="85"
@ -242,7 +243,7 @@
</div>
<div class="mb-3 ">
<label class="col-6 col-form-label required">补给装备加注速度</label>
<label class="col-6 col-form-label required" for="supplyPump">补给装备加注速度</label>
<div class="col">
<input type="text" class="form-control " placeholder=""
value="18"
@ -253,7 +254,7 @@
</div>
<div class="mb-3 ">
<label class="col-6 col-form-label required">计算间隔时间(小时)</label>
<label class="col-6 col-form-label required" for="intervalTime">计算间隔时间(小时)</label>
<div class="col">
<input type="text" class="form-control" placeholder="" value="1"
name="intervalTime" id="intervalTime">
@ -287,10 +288,13 @@
<script th:src="@{/js/common/common.js}"></script>
<script th:src="@{/js/mermaid.min.js}"></script>
<script th:src="@{/js/mock.js}"></script>
</body>
</html>
<script>
mermaid.initialize({startOnLoad: false});
function renderAndShow() {
@ -318,6 +322,5 @@
}
</script>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,10 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
</style>
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -20,6 +20,27 @@
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -20,6 +20,27 @@
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,6 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -18,7 +18,27 @@
<link th:href="@{/css/tabler-flags.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -18,7 +18,27 @@
<link th:href="@{/css/tabler-flags.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -19,7 +19,27 @@
<link th:href="@{/css/tabler-payments.min.css}" rel="stylesheet"/>
<link th:href="@{/css/tabler-vendors.min.css}" rel="stylesheet"/>
<link th:href="@{/css/defence.css}" rel="stylesheet"/>
<style>
table {
border-collapse: collapse;
min-width: 1200px; /* 比容器宽,才会滚动 */
width: 100%;
}
/* 固定最后一列 */
th:last-child,
td:last-child {
position: sticky;
right: 0;
background: #f7fafc;
z-index: 2;
}
/* 可选:加个阴影效果,体验更好 */
th:last-child,
td:last-child {
box-shadow: -2px 0 6px -2px #8882;
}
</style>
</head>
<body>

View File

@ -316,25 +316,16 @@
</script>
</div> <!-- 油品类别2--->
<div th:fragment="fuel_startTime_dialog" id="_fuel_startTime_dialog">
<script th:src="@{/libs/flatpickr/flatpickr.js}"></script>
<script th:src="@{/libs/flatpickr/zh.js}"></script>
<div class="mb-3 ">
<label class="col-6 col-form-label required">开始时间</label>
<label class="col-6 col-form-label required" for="startTime">开始时间</label>
<div class="col">
<input type="text" class="form-control" placeholder="" value="" id="startTime" name="startTime"
th:value="${now}">
<input type="text" name="startTime" id="startTime" class="form-control" data-mask-visible="true" th:value="${now}" autocomplete="off">
<div class="invalid-feedback" id="startTime_error_tip"></div>
</div>
</div>
<script>
flatpickr("#startTime", {
enableTime: true,
time_24hr: true,
dateFormat: "Y-m-d H:i:S",
locale: "zh" // 启用中文
});
</script>
</div> <!-- 时间片段--->
<div th:fragment="fuel_equip_dialog" id="_fuel_equip_dialog">
<div class="mb-3 row">