zhangxinlei1996 3 年之前
父节点
当前提交
4a36f3eac5
共有 7 个文件被更改,包括 29 次插入17 次删除
  1. 二进制
      api/api
  2. 5 3
      api/internal/logic/checkentlogic.go
  3. 7 4
      entity/ent.go
  4. 7 0
      entity/rpc.go
  5. 3 4
      rpc/internal/config/config.go
  6. 二进制
      rpc/rpc
  7. 7 6
      service/entService.go

二进制
api/api


+ 5 - 3
api/internal/logic/checkentlogic.go

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"log"
 
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
@@ -31,10 +30,13 @@ func (l *CheckEntLogic) CheckEnt(req *types.CheckEntReq) (resp *types.Resp, err
 	res, err := entity.UserCenterRpc.CheckEnt(l.ctx, &pb.CheckEntReq{
 		EntId: req.EntId,
 	})
-	log.Println("-----------", req.EntId)
+
 	return &types.Resp{
 		Error_code: res.ErrorCode,
 		Error_msg:  res.ErrorMsg,
-		Data:       res.Data,
+		Data: map[string]interface{}{
+			"authStatus":   res.Data.AuthStatus,
+			"frozenStatus": res.Data.FrozenStatus,
+		},
 	}, err
 }

+ 7 - 4
entity/ent.go

@@ -486,17 +486,20 @@ type CheckEnt struct {
 }
 
 /*
-	int64 authStatus ;//企业是否认证 -1 未通过,0 未认证,1 已认证. -2 已到期
-	int64 frozenStatus ; //冻结  1正常  0冻结
+	int64 authStatus ;//企业是否认证 -1 未通过,0 未认证,1 已认证. -2 已到期 3待审核
+	int64 frozenStatus ; //冻结  0正常 1冻结
 */
 func (this *CheckEnt) Check() (authStatus, frozenStatus int64, msg string) {
 	if this.EntId == 0 {
 		msg = "企业id为空"
 		return
 	}
-	if r := this.Mysql.SelectBySql(`select auth_status,frozen_status from entniche_info where id =?`, this.EntId); r != nil && len(*r) > 0 {
+	if r := this.Mysql.SelectBySql(`select auth_status,frozen_status,audit_status from entniche_info where id =?`, this.EntId); r != nil && len(*r) > 0 {
 		authStatus = common.Int64All(common.If((*r)[0]["auth_status"] == nil, 0, (*r)[0]["auth_status"]))
-		frozenStatus = common.Int64All(common.If((*r)[0]["frozen_status"] == nil, 1, (*r)[0]["frozen_status"]))
+		if (*r)[0]["auth_status"] != nil && common.Int64All((*r)[0]["auth_status"]) == 1 {
+			authStatus = 3
+		}
+		frozenStatus = common.Int64All(common.If((*r)[0]["frozen_status"] == nil, 0, (*r)[0]["frozen_status"]))
 	} else {
 		msg = "未查询到企业"
 	}

+ 7 - 0
entity/rpc.go

@@ -0,0 +1,7 @@
+package entity
+
+import "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/resource"
+
+var (
+	ResourceLib resource.Resource
+)

+ 3 - 4
rpc/internal/config/config.go

@@ -4,7 +4,7 @@ import (
 	"bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/resource"
 	"github.com/zeromicro/go-zero/core/discov"
 
-	"app.yhyue.com/moapp/jyInfo/rpc/manager"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
 	"github.com/zeromicro/go-zero/core/conf"
 	"github.com/zeromicro/go-zero/zrpc"
 )
@@ -20,8 +20,7 @@ type Config struct {
 }
 
 var (
-	ConfigJson  Config
-	ResourceLib resource.Resource
+	ConfigJson Config
 )
 
 type Mysql struct {
@@ -42,7 +41,7 @@ func init() {
 			Key:   ConfigJson.ResourceEtcdConf.Etcd.Key,
 		},
 	})
-	ResourceLib = resource.NewResource(resourceClient)
+	entity.ResourceLib = resource.NewResource(resourceClient)
 
 	//初始化信息平台相关
 }

二进制
rpc/rpc


+ 7 - 6
service/entService.go

@@ -126,12 +126,13 @@ func (this *EntService) Examinet(data *userCenter.ExamineReq) (int64, string) {
 		return entity.ErrorCode, "参数异常"
 	}
 	info := &entity.Examine{
-		ExamineId: data.ExamineId,
-		EntId:     data.EntId,
-		Reason:    data.Reason,
-		AuthType:  data.AuthType,
-		AuditUser: data.AuditUser,
-		Mysql:     entity.Mysql,
+		ExamineId:   data.ExamineId,
+		EntId:       data.EntId,
+		Reason:      data.Reason,
+		AuthType:    data.AuthType,
+		AuditUser:   data.AuditUser,
+		Mysql:       entity.Mysql,
+		ResourceLib: entity.ResourceLib,
 	}
 	if info.EntExamine() {
 		return entity.SuccessCode, ""