Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- convertType out.Organization toSet {
- def S1 = "СПАРК"
- def S = Dict("Source","Name",S1)
- logInfo("внешняя онтология объект: " + INN + ", kpp " + KPP + " источник " + S + ", " + Source)
- def ORG_1 = object("Organization", SPARKID:SparkID, Source:S, DateFirstReg: DateFirstReg, ShortName:ShortName, OrgName: OrgName,
- NormName:NormName,SparkGUID :SparkGUID, INN:INN,KPP:KPP,OGRN:OGRN,OKPO:OKPO, OKVEDList: OKVEDList,OKVED2List:OKVED2List,
- CharterCapital:CharterCapital,ChangesInName:ChangesInName_json, IncludeInList: IncludeInList, IndexOfDueDiligence : IndexOfDueDiligence,
- CompanySize: CompanySize, SubmittedStatements: SubmittedStatements, StateContracts: StateContracts,ArbitrationCases: ArbitrationCases,
- ExecutionProceedings: ExecutionProceedings, OKOPFName: OKOPFName,OKOPFCode:OKOPFCode, OKOPFCodeNew: OKOPFCodeNew, OKATO:OKATO)
- logInfo("созданые объект Организация, ИНН: ${ORG_1.INN}, kpp ${ORG_1.KPP} источник ${ORG_1.Source} ShortName: ${ORG_1.ShortName}")
- }
- convertType out.Person toSet {
- logInfo("старт конвертации объекта Персона")
- def S1 = "СПАРК"
- def S = Dict("Source","Name",S1)
- Utils.logInfo("внешняя онтология объект Персона, ИНН: " + INN + " источник " + S + ", " + Source)
- def PERSON_1 = object ("Person", FullName: FullName,INN: INN,Source:S,YearBirh: YearBirh,Header:Header )
- Utils.logInfo("созданые объект Персона, ИНН: " +PERSON_1.INN + " источник " + PERSON_1.Source)
- }
- convertLink out.Founder(from: Organization, to: Organization) to in.Founder(from: Organization, to: Organization)
- convertLink out.Filial(from: Organization, to: Organization) to in.Filial(from: Organization, to: Organization)
- convertLink out.Header(from: Person, to: Organization) to in.Header(from: Person, to: Organization)
- convertObjectSet OUT to IN using {
- logInfo('---convertObjectSet-----------------------------')
- def links = in.links('Founder','Filial')
- for(def link : links) {
- def from = link.from().@delegate
- def to = link.to().@delegate
- logInfo("${from.class.name}")
- logInfo("link: ${link.type()}\n\tfrom: \'${from.schema.alias}\' ${link.from().toMap()}\n\tto: \'${to.schema.alias}\' ${link.to().toMap()}")
- def fromIsOk = isMatchableObject(from)
- def toIsOk = isMatchableObject(to)
- if (fromIsOk && toIsOk) {
- logInfo('from and to is matchable')
- } else if (!fromIsOk && toIsOk) {
- logInfo('\n\tfrom is not matchable')
- } else if (fromIsOk && !toIsOk){
- logInfo('\n\tto is not matchable')
- } else {
- logInfo('\n\t \'from\' and \'to\' both are not matchable')
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement