|
@@ -449,18 +449,25 @@ class OaService extends Service
|
|
|
|
|
|
|
|
|
if (empty($list)) {
|
|
|
- $this->returnOa($order_no, 1, $type);
|
|
|
- return [200, ''];
|
|
|
+ list($parent_status,$parent_msg) = $this->returnOa($order_no, 1, $type);
|
|
|
+ if(!$parent_status) return [false, $parent_msg];
|
|
|
+ return [true, ''];
|
|
|
}
|
|
|
try {
|
|
|
DB::beginTransaction();
|
|
|
|
|
|
list($employee_ids, $oa_sub_id,$order_detail) = $this->oaCommon($menu_id, ['order_number' => $orderObject], 1,0,$this->user);
|
|
|
if (empty($employee_ids)) {
|
|
|
- $this->returnOa($order_no, 1, $type);
|
|
|
- DB::commit();
|
|
|
+ list($parent_status,$parent_msg) = $this->returnOa($order_no, 1, $type);
|
|
|
+ if(!$parent_status) {
|
|
|
+ DB::rollBack();
|
|
|
+ return [false, $parent_msg];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ DB::commit();
|
|
|
+ return [true, '审核成功'];
|
|
|
+ }
|
|
|
|
|
|
- return [true, '审核成功'];
|
|
|
}
|
|
|
$order = new OaOrder();
|
|
|
$order->menu_id = $menu_id;
|
|
@@ -628,7 +635,11 @@ class OaService extends Service
|
|
|
|
|
|
];
|
|
|
$this->sendWxMsg($order_detail['crt_id'],2,0,$oaOrder->menu_id,$tmp_data);
|
|
|
- $this->returnOa($oaOrder->order_no, 1, $oaOrder->opt_case);
|
|
|
+ list($parent_status,$parent_msg) = $this->returnOa($oaOrder->order_no, 1, $oaOrder->opt_case);
|
|
|
+ if(!$parent_status){
|
|
|
+ DB::rollBack();
|
|
|
+ return [false,$parent_msg];
|
|
|
+ }
|
|
|
} else {
|
|
|
$oaOrder->state = 1;
|
|
|
$oaOrder->save();
|
|
@@ -675,7 +686,11 @@ class OaService extends Service
|
|
|
$oaOrder->state = 3;
|
|
|
$oaOrder->save();
|
|
|
$this->sendWxMsg($order_detail['crt_id'],3,2,$oaOrder->menu_id,$tmp_data);
|
|
|
- $this->returnOa($oaOrder->order_no, 2, $oaOrder->opt_case);
|
|
|
+ list($parent_status,$parent_msg) = $this->returnOa($oaOrder->order_no, 2, $oaOrder->opt_case);
|
|
|
+ if(!$parent_status){
|
|
|
+ DB::rollBack();
|
|
|
+ return [false,$parent_msg];
|
|
|
+ }
|
|
|
}else{
|
|
|
$id = OaOrderSub::where('sort', ($detail['sort'] - 1))->where('oa_order_id', $oaOrder->id)->value('id');
|
|
|
$employee_ids = OaOrderSubEmployee::where('oa_order_sub_id',$id)->pluck('employee_id')->toArray();
|
|
@@ -841,7 +856,10 @@ class OaService extends Service
|
|
|
// ]);
|
|
|
// $oaOrder->state = 1;
|
|
|
// $oaOrder->save();
|
|
|
- $this->returnOa($order_no, 3, $op_case);
|
|
|
+ list($parent_status,$parent_msg) = $this->returnOa($order_no, 3, $op_case);
|
|
|
+ if(!$parent_status){
|
|
|
+ return [false,$parent_msg];
|
|
|
+ }
|
|
|
return [true, '弃审成功'];
|
|
|
|
|
|
}
|