|
|
@@ -307,7 +307,7 @@ class Entrust extends Backend
|
|
|
//$temp_id[$kk] 判断标准id
|
|
|
//$vv 委托单id
|
|
|
if (empty($temp_id[$ke])) {
|
|
|
- $this->error($id . '未获取到判断标准');
|
|
|
+ $this->error('序号为'.$id . '未获取到判断标准,请先编辑确认标准');
|
|
|
}
|
|
|
/***
|
|
|
* 提交后,更新此数据的 判定标准、委托状态
|
|
|
@@ -325,7 +325,7 @@ class Entrust extends Backend
|
|
|
$data_txt_gc = $entrust['sample_no'] . '.D';
|
|
|
$gather_gc = Db::name('gather_txt_gc')->where('data_txt_name', $data_txt_gc)->order('id desc')->find();
|
|
|
if (empty($gather_gc)) {
|
|
|
- $this->error('未获取到检测数据');
|
|
|
+ $this->error('序号为'.$id.'的样品未获取到检测数据,请取消选中');
|
|
|
}
|
|
|
$gather = $gather_gc;
|
|
|
$gather_tab = 'gather_txt_check_gc';
|
|
|
@@ -459,23 +459,14 @@ class Entrust extends Backend
|
|
|
* 根据批次号绑定检测数据
|
|
|
* 生成检测结果
|
|
|
*/
|
|
|
+ $record = [];
|
|
|
for ($i=0;$i<count($idList);$i++){
|
|
|
$entrust_res = Db::name('entrust')->where('id', $idList[$i])->update($entrust_update[$i]);
|
|
|
- $entrust_id = Db::name('res')->where('entrust_id',$idList[$i])->find();
|
|
|
- if (empty($entrust_id)) {
|
|
|
- $res_check = Db::name('res')->insert($params[$i]);
|
|
|
- } else {
|
|
|
- $data =Db::name('res')
|
|
|
- ->whereIn('entrust_id',$idList[$i])
|
|
|
- ->update(['delete_time'=>date('Y-m-d H:i:s')]);
|
|
|
- if (!$data){
|
|
|
- $result = false;
|
|
|
- }
|
|
|
- $res_check = Db::name('res')->insert($params[$i]);
|
|
|
- }
|
|
|
+ Db::name('res')->where('entrust_id',$idList[$i])->update(['delete_time'=>time()]);
|
|
|
+ $res_check = Db::name('res')->insert($params[$i]);
|
|
|
$log_res = Db::name('entrust_log')->insert($log[$i]);
|
|
|
if (!$log_res || !$res_check) {
|
|
|
- $result = false;
|
|
|
+ $record[$i] = $idList[$i];
|
|
|
}else{
|
|
|
$result += 1;
|
|
|
}
|
|
|
@@ -485,8 +476,9 @@ class Entrust extends Backend
|
|
|
Db::rollback();
|
|
|
$this->error($e->getMessage());
|
|
|
}
|
|
|
- if ($result === false) {
|
|
|
- $this->error(__('No rows were inserted'));
|
|
|
+ if ($result !== count($idList)) {
|
|
|
+ $res_log = implode(',',$record);
|
|
|
+ $this->error(__('序号为'.$res_log.'的委托单没有提交成功,请重新提交'));
|
|
|
}
|
|
|
$this->success();
|
|
|
}
|