Quintiq file version 2.0
|
#parent: #root
|
StaticMethod HandlePR (
|
Archive archive,
|
MacroPlan macroPlan,
|
String userName,
|
String prFileName,
|
BinaryValue prBinaryValue,
|
Boolean isPRArchive,
|
String filePath
|
)
|
{
|
TextBody:
|
[*
|
// 请求参数
|
pathPR := filePath + prFileName;
|
isArchive := ifexpr( isPRArchive, "true", "false" );
|
minorKey := [String]macroPlan.MDSID().MinorKey();
|
json := JSON::Object()
|
.Add( "pathPR", pathPR )
|
.Add( "isArchive", isArchive )
|
.Add( "minorKey", minorKey ).Build().AsString();
|
|
// 写入临时文件
|
Archive::WriteTempFile( pathPR, prBinaryValue );
|
|
info( json );
|
for ( i := 0; i < 10000; i++ ) {
|
for ( j := 0; j < 20000; j++ ) {
|
info( i + j );
|
}
|
}
|
// 调用接口
|
url := "/PR/Import";
|
|
i := HTTPInterface::Create( archive.JavaInterfaceAddress(), archive.JavaInterfacePort() );
|
i.URL( url );
|
i.PostMethod( true );
|
i.MediaType( "application/json" );
|
|
i.Call( json );
|
|
htmlresult := i.Result();
|
|
respJSON := JSON::Parse( htmlresult );
|
code := respJSON.Get( "code" ).GetNumber();
|
message := respJSON.Get( "message" ).GetString();
|
|
if ( code = 200 ) {
|
|
} else {
|
error( message );
|
}
|
*]
|
}
|