修正流程引擎多人执行模式bug

This commit is contained in:
2021-04-13 00:01:21 +08:00
parent de8a7e82be
commit d5da54b817
27 changed files with 2383 additions and 85 deletions
+5 -5
View File
@@ -44,10 +44,10 @@ class AllocationHook
->get(['stock_allocation_data.*', 'product.code as product_code']);
// 同步数据到外部接口
$ret = plugin_sync_api('postTransVouch', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -56,7 +56,7 @@ class AllocationHook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'TransVouch', 'field' => 'cTVCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在其他入库单['.$master['sn'].']无法弃审。');
abort_error('存在其他入库单['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -5
View File
@@ -115,10 +115,10 @@ class CancelHook
// 同步数据到外部接口
$ret = plugin_sync_api('postCancelOrder', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -127,7 +127,7 @@ class CancelHook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在退货申请['.$master['sn'].']无法弃审。');
abort_error('存在退货申请['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -5
View File
@@ -133,10 +133,10 @@ class DeliveryHook
// 同步数据到外部接口
$ret = plugin_sync_api('postDelivery', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -145,7 +145,7 @@ class DeliveryHook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在发货单['.$master['sn'].']无法弃审。');
abort_error('存在发货单['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -5
View File
@@ -122,10 +122,10 @@ class DirectHook
// 同步数据到外部接口
$ret = plugin_sync_api('postDeliveryZY', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -134,7 +134,7 @@ class DirectHook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在发货单(直营)['.$master['sn'].']无法弃审。');
abort_error('存在发货单(直营)['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -5
View File
@@ -39,10 +39,10 @@ class Record01Hook
->get(['stock_record01_data.*', 'product.code as product_code']);
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord01', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -51,7 +51,7 @@ class Record01Hook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord01', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在采购单['.$master['sn'].']无法弃审。');
abort_error('存在采购单['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -5
View File
@@ -48,10 +48,10 @@ class Record08Hook
->get(['stock_record08_data.*', 'product.code as product_code']);
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord08', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -60,7 +60,7 @@ class Record08Hook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord08', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在其他入库单['.$master['sn'].']无法弃审。');
abort_error('存在其他入库单['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -5
View File
@@ -78,10 +78,10 @@ class Record09Hook
}
// 同步数据到外部接口
$ret = plugin_sync_api($post_type, ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
abort_error($ret['msg']);
return $params;
}
public function onBeforeAbort($params) {
@@ -92,12 +92,12 @@ class Record09Hook
if ($master['type_id'] == 2) {
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在样品申请单['.$master['sn'].']无法弃审。');
abort_error('存在样品申请单['.$master['sn'].']无法弃审。');
}
} else {
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord09', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在其他出库单['.$master['sn'].']无法弃审。');
abort_error('存在其他出库单['.$master['sn'].']无法弃审。');
}
}
return $params;
+4 -5
View File
@@ -67,11 +67,10 @@ class Record10Hook
->get(['stock_record10_data.*', 'product.code as product_code']);
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord10', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
abort_error($ret['msg']);
return $params;
}
public function onBeforeAbort($params) {
@@ -80,7 +79,7 @@ class Record10Hook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord10', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在产成品入库单['.$master['sn'].']无法弃审。');
abort_error('存在产成品入库单['.$master['sn'].']无法弃审。');
}
return $params;
}
+5 -6
View File
@@ -48,11 +48,10 @@ class Record11Hook
->get(['stock_record11_data.*', 'product.code as product_code']);
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord11', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
}
abort_error($ret['msg']);
if ($ret['error_code'] > 0) {
abort_error($ret['msg']);
}
return $params;
}
public function onBeforeAbort($params) {
@@ -61,7 +60,7 @@ class Record11Hook
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord11', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在原材料出库单['.$master['sn'].']无法弃审。');
abort_error('存在原材料出库单['.$master['sn'].']无法弃审。');
}
return $params;
}