示例#1
0
 function act_getPageNum($where)
 {
     //调用model层获取数据
     $list = IqcCompleteInfoModel::getPageNum($where);
     if ($list) {
         return $list;
     } else {
         self::$errCode = WhStandardModel::$errCode;
         self::$errMsg = WhStandardModel::$errMsg;
         return false;
     }
 }
示例#2
0
 /**
  * 插入一条记录
  * @para $data as array
  * return insert_id
  */
 public static function insertRow($data)
 {
     self::initDB();
     $sql = array2sql($data);
     $sql = "INSERT INTO `" . self::$table . "` SET " . $sql;
     $query = self::$dbConn->query($sql);
     if ($query) {
         $insertId = self::$dbConn->insert_id();
         return $insertId;
     } else {
         self::$errCode = "003";
         self::$errMsg = "error";
         return false;
     }
 }
示例#3
0
 public function act_getLastDetector()
 {
     $spuArr = $_GET['spuArr'];
     $spus = json_decode($spuArr, true);
     if (empty($spus)) {
         self::$errCode = 101;
         self::$errMsg = '未获取spu信息';
         return false;
     }
     if (!is_array($spus)) {
         self::$errCode = 102;
         self::$errMsg = '产品spu不是数组';
         return false;
     }
     $detectIdArr = array();
     foreach ($spus as $spu) {
         $where = " WHERE sku like '{$spu}%' ORDER BY checkTime DESC ";
         $detectInfoList = IqcCompleteInfoModel::iqcCompleteInfo($where);
         if ($detectInfoList) {
             foreach ($detectInfoList as $detectInfo) {
                 if (preg_match("/^{$spu}(_[0-9A-Z])*\$/", $detectInfo['sku'])) {
                     $detectIdArr[$spu] = $detectInfo['checkUser'];
                     break;
                 }
             }
         }
     }
     if (!empty($detectIdArr)) {
         self::$errCode = 200;
         self::$errMsg = '成功获取检测人';
         return $detectIdArr;
     } else {
         self::$errCode = 103;
         self::$errMsg = '未获取检测人信息';
         return false;
     }
 }
示例#4
0
 function act_whRegularInspection()
 {
     $data = array();
     $sku = $_POST['sku'];
     $spu = $_POST['spu'];
     $check_num = $_POST['check_num'];
     $checkTypeID = 2;
     $skuName = $_POST['skuName'];
     $reNum = $_POST['reNum'];
     $type = $_POST['type'];
     $sampleTypeId = $_POST['sampleTypeId'];
     if ($type == 1) {
         $rejects_num = $_POST['rejects_num'];
         $bad_reason = post_check($_POST['bad_reason']);
         $set = "SET sku='{$sku}',spu='{$spu}',defectiveNum='{$rejects_num}',note='{$bad_reason}',startTime=" . time() . " ";
         /*
          * 插入不良品库表qc_sample_defective_products
          */
         $res = DefectiveProductsModel::addDefectiveProducts($set);
         if ($res) {
             $data = array('sku' => $sku, 'goodsName' => $skuName, 'arrivalNum' => $reNum, 'checkNum' => $check_num, 'rejectsNum' => $rejects_num, 'rejectsReason' => $bad_reason, 'checkUser' => $_SESSION['sysUserId'], 'checkTime' => time(), 'skuTypeCheckID' => $sampleTypeId, 'checkTypeID' => 2, 'sellerId' => 1);
             /*
              * 插入完成记录表qc_work_table
              */
             $workTabl = IqcCompleteInfoModel::insertRow($data);
             if ($workTabl) {
                 /*
                  * 更新老ERP系统库存接口
                  */
                 $oldErp = UserCacheModel::qccenterUpdateErpGoodscount($sku, $rejects_num);
                 if ($oldErp) {
                     self::$errCode = "200";
                     self::$errMsg = "提交成功,库存扣除成功,请检测下一料号!";
                     return $oldErp;
                 } else {
                     self::$errCode = "4444";
                     self::$errMsg = "qc检测不良品扣除ERP库存失败!请联系IT解决!";
                     return false;
                 }
             } else {
                 self::$errCode = "003";
                 self::$errMsg = "提交失败,请重试";
                 return false;
             }
             /*测试用
             		$oldErp =	IqcCompleteInfoModel::insertRow($data);
             		if($oldErp){
             			self::$errCode = "200";
             			self::$errMsg  = "提交成功,请检测下一料号";
             			return $oldErp;	
             		}else{
             			self::$errCode = "4444";
             			self::$errMsg  = "qc检测不良品扣除ERP库存失败!请联系IT解决!";
             			return false;
             		}	
             		*/
         } else {
             self::$errCode = "003";
             self::$errMsg = "提交失败,请重试";
             return false;
         }
     } else {
         if ($type == 2) {
             /*
              * 插入完成记录表qc_work_table
              */
             $data = array('sku' => $sku, 'goodsName' => $skuName, 'arrivalNum' => $reNum, 'checkNum' => $check_num, 'rejectsNum' => 0, 'checkUser' => $_SESSION['sysUserId'], 'checkTime' => time(), 'skuTypeCheckID' => $sampleTypeId, 'checkTypeID' => 2, 'sellerId' => 1);
             /*
              * 插入完成记录表qc_work_table
              */
             if (IqcCompleteInfoModel::insertRow($data)) {
                 self::$errCode = "200";
                 self::$errMsg = "提交成功,请检测下一料号";
                 return true;
             } else {
                 self::$errCode = "003";
                 self::$errMsg = "提交失败,请重试";
                 return false;
             }
         }
     }
 }