嗨,我需要将 operationsList 数组下的 json 对象解析为关系字段和对象,但这里的技巧是我粘贴的示例在 operationsList 数组下有七个对象,我的代码能够单独解析每个 json 对象,但您需要使用以下函数能够自动选择每个 json 对象。
我需要在 pgadmin $ 中执行 postgres 9.6 的答案
注意:我尝试了几个小时使用所有功能
代码粘贴在下面
{
"header" : {
"tasklistid" : "RC016753",
"planningPlant" : "ECL",
"status" : "Z03",
"title" : "725307-STG 1 LPT NZZ",
"parentRouterId" : "",
"enginecode" : "5B",
"structureNode" : "5B_72530015200",
"routerType" : "INR",
"disassemblyLocation" : "TL725300",
"latestReleaseDate" : "31.12.8888",
"planningReference" : "INR-725300"
},
"operationsList" : [ {
"order" : "0010",
"text" : "232-003-IN PROCESS - FPI",
"workCenter" : "248",
"controlKey" : "ZQP3",
"details" : {
"longText" : "232-003-IN PROCESS - FPI FPI : Floroscent penetration Inspection This is Long text to test the API",
"MICS" : [ {
"order" : "0010",
"MICNumber" : "C0000100",
"Plant" : "ECL",
"version" : "000003"
}, {
"order" : "0020",
"MICNumber" : "C0175399",
"Plant" : "ECL",
"version" : "000001"
}, {
"order" : "0030",
"MICNumber" : "C0175400",
"Plant" : "ECL",
"version" : "000001"
} ],
"dependencies" : [ ],
"documents" : [ {
"Number" : "5B/ZSC-ECL-0041176",
"Type" : "ZSC",
"version" : "00",
"order" : "0500"
}, {
"Number" : "5B/ZSC-ECL-0041175",
"Type" : "ZSC",
"version" : "00",
"order" : "0510"
}, {
"Number" : "5B/ZSC-ECL-0041177",
"Type" : "ZSC",
"version" : "00",
"order" : "0520"
}, {
"Number" : "5B/ZSC-ECL-0041178",
"Type" : "ZSC",
"version" : "00",
"order" : "0530"
} ]
}
}, {
"order" : "0020",
"text" : "307-004-BENCHING",
"workCenter" : "358",
"controlKey" : "SM01",
"details" : {
"longText" : "",
"MICS" : [ ],
"dependencies" : [ ],
"documents" : [ ]
}
}, {
"order" : "0030",
"text" : "110-005-CHEMICAL CLEANING",
"workCenter" : "048",
"controlKey" : "ZQP1",
"details" : {
"longText" : "",
"MICS" : [ {
"order" : "0010",
"MICNumber" : "C0006683",
"Plant" : "ECL",
"version" : "000001"
} ],
"dependencies" : [ ],
"documents" : [ ]
}
}, {
"order" : "0040",
"text" : "310-001-TIG WELDING",
"workCenter" : "295",
"controlKey" : "ZQP1",
"details" : {
"longText" : "",
"MICS" : [ {
"order" : "0010",
"MICNumber" : "C0020962",
"Plant" : "ECL",
"version" : "000001"
}, {
"order" : "0020",
"MICNumber" : "C0006552",
"Plant" : "ECL",
"version" : "000001"
}, {
"order" : "0030",
"MICNumber" : "C0006511",
"Plant" : "ECL",
"version" : "000001"
} ],
"dependencies" : [ ],
"documents" : [ {
"Number" : "5B/ZSC-ECL-0041175",
"Type" : "ZSC",
"version" : "00",
"order" : "0500"
}, {
"Number" : "5B/ZSC-ECL-0041176",
"Type" : "ZSC",
"version" : "00",
"order" : "0510"
}, {
"Number" : "5B/ZSC-ECL-0041177",
"Type" : "ZSC",
"version" : "00",
"order" : "0520"
}, {
"Number" : "5B/ZSC-ECL-0041178",
"Type" : "ZSC",
"version" : "00",
"order" : "0530"
} ]
}
}, {
"order" : "0050",
"text" : "307-005-BENCHING",
"workCenter" : "358",
"controlKey" : "SM01",
"details" : {
"longText" : "",
"MICS" : [ ],
"dependencies" : [ ],
"documents" : [ {
"Number" : "5B/ZSC-ECL-0041175",
"Type" : "ZSC",
"version" : "00",
"order" : "0500"
}, {
"Number" : "5B/ZSC-ECL-0041176",
"Type" : "ZSC",
"version" : "00",
"order" : "0510"
}, {
"Number" : "5B/ZSC-ECL-0041177",
"Type" : "ZSC",
"version" : "00",
"order" : "0520"
}, {
"Number" : "5B/ZSC-ECL-0041178",
"Type" : "ZSC",
"version" : "00",
"order" : "0530"
} ]
}
}, {
"order" : "0060",
"text" : "220-001-IN PROCESS DIMENSIONAL INSP",
"workCenter" : "358",
"controlKey" : "ZQP1",
"details" : {
"longText" : "",
"MICS" : [ {
"order" : "0010",
"MICNumber" : "C0027739",
"Plant" : "ECL",
"version" : "000001"
} ],
"dependencies" : [ ],
"documents" : [ {
"Number" : "5B/ZSC-ECL-0041175",
"Type" : "ZSC",
"version" : "00",
"order" : "0500"
}, {
"Number" : "5B/ZSC-ECL-0041176",
"Type" : "ZSC",
"version" : "00",
"order" : "0510"
}, {
"Number" : "5B/ZSC-ECL-0041177",
"Type" : "ZSC",
"version" : "00",
"order" : "0520"
}, {
"Number" : "5B/ZSC-ECL-0041178",
"Type" : "ZSC",
"version" : "00",
"order" : "0530"
} ]
}
}, {
"order" : "0070",
"text" : "110-006-CHEMICAL CLEANING",
"workCenter" : "048",
"controlKey" : "ZQP1",
"details" : {
"longText" : "",
"MICS" : [ {
"order" : "0010",
"MICNumber" : "C0006683",
"Plant" : "ECL",
"version" : "000001"
} ],
"dependencies" : [ ],
"documents" : [ ]
}
} ]
}
请让我知道执行此操作的正确方法,并随时发表您的想法。