修改getShipEntity方法获取shipClazz

This commit is contained in:
lxy 2025-03-13 16:40:51 +08:00
parent 2692e2d6fc
commit c8118ec049
3 changed files with 21 additions and 12 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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;
}
}
}