|
@@ -82,12 +82,13 @@ func Dotognbu() {
|
|
|
var companyItems []*models.CompanyJson
|
|
|
if len(companyList) > 0 {
|
|
|
url = "https://crm.hzinsights.com/openapi/v1/Customer/batchSyncFiccCustomer?access_token=" + accessToken
|
|
|
- for k, v := range companyList {
|
|
|
- if v.Permission == "策略" {
|
|
|
- companyList[k].Fe = "FICC"
|
|
|
- } else {
|
|
|
- companyList[k].Fe = "权益"
|
|
|
- }
|
|
|
+ for k, _ := range companyList {
|
|
|
+ //if v.Permission == "策略" {
|
|
|
+ // companyList[k].Fe = "FICC"
|
|
|
+ //} else {
|
|
|
+ //
|
|
|
+ //}
|
|
|
+ companyList[k].Fe = "权益"
|
|
|
//一次同步一百条
|
|
|
companyItems = append(companyItems, companyList[k])
|
|
|
if (k+1)%100 == 0 {
|
|
@@ -134,6 +135,9 @@ func Dotognbu() {
|
|
|
}
|
|
|
userList[k].CountryCode = "+" + v.CountryCode
|
|
|
userList[k].OutboundCountryCode = "+" + v.OutboundCountryCode
|
|
|
+ if userList[k].Mobile != "" && userList[k].OutboundMobile != "" && userList[k].Mobile == userList[k].OutboundMobile {
|
|
|
+ userList[k].OutboundMobile = ""
|
|
|
+ }
|
|
|
//一次同步一百条
|
|
|
userItems = append(userItems, userList[k])
|
|
|
if (k+1)%100 == 0 {
|
|
@@ -144,9 +148,10 @@ func Dotognbu() {
|
|
|
jsonstr := string(data)
|
|
|
jsonstr = "{\"sync_data\": " + jsonstr + " }"
|
|
|
SendComapnyToShanghai(url, jsonstr)
|
|
|
- companyItems = make([]*models.CompanyJson, 0)
|
|
|
+ userItems = make([]*models.UserJson, 0)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//如果剩下还有则同步剩下的部分
|
|
|
if len(userItems) > 0 {
|
|
|
data, err := json.Marshal(userItems)
|