예제 #1
0
 /**
  * CommonModel::get_hsInfo()
  * 获取spu海关报关信息
  * @param mixed $spus
  * @author Gary
  * @return void
  */
 public static function get_hsInfo($spus)
 {
     $paramArr = array('method' => 'pc.getHscodeInfoBySpuArr', 'spuArr' => $spus);
     $res = UserCacheModel::callOpenSystem($paramArr);
     unset($paramArr);
     return $res;
 }
예제 #2
0
 public function view_getWhRecManageList()
 {
     $paramArr = array();
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $status = isset($_GET['status']) ? $_GET['status'] : '';
     $reStatus = isset($_GET['reStatus']) ? $_GET['reStatus'] : 0;
     $page = isset($_GET['page']) ? $_GET['page'] : 1;
     $paramArr['method'] = 'purchase.getPurchaseOrderList';
     //API名称
     $paramArr['page'] = $page;
     $paramArr['status'] = $reStatus;
     if ($type == 'search') {
         $keyWord = isset($_GET['keyWord']) ? post_check($_GET['keyWord']) : '';
         $select = isset($_GET['select']) ? post_check($_GET['select']) : 0;
         $cStartTime = isset($_GET['cStartTime']) ? post_check($_GET['cStartTime']) : '';
         $cEndTime = isset($_GET['cEndTime']) ? post_check($_GET['cEndTime']) : '';
         $eStartTime = isset($_GET['eStartTime']) ? post_check($_GET['eStartTime']) : '';
         $eEndTime = isset($_GET['eEndTime']) ? post_check($_GET['eEndTime']) : '';
         if (!empty($select)) {
             $paramArr['key'] = $keyWord;
             $paramArr['type'] = $select;
         }
         if (!empty($cStartTime)) {
             $startTime = strtotime($cStartTime . '00:00:00');
             $paramArr['addTime_start'] = $startTime;
         }
         if (!empty($cEndTime)) {
             $endTime = strtotime($cEndTime . '23:59:59');
             $paramArr['addTime_end'] = $endTime;
         }
         if (!empty($eStartTime)) {
             $startTime = strtotime($eStartTime . '00:00:00');
             $paramArr['auditTime_start'] = $startTime;
         }
         if (!empty($eEndTime)) {
             $endTime = strtotime($eEndTime . '23:59:59');
             $paramArr['auditTime_end'] = $endTime;
         }
     }
     $purchase_order = UserCacheModel::callOpenSystem($paramArr);
     $total = $purchase_order[0];
     $whRecManageList = $purchase_order[1];
     if (!empty($whRecManageList)) {
         $usermodel = UserModel::getInstance();
         $count = count($whRecManageList);
         for ($i = 0; $i < $count; $i++) {
             //仓库
             $storeId = empty($whRecManageList[$i]['warehouse_id']) ? 1 : $whRecManageList[$i]['warehouse_id'];
             $whName_info = WarehouseManagementModel::warehouseManagementModelList("where companyId=1 and id={$storeId}");
             $whRecManageList[$i]['whName'] = $whName_info[0]['whName'];
             $purchaseuser_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$whRecManageList[$i]['purchaseuser_id']}'", '', 'limit 1');
             $inventory_info[$i]['purchaseuser'] = $purchaseuser_info[0]['global_user_name'];
         }
     }
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     if (!empty($_GET['page'])) {
         if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
             $n = 1;
         } else {
             $n = (intval($_GET['page']) - 1) * $num + 1;
         }
     } else {
         $n = 1;
     }
     if ($total > $num) {
         //输出分页显示
         $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $show_page = $page->fpage(array(0, 2, 3));
     }
     $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '收货管理表'));
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '收货管理表');
     $this->smarty->assign('toplevel', 0);
     $this->smarty->assign('secondlevel', '09');
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('status', $status);
     $this->smarty->assign('whRecManageList', $whRecManageList);
     //循环列表
     $this->smarty->display("whRecManageList.htm");
 }
예제 #3
0
 /**
  * 备货单料号复核完成后,将配货数量同步到采购系统备货单
  * Enter description here ...
  * @param 备货单号 $ordersn
  * @param 料号 $sku
  * @param 数量 $num
  */
 public function updPurOrderQty($ordersn, $sku, $num)
 {
     $paramArr['method'] = 'ow_updBOrderAmount';
     //API名称
     $paramArr['ordersn'] = $ordersn;
     $paramArr['sku'] = $sku;
     $paramArr['amount'] = $num;
     $rtnInfo = UserCacheModel::callOpenSystem($paramArr);
     return $rtnInfo;
 }
예제 #4
0
 public function view_getskuStockList()
 {
     $type = isset($_GET['type']) ? $_GET['type'] : '';
     $searchContent = isset($_GET['searchContent']) ? $_GET['searchContent'] : '';
     $online = isset($_GET['online']) ? $_GET['online'] : '';
     $warehouse = isset($_GET['warehouse']) ? $_GET['warehouse'] : '';
     $isnew = isset($_GET['isnew']) ? $_GET['isnew'] : '';
     $pid_one = isset($_GET['pid_one']) ? $_GET['pid_one'] : '';
     $pid_two = isset($_GET['pid_two']) ? $_GET['pid_two'] : '';
     $pid_three = isset($_GET['pid_three']) ? $_GET['pid_three'] : '';
     $pid_four = isset($_GET['pid_four']) ? $_GET['pid_four'] : '';
     $skuStockAct = new SkuStockAct();
     $where = 'WHERE a.is_delete=0 ';
     if (!empty($online)) {
         $where .= "AND a.goodsStatus='{$online}' ";
         $this->smarty->assign('online', $online);
     }
     if (!empty($warehouse)) {
         $where .= "AND b.storeId='{$warehouse}' ";
         $this->smarty->assign('warehouse', $warehouse);
     }
     if (is_numeric($isnew)) {
         $where .= "AND a.isNew='{$isnew}' ";
         $this->smarty->assign('isnew', $isnew);
     }
     if (!empty($pid_four)) {
         $cate = $pid_one . "-" . $pid_two . "-" . $pid_three . "-" . $pid_four;
         $where .= "AND a.goodsCategory='{$cate}' ";
         $this->smarty->assign('pid_four', $pid_four);
         $this->smarty->assign('pid_three', $pid_three);
         $this->smarty->assign('pid_two', $pid_two);
         $this->smarty->assign('pid_one', $pid_one);
         $cate_four = $skuStockAct->act_getCategoryInfo($pid_three);
         $this->smarty->assign('cate_four', $cate_four);
         $cate_three = $skuStockAct->act_getCategoryInfo($pid_two);
         $this->smarty->assign('cate_three', $cate_three);
         $cate_two = $skuStockAct->act_getCategoryInfo($pid_one);
         $this->smarty->assign('cate_two', $cate_two);
     } else {
         if (!empty($pid_three)) {
             $cate = $pid_one . "-" . $pid_two . "-" . $pid_three;
             $where .= "AND a.goodsCategory='{$cate}' ";
             $this->smarty->assign('pid_three', $pid_three);
             $this->smarty->assign('pid_two', $pid_two);
             $this->smarty->assign('pid_one', $pid_one);
             $cate_three = $skuStockAct->act_getCategoryInfo($pid_two);
             $this->smarty->assign('cate_three', $cate_three);
             $cate_two = $skuStockAct->act_getCategoryInfo($pid_one);
             $this->smarty->assign('cate_two', $cate_two);
         } else {
             if (!empty($pid_two)) {
                 $cate = $pid_one . "-" . $pid_two;
                 $where .= "AND a.goodsCategory='{$cate}' ";
                 $this->smarty->assign('pid_two', $pid_two);
                 $this->smarty->assign('pid_one', $pid_one);
                 $cate_two = $skuStockAct->act_getCategoryInfo($pid_one);
                 $this->smarty->assign('cate_two', $cate_two);
             } else {
                 if (!empty($pid_one)) {
                     $where .= "AND a.goodsCategory='{$pid_one}' ";
                     $this->smarty->assign('pid_one', $pid_one);
                 }
             }
         }
     }
     switch ($type) {
         case '1':
             $spuinfo = OmAvailableModel::getTNameList("pc_goods", "sku", "where spu='{$searchContent}'");
             if (empty($spuinfo)) {
                 $skuinfo = get_realskuinfo($searchContent);
                 foreach ($skuinfo as $sku => $num) {
                     $sku_str .= "'" . $sku . "',";
                 }
                 $sku_str = trim($sku_str, ',');
                 $where .= "AND a.sku in (" . $sku_str . ") ";
             } else {
                 foreach ($spuinfo as $info) {
                     $sku_str .= "'" . $info['sku'] . "',";
                 }
                 $sku_str = trim($sku_str, ',');
                 $where .= "AND a.sku in (" . $sku_str . ") ";
             }
             break;
         case '2':
             $positionIds = SkuStockModel::getAllPositionIdByPName($searchContent);
             $pos = '';
             if (!empty($positionIds)) {
                 foreach ($positionIds as $positionId) {
                     $pos .= $positionId['id'] . ",";
                 }
             } else {
                 $pos = 0;
             }
             $pos = trim($pos, ',');
             $where .= "AND b.positionId in({$pos}) ";
             break;
         case '3':
             $where .= "AND a.goodsName='{$searchContent}' ";
             break;
         case '4':
             $purchaseId = getUserIdByName($searchContent);
             if (empty($purchaseId)) {
                 $purchaseId = 10000000;
             }
             $where .= "AND a.purchaseId='{$purchaseId}' ";
             break;
         case '5':
             $str = '';
             $Supplier_id = CommonModel::getPartnerByName($searchContent);
             $paramArr['method'] = 'pc.getSkuByPartnerId';
             //API名称
             $paramArr['pid'] = $Supplier_id;
             $Supplier_info = UserCacheModel::callOpenSystem($paramArr);
             if (!empty($Supplier_info['data'])) {
                 foreach ($Supplier_info['data'] as $info) {
                     $str .= "'" . $info . "',";
                 }
                 $str = trim($str, ",");
                 $str = "(" . $str . ")";
             } else {
                 $str = "('no')";
             }
             $where .= "AND a.sku in {$str} ";
             break;
         default:
             break;
     }
     $where .= "GROUP BY a.sku ";
     $total = $skuStockAct->act_getSkuStockCount($where);
     $num = 100;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $where .= "ORDER BY a.sku " . $page->limit;
     $skuStockList = $skuStockAct->act_getSkuStockList($where);
     if (!empty($_GET['page'])) {
         if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
             $n = 1;
         } else {
             $n = (intval($_GET['page']) - 1) * $num + 1;
         }
     } else {
         $n = 1;
     }
     if ($total > $num) {
         //输出分页显示
         $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $show_page = $page->fpage(array(0, 2, 3));
     }
     $navlist = array(array('url' => 'index.php?mod=skuStock&act=searchSku', 'title' => '库存管理'), array('url' => 'index.php?mod=skuStock&act=searchSku', 'title' => '货品搜索'));
     $usermodel = UserModel::getInstance();
     $count = count($skuStockList);
     for ($i = 0; $i < $count; $i++) {
         //$skuStockList[$i]['category'] = CommonModel::getCateInfoByPath($skuStockList[$i]['goodsCategory']);      //类别
         $user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$skuStockList[$i]['purchaseId']}'", '', 'limit 1');
         $skuStockList[$i]['pName'] = $user_info[0]['global_user_name'];
         //类别
         $skuStockList[$i]['cateName'] = SkuStockModel::getCategoryInfoByPath($skuStockList[$i]['goodsCategory']);
         //获取供应商
         $par['method'] = 'pc.getPartnerIdBySku';
         //API名称
         $par['sku'] = $skuStockList[$i]['sku'];
         $sku_pname = UserCacheModel::callOpenSystem($par);
         if (!empty($sku_pname['data'])) {
             $purchase = CommonModel::getPartnerByID($sku_pname['data']);
             $skuStockList[$i]['PartnerName'] = $purchase['username'];
         }
         //仓库
         if (!empty($skuStockList[$i]['storeId'])) {
             $whName_info = WarehouseManagementModel::warehouseManagementModelList("where companyId=1 and id={$skuStockList[$i]['storeId']}");
             $skuStockList[$i]['whName'] = $whName_info[0]['whName'];
         }
         //图片
         //$picUrl = getPicFromOpenSys($skuStockList[$i]['sku']);
         //$skuStockList[$i]['picUrl'] = $picUrl;
     }
     //仓库
     $whName = WarehouseManagementModel::warehouseManagementModelList("where companyId=1");
     $this->smarty->assign('whName', $whName);
     //类别
     $cate_f = SkuStockModel::getCategoryInfo(0);
     $this->smarty->assign('cate_f', $cate_f);
     $this->smarty->assign('type', $type);
     $this->smarty->assign('searchContent', $searchContent);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '库存信息列表');
     $this->smarty->assign('toplevel', 0);
     $this->smarty->assign('secondlevel', '01');
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('status', $status);
     $this->smarty->assign('skuStockList', $skuStockList ? $skuStockList : null);
     //循环列表
     $this->smarty->display("skuStock.htm");
 }
예제 #5
0
 /**
  * 海外仓料号入库判断料号状态,如果状态为暂时停售,自动修改为在线
  * time:2014-07-29
  * name:wangminwei
  */
 public static function getAndUpdOverseaSkuStatus($sku)
 {
     $paramArr['method'] = 'pur.AutoUpdOverseaSkuStatus';
     //API名称
     $paramArr['sku'] = $sku;
     $rtnInfo = UserCacheModel::callOpenSystem($paramArr);
     if (FALSE === $rtnInfo) {
         self::$errmsg = '请求开放系统出错!';
         return FALSE;
     }
     $code = isset($rtnInfo['code']) ? trim($rtnInfo['code']) : '';
     if ($code !== 'success') {
         self::$errmsg = $messageInfo['msg'];
         return FALSE;
     }
 }
예제 #6
0
            }
            $objPHPExcel->setActiveSheetIndex(0)->setCellValue($nn, $ispacking);
            //是否带包装
            $objPHPExcel->setActiveSheetIndex(0)->setCellValue($oo, "");
            //港币汇率
            $objPHPExcel->setActiveSheetIndex(0)->setCellValue($pp, $pmCost);
            //信封价格
            $row++;
        }
    }
}
$packingmaterialRow = 2;
//包材信息API接口调用方法
$para_path['method'] = 'pc.getPmInfoAll';
//API名称
$cate_info = UserCacheModel::callOpenSystem($para_path);
foreach ($cate_info['data'] as $keyName => $packingmaterial) {
    $qq = 'Q' . $packingmaterialRow;
    $rr = 'R' . $packingmaterialRow;
    $ss = 'S' . $packingmaterialRow;
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue($qq, $packingmaterial['pmName']);
    //包材规格
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue($rr, $packingmaterial['pmWeight']);
    //包材重量
    $objPHPExcel->setActiveSheetIndex(0)->setCellValue($ss, $packingmaterial['pmNotes']);
    //包材规格说明
    $packingmaterialRow++;
}
$start = strtotime(date("Y-m-d") . " 00:00:01");
$end = strtotime(date("Y-m-d") . " 23:59:59");
$title = "weightExport_" . date('Y-n-j', $end);