Browse Source

参数修改

WH01243 1 năm trước cách đây
mục cha
commit
c8893b7258

+ 1 - 1
api/biService.api

@@ -47,7 +47,7 @@ type (
 		PositionId       int64                    `header:"positionId,optional"`
 		IsTask           int64                    `json:"isTask"`
 		DataType         int64                    `json:"dataType"`
-		UpdataPositionID int64                    `json:"updataPositionID"`
+		UpdatePositionID int64                    `json:"updatePositionID"`
 	}
 	ClueImportReq {
 		PositionId int64  `header:"positionId,optional"`

+ 35 - 35
api/internal/handler/routes.go

@@ -14,8 +14,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/ClueAdd",
-				Handler: ClueAddHandler(serverCtx),
+				Path:    "/biService/myDataAsset",
+				Handler: MyDataAssetHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -24,34 +24,19 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/allInfoExport",
-				Handler: allInfoExportHandler(serverCtx),
-			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/biService/allProjectExport",
-				Handler: allProjectExportHandler(serverCtx),
+				Path:    "/biService/getInfoId",
+				Handler: GetInfoIdHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/autoFollow",
-				Handler: AutoFollowHandler(serverCtx),
+				Path:    "/biService/drawClue",
+				Handler: DrawClueHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/biService/call",
 				Handler: CallHandler(serverCtx),
 			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/biService/clueImport",
-				Handler: ClueImportHandler(serverCtx),
-			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/biService/clueImportTt",
-				Handler: ClueImportTlHandler(serverCtx),
-			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/biService/distributeClue",
@@ -64,28 +49,28 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/drawClue",
-				Handler: DrawClueHandler(serverCtx),
+				Path:    "/biService/clueImport",
+				Handler: ClueImportHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/getCompanyType",
-				Handler: getCompanyTypeHandler(serverCtx),
+				Path:    "/biService/ClueAdd",
+				Handler: ClueAddHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/getInfoId",
-				Handler: GetInfoIdHandler(serverCtx),
+				Path:    "/biService/clueImportTt",
+				Handler: ClueImportTlHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/infoOperate",
-				Handler: infoOperateHandler(serverCtx),
+				Path:    "/biService/autoFollow",
+				Handler: AutoFollowHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/myDataAsset",
-				Handler: MyDataAssetHandler(serverCtx),
+				Path:    "/biService/sqlManage",
+				Handler: sqlManageHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -99,13 +84,28 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/sendMail",
-				Handler: sendMailHandler(serverCtx),
+				Path:    "/biService/allProjectExport",
+				Handler: allProjectExportHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/biService/sqlManage",
-				Handler: sqlManageHandler(serverCtx),
+				Path:    "/biService/allInfoExport",
+				Handler: allInfoExportHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/infoOperate",
+				Handler: infoOperateHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/getCompanyType",
+				Handler: getCompanyTypeHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/biService/sendMail",
+				Handler: sendMailHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,

+ 1 - 1
api/internal/logic/distributeclueshowlogic.go

@@ -41,7 +41,7 @@ func (l *DistributeClueShowLogic) DistributeClueShow(req *types.DistributeClueSh
 		PositionId:       req.PositionId,
 		Datas:            datas,
 		IsTask:           req.IsTask,
-		UpdataPositionID: req.UpdataPositionID,
+		UpdatePositionID: req.UpdatePositionID,
 	})
 	return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data}, err
 }

+ 4 - 2
api/internal/svc/servicecontext.go

@@ -22,13 +22,15 @@ func NewServiceContext(c config.Config) *ServiceContext {
 		BiServiceRpc: biservice.NewBiService(zrpc.MustNewClient(c.BiServiceRpc)),
 		ResourceCenterRpc: resource.NewResource(zrpc.MustNewClient(zrpc.RpcClientConf{
 			Etcd: discov.EtcdConf{
-				Hosts: c.BiServiceRpc.Etcd.Hosts,
+				//Hosts: c.BiServiceRpc.Etcd.Hosts,
+				Hosts: []string{"192.168.3.206:2379"},
 				Key:   c.ResourceCenterKey,
 			},
 		})),
 		UserCenterRpc: usercenter.NewUserCenter(zrpc.MustNewClient(zrpc.RpcClientConf{
 			Etcd: discov.EtcdConf{
-				Hosts: c.BiServiceRpc.Etcd.Hosts,
+				//Hosts: c.BiServiceRpc.Etcd.Hosts,
+				Hosts: []string{"192.168.3.206:2379"},
 				Key:   c.UserCenterKey,
 			},
 		})),

+ 1 - 1
api/internal/types/types.go

@@ -54,7 +54,7 @@ type DistributeClueShowReq struct {
 	PositionId       int64                    `header:"positionId,optional"`
 	IsTask           int64                    `json:"isTask"`
 	DataType         int64                    `json:"dataType"`
-	UpdataPositionID int64                    `json:"updataPositionID"`
+	UpdatePositionID int64                    `json:"updatePositionID"`
 }
 
 type ClueImportReq struct {

+ 2 - 1
rpc/biService.proto

@@ -163,7 +163,7 @@ message DistributeClueShowReq {
 	string clueIdList = 3;
 	repeated DistributeClueShows datas = 4;
 	int64 IsTask = 5;
-	int64 UpdataPositionID=6;
+	int64 UpdatePositionID=6;
 }
 
 message DistributeClueShows {
@@ -177,6 +177,7 @@ message DistributeClueShowss {
 	int64 minCount = 4;
 	int64 companyCounts = 5;
 	int64 existingCount=6;
+	bool FullStatus=7;
 }
 
 message DistributeClueShowResp {

+ 17 - 7
rpc/pb/biService.pb.go

@@ -1630,7 +1630,7 @@ type DistributeClueShowReq struct {
 	ClueIdList       string                 `protobuf:"bytes,3,opt,name=clueIdList,proto3" json:"clueIdList,omitempty"`
 	Datas            []*DistributeClueShows `protobuf:"bytes,4,rep,name=datas,proto3" json:"datas,omitempty"`
 	IsTask           int64                  `protobuf:"varint,5,opt,name=IsTask,proto3" json:"IsTask,omitempty"`
-	UpdataPositionID int64                  `protobuf:"varint,6,opt,name=UpdataPositionID,proto3" json:"UpdataPositionID,omitempty"`
+	UpdatePositionID int64                  `protobuf:"varint,6,opt,name=UpdatePositionID,proto3" json:"UpdatePositionID,omitempty"`
 }
 
 func (x *DistributeClueShowReq) Reset() {
@@ -1700,9 +1700,9 @@ func (x *DistributeClueShowReq) GetIsTask() int64 {
 	return 0
 }
 
-func (x *DistributeClueShowReq) GetUpdataPositionID() int64 {
+func (x *DistributeClueShowReq) GetUpdatePositionID() int64 {
 	if x != nil {
-		return x.UpdataPositionID
+		return x.UpdatePositionID
 	}
 	return 0
 }
@@ -1773,6 +1773,7 @@ type DistributeClueShowss struct {
 	MinCount      int64 `protobuf:"varint,4,opt,name=minCount,proto3" json:"minCount,omitempty"`
 	CompanyCounts int64 `protobuf:"varint,5,opt,name=companyCounts,proto3" json:"companyCounts,omitempty"`
 	ExistingCount int64 `protobuf:"varint,6,opt,name=existingCount,proto3" json:"existingCount,omitempty"`
+	FullStatus    bool  `protobuf:"varint,7,opt,name=FullStatus,proto3" json:"FullStatus,omitempty"`
 }
 
 func (x *DistributeClueShowss) Reset() {
@@ -1849,6 +1850,13 @@ func (x *DistributeClueShowss) GetExistingCount() int64 {
 	return 0
 }
 
+func (x *DistributeClueShowss) GetFullStatus() bool {
+	if x != nil {
+		return x.FullStatus
+	}
+	return false
+}
+
 type DistributeClueShowResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2300,16 +2308,16 @@ var file_biService_proto_rawDesc = []byte{
 	0x32, 0x14, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75,
 	0x65, 0x53, 0x68, 0x6f, 0x77, 0x73, 0x52, 0x05, 0x64, 0x61, 0x74, 0x61, 0x73, 0x12, 0x16, 0x0a,
 	0x06, 0x49, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x49,
-	0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x2a, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x61, 0x50,
+	0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x2a, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50,
 	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49,
+	0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49,
 	0x44, 0x22, 0x61, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x43,
 	0x6c, 0x75, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x73, 0x69,
 	0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f,
 	0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x74,
 	0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01,
 	0x28, 0x03, 0x52, 0x10, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x43,
-	0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe0, 0x01, 0x0a, 0x14, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62,
+	0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x02, 0x0a, 0x14, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62,
 	0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x73, 0x73, 0x12, 0x1e, 0x0a,
 	0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
 	0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a,
@@ -2323,7 +2331,9 @@ var file_biService_proto_rawDesc = []byte{
 	0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74,
 	0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75,
 	0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69,
-	0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x7f, 0x0a, 0x16, 0x44, 0x69, 0x73, 0x74, 0x72,
+	0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x75, 0x6c, 0x6c, 0x53,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x46, 0x75, 0x6c,
+	0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x7f, 0x0a, 0x16, 0x44, 0x69, 0x73, 0x74, 0x72,
 	0x69, 0x62, 0x75, 0x74, 0x65, 0x43, 0x6c, 0x75, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73,
 	0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,

+ 26 - 17
service/company.go

@@ -66,8 +66,11 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 		m.ClueCount = 0
 		m.CompanyCounts = 0
 		//现有数据查询
-		existingCount := JyBiTidb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and trailstatus != '08' `, m.PositionId)
+		existingCount := JyBiTidb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and  is_assign=1 and trailstatus != '08' `, m.PositionId)
 		m.ExistingCount = existingCount
+		if existingCount > allocationCap {
+			m.FullStatus = true
+		}
 		if this.DataType == 1 {
 			m.CompanyCount = 0
 			m.MinCount = 0
@@ -253,38 +256,44 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq, allocationCap int
 				minCount, minIndex := int64(0), 0
 				isindexok := false
 				for k, r := range rdata {
-					if this.DataType == 1 {
-						if k == 0 {
-							minCount = r.CompanyCounts
-						}
-					} else {
-						if r.CompanyCounts < r.CompanyCount {
-							minCount = r.CompanyCounts
+					if !r.FullStatus {
+						if this.DataType == 1 {
+							if k == 0 {
+								minCount = r.CompanyCounts
+							}
+						} else {
+							if r.CompanyCounts < r.CompanyCount {
+								minCount = r.CompanyCounts
+							}
 						}
 					}
 				}
 				for _, r := range rdata {
-					if this.DataType == 1 {
-						if r.CompanyCounts < minCount {
-							minCount = r.CompanyCounts
-						}
-					} else {
-						if r.CompanyCounts < minCount && r.CompanyCounts < r.CompanyCount {
-							minCount = r.CompanyCounts
+					if !r.FullStatus {
+						if this.DataType == 1 {
+							if r.CompanyCounts < minCount {
+								minCount = r.CompanyCounts
+							}
+						} else {
+							if r.CompanyCounts < minCount && r.CompanyCounts < r.CompanyCount {
+								minCount = r.CompanyCounts
+							}
 						}
 					}
 				}
 				for k, r := range rdata {
 					countNumber := rdata[minIndex].ExistingCount + rdata[minIndex].ClueCount + int64(count)
 					fmt.Println(1111, k, rdata[minIndex], rdata[minIndex].ExistingCount, rdata[minIndex].ClueCount, int64(count))
-					if countNumber >= allocationCap {
+					if countNumber >= allocationCap || r.FullStatus {
 						if gconv.Int(allocationCap-rdata[minIndex].ExistingCount-rdata[minIndex].ClueCount) == 0 {
+							r.FullStatus = true
 							minIndex = minIndex + 1
 							continue
 						} else {
+							r.FullStatus = true
 							count = gconv.Int(allocationCap - rdata[minIndex].ExistingCount - rdata[minIndex].ClueCount)
 						}
-						if this.UpdataPositionID == rdata[minIndex].PositionId {
+						if this.UpdatePositionID == rdata[minIndex].PositionId {
 							return &biservice.DistributeClueShowResp{
 								ErrorCode: 1,
 								ErrorMsg:  "线索已达上限",