1140 Veröffentlichungsart aus ART

This commit is contained in:
Felix Lohmeier 2020-08-13 15:46:22 +02:00
parent 68d63562a0
commit cfa4178d9a
2 changed files with 80 additions and 39 deletions

View File

@ -567,50 +567,44 @@ echo
# ----------------------------------- 0500 ----------------------------------- #
# spec_B_T_56
# TODO: Regeln für ART=GH, ART=L
# TODO: Differenzierung nach MEDGR
echo "Gattung und Status 0500..."
read -r -d '' expression << EXPRESSION
if(
or(
value == 'M',
value == 'L'
),
'Aan',
if(
if(
value == 'U',
'Asn',
if(
if(
or(
value == 'A',
value == 'V'
),
'Ban',
if(
value == 'V',
'Ban',
if(
if(
and(
value == 'P',
forNonBlank(cells['M|MEDGR'].value,v,if(v == 'SPIEL', true, false),false)
),
'Ban',
if(
if(
value == 'P',
'Lax',
if(
if(
value == 'G',
'Acn',
if(
if(
value == 'S',
'AFn',
if(
if(
value == 'Z',
'Abn',
null
)
)
)
)
)
)
)
)
)
null
))))))))
EXPRESSION
if curl -fs \
--data project="${projects[$p]}" \
@ -639,6 +633,51 @@ else
fi
echo
# ----------------------------------- 1140 ----------------------------------- #
# spec_B_T_53
# TODO: Differenzierung nach MEDGR
echo "Veröffentlichungsart 1140..."
read -r -d '' expression << EXPRESSION
if(
value == 'A',
'muto',
if(
value == 'V',
'vide',
if(
value == 'L',
'lo',
null
)))
EXPRESSION
if curl -fs \
--data project="${projects[$p]}" \
--data-urlencode "operations@-" \
"${endpoint}/command/core/apply-operations$(refine_csrf)" > /dev/null \
<< JSON
[
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "M|ART",
"expression": $(echo "grel:${expression}" | ${jq} -s -R '.'),
"onError": "set-to-blank",
"newColumnName": "1140",
"columnInsertIndex": 3
}
]
JSON
then
log "transformed ${p} (${projects[$p]})"
else
error "transform ${p} (${projects[$p]}) failed!"
fi
echo
# ----------------------------------- 4000 ----------------------------------- #
# spec_B_T_17
@ -730,6 +769,7 @@ with(
'2199',
'0100',
'0500',
'1140',
'2000',
'4000',
'7100B',

View File

@ -475,6 +475,7 @@ if(row.index - row.record.fromRowIndex == 0,
'' + '\n'
+ forNonBlank(cells['0500'].value, v, '002@' + ' 0' + v + '\n', '')
+ forNonBlank(cells['0100'].value, v, '003@' + ' 0' + v + '\n', '')
+ forNonBlank(cells['1140'].value, v, '013H@' + ' a' + v + '\n', '')
+ forNonBlank(cells['2000'].value, v, forEach(v.split('␟'),x,'004A' + ' 0' + x + '\n').join(''), '')
+ forNonBlank(cells['2199'].value, v, '006Y' + ' 0' + v + '\n', '')
+ forNonBlank(cells['4000'].value, v, '021A' + ' a' + v + '\n', '')