功能:嘉居导入AB库模块修改柜名和房名

pull/2485/head
ChenX 10 months ago
parent 83801dc37d
commit a8bbc3413f

@ -182,6 +182,13 @@ class JiaJuParse
async ParseProduct(product: JiaJu.ProductBase, guiName: string = undefined, parentRoomName: string = ""): Promise<TemplateRecord | Entity> async ParseProduct(product: JiaJu.ProductBase, guiName: string = undefined, parentRoomName: string = ""): Promise<TemplateRecord | Entity>
{ {
//提前解析柜名和房名
if ((product as JiaJu.ModelProduct).RoomID)//有RoomId的层级就是柜子层级
{
parentRoomName = this.RoomIdNameMap.get((product as JiaJu.ModelProduct).RoomID) ?? parentRoomName;
guiName = product.Name ?? guiName ?? "[未命名]";//尊重有RoomID的层级的柜名
}
let entity: Entity; let entity: Entity;
let template: TemplateRecord; let template: TemplateRecord;
if (product.TypeID === "BanJian")//(product as JiaJu.EntityProduct).BoardMode if (product.TypeID === "BanJian")//(product as JiaJu.EntityProduct).BoardMode
@ -215,6 +222,10 @@ class JiaJuParse
{ {
if (en instanceof Board) if (en instanceof Board)
{ {
//设置柜名和房名
en.BoardProcessOption[EBoardKeyList.RoomName] = parentRoomName;
en.BoardProcessOption[EBoardKeyList.CabinetName] = guiName;
if (paramTable.MTL) if (paramTable.MTL)
{ {
const materialParam = this.Code_MaterialInfo.get(paramTable.MTL); const materialParam = this.Code_MaterialInfo.get(paramTable.MTL);
@ -228,6 +239,10 @@ class JiaJuParse
} }
if (en instanceof HardwareCompositeEntity) if (en instanceof HardwareCompositeEntity)
{ {
//设置柜名和房名
en.HardwareOption.roomName = parentRoomName;
en.HardwareOption.cabinetName = guiName;
let parsMap = new Map([["CFDW", "unit"], ["CFJG", "actualExpr"], ["CFXH", "model"], ["CFCJ", "factory"], ["CFPP", "brand"], let parsMap = new Map([["CFDW", "unit"], ["CFJG", "actualExpr"], ["CFXH", "model"], ["CFCJ", "factory"], ["CFPP", "brand"],
["CFGG", "spec"], ["CFSL", "count"], ["CFCZ", "material"], ["CFYS", "color"]]); ["CFGG", "spec"], ["CFSL", "count"], ["CFCZ", "material"], ["CFYS", "color"]]);
@ -289,12 +304,6 @@ class JiaJuParse
let childrenEntitys: Entity[] = []; let childrenEntitys: Entity[] = [];
let childrenTemplate: TemplateRecord[] = []; let childrenTemplate: TemplateRecord[] = [];
if ((product as JiaJu.ModelProduct).RoomID)//有RoomId的层级就是柜子层级
{
parentRoomName = this.RoomIdNameMap.get((product as JiaJu.ModelProduct).RoomID) ?? parentRoomName;
guiName = product.Name ?? guiName ?? "[未命名]";//尊重有RoomID的层级的柜名
}
if ((product as JiaJu.ModelProduct).Products[0]?.Product?.length) if ((product as JiaJu.ModelProduct).Products[0]?.Product?.length)
for (let p of (product as JiaJu.ModelProduct).Products[0].Product) for (let p of (product as JiaJu.ModelProduct).Products[0].Product)
{ {

Loading…
Cancel
Save