Skip to content

Доработки 240705 #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ public class BusinessProcess implements ReferenceObject {
@Default
MultiLanguageString explanation = MultiLanguageString.EMPTY;

/**
* Ссылка на задачу
*/
@Default
MdoReference task = MdoReference.EMPTY;

@Override
public List<MD> getChildren() {
return children.getOrCompute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public class FilterCriterion implements MDObject, ModuleOwner, CommandOwner, For
* Свое
*/

/**
* Состав критерия
*/
@Singular("addContent")
List<MdoReference> content;

/**
* Пояснение
*/
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/github/_1c_syntax/bsl/mdo/Sequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,18 @@ public class Sequence implements MDObject, AttributeOwner, ModuleOwner {
* Свое
*/

/**
* Измерения
*/
@Singular("dimension")
List<Dimension> dimensions;

/**
* Документы
*/
@Singular("addDocuments")
List<MdoReference> documents;

/*
* Для AttributeOwner
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Служебный класс для хранения контекста при "сборке" объекта при чтении из файла
Expand Down Expand Up @@ -114,13 +115,16 @@ private void setValueChildren() {
var children = childrenNames.parallelStream()
.map(fullName -> (MD) mdReader.read(fullName))
.filter(Objects::nonNull)
.toList();
.collect(Collectors.toMap(md -> md.getMdoReference().getMdoRef(), md -> md));

children.forEach((MD child) -> {
// после обработки порядок нарушился, необходимо его соблюсти
childrenNames.forEach((String name) -> {
var child = children.get(name);
if (child != null) {
var fieldName = child.getMdoType().getName();
setValue(fieldName, child);
setValue(CHILD_FILED_NAME, child);
}
);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import org.junit.jupiter.params.aggregator.ArgumentsAccessor;
import org.junit.jupiter.params.provider.CsvSource;

import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;


Expand Down Expand Up @@ -211,7 +213,7 @@ void testFullMdclasses(ArgumentsAccessor argumentsAccessor) {
@ParameterizedTest
@CsvSource(
{
"false, mdclasses_ext",
"false, mdclasses_ext"
}
)
void testFullExt(ArgumentsAccessor argumentsAccessor) {
Expand All @@ -227,6 +229,9 @@ void testFullExt(ArgumentsAccessor argumentsAccessor) {
// проверка состава дочерних
checkChildrenExt(cf);

// проверка порядок
checkChildrenOrder(cf);

assertThat(cf.getPlainChildren())
.hasSize(147)
.allMatch(md -> md.getSupportVariant().equals(SupportVariant.NONE));
Expand All @@ -241,6 +246,21 @@ void testFullExt(ArgumentsAccessor argumentsAccessor) {
.isEmpty();
}

@ParameterizedTest
@CsvSource(
{
"true, mdclasses_ext, _edt"
}
)
void testFullExtEdt(ArgumentsAccessor argumentsAccessor) {
var mdc = MDTestUtils.readConfiguration(argumentsAccessor, false);
assertThat(mdc).isInstanceOf(ConfigurationExtension.class);
var cf = (ConfigurationExtension) mdc;

// проверка порядок
checkChildrenOrder(cf);
}

@ParameterizedTest
@CsvSource(
{
Expand Down Expand Up @@ -878,4 +898,98 @@ private static void checkChildrenExt(ConfigurationExtension cf) {
cf.getExternalDataSources().size());
}

private static void checkChildrenOrder(ConfigurationExtension cf) {
var ordered = List.of("Language.Русский",
"Subsystem.ПерваяПодсистема",
"Subsystem.ПерваяПодсистема1",
"StyleItem.ЭлементСтиля1",
"StyleItem.ЭлементСтиля2",
"Style.Стиль1",
"Style.Стиль2",
"CommonPicture.ОбщаяКартинка1",
"CommonPicture.ОбщаяКартинка2",
"SessionParameter.ПараметрСеанса1",
"SessionParameter.ПараметрСеанса2",
"Role.Роль1",
"Role.Роль2",
"CommonTemplate.Макет",
"CommonTemplate.Макет1",
"FilterCriterion.КритерийОтбора1",
"FilterCriterion.КритерийОтбора2",
"CommonModule.ПростойОбщийМодуль",
"CommonModule.ОбщийМодульВызовСервера",
"CommonModule.ОбщийМодульПовтИспВызов",
"CommonModule.ОбщийМодульПовтИспСеанс",
"CommonModule.ОбщийМодульПолныйеПрава",
"CommonModule.ПростойОбщийМодуль1",
"CommonModule.ОбщийМодульВызовСервера1",
"CommonModule.ОбщийМодульПовтИспВызов1",
"CommonModule.ОбщийМодульПовтИспСеанс1",
"CommonAttribute.ОбщийРеквизит1",
"ExchangePlan.ПланОбмена1",
"ExchangePlan.ПланОбмена2",
"XDTOPackage.ПакетXDTO1",
"XDTOPackage.ПакетXDTO2",
"WebService.WebСервис1",
"WebService.WebСервис2",
"HTTPService.HTTPСервис1",
"HTTPService.HTTPСервис2",
"WSReference.WSСсылка1",
"WSReference.WSСсылка2",
"EventSubscription.ПодпискаНаСобытие1",
"ScheduledJob.РегламентноеЗадание1",
"SettingsStorage.ХранилищеНастроек1",
"FunctionalOption.ФункциональнаяОпция1",
"FunctionalOption.ФункциональнаяОпция2",
"FunctionalOptionsParameter.ПараметрФункциональныхОпций1",
"FunctionalOptionsParameter.ПараметрФункциональныхОпций2",
"DefinedType.ОпределяемыйТип1",
"CommonCommand.ОбщаяКоманда1",
"CommonCommand.ОбщаяКоманда2",
"CommandGroup.ГруппаКоманд1",
"CommandGroup.ГруппаКоманд2",
"Constant.Константа1",
"Constant.Константа2",
"CommonForm.Форма",
"CommonForm.Форма1",
"Catalog.Справочник1",
"Catalog.Справочник2",
"Document.Документ1",
"Document.Документ2",
"DocumentNumerator.НумераторДокументов1",
"Sequence.Последовательность1",
"DocumentJournal.ЖурналДокументов1",
"Enum.Перечисление1",
"Enum.Перечисление2",
"Report.Отчет1",
"Report.Отчет2",
"DataProcessor.Обработка1",
"DataProcessor.Обработка2",
"InformationRegister.РегистрСведений1",
"InformationRegister.РегистрСведений2",
"InformationRegister.РегистрСведений3",
"InformationRegister.РегистрСведений4",
"AccumulationRegister.РегистрНакопления1",
"AccumulationRegister.РегистрНакопления2",
"ChartOfCharacteristicTypes.ПланВидовХарактеристик1",
"ChartOfCharacteristicTypes.ПланВидовХарактеристик2",
"ChartOfAccounts.ПланСчетов1",
"ChartOfAccounts.ПланСчетов2",
"AccountingRegister.РегистрБухгалтерии1",
"AccountingRegister.РегистрБухгалтерии2",
"ChartOfCalculationTypes.ПланВидовРасчета1",
"ChartOfCalculationTypes.ПланВидовРасчета2",
"CalculationRegister.РегистрРасчета2",
"CalculationRegister.РегистрРасчета1",
"BusinessProcess.БизнесПроцесс1",
"Task.Задача1");

assertThat(cf.getChildren()).hasSize(ordered.size());

for (int i = 0; i < cf.getChildren().size(); i++) {
var original = cf.getChildren().get(i);
var fixture = ordered.get(i);
assertThat(fixture).isEqualTo(original.getMdoReference().getMdoRef());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
<Comment/>
<Type/>
<UseStandardCommands>true</UseStandardCommands>
<Content/>
<Content>
<xr:Item xsi:type="xr:MDObjectRef">Document.Документ1.Attribute.Реквизит1</xr:Item>
<xr:Item xsi:type="xr:MDObjectRef">Document.Документ1.Attribute.Реквизит2</xr:Item>
</Content>
<DefaultForm/>
<AuxiliaryForm/>
<ListPresentation/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<MoveBoundaryOnPosting>Move</MoveBoundaryOnPosting>
<Documents>
<xr:Item xsi:type="xr:MDObjectRef">Document.Документ1</xr:Item>
<xr:Item xsi:type="xr:MDObjectRef">Document.Документ2</xr:Item>
</Documents>
<RegisterRecords/>
<DataLockControlMode>Managed</DataLockControlMode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
<AccountingRegister>РегистрБухгалтерии2</AccountingRegister>
<ChartOfCalculationTypes>ПланВидовРасчета1</ChartOfCalculationTypes>
<ChartOfCalculationTypes>ПланВидовРасчета2</ChartOfCalculationTypes>
<CalculationRegister>РегистрРасчета1</CalculationRegister>
<CalculationRegister>РегистрРасчета2</CalculationRegister>
<CalculationRegister>РегистрРасчета1</CalculationRegister>
<BusinessProcess>БизнесПроцесс1</BusinessProcess>
<Task>Задача1</Task>
</ChildObjects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
<name>КритерийОтбора1</name>
<type/>
<useStandardCommands>true</useStandardCommands>
<content>Document.Документ1.Attribute.Реквизит1</content>
<content>Document.Документ1.Attribute.Реквизит2</content>
</mdclass:FilterCriterion>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</producedTypes>
<name>Последовательность1</name>
<documents>Document.Документ1</documents>
<documents>Document.Документ2</documents>
<dataLockControlMode>Managed</dataLockControlMode>
<dimensions uuid="763b82dd-2fdb-4a02-a50b-3eb916c02d3d">
<name>Измерение1</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
<accountingRegisters>AccountingRegister.РегистрБухгалтерии2</accountingRegisters>
<chartsOfCalculationTypes>ChartOfCalculationTypes.ПланВидовРасчета1</chartsOfCalculationTypes>
<chartsOfCalculationTypes>ChartOfCalculationTypes.ПланВидовРасчета2</chartsOfCalculationTypes>
<calculationRegisters>CalculationRegister.РегистрРасчета1</calculationRegisters>
<calculationRegisters>CalculationRegister.РегистрРасчета2</calculationRegisters>
<calculationRegisters>CalculationRegister.РегистрРасчета1</calculationRegisters>
<businessProcesses>BusinessProcess.БизнесПроцесс1</businessProcesses>
<tasks>Task.Задача1</tasks>
</mdclass:Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
"@reference": "/com.github._1c_syntax.bsl.mdo.BusinessProcess/explanation"
},
"tabularSections": [],
"task": {
"type": "TASK",
"mdoRef": "Task.Задача1",
"mdoRefRu": "Задача.Задача1"
},
"templates": [],
"uuid": "560a32ca-028d-4b88-b6f2-6b7212bf31f8"
}}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
"@reference": "/com.github._1c_syntax.bsl.mdo.BusinessProcess/explanation"
},
"tabularSections": [],
"task": {
"type": "TASK",
"mdoRef": "Task.Задача1",
"mdoRefRu": "Задача.Задача1"
},
"templates": [],
"uuid": "560a32ca-028d-4b88-b6f2-6b7212bf31f8"
}}
Original file line number Diff line number Diff line change
Expand Up @@ -633,22 +633,22 @@
},
"modules": [
{
"moduleType": "ObjectModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/Catalogs/Справочник1/Ext/ObjectModule.bin",
"moduleType": "ManagerModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/Catalogs/Справочник1/Ext/ManagerModule.bsl",
"owner": {
"@reference": "/com.github._1c_syntax.bsl.mdo.Catalog/attributes/c/com.github._1c_syntax.bsl.mdo.children.ObjectAttribute/owner"
},
"supportVariant": "NONE",
"isProtected": true
"isProtected": false
},
{
"moduleType": "ManagerModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/Catalogs/Справочник1/Ext/ManagerModule.bsl",
"moduleType": "ObjectModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/Catalogs/Справочник1/Ext/ObjectModule.bin",
"owner": {
"@reference": "/com.github._1c_syntax.bsl.mdo.Catalog/attributes/c/com.github._1c_syntax.bsl.mdo.children.ObjectAttribute/owner"
},
"supportVariant": "NONE",
"isProtected": false
"isProtected": true
}
],
"name": "Справочник1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,22 +633,22 @@
},
"modules": [
{
"moduleType": "ObjectModule",
"uri": "src/test/resources/ext/edt/mdclasses/configuration/src/Catalogs/Справочник1/ObjectModule.bsl",
"moduleType": "ManagerModule",
"uri": "src/test/resources/ext/edt/mdclasses/configuration/src/Catalogs/Справочник1/ManagerModule.bsl",
"owner": {
"@reference": "/com.github._1c_syntax.bsl.mdo.Catalog/attributes/c/com.github._1c_syntax.bsl.mdo.children.ObjectAttribute/owner"
},
"supportVariant": "NONE",
"isProtected": true
"isProtected": false
},
{
"moduleType": "ManagerModule",
"uri": "src/test/resources/ext/edt/mdclasses/configuration/src/Catalogs/Справочник1/ManagerModule.bsl",
"moduleType": "ObjectModule",
"uri": "src/test/resources/ext/edt/mdclasses/configuration/src/Catalogs/Справочник1/ObjectModule.bsl",
"owner": {
"@reference": "/com.github._1c_syntax.bsl.mdo.Catalog/attributes/c/com.github._1c_syntax.bsl.mdo.children.ObjectAttribute/owner"
},
"supportVariant": "NONE",
"isProtected": false
"isProtected": true
}
],
"name": "Справочник1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
},
"modules": [
{
"moduleType": "ObjectModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/ChartsOfCharacteristicTypes/ПланВидовХарактеристик1/Ext/ObjectModule.bsl",
"moduleType": "ManagerModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/ChartsOfCharacteristicTypes/ПланВидовХарактеристик1/Ext/ManagerModule.bsl",
"owner": {
"@reference": "/com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypes/mdoReference"
},
"supportVariant": "NONE",
"isProtected": false
},
{
"moduleType": "ManagerModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/ChartsOfCharacteristicTypes/ПланВидовХарактеристик1/Ext/ManagerModule.bsl",
"moduleType": "ObjectModule",
"uri": "src/test/resources/ext/designer/mdclasses/src/cf/ChartsOfCharacteristicTypes/ПланВидовХарактеристик1/Ext/ObjectModule.bsl",
"owner": {
"@reference": "/com.github._1c_syntax.bsl.mdo.ChartOfCharacteristicTypes/mdoReference"
},
Expand Down
Loading
Loading