Commit e30e27c4 by wang

^

parent c99a95bb
...@@ -62,6 +62,7 @@ func (this *ServiceSupplier)MappingHandle(MappingType int) { ...@@ -62,6 +62,7 @@ func (this *ServiceSupplier)MappingHandle(MappingType int) {
panic(err)//获取csv报错,终止程序 panic(err)//获取csv报错,终止程序
} }
for groupName,data:=range res{ for groupName,data:=range res{
groupName=strings.Replace(groupName,"?"," ",10)
//组装 purchaseNames(里面包含供应商采购商中文 名称) //组装 purchaseNames(里面包含供应商采购商中文 名称)
purchaseNames:=make([]interface{},0) purchaseNames:=make([]interface{},0)
for _,OldSupplier:=range data{ for _,OldSupplier:=range data{
...@@ -76,8 +77,8 @@ func (this *ServiceSupplier)MappingHandle(MappingType int) { ...@@ -76,8 +77,8 @@ func (this *ServiceSupplier)MappingHandle(MappingType int) {
NewMapping:=SupplierMappingEntity{ NewMapping:=SupplierMappingEntity{
OldSupplierCode:OldSupplier["canal"], OldSupplierCode:OldSupplier["canal"],
SupplierCode:dbSuplierInfo.SupplierCode, SupplierCode:dbSuplierInfo.SupplierCode,
OldSupplierName:strings.Replace(OldSupplier["oldName"],"?"," ",10), OldSupplierName:groupName,
SupplierName:strings.Replace(dbSuplierInfo.SupplierName,"?"," ",10), SupplierName:groupName,
SupplierId:int(dbSuplierInfo.SupplierId), SupplierId:int(dbSuplierInfo.SupplierId),
Source:MappingType, Source:MappingType,
} }
...@@ -136,7 +137,7 @@ func (this *ServiceSupplier) GetStatus2SupplierInfo(supplierName string,purchase ...@@ -136,7 +137,7 @@ func (this *ServiceSupplier) GetStatus2SupplierInfo(supplierName string,purchase
poolSupplierEntity:=PoolSupplierEntity{} poolSupplierEntity:=PoolSupplierEntity{}
poolSupplierEntity.Status=2 poolSupplierEntity.Status=2
poolSupplierEntity.IsType=0 poolSupplierEntity.IsType=0
poolSupplierEntity.SupplierName=strings.Replace(supplierName,"?"," ",10) poolSupplierEntity.SupplierName=supplierName
_,err:= dbSpu.Table("lie_supplier_channel").Insert(&poolSupplierEntity) _,err:= dbSpu.Table("lie_supplier_channel").Insert(&poolSupplierEntity)
if(err!=nil){ if(err!=nil){
syncLog.SyncInsertLog("mapping_insert","[插入映射-新增标准]出错:"+"供应商标准名称:"+supplierName+err.Error(),syncLog.LogLevelFatal) syncLog.SyncInsertLog("mapping_insert","[插入映射-新增标准]出错:"+"供应商标准名称:"+supplierName+err.Error(),syncLog.LogLevelFatal)
......
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
syncLog "go_supplier_task/pkg/logger/sync" syncLog "go_supplier_task/pkg/logger/sync"
"go_supplier_task/pkg/mysql" "go_supplier_task/pkg/mysql"
"sort" "sort"
"strings"
) )
var SupplierEerrKey="mergerSupplierErr" var SupplierEerrKey="mergerSupplierErr"
...@@ -33,6 +34,7 @@ func (this *ServiceSupplier)MergerCriteria() { ...@@ -33,6 +34,7 @@ func (this *ServiceSupplier)MergerCriteria() {
//数据整理 groupName 标准名称;supplierDataList 供应商列表 //数据整理 groupName 标准名称;supplierDataList 供应商列表
for groupName,supplierDataList:=range res{//groupName 标准名称 for groupName,supplierDataList:=range res{//groupName 标准名称
groupName=strings.Replace(groupName,"?"," ",10)
PoolSupplierEntitys := make([]PoolSupplierEntity, 0) PoolSupplierEntitys := make([]PoolSupplierEntity, 0)
for _,oneSuplier:=range supplierDataList{ for _,oneSuplier:=range supplierDataList{
poolSupplierEntity:=PoolSupplierEntity{} poolSupplierEntity:=PoolSupplierEntity{}
...@@ -119,7 +121,6 @@ func (this *ServiceSupplier) onlyOpenHandle(groupName string,PoolSupplierEntity ...@@ -119,7 +121,6 @@ func (this *ServiceSupplier) onlyOpenHandle(groupName string,PoolSupplierEntity
return true,onlyOpenSupplier return true,onlyOpenSupplier
} }
}else{ }else{
return false,oneSupplierEntity return false,oneSupplierEntity
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment