Kaynağa Gözat

feat:采购单位

wangshan 3 yıl önce
ebeveyn
işleme
ed85f734c8

+ 1 - 0
jyBXBuyer/rpc/bxbuyer.proto

@@ -42,6 +42,7 @@ message  BuyerList {
   int64  pCount = 5;//项目数量
   bool  isFollowed = 6;//是否关注
   bool  isReceived = 7;//是否已领取
+  string  recId = 8;//领取id
 }
 
 service Bxbuyer {

+ 15 - 6
jyBXBuyer/rpc/model/buyerListBYEs.go

@@ -2,6 +2,7 @@ package model
 
 import (
 	MC "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/esv1"
 	"encoding/json"
 	"fmt"
@@ -10,6 +11,7 @@ import (
 	"jyBXBuyer/rpc/type/bxbuyer"
 	"log"
 	"runtime"
+	"strconv"
 	"strings"
 	"sync"
 	"time"
@@ -190,10 +192,11 @@ func GetBuyerList(qstr string, in *bxbuyer.BuyerListReq, isCache bool) (resp *bx
 						isFws = IsFollowd(buyerNames, userId)
 					}
 					//领取状态
-					isRws := map[string]bool{}
+					isRws := map[string]string{}
 					if icr {
 						isRws = IsReceived(buyerNames, entUserId)
 					}
+					log.Println("---:", isRws)
 					for _, fv := range fiftyArr {
 						fv.Province = infoMap[fv.Buyer].Province
 						fv.City = infoMap[fv.Buyer].City
@@ -201,7 +204,10 @@ func GetBuyerList(qstr string, in *bxbuyer.BuyerListReq, isCache bool) (resp *bx
 							fv.IsFollowed = isFws[fv.Buyer]
 						}
 						if icr {
-							fv.IsReceived = isRws[fv.Buyer]
+							if isRws[fv.Buyer] != "" {
+								fv.RecId = isRws[fv.Buyer]
+								fv.IsReceived = true
+							}
 						}
 					}
 					wg.Done()
@@ -307,15 +313,18 @@ var (
 )
 
 //领取状态
-func IsReceived(buyerNames []string, entUserId string) (isRws map[string]bool) {
+func IsReceived(buyerNames []string, entUserId string) (isRws map[string]string) {
 	//新加领取的客户id----保证领取的唯一性
 	receInfos := IC.MainMysql.SelectBySql(fmt.Sprintf("SELECT ecn.id,  ecn.name  FROM %s ecn,%s  euu WHERE ecn.id = euu.customer_id AND euu.user_id =? AND ecn.`name` IN  ('%s') AND (euu.source_type =1 or euu.source_type=4)", Entniche_customer, Entniche_user_customer, strings.Join(buyerNames, "','")), entUserId)
+	log.Println("---:", len(*receInfos))
 	if receInfos != nil {
 		if len(*receInfos) > 0 {
-			isRws = map[string]bool{}
+			isRws = map[string]string{}
 			for _, rv := range *receInfos {
-				if MC.ObjToString(rv["name"]) != "" {
-					isRws[MC.ObjToString(rv["name"])] = true
+				log.Println(strconv.Itoa(MC.IntAll(rv["id"])), "name:", rv["name"])
+				if MC.ObjToString(rv["name"]) != "" && strconv.Itoa(MC.IntAll(rv["id"])) != "" {
+					log.Println("------------------------")
+					isRws[MC.ObjToString(rv["name"])] = encrypt.SE.Encode2HexByCheck(strconv.Itoa(MC.IntAll(rv["id"])))
 				}
 			}
 		}

+ 17 - 8
jyBXBuyer/rpc/type/bxbuyer/bxbuyer.pb.go

@@ -338,6 +338,7 @@ type BuyerList struct {
 	PCount     int64   `protobuf:"varint,5,opt,name=pCount,proto3" json:"pCount,omitempty"`         //项目数量
 	IsFollowed bool    `protobuf:"varint,6,opt,name=isFollowed,proto3" json:"isFollowed,omitempty"` //是否关注
 	IsReceived bool    `protobuf:"varint,7,opt,name=isReceived,proto3" json:"isReceived,omitempty"` //是否已领取
+	RecId      string  `protobuf:"bytes,8,opt,name=recId,proto3" json:"recId,omitempty"`            //领取id
 }
 
 func (x *BuyerList) Reset() {
@@ -421,6 +422,13 @@ func (x *BuyerList) GetIsReceived() bool {
 	return false
 }
 
+func (x *BuyerList) GetRecId() string {
+	if x != nil {
+		return x.RecId
+	}
+	return ""
+}
+
 var File_bxbuyer_proto protoreflect.FileDescriptor
 
 var file_bxbuyer_proto_rawDesc = []byte{
@@ -470,7 +478,7 @@ var file_bxbuyer_proto_rawDesc = []byte{
 	0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12,
 	0x26, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
 	0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73,
-	0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xc1, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x65,
+	0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xd7, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x65,
 	0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62,
 	0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x62, 0x75, 0x64,
@@ -482,13 +490,14 @@ var file_bxbuyer_proto_rawDesc = []byte{
 	0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52,
 	0x0a, 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69,
 	0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,
-	0x0a, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x32, 0x45, 0x0a, 0x07, 0x42,
-	0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x09, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c,
-	0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75,
-	0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x62, 0x78, 0x62,
-	0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
-	0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x62,
-	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x0a, 0x69, 0x73, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72,
+	0x65, 0x63, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x63, 0x49,
+	0x64, 0x32, 0x45, 0x0a, 0x07, 0x42, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x09,
+	0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x62, 0x78, 0x62, 0x75,
+	0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
+	0x1a, 0x16, 0x2e, 0x62, 0x78, 0x62, 0x75, 0x79, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x79, 0x65, 0x72,
+	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x62, 0x78,
+	0x62, 0x75, 0x79, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (