administrator
2024-05-30 7858c560390ea9fd2aed8b6a9b3e663250daf359
新增IDS全表下载
已添加2个文件
61 ■■■■■ 文件已修改
_Main/BL/Type_TemplateManager/StaticMethod_GetIDSFullTable.qbl 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_DialogRequirementUpload/Response_pnlActionsLeft_bIDSFullTableTemplateDownload_OnClick.def 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_TemplateManager/StaticMethod_GetIDSFullTable.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetIDSFullTable (
  const Archive archive,
  Number year
) as BinaryValue
{
  TextBody:
  [*
    // Administrator May-30-2024 (created)
    // Akari May-18-2024 (created)
    // è°ƒç”¨æŽ¥å£
    url := "/IDSPPACurve/GetIDSFullTableXML" + "?year=" +[String]year;
    i := HTTPInterface::Create( archive.JavaInterfaceAddress(), archive.JavaInterfacePort() );
    i.URL( url );
    i.PostMethod( false );
    i.TimeOut( Duration::Minutes( 5 ) );
    i.Call( );
    htmlresult := i.Result();
    respJSON   := JSON::Parse( htmlresult );
    code    := respJSON.Get( "code" ).GetNumber();
    message := respJSON.Get( "message" ).GetString();
    xmlTemplate := "";
    if( code = 200 ){
      xmlTemplate := message;
    }else{
      error( message );
    }
    tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlTemplate ) );
    XLS::SaveTable( tableHandle, OS::TempPath() + "template.xlsx" );
    file := OSFile::Construct();
    file.Open( OS::TempPath() + "template.xlsx", "Read", true );
    data := file.ReadBinary();
    return data;
  *]
}
_Main/UI/MacroPlannerWebApp/Component_DialogRequirementUpload/Response_pnlActionsLeft_bIDSFullTableTemplateDownload_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
Quintiq file version 2.0
#parent: pnlActionsLeft/bIDSFullTableTemplateDownload
Response OnClick () id:Response_pnlActionsLeft_bIDSFullTableTemplateDownload_OnClick
{
  #keys: '[411860.0.31051373]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  QuillAction
  {
    Body:
    [*
      binaryValue := TemplateManager::GetIDSFullTable( Archive, Date::ActualDate().Year() );
      Application.Download( "IDS全表: "+ [String]Date::ActualDate().Year() +".xlsx", binaryValue.AsBinaryData() );
    *]
    GroupServerCalls: false
  }
}