【修改步骤并保存仿真背景】

This commit is contained in:
weizhihong 2022-08-29 10:23:45 +08:00
parent 12dc16c0b5
commit 1e15bb8ee3

View File

@ -1,7 +1,6 @@
package club.joylink.rtss.services.training2;
import club.joylink.rtss.dao.DraftTraining2DAO;
import club.joylink.rtss.entity.TrainingWithBLOBs;
import club.joylink.rtss.entity.training2.DraftTraining2;
import club.joylink.rtss.entity.training2.DraftTraining2Example;
import club.joylink.rtss.entity.training2.DraftTraining2WithBLOBs;
@ -23,8 +22,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import java.time.LocalDateTime;
import java.util.ArrayList;
@ -42,6 +39,7 @@ public class Training2DraftService {
private DraftTraining2DAO trainingDao;
@Autowired
private GroupSimulationService roupSimulationService;
/**
* 根据基本信息创建实训
*
@ -123,6 +121,7 @@ public class Training2DraftService {
//
this.trainingDao.updateByExampleSelective(b, example);
}
/**
* 重置用户实训草稿的初始背景
*/
@ -138,6 +137,7 @@ public class Training2DraftService {
//
this.trainingDao.updateByExampleSelective(b, example);
}
/**
* 更新用户实训草稿的地图定位信息
*/
@ -155,6 +155,7 @@ public class Training2DraftService {
//
this.trainingDao.updateByExampleSelective(b, example);
}
/**
* 更新当前用户的实训草稿基础信息
*/
@ -315,11 +316,14 @@ public class Training2DraftService {
/**
* 修改实训所有步骤
*/
public void updateSteps(Long trainingId, List<Step2VO> step2VOList) {
public void updateSteps(String group, Long trainingId, List<Step2VO> step2VOList) {
DraftTraining2WithBLOBs draftTraining2 = trainingDao.selectByPrimaryKey(trainingId);
if (draftTraining2 == null) {
throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在");
}
// 保存当前背景
Simulation simulation = this.roupSimulationService.getSimulationByGroup(group);
StorageSimulation scenesSaving = new StorageSimulation(simulation, false);
String stepJson;
if (CollectionUtils.isEmpty(step2VOList)) {
stepJson = StringUtil.EMPTY_STRING;