fix: 网元PLMN新增修改使用最后记录信息
This commit is contained in:
@@ -215,14 +215,14 @@ const supportMapper = {
|
||||
name: 'guami',
|
||||
display: 'GUAMI List',
|
||||
key: ['plmnId'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
return {
|
||||
index: index,
|
||||
plmnId: plmn,
|
||||
pointer: 1,
|
||||
regionId: 1,
|
||||
setId: 1,
|
||||
pointer: lastItem.pointer,
|
||||
regionId: lastItem.regionId,
|
||||
setId: lastItem.setId,
|
||||
};
|
||||
},
|
||||
},
|
||||
@@ -231,7 +231,7 @@ const supportMapper = {
|
||||
name: 'tai',
|
||||
display: 'TAI List',
|
||||
key: ['plmnId'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
return {
|
||||
index: index,
|
||||
@@ -245,12 +245,12 @@ const supportMapper = {
|
||||
name: 'slice',
|
||||
display: 'Slice List',
|
||||
key: ['plmnId'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
return {
|
||||
index: index,
|
||||
plmnId: plmn,
|
||||
sd: param.snssai.sd,
|
||||
sd: parseInt(param.snssai.sd),
|
||||
sst: param.snssai.sst,
|
||||
};
|
||||
},
|
||||
@@ -262,9 +262,10 @@ const supportMapper = {
|
||||
name: 'plmn',
|
||||
display: 'PLMN List',
|
||||
key: ['mcc', 'mnc'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
const domain = `ims.mnc${param.plmnId.mnc}.mcc${param.plmnId.mcc}.3gppnetwork.org`;
|
||||
const mccDomain = param.plmnId.mcc.padStart(3, '0');
|
||||
const domain = `ims.mnc${param.plmnId.mnc}.mcc${mccDomain}.3gppnetwork.org`;
|
||||
return {
|
||||
index: index,
|
||||
domain: domain,
|
||||
@@ -293,14 +294,12 @@ const supportMapper = {
|
||||
name: 'gummei',
|
||||
display: 'Gummei List',
|
||||
key: ['plmnId'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
return {
|
||||
return Object.assign(lastItem, {
|
||||
index: index,
|
||||
plmnId: plmn,
|
||||
groupId: 1,
|
||||
code: 1,
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -308,7 +307,7 @@ const supportMapper = {
|
||||
name: 'tai',
|
||||
display: 'TAI List',
|
||||
key: ['plmnId'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
return {
|
||||
index: index,
|
||||
@@ -322,16 +321,12 @@ const supportMapper = {
|
||||
name: 'hss',
|
||||
display: 'HSS List',
|
||||
key: ['imsiPre'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
const Hostname = `hss.ims.mnc${param.plmnId.mnc}.mcc${param.plmnId.mcc}.3gppnetwork.org`;
|
||||
return {
|
||||
return Object.assign(lastItem, {
|
||||
index: index,
|
||||
hssHostname: Hostname,
|
||||
hssPort: 3868,
|
||||
imsiPre: plmn,
|
||||
protocol: 'SCTP',
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -339,14 +334,13 @@ const supportMapper = {
|
||||
name: 'sgw',
|
||||
display: 'SGW List',
|
||||
key: ['plmnId'],
|
||||
item: (index, param) => {
|
||||
item: (index, param, lastItem) => {
|
||||
const plmn = `${param.plmnId.mcc}${param.plmnId.mnc}`;
|
||||
return {
|
||||
return Object.assign(lastItem, {
|
||||
index: index,
|
||||
plmnId: plmn,
|
||||
sgwIp: '172.16.5.150',
|
||||
tac: param.tac,
|
||||
};
|
||||
tac: parseInt(param.tac),
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -441,7 +435,7 @@ async function toConfig(
|
||||
continue;
|
||||
}
|
||||
const index = item.index;
|
||||
const updateItem = rule.item(index, param);
|
||||
const updateItem = rule.item(index, param, item);
|
||||
// console.log('存在修改', rule.name, index, updateItem);
|
||||
const resList = await editNeConfigData({
|
||||
neType: ntType,
|
||||
@@ -454,14 +448,12 @@ async function toConfig(
|
||||
resList.code != RESULT_CODE_SUCCESS ? 'failed' : 'success';
|
||||
errMsgArr.push(`${ntType}_${neId} ${rule.display} modify ${state}`);
|
||||
} else {
|
||||
const item = res.data.sort((a, b) => b.index - a.index);
|
||||
if (!item) {
|
||||
// console.log('没有找到', rule.name, index);
|
||||
errMsgArr.push(`${ntType}_${neId} ${rule.display} not found`);
|
||||
continue;
|
||||
let lastIndex = 0;
|
||||
const arr = res.data.sort((a, b) => b.index - a.index);
|
||||
if (arr.length != 0) {
|
||||
lastIndex = arr[0].index + 1;
|
||||
}
|
||||
const lastIndex = item[0].index + 1;
|
||||
const addItem = rule.item(lastIndex, param);
|
||||
const addItem = rule.item(lastIndex, param, arr[0]);
|
||||
// console.log('不存在新增', rule.name, lastIndex, addItem);
|
||||
const resList = await addNeConfigData({
|
||||
neType: ntType,
|
||||
|
||||
Reference in New Issue
Block a user