|
|
|
@ -10,12 +10,13 @@ import { HardwareTopline } from "../../DatabaseServices/Hardware/HardwareTopline
|
|
|
|
|
import { ObjectId } from "../../DatabaseServices/ObjectId";
|
|
|
|
|
import { TemplateRecord } from "../../DatabaseServices/Template/TemplateRecord";
|
|
|
|
|
import { CoordinateSystem } from "../../Geometry/CoordinateSystem";
|
|
|
|
|
import { AsVector2, equalv3, GetBoxArr, ZeroVec } from "../../Geometry/GeUtils";
|
|
|
|
|
import { AsVector2, GetBoxArr, ZeroVec, equalv3 } from "../../Geometry/GeUtils";
|
|
|
|
|
import { IContourData } from "../../Production/Convert2PtsBul";
|
|
|
|
|
import { I2DModeling, I3DContourData, I3DModeling, IDrillingOption, IHardwareType, IModelingData, ISpliteHardwareData, ISpliteOrderData, Production } from '../../Production/Product';
|
|
|
|
|
import { EMetalsType } from "../../UI/Components/RightPanel/RightPanelInterface";
|
|
|
|
|
import { BoardOpenDir, FaceDirection, ISealingData, LinesType } from "../../UI/Store/BoardInterface";
|
|
|
|
|
// import { DownPanelStore } from "../../UI/Store/DownPanelStore";
|
|
|
|
|
import { userConfig } from "../../Editor/UserConfig";
|
|
|
|
|
import { GetCountOption, ICountType, lookOverBoardInfosTool } from "../LookOverBoardInfos/LookOverBoardInfosTool";
|
|
|
|
|
import { HardwareCompositeEntity } from './../../DatabaseServices/Hardware/HardwareCompositeEntity';
|
|
|
|
|
import { ProcessingGroupRecord } from './../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord';
|
|
|
|
@ -127,7 +128,7 @@ export class ErpParseData
|
|
|
|
|
let boardData = Production.GetBoardSplitOrderData(entity);
|
|
|
|
|
if (!boardData)
|
|
|
|
|
return;//返回空数据,提示用户修改,结束拆单
|
|
|
|
|
|
|
|
|
|
this.UpdateBoardDrillRemark(boardData);
|
|
|
|
|
// if (boardData.info.isRect)
|
|
|
|
|
// {
|
|
|
|
|
//矩形和异形封边
|
|
|
|
@ -173,11 +174,9 @@ export class ErpParseData
|
|
|
|
|
block.KaiLiaoHeight = boardData.info.kaiLiaoHeight;
|
|
|
|
|
let kaiLiaoArray = [boardData.info.kaiLiaoWidth, boardData.info.kaiLiaoHeight];
|
|
|
|
|
block.CadData = JSON.stringify([pointInfoArray, basepositionArray, cadModelArray, offsetArray, kaiLiaoArray]);
|
|
|
|
|
let filter = (remark: [string, string]) => { return !remark[0].startsWith('jl-') && !remark[0].startsWith('$'); };
|
|
|
|
|
block.RemarkJson = JSON.stringify(this.GetRemark(boardData.info.remarks, filter).map(t => t[1]));
|
|
|
|
|
//铰链备注处理,后期去掉
|
|
|
|
|
let jlFilter = (remark: [string, string]) => { return remark[0].startsWith('jl-') || remark[0].startsWith('$'); };
|
|
|
|
|
block.RemarkExtra = JSON.stringify(this.GetRemark(boardData.info.remarks, jlFilter));
|
|
|
|
|
const extraFilter = (remark) => { return remark.startsWith('jl-') || remark.startsWith('$') || remark.startsWith('#drills'); };
|
|
|
|
|
block.RemarkJson = JSON.stringify(boardData.info.remarks.filter(t => !extraFilter(t[0])));
|
|
|
|
|
block.RemarkExtra = JSON.stringify(boardData.info.remarks.filter(t => extraFilter(t[0])));
|
|
|
|
|
//新增板材备注列表
|
|
|
|
|
block.AllRemarkList = boardData.info.remarks;
|
|
|
|
|
let boxSize = boxSizeList.get(entity);
|
|
|
|
@ -715,12 +714,6 @@ export class ErpParseData
|
|
|
|
|
}
|
|
|
|
|
return add;
|
|
|
|
|
}
|
|
|
|
|
GetRemark(remarks: [string, string][], filter: (block: [string, string]) => boolean)
|
|
|
|
|
{
|
|
|
|
|
if (filter)
|
|
|
|
|
return remarks.filter(t => filter(t));
|
|
|
|
|
return remarks;
|
|
|
|
|
}
|
|
|
|
|
GetDrillObjects(drills: ICountType[], RoomName: string, BoxName: string, specFun: (name: string) => { spec: string, count: number; }[])
|
|
|
|
|
{
|
|
|
|
|
return drills.map(t =>
|
|
|
|
@ -893,6 +886,40 @@ export class ErpParseData
|
|
|
|
|
return object;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
UpdateBoardDrillRemark(spliteData: ISpliteOrderData)
|
|
|
|
|
{
|
|
|
|
|
if (userConfig.chaidanOption.drillRemark === false) return;
|
|
|
|
|
const fun = (holes: IDrillingOption[], frontOrSide: FrontOrSide) =>
|
|
|
|
|
{
|
|
|
|
|
const holeList = holes.map(t => { return { name: t.type == (GangDrillType.Wood || t.type == GangDrillType.WoodPXL) ? '木销' : t.name, type: t.type, face: t.face }; });
|
|
|
|
|
let groupList = this.groupBy(holeList, ['name', 'type', 'face']);
|
|
|
|
|
let infos: { name: string, type: string, face: string, count: number; }[] = [];
|
|
|
|
|
for (const g of groupList)
|
|
|
|
|
{
|
|
|
|
|
const holeMap = { 0: '偏心轮', 10: '预埋件', };
|
|
|
|
|
const holeType = frontOrSide == FrontOrSide.正面反面 ? holeMap[this.GetHoleType(g.keyList[1])] : '连接杆';
|
|
|
|
|
let face = '';
|
|
|
|
|
if (frontOrSide == FrontOrSide.正面反面)
|
|
|
|
|
face = { 0: '正面', 1: '反面' }[g.keyList[2]];
|
|
|
|
|
else
|
|
|
|
|
face = { 0: '上侧面', 1: '右侧面', 2: '下侧面', 3: '左侧面' }[g.keyList[2]];
|
|
|
|
|
infos.push({ name: g.keyList[0], type: holeType, face: face, count: g.value.length });
|
|
|
|
|
}
|
|
|
|
|
return infos;
|
|
|
|
|
};
|
|
|
|
|
let list = [...fun(spliteData.holes.frontBackHoles, FrontOrSide.正面反面), ...fun(spliteData.holes.sideHoles, FrontOrSide.侧面)];
|
|
|
|
|
if (list.length > 0)
|
|
|
|
|
{
|
|
|
|
|
let remarks = spliteData.info.remarks.slice();
|
|
|
|
|
let drillRemark = remarks.find(t => t[0] == '#drills');
|
|
|
|
|
if (drillRemark)
|
|
|
|
|
drillRemark[1] = JSON.stringify(list);
|
|
|
|
|
else
|
|
|
|
|
remarks.push(['#drills', JSON.stringify(list)]);
|
|
|
|
|
spliteData.info.remarks = remarks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
groupBy(data: any[], fileds: string[])
|
|
|
|
|
{
|
|
|
|
|
let groupList = {};
|
|
|
|
|