|
@@ -1458,6 +1458,33 @@ class OrderSuperLoss extends Api
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 写入超节损核算结果(队列 OrderSuperLossJob / OrderLossQueueWorker 等调用)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $gdbh 工单编号
|
|
|
|
|
+ * @param string $yjno 印件号
|
|
|
|
|
+ * @param array $rows OneOrderSuperLoss 返回的行数据
|
|
|
|
|
+ * @return bool
|
|
|
|
|
+ */
|
|
|
|
|
+ public function saveSuperLossResult($gdbh, $yjno, array $rows)
|
|
|
|
|
+ {
|
|
|
|
|
+ $gdbh = trim((string)$gdbh);
|
|
|
|
|
+ $yjno = trim((string)$yjno);
|
|
|
|
|
+ if ($gdbh === '' || $yjno === '' || empty($rows)) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ db('工单_质量考核汇总')
|
|
|
|
|
+ ->where('Gy0_gdbh', $gdbh)
|
|
|
|
|
+ ->where('印件及工序', $yjno)
|
|
|
|
|
+ ->delete();
|
|
|
|
|
+
|
|
|
|
|
+ $sql = db('工单_质量考核汇总')->fetchSql(true)->insertAll($rows);
|
|
|
|
|
+ $res = db()->query($sql);
|
|
|
|
|
+
|
|
|
|
|
+ return $res !== false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 超节损列表
|
|
* 超节损列表
|
|
@@ -1675,7 +1702,6 @@ class OrderSuperLoss extends Api
|
|
|
$list['target_rate'] = number_format($list['target_rate'],2);
|
|
$list['target_rate'] = number_format($list['target_rate'],2);
|
|
|
$list['target_rate'] = $list['target_rate'].'%';
|
|
$list['target_rate'] = $list['target_rate'].'%';
|
|
|
//实际合格率
|
|
//实际合格率
|
|
|
-// $list['real_rate'] = $list['warehousing_num']/($list['实际投料']*$Multiple)*100;
|
|
|
|
|
$list['real_rate'] = $list['warehousing_num']/($list['实际投料'])*100;
|
|
$list['real_rate'] = $list['warehousing_num']/($list['实际投料'])*100;
|
|
|
$list['real_rate'] = number_format($list['real_rate'],2);
|
|
$list['real_rate'] = number_format($list['real_rate'],2);
|
|
|
$list['real_rate'] = $list['real_rate'].'%';
|
|
$list['real_rate'] = $list['real_rate'].'%';
|
|
@@ -1825,7 +1851,7 @@ class OrderSuperLoss extends Api
|
|
|
$list['target_rate'] = number_format($list['target_rate'],2);
|
|
$list['target_rate'] = number_format($list['target_rate'],2);
|
|
|
$list['target_rate'] = $list['target_rate'].'%';
|
|
$list['target_rate'] = $list['target_rate'].'%';
|
|
|
//实际合格率
|
|
//实际合格率
|
|
|
-// $list['real_rate'] = $list['warehousing_num']/($list['实际投料']*$Multiple)*100;
|
|
|
|
|
|
|
+
|
|
|
$list['real_rate'] = $list['warehousing_num']/($list['实际投料'])*100;
|
|
$list['real_rate'] = $list['warehousing_num']/($list['实际投料'])*100;
|
|
|
$list['real_rate'] = number_format($list['real_rate'],2);
|
|
$list['real_rate'] = number_format($list['real_rate'],2);
|
|
|
$list['real_rate'] = $list['real_rate'].'%';
|
|
$list['real_rate'] = $list['real_rate'].'%';
|