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_HandlePP.qbl | 50 +++++++++++++++++++++++++++-----------------------
1 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/_Main/BL/Type_Archive/StaticMethod_HandlePP.qbl b/_Main/BL/Type_Archive/StaticMethod_HandlePP.qbl
index 445a11d..177b889 100644
--- a/_Main/BL/Type_Archive/StaticMethod_HandlePP.qbl
+++ b/_Main/BL/Type_Archive/StaticMethod_HandlePP.qbl
@@ -7,37 +7,41 @@
String ppFileName,
BinaryValue ppBinaryValue,
Boolean isPPArchive,
- String filePath
-)
+ String filePath,
+ Boolean isOverwriteFile
+) as stream[JSON]
{
TextBody:
[*
// 璇锋眰鍙傛暟
- pathPP := filePath + ppFileName;
- isArchive := ifexpr( isPPArchive, "true", "false" );
- minorKey := [String]macroPlan.MDSID().MinorKey();
- json := JSON::Object()
- .Add( "path", pathPP )
- .Add( "isArchive", isArchive )
- .Add( "minorKey", minorKey ).Build().AsString();
+ pathPP := filePath + ppFileName;
+ isArchive := ifexpr( isPPArchive, "true", "false" );
+ isOverride := ifexpr( isOverwriteFile, "true", "false" );
+ minorKey := [String]macroPlan.MDSID().MinorKey();
+ json := JSON::Object()
+ .Add( "path", pathPP )
+ .Add( "isArchive", isArchive )
+ .Add( "isOverride", isOverride )
+ .Add( "minorKey", minorKey ).Build().AsString();
// 鍐欏叆涓存椂鏂囦欢
Archive::WriteTempFile( pathPP, ppBinaryValue );
- 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