在异步场景分发数据时
1 createPurchase参数创建判断逻辑
2 SOP场景的Product只取关键物料
3 unit的工艺段默认无限产能
4 运输单元修改层级
| | |
| | | processingtime := Duration::Zero(); |
| | | |
| | | unitofmeasurename := "PCS"; |
| | | currencyid := "CNY"; |
| | | startdate := Date::Date( 1900, 1, 1 ); |
| | | enddate := Date::Date( 9999, 12, 31 ); |
| | | capacitytype := "Transport quantity"; |
| | |
| | | |
| | | unit := Unit::FindUnitTypeIndex( unitid ); |
| | | if( isnull( unit)){ |
| | | unit :=macroplan.Unit( relnew, |
| | | ID := unitid, |
| | | Name := unitid, |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := currencyid, |
| | | StartDate := startdate, |
| | | EndDate := enddate, |
| | | CapacityType := capacitytype ); |
| | | unit := macroplan.Unit( relnew, ID := unitid, |
| | | Name := unitid, |
| | | ParentUnitID := "运输", |
| | | CapacityType := capacitytype, |
| | | UnitOfMeasureName := unitofmeasurename, |
| | | CurrencyID := macroplan.BaseCurrency().ID(), |
| | | StartDate := startdate, |
| | | EndDate := enddate ); |
| | | } |
| | | |
| | | result := Lane::CreateLane( unit, id, name, processingtime); |
| | |
| | | // yypsybs Aug-21-2023 (created) |
| | | keyProductList := construct( Strings ); |
| | | if( isKeyProduct ) { |
| | | keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="成品" or item.ProductMajorType()="半成品", item.ID() ); |
| | | keyProductList := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="成品" or item.ProductMajorType()="半成品", item.ID() ); |
| | | } |
| | | bomList := selectsortedset( globalOTDTable, Global_MappingOperationBOM, item, |
| | | ifexpr( isnull( businessTypes ) or businessTypes.Size() = 0, |
| | |
| | | } |
| | | } |
| | | if( createPurchaseSupplyMaterial ) { |
| | | toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | toCreateBomList := construct( Strings ); |
| | | if( isKeyProduct){ |
| | | toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | item.ComponentType() = "P" and keyProductList.Find( item.ComponentCode())>=0, item.OrganCode() + item.ComponentCode()); |
| | | }else{ |
| | | toCreateBomList := selectuniquevalues( bomList, Elements, item, |
| | | item.ComponentType() = "P" , item.OrganCode() + item.ComponentCode()); |
| | | |
| | | } |
| | | traverse( toCreateBomList, Elements, key ) { |
| | | boms := selectset( bomList, Elements, item, item.ComponentType() = "P" and item.OrganCode() + item.ComponentCode() = key ); |
| | | bom := boms.First(); |
| | |
| | | |
| | | if( isnull( businesstypes ) or businesstypes.Size() = 0 ) { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.KeyProduct() = true ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.ProductMajorType()="成品" or item.ProductMajorType()="半成品" ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, true ); |
| | | } |
| | | } else { |
| | | if( iskeyproduct = true ){ |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, item.KeyProduct() = true and businesstypes.Find( item.BusinessType() ) >= 0 ); |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, (item.ProductMajorType()="成品" or item.ProductMajorType()="半成品") and businesstypes.Find( item.BusinessType() ) >= 0 ); |
| | | } |
| | | else{ |
| | | listToDeal := selectset( globalOTDTable, Global_MappingProduct_MP, item, businesstypes.Find( item.BusinessType() ) >= 0 ); |
| | |
| | | supplyunit.IsSupplier(true); |
| | | |
| | | Unit::CreateOrUpdate( this, |
| | | "整车运输", |
| | | "整车运输", |
| | | "运输", |
| | | "运输", |
| | | "天马集团", |
| | | capacitytype, |
| | | unitofmeasurename ); |
| | |
| | | thirdlevelid, |
| | | thirdlevelid, |
| | | secondlevelid, |
| | | "Time", |
| | | infinite, |
| | | item.UnitOfMeasureName() ); |
| | | |
| | | //Get the last level unit |