|
|
@@ -14,6 +14,64 @@ use Yii;
|
|
|
class ExpressController extends BaseController
|
|
|
{
|
|
|
|
|
|
+ public function actionTestUpdate()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $action = $get['action'] ?? 0;
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有找到订单');
|
|
|
+ }
|
|
|
+ if ($order->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的订单');
|
|
|
+ }
|
|
|
+ $fhWlNo = $order->fhWlNo ?? '';
|
|
|
+ if (empty($fhWlNo)) {
|
|
|
+ util::fail('没有找到物流单');
|
|
|
+ }
|
|
|
+
|
|
|
+ $orderSn = $order->orderSn;
|
|
|
+ $wayBillId = $order->fhWlNo;
|
|
|
+ $actionTime = time();
|
|
|
+ $actionTypeMap = [
|
|
|
+ 0 => 100001,
|
|
|
+ 1 => 100002,
|
|
|
+ 2 => 100003,
|
|
|
+ 3 => 200001,
|
|
|
+ 4 => 300002,
|
|
|
+ 5 => 300003,
|
|
|
+ 6 => 300004,
|
|
|
+ 7 => 400001,
|
|
|
+ 8 => 400002,
|
|
|
+ ];
|
|
|
+ $actionType = $actionTypeMap[$action] ?? 100001;
|
|
|
+ $actionMsg = '编号' . rand(1111, 9999);
|
|
|
+
|
|
|
+ $bizIdMap = dict::getDict('expressBizIdMap');
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ $bizId = $bizIdMap[$mainId] ?? 0;
|
|
|
+ if (empty($bizId)) {
|
|
|
+ util::fail('没有找到月结账号');
|
|
|
+ }
|
|
|
+ //暂时只支持顺丰
|
|
|
+ $deliveryId = 'SF';
|
|
|
+ } else {
|
|
|
+ $deliveryId = 'TEST';
|
|
|
+ $bizId = 'test_biz_id';
|
|
|
+ }
|
|
|
+ $params = [
|
|
|
+ 'deliveryId' => $deliveryId,
|
|
|
+ 'bizId' => $bizId,
|
|
|
+ 'orderSn' => $orderSn,
|
|
|
+ 'wayBillId' => $wayBillId,
|
|
|
+ 'actionType' => $actionType,
|
|
|
+ 'actionMsg' => $actionMsg,
|
|
|
+ 'actionTime' => $actionTime,
|
|
|
+ ];
|
|
|
+ ExpressClass::testUpdate($params, $order);
|
|
|
+ }
|
|
|
+
|
|
|
public function actionCancelWayBill()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|