public function act_orderPartionPack() { $partion = isset($_POST['partion']) ? trim($_POST['partion']) : ""; $packageId = isset($_POST['packageid']) ? trim($_POST['packageid']) : ""; $userId = $_SESSION['userId']; $msg = orderPartionModel::selectPartionPack($packageId); if ($msg[0]['partion'] != $partion) { self::$errCode = 608; self::$errMsg = "选择的分区与扫描口袋的分区不匹配!"; return false; } TransactionBaseModel::begin(); $where = " where partion='{$partion}' and scanUserId={$userId} and packageid is null"; $data = orderPartionModel::selectData($where); if ($data[0]['totalNum'] == 0) { self::$errCode = 611; self::$errMsg = "已打包!"; return false; } $result1 = orderPartionModel::updatePartionRecord($partion, $userId, $packageId); if (!$result1) { self::$errCode = 609; self::$errMsg = "更新分区记录失败!"; TransactionBaseModel::rollback(); return false; } $result2 = orderPartionModel::updatePartionPack($packageId, $data[0]['totalNum'], $data[0]['totalWeight'], $userId); if (!$result1) { self::$errCode = 610; self::$errMsg = "更新口袋记录失败!"; TransactionBaseModel::rollback(); return false; } TransactionBaseModel::commit(); return true; }
public function view_pda_orderPartion() { //$this->smarty->template_dir = WEB_PATH.'pda/html/'; $userId = $_SESSION['userId']; $type = isset($_GET['type']) ? trim($_GET['type']) : ""; if ($type == "pack") { $this->smarty->assign("successLog", "打包成功!"); $this->smarty->assign("lists", array()); } if ($type == "scan") { $partion = isset($_GET['partion']) ? urldecode(trim($_GET['partion'])) : ""; $orderid = isset($_GET['orderid']) ? trim($_GET['orderid']) : ""; $where = " where partion='{$partion}' and scanUserId={$userId} and packageid is null"; $lists = orderPartionModel::selectData($where); $lists[0]['partion'] = $partion; $this->smarty->assign("successLog", "扫描成功!" . "(" . $orderid . ")"); $this->smarty->assign("orderid", $orderid); $this->smarty->assign("partion", $partion); $this->smarty->assign("lists", $lists); } /*$channel_list = $memc_obj->get_extral('trans_system_channelinfo'); //print_r($channel_list); $this->smarty->assign("channel_list",$channel_list); $partion_list = $memc_obj->get_extral('trans_system_carrierinfo'); foreach($partion_list as $key=> $value_arr){ foreach($value_arr as $key1=> $value){ $partion[$key1] = $value; $carrierId = $key; $carrier_list = $memc_obj->get_extral('trans_system_carrier'); //print_r($carrier_list); foreach($carrier_list as $carrier_value){ if($carrierId == $carrier_value['id']){ $partion[$key1]['carrierName'] = $carrier_value['carrierNameCn']; } } } } //print_r($partion); $this->smarty->assign("partion",$partion);*/ $where = " where scanUserId='{$userId}' and packageid is null"; $ret = orderPartionModel::selectUserPartion($where); /* foreach($ret as $key=>$ret_value){ foreach($partion_list as $key=> $value_arr){ foreach($value_arr as $key1=> $value){ if($ret_value['partionId']==$value['partionId']){ $ret[$key]['partionName'] = $value['partitionName']; } } } }*/ $toptitle = '分区扫描'; $this->smarty->assign('toptitle', $toptitle); $this->smarty->assign('action', $toptitle); $this->smarty->assign("partionuser", $ret); $this->smarty->display('pda_orderPartion.htm'); }