unknown пре 8 месеци
родитељ
комит
299568c170
1 измењених фајлова са 9 додато и 3 уклоњено
  1. 9 3
      application/api/controller/OrderSuperLoss.php

+ 9 - 3
application/api/controller/OrderSuperLoss.php

@@ -1303,8 +1303,9 @@ class OrderSuperLoss extends Api
             $number1 = (int)substr($data['yj_tlgg'],0,3);
             $number2 = (int)substr($data['yj_tlgg'],4,3);
             preg_match('/(\d+)g/',$data['yj_zzmc'], $matches);
-            if ($data['st_dw'] === '吨' && $data['mod_num'] == 0){
+            if ($data['st_dw'] === '吨'){
                 $data['投料'] = round(($data['投料']*1000*1000)/$matches[1]/($number1*$number2)*1000000);
+                $data['st_dw'] === '张';
             }
         }
 
@@ -1319,7 +1320,6 @@ class OrderSuperLoss extends Api
         $data['实际投料'] = str_replace(',', '', number_format($data['投料'] * $data['ls'] * $data['ks'] / 10000, 4));
         new WorkOrder();
         (new WorkOrder)->PlannedProcessYield($param['gdbh'],$param['yjno'],0,$data['实际投料']*10000/$data['ls']);
-
         //工单入仓数量
         $data['warehousing_num'] = $total_number[0];
         //截取工单末版的入仓时间
@@ -1459,7 +1459,8 @@ class OrderSuperLoss extends Api
                 'rtrim(c.sczl_gxmc) as gxmc', 'SUM(c.sczl_cl) as cl', 'SUM(c.sczl_fp) as fp', 'c.sczl_bh1 as sczl_bh',
                 'd.使用部门 as 使用部门', 'c.sczl_bzdh as bzdh', 'b.sczl_jtbh', 'a.损耗系数', 'a.Gy0_ms', 'a.Gy0_Rate0',
                 'a.Gy0_Rate1', 'a.无形损承担比例', 'a.Gy0_计划接货数*a.Gy0_ls*a.Gy0_ks as 计划产量', 'e.Gd_客户代号', 'e.Gd_客户名称',
-                'e.Gd_cpdh', 'e.Gd_cpmc', 'e.销售订单号', 'e.投料大箱', 'e.订单数量', 'e.计量单位', 'rtrim(a.Gy0_SITE) as Gy0_SITE'
+                'e.Gd_cpdh', 'e.Gd_cpmc', 'e.销售订单号', 'e.投料大箱', 'e.订单数量', 'e.计量单位', 'rtrim(a.Gy0_SITE) as Gy0_SITE',
+                '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')
@@ -1477,6 +1478,10 @@ 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'])) {
@@ -1491,6 +1496,7 @@ class OrderSuperLoss extends Api
                 $sumBz[$vv['sczl_bh1'].'-'.$vv['Gy0_gxh']] = $vv['total_cl'];
             }
         }
+
         foreach ($gy_data as $kk => $vv) {
             //每道工序的产量(按班组分)
             $gy_data[$kk]['total_cl'] = $vv['total_cl'] * $vv['Gy0_ls'] * $vv['Gy0_ks'];