Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wang
/
go_supplier_task
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
e30e27c4
authored
Mar 23, 2021
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
^
parent
c99a95bb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
service/service_mapping.go
service/service_supplier.go
service/service_mapping.go
View file @
e30e27c4
...
...
@@ -62,6 +62,7 @@ func (this *ServiceSupplier)MappingHandle(MappingType int) {
panic
(
err
)
//获取csv报错,终止程序
}
for
groupName
,
data
:=
range
res
{
groupName
=
strings
.
Replace
(
groupName
,
"?"
,
" "
,
10
)
//组装 purchaseNames(里面包含供应商采购商中文 名称)
purchaseNames
:=
make
([]
interface
{},
0
)
for
_
,
OldSupplier
:=
range
data
{
...
...
@@ -76,8 +77,8 @@ func (this *ServiceSupplier)MappingHandle(MappingType int) {
NewMapping
:=
SupplierMappingEntity
{
OldSupplierCode
:
OldSupplier
[
"canal"
],
SupplierCode
:
dbSuplierInfo
.
SupplierCode
,
OldSupplierName
:
strings
.
Replace
(
OldSupplier
[
"oldName"
],
"?"
,
" "
,
10
)
,
SupplierName
:
strings
.
Replace
(
dbSuplierInfo
.
SupplierName
,
"?"
,
" "
,
10
)
,
OldSupplierName
:
groupName
,
SupplierName
:
groupName
,
SupplierId
:
int
(
dbSuplierInfo
.
SupplierId
),
Source
:
MappingType
,
}
...
...
@@ -136,7 +137,7 @@ func (this *ServiceSupplier) GetStatus2SupplierInfo(supplierName string,purchase
poolSupplierEntity
:=
PoolSupplierEntity
{}
poolSupplierEntity
.
Status
=
2
poolSupplierEntity
.
IsType
=
0
poolSupplierEntity
.
SupplierName
=
s
trings
.
Replace
(
supplierName
,
"?"
,
" "
,
10
)
poolSupplierEntity
.
SupplierName
=
s
upplierName
_
,
err
:=
dbSpu
.
Table
(
"lie_supplier_channel"
)
.
Insert
(
&
poolSupplierEntity
)
if
(
err
!=
nil
){
syncLog
.
SyncInsertLog
(
"mapping_insert"
,
"[插入映射-新增标准]出错:"
+
"供应商标准名称:"
+
supplierName
+
err
.
Error
(),
syncLog
.
LogLevelFatal
)
...
...
service/service_supplier.go
View file @
e30e27c4
...
...
@@ -7,6 +7,7 @@ import (
syncLog
"go_supplier_task/pkg/logger/sync"
"go_supplier_task/pkg/mysql"
"sort"
"strings"
)
var
SupplierEerrKey
=
"mergerSupplierErr"
...
...
@@ -33,6 +34,7 @@ func (this *ServiceSupplier)MergerCriteria() {
//数据整理 groupName 标准名称;supplierDataList 供应商列表
for
groupName
,
supplierDataList
:=
range
res
{
//groupName 标准名称
groupName
=
strings
.
Replace
(
groupName
,
"?"
,
" "
,
10
)
PoolSupplierEntitys
:=
make
([]
PoolSupplierEntity
,
0
)
for
_
,
oneSuplier
:=
range
supplierDataList
{
poolSupplierEntity
:=
PoolSupplierEntity
{}
...
...
@@ -119,7 +121,6 @@ func (this *ServiceSupplier) onlyOpenHandle(groupName string,PoolSupplierEntity
return
true
,
onlyOpenSupplier
}
}
else
{
return
false
,
oneSupplierEntity
}
...
...
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