|
|
@@ -302,7 +302,37 @@ sql;
|
|
|
}
|
|
|
oci_close($conn);
|
|
|
return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function resetInterfaceReturnMark(Request $request)
|
|
|
+ {
|
|
|
+ if(!Gate::allows('订单管理-编辑')){ return redirect(url('/')); }
|
|
|
+ $orderno=$request->orderno;
|
|
|
+ $oldIds =OracleDOCOrderHeader::query()
|
|
|
+ ->whereIn('orderno', $orderno)
|
|
|
+ ->where('edisendflag', 'N')->pluck('orderno')->toArray();
|
|
|
|
|
|
+ OracleDOCOrderHeader::query()
|
|
|
+ ->whereIn('orderno',$orderno)
|
|
|
+ ->where('sostatus','99')
|
|
|
+ ->whereIn('edisendflag',['R','W'])
|
|
|
+ ->where('addwho','!=','EDI')
|
|
|
+ ->update(['edisendflag'=>'N']);
|
|
|
+
|
|
|
+ $failedOrdernos =OracleDOCOrderHeader::query()
|
|
|
+ ->whereIn('orderno', $orderno)
|
|
|
+ ->where('edisendflag', '!=', 'N')->pluck('orderno');
|
|
|
+
|
|
|
+ $successedOrdernos =OracleDOCOrderHeader::query()
|
|
|
+ ->whereIn('orderno', array_diff($orderno,$oldIds))
|
|
|
+ ->where('edisendflag', 'N')->pluck('orderno');
|
|
|
+
|
|
|
+ app('LogService')->log(__METHOD__,'重置接口回传标记'.__FUNCTION__,json_encode($orderno),Auth::user()['id']);
|
|
|
+ if (count($failedOrdernos)==0) {
|
|
|
+ return ['success'=>true];
|
|
|
+ } else {
|
|
|
+ return ['success'=>false,'fail_info'=>"数据 {$failedOrdernos} 更新失败,数据{$successedOrdernos}更新成功"];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|