This commit is contained in:
苏尹岚
2021-02-05 16:33:46 +08:00
parent a388b89225
commit fb7ad6b750
3 changed files with 39 additions and 30 deletions

View File

@@ -705,10 +705,12 @@ func (c *PurchaseHandler) SyncQualify(ctx *jxcontext.Context, storeDetail *dao.S
return fmt.Errorf("个人信息不全, [%v]", storeDetail.ID)
}
if storeDetail.StoreFrontPic == "" || storeDetail.StoreInPic == "" {
return fmt.Errorf("门面门店照必须不全!, [%v]", storeDetail.ID)
return fmt.Errorf("门面门店照不全!, [%v]", storeDetail.ID)
}
if storeDetail.Licence2Code == "" || storeDetail.Licence2Image == "" {
return fmt.Errorf("食品经营许可证不全, [%v]", storeDetail.ID)
if storeDetail.EbaiSupplierID == EbaiSupplierIDsc {
if storeDetail.Licence2Code == "" || storeDetail.Licence2Image == "" {
return fmt.Errorf("食品经营许可证不全, [%v]", storeDetail.ID)
}
}
//营业执照
@@ -739,31 +741,33 @@ func (c *PurchaseHandler) SyncQualify(ctx *jxcontext.Context, storeDetail *dao.S
}
}
//食品经营许可证
licence2Map := make(map[string]interface{})
licence2Map["type_1"] = 2
licence2Map["type_2"] = 202
licence2Map["license_number"] = storeDetail.Licence2Code
licence2Map["license_address"] = storeDetail.LicenceAddress
licence2Map["legal_representative_name"] = storeDetail.LicenceOwnerName
licence2Map["license_name"] = storeDetail.LicenceCorpName
licence2Map["photos"] = []map[string]interface{}{
map[string]interface{}{
"photo_url": storeDetail.Licence2Image,
"waterprinter_url": storeDetail.Licence2Image,
},
}
if storeDetail.Licence2Expire == "" {
licence2Map["long_term_valid"] = 1
} else {
if storeDetail.Licence2Valid != "" {
if utils.Str2Time(storeDetail.Licence2Expire).Sub(utils.Str2Time(storeDetail.Licence2Valid)) > 0 {
licence2Map["license_validdate"] = storeDetail.Licence2Expire
} else {
licence2Map["license_validdate"] = storeDetail.Licence2Valid
}
if storeDetail.EbaiSupplierID == EbaiSupplierIDsc {
//食品经营许可证
licence2Map["type_1"] = 2
licence2Map["type_2"] = 202
licence2Map["license_number"] = storeDetail.Licence2Code
licence2Map["license_address"] = storeDetail.LicenceAddress
licence2Map["legal_representative_name"] = storeDetail.LicenceOwnerName
licence2Map["license_name"] = storeDetail.LicenceCorpName
licence2Map["photos"] = []map[string]interface{}{
map[string]interface{}{
"photo_url": storeDetail.Licence2Image,
"waterprinter_url": storeDetail.Licence2Image,
},
}
if storeDetail.Licence2Expire == "" {
licence2Map["long_term_valid"] = 1
} else {
licence2Map["license_validdate"] = storeDetail.Licence2Expire
if storeDetail.Licence2Valid != "" {
if utils.Str2Time(storeDetail.Licence2Expire).Sub(utils.Str2Time(storeDetail.Licence2Valid)) > 0 {
licence2Map["license_validdate"] = storeDetail.Licence2Expire
} else {
licence2Map["license_validdate"] = storeDetail.Licence2Valid
}
} else {
licence2Map["license_validdate"] = storeDetail.Licence2Expire
}
}
}
@@ -800,7 +804,7 @@ func (c *PurchaseHandler) SyncQualify(ctx *jxcontext.Context, storeDetail *dao.S
params := make(map[string]interface{})
maps := []map[string]interface{}{
licenceMap, licence2Map, idMap, map[string]interface{}{
licenceMap, idMap, map[string]interface{}{
"type_1": 5,
"type_2": 501,
"photos": []map[string]interface{}{
@@ -820,6 +824,9 @@ func (c *PurchaseHandler) SyncQualify(ctx *jxcontext.Context, storeDetail *dao.S
},
},
}
if storeDetail.EbaiSupplierID == EbaiSupplierIDsc {
maps = append(maps, licence2Map)
}
params["aptitude"] = maps
err = api.EbaiAPI.ShopAptitudeUpload("", utils.Str2Int64(storeDetail.VendorStoreID), params)
return err