Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
16c6a9ef
Commit
16c6a9ef
authored
Jul 24, 2020
by
xmy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ft-immediateDelivery'
parents
7454608e
3c438075
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
6 deletions
+105
-6
src/Cmq/Topic.php
+6
-6
src/Common/Config/CfgCenter.php
+1
-0
src/Goods/Enum/GoodsEnum.php
+1
-0
src/Logistics/Enum/LogisticsCmqEnum.php
+13
-0
src/Logistics/Lib/LogisticsInterface.php
+84
-0
No files found.
src/Cmq/Topic.php
View file @
16c6a9ef
...
...
@@ -261,9 +261,9 @@ class Topic
do
{
try
{
$res
=
$this
->
publish_message
(
$cryptMessage
,
$vTagList
,
$routingKey
);
if
(
$res
[
'code'
]
==
0
)
break
;
}
catch
(
\Throwable
$e
)
{
App
::
error
(
"[消息队列异常]:"
.
var_export
(
$e
,
true
));
if
(
$res
[
'code'
]
==
0
)
break
;
}
catch
(
\Throwable
$e
)
{
App
::
error
(
"[消息队列异常]:"
.
$e
->
getFile
()
.
$e
->
getMessage
(),
$e
->
getLine
(
));
}
$tryTimes
++
;
}
while
(
$tryTimes
<
3
);
...
...
@@ -277,7 +277,7 @@ class Topic
return
$res
;
}
protected
function
TopicLog
(
$message
,
$cryptMessage
,
$tagName
,
$response
,
$status
=
0
)
protected
function
TopicLog
(
$message
,
$cryptMessage
,
$tagName
,
$response
,
$status
=
0
)
{
$data
=
[
'tagName'
=>
$tagName
,
...
...
@@ -291,8 +291,8 @@ class Topic
try
{
$db
=
CfgCenter
::
dbConnect
();
$db
->
insert
(
'topic_log'
,
$data
);
}
catch
(
\Exception
$e
)
{
App
::
error
(
"消息主题日志记录失败:"
.
$e
->
getMessage
()
.
'---'
.
json_encode
(
$data
));
}
catch
(
\Exception
$e
)
{
App
::
error
(
"消息主题日志记录失败:"
.
$e
->
getMessage
()
.
'---'
.
json_encode
(
$data
));
}
}
}
src/Common/Config/CfgCenter.php
View file @
16c6a9ef
...
...
@@ -30,6 +30,7 @@ class CfgCenter
const
MP_OEMADM
=
'mp_oemadm'
;
// OEM机构管理员公众号后台,使用云脉科技公众号
const
TRAFFIC_BACKEND_WEAPP
=
'traffic_backend_weapp'
;
//流量平台业务员端小程序
const
TRAFFIC_FRONTEND_WEAPP
=
'traffic_frontend_weapp'
;
//流量平台买家端小程序
const
CATERING_WEAPP
=
'catering_weapp'
;
//餐饮小程序
/**
* 根据用户token获取配置, 优先使用此方法读取配置
...
...
src/Goods/Enum/GoodsEnum.php
View file @
16c6a9ef
...
...
@@ -16,6 +16,7 @@ class GoodsEnum
const
SERVER_GOODS
=
1
;
//服务商品
const
ENTITY_GOODS
=
2
;
//实体商品
const
TAKE_OUT_GOODS
=
3
;
//外卖商品
const
FREIGHT_FREE
=
1
;
//包邮
...
...
src/Logistics/Enum/LogisticsCmqEnum.php
0 → 100644
View file @
16c6a9ef
<?php
namespace
Hdll\Services\Logistics\Enum
;
class
LogisticsCmqEnum
{
const
TOPIC
=
'logistics'
;
const
TOPIC_CMQ_RECHARGE
=
'Recharge'
;
//充值回调cmq
}
\ No newline at end of file
src/Logistics/Lib/LogisticsInterface.php
View file @
16c6a9ef
...
...
@@ -2,6 +2,8 @@
namespace
Hdll\Services\Logistics\Lib
;
use
App\Exception\BaseException
;
use
App\Exception\RpcException
;
use
Swoft\Core\ResultInterface
;
/**
...
...
@@ -15,6 +17,9 @@ interface LogisticsInterface
public
function
onPath
(
array
$param
);
public
function
imOnPath
(
array
$param
);
/**
* 获取运费
* @param $storeId
...
...
@@ -31,4 +36,82 @@ interface LogisticsInterface
* @return mixed
*/
public
function
getReceiver
(
$id
,
$storeId
);
/**
* 获取即时配送收货人地址
* @param $id
* @param $storeId
* @return array
*/
public
function
getImReceiver
(
$id
,
$storeId
);
/**
* 预下单
* @param $storeId
* @param $buyerId
* @param array $receiver 收货人信息
* @param $items 商品信息
* [
* ['name'=>'商品名称','image'=>'shang_pin_tu_pian'],
* ['name'=>'商品名称','image'=>'shang_pin_tu_pian'],
* ]
* @param $unique
* @param $orderSn 订单号
* @param $price 商品总价
* @param $deliveryCode 配送服务代码 不同配送公司自定义, 顺丰和达达不填
* @return mixed
*/
public
function
preOrder
(
$storeId
,
$buyerId
,
array
$receiver
,
$items
,
$unique
,
$orderSn
,
$price
,
$deliveryCode
=
null
);
/**
* 下单
* @param $storeId
* @param $buyerId
* @param array $receiver 收货人信息
* @param $orderSn 订单号
* @param $deliveryCode 配送服务代码 不同配送公司自定义, 顺丰和达达不填
* @return mixed
*/
public
function
order
(
$storeId
,
$buyerId
,
array
$receiver
,
$orderSn
,
$deliveryCode
=
null
);
/**
* 获取账号信息
* @param $condition
* @param string[] $fields
* @return mixed
*/
public
function
getAccountByCondition
(
$condition
,
$fields
=
[
'*'
]);
/**
* 获取即时配送物流订单
* @param $orderIds
* @param string[] $fields
* @return mixed
*/
public
function
getByMainOrderIds
(
$storeId
,
$orderIds
,
$fields
=
[
'*'
]);
/**
* 获取物流状态
* @param $orderIds
* @return mixed
*/
public
function
getPathByMainOrderIds
(
$storeId
,
$orderIds
);
/**
* 取消物流订单
* @param $storeId
* @param $orderSn
* @param string $cancelReason
* @return mixed
*/
public
function
cancelOrder
(
$storeId
,
$orderSn
,
$cancelReason
=
''
);
/**
* 获取充值订单
* @param $orderSn
* @return mixed
*/
public
function
getRechargeOrder
(
$orderSn
);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment