Просмотр исходного кода

fix:修复老数据营业执照显示

zhangxinlei1996 3 лет назад
Родитель
Сommit
034fb5fe8e

+ 7 - 1
entity/ent.go

@@ -6,6 +6,7 @@ import (
 	"fmt"
 	"log"
 	"strconv"
+	"strings"
 	"time"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -495,6 +496,7 @@ func (this *ExamineList) GetSql() (selectSql, countSql string) {
 type CheckEnt struct {
 	EntId int64
 	Mysql *mysql.Mysql
+	Url   string
 }
 
 /*
@@ -547,12 +549,16 @@ func (this *CheckEnt) Info() *EntInfoData {
 	info := EntInfoData{}
 	if r != nil && len(*r) > 0 {
 		data := (*r)[0]
+		license := common.ObjToString(data["license"]) //老企业认证只传了后缀,需要拼接
+		if !strings.Contains(license, "http") {
+			license = this.Url + license
+		}
 		info.OrganizationType = common.ObjToString(data["organization_type"])
 		info.CreditCode = common.ObjToString(data["code"])
 		info.Name = common.ObjToString(data["name"])
 		info.CompanyType = common.Int64All(data["auth_type"])
 		info.AreaNumber = common.ObjToString(data["area_number"])
-		info.Business = common.ObjToString(data["license"])
+		info.Business = license
 		info.OfficialLetter = common.ObjToString(data["official_letter"])
 		info.AuthStartTime = common.ObjToString(data["auth_startTime"]) //创建时间 即为认证通过时间
 		info.AuthEndTime = common.ObjToString(data["auth_endTime"])     //有效截止日期

+ 2 - 1
rpc/etc/usercenter.yaml

@@ -29,4 +29,5 @@ Logx:
   Level: info #info|error|severe
   KeepDays: 100
 IsRun: true
-CheckEntIsExpire: 00:00
+CheckEntIsExpire: 00:00
+DoMain: https://jybx-webtest.jydev.jianyu360.com

+ 1 - 0
rpc/internal/config/config.go

@@ -19,6 +19,7 @@ type Config struct {
 	Logx             logx.LogConf
 	IsRun            bool   //定时任务是否开启
 	CheckEntIsExpire string //
+	DoMain           string
 }
 
 var (

+ 7 - 2
rpc/internal/logic/entservice.go

@@ -1,5 +1,10 @@
 package logic
 
-import "bp.jydev.jianyu360.cn/BaseService/userCenter/service"
+import (
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/config"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/service"
+)
 
-var Entservice service.EntService
+var Entservice = service.EntService{
+	Url: config.ConfigJson.DoMain,
+}

+ 4 - 1
service/entService.go

@@ -10,7 +10,9 @@ import (
 	userCenter "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
 )
 
-type EntService struct{}
+type EntService struct {
+	Url string
+}
 
 //创建企业用户
 /*
@@ -233,6 +235,7 @@ func (this *EntService) Info(data *userCenter.CheckEntReq) (int64, string, *user
 	info := &entity.CheckEnt{
 		EntId: data.EntId,
 		Mysql: entity.Mysql,
+		Url:   this.Url,
 	}
 	rdata := info.Info()
 	entInfoData := &userCenter.EntInfoData{