unknown 1 місяць тому
батько
коміт
d2b724c5dc
1 змінених файлів з 376 додано та 201 видалено
  1. 376 201
      application/api/controller/CostAccounting.php

+ 376 - 201
application/api/controller/CostAccounting.php

@@ -907,218 +907,393 @@ class CostAccounting extends Api
         }
     }
 
+    /**
+     * 获取各车间人工分摊因子比例
+     * @param string $month 年月
+     * @return array
+     */
+    protected function WageRatio($month)
+    {
+        try {
+            // 使用一次查询获取所有需要的数据
+            $result = db('成本v23_月度成本明细')
+                ->where('sys_ny', $month)
+                ->whereNotNull('车间名称')
+                ->field('
+                    SUM(人工分摊因子) as total,
+                    rtrim(车间名称) as workshop_name,
+                    SUM(人工分摊因子) as workshop_total
+                ')
+                ->group('车间名称')
+                ->select();
 
+            if (empty($result)) {
+                return [];
+            }
 
+            // 计算总人工分摊因子
+            $total = array_sum(array_column($result, 'workshop_total'));
 
-    //计算成本
-//    public function CostCalculation()
-//    {
-//        if ($this->request->isGet() === false) {
-//            $this->error('请求错误');
-//        }
-//        $param = $this->request->param();
-//        if (empty($param)) {
-//            $this->error('参数错误');
-//        }
-//        //查询工单数据
-//        $list = db('成本v23_月度成本明细')
-//            ->field('车间名称,sys_ny as 年月,sczl_gdbh as 工单编号,sczl_yjno as 印件号,sczl_gxh as 工序号,工序名称,sczl_jtbh as jtbh,
-//            占用机时,计件产量,sczl_ms as 墨色数,Uniqid,计件产量*sczl_ms as 色度数')
-//            ->where('sys_ny', $param['month'])
-//            ->whereNotNull('车间名称')
-//            ->select();
-//        //查询整月全车间色度数之和
-//        $ChromaticityCount = db('成本v23_月度成本明细')
-//            ->where('sys_ny', $param['month'])
-//            ->whereNotNull('车间名称')
-//            ->column('sum(计件产量*sczl_ms)');
-//        //查询整月各车间色度数
-//        $MachineChromaticityCount = db('成本v23_月度成本明细')
-//            ->where('sys_ny', $param['month'])
-//            ->whereNotNull('车间名称')
-//            ->group('车间名称')
-//            ->column('sum(计件产量*sczl_ms)');
-//        //计算车间水电气
-//        $res = $this->ApportionmentOne($param['month']);
-//        halt($res);
-//
-//
-//
-//    }
-//    //计算水电气分摊费用
-//    protected function ApportionmentOne($month)
-//    {
-//        $list = db('成本_各月水电气')
-//            ->where('Sys_ny', $month)
-//            ->where('费用类型','like','%分摊%')
-//            ->select();
-//        foreach ($list as $k => $v) {
-//            if ($v['科目名称'] == '待分摊总额') {
-//                $money = $v['耗电量'] * $v['单位电价'];
-//                $data = $this->MachineTime($v['部门名称'],$month);
-//                foreach ($data['machine'] as $k1 => $v1) {
-//                    $data['machine'][$k1]['分摊水电'] = round($money*($v1['占用机时']/$data['sist']),2) ;
-//                }
-//            }elseif (strpos($v['科目名称'],'废气处理') !== false) {
-//                $electricityMoney = $v['耗电量'] * $v['单位电价'];
-//                $gasMoney = $v['耗气量'] * $v['单位气价'];
-//                $data = $this->MachineTime('03、卷凹机组',$month);
-//                foreach ($data['machine'] as $k1 => $v1) {
-//                    $data['machine'][$k1]['分摊水电'] = round($electricityMoney*($v1['占用机时']/$data['sist']),2) ;
-//                    $data['machine'][$k1]['废气处理'] = round($gasMoney*($v1['占用机时']/$data['sist']),2) ;
-//                }
-//            }elseif (strpos($v['科目名称'],'锅炉') !== false && strpos($v['科目名称'],'热水锅炉') === false) {
-//                $electricityMoney = $v['耗电量'] * $v['单位电价'];
-//                $gasMoney = $v['耗气量'] * $v['单位气价'];
-//                $data = $this->MachineTime('03、卷凹机组',$month);
-//                foreach ($data['machine'] as $k1 => $v1) {
-//                    $data['machine'][$k1]['分摊水电'] = round($electricityMoney*($v1['占用机时']/$data['sist']),2) ;
-//                    $data['machine'][$k1]['锅炉'] = round($gasMoney*($v1['占用机时']/$data['sist']),2) ;
-//                }
-//            }elseif (strpos($v['科目名称'],'空压机A') !== false) {
-//                $money = $v['耗电量'] * $v['单位电价'];
-//                $sistList = ['凹丝印车间','胶印车间','印后车间','检验车间'];
-//                $data = $this->MachineTime($sistList,$month);
-//                foreach ($data['machine'] as $k1 => $v1) {
-//                    $data['machine'][$k1]['空压机A'] = round($money*($v1['占用机时']/$data['sist']),2) ;
-//                }
-//            }elseif (strpos($v['科目名称'],'空压机B') !== false) {
-//                $money = $v['耗电量'] * $v['单位电价'];
-//                $sistList = ['凹丝印车间','胶印车间','印后车间','检验车间'];
-//                $data = $this->MachineTime($sistList,$month);
-//                foreach ($data['machine'] as $k1 => $v1) {
-//                    $data['machine'][$k1]['空压机B'] = round($money*($v1['占用机时']/$data['sist']),2) ;
-//                }
-//            }elseif (strpos($v['科目名称'],'热水锅炉') !== false){
-//                $money = $v['耗电量'] * $v['单位电价'];
-//                $sistList = ['凹丝印车间','胶印车间','印后车间','检验车间'];
-//                $data = $this->MachineTime($sistList,$month);
-//                foreach ($data['machine'] as $k1 => $v1) {
-//                    $data['machine'][$k1]['热水锅炉'] = round($money*($v1['占用机时']/$data['sist']),2) ;
-//                }
-//            }
-//        }
-//    }
-//
-//    //查询车间全部机台通电机时数据
-//    protected function MachineTime($sist,$month)
-//    {
-//        $where['a.sys_ny'] = $month;
-//        $where['b.sys_sbID'] = ['<>',''];
-//        if (is_array($sist)) {
-//            $where['a.车间名称'] = ['in',$sist];
-//        }else{
-//            if (strpos($sist,'机组') !== false) {
-//                $where['b.设备编组'] = $sist;
-//            }elseif (strpos($sist,'车间') !== false) {
-//                $where['a.车间名称'] = $sist;
-//            }
-//        }
-//        //查询各个工单工艺通电时间
-//        $machine = db('成本v23_月度成本明细')
-//            ->alias('a')
-//            ->join('设备_基本资料 b', 'a.sczl_jtbh = b.设备编号','left')
-//            ->field('a.sczl_gdbh as 工单编号,a.sczl_yjno as 印件号,a.sczl_gxh as 工序号,a.sczl_jtbh as 机台编号,a.占用机时,a.Uniqid')
-//            ->where($where)
-//            ->select();
-//        //查询各个车间通电总时长
-//        $sist = db('成本v23_月度成本明细')
-//            ->alias('a')
-//            ->join('设备_基本资料 b', 'a.sczl_jtbh = b.设备编号','left')
-//            ->where($where)
-//            ->value('sum(a.占用机时) as 占用机时');
-//        $data = [
-//            'machine' => $machine,
-//            'sist' => $sist
-//        ];
-//        return $data;
-//    }
+            // 计算每个车间的比例
+            $data = [];
+            foreach ($result as $item) {
+                if ($total > 0) {
+                    $data[$item['workshop_name']] = number_format($item['workshop_total'] / $total, 2);
+                } else {
+                    $data[$item['workshop_name']] = 0;
+                }
+            }
+
+            return $data;
+        } catch (\Exception $e) {
+            // 记录日志
+            \think\facade\Log::error('WageRatio计算失败: ' . $e->getMessage());
+            return [];
+        }
+    }
+
+    /**
+     * 获取指定部门各月的色度数数据
+     * @param string $month 年月
+     * @param string $sist 部门
+     * @return array
+     */
+    protected function WageRatioMonth($month, $sist)
+    {
+        try {
+            // 使用一次查询获取数据和总数
+            $query = db('成本_各月色度数')
+                ->where(['年月' => $month, '部门' => $sist]);
+
+            // 计算总数
+            $total = $query->value('SUM(sczl_cl * CASE 
+                WHEN sczl_ms = 0 OR sczl_ms IS NULL OR sczl_ms = \'\' THEN 1 
+                ELSE sczl_ms 
+            END)');
+
+            // 获取列表数据
+            $list = $query->field("
+                sczl_gdbh,
+                sczl_yjno,
+                sczl_gxh,
+                sczl_jtbh,
+                sczl_cl,
+                CASE 
+                    WHEN sczl_ms = 0 OR sczl_ms IS NULL OR sczl_ms = '' 
+                    THEN 1 
+                    ELSE sczl_ms 
+                END as sczl_ms
+            ")->select();
+
+            return [
+                'total' => $total ?: 0, // 防止空值
+                'list' => $list ?: [],  // 防止空值
+            ];
+        } catch (\Exception $e) {
+            \think\facade\Log::error('WageRatioMonth查询失败: ' . $e->getMessage());
+            return ['total' => 0, 'list' => []];
+        }
+    }
+
+    /**
+     * 计算工资分配
+     * @param string $month 年月
+     * @param string $sist 部门
+     * @param float $ratio 比例
+     * @param string $type 类型
+     * @param float $amount 金额
+     * @return array
+     */
+    protected function WageRatioCalculation($month, $sist, $ratio, $type, $amount)
+    {
+        try {
+            $data = [];
+            $chromaNumber = $this->WageRatioMonth($month, $sist);
+
+            if (empty($chromaNumber['list']) || $chromaNumber['total'] == 0) {
+                return [];
+            }
+
+            $money = $ratio * $amount;
+            $name = $type === '部门人员工资' ? '车间人工' : '部门人工附加';
+
+            foreach ($chromaNumber['list'] as $item) {
+                if ($chromaNumber['total'] > 0) {
+                    $perAmount = ($item['sczl_cl'] * $item['sczl_ms'] / $chromaNumber['total']) * $money;
+                    $data[] = [
+                        'name' => $name,
+                        'money' => round($perAmount, 2),
+                        'sczl_gdbh' => $item['sczl_gdbh'],
+                        'sczl_yjno' => $item['sczl_yjno'],
+                        'sczl_gxh' => $item['sczl_gxh'],
+                        'sczl_jtbh' => $item['sczl_jtbh'],
+                    ];
+                }
+            }
+
+            return $data;
+        } catch (\Exception $e) {
+            \think\facade\Log::error('WageRatioCalculation计算失败: ' . $e->getMessage());
+            return [];
+        }
+    }
+
+    /**
+     * 工资费用分配主函数(优化版)
+     */
+    public function WageExpensesList()
+    {
+
+        // 参数验证
+        if (!$this->request->isGet()) {
+            throw new \Exception('请求错误,仅支持GET请求');
+        }
+
+        $param = $this->request->param();
+        if (empty($param) || !isset($param['month'])) {
+            throw new \Exception('参数错误,缺少必要参数');
+        }
+
+        $month = trim($param['month']);
+
+        // 获取工资比例
+        $wageRatio = $this->WageRatio($month);
+        if (empty($wageRatio)) {
+            throw new \Exception('未找到该月的人工分摊因子数据');
+        }
+
+        // 获取月度工资数据
+        $monthWage = db('成本_各月其他费用')
+            ->where('sys_ny', $month)
+            ->field('部门人员工资,管理人员工资')
+            ->find();
+
+        if (empty($monthWage)) {
+            throw new \Exception('未找到该月的工资数据');
+        }
+
+        // 准备批量更新数据
+        $updateData = [];
+        $updateCount = 0;
+
+        // 遍历所有车间
+        foreach ($wageRatio as $workshopName => $ratio) {
+            // 计算两种类型的工资分配
+            $updateTypes = [
+                '部门人员工资' => '车间人工',
+                '管理人员工资' => '部门人工附加'
+            ];
+
+            foreach ($updateTypes as $wageType => $fieldName) {
+                if (!isset($monthWage[$wageType])) {
+                    continue;
+                }
+
+                $calculatedData = $this->WageRatioCalculation(
+                    $month,
+                    $workshopName,
+                    $ratio,
+                    $wageType,
+                    $monthWage[$wageType]
+                );
+
+                // 收集更新数据
+                foreach ($calculatedData as $item) {
+                    if (!empty($item['sczl_gdbh'])) {
+                        // 构建唯一标识作为更新条件
+                        $conditions = [
+                            'sczl_gdbh' => $item['sczl_gdbh'],
+                            'sczl_gxh' => $item['sczl_gxh'] ?? null,
+                            'sczl_jtbh' => $item['sczl_jtbh'] ?? null,
+                            'sczl_yjno' => $item['sczl_yjno'] ?? null,
+                        ];
+
+                        // 生成唯一标识字符串
+                        $uniqCondition = http_build_query(array_filter($conditions));
+
+                        $updateData[] = [
+                            'condition' => $uniqCondition, // 用于去重的条件
+                            'conditions' => $conditions,   // 实际查询条件
+                            'field' => $item['name'],
+                            'value' => $item['money'],
+                            'month' => $month
+                        ];
+                        $updateCount++;
+                    }
+                }
+            }
+        }
+
+        // 批量更新
+        $updatedRows = $this->batchUpdateData($updateData,$month);
+
+        // 返回成功结果
+        return json([
+            'code' => 200,
+            'msg' => '工资分配完成',
+            'data' => [
+                'updated_rows' => $updatedRows,
+                'update_count' => $updateCount,
+                'workshop_count' => count($wageRatio)
+            ]
+        ]);
+    }
+
+    /**
+     * 批量更新数据(原生SQL版本)
+     * @param array $updateData 更新数据
+     * @param string $month 月份
+     * @return int 更新的行数
+     */
+    private function batchUpdateData(array $updateData, string $month)
+    {
+        if (empty($updateData)) {
+            return 0;
+        }
+
+        $updatedRows = 0;
+
+        // 按字段分组
+        $groupedData = [];
+        foreach ($updateData as $item) {
+            $field = $item['field'];
+            $groupedData[$field][] = $item;
+        }
+
+        // 对每个字段进行批量更新
+        foreach ($groupedData as $field => $items) {
+
+                // 构建CASE WHEN语句
+                $caseWhens = [];
+                $gdbhList = [];
+
+                foreach ($items as $item) {
+                    $baseCondition = "sczl_gdbh = '{$item['conditions']['sczl_gdbh']}'";
+
+                    // 添加其他可选条件
+                    $conditions = [$baseCondition];
+
+                    if (!empty($item['conditions']['sczl_gxh'])) {
+                        $conditions[] = "sczl_gxh = '{$item['conditions']['sczl_gxh']}'";
+                    }
+                    if (!empty($item['conditions']['sczl_jtbh'])) {
+                        $conditions[] = "sczl_jtbh = '{$item['conditions']['sczl_jtbh']}'";
+                    }
+                    if (!empty($item['conditions']['sczl_yjno'])) {
+                        $conditions[] = "sczl_yjno = '{$item['conditions']['sczl_yjno']}'";
+                    }
+
+                    $whenCondition = implode(' AND ', $conditions);
+                    $caseWhens[] = "WHEN {$whenCondition} THEN {$item['value']}";
+
+                    $gdbhList[] = $item['conditions']['sczl_gdbh'];
+                }
+
+                if (empty($caseWhens)) {
+                    continue;
+                }
+
+                // 去重
+                $gdbhList = array_unique($gdbhList);
+                $gdbhStr = implode("','", $gdbhList);
+                $caseStr = implode(' ', $caseWhens);
+
+                // 构建SQL
+                $sql = "UPDATE 成本v23_月度成本明细 
+                   SET {$field} = CASE {$caseStr} ELSE {$field} END 
+                   WHERE sczl_gdbh IN ('{$gdbhStr}') AND sys_ny = '{$month}'";
+
+                // 执行SQL
+                $result = db()->execute($sql);
+                $updatedRows += $result;
+
+            }
+
+        return $updatedRows;
+    }
 
+    /**
+     * 获取工资分配详情(调试用)
+     */
+    public function getWageDistributionDetail($month)
+    {
+        $wageRatio = $this->WageRatio($month);
+        $distribution = [];
+
+        foreach ($wageRatio as $workshop => $ratio) {
+            $distribution[$workshop] = [
+                'ratio' => $ratio,
+                'data' => $this->WageRatioMonth($month, $workshop)
+            ];
+        }
+
+        return $distribution;
+    }
 
 
-    //查询各月工单数据
-//    public function setMonthWorkOrder()
+    //获取工单编号
+    public function getmonthWorkorderList($month)
+    {
+        $worderList = db('成本v23_月度成本明细')
+            ->alias('a')
+            ->join('工单_印件资料 b','a.sczl_gdbh = b.Yj_Gdbh and a.sczl_yjno = b.yj_Yjno')
+            ->join('物料_收发记录 c', 'a.sczl_gdbh = c.st_gdbh and b.yj_Yjdh = c.cpdh')
+            ->field('a.sczl_gdbh,a.sczl_yjno,c.st_wlbh,rtrim(c.st_jylb) as st_jylb,c.仓库编号,c.st_jtbh,
+            rtrim(c.cpdh) as cpdh,c.领用单价,c.st_oldSl,c.Uniqid')
+            ->group('a.sczl_gdbh,cpdh,c.st_wlbh,c.Uniqid')
+            ->where('a.sys_ny', $month)
+            ->where('c.领用单价','<>',0)
+            ->select();
+        $data = [];
+        foreach ($worderList as $item) {
+            if (preg_match("/[A-Za-z]/", $item['仓库编号'])) {
+                $sist = $item['仓库编号'];
+            } else {
+                $sist = 'Y' . $item['仓库编号'];
+            }
+            if (!isset($data[$sist])) {
+                $data[$sist] = [];
+            }
+            $data[$sist][] = [
+                'gdbh' => $item['sczl_gdbh'],
+                'yjno' => $item['sczl_yjno'],
+                'st_wlbh' => $item['st_wlbh'],
+                'jtbh' => $item['st_jtbh'],
+                'cpdh' => $item['cpdh'],
+                'price' => $item['领用单价'],
+                'st_sl' => $item['st_oldSl'],
+                'Uniqid' => $item['Uniqid']
+            ];
+        }
+        halt($data);
+    }
+
+    //获取分摊材料数据
+//    public function MaterialsShareList($month)
 //    {
-//        if ($this->request->isGet() === false) {
-//            $this->error('请求错误');
-//        }
-//        $param = $this->request->param();
-//        if (empty($param)) {
-//            $this->error('参数错误');
-//        }
-//        $Printinglist = db('设备_产量计酬')
-//            ->alias('a')
-//            ->join('工单_工艺资料 b','a.sczl_gdbh = b.Gy0_gdbh and a.sczl_yjno = b.Gy0_yjno and a.sczl_gxh = b.Gy0_gxh')
-//            ->join('设备_基本资料 c','a.sczl_jtbh = c.设备编号','LEFT')
-//            ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh and a.sczl_yjno = d.yj_Yjno')
-//            ->field('a.sczl_gdbh as 工单编号,a.sczl_yjno as 印件号,a.sczl_gxh as 工序号,sum(a.sczl_cl) as 班组车头产量,b.Gy0_gxmc as 工序名称,
-//            a.sczl_ms as 墨色数,rtrim(c.使用部门) as 使用部门,rtrim(b.印刷方式) as 印刷方式,b.版距,b.工价系数,a.sczl_jtbh,d.yj_yjmc as 印件名称,
-//            sum(a.sczl_设备运行工时) as 占用机时,a.sys_rq as 年月,b.工价系数 as 工序难度系数,b.千件工价')
-//            ->where('a.sys_rq','like',$param['month'].'%')
-//            ->group('a.sczl_gdbh,a.sczl_yjno,a.sczl_gxh,a.sczl_jtbh')
-//            ->select();
-        //查询外发加工、拆片工单
-//        $disassemblingList = db('db_sczl')
-//            ->alias('a')
-//            ->join('工单_工艺资料 b','a.sczl_gdbh = b.Gy0_gdbh and a.sczl_yjno = b.Gy0_yjno and a.sczl_gxh = b.Gy0_gxh')
-//            ->join('设备_基本资料 c','a.sczl_jtbh = c.设备编号','LEFT')
-//            ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh and a.sczl_yjno = d.yj_Yjno')
-//            ->field('a.sczl_gdbh as 工单编号,a.sczl_yjno as 印件号,a.sczl_gxh as 工序号,sum(a.sczl_cl) as 班组车头产量,b.Gy0_gxmc as 工序名称,
-//            a.sczl_ms as 墨色数,rtrim(c.使用部门) as 使用部门,rtrim(b.印刷方式) as 印刷方式,b.版距,b.工价系数,a.sczl_jtbh,d.yj_yjmc as 印件名称,
-//            sum(a.sczl_设备运行工时) as 占用机时,a.sys_rq as 年月,b.工价系数 as 工序难度系数,b.千件工价')
-//            ->where('a.sys_rq','like',$param['month'].'%')
-//            ->group('a.sczl_gdbh,a.sczl_yjno,a.sczl_gxh,a.sczl_jtbh')
+//        $year = substr($month, 0, 4) . '-' . substr($month, 4, 2);
+//        $list = db('物料_收发记录')
+//            ->field(['rtrim(st_jylb) as st_jylb', 'st_oldSl', '领用单价', '仓库编号','rtrim(st_jtbh) as jtbh'])
+//            ->where([
+//                'st_rq' => ['like',$year . '%'],
+//            ])
+//            ->whereNotIn('st_jylb', ['生产领料','制版领用'])
 //            ->select();
-        //查询包装工序
-//        $field = 'a.sczl_gdbh1,a.sczl_gdbh2,a.sczl_gdbh3,a.sczl_gdbh4,a.sczl_gdbh5,a.sczl_gdbh6,a.sczl_yjGx1,
-//            a.sczl_yjGx2,a.sczl_yjGx3,a.sczl_yjGx4,a.sczl_yjGx5,a.sczl_yjGx6,a.sczl_cl1,a.sczl_cl2,a.sczl_cl3,a.sczl_cl4,a.sczl_cl5,
-//            a.sczl_cl6,a.sczl_PgCl1,a.sczl_PgCl2,a.sczl_PgCl3,a.sczl_PgCl4,a.sczl_PgCl5,a.sczl_PgCl6';
-//        $PackagingList = db('db_包装计件')
-//            ->alias('a')
-//
-//            ->field($field)
-//            ->where('sczl_rq','like',$param['month'].'%')
-//            ->select();
-//        foreach ($PackagingList as $k => $v) {
-//
-//        }
-//        halt($PackagingList);
 //        $data = [];
-//        foreach ($list as $k => $v) {
-//            if ($v['版距'] === '0.0'){
-//                $list[$k]['版距'] = 1000;
-//            }
-//            if ($v['墨色数'] === '0.00'){
-//                $list[$k]['墨色数'] = 1;
-//            }
-//            if (strpos($v['工序名称'],'切废')){
-//                $list[$k]['墨色数'] = 0.2;
+//        foreach ($list as $item) {
+//            if ($item['st_jylb'] == '修理领用') {
+//
+//            }}
+//            if (!isset($data[$item['st_jylb']])) {
+//                $data[$item['st_jylb']] = [];
 //            }
-//            $chanliang = $v['班组车头产量']*$v['工序难度系数'] + $v['班组换算产量'];
-//            $data[] = [
-//                '车间名称' => $v['使用部门'],
-//                'sys_ny' => $param['month'],
-//                'sczl_gdbh' => $v['工单编号'],
-//                '印件名称' => $v['印件名称'],
-//                'sczl_yjno' => $v['印件号'],
-//                'sczl_gxh' => $v['工序号'],
-//                '工序名称' => $v['工序名称'],
-//                'sczl_jtbh' => $v['sczl_jtbh'],
-//                '卷张换算系数' => $list[$k]['版距']/1000,
-//                '占用机时' => $v['占用机时'],
-//                '班组车头产量' => $v['班组车头产量'],
-//                'sczl_ms' => $list[$k]['墨色数'],
-//                '工序难度系数' => $v['工序难度系数'],
-//                '班组换算产量' => $v['班组换算产量'],
-//                '千件工价' => $v['千件工价'],
-//                '计件产量' => $chanliang,
-//                '水电分摊因子' => $v['占用机时'],
-//                '材料分摊因子' => $chanliang,
-//                '人工分摊因子' => ($chanliang/1000)*$v['千件工价'],
-//                'Sys_id' => $param['sys_id'],
-//                'Sys_rq' => date('Y-m-d H:i:s', time())
+//            $data[$item['st_jylb']][] = [
+//                'sl' => $item['st_oldSl'],
+//                'price' => $item['领用单价'],
+//                'sist' => $item['仓库编号'],
+//                'jtbh' => $item['jtbh'],
 //            ];
 //        }
+//        halt($data);
 //    }
-
 }