添加新增Forecast的时候可以使用Curve拆分的功能
| | |
| | | #parent: #root |
| | | StaticMethod GenerateForecast ( |
| | | ArchiveExecutionStatus archiveExecutionStatus, |
| | | MacroPlan macroPlan |
| | | MacroPlan macroPlan, |
| | | Boolean isClearForecast |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | traverse ( macroPlan, SalesDemand.astype( Forecast ), f ) { |
| | | f.Delete(); |
| | | if( isClearForecast ){ |
| | | traverse ( macroPlan, SalesDemand.astype( Forecast ), f ) { |
| | | f.Delete(); |
| | | } |
| | | } |
| | | |
| | | productMPs := selectset( macroPlan,Product_MP,prod,not prod.IsSystem() ); |
| | |
| | | archiveExecutionStatus.AES_TemporaryDemandData().Execute(); |
| | | |
| | | // çæForecast |
| | | Archive::GenerateForecast( archiveExecutionStatus, macroPlan ); |
| | | Archive::GenerateForecast( archiveExecutionStatus, macroPlan ,true ); |
| | | |
| | | // æ¸
ç©ºä¸´æ¶æ°æ®åº |
| | | archiveExecutionStatus.AES_TemporaryDemandData().Source().FlatQuery( "truncate table A_Forecasts" ); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod SplitUsingCurve ( |
| | | SalesSegment_MP salesSegment, |
| | | Product_MP product, |
| | | StockingPoint_MP stockingPoint, |
| | | Date startDate, |
| | | Date endDate, |
| | | Real quantity, |
| | | String curve, |
| | | const Archive archive, |
| | | ArchiveExecutionStatus archiveExecutionStatus |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Akari Sep-11-2024 (created) |
| | | // 请æ±åæ° |
| | | macroPlan := salesSegment.MacroPlan(); |
| | | ac := select( archive, ArchiveCurve, tempAC, true ); |
| | | json := JSON::Object() |
| | | .Add( "salesSegment", salesSegment.Name() ) |
| | | .Add( "productID", product.ID() ) |
| | | .Add( "stockingPointID", stockingPoint.ID() ) |
| | | .Add( "startDate", startDate.Format( "Y-M2-D2") ) |
| | | .Add( "endDate", endDate.Format( "Y-M2-D2") ) |
| | | .Add( "quantity", quantity ) |
| | | .Add( "curve", curve ) |
| | | .Add( "pathCurve", ac.FilePath() ).Build().AsString(); |
| | | |
| | | // è°ç¨æ¥å£ |
| | | url := "/IDSPPACurve/ImportCurveIncremental"; |
| | | |
| | | i := HTTPInterface::Create( archive.JavaInterfaceAddress(), archive.JavaInterfacePort() ); |
| | | i.URL( url ); |
| | | i.PostMethod( true ); |
| | | i.MediaType( "application/json" ); |
| | | i.TimeOut( Duration::Minutes( 5 ) ); |
| | | |
| | | i.Call( json ); |
| | | |
| | | htmlresult := i.Result(); |
| | | |
| | | respJSON := JSON::Parse( htmlresult ); |
| | | |
| | | code := respJSON.Get( "code" ).GetNumber(); |
| | | message := respJSON.Get( "message" ).GetString(); |
| | | |
| | | if( code = 200 ){ |
| | | // è·åéæ± |
| | | archiveExecutionStatus.AES_TemporaryDemandData().Execute(); |
| | | |
| | | // çæForecast |
| | | Archive::GenerateForecast( archiveExecutionStatus, macroPlan ,false ); |
| | | |
| | | // æ¸
ç©ºä¸´æ¶æ°æ®åº |
| | | archiveExecutionStatus.AES_TemporaryDemandData().Source().FlatQuery( "truncate table A_Forecasts" ); |
| | | }else{ |
| | | error( message ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component PanelCurve |
| | | { |
| | | #keys: '[414996.1.77261280]' |
| | | BaseType: 'WebPanel' |
| | | Children: |
| | | [ |
| | | Component DropDownStringListCurve |
| | | { |
| | | #keys: '[414996.1.79651031]' |
| | | BaseType: 'WebDropDownStringList' |
| | | Properties: |
| | | [ |
| | | Label: 'Curve' |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 9 |
| | | Visible: false |
| | | ] |
| | | } |
| | |
| | | Children: |
| | | [ |
| | | #child: PanelOrigin |
| | | #child: PanelCurve |
| | | ] |
| | | } |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | FixedSize: true |
| | | Taborder: 8 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component pnlActions #extension |
| | | { |
| | | Children: |
| | | [ |
| | | Component btnOk #extension |
| | | { |
| | | Properties: |
| | | [ |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | Component btnCancel #extension |
| | | { |
| | | Properties: |
| | | [ |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component bSplitUsingCurve |
| | | { |
| | | #keys: '[414996.1.79889444]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Label: 'Split using Curve' |
| | | Taborder: 0 |
| | | Visible: false |
| | | ] |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: PanelCurve/DropDownStringListCurve |
| | | Response OnCreated () id:Response_MacroPlanner_PanelCurve_DropDownStringListCurve_OnCreated |
| | | { |
| | | #keys: '[414996.1.77271766]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebComponent_OnCreated' |
| | | GroupServerCalls: true |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | curves := selectuniquevalues( MacroPlan,SixDigitCode,code,code.Curve()); |
| | | this.Strings( curves.Concatenate( ";")); |
| | | *] |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: pnlActions/bSplitUsingCurve |
| | | Response OnClick () id:Response_MacroPlanner_pnlActions_bSplitUsingCurve_OnClick |
| | | { |
| | | #keys: '[414996.1.77291489]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | GroupServerCalls: true |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | Forecast::SplitUsingCurve( DropDownListSalesSegment.Data(), |
| | | DropDownListProduct.Data(), |
| | | DropDownListStockingPoint.Data(), |
| | | DateSelectorStart.Date(), |
| | | DateSelectorEnd.Date(), |
| | | [Real]EditFieldQuantityUom.Text(), |
| | | DropDownStringListCurve.Text(), |
| | | Archive, |
| | | ArchiveExecutionStatus ); |
| | | |
| | | WebMessageBox::Success( "Success" ); |
| | | Form.Close(); |
| | | *] |
| | | } |
| | | } |
| | |
| | | Children: |
| | | [ |
| | | #child: pnlContent |
| | | #child: pnlActions |
| | | ] |
| | | } |
| | |
| | | [ |
| | | Component DataSetLevelSalesDemands #extension |
| | | { |
| | | Children: |
| | | [ |
| | | #child: listContextMenuSD |
| | | ] |
| | | Properties: |
| | | [ |
| | | Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ImgNotLinkedToPeriod","title":"ImgNotLinkedToPeriod","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ImgNotLinkedToPeriod"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ImgIsPostponed","title":"ImgIsPostponed","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ImgIsPostponed"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockingPoint_MP.ID","title":"Stocking point","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"StockingPoint_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SalesSegment_MP.Name","title":"Sales segment","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"SalesSegment_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Product_MP.ID","title":"Product","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Product_MP.ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StartDate","title":"Start","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StartDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"End","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasure_MP.Name","title":"Quantity UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"UnitOfMeasure_MP.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Quantity","title":"Original Qty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Quantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"NettedQuantity","title":"Quantity","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"NettedQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FulfilledQuantity","title":"Fulfilled","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"FulfilledQuantity"}},{"attribute":{"classtype":"WebApiDefinitionAttributeChart","columnid":"Fulfillment Illustration","title":"Fulfillment","subtotals":"","tooltip":"","width":-1,"display":"shown","type":"stackbar","relative":true,"attributes":[{"name":"Fulfilled demand","color":"rgb(87,184,71)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Fulfillment","title":"Fulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"object.FulfilledQuantity().Round(2)"}},{"name":"Unfulfilled demand","color":"rgb(232,123,0)","expression":{"classtype":"WebApiDefinitionAttributeExpression","columnid":"Unfulfilled demand","title":"Unfulfilled demand","subtotals":"","tooltip":"","width":-1,"display":"shown","expressionbody":"maxvalue(object.NettedQuantity()-object.FulfilledQuantity(),0.0).Round(2)"}}]}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Price","title":"Price","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Price"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"PriceUoM","title":"PriceUoM","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"PriceUoM"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Priority.Name","title":"Priority","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Priority.Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"DemandUncertaintyPercentage","title":"Uncertainty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"DemandUncertaintyPercentage"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Origin","title":"Origin","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Origin"}}]' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component listContextMenuSD #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: ListSalesDemands |
| | | Response OnClick () inherited id:Response_ListSalesDemands_MenuCreate_OnClick_715 #extension |
| | | { |
| | | QuillAction #extension |
| | | { |
| | | Body: |
| | | [* |
| | | //Create new sales demand |
| | | dlg := construct( DialogCreateEditForecast ); |
| | | dlg.New(); |
| | | |
| | | dlg.bSplitUsingCurve().Visible( true ); |
| | | dlg.PanelCurve().Visible( true ); |
| | | *] |
| | | } |
| | | } |