From eb703e956320ef3f51ef085447e18bbd4747e1d3 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期一, 28 十月 2024 15:55:24 +0800
Subject: [PATCH] 财务产量/销量导入从1月开始报错
---
_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_Publish.qbl | 46 +++++++++++++++
_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_PanelExport_670_bRefresh_OnClick.def | 2
_Main/BL/InfoMessages.qbl | 20 ++++++
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl | 40 ++++---------
_Main/BL/Type_InterfaceLoginfo/StaticMethod_CallInterfaceForDataCenter.qbl | 51 +++++++++++++++++
_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl | 2
_Main/BL/Type_FinancialSalesSource/Method_AfterImport.qbl | 2
7 files changed, 132 insertions(+), 31 deletions(-)
diff --git a/_Main/BL/InfoMessages.qbl b/_Main/BL/InfoMessages.qbl
index f12c34f..73c874d 100644
--- a/_Main/BL/InfoMessages.qbl
+++ b/_Main/BL/InfoMessages.qbl
@@ -122,6 +122,26 @@
{
DefaultText: 'Customer demand(PPA + IDS)'
}
+ InfoMessage InterfaceDataset_CustomerDemandPPAIDS_URL
+ {
+ DefaultText: '/api/customer-demand/saveList'
+ }
+ InfoMessage InterfaceDataset_DataCenter_Address
+ {
+ DefaultText: 'vwed-service.dmp.vwfawedl.mobi'
+ }
+ InfoMessage InterfaceDataset_DataCenter_ClientId
+ {
+ DefaultText: 'PPPS'
+ }
+ InfoMessage InterfaceDataset_DataCenter_ClientSecret
+ {
+ DefaultText: 'eyJ0eXAiOiJKV1QdsdfQdiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3Mjk4MjgxMjksInVzZXJuYW1lIjoicmNhY2NvdW50In0'
+ }
+ InfoMessage InterfaceDataset_DataCenter_ContentType
+ {
+ DefaultText: 'application/json;charset=utf-8'
+ }
InfoMessage InterfaceDataset_FinishedEngineInventory_Name
{
DefaultText: 'Finished engine inventory'
diff --git a/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_Publish.qbl b/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_Publish.qbl
new file mode 100644
index 0000000..b222ad0
--- /dev/null
+++ b/_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_Publish.qbl
@@ -0,0 +1,46 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Publish (
+ InterfaceDataset owner,
+ String executor
+)
+{
+ TextBody:
+ [*
+ //// 鐢勫叞楦� Jul-17-2024 (created)
+ requestbody :='[
+ {
+ "product": "DZ948293",
+ "demandDate": "2024-10-01",
+ "demandQty": 800,
+ "versionName": "V2410204",
+ "interfaceTime": "2024-10-01 12:00:00"
+ }
+ ]';
+ loginfo := owner.InterfaceLoginfo( relnew, ExecuteUser := executor
+ , Name := Translations::InterfaceDataset_CustomerDemandPPAIDS_Name()
+ , InterfaceDateTime := DateTime::ActualTime()
+ , Message := '瀹㈡埛闇�姹傦紙PPA+IDS锛�'
+ , RequestBody := requestbody);
+
+ InterfaceLoginfo::CallInterface( owner, loginfo );
+ //if( not isnull( data ) ){
+ //
+ // cnv2 := StringToDate::StandardConverter();
+ // cnv2.SetCustomConversion();
+ // cnv2.CustomFormatString( 'yyyy-MM-dd' );
+ //
+ // sadatalist := construct( FinishedEngineInventorys );
+ // for( seq := 0;seq < data.Size();seq++){
+ // item := data.Get(seq);
+ // sadata := FinishedEngineInventory::GenerateData( loginfo, cnv2, item );
+ // sadatalist.Add( sadata );
+ // }
+ //
+ // options := DatasetFindOptions::Construct( 'MacroPlan' ).IncludeOffline( true ); //to load we must search offline datasets.
+ // mdskey := DatasetController::FindUnique( options );
+ //
+ // MDSMacroPlan::Root( mdskey ) -> InventoryInterfaceData::SynchronizeInventory( owner, sadatalist );
+ //}
+ *]
+}
diff --git a/_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl b/_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl
index 845846f..bad03e0 100644
--- a/_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl
+++ b/_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl
@@ -40,7 +40,7 @@
periodname := period.Format( "M2/D2/Y" );
quantity := [Real]cell.Value();
previouscolumn := cell.FinancialProductionColumn().PreviousColumn();
- if( period = yearday.Date() and not isnull( previouscolumn ) and beforeyearday = cnv2.Convert( previouscolumn.Name() ) ){
+ if( period = yearday.Date() and not isnull( previouscolumn ) and cnv2.CanConvert( previouscolumn.Name() ) and beforeyearday = cnv2.Convert( previouscolumn.Name() ) ){
previouscell := selectobject( row, FinancialProductionCell, previouscell, previouscell.FinancialProductionColumn() = previouscolumn );
quantity := [Real]cell.Value() + [Real]previouscell.Value();
}
diff --git a/_Main/BL/Type_FinancialSalesSource/Method_AfterImport.qbl b/_Main/BL/Type_FinancialSalesSource/Method_AfterImport.qbl
index ba14ab4..a57f712 100644
--- a/_Main/BL/Type_FinancialSalesSource/Method_AfterImport.qbl
+++ b/_Main/BL/Type_FinancialSalesSource/Method_AfterImport.qbl
@@ -36,7 +36,7 @@
periodname := period.Format( "M2/D2/Y" );
quantity := [Real]cell.Value()
previouscolumn := cell.FinancialSalesColumn().PreviousColumn();
- if( period = yearday.Date() and not isnull( previouscolumn ) and beforeyearday = cnv2.Convert( previouscolumn.Name() ) ){
+ if( period = yearday.Date() and not isnull( previouscolumn ) and cnv2.CanConvert( previouscolumn.Name() ) and beforeyearday = cnv2.Convert( previouscolumn.Name() ) ){
previouscell := selectobject( row, FinancialSalesCell, previouscell, previouscell.FinancialSalesColumn() = previouscolumn );
quantity := [Real]cell.Value() + [Real]previouscell.Value();
}
diff --git a/_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl b/_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl
index f9b03a6..612bf56 100644
--- a/_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl
@@ -11,7 +11,7 @@
owner.FinancialWeeklyReport( relflush );
ccunit := FinancialWeeklyReport::GetDefaultCCUnit();
dlunit := FinancialWeeklyReport::GetDefaultDLUnit();
- allunit := FinancialWeeklyReport::GetDefaultAllUnit();
+ //allunit := FinancialWeeklyReport::GetDefaultAllUnit();
defaultname := FinancialWeeklyReport::GetDefaultName();
startofplanning := owner.StartOfPlanning();
@@ -29,17 +29,13 @@
dlsales := table.FinancialWeeklyRow( relnew, Name := 'DL閿�閲�', RowNr := 5 );
ccsales := table.FinancialWeeklyRow( relnew, Name := 'CC閿�閲�', RowNr := 6 );
//SUM
- totalpvaluesum := [Real]0;
dlpvaluesum := [Real]0;
ccpvaluesum := [Real]0;
- totalsvaluesum := [Real]0;
dlsvaluesum := [Real]0;
ccsvaluesum := [Real]0;
//绱閲�
- totalpvaluecumulant := [Real]0;
dlpvaluecumulant := [Real]0;
ccpvaluecumulant := [Real]0;
- totalsvaluecumulant := [Real]0;
dlsvaluecumulant := [Real]0;
ccsvaluecumulant := [Real]0;
@@ -48,18 +44,12 @@
salescolumn := selectobject( salestable, FinancialSalesColumn, scolumn, scolumn.Name() = column.Name() and scolumn.Period() = column.Period() and not scolumn.IsDay() );
//浜ч噺姹囨��
- totalpvalue := [Real]0;
dlpvalue := [Real]0;
ccpvalue := [Real]0;
traverse( productioncolumn, FinancialProductionCell, cell, cell.Quantity() > 0 ){
unit := cell.FinancialProductionRow().Unit();
- if( unit = allunit ){
- totalpvalue := totalpvalue + cell.Quantity();
- if( column.Period() = startofplanning.StartOfMonth().Date() ){
- totalpvaluecumulant := totalpvaluecumulant - cell.PlanValue();
- }
- }else if( unit = dlunit ){
+ if( unit = dlunit ){
dlpvalue := dlpvalue + cell.Quantity();
if( column.Period() = startofplanning.StartOfMonth().Date() ){
dlpvaluecumulant := dlpvaluecumulant - cell.PlanValue();
@@ -71,7 +61,7 @@
}
}
}
- totalpcell := column.FinancialWeeklyCell( relnew, Value := [String]( [Number]totalpvalue ) );
+ totalpcell := column.FinancialWeeklyCell( relnew, Value := [String]( [Number]( dlpvalue + ccpvalue ) ) );
totalproduction.FinancialWeeklyCell( relinsert, totalpcell );
dlpcell := column.FinancialWeeklyCell( relnew, Value := [String]( [Number]dlpvalue ) );
dlproduction.FinancialWeeklyCell( relinsert, dlpcell );
@@ -79,20 +69,18 @@
ccproduction.FinancialWeeklyCell( relinsert, ccpcell );
//閿�閲忔眹鎬�
- totalsvalue := [Real]0;
dlsvalue := [Real]0;
ccsvalue := [Real]0;
traverse( salescolumn, FinancialSalesCell, cell, [Real]cell.Value() > 0 ){
unit := cell.FinancialSalesRow().Unit();
- if( unit = allunit ){
- totalsvalue := totalsvalue + [Real]cell.Value();
- }else if( unit = dlunit ){
+
+ if( unit = dlunit ){
dlsvalue := dlsvalue + [Real]cell.Value();
}else if( unit = ccunit ){
ccsvalue := ccsvalue + [Real]cell.Value();
}
}
- totalscell := column.FinancialWeeklyCell( relnew, Value := [String]totalsvalue );
+ totalscell := column.FinancialWeeklyCell( relnew, Value := [String]( dlsvalue + ccsvalue ) );
totalsales.FinancialWeeklyCell( relinsert, totalscell );
dlscell := column.FinancialWeeklyCell( relnew, Value := [String]dlsvalue );
dlsales.FinancialWeeklyCell( relinsert, dlscell );
@@ -100,17 +88,13 @@
ccsales.FinancialWeeklyCell( relinsert, ccscell );
if( column.Period() < startofplanning.StartOfMonth().Date() ){
- totalpvaluecumulant := totalpvaluecumulant + totalpvalue;
dlpvaluecumulant := dlpvaluecumulant + dlpvalue;
ccpvaluecumulant := ccpvaluecumulant + ccpvalue;
- totalsvaluecumulant := totalsvaluecumulant + totalsvalue;
dlsvaluecumulant := dlsvaluecumulant + dlsvalue;
ccsvaluecumulant := ccsvaluecumulant + ccsvalue;
}
- totalpvaluesum := totalpvaluesum + totalpvalue;
dlpvaluesum := dlpvaluesum + dlpvalue;
ccpvaluesum := ccpvaluesum + ccpvalue;
- totalsvaluesum := totalsvaluesum + totalsvalue;
dlsvaluesum := dlsvaluesum + dlsvalue;
ccsvaluesum := ccsvaluesum + ccsvalue;
}
@@ -118,33 +102,33 @@
cumulantcolumn := table.FinancialWeeklyColumn( relnew, Name := '绱閲�' );
proportioncolumn := table.FinancialWeeklyColumn( relnew, Name := '鍗犳瘮' );
//SUM
- totalpcellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]( [Number]totalpvaluesum ) );
+ totalpcellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]( [Number]( dlpvaluesum + ccpvaluesum ) ) );
totalproduction.FinancialWeeklyCell( relinsert, totalpcellsum );
dlpcellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]( [Number]dlpvaluesum ) );
dlproduction.FinancialWeeklyCell( relinsert, dlpcellsum );
ccpcellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]( [Number]ccpvaluesum ) );
ccproduction.FinancialWeeklyCell( relinsert, ccpcellsum );
- totalscellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]totalsvaluesum );
+ totalscellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]( dlsvaluesum + ccsvaluesum ) );
totalsales.FinancialWeeklyCell( relinsert, totalscellsum );
dlscellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]dlsvaluesum );
dlsales.FinancialWeeklyCell( relinsert, dlscellsum );
ccscellsum := sumcolumn.FinancialWeeklyCell( relnew, Value := [String]ccsvaluesum );
ccsales.FinancialWeeklyCell( relinsert, ccscellsum );
//绱閲�
- totalpcellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]totalpvaluecumulant );
+ totalpcellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]( dlpvaluecumulant + ccpvaluecumulant ) );
totalproduction.FinancialWeeklyCell( relinsert, totalpcellcumulant );
dlpcellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]dlpvaluecumulant );
dlproduction.FinancialWeeklyCell( relinsert, dlpcellcumulant );
ccpcellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]ccpvaluecumulant );
ccproduction.FinancialWeeklyCell( relinsert, ccpcellcumulant );
- totalscellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]totalsvaluecumulant );
+ totalscellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]( dlsvaluecumulant + ccsvaluecumulant ) );
totalsales.FinancialWeeklyCell( relinsert, totalscellcumulant );
dlscellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]dlsvaluecumulant );
dlsales.FinancialWeeklyCell( relinsert, dlscellcumulant );
ccscellcumulant := cumulantcolumn.FinancialWeeklyCell( relnew, Value := [String]ccsvaluecumulant );
ccsales.FinancialWeeklyCell( relinsert, ccscellcumulant );
//鍗犳瘮
- totalpvalueproportion := guard( ( totalpvaluecumulant / totalpvaluesum ).Format( 'N(Dec(2))' ), '0.00' );
+ totalpvalueproportion := guard( ( ( dlpvaluecumulant + ccpvaluecumulant ) / ( dlpvaluesum + ccpvaluesum ) ).Format( 'N(Dec(2))' ), '0.00' );
totalpcellproportion := proportioncolumn.FinancialWeeklyCell( relnew, Value := totalpvalueproportion );
totalproduction.FinancialWeeklyCell( relinsert, totalpcellproportion );
@@ -156,7 +140,7 @@
ccpcellproportion := proportioncolumn.FinancialWeeklyCell( relnew, Value := ccpvalueproportion );
ccproduction.FinancialWeeklyCell( relinsert, ccpcellproportion );
- totalsvalueproportion := guard( ( totalsvaluecumulant / totalsvaluesum ).Format( 'N(Dec(2))' ), '0.00' );
+ totalsvalueproportion := guard( ( ( dlsvaluecumulant + ccsvaluecumulant ) / ( dlsvaluesum + ccsvaluesum ) ).Format( 'N(Dec(2))' ), '0.00' );
totalscellproportion := proportioncolumn.FinancialWeeklyCell( relnew, Value := totalsvalueproportion );
totalsales.FinancialWeeklyCell( relinsert, totalscellproportion );
diff --git a/_Main/BL/Type_InterfaceLoginfo/StaticMethod_CallInterfaceForDataCenter.qbl b/_Main/BL/Type_InterfaceLoginfo/StaticMethod_CallInterfaceForDataCenter.qbl
new file mode 100644
index 0000000..7660e64
--- /dev/null
+++ b/_Main/BL/Type_InterfaceLoginfo/StaticMethod_CallInterfaceForDataCenter.qbl
@@ -0,0 +1,51 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod CallInterfaceForDataCenter (
+ InterfaceDataset owner,
+ InterfaceLoginfo loginfo
+) as owning JSON
+{
+ Description: '璋冪敤鏁版嵁涓彴鎺ュ彛'
+ TextBody:
+ [*
+ // 鐢勫叞楦� Jul-22-2024 (created)
+ address := Translations::InterfaceDataset_DataCenter_Address();
+ httpinterface := HTTPInterface::Create( address,80);
+ httpinterface.PostMethod( true );
+ httpinterface.MediaType( Translations::InterfaceDataset_DataCenter_ContentType() );
+ httpinterface.AddHeader( "clientId", Translations::InterfaceDataset_DataCenter_ClientId() );
+ httpinterface.AddHeader( "clientSecret", Translations::InterfaceDataset_DataCenter_ClientSecret() );
+ try{
+ if( loginfo.Name() = Translations::InterfaceDataset_CustomerDemandPPAIDS_Name() ){//瀹㈡埛闇�姹�
+ httpinterface.URL( Translations::InterfaceDataset_CustomerDemandPPAIDS_URL() );
+ }
+ httpinterface.Call( loginfo.RequestBody() );
+ result := httpinterface.Result();
+ loginfo.Response( result );
+ loginfo.Success( true );
+ }onerror{
+ loginfo.ReturnMsg( e.GeneralInformation() );
+ }
+
+ //鍚庣画鍏叡澶勭悊
+ loginfo.FinishTime( DateTime::ActualTime() );
+ data := JSON::Null().Build();
+
+ if( loginfo.Success() ){
+ resultJson := JSON::Parse( loginfo.Response() );
+ code := resultJson.Get( "code" ).GetString();
+ msg := resultJson.Get( "message" ).GetString();
+ data := resultJson.Get( "data" );
+
+ loginfo.ReturnMsg( msg );
+ if( code = "200" ){
+ total := resultJson.Get( "dataSize" ).GetNumber();
+ loginfo.ReturnSuccess( true );
+ loginfo.TotalRow( total );
+ loginfo.UpdateLast();
+ }
+ }
+
+ return &data;
+ *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_PanelExport_670_bRefresh_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_PanelExport_670_bRefresh_OnClick.def
index 5b93647..b16556e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_PanelExport_670_bRefresh_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCCEngineLogisticsCostReport/Response_PanelExport_670_bRefresh_OnClick.def
@@ -15,7 +15,7 @@
[*
CCEngineLogisticsCostReport::Initialize( MacroPlan );
- if( not isnull( MacroPlan.DLEngineLogisticsCostExcel() ) ){
+ if( not isnull( MacroPlan.CCEngineLogisticsCostExcel() ) ){
CCEngineLogisticsCostReport::Import( MacroPlan, RecycleBin, MacroPlan.CCEngineLogisticsCostExcel().FileBinaryValue() );
}else{
CCEngineLogisticsCostReport::InitiateSearch( MacroPlan );
--
Gitblit v1.9.3