Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
18392d6961
|
|
@ -2,6 +2,7 @@ package com.hivekion.common.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -14,6 +15,7 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||||
* @since 2025/7/22
|
* @since 2025/7/22
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
|
||||||
public class WsEndpointConfig {
|
public class WsEndpointConfig {
|
||||||
@Bean
|
@Bean
|
||||||
public ServerEndpointExporter serverEndpointExporter() {
|
public ServerEndpointExporter serverEndpointExporter() {
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ public class RoomManager {
|
||||||
|
|
||||||
private static final Map<String, Room> roomsMap = new ConcurrentHashMap<>();
|
private static final Map<String, Room> roomsMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static void startRoom(String id, Scenario scenario, long time) {
|
public static void startRoom(String id, Scenario scenario, long duringTime) {
|
||||||
Room room = new Room(id, scenario);
|
Room room = new Room(id, scenario);
|
||||||
roomsMap.put(id, room);
|
roomsMap.put(id, room);
|
||||||
room.start(time);
|
room.start(duringTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void stopRoom(String id) {
|
public static void stopRoom(String id) {
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,6 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
private StatisticBean statisticBean;
|
private StatisticBean statisticBean;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public AbtParentTask(ScenarioTask scenarioTask, String roomId) {
|
public AbtParentTask(ScenarioTask scenarioTask, String roomId) {
|
||||||
this.scenarioTask = scenarioTask;
|
this.scenarioTask = scenarioTask;
|
||||||
this.roomId = roomId;
|
this.roomId = roomId;
|
||||||
|
|
@ -250,11 +249,16 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
schedule.scheduleWithFixedDelay(() -> {
|
schedule.scheduleWithFixedDelay(() -> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Room room = RoomManager.getRoom(this.roomId);
|
||||||
|
if (room == null || room.isTimeExpired()) {
|
||||||
|
log.error("房间不存在或者已经到达想定结束时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.getRoomStatus()) {
|
if (this.getRoomStatus()) {
|
||||||
//自动生成的任务不需要判断油量;不要在生成新的任务
|
//自动生成的任务不需要判断油量;不要在生成新的任务
|
||||||
log.info("{}-fromSource::{}",scenarioTask.getResourceId(),scenarioTask.getFromSource());
|
log.info("{}-fromSource::{}", scenarioTask.getResourceId(), scenarioTask.getFromSource());
|
||||||
if(!"general".equals(scenarioTask.getFromSource())) {
|
if (!"general".equals(scenarioTask.getFromSource())) {
|
||||||
double currentFuel = getCurrentFuel();
|
double currentFuel = getCurrentFuel();
|
||||||
double totalFuel = statisticBean.getFuel().getTotal();
|
double totalFuel = statisticBean.getFuel().getTotal();
|
||||||
log.info("totalFuel::{}", totalFuel);
|
log.info("totalFuel::{}", totalFuel);
|
||||||
|
|
@ -282,7 +286,6 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (distanceInfoMap.isEmpty()) {
|
if (distanceInfoMap.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -290,7 +293,7 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
if (duringAction != null) {
|
if (duringAction != null) {
|
||||||
duringAction.doSomeThing();
|
duringAction.doSomeThing();
|
||||||
}
|
}
|
||||||
log.info("移动中..... 放大系数{}",RoomManager.getMag(roomId));
|
log.info("移动中..... 放大系数{}", RoomManager.getMag(roomId));
|
||||||
//跑动距离
|
//跑动距离
|
||||||
double distance = duringTime.getAndAdd(RoomManager.getMag(roomId)) * speed;
|
double distance = duringTime.getAndAdd(RoomManager.getMag(roomId)) * speed;
|
||||||
|
|
||||||
|
|
@ -348,7 +351,7 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
this.scenarioTask.getResourceId());
|
this.scenarioTask.getResourceId());
|
||||||
editScenarioInfo.getJbxx().getTeam().setLat(coordinate.getLat() + "");
|
editScenarioInfo.getJbxx().getTeam().setLat(coordinate.getLat() + "");
|
||||||
editScenarioInfo.getJbxx().getTeam().setLng(coordinate.getLng() + "");
|
editScenarioInfo.getJbxx().getTeam().setLng(coordinate.getLng() + "");
|
||||||
setEditScenarioInfo(editScenarioInfo,scenarioTask.getResourceId());
|
setEditScenarioInfo(editScenarioInfo, scenarioTask.getResourceId());
|
||||||
pushStatus(scenarioTask.getResourceId());
|
pushStatus(scenarioTask.getResourceId());
|
||||||
|
|
||||||
} else if (Double.compare(distance, endPoint.getKey()) == 0) {
|
} else if (Double.compare(distance, endPoint.getKey()) == 0) {
|
||||||
|
|
@ -399,7 +402,7 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
return JSON.parseObject(updJsonStr, EditScenarioInfo.class);
|
return JSON.parseObject(updJsonStr, EditScenarioInfo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setEditScenarioInfo(EditScenarioInfo editScenarioInfo,String resourceId) {
|
protected void setEditScenarioInfo(EditScenarioInfo editScenarioInfo, String resourceId) {
|
||||||
SpringUtil.getBean(RedisUtil.class).hset(
|
SpringUtil.getBean(RedisUtil.class).hset(
|
||||||
this.scenarioTask.getScenarioId() + "-" + roomId + "-" + resourceId,
|
this.scenarioTask.getScenarioId() + "-" + roomId + "-" + resourceId,
|
||||||
"updScenarioInfo", JSON.toJSONString(editScenarioInfo));
|
"updScenarioInfo", JSON.toJSONString(editScenarioInfo));
|
||||||
|
|
@ -473,7 +476,6 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
// 找出油料保障分队
|
// 找出油料保障分队
|
||||||
for (ScenarioResource resource : resourceList) {
|
for (ScenarioResource resource : resourceList) {
|
||||||
|
|
||||||
|
|
||||||
Teaminfo teaminfo = teamInfoMap.get(resource.getResourceId());
|
Teaminfo teaminfo = teamInfoMap.get(resource.getResourceId());
|
||||||
|
|
||||||
if ("SUPPLIER_FUEL".equals(teaminfo.getRoleCode())) {
|
if ("SUPPLIER_FUEL".equals(teaminfo.getRoleCode())) {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class Room implements AutoCloseable {
|
||||||
private Map<String, Coordinate> resourceCoordinateMap = new ConcurrentHashMap<>();
|
private Map<String, Coordinate> resourceCoordinateMap = new ConcurrentHashMap<>();
|
||||||
//资源路线path
|
//资源路线path
|
||||||
private Map<String, Object> resourcePathMap = new ConcurrentHashMap<>();
|
private Map<String, Object> resourcePathMap = new ConcurrentHashMap<>();
|
||||||
private Map<String,ScenarioResource> scenarioResourceMap = new ConcurrentHashMap<>();
|
private Map<String, ScenarioResource> scenarioResourceMap = new ConcurrentHashMap<>();
|
||||||
/**
|
/**
|
||||||
* 任务管理相关
|
* 任务管理相关
|
||||||
*/
|
*/
|
||||||
|
|
@ -109,11 +109,14 @@ public class Room implements AutoCloseable {
|
||||||
*/
|
*/
|
||||||
public void start(long time) {
|
public void start(long time) {
|
||||||
status.set(true);
|
status.set(true);
|
||||||
|
log.info("想定持续时间{}", time);
|
||||||
totalTime.set(time);
|
totalTime.set(time);
|
||||||
startTask();
|
|
||||||
//初始化系统资源 物资人员等信息
|
//初始化系统资源 物资人员等信息
|
||||||
initRoomParam();
|
initRoomParam();
|
||||||
pushRoomInfo();
|
pushRoomInfo();
|
||||||
|
|
||||||
|
startTask();
|
||||||
|
|
||||||
numStatus.set(1);
|
numStatus.set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,7 +142,6 @@ public class Room implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂停
|
* 暂停
|
||||||
*/
|
*/
|
||||||
|
|
@ -159,7 +161,10 @@ public class Room implements AutoCloseable {
|
||||||
public long getDuringTime() {
|
public long getDuringTime() {
|
||||||
return duringTime.get();
|
return duringTime.get();
|
||||||
}
|
}
|
||||||
|
//是否到达想定结束时间
|
||||||
|
public boolean isTimeExpired() {
|
||||||
|
return totalTime.get() - duringTime.get() <= 0;
|
||||||
|
}
|
||||||
|
|
||||||
// 启动定时任务
|
// 启动定时任务
|
||||||
private void startTask() {
|
private void startTask() {
|
||||||
|
|
@ -172,14 +177,24 @@ public class Room implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
long curTime = duringTime.addAndGet(this.mag);
|
long curTime = duringTime.addAndGet(this.mag);
|
||||||
|
if (totalTime.get() - curTime > 0) {
|
||||||
sendRemainTime((totalTime.get() - curTime));
|
sendRemainTime((totalTime.get() - curTime));
|
||||||
|
} else {
|
||||||
|
log.info("想定结束,持续时间{}", curTime);
|
||||||
|
future.cancel(true);
|
||||||
|
scheduler.shutdownNow();
|
||||||
|
}
|
||||||
|
|
||||||
NavigableMap<Long, Map<String, TaskAction>> actions = actionMap.headMap(curTime, true);
|
NavigableMap<Long, Map<String, TaskAction>> actions = actionMap.headMap(curTime, true);
|
||||||
if (!actions.isEmpty()) {
|
if (!actions.isEmpty()) {
|
||||||
actions.forEach((key, action) -> {
|
actions.forEach((key, action) -> {
|
||||||
action.forEach((taskAction, task) -> {
|
action.forEach((taskAction, task) -> {
|
||||||
|
try {
|
||||||
actionExecutor.submit(task::doSomeThing);
|
actionExecutor.submit(task::doSomeThing);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("error::", e);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -204,7 +219,7 @@ public class Room implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws Exception {
|
public void close() {
|
||||||
actionMap.clear();
|
actionMap.clear();
|
||||||
if (future != null && !future.isCancelled()) {
|
if (future != null && !future.isCancelled()) {
|
||||||
future.cancel(true);
|
future.cancel(true);
|
||||||
|
|
@ -215,7 +230,7 @@ public class Room implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendRemainTime(long remainTime) {
|
private void sendRemainTime(long remainTime) {
|
||||||
|
log.info("remain_time{}", remainTime);
|
||||||
Map<String, Object> timeMap = new HashMap<>();
|
Map<String, Object> timeMap = new HashMap<>();
|
||||||
timeMap.put("update_time_str", utils.formatSeconds(remainTime));
|
timeMap.put("update_time_str", utils.formatSeconds(remainTime));
|
||||||
timeMap.put("remain_time", remainTime);
|
timeMap.put("remain_time", remainTime);
|
||||||
|
|
@ -263,32 +278,24 @@ public class Room implements AutoCloseable {
|
||||||
scenarioResourceMap.put(resource.getId(), resource);
|
scenarioResourceMap.put(resource.getId(), resource);
|
||||||
});
|
});
|
||||||
long endTime = System.currentTimeMillis();
|
long endTime = System.currentTimeMillis();
|
||||||
log.info("======cost time============={}===================",endTime-begTime);
|
log.info("======cost time============={}===================", endTime - begTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addResourcePath(String resourceId, Object obj) {
|
public void addResourcePath(String resourceId, Object obj) {
|
||||||
resourcePathMap.put(resourceId, obj);
|
resourcePathMap.put(resourceId, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getResourcePath(String resourceId) {
|
|
||||||
return resourcePathMap.get(resourceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addResourceLastPosition(String resourceId, Coordinate obj) {
|
|
||||||
resourceCoordinateMap.put(resourceId, obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Coordinate getResourceLastPosition(String resourceId) {
|
|
||||||
return resourceCoordinateMap.get(resourceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> getPathMap() {
|
public Map<String, Object> getPathMap() {
|
||||||
return resourcePathMap;
|
return resourcePathMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, ScenarioResource> getScenarioResourceMap() {
|
public Map<String, ScenarioResource> getScenarioResourceMap() {
|
||||||
return scenarioResourceMap;
|
return scenarioResourceMap;
|
||||||
}
|
}
|
||||||
private void pushRoomInfo(){
|
|
||||||
|
private void pushRoomInfo() {
|
||||||
ResponseCmdInfo<Object> respObj = new ResponseCmdInfo<>();
|
ResponseCmdInfo<Object> respObj = new ResponseCmdInfo<>();
|
||||||
Map<String, Object> dataMap = new HashMap<>();
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
dataMap.put("mag", this.getMag());
|
dataMap.put("mag", this.getMag());
|
||||||
|
|
@ -300,7 +307,7 @@ public class Room implements AutoCloseable {
|
||||||
Global.sendCmdInfoQueue.add(respObj);
|
Global.sendCmdInfoQueue.add(respObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearScenarioCache(){
|
private void clearScenarioCache() {
|
||||||
try {
|
try {
|
||||||
scenario.setResourceList(SpringUtil.getBean(ScenarioResourceServiceImpl.class)
|
scenario.setResourceList(SpringUtil.getBean(ScenarioResourceServiceImpl.class)
|
||||||
.getResourceListByScenarioId(scenario.getId()));
|
.getResourceListByScenarioId(scenario.getId()));
|
||||||
|
|
@ -308,7 +315,8 @@ public class Room implements AutoCloseable {
|
||||||
redisUtil = SpringUtil.getBean(RedisUtil.class);
|
redisUtil = SpringUtil.getBean(RedisUtil.class);
|
||||||
}
|
}
|
||||||
for (ScenarioResource scenarioResource : this.scenario.getResourceList()) {
|
for (ScenarioResource scenarioResource : this.scenario.getResourceList()) {
|
||||||
ScenarioInfo scenarioInfo = scenarioService.listScenarioInfo(scenarioResource.getScenarioId(),
|
ScenarioInfo scenarioInfo = scenarioService.listScenarioInfo(
|
||||||
|
scenarioResource.getScenarioId(),
|
||||||
roomId, scenarioResource.getId());
|
roomId, scenarioResource.getId());
|
||||||
EditScenarioInfo updScenarioInfo = scenarioService.listEditScenarioInfo(
|
EditScenarioInfo updScenarioInfo = scenarioService.listEditScenarioInfo(
|
||||||
scenarioResource.getScenarioId(), roomId, scenarioResource.getId());
|
scenarioResource.getScenarioId(), roomId, scenarioResource.getId());
|
||||||
|
|
@ -317,7 +325,7 @@ public class Room implements AutoCloseable {
|
||||||
redisUtil.delete(
|
redisUtil.delete(
|
||||||
scenarioResource.getScenarioId() + "-" + roomId + "-" + scenarioResource.getId());
|
scenarioResource.getScenarioId() + "-" + roomId + "-" + scenarioResource.getId());
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
} catch (Exception ex) {
|
||||||
log.error("===================clear cached fail==========================");
|
log.error("===================clear cached fail==========================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ public class ScenarioRoomController extends BaseController {
|
||||||
ResponseCmdInfo<Object> respObj = new ResponseCmdInfo<>();
|
ResponseCmdInfo<Object> respObj = new ResponseCmdInfo<>();
|
||||||
Map<String, Object> dataMap = new HashMap<>();
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
dataMap.put("mag", mag);
|
dataMap.put("mag", mag);
|
||||||
dataMap.put("status", RoomManager.getRoom(room.getId()).getStatus());
|
dataMap.put("status", RoomManager.getRoom(room.getId())==null?0:RoomManager.getRoom(room.getId()).getStatus());
|
||||||
respObj.setData(dataMap);
|
respObj.setData(dataMap);
|
||||||
respObj.setRoom(room.getId());
|
respObj.setRoom(room.getId());
|
||||||
respObj.setScenarioId(room.getScenarioId());
|
respObj.setScenarioId(room.getScenarioId());
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
spring.datasource.dynamic.primary=dm
|
spring.datasource.dynamic.primary=dm
|
||||||
spring.datasource.dynamic.strict=false
|
spring.datasource.dynamic.strict=false
|
||||||
spring.datasource.dynamic.datasource.dm.url=jdbc:dm://192.168.0.53:5236/SIMULATION
|
spring.datasource.dynamic.datasource.dm.url=jdbc:dm://127.0.0.1:5236/SIMULATION
|
||||||
spring.datasource.dynamic.datasource.dm.driver-class-name=dm.jdbc.driver.DmDriver
|
spring.datasource.dynamic.datasource.dm.driver-class-name=dm.jdbc.driver.DmDriver
|
||||||
spring.datasource.dynamic.datasource.dm.username=simulation
|
spring.datasource.dynamic.datasource.dm.username=SYSDBA
|
||||||
spring.datasource.dynamic.datasource.dm.password=Simulation001
|
spring.datasource.dynamic.datasource.dm.password=SYSDBA001
|
||||||
|
|
||||||
spring.redis.database=0
|
spring.redis.database=0
|
||||||
spring.redis.host=192.168.0.225
|
spring.redis.host=127.0.0.1
|
||||||
spring.redis.port=6379
|
spring.redis.port=6379
|
||||||
#spring.redis.password=123
|
#spring.redis.password=123
|
||||||
spring.redis.timeout=5000
|
spring.redis.timeout=5000
|
||||||
|
|
@ -52,4 +52,3 @@ get.all.user = http://127.0.0.1/oauth2Server/api/outside/syncUserAll
|
||||||
logout.url=http://127.0.0.1:99/oauth2Server/oauth2/logout
|
logout.url=http://127.0.0.1:99/oauth2Server/oauth2/logout
|
||||||
|
|
||||||
path.planning.url=http://192.168.0.53:8989/route
|
path.planning.url=http://192.168.0.53:8989/route
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ death.warn = 2
|
||||||
ammunition.warn = 3
|
ammunition.warn = 3
|
||||||
food.warn = 3
|
food.warn = 3
|
||||||
water.warn = 3
|
water.warn = 3
|
||||||
fuel.warn = 95.99
|
fuel.warn = 99.80
|
||||||
medical.warn = 1
|
medical.warn = 1
|
||||||
death.spreed = 3
|
death.spreed = 3
|
||||||
injured.spreed = 3
|
injured.spreed = 3
|
||||||
|
|
|
||||||
30
src/main/resources/logback-spring.xml
Normal file
30
src/main/resources/logback-spring.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 文件输出,按天滚动 -->
|
||||||
|
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>/home/admin/app/logs/app.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 每天一个日志文件,保留30天 -->
|
||||||
|
<fileNamePattern>logs/app-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 日志级别 -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
<appender-ref ref="file" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
|
||||||
|
</configuration>
|
||||||
|
|
@ -2,6 +2,13 @@ package com.hivekion;
|
||||||
|
|
||||||
import com.hivekion.baseData.entity.ModuleStatus;
|
import com.hivekion.baseData.entity.ModuleStatus;
|
||||||
import com.hivekion.baseData.service.ModuleStatusService;
|
import com.hivekion.baseData.service.ModuleStatusService;
|
||||||
|
import com.hivekion.common.uuid.IdUtils;
|
||||||
|
import com.hivekion.scenario.entity.ScenarioResource;
|
||||||
|
import com.hivekion.scenario.service.ScenarioResourceService;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.List;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
@ -21,13 +28,18 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||||
*/
|
*/
|
||||||
@SpringBootTest(classes = DemoApplication.class)
|
@SpringBootTest(classes = DemoApplication.class)
|
||||||
@AutoConfigureMockMvc
|
@AutoConfigureMockMvc
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
public class ApplicationTest {
|
public class ApplicationTest {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ModuleStatusService moduleStatusService;
|
private ModuleStatusService moduleStatusService;
|
||||||
|
@Resource
|
||||||
|
private ScenarioResourceService scenarioResourceService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void modStatus(){
|
public void modStatus() {
|
||||||
ModuleStatus status = new ModuleStatus();
|
ModuleStatus status = new ModuleStatus();
|
||||||
status.setModuleName("评估子系统");
|
status.setModuleName("评估子系统");
|
||||||
status.setModuleUrl("/");
|
status.setModuleUrl("/");
|
||||||
|
|
@ -37,4 +49,5 @@ public class ApplicationTest {
|
||||||
moduleStatusService.save(status);
|
moduleStatusService.save(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user