示例#1
0
 public static function getInstance()
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#2
0
 /**
  * 海外仓到货立方数
  */
 public function view_overSkuVolume()
 {
     global $mod, $act;
     $keyword = isset($_GET['keyword']) ? $_GET['keyword'] : '';
     $purwh = new PurToWhModel();
     $condition = '';
     if (!empty($keyword)) {
         $rtnCguserArr = $purwh->getCguserArrId($keyword);
         //获取可能匹配的采购员编号
         $cguserArr = '';
         if (!empty($rtnCguserArr)) {
             foreach ($rtnCguserArr as $k => $v) {
                 $cguserArr .= $v['global_user_id'] . ',';
             }
             $cguserArr = "(" . substr($cguserArr, 0, strlen($cguserArr) - 1) . ")";
         }
         if ($cguserArr != '') {
             $condition .= "AND (a.sku LIKE '%{$keyword}%' OR a.goodsName LIKE '%{$keyword}%' OR a.OverSeaSkuCharger IN {$cguserArr})";
         } else {
             $condition .= "AND (a.sku LIKE '%{$keyword}%' OR a.goodsName LIKE '%{$keyword}%')";
         }
     }
     $page = isset($_GET['page']) ? $_GET['page'] : '1';
     $listInfo = $purwh->getOverSeaSkuVolume($condition, $page);
     $perNum = 200;
     $totalNum = $listInfo["totalNum"];
     $list = $listInfo["goodsInfo"];
     $totalVolume = 0;
     if (!empty($list)) {
         foreach ($list as $k => $v) {
             $sku = $v['sku'];
             $length = $v['goodsLength'];
             $width = $v['goodsWidth'];
             $height = $v['goodsHeight'];
             $stock = $v['b_stock_cout'];
             $inboxqty = $v['inBoxQty'];
             $totalVolume += $length * $width * $height * ($stock + $inboxqty);
         }
         $totalVolume = round($totalVolume / 1000000, 3);
     }
     $allTotalVolume = $purwh->getTotalVolume();
     $pageobj = new Page($totalNum, $perNum);
     $pageStr = $pageobj->fpage();
     $this->smarty->assign('pageStr', $pageStr);
     //分页输出
     $this->smarty->assign('list', $list);
     //循环赋值*/
     $this->smarty->assign('title', '海外料号B仓库存立方数');
     $this->smarty->assign('mod', $mod);
     //模块权限
     $this->smarty->assign('totalVolume', $totalVolume);
     $this->smarty->assign('allTotalVolume', $allTotalVolume);
     $this->smarty->display('overSkuVolume.htm');
 }
示例#3
0
 public function batchAuit()
 {
     $data = !empty($_POST['dataArr']) ? $_POST['dataArr'] : '';
     $paytime = !empty($_POST['paytime']) ? $_POST['paytime'] : '';
     $payaway = !empty($_POST['paymethod']) ? $_POST['paymethod'] : '';
     $fee = !empty($_POST['fee']) ? $_POST['fee'] : '';
     if (empty($payaway) || empty($paytime) || empty($fee)) {
         $result['code'] = '402';
         $result['msg'] = '参数有误';
         return json_encode($result);
     }
     if (!empty($data)) {
         $orderArr = '';
         foreach ($data as $k => $v) {
             $ordersn = $v['ordersn'];
             $orderArr .= "'" . $ordersn . "',";
         }
         $orderArr = "(" . substr($orderArr, 0, strlen($orderArr) - 1) . ")";
         $rtnData = PurToWhModel::batchAuit($orderArr, $paytime, $payaway, $fee);
         if ($rtnData) {
             $result['code'] = '1';
             $result['msg'] = '审核成功';
             BaseModel::commit();
         } else {
             $result['code'] = '2';
             $result['msg'] = '审核失败';
             BaseModel::rollback();
         }
     } else {
         $result['code'] = '404';
         $result['msg'] = '没有数据';
     }
     return json_encode($result);
 }
示例#4
0
 /**
  *功能:更新订单
  *@param string  $_GET ['dataKey']  修改的字段名窜
  *@param string $_GET ["dataVal"] 修改的字段值窜
  *@return null
  * */
 public function save_all()
 {
     global $dbConn;
     $data = $_POST['data'];
     $dataSet = array2sql($data);
     $sql = "update ph_order set {$dataSet} where recordnumber='{$data['recordnumber']}'";
     if ($dbConn->execute($sql)) {
         PurToWhModel::updReceiptSupplier($data['recordnumber'], $data['partner_id']);
         //更新映射供应商到收货管理表
         return 1;
     } else {
         return 0;
     }
 }
示例#5
0
 public function view_exportOverSkuVolume()
 {
     $objPHPExcel = new PHPExcel();
     $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")->setLastModifiedBy("Maarten Balliauw")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '料号');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B1', '立方数(m)');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C1', 'B仓库存');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D1', '封箱库存');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E1', '采购员');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F1', '长');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('G1', '宽');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('H1', '高');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I1', '单位');
     $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J1', '描述');
     $keyword = isset($_GET['keyword']) ? $_GET['keyword'] : '';
     $purwh = new PurToWhModel();
     $condition = '';
     if (!empty($keyword)) {
         $rtnCguserArr = $purwh->getCguserArrId($keyword);
         //获取可能匹配的采购员编号
         $cguserArr = '';
         if (!empty($rtnCguserArr)) {
             foreach ($rtnCguserArr as $k => $v) {
                 $cguserArr .= $v['global_user_id'] . ',';
             }
             $cguserArr = "(" . substr($cguserArr, 0, strlen($cguserArr) - 1) . ")";
         }
         if ($cguserArr != '') {
             $condition .= "AND (a.sku LIKE '%{$keyword}%' OR a.goodsName LIKE '%{$keyword}%' OR a.OverSeaSkuCharger IN {$cguserArr})";
         } else {
             $condition .= "AND (a.sku LIKE '%{$keyword}%' OR a.goodsName LIKE '%{$keyword}%')";
         }
     }
     $listInfo = $purwh->exportOverSeaSkuVolume($condition);
     $totalVolume = 0;
     $row = 2;
     if (!empty($listInfo)) {
         foreach ($listInfo as $k => $v) {
             $sku = $v['sku'];
             $length = $v['goodsLength'];
             $width = $v['goodsWidth'];
             $height = $v['goodsHeight'];
             $stock = $v['b_stock_cout'];
             $inboxqty = $v['inBoxQty'];
             $name = $v['goodsName'];
             $cguserId = $v['OverSeaSkuCharger'];
             $cguser = getUserNameById($cguserId);
             $totalVolume = $length * $width * $height * ($stock + $inboxqty) / 1000000;
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . $row, $sku);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B' . $row, $totalVolume);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C' . $row, $stock);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('D' . $row, $inboxqty);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('E' . $row, $cguser);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('F' . $row, $length);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('G' . $row, $width);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('H' . $row, $height);
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I' . $row, 'cm');
             $objPHPExcel->setActiveSheetIndex(0)->setCellValue('J' . $row, $name);
             $row++;
         }
     }
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('A')->setWidth(15);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('B')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('C')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('D')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('E')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('F')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('G')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('H')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('I')->setWidth(10);
     $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('J')->setWidth(50);
     $objPHPExcel->getActiveSheet(0)->getStyle('A1:J' . $row)->getAlignment()->setWrapText(true);
     $title = "B仓海外料号库存立方表" . date('Y-m-d');
     $titlename = $title . ".xls";
     $objPHPExcel->getActiveSheet()->setTitle($title);
     $objPHPExcel->setActiveSheetIndex(0);
     header('Content-Type: application/vnd.ms-excel');
     header("Content-Disposition: attachment;filename={$titlename}");
     header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
     $objWriter->save('php://output');
 }