|
|
@@ -1434,7 +1434,7 @@ class OrderSuperLoss extends Api
|
|
|
$total['reward'] = 0; //超节损奖励数组
|
|
|
//工单产量数据详情查询
|
|
|
$total_cl_data = \db('工单_工艺资料')->alias('a')
|
|
|
- ->field(['a.Gy0_yjno', 'a.Gy0_gxh', 'rtrim(a.Gy0_gxmc) as gxmc', 'a.Gy0_ls', 'SUM(b.sczl_cl) as total_cl', 'SUM(c.sczl_cl) as cl'])
|
|
|
+ ->field(['a.Gy0_yjno', 'a.Gy0_gxh', 'rtrim(a.Gy0_gxmc) as gxmc', 'a.Gy0_ls', 'SUM(b.sczl_cl) as total_cl', 'SUM(c.sczl_cl) as cl','rtrim(a.印刷方式) as 印刷方式','rtrim(a.版距) as 版距'])
|
|
|
->join('设备_产量计酬 b', 'a.Gy0_gdbh = b.sczl_gdbh AND a.Gy0_yjno = b.sczl_yjno AND a.Gy0_gxh = b.sczl_gxh', 'left')
|
|
|
->join('db_sczl c', 'a.Gy0_gdbh = c.sczl_gdbh AND a.Gy0_yjno = c.sczl_yjno AND a.Gy0_gxh = c.sczl_gxh', 'left')
|
|
|
->where([
|
|
|
@@ -1478,10 +1478,6 @@ class OrderSuperLoss extends Api
|
|
|
->select();
|
|
|
$sumBz = [];
|
|
|
foreach ($gy_data as $kk => $vv){
|
|
|
- $banju = $vv['版距']/1000;
|
|
|
- if ($vv['印刷方式'] === '卷对卷'){
|
|
|
- $vv['total_cl'] = $vv['total_cl']*$banju;
|
|
|
- }
|
|
|
//每道工序的产量(按班组分)
|
|
|
$vv['total_cl'] = $vv['total_cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
if (empty($vv['total_cl'])) {
|
|
|
@@ -1496,12 +1492,15 @@ class OrderSuperLoss extends Api
|
|
|
$sumBz[$vv['sczl_bh1'].'-'.$vv['Gy0_gxh']] = $vv['total_cl'];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
foreach ($gy_data as $kk => $vv) {
|
|
|
+ $banju = $vv['版距']/1000;
|
|
|
+ if ($vv['印刷方式'] === '卷对卷'){
|
|
|
+ $vv['total_cl'] = $vv['total_cl']*$banju;
|
|
|
+ }
|
|
|
//每道工序的产量(按班组分)
|
|
|
- $gy_data[$kk]['total_cl'] = $vv['total_cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
+ $gy_data[$kk]['total_cl'] = (int)$vv['total_cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
if (empty($vv['total_cl'])) {
|
|
|
- $gy_data[$kk]['total_cl'] = $vv['cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
+ $gy_data[$kk]['total_cl'] = (int)$vv['cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
}
|
|
|
$gy_data[$kk]['Gy0_计划损耗'] = $vv['Gy0_计划损耗'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
$vv['Gy0_计划损耗'] = $vv['Gy0_计划损耗'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|
|
|
@@ -1562,6 +1561,10 @@ class OrderSuperLoss extends Api
|
|
|
}
|
|
|
//工序产量
|
|
|
foreach ($total_cl_data as $k => $v) {
|
|
|
+ $banju1 = $v['版距']/1000;
|
|
|
+ if ($v['印刷方式'] === '卷对卷'){
|
|
|
+ $v['total_cl'] = $v['total_cl']*$banju1;
|
|
|
+ }
|
|
|
if ($v['Gy0_yjno'] === $vv['Gy0_yjno'] && $v['Gy0_gxh'] === $vv['Gy0_gxh']) {
|
|
|
if (strpos($v['gxmc'], '拆片') !== false) {
|
|
|
$gy_data[$kk]['工序产量'] = $v['cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];
|