去掉无用的参数

修改表单构建关联字段的逻辑
修改外部插件说明
This commit is contained in:
2021-03-01 03:02:47 +08:00
parent 2418516c49
commit eebbdf279e
63 changed files with 1273 additions and 1380 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ class AllocationHook
->leftJoin('product', 'product.id', '=', 'stock_allocation_data.product_id')
->where('stock_allocation_data.allocation_id', $id)
->get(['stock_allocation_data.*', 'product.code as product_code']);
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postTransVouch', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -53,7 +53,7 @@ class AllocationHook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_allocation')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'TransVouch', 'field' => 'cTVCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在其他入库单['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -113,7 +113,7 @@ class CancelHook
) t where t.row_index = 1";
$rows = DB::select($sql);
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postCancelOrder', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -124,7 +124,7 @@ class CancelHook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_cancel')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在退货申请['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -131,7 +131,7 @@ class DeliveryHook
}
}
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postDelivery', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -142,7 +142,7 @@ class DeliveryHook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_delivery')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在发货单['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -120,7 +120,7 @@ class DirectHook
}
}
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postDeliveryZY', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -131,7 +131,7 @@ class DirectHook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_direct')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在发货单(直营)['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -37,7 +37,7 @@ class Record01Hook
->leftJoin('product', 'product.id', '=', 'stock_record01_data.product_id')
->where('stock_record01_data.record01_id', $id)
->get(['stock_record01_data.*', 'product.code as product_code']);
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord01', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -48,7 +48,7 @@ class Record01Hook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_record01')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord01', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在采购单['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -46,7 +46,7 @@ class Record08Hook
->leftJoin('product', 'product.id', '=', 'stock_record08_data.product_id')
->where('stock_record08_data.record08_id', $id)
->get(['stock_record08_data.*', 'product.code as product_code']);
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord08', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -57,7 +57,7 @@ class Record08Hook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_record08')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord08', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在其他入库单['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -76,7 +76,7 @@ class Record09Hook
} else {
$post_type = 'postRecord09';
}
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api($post_type, ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -88,7 +88,7 @@ class Record09Hook
$id = $params['id'];
$master = DB::table('stock_record09')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
if ($master['type_id'] == 2) {
$ret = plugin_sync_api('getVouchExist', ['table' => 'DispatchList', 'field' => 'cDLCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
+6 -4
View File
@@ -10,17 +10,19 @@ class Record10Hook
}
public function onBillSeqNo($params) {
// 川南库管独立编号
// 外部库管独立编号
if (auth()->id() == 2177) {
$params['rule'] = $params['rule'].'11';
} else {
$params['rule'] = $params['rule'].'10';
}
return $params;
}
public function onBeforePage($params) {
// 川南库管登录
// 外部库管登录
if (auth()->id() == 2177) {
$params['q']->whereIn('stock_record10.warehouse_id', [20001, 20047]);
} else {
@@ -63,7 +65,7 @@ class Record10Hook
->leftJoin('product', 'product.id', '=', 'stock_record10_data.product_id')
->where('stock_record10_data.record10_id', $id)
->get(['stock_record10_data.*', 'product.code as product_code']);
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord10', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
return $params;
@@ -75,7 +77,7 @@ class Record10Hook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_record10')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord10', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在产成品入库单['.$master['sn'].']无法弃审。');
+2 -2
View File
@@ -46,7 +46,7 @@ class Record11Hook
->leftJoin('product', 'product.id', '=', 'stock_record11_data.product_id')
->where('stock_record11_data.record11_id', $id)
->get(['stock_record11_data.*', 'product.code as product_code']);
// 同步数据到yonyou
// 同步数据到外部接口
$ret = plugin_sync_api('postRecord11', ['master' => $master, 'rows' => $rows]);
if ($ret['success'] == true) {
@@ -58,7 +58,7 @@ class Record11Hook
public function onBeforeAbort($params) {
$id = $params['id'];
$master = DB::table('stock_record11')->where('id', $id)->first();
// 检查用友单据是否存在
// 检查外部接口单据是否存在
$ret = plugin_sync_api('getVouchExist', ['table' => 'Rdrecord11', 'field' => 'cCode', 'value' => $master['sn']]);
if ($ret['msg'] > 0) {
abort_error('用友存在原材料出库单['.$master['sn'].']无法弃审。');