代码格式化
This commit is contained in:
parent
db657689bf
commit
f8abb9eddc
@ -124,37 +124,37 @@ public class GenerateTask {
|
||||
@Transactional
|
||||
public String generateNewTrainings(Long mapId, MapVO mapVO) {
|
||||
log.warn("generate training start...[{}]", LocalTime.now());
|
||||
// 查询通用运行图
|
||||
RunPlanVO planVO = this.iRunPlanTemplateService.getFirstRunPlanByMapId(mapVO.getId());
|
||||
this.delete(mapId);
|
||||
GenerateConfig config = new GenerateConfig();
|
||||
config.setMapId(mapId);
|
||||
List<String> results = new ArrayList<>();
|
||||
List<CommandDefinitionVO> commandDefinitions = iCommandService.queryDefinitionsByLineCode(mapVO.getLineCode());
|
||||
Map<String, List<CommandDefinitionVO>> groupByPrdType = commandDefinitions.stream()
|
||||
.collect(Collectors.groupingBy(CommandDefinitionVO::getPrdType));
|
||||
groupByPrdType.forEach((r, cdr) -> {
|
||||
config.setPrdType(r);
|
||||
SimulationBuildParams params = SimulationBuildParams.builder()
|
||||
.createTime(LocalDateTime.now())
|
||||
.map(mapVO)
|
||||
.prodType(MapPrdTypeEnum.getMapPrdTypeEnumByCode(config.getPrdType()))
|
||||
.runPlan(planVO)
|
||||
.build();
|
||||
Simulation simulation = SimulationBuilder.build(params);
|
||||
Map<String, List<CommandDefinitionVO>> groupByOperationObject = cdr.stream()
|
||||
.collect(Collectors.groupingBy(CommandDefinitionVO::getOperateObject));
|
||||
groupByOperationObject.forEach((o, cdo) -> {
|
||||
config.setTrainingType(o);
|
||||
config.setOperateType(cdo.stream().map(cd -> cd.getOperate()).collect(Collectors.toList()));
|
||||
List<String> list = this.generateNew(config, mapVO, simulation);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
results.addAll(list);
|
||||
}
|
||||
});
|
||||
// 查询通用运行图
|
||||
RunPlanVO planVO = this.iRunPlanTemplateService.getFirstRunPlanByMapId(mapVO.getId());
|
||||
this.delete(mapId);
|
||||
GenerateConfig config = new GenerateConfig();
|
||||
config.setMapId(mapId);
|
||||
List<String> results = new ArrayList<>();
|
||||
List<CommandDefinitionVO> commandDefinitions = iCommandService.queryDefinitionsByLineCode(mapVO.getLineCode());
|
||||
Map<String, List<CommandDefinitionVO>> groupByPrdType = commandDefinitions.stream()
|
||||
.collect(Collectors.groupingBy(CommandDefinitionVO::getPrdType));
|
||||
groupByPrdType.forEach((r, cdr) -> {
|
||||
config.setPrdType(r);
|
||||
SimulationBuildParams params = SimulationBuildParams.builder()
|
||||
.createTime(LocalDateTime.now())
|
||||
.map(mapVO)
|
||||
.prodType(MapPrdTypeEnum.getMapPrdTypeEnumByCode(config.getPrdType()))
|
||||
.runPlan(planVO)
|
||||
.build();
|
||||
Simulation simulation = SimulationBuilder.build(params);
|
||||
Map<String, List<CommandDefinitionVO>> groupByOperationObject = cdr.stream()
|
||||
.collect(Collectors.groupingBy(CommandDefinitionVO::getOperateObject));
|
||||
groupByOperationObject.forEach((o, cdo) -> {
|
||||
config.setTrainingType(o);
|
||||
config.setOperateType(cdo.stream().map(cd -> cd.getOperate()).collect(Collectors.toList()));
|
||||
List<String> list = this.generateNew(config, mapVO, simulation);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
results.addAll(list);
|
||||
}
|
||||
});
|
||||
log.warn("generate training end...[{}]", LocalTime.now());
|
||||
return CollectionUtils.isEmpty(results) ? "成功" : String.join(",", results);
|
||||
});
|
||||
log.warn("generate training end...[{}]", LocalTime.now());
|
||||
return CollectionUtils.isEmpty(results) ? "成功" : String.join(",", results);
|
||||
}
|
||||
|
||||
@Async
|
||||
|
Loading…
Reference in New Issue
Block a user