|
@@ -1298,17 +1298,21 @@ class OrderSuperLoss extends Api
|
|
|
})
|
|
})
|
|
|
->field($field)
|
|
->field($field)
|
|
|
->find();
|
|
->find();
|
|
|
|
|
+
|
|
|
if ($data['投料'] == null){
|
|
if ($data['投料'] == null){
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
if (!empty($data['yj_tlgg'])){
|
|
if (!empty($data['yj_tlgg'])){
|
|
|
$number1 = (int)substr($data['yj_tlgg'],0,3);
|
|
$number1 = (int)substr($data['yj_tlgg'],0,3);
|
|
|
$number2 = (int)substr($data['yj_tlgg'],4,3);
|
|
$number2 = (int)substr($data['yj_tlgg'],4,3);
|
|
|
- preg_match('/(\d+)g/',$data['yj_zzmc'], $matches);
|
|
|
|
|
- if ($data['st_dw'] === '吨'){
|
|
|
|
|
- $data['投料'] = round(($data['投料']*1000*1000)/$matches[1]/($number1*$number2)*1000000);
|
|
|
|
|
- $data['st_dw'] === '张';
|
|
|
|
|
|
|
+ if ($number1 !== 0 && $number2 !== 0) {
|
|
|
|
|
+ preg_match('/(\d+)g/',$data['yj_zzmc'], $matches);
|
|
|
|
|
+ if ($data['st_dw'] === '吨'){
|
|
|
|
|
+ $data['投料'] = round(($data['投料']*1000*1000)/$matches[1]/($number1*$number2)*1000000);
|
|
|
|
|
+ $data['st_dw'] === '张';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//将开数、联数为0重新赋值
|
|
//将开数、联数为0重新赋值
|
|
@@ -1318,6 +1322,7 @@ class OrderSuperLoss extends Api
|
|
|
if ($data['ks'] == 0) {
|
|
if ($data['ks'] == 0) {
|
|
|
$data['ks'] === 1;
|
|
$data['ks'] === 1;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//计算工单实际投料
|
|
//计算工单实际投料
|
|
|
$data['实际投料'] = str_replace(',', '', number_format($data['投料'] * $data['ls'] * $data['ks'] / 10000, 4));
|
|
$data['实际投料'] = str_replace(',', '', number_format($data['投料'] * $data['ls'] * $data['ks'] / 10000, 4));
|
|
|
new WorkOrder();
|
|
new WorkOrder();
|