|
|
@@ -423,24 +423,23 @@ class WorkOrder extends Api
|
|
|
$printCode = \db('工单_印件资料')
|
|
|
->where('Uniqid',$param['printID'])
|
|
|
->value('yj_Yjno');
|
|
|
- if (empty($printCode)){
|
|
|
- $this->success('未找到该工单印件资料');
|
|
|
- }
|
|
|
- //修改工单工艺计划产量
|
|
|
- $result = $this->PlannedProcessYield($param['gdbh'],$printCode,0,$param['jhtl']);
|
|
|
- if ($result === false){
|
|
|
- $this->success('分配工序计划产量失败');
|
|
|
+ if (!empty($printCode)){
|
|
|
+ //修改工单工艺计划产量
|
|
|
+ $result = $this->PlannedProcessYield($param['gdbh'],$printCode,0,$param['jhtl']);
|
|
|
+ if ($result === false){
|
|
|
+ $this->success('分配工序计划产量失败');
|
|
|
+ }
|
|
|
+ //修改印件信息
|
|
|
+ $printSql = \db('工单_印件资料')
|
|
|
+ ->where('Uniqid',$param['printID'])
|
|
|
+ ->fetchSql(true)
|
|
|
+ ->update(['Yj_Gdbh'=>$param['gdbh'],'yj_yjmc'=>$param['yjmc'],'yj_Yjdh'=>$param['yjdh'],'yj_平张投料'=>$param['jhtl']]);
|
|
|
+ $printRes = Db::query($printSql);
|
|
|
}
|
|
|
//修改工单信息
|
|
|
$sql = \db('工单_基本资料')->where('Uniqid',$param['Uniqid'])->fetchSql(true)->update($row);
|
|
|
$res = Db::query($sql);
|
|
|
- //修改印件信息
|
|
|
- $printSql = \db('工单_印件资料')
|
|
|
- ->where('Uniqid',$param['printID'])
|
|
|
- ->fetchSql(true)
|
|
|
- ->update(['yj_yjmc'=>$param['yjmc'],'yj_Yjdh'=>$param['yjdh'],'yj_平张投料'=>$param['jhtl']]);
|
|
|
- $printRes = Db::query($printSql);
|
|
|
- if ($res !== false && $printRes !== false){
|
|
|
+ if ($res !== false){
|
|
|
$this->success('成功');
|
|
|
}else{
|
|
|
$this->error('失败');
|