|
|
|
@ -40,12 +40,7 @@ export class ErpParseData
|
|
|
|
|
block.BoxName = boxName;
|
|
|
|
|
block.BoardName = entity.Name; //板名称
|
|
|
|
|
block.BoardType = entity.BoardType; // 板类型 0:层板 1:立板 2:背板
|
|
|
|
|
let boardInfo = Production.GetBoardInfo(entity);
|
|
|
|
|
block.GoodsID = 0;
|
|
|
|
|
//材料,颜色
|
|
|
|
|
block.Color = boardInfo.color;
|
|
|
|
|
block.Material = boardInfo.material;
|
|
|
|
|
block.MaterialName = boardInfo.boardName;
|
|
|
|
|
//板大小
|
|
|
|
|
block.Width = this.GetNumberBit(entity.Width, 3); // 宽
|
|
|
|
|
block.Height = this.GetNumberBit(entity.Height, 3); // 高
|
|
|
|
@ -78,6 +73,10 @@ export class ErpParseData
|
|
|
|
|
baseposition.YVec = `${yVec.x},${yVec.y},${yVec.z}`;
|
|
|
|
|
baseposition.ZVec = `${zVec.x},${zVec.y},${zVec.z}`;
|
|
|
|
|
let boardData = Production.GetBoardSplitOrderData(entity);
|
|
|
|
|
//材料,颜色
|
|
|
|
|
block.Color = boardData.info.color;
|
|
|
|
|
block.Material = boardData.info.material;
|
|
|
|
|
block.MaterialName = boardData.info.boardName;
|
|
|
|
|
block.FrontHoleCount = boardData.holes.frontBackHoles != null ? boardData.holes.frontBackHoles.filter(t => t.face === DrillingFace.Front).length : 0;
|
|
|
|
|
block.BackHoleCount = boardData.holes.frontBackHoles != null ? boardData.holes.frontBackHoles.filter(t => t.face === DrillingFace.Back).length : 0;
|
|
|
|
|
block.SideHoleCount = boardData.holes.sideHoles != null ? boardData.holes.sideHoles.length : 0;
|
|
|
|
@ -91,7 +90,8 @@ export class ErpParseData
|
|
|
|
|
let cadModelArray = this.GetCadModelArray([modelData]);
|
|
|
|
|
block.CadDataType = CadType.WebCad;
|
|
|
|
|
let offsetArray = [boardData.offsetTanslation.x, boardData.offsetTanslation.y, boardData.offsetTanslation.z];
|
|
|
|
|
block.CadData = JSON.stringify([pointInfoArray, basepositionArray, cadModelArray, offsetArray]);
|
|
|
|
|
let kaiLiaoArray = [boardData.info.kaiLiaoWidth, boardData.info.kaiLiaoHeight]
|
|
|
|
|
block.CadData = JSON.stringify([pointInfoArray, basepositionArray, cadModelArray, offsetArray, kaiLiaoArray]);
|
|
|
|
|
blockList.push(block);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -125,7 +125,7 @@ export class ErpParseData
|
|
|
|
|
return w;
|
|
|
|
|
}
|
|
|
|
|
//获取异形数据
|
|
|
|
|
GetPointDetail(points: IContourData, seals: ISealingData[]): CadBlockPoint[]
|
|
|
|
|
GetPointDetail(points: IContourData): CadBlockPoint[]
|
|
|
|
|
{
|
|
|
|
|
if (points == null || points.pts == null) return [];
|
|
|
|
|
let pointList: CadBlockPoint[] = [];
|
|
|
|
@ -136,7 +136,6 @@ export class ErpParseData
|
|
|
|
|
newPoint.PointX = this.GetNumberBit(points.pts[i].x, 2);
|
|
|
|
|
newPoint.PointY = this.GetNumberBit(points.pts[i].y, 2);
|
|
|
|
|
newPoint.Curve = this.GetNumberBit(points.buls[i], 6);
|
|
|
|
|
newPoint.SealSize = seals[i].size;
|
|
|
|
|
pointList.push(newPoint);
|
|
|
|
|
}
|
|
|
|
|
return pointList;
|
|
|
|
@ -301,9 +300,11 @@ export class ErpParseData
|
|
|
|
|
GetBlockPointInfo(board: ISpliteOrderData): CadBlockInfo
|
|
|
|
|
{
|
|
|
|
|
let pointDetail: CadBlockPoint[] = [];
|
|
|
|
|
let orgPointDetail: CadBlockPoint[] = [];
|
|
|
|
|
if (board.info.isRect === false)
|
|
|
|
|
{
|
|
|
|
|
pointDetail = this.GetPointDetail(board.outline, board.sealing);
|
|
|
|
|
pointDetail = this.GetPointDetail(board.outline);
|
|
|
|
|
orgPointDetail = this.GetPointDetail(board.originOutlin);
|
|
|
|
|
}
|
|
|
|
|
let frontModelDetail = this.GetModelDetail(board.modeling, FrontOrSide.正面反面);
|
|
|
|
|
let sideModelDetail = this.GetModelDetail(board.sideModeling, FrontOrSide.侧面);
|
|
|
|
@ -317,6 +318,7 @@ export class ErpParseData
|
|
|
|
|
result.PointDetail = pointDetail;
|
|
|
|
|
result.HoleDetail = holeDetail;
|
|
|
|
|
result.ModelDetail = modelDetail;
|
|
|
|
|
result.OrgPointDetail = orgPointDetail;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -365,7 +367,7 @@ export class ErpParseData
|
|
|
|
|
{
|
|
|
|
|
return points.map(p =>
|
|
|
|
|
{
|
|
|
|
|
return [p.PointID, p.PointX, p.PointY, p.Curve, p.SealSize];
|
|
|
|
|
return [p.PointID, p.PointX, p.PointY, p.Curve];
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
GetHolesArray(holes: CadBlockHoles[])
|
|
|
|
@ -394,9 +396,9 @@ export class ErpParseData
|
|
|
|
|
{
|
|
|
|
|
return [info.BasePoint, info.XVec, info.YVec, info.ZVec];
|
|
|
|
|
}
|
|
|
|
|
GetPointInfoArray(info: CadBlockInfo): [object, object, object]
|
|
|
|
|
GetPointInfoArray(info: CadBlockInfo): [object, object, object, object]
|
|
|
|
|
{
|
|
|
|
|
return [this.GetPointsArray(info.PointDetail), this.GetHolesArray(info.HoleDetail), this.GetModelsArray(info.ModelDetail)];
|
|
|
|
|
return [this.GetPointsArray(info.PointDetail), this.GetHolesArray(info.HoleDetail), this.GetModelsArray(info.ModelDetail), this.GetPointsArray(info.OrgPointDetail)];
|
|
|
|
|
}
|
|
|
|
|
GetBasePositionArray(basePosition: CadBlockBasePosition): [number, number, number]
|
|
|
|
|
{
|
|
|
|
|