Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-xzb1
This commit is contained in:
commit
7b912b5027
@ -30,6 +30,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -104,13 +105,15 @@ public class Training2DraftService {
|
||||
List<DraftTraining2> find = this.trainingDao.selectByExample(example);
|
||||
return null != find && !find.isEmpty();
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public DraftTraining2 findById(Long id){
|
||||
public DraftTraining2 findById(Long id) {
|
||||
DraftTraining2Example example = new DraftTraining2Example();
|
||||
example.createCriteria().andIdEqualTo(id);
|
||||
List<DraftTraining2> find = this.trainingDao.selectByExample(example);
|
||||
return null != find && find.size()>0 ? find.get(0):null;
|
||||
return null != find && find.size() > 0 ? find.get(0) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户实训草稿的初始背景
|
||||
*/
|
||||
@ -360,6 +363,12 @@ public class Training2DraftService {
|
||||
if (draftTraining2 == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Data_Not_Exist, "实训不存在");
|
||||
}
|
||||
AtomicInteger operationId = new AtomicInteger(0); // 操作ID
|
||||
// 设置Operation的Id
|
||||
step2VOList.stream().filter(s -> !CollectionUtils.isEmpty(s.getOperations())).forEach(s -> {
|
||||
operationId.set(0);
|
||||
s.getOperations().forEach(o -> o.setId(operationId.getAndIncrement()));
|
||||
});
|
||||
// 保存当前背景
|
||||
Simulation simulation = this.roupSimulationService.getSimulationByGroup(group);
|
||||
DraftTraining2WithBLOBs updateObj = new DraftTraining2WithBLOBs();
|
||||
|
Loading…
Reference in New Issue
Block a user