From 191fc5cc2e5eeaff377b749dfa7e497fe503506b Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期一, 27 五月 2024 20:56:50 +0800
Subject: [PATCH] PR,PP,Budget 功能
---
_Main/BL/Type_Archive/StaticMethod_HandleBudget.qbl | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/_Main/BL/Type_Archive/StaticMethod_HandleBudget.qbl b/_Main/BL/Type_Archive/StaticMethod_HandleBudget.qbl
index 37fff73..ed3e960 100644
--- a/_Main/BL/Type_Archive/StaticMethod_HandleBudget.qbl
+++ b/_Main/BL/Type_Archive/StaticMethod_HandleBudget.qbl
@@ -7,37 +7,41 @@
String budgetFileName,
BinaryValue budgetBinaryValue,
Boolean isBudgetArchive,
- String filePath
-)
+ String filePath,
+ Boolean isOverwriteFile
+) as stream[JSON]
{
TextBody:
[*
// 璇锋眰鍙傛暟
pathBudget := filePath + budgetFileName;
isArchive := ifexpr( isBudgetArchive, "true", "false" );
+ isOverride := ifexpr( isOverwriteFile, "true", "false" );
minorKey := [String]macroPlan.MDSID().MinorKey();
json := JSON::Object()
.Add( "path", pathBudget )
.Add( "isArchive", isArchive )
+ .Add( "isOverride", isOverride )
.Add( "minorKey", minorKey ).Build().AsString();
// 鍐欏叆涓存椂鏂囦欢
Archive::WriteTempFile( pathBudget, budgetBinaryValue );
- info( json );
-
// 璋冪敤鎺ュ彛
- //url := "/PR/Import";
- //i := HTTPInterface::Create( archive.JavaInterfaceAddress(), archive.JavaInterfacePort() );
- //i.URL( url );
- //i.PostMethod( true );
- //
- //try {
- // i.Call( json );
- //
- // htmlresult := i.Result();
- //} onerror {
- //
- //}
+ url := "/PPBudget/Import";
+
+ 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 );
+
+ return emit( respJSON );
*]
}
--
Gitblit v1.9.3