Ver Fonte

推送记录入参出参

zealerChina há 1 ano atrás
pai
commit
c349dd72f2

+ 13 - 0
application/admin/view/produceorder/detail.html

@@ -137,6 +137,19 @@ td:first-child {
         <td>{$row['first_time']}</td>
     </tr>
 </table>
+<table class="table table-striped table-bordered table-hover table-nowrap" width="50%">
+    <tr>
+        <td colspan="2"><b>推送错误信息</b></td>
+    </tr>
+    <tr>
+        <td>{:__('入参')}:</td>
+        <td>{$row['import_params']}</td>
+    </tr>
+    <tr>
+        <td>{:__('出参')}:</td>
+        <td>{$row['export_params']}</td>
+    </tr>
+</table>
 
 <div class="hide layer-footer">
     <label class="control-label col-xs-12 col-sm-2"></label>

+ 20 - 1
application/api/controller/MobileController.php

@@ -510,7 +510,26 @@ class MobileController extends UserApi
                         $mobile['hits']=MobileComputer::makeHits($mobile['no'],[$hitMiddle]);
                     }
                 }else{
-                    $mobile['hits']=[];
+                    // $mobile['hits']=[];
+                    App::invokeMethod([$computer,'check_'.$rule['tail']]);
+                    $hitTail=$computer->getHits();
+                    $hits=MobileComputer::makeHits($mobile['no'],[$hitTail]);
+                    $hitResult = false;
+                    foreach ($hits as $hit) {
+                        if ($hit) {
+                            $hitResult = true;
+                            break;
+                        }
+                    }
+                    if (!$hitResult) {
+                        App::invokeMethod([$computer,'check_'.$rule['middle']]);
+                        $hitMiddle=$computer->getHits();
+                        if($hitMiddle){
+                            $hits=MobileComputer::makeHits($mobile['no'],[$hitMiddle]);
+                        }
+                    }
+
+                    $mobile['hits'] = $hits;
                 }
             }
         }elseif(!empty($data['search_type']) && empty($data['rule_name'])){

+ 21 - 1
application/common/service/ZopBaseService.php

@@ -193,7 +193,7 @@ class ZopBaseService
      * @param array $params
      * @return string
      */
-    public static function send($urlPath = '', $params = [])
+    public static function send($urlPath = '', $params = [], $order = null)
     {
         // 数据获取
         $baseUrl = self::ZOP_URL;
@@ -227,6 +227,26 @@ class ZopBaseService
         ];
         $result = self::sendRequest($url, $reqParam);
 
+        // 判断result是否有报错
+        if (empty($result)) {
+            return $result;
+        }
+
+        $resArr = json_decode($result, true);
+        if ($urlPath == '/link/king/identity/cust/v2') {
+            if ($resArr['aCode'] != '0000' || $resArr['bCode']!= '0000') {
+                $order->import_params = json_encode($reqParam);
+                $order->export_params = $result;
+                $order->save();
+            }
+        } else {
+            if ($resArr['rspCode'] != '0000') {
+                $order->import_params = json_encode($reqParam);
+                $order->export_params = $result;
+                $order->save();
+            }
+        }
+
         return $result;
     }
 }

+ 19 - 19
application/common/service/ZopOrderService.php

@@ -97,7 +97,7 @@ class ZopOrderService extends ZopBaseService
                     ]
                 ],
             ];
-            $resourceResult = self::resourceUpload($resourceParams);
+            $resourceResult = self::resourceUpload($resourceParams, $order);
             if ($resourceResult['code'] != 0) {
                 // 写入订单错误信息
                 $order->failure_reason = $resourceResult['message'];
@@ -139,7 +139,7 @@ class ZopOrderService extends ZopBaseService
             'certNum' => $certNum,
         ];
 
-        $identityResult = self::identityCust($identityParams);
+        $identityResult = self::identityCust($identityParams, $order);
         if ($identityResult['code'] != 0) {
             // 写入订单错误信息
             $order->failure_reason = $identityResult['message'];
@@ -184,7 +184,7 @@ class ZopOrderService extends ZopBaseService
                 'pageUrl' => $pageUrl,
                 'resourceId' => $resourceId,
             ];
-            $autoOrderResult = self::autoNumSync($autoOrderParams);
+            $autoOrderResult = self::autoNumSync($autoOrderParams, $order);
             if ($autoOrderResult['code'] != 0) {
                 // 写入订单错误信息
                 $order->failure_reason = $autoOrderResult['message'];
@@ -216,7 +216,7 @@ class ZopOrderService extends ZopBaseService
                 'resourceId' => $resourceId,
             ];
     
-            $preOrderResult = self::preOrdersync($preOrderParams);
+            $preOrderResult = self::preOrdersync($preOrderParams, $order);
             if ($preOrderResult['code'] != 0) {
                 // 写入订单错误信息
                 $order->failure_reason = $preOrderResult['message'];
@@ -249,7 +249,7 @@ class ZopOrderService extends ZopBaseService
                 'isOpenCF' => $isOpenCF,
             ];
     
-            $orderResult = self::ordersync($orderParams);
+            $orderResult = self::ordersync($orderParams, $order);
             if ($orderResult['code'] != 0) {
                 // 写入订单错误信息
                 $order->failure_reason = $orderResult['message'];
@@ -271,7 +271,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params [channel: 渠道, goodsId: 商品ID, resourceContents: [content: 资源内容, sort: 排序]]]
      * @return array
      */
-    public static function resourceUpload($params = [])
+    public static function resourceUpload($params = [], $order = null)
     {
         $url = '/link/king/resource/upload/v1';
 
@@ -281,7 +281,7 @@ class ZopOrderService extends ZopBaseService
             'resourceContents'
         ]);
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('资源上传请求失败');
         }
@@ -303,7 +303,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params [province: 省份编码, city.地市编码, certName. 证件姓名, certNum. 证件编码]
      * @return array
      */
-    public static function identityCust($params = [])
+    public static function identityCust($params = [], $order = null)
     {
         $url = '/link/king/identity/cust/v2';
 
@@ -314,7 +314,7 @@ class ZopOrderService extends ZopBaseService
             'certNum'
         ]);
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('客户资料校验请求失败');
         }
@@ -338,7 +338,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params [orderId: 订单ID, goodsId: 商品ID, certName: 证件姓名, certNo: 证件编码, contactNum: 联系电话, postProvinceCode: 省份编码, postCityCode: 地市编码, postDistrictCode: 区县编码, postAddr: 详细地址, channel: 渠道, createTime: 创建时间, updateTime: 更新时间, orderTotalFee: 订单总金额, pageUrl: 页面地址, resourceId: 资源ID]
      * @return array
      */
-    public static function preOrdersync($params = [])
+    public static function preOrdersync($params = [], $order = null)
     {
         $url = '/link/king/card/preOrder/preOrdersync';
 
@@ -361,7 +361,7 @@ class ZopOrderService extends ZopBaseService
         ]);
         $data['launchPlatform'] = self::getRandLaunchPlatform();
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('意向单同步请求失败');
         }
@@ -412,7 +412,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params [goodsId: 商品ID, provinceCode: 省份编码, cityCode: 地市编码, searchCategory: 搜索类别: 1、普通选号 2、靓号选号 3、全部(普通、靓号都包括)]
      * @return array
      */
-    public static function linkNumSelect($params = [])
+    public static function linkNumSelect($params = [], $order = null)
     {
         $url = '/link/num/select/v1';
 
@@ -424,7 +424,7 @@ class ZopOrderService extends ZopBaseService
         ]);
         $data['qryType'] = '02';
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('选号服务请求失败');
         }
@@ -450,7 +450,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params
      * @return array
      */
-    public static function ordersync($params = [])
+    public static function ordersync($params = [], $order = null)
     {
         $url = '/link/king/card/preOrder/ordersync/v2';
 
@@ -464,7 +464,7 @@ class ZopOrderService extends ZopBaseService
             'isOpenCF'
         ]);
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('正式单同步请求失败');
         }
@@ -489,7 +489,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params
      * @return array
      */
-    public static function postInfo($params = [])
+    public static function postInfo($params = [], $order = null)
     {
         $url = '/link/king/postInfo/qry';
 
@@ -497,7 +497,7 @@ class ZopOrderService extends ZopBaseService
             'provinceCode'
         ]);
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('查询省市区信息请求失败');
         }
@@ -644,7 +644,7 @@ class ZopOrderService extends ZopBaseService
      * @param array $params [orderId: 订单ID, goodsId: 商品ID, certName: 证件姓名, certNo: 证件编码, contactNum: 联系电话, postProvinceCode: 省份编码, postCityCode: 地市编码, postDistrictCode: 区县编码, postAddr: 详细地址, channel: 渠道, createTime: 创建时间, updateTime: 更新时间, orderTotalFee: 订单总金额, pageUrl: 页面地址, resourceId: 资源ID]
      * @return array
      */
-    public static function autoNumSync($params = [])
+    public static function autoNumSync($params = [], $order = null)
     {
         $url = '/link/king/card/preOrder/autoNumSync';
 
@@ -667,7 +667,7 @@ class ZopOrderService extends ZopBaseService
         ]);
         $data['launchPlatform'] = self::getRandLaunchPlatform();
 
-        $result = self::send($url, $data);
+        $result = self::send($url, $data, $order);
         if (empty($result)) {
             return self::error('自动选号请求失败');
         }