Пример #1
0
 /**
  * 分区操作
  * @author czq
  */
 public function act_checkPartion()
 {
     if (!$_SESSION['userId']) {
         $result = array('status' => 0, 'msg' => '请先登录系统');
         echo json_encode($result);
         exit;
     }
     $shipOrderId = trim($_REQUEST['shipOrderId']);
     $shipOrder = WhShippingOrderModel::find($shipOrderId);
     if (empty($shipOrder)) {
         $result = array('status' => 'A00', 'msg' => '发货单信息不存在');
         echo json_encode($result);
         exit;
     }
     if ($shipOrder['orderStatus'] != PKS_WDISTRICT) {
         $result = array('status' => 'A00', 'msg' => '发货单非待分区状态,不能分区');
         echo json_encode($result);
         exit;
     }
     if (empty($shipOrder['channelId'])) {
         $result = array('status' => 'A00', 'msg' => '发货单在申请运输方式中,请稍后分区');
         echo json_encode($result);
         exit;
     }
     $partition = WhTransportPartitionModel::getPartition($shipOrder['channelId'], $shipOrder['countryName']);
     if ($partition) {
         $vo = WhOrderPartionRecordsModel::find("shipOrderId='" . $shipOrderId . "'");
         if (!$vo) {
             $data = array('shipOrderId' => $shipOrderId, 'packageId' => 0, 'partitionId' => $partition['id'], 'weight' => $shipOrder['orderWeight'], 'partion' => $partition['title'], 'scanUserId' => $_SESSION['userId'], 'scanTime' => time(), 'modifyTime' => 0, 'note' => '', 'is_delete' => 0, 'storeId' => 0);
             WhOrderPartionRecordsModel::insert($data);
             $result = array('status' => $partition['code'], 'partition' => $partition['partition'], 'msg' => $partition['title']);
         } else {
             if ($vo['packageId']) {
                 $result = array('status' => 'A00', 'partition' => $partition['partition'], 'msg' => '已打包,不能再分区');
             } else {
                 $result = array('status' => $partition['code'], 'partition' => $partition['partition'], 'msg' => '包裹已分拣,分区为: ' . $partition['title']);
             }
         }
     } else {
         $result = array('status' => 'A00', 'partition' => '', 'msg' => '当前国家未分区,请联系销售人员');
     }
     echo json_encode($result);
     exit;
 }
Пример #2
0
 /**
  * 快递复核标记为发货异常
  * @return boolean
  * @author czq
  */
 public function act_signUnusual()
 {
     $shipOrderId = isset($_POST['shipOrderId']) ? intval($_POST['shipOrderId']) : 0;
     if (empty($shipOrderId)) {
         self::$errCode = 0;
         self::$errMsg = '请输入发货单信息!';
         return;
     }
     $shipOrder = WhShippingOrderModel::find(' id=' . $shipOrderId . ' AND is_delete = 0', 'id');
     if (!$shipOrder) {
         self::$errCode = 0;
         self::$errMsg = '发货单' . $shipOrder . '不存在!';
         return;
     }
     WhShippingOrderModel::begin();
     //更新状态为 发货单异常
     if (!WhShippingOrderModel::update(array('orderStatus' => PKS_UNUSUAL_SHIPPING_INVOICE), $shipOrderId)) {
         self::$errCode = 0;
         self::$errMsg = '发货单' . $shipOrder . '不存在!';
         WhShippingOrderModel::rollback();
         return false;
     }
     self::$errCode = 1;
     self::$errMsg = '发货单标记异常成功';
     WhShippingOrderModel::commit();
     return true;
 }