定制 dprmc/clear-structure-sentry-data-service 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dprmc/clear-structure-sentry-data-service

最新稳定版本:v2.0.21

Composer 安装命令:

composer require dprmc/clear-structure-sentry-data-service

包简介

A library that allows you to import standard import files into the Sentry system.

README 文档

README

Coverage Status Build Status Total Downloads Latest Stable Version License

ImportExcel

Used to import Standard Import Files as defined by ClearStructure.

Check Sentry's documentation for the proper format if a Standard Import File.

// This will attempt to import the contents of 'standard_import_file.xlsx' into the UAT site.
// Change the 2nd parameter of the run() method to true to import to your production site.

use DPRMC\ClearStructure\Sentry\DataService\Services\ImportExcel;

$uatUrl           = 'http://your-uat-url';
$prodUrl          = 'http://your-prod-url';
$user             = 'yourSentryUserName';
$pass             = 'yourEncryptedSentryPassword';
$pathToImportFile = 'standard_import_file.xlsx';
$postToUAT        = true;

$importExcelResponse = ImportExcel::init( $uatUrl, $prodUrl, $user, $pass, $postToUAT )
                           ->setData($pathToImportFile)
                           ->run();
                           
// Contents of $importExcelResponse->response() if everything goes well:
Array
(
    [time] => Carbon\Carbon Object
        (
            [date] => 2018-08-03 16:12:23.000000
            [timezone_type] => 3
            [timezone] => UTC
        )

    [name] => Security_Attribute_Update
    [num] => 2
    [runtime] => 296.8872
    [errors] => Array
        (
        )

    [warnings] => Array
        (
        )
)

// Call path() to get the local filepath of the xlsx that was uploaded to Sentry.
$importExcelResponse->path();

Deleting Data

$data   = [];
$data[] = [
    'scheme_identifier'          => 42,
    'scheme_name'                => 'SentryId',
    'market_data_authority_name' => 'DB',
    'action'                     => 'DELETE',
    'as_of_date'                 => '1/1/2018',
];

$data[] = [
    'scheme_identifier'          => 'ABCDEFGH1',
    'scheme_name'                => 'CUSIP',
    'market_data_authority_name' => 'DB',
    'action'                     => 'DELETE',
    'as_of_date'                 => '1/1/2018',
];

$deleteExcelResponse = DeleteExcelSecurityPricing::init( $uatUrl, $prodUrl, $user, $pass, $postToUAT )
                                  ->setData($data)  
                                  ->delete();


Testing

Want to run the PHPUnit tests?

foo@bar:~$ php ./phpunit-5.7.27.phar

统计信息

  • 总下载量: 3.5k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-16