修改getShipEntity方法获取shipClazz
This commit is contained in:
parent
2692e2d6fc
commit
c8118ec049
|
|
@ -63,10 +63,13 @@ export async function getShipEntity(shipServiceId, orderIds, context) {
|
|||
for (const e of entities) {
|
||||
const k = `${e}$system`;
|
||||
const row = system[k][0];
|
||||
if (row && row.sort > sort && await ShipClazzDict[e]?.available(shipServiceId, orderIds, context)) {
|
||||
sort = row.sort;
|
||||
entity = e;
|
||||
entityId = row.id;
|
||||
if (row && row.sort > sort) {
|
||||
const clazz = await getShipClazz(e, row.id, context);
|
||||
if (await clazz.available(shipServiceId, orderIds, context)) {
|
||||
sort = row.sort;
|
||||
entity = e;
|
||||
entityId = row.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entity) {
|
||||
|
|
|
|||
|
|
@ -69,10 +69,13 @@ async function getShipEntity(shipServiceId, orderIds, context) {
|
|||
for (const e of entities) {
|
||||
const k = `${e}$system`;
|
||||
const row = system[k][0];
|
||||
if (row && row.sort > sort && await ShipClazzDict[e]?.available(shipServiceId, orderIds, context)) {
|
||||
sort = row.sort;
|
||||
entity = e;
|
||||
entityId = row.id;
|
||||
if (row && row.sort > sort) {
|
||||
const clazz = await getShipClazz(e, row.id, context);
|
||||
if (await clazz.available(shipServiceId, orderIds, context)) {
|
||||
sort = row.sort;
|
||||
entity = e;
|
||||
entityId = row.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entity) {
|
||||
|
|
|
|||
|
|
@ -95,10 +95,13 @@ export async function getShipEntity(shipServiceId: string, orderIds: string[], c
|
|||
for (const e of entities) {
|
||||
const k = `${e}$system` as keyof EntityDict['system']['Schema'];
|
||||
const row = system[k][0];
|
||||
if (row && row.sort > sort && await ShipClazzDict[e]?.available(shipServiceId, orderIds, context)) {
|
||||
sort = row.sort;
|
||||
entity = e;
|
||||
entityId = row.id;
|
||||
if (row && row.sort > sort) {
|
||||
const clazz = await getShipClazz(e, row.id!, context);
|
||||
if (await clazz.available(shipServiceId, orderIds, context)) {
|
||||
sort = row.sort;
|
||||
entity = e;
|
||||
entityId = row.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue