|
|
@@ -17,6 +17,43 @@ class ExpressClass extends BaseClass
|
|
|
|
|
|
public static $baseFile = '\bizGhs\express\models\DeliveryOrder';
|
|
|
|
|
|
+ public static function cancel($params, $order)
|
|
|
+ {
|
|
|
+ $cgId = $order->purchaseId;
|
|
|
+ $cg = PurchaseClass::getById($cgId, true);
|
|
|
+ if (empty($cg)) {
|
|
|
+ util::fail('订单信息缺失');
|
|
|
+ }
|
|
|
+
|
|
|
+ $merchant = WxOpenClass::getGhsWxInfo();
|
|
|
+ $ptStyle = dict::getDict('ptStyle', 'ghs');
|
|
|
+
|
|
|
+ $orderSn = $params['orderSn'];
|
|
|
+ $openId = $params['openId'];
|
|
|
+ $deliveryId = $params['deliveryId'];
|
|
|
+ $bizId = $params['bizId'];
|
|
|
+
|
|
|
+ $wayBillId = $order->fhWlNo ?? '';
|
|
|
+
|
|
|
+ $data = [
|
|
|
+ 'openid' => $openId,
|
|
|
+ 'deliveryId' => $deliveryId,
|
|
|
+ 'waybill_id' => $wayBillId,
|
|
|
+ 'order_id' => $orderSn
|
|
|
+ ];
|
|
|
+
|
|
|
+ $ret = expressUtil::cancelOrder($merchant, $data, $ptStyle);
|
|
|
+ if ($ret['errcode'] == 0) {
|
|
|
+ $order->fhWlStatus = 2;
|
|
|
+ $order->save();
|
|
|
+ $cg->fhWlStatus = 2;
|
|
|
+ $cg->save();
|
|
|
+ util::complete('取消成功');
|
|
|
+ } else {
|
|
|
+ util::fail('取消失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//新增运单 ssh 20250703
|
|
|
public static function addWayBill($params, $order)
|
|
|
{
|