Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation DispatchShiftPlan_InterfaceLoginfo_InterfaceLoginfo_DispatchShiftPlan |
| | | { |
| | | #keys: '1[414996.1.203950081]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide InterfaceLoginfo |
| | | { |
| | | #keys: '3[414996.1.203950083][414996.1.203950082][414996.1.203950084]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: DispatchShiftPlan |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide DispatchShiftPlan |
| | | { |
| | | #keys: '3[414996.1.203950086][414996.1.203950085][414996.1.203950087]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: InterfaceLoginfo |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
| | |
| | | cell.DLExternalRentalWarehouseTransportationCosts( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLExternalRentalWarehouseTransportationCosts() ) ); |
| | | cell.DLRentalWarehouseStorageFees( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLRentalWarehouseStorageFees() ) ); |
| | | cell.CleaningCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CleaningCost() ) ); |
| | | cell.CCCleaningCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCCleaningCost() ) ); // CCå¤ç§åºæ¸
æ´è´¹ç¨ |
| | | cell.DLRentalWarehouseMaterialRackCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLRentalWarehouseMaterialRackCost() ) ); // 大è¿å¤ç§åºææ¶è´¹ç¨ |
| | | cell.CCExternalRentalWarehouseDLMaterialRackCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCExternalRentalWarehouseDLMaterialRackCost() ) ); // CCå¤ç§åºDLææ¶è´¹ç¨ |
| | | cell.EstimatedTotalCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.EstimatedTotalCost() ) ); |
| | | cell.Coefficient( 1.05 ); |
| | | cell.TotalCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.TotalCost() ) ); |
| | |
| | | cell.DLExternalRentalWarehouseTransportationCosts( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLExternalRentalWarehouseTransportationCosts() ) ); |
| | | cell.DLRentalWarehouseStorageFees( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLRentalWarehouseStorageFees() ) ); |
| | | cell.CleaningCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CleaningCost() ) ); |
| | | cell.CCCleaningCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCCleaningCost() ) ); // CCå¤ç§åºæ¸
æ´è´¹ç¨ |
| | | cell.DLRentalWarehouseMaterialRackCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLRentalWarehouseMaterialRackCost() ) ); // 大è¿å¤ç§åºææ¶è´¹ç¨ |
| | | cell.CCExternalRentalWarehouseDLMaterialRackCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCExternalRentalWarehouseDLMaterialRackCost() ) ); // CCå¤ç§åºDLææ¶è´¹ç¨ |
| | | cell.EstimatedTotalCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.EstimatedTotalCost() ) ); |
| | | cell.Coefficient( 1.05 ); |
| | | cell.TotalCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.TotalCost() ) ); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ShiftQty |
| | | { |
| | | #keys: '3[414996.1.206760016][414996.1.206760015][414996.1.206760017]' |
| | | ValueType: String |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Dispatch ( |
| | | InterfaceDataset interfaceDataset, |
| | | const MacroPlan macroPlan, |
| | | Archive owner, |
| | | String versionFlag |
| | | String executor |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Akari Aug-21-2024 (created) |
| | | // owner.DispatchShiftPlan( relflush ); |
| | | // owner.RB_DispatchShiftPlanBroker().Source().FlatQuery( "truncate table A_DispatchShiftPlan" ); |
| | | now := DateTime::Now(); |
| | | |
| | | dispatchShiftPlans := selectset( owner,DispatchShiftPlan,dispatchShiftPlan,true ); |
| | | interfaceLoginfo := maxselect( interfaceDataset,InterfaceLoginfo,loginfo,loginfo.Name() = Translations::InterfaceDataset_ShiftPlanPPPSPush_Name() ,loginfo.InterfaceDateTime() ); |
| | | if( not isnull( interfaceLoginfo )){ |
| | | if( not interfaceLoginfo.IsShow() ){ |
| | | interfaceLoginfo.Delete(); |
| | | }else{ |
| | | interfaceLoginfo.Last( false ); |
| | | } |
| | | } |
| | | |
| | | interfaceLoginfo := interfaceDataset.InterfaceLoginfo( relnew, |
| | | ExecuteUser := executor, |
| | | Name := Translations::InterfaceDataset_ShiftPlanPPPSPush_Name(), |
| | | InterfaceDateTime := now, |
| | | Last := true, |
| | | Message := 'çæ¬¡è®¡åï¼PPA+IDSï¼æ°æ®æ¨é' ); |
| | | |
| | | dispatchShiftPlans := selectset( interfaceLoginfo,DispatchShiftPlan,dispatchShiftPlan,true ); |
| | | dispatchShiftPlanIndexTree := NamedValueTree::Create(); |
| | | for( i := 0 ; i < dispatchShiftPlans.Size() ; i++){ |
| | | dispatchShiftPlan := dispatchShiftPlans.Element( i ); |
| | |
| | | dispatchShiftPlan := dispatchShiftPlans.Element( dispatchShiftPlanIndex.GetValueAsNumber() ); |
| | | dispatchShiftPlan.Tips( shiftPlan.Remark() ); |
| | | dispatchShiftPlan.VersionName( macroPlanName ); |
| | | dispatchShiftPlan.VersionFlag( versionFlag ); |
| | | dispatchShiftPlan.InterfaceTime( now ); |
| | | }else{ |
| | | owner.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(), |
| | | interfaceLoginfo.DispatchShiftPlan( relnew,ID := OS:: GenerateGUIDAsString(), |
| | | ProductLine := productLine, |
| | | FactoryName := factory.ID(), |
| | | ShiftQty := shiftPlan.Outcome(), |
| | | |
| | | ShiftDate := shiftDate, |
| | | Tips := shiftPlan.Remark(), |
| | | VersionName := macroPlanName, |
| | | VersionFlag := versionFlag, |
| | | InterfaceTime := now ); |
| | | } |
| | | } |
| | | |
| | | DispatchShiftPlan::Publish( interfaceLoginfo ); |
| | | // owner.RB_DispatchShiftPlanBroker().AsyncExecute(); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Publish ( |
| | | InterfaceLoginfo loginfo |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | //// çå
°é¸½ Jul-17-2024 (created) |
| | | jsonarray := JSON::Array(); |
| | | traverse( loginfo, DispatchShiftPlan, shiftPlan ){ |
| | | shiftPlanjson := JSON::Object() |
| | | .Add( "productLine", shiftPlan.ProductLine() ) |
| | | .Add( "shiftDate", shiftPlan.ShiftDate().Format( 'Y-M2-D2' ) )//"2024-10-01" |
| | | .Add( "shiftQty", shiftPlan.ShiftQty() ) |
| | | .Add( "tips", shiftPlan.Tips() ) |
| | | .Add( "versionName", shiftPlan.VersionName() ) |
| | | .Add( "factoryName", shiftPlan.FactoryName() ) |
| | | .Add( "fac", shiftPlan.Fac() ) |
| | | .Add( "interfaceTime", shiftPlan.InterfaceTime().Format( 'Y-M2-D2 H:m:s' ) )/*"2024-10-01 12:00:00" )*/ |
| | | .Build(); |
| | | jsonarray.Add( shiftPlanjson ); |
| | | } |
| | | loginfo.RequestBody( jsonarray.Build().AsString() ); |
| | | info( loginfo.RequestBody() ); |
| | | data := InterfaceLoginfo::CallInterfaceForDataCenter( loginfo.InterfaceDataset(), loginfo ); |
| | | info( '----------------', data.AsString() ); |
| | | *] |
| | | } |
| | |
| | | // OfflinePlanArchiveVersion::RefreshData( this, macroplan, archive ); |
| | | } |
| | | if( isshiftplan ){//çæ¬¡è®¡å |
| | | DispatchShiftPlan::Dispatch(this, macroplan,executor ); |
| | | // CustomerDemandIDS::GenerateData( this, recyclebin, archive ); |
| | | } |
| | | if( isassembleonlineplan ){//è£
é
ä¸çº¿è®¡å |
| | |
| | | } |
| | | |
| | | // å建åå
æ ¼ |
| | | traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr ) { // 循ç¯è¡ |
| | | traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr |
| | | // , mlcrr.Factory() = "é¿æ¥å·¥å" |
| | | ) { // 循ç¯è¡ |
| | | info( "å½åéåçè¡ï¼", mlcrr.Factory(), " ", mlcrr.Category() ); |
| | | traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) { // 循ç¯å |
| | | |
| | |
| | | tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "大è¿å·¥å", "DL", "CC" ) + " " + mlcrr.Category() + "å¤ç§åº" ) and |
| | | tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGWåºæ¿", ifexpr( mlcrr.Factory() = "大è¿å·¥å", "DL", "CC" ) + " " + mlcrr.Category() + "线边åº" ) ); |
| | | |
| | | // è¿è¾ææ¬åæ°ï¼è°æ¨è´¹ç¨ï¼ |
| | | lct1 := select( macroPlan, LogisticsCostTransport, tempLCT, |
| | | tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "大è¿å·¥å", "CC", "DL" ) + " " + mlcrr.Category() ) and |
| | | tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGWåºæ¿", ifexpr( mlcrr.Factory() = "大è¿å·¥å", "DL", "CC" ) + " " + mlcrr.Category() + "å¤ç§åº" ) ); |
| | | |
| | | // å½åææ«æåä¸å¤©æ¥æ |
| | | lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1; |
| | |
| | | guard( tempTPC.TransferPlanColumn().ColumnDate().Year() = mlcrc.StartDate().Year(), false ) and |
| | | guard( tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ), |
| | | [Number]tempTPC.Value() ); |
| | | cell.TransferCost( [Number] ( [Number] ( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct.LoadingCapacity(), 1 ) ) * guard( lct.TransportPrice(), 1 ) ); |
| | | // info( "è°æ¨æ°éï¼", transferQuantity, " å
è£
容éï¼", guard( lcm.PackagingCapacity(), 1 ), " è£
载容éï¼", guard( lct1.LoadingCapacity(), 1 ), " è¿è¾åä»·ï¼",guard( lct1.TransportPrice(), 1 ) ); |
| | | cell.TransferCost( [Number] ( ceil( ceil( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct1.LoadingCapacity(), 1 ) ) * guard( lct1.TransportPrice(), 1 ) ) ); |
| | | |
| | | // å¤ç§åºå
¥åºè´¹ç¨ï¼å
¥åºé[å
è£
é] / å
è£
容é * å
¥åºåä»·ï¼ |
| | | cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) ); |