中石油化基础文件

This commit is contained in:
2020-09-24 14:39:31 +08:00
parent e84e74268a
commit 1f178435a6
6 changed files with 278 additions and 33 deletions

2
README
View File

@@ -1,2 +1,2 @@
核销系统 增加发券
核销系统 增加发券 开发分支

42
config/sinopec.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
return [
/**
* 平安接口参数
*/
'this_type' => 'dev',
/**
* 测试环境参数
*/
'test' => [
'client_id' => 'P_YISHIDAI',
'grant_type' => 'client_credentials',
'client_secret' => 'zGg9e6J5',
'userName' => '18804518018',
'AES_CODE' => '61DA0376BEBCFE1F',
'tokenUri' => 'https://test-api.pingan.com.cn:20443/oauth/oauth2/access_token',
'Uri' => 'http://test-api.pingan.com.cn:20080/open/vassPartner/appsvr/property/api/new/',
],
/**
* 生产环境参数
*/
'dev' => [
'client_id' => 'P_YISHIDAI',
'grant_type' => 'client_credentials',
'client_secret' => 'F3j5J7bx',
'userName' => '13936166646',
'AES_CODE' => '108DD27AB83252DB',
'tokenUri' => 'http://api.pingan.com.cn/oauth/oauth2/access_token',
'Uri' => 'http://api.pingan.com.cn/open/vassPartner/appsvr/property/api/new/',
],
'coupon_status' => [
1 => '新建',
2 => '未生效',
3 => '生效',
4 => '失效',
5 => '过期',
],
];

View File

@@ -0,0 +1,73 @@
<?php
namespace XuanChen\Coupon\Action;
use XuanChen\Coupon\Action\sinopec\ZhyCreate;
use XuanChen\Coupon\Contracts\CouponContracts;
/**
* Class SinopecAction 中石化控制器
* @Author: 玄尘
* @Date: 2020/9/23 15:14
* @package XuanChen\Coupon\Action
*/
class SinopecAction extends Init implements CouponContracts
{
/**
* Notes: 创建营销活动
* @Author: 玄尘
* @Date: 2020/9/23 16:01
* @param array $data
*/
public function create(array $data)
{
$action = new ZhyCreate();
$action->data = $data;
return $action->start();
}
/**
* Notes: 发券接口
* @Author: 玄尘
* @Date: 2020/9/23 15:58
*/
function grant()
{
// TODO: Implement grant() method.
}
/**
* Notes: 查询接口
* @Author: 玄尘
* @Date: 2020/9/23 15:58
* @return mixed|void
*/
function detail()
{
// TODO: Implement detail() method.
}
/**
* Notes: 作废接口
* @Author: 玄尘
* @Date: 2020/9/23 15:59
*/
function destroy()
{
// TODO: Implement destroy() method.
}
/**
* Notes: 核销接口
* @Author: 玄尘
* @Date: 2020/9/23 16:00
* @return mixed|void
*/
function start()
{
// TODO: Implement start() method.
}
}

View File

@@ -0,0 +1,81 @@
<?php
namespace XuanChen\Coupon\Action\sinopec;
use XuanChen\Coupon\Contracts\CheckCouponContracts;
class ZhyCreate implements CheckCouponContracts
{
public $data;
public function start()
{
try {
[
"cooperativeMerchant" => "",
"eletronAndRule" => [
[
"entryMethod" => "01",
"marketCode" => "20191213154203514",
"marketRuleNumber" => "001",
"perVoucherNumber" => "1",
"planVoucherNumber" => "10",
"queryCreateTime" => "2019-11-11 18=> 39=> 49",
"similarStack" => "Y",
"voucherEndTime" => "2019-12-15",
"voucher_ruleCode" => "$01-VC-1573468710381900",
"voucherRuleName" => "ceshi2",
"voucherSource" => "S01",
"voucherStartTime" => "2019-12-13",
"voucherStartTime_type" => "VOUCHER_START_TIME_TYPE_ABSOLUTE_EFFECTIVE_TIME"
]
],
"limitFrequency" => "",
"mabIsRefund" => "",
"marketCode" => "20191213154203514",
"marketExEndTime" => "2019-12-15 00=> 00=> 00",
"marketExStartTime" => "2019-12-13 00=> 00=> 00",
"marketHierarchy" => "3311",
"marketName" => "行为推送活动-3",
"marketProvince" => "51",
"marketReleaseSys" => "VOUCHER_PUBLISH_TYPE_APPLET",
"marketStatus" => "MARKET_ACTIVITY_STATE_TAKE_EFFECT",
"promotionCalculation" => "PROMOTION_TYPE_MEMBER_BEHAVIOR",
"rule" => [
[
"cashValue" => "100",
"channel" => "C01,C02,C03,C05",
"fullType" => "",
"marketCode" => "20191213154203514",
"perVoucherNumber" => "1",
"planVoucherNumber" => "10",
"ruleCode" => "$01-VC-1573468710381900",
"ruleDetail" => "123123",
"ruleName" => "ceshi2",
"voucherType" => "C01"
]
],
"tradLimit" => [
[
"endValue" => "",
"fixed" => "",
"marketCode" => "20191213154203514",
"marketRuleName" => "001",
"marketRuleNumber" => "001",
"memLevel" => "",
"operator" => "",
"startValue" => "",
"tradingUnit" => "",
"transactionType" => ""
]
]
];
} catch (\Exception $e) {
return $e->getMessage();
}
}
}

View File

@@ -0,0 +1,81 @@
<?php
namespace XuanChen\Coupon\Action\sinopec;
use XuanChen\Coupon\Contracts\CheckCouponContracts;
class ZhyQuery implements CheckCouponContracts
{
public $data;
public function start()
{
try {
[
"cooperativeMerchant" => "",
"eletronAndRule" => [
[
"entryMethod" => "01",
"marketCode" => "20191213154203514",
"marketRuleNumber" => "001",
"perVoucherNumber" => "1",
"planVoucherNumber" => "10",
"queryCreateTime" => "2019-11-11 18=> 39=> 49",
"similarStack" => "Y",
"voucherEndTime" => "2019-12-15",
"voucher_ruleCode" => "$01-VC-1573468710381900",
"voucherRuleName" => "ceshi2",
"voucherSource" => "S01",
"voucherStartTime" => "2019-12-13",
"voucherStartTime_type" => "VOUCHER_START_TIME_TYPE_ABSOLUTE_EFFECTIVE_TIME"
]
],
"limitFrequency" => "",
"mabIsRefund" => "",
"marketCode" => "20191213154203514",
"marketExEndTime" => "2019-12-15 00=> 00=> 00",
"marketExStartTime" => "2019-12-13 00=> 00=> 00",
"marketHierarchy" => "3311",
"marketName" => "行为推送活动-3",
"marketProvince" => "51",
"marketReleaseSys" => "VOUCHER_PUBLISH_TYPE_APPLET",
"marketStatus" => "MARKET_ACTIVITY_STATE_TAKE_EFFECT",
"promotionCalculation" => "PROMOTION_TYPE_MEMBER_BEHAVIOR",
"rule" => [
[
"cashValue" => "100",
"channel" => "C01,C02,C03,C05",
"fullType" => "",
"marketCode" => "20191213154203514",
"perVoucherNumber" => "1",
"planVoucherNumber" => "10",
"ruleCode" => "$01-VC-1573468710381900",
"ruleDetail" => "123123",
"ruleName" => "ceshi2",
"voucherType" => "C01"
]
],
"tradLimit" => [
[
"endValue" => "",
"fixed" => "",
"marketCode" => "20191213154203514",
"marketRuleName" => "001",
"marketRuleNumber" => "001",
"memLevel" => "",
"operator" => "",
"startValue" => "",
"tradingUnit" => "",
"transactionType" => ""
]
]
];
} catch (\Exception $e) {
return $e->getMessage();
}
}
}

View File

@@ -1,32 +0,0 @@
<?php
namespace XuanChen\Coupon;
use Illuminate\Support\ServiceProvider;
class CouponServiceProvider extends ServiceProvider
{
/**
* Register services.
* @return void
*/
public function register()
{
dd(1);
if ($this->app->runningInConsole()) {
$this->publishes([__DIR__ . '/../config/xuanchen_coupon.php' => config_path('xuanchen_coupon.php')]);
}
}
/**
* Bootstrap services.
* @return void
*/
public function boot()
{
$this->mergeConfigFrom(__DIR__ . '/../config/xuanchen_coupon.php', 'xuanchen_coupon');
}
}