Example #1
0
 public function view_orderWeighing()
 {
     $config_path = 'images/cz';
     $time = date("Y/m/d", time());
     $dirPath = $config_path . '/' . $time;
     if (!is_dir($dirPath)) {
         mkdirs($dirPath, 0777);
     }
     $this->smarty->assign('time', $time);
     $navlist = array(array('url' => '', 'title' => '出库'), array('url' => 'index.php?mod=waitWeighing&act=waitWeighingList', 'title' => '待称重'), array('url' => '', 'title' => '称重扫描<小包>'));
     $secnev = 3;
     $toplevel = 2;
     $secondlevel = 26;
     //$userName = $_SESSION['username'];
     //$this->smarty->assign('secnev','1');
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('secnev', $secnev);
     $this->smarty->assign('toplevel', $toplevel);
     $this->smarty->assign('secondlevel', $secondlevel);
     $partion_list = CommonModel::getChannelNameByIds('all');
     //$channel_list = CommonModel::getCarrierChannelByIds('all');
     $channel_list = C('MAILWAYCONFIG');
     $this->smarty->assign("partion_list", $partion_list);
     $this->smarty->assign("channel_list", $channel_list);
     //$this->smarty->assign('toptitle', '货品资料管理');
     $this->smarty->display('orderWeighing.htm');
 }
Example #2
0
 public function act_packingTracknumber()
 {
     $orderid = isset($_POST['orderid']) ? $_POST['orderid'] : "";
     $tracknumber = isset($_POST['tracknumber']) ? $_POST['tracknumber'] : "";
     $userId = $_SESSION['userId'];
     //先核对订单
     //兼容 EUB或者 包裹 扫描的是 trackno 而非ebayid
     $p_real_ebayid = '#^\\d+$#';
     $p_trackno_eub = '#^(LK|RA|RB|RC|RR|RF|LN)\\d+(CN|HK|DE200)$#';
     $is_eub_package_type = false;
     if (preg_match($p_real_ebayid, $orderid)) {
     } else {
         if (preg_match($p_trackno_eub, $orderid)) {
             $is_eub_package_type = true;
         } else {
             self::$errCode = "001";
             self::$errMsg = "订单号[" . $orderid . "]格式有误";
             return false;
         }
     }
     if ($is_eub_package_type === true) {
         $record = ShippingOrderModel::getShippingOrderInfo("b.*", "where a.tracknumber='{$orderid}' and a.is_delete=0");
     } else {
         $record = ShippingOrderModel::getShippingOrder("*", "where id='{$orderid}'");
     }
     //验证发货单号 以及所属状态
     if (!$record) {
         self::$errCode = 404;
         self::$errMsg = "发货单号不存在!";
         return false;
     }
     if ($record[0]['orderStatus'] != 404) {
         self::$errCode = 405;
         self::$errMsg = "此发货单不在待包装!";
         if ($record[0]['orderStatus'] == 900) {
             self::$errMsg = "此发货单已废弃!";
         }
         return false;
     }
     //挂号的单需要再输入挂号条码
     $carrier = CommonModel::getShipingNameById($record[0]['transportId']);
     $partion = CommonModel::getChannelNameByIds($record[0]['transportId'], $record[0]['countryName']);
     $total_num = 0;
     $skuinfos = get_realskunum($record[0]['id']);
     foreach ($skuinfos as $or_sku => $or_nums) {
         $total_num += $or_nums;
     }
     if (carrier == '中国邮政挂号' && !preg_match("/^(RA|RB|RC|RR)\\d+(CN)\$/", $tracknumber)) {
         self::$errCode = 111;
         self::$errMsg = "录入失败,中国邮政挂号跟踪码不符合规范";
         return false;
     }
     if ($carrier == '香港小包挂号' && !preg_match("/^(RA|RB|RC|RR)\\d+(HK)\$/", $tracknumber)) {
         self::$errCode = 111;
         self::$errMsg = "录入失败,香港小包挂号跟踪码不符合规范";
         return false;
     }
     $p_str = "挂号条码:" . "<font color='#FF0000'>" . $tracknumber . "</font> <br>";
     TransactionBaseModel::begin();
     //更新订单状态
     $msg = OmAvailableModel::updateTNameRow("wh_shipping_order", "set orderStatus=405", "where id={$record[0]['id']}");
     if (!$msg) {
         self::$errCode = 409;
         self::$errMsg = "更新发货单状态记录失败!";
         $arr['partion'] = $partion;
         $arr['carrier'] = $carrier;
         TransactionBaseModel::rollback();
         return json_encode($arr);
         exit;
     }
     //更新操作记录
     $msg = packingScanOrderModel::updateOrderRecord($record[0]['id'], $userId);
     if (!$msg) {
         self::$errCode = 406;
         self::$errMsg = "更新发货单操作记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     //插入包装记录
     $msg = packingScanOrderModel::insertPackingRecord($record[0]['id'], $userId);
     if (!$msg) {
         self::$errCode = 407;
         self::$errMsg = "插入包装记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     $msg = packingScanOrderModel::deleteTrackRecord($record[0]['id']);
     if (!$msg) {
         self::$errCode = 409;
         self::$errMsg = "删除跟踪记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     //录入挂号条码
     $msg = packingScanOrderModel::insertTrackRecord($tracknumber, $record[0]['id']);
     if (!$msg) {
         self::$errCode = 408;
         self::$errMsg = "插入包装记录失败!";
         TransactionBaseModel::rollback();
         return false;
     }
     WhPushModel::pushOrderStatus($record[0]['id'], 'STATESHIPPED_BEWEIGHED', $userId, time(), '', $tracknumber);
     //状态推送
     $arr['partion'] = "<font color='#FF0000'>该订单属于" . $partion . ";含SKU总数:" . $total_num . "个</font><br>";
     $arr['carrier'] = $carrier;
     $arr['res'] = $arr['partion'] . "包装人员:" . "<font color='green'>" . $_SESSION['userCnName'] . "</font><br>" . "运输方式:" . "<font color='#FF0000'>" . $carrier . "</font> <br>" . $p_str . "扫描结果:<font color='#33CC33'>包装扫描成功!</font>";
     TransactionBaseModel::commit();
     return $arr;
 }
Example #3
0
 public static function showPartionScan($shipOrderId, $accountId, $carrier, $countryName)
 {
     $sz_array = $sz_name_array = array();
     $account = CommonModel::getAccountNameById($accountId);
     $partions = CommonModel::getChannelNameByIds('all');
     foreach ($partions as $partion) {
         $sz_array[$partion['partitionCode']] = $partion['countries'];
         $sz_name_array[$partion['partitionCode']] = htmlspecialchars_decode($partion['partitionName']);
     }
     //匹配回邮地址信息
     $returnvalue = $carrier;
     foreach ($sz_array as $sz_key => $sz_value) {
         $sz_value_arr = explode("],[", $sz_value);
         $sz_value_arr[0] = str_replace("[", "", $sz_value_arr[0]);
         $sz_value_arr[count($sz_value_arr) - 1] = str_replace("]", "", $sz_value_arr[count($sz_value_arr) - 1]);
         if (!empty($countryName) && in_array(trim($countryName), $sz_value_arr)) {
             $returnvalue .= $sz_name_array[$sz_key];
             break;
         }
     }
     //增加因缺少国家直接为福七区的逻辑 add by guanyongjun 2014/03/07
     if (!in_array($countryName, array('Australia', 'Australla')) && empty($returnvalue)) {
         $returnvalue = $carrier . $sz_name_array[7];
     }
     return $returnvalue;
     // if(strpos($carrier, '中国邮政')!==false){
     // if(in_array(trim($countryName), array('Albania','Algeria','Argentina','Egypt','Ethiopia','Estonia','Anguilla','Austria','Bahrain','Panama','Belarus','Bulgaria','Benin','Belgium','Iceland','Bosnia and Herzegovina','Bolivia','Botswana','Burkina Faso','Burundi','Denmark','Togo','Dominica','Russian Federation','Ecuador','Falkland Islands(Malvinas)','Gambia','Colombia','Costa Rica','Greenland','Georgia','Guyana','Haiti','Djibouti','Guinea','Guinea','Ghana','Cambodia','Czech Republic','Zimbabwe','Cameroon','Qatar','Cote d Ivoire (Ivory Coast)','Kuwait','Kenya','Latvia','Lesotho','Laos','Lebanon','Lithuania','Liberia','Libya','Rwanda','Romania','Madagascar','Malta','Malawi','Mali','Mauritania','Mongolia','Bangladesh','Peru','Morocco','Mozambique','Namibia','Nepal','Niger','Nigeria','Palau','Portugal','Sweden','Senegal','Cyprus','Seychelles','Slovakia','Sudan','Suriname','Tanzania','Trinidad and Tobago','Tunisia','Turkey','Venezuela','Uganda','Uruguay','Western Sahara','Greece','Hungary','Syria','Jamaica','Armenia','Yemen','Iraq','Iran','India','Zambia','Zaire','Chad','Chile','Cuba,Republic of','Congo, Republic of the','Congo, Democratic Republic of the','Russia','Azerbaijan Republic','Azerbaijan','Dominica','Dominican Republic','Equatorial Guinea','Gabon Republic','Papua New Guinea')) || in_array($account, array('taotaocart','arttao','taochains','etaosky','tmallbasket','mucheer','lantao','direttao','hitao','taolink'))){
     // return $carrier.$sz_name_array[7];
     // }else{
     // $mailways = self::getOrderGoodsMailwayIds($shipOrderId);
     // if(in_array(2,$mailways) || in_array(5,$mailways) || in_array(trim($countryName), array('Saudi Arabia','Malaysia'))){
     // $returnvalue = $carrier;
     // foreach($sz_array as $sz_key => $sz_value){
     // $sz_value_arr = explode("],[",$sz_value);
     // $sz_value_arr[0] =  str_replace("[","",$sz_value_arr[0]);
     // $sz_value_arr[count($sz_value_arr)-1] = str_replace("]","",$sz_value_arr[count($sz_value_arr)-1]);
     // if(!empty($countryName) && in_array(trim($countryName),$sz_value_arr)){
     // $returnvalue .= $sz_name_array[$sz_key];
     // break;
     // }
     // }
     // return $returnvalue;
     // }else if(in_array(1,$mailways)){
     // return $carrier.$sz_name_array[7];
     // } else {
     // return $carrier.$sz_name_array[7];
     // }
     // }
     // }
 }