|
|
@@ -1134,9 +1134,7 @@ class WorkOrder extends Api
|
|
|
//获取工艺资料数据
|
|
|
$list = \db('工单_工艺资料')->where('UniqId',$UniqId)->field('Gy0_yjno,Gy0_gxh,rtrim(Gy0_计划接货数) as 计划接货数')->find();
|
|
|
//如果是第一道工序需从印件资料中获取计划产量
|
|
|
- if ($minGxh[0] === $param['Gy0_gxh']){
|
|
|
- $list['计划接货数'] = \db('工单_印件资料')->where('Yj_Gdbh',$param['Gy0_gdbh'])->where('yj_Yjno',$param['Gy0_yjno'])->column('yj_平张投料')[0];
|
|
|
- }
|
|
|
+ $list['计划接货数'] = \db('工单_印件资料')->where('Yj_Gdbh',$param['Gy0_gdbh'])->where('yj_Yjno',$param['Gy0_yjno'])->column('yj_平张投料')[0];
|
|
|
//修改工单状态
|
|
|
$status = \db('工单_基本资料')->where('Gd_gdbh',$param['Gy0_gdbh'])->field('rtrim(gd_statu) as status')->find();
|
|
|
if ($status['status'] !== '2-生产中'){
|
|
|
@@ -1145,7 +1143,7 @@ class WorkOrder extends Api
|
|
|
}
|
|
|
//重新分配工序计划产量
|
|
|
if ((int)$list['计划接货数'] > 0){
|
|
|
- $result = $this->PlannedProcessYield($param['Gy0_gdbh'],$list['Gy0_yjno'],$list['Gy0_gxh'],$list['计划接货数']);
|
|
|
+ $result = $this->PlannedProcessYield($param['Gy0_gdbh'],$list['Gy0_yjno'],0,$list['计划接货数']);
|
|
|
}
|
|
|
if ($res !== false){
|
|
|
$this->success('成功');
|
|
|
@@ -1764,7 +1762,7 @@ class WorkOrder extends Api
|
|
|
->value('rtrim(yj_平张投料)');
|
|
|
//分配工艺计划产量
|
|
|
if ((int)$number >0){
|
|
|
- $this->PlannedProcessYield($param['Gy0_gdbh'],$param['Gy0_yjno'],$param['Gy0_gxh'],$number);
|
|
|
+ $this->PlannedProcessYield($param['Gy0_gdbh'],$param['Gy0_yjno'],0,$number);
|
|
|
}
|
|
|
if ($res !== false){
|
|
|
$this->success('成功');
|
|
|
@@ -2392,18 +2390,11 @@ class WorkOrder extends Api
|
|
|
*/
|
|
|
public function PlannedProcessYield($workOrder,$yjno,$gxh,$feed)
|
|
|
{
|
|
|
- if ($gxh === 0){
|
|
|
- $where = [
|
|
|
- 'Gy0_gdbh'=>$workOrder,
|
|
|
- 'Gy0_yjno'=>$yjno,
|
|
|
- ];
|
|
|
- }else{
|
|
|
- $where = [
|
|
|
- 'Gy0_gdbh'=>$workOrder,
|
|
|
- 'Gy0_yjno'=>$yjno,
|
|
|
- 'Gy0_gxh'=>['>=',$gxh]
|
|
|
- ];
|
|
|
- }
|
|
|
+
|
|
|
+ $where = [
|
|
|
+ 'Gy0_gdbh'=>$workOrder,
|
|
|
+ 'Gy0_yjno'=>$yjno,
|
|
|
+ ];
|
|
|
//获取工艺资料
|
|
|
$processList = \db('工单_工艺资料')
|
|
|
->where($where)
|