Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
17f46ef4
authored
Mar 28, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-财务信息金蝶同步-20240319'
# Conflicts: # app/Http/routes.php
parents
e2c0972a
c3e4b737
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
8 deletions
app/Http/Services/LogService.php
app/Http/Services/SyncSupplierService.php
app/Http/Transformers/LogTransformer.php
app/Http/routes.php
app/Http/Services/LogService.php
View file @
17f46ef4
...
@@ -120,9 +120,9 @@ class LogService
...
@@ -120,9 +120,9 @@ class LogService
$filter
=
new
LogFilter
();
$filter
=
new
LogFilter
();
$query
=
$filter
->
defaultFilter
(
$query
);
$query
=
$filter
->
defaultFilter
(
$query
);
if
(
$type
)
{
if
(
$type
)
{
$logs
=
$query
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'type'
,
$type
)
->
limit
(
$limit
)
->
get
();
$logs
=
$query
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'type'
,
$type
)
->
limit
(
$limit
)
->
get
()
->
toArray
()
;
}
else
{
}
else
{
$logs
=
$query
->
where
(
'supplier_id'
,
$supplierId
)
->
limit
(
$limit
)
->
get
();
$logs
=
$query
->
where
(
'supplier_id'
,
$supplierId
)
->
limit
(
$limit
)
->
get
()
->
toArray
()
;
}
}
$transformer
=
new
LogTransformer
();
$transformer
=
new
LogTransformer
();
$logs
=
$transformer
->
transformList
(
$logs
);
$logs
=
$transformer
->
transformList
(
$logs
);
...
@@ -256,4 +256,4 @@ class LogService
...
@@ -256,4 +256,4 @@ class LogService
}
}
}
}
\ No newline at end of file
app/Http/Services/SyncSupplierService.php
View file @
17f46ef4
...
@@ -103,6 +103,20 @@ class SyncSupplierService
...
@@ -103,6 +103,20 @@ class SyncSupplierService
}
}
}
}
//审核流程
$updateLogs
=
(
new
LogService
())
->
getLogs
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
);
$reviewProcess
=
[];
if
(
$updateLogs
)
{
foreach
(
$updateLogs
as
$log
)
{
$content
=
is_array
(
$log
[
'content'
])
&&
!
empty
(
$log
[
'content'
])
?
$log
[
'content'
][
0
]
:
$log
[
'content'
];
$reviewProcess
[]
=
[
'operator'
=>
$log
[
'admin_name'
],
'operateDate'
=>
$log
[
'add_time'
],
'operate'
=>
$content
,
];
}
}
$message
[
'reviewProcess'
]
=
$reviewProcess
;
if
(
$conn
)
{
if
(
$conn
)
{
}
else
{
}
else
{
...
...
app/Http/Transformers/LogTransformer.php
View file @
17f46ef4
...
@@ -5,6 +5,7 @@ namespace App\Http\Transformers;
...
@@ -5,6 +5,7 @@ namespace App\Http\Transformers;
use
App\Http\Services\LogService
;
use
App\Http\Services\LogService
;
use
App\Model\SupplierReceiptModel
;
class
LogTransformer
class
LogTransformer
{
{
...
@@ -41,7 +42,20 @@ class LogTransformer
...
@@ -41,7 +42,20 @@ class LogTransformer
$oldReceipt
=
json_decode
(
$item
[
'remark'
],
true
);
$oldReceipt
=
json_decode
(
$item
[
'remark'
],
true
);
//新增
//新增
if
(
empty
(
$oldReceipt
[
'receipt_id'
]))
{
if
(
empty
(
$oldReceipt
[
'receipt_id'
]))
{
$item
[
'content'
]
.=
' : '
.
"银行名称 :
{
$oldReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$oldReceipt
[
'account_no'
]
}
"
;
$type
=
array_get
(
$oldReceipt
,
'receipt_type'
,
1
);
$type
=
$type
==
1
?
"大陆"
:
"香港以及国外"
;
$swiftCodeText
=
(
$type
==
'香港以及国外'
)
?
' | 国际代码 : '
.
array_get
(
$oldReceipt
,
'swift_code'
)
:
''
;
$item
[
'content'
]
.=
' : '
.
"银行所在地 :
{
$type
}
| 银行名称 :
{
$oldReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$oldReceipt
[
'account_no'
]
}
| 银行地址 :
{
$oldReceipt
[
'account_adderss'
]
}
"
.
$swiftCodeText
;
}
else
{
$newReceipt
=
SupplierReceiptModel
::
where
(
'receipt_id'
,
$oldReceipt
[
'receipt_id'
])
->
first
();
if
(
!
empty
(
$newReceipt
))
{
$newReceipt
=
$newReceipt
->
toArray
();
$type
=
array_get
(
$newReceipt
,
'receipt_type'
,
1
);
$type
=
$type
==
1
?
"大陆"
:
"香港以及国外"
;
$swiftCodeText
=
(
$type
==
'香港以及国外'
)
?
' | 国际代码 : '
.
array_get
(
$newReceipt
,
'swift_code'
)
:
''
;
$item
[
'content'
]
.=
' : '
.
"银行所在地 :
{
$type
}
| 银行名称 :
{
$newReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$newReceipt
[
'account_no'
]
}
| 银行地址 :
{
$newReceipt
[
'account_adderss'
]
}
"
.
$swiftCodeText
;
}
}
}
}
}
...
@@ -63,11 +77,11 @@ class LogTransformer
...
@@ -63,11 +77,11 @@ class LogTransformer
if
(
empty
(
$oldReceipt
[
'receipt_id'
]))
{
if
(
empty
(
$oldReceipt
[
'receipt_id'
]))
{
//新增日志
//新增日志
$content
=
"银行名称 :
{
$oldReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$oldReceipt
[
'account_no'
]
}
"
;
$content
=
"银行名称 :
{
$oldReceipt
[
'bank_name'
]
}
| 账户号码 :
{
$oldReceipt
[
'account_no'
]
}
"
;
}
else
{
}
else
{
if
(
$receipt
)
{
if
(
$receipt
)
{
//修改日志
//修改日志
}
else
{
}
else
{
//删除日志
//删除日志
}
}
}
}
...
...
app/Http/routes.php
View file @
17f46ef4
...
@@ -82,5 +82,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -82,5 +82,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\
DataService
())
->
exportContact
(
);
(
new
\App\Http\Services\
SyncSupplierService
())
->
syncSupplierToErp
(
12469
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment