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

feat:core 返回投标截止时间

fuwencai 2 лет назад
Родитель
Сommit
cce067e909

+ 1 - 0
jyBXCore/rpc/bxcore.proto

@@ -175,6 +175,7 @@ message ParticipateDetailInfo{
   bool showTransfer = 3;// 转给同事按钮是否展示:true-展示 false-不展示
   string userName = 4;//参标人姓名 逗号分割
   string projectId = 5;// 项目id
+  int64 bidEndTime = 6 ;// 投标截止时间
 
 }
 message ParticipateInfoRes{

+ 4 - 3
jyBXCore/rpc/internal/logic/participateinfologic.go

@@ -59,6 +59,7 @@ func (l *ParticipateInfoLogic) ParticipateInfo(in *bxcore.ParticipateInfoReq) (*
 	// 判断是否已经过了开标时间
 	var isValid bool
 	bidopentime := common.Int64All((*projectInfos)[0]["bidopentime"])
+	bidendtime := common.Int64All((*projectInfos)[0]["bidendtime"])
 	if time.Now().Unix() >= bidopentime || bidopentime == 0 {
 		isValid = true
 	}
@@ -69,11 +70,11 @@ func (l *ParticipateInfoLogic) ParticipateInfo(in *bxcore.ParticipateInfoReq) (*
 	switch int(in.PositionType) {
 	case service.PositionTypePersonal:
 		existList := participateService.PersonalExistProject(projectIds)
-		formatData = participateService.DetailPersonalFormat(existList, isValid)
+		formatData = participateService.DetailPersonalFormat(existList, isValid, bidendtime)
 	case service.PositionTypeEnt:
 		isAllow := util.IsALLow(in.EntId)
-		existList := participateService.EntExistProject(projectIds)                  // 查询出已经存在的
-		formatData = participateService.DetailEntFormat(existList, isValid, isAllow) // 格式化数据
+		existList := participateService.EntExistProject(projectIds)                              // 查询出已经存在的
+		formatData = participateService.DetailEntFormat(existList, isValid, isAllow, bidendtime) // 格式化数据
 	}
 	result.Data = formatData
 	return &result, nil

+ 1 - 1
jyBXCore/rpc/model/es/project.go

@@ -46,7 +46,7 @@ func GetProjectByInfoId(infoIds []string) *[]map[string]interface{} {
 	if len(infoIds) == 0 {
 		return nil
 	}
-	query := `{"_source":["_id","list.infoid","ids","bidopentime"],"query":{"bool":{"must":[{"terms":{"list.infoid":["` + strings.Join(infoIds, "\",\"") + `"]}}]}}}`
+	query := `{"_source":["_id","list.infoid","ids","bidopentime","bidendtime"],"query":{"bool":{"must":[{"terms":{"list.infoid":["` + strings.Join(infoIds, "\",\"") + `"]}}]}}}`
 
 	projectResult := elastic.Get(IndexProjectSet, TypeProjectSet, query)
 	return projectResult

+ 4 - 2
jyBXCore/rpc/service/participateBid.go

@@ -145,7 +145,7 @@ func (p *ParticipateBid) ListEntFormat(existProjectMap, infoM map[string]string,
 }
 
 // DetailEntFormat 企业版 详情页数据格式化  返回数据 参标按钮 终止参标按钮 转给同事按钮 参标人姓名
-func (p *ParticipateBid) DetailEntFormat(existProjectMap map[string]string, isValid, isAllow bool) (formatData *bxcore.ParticipateDetailInfo) {
+func (p *ParticipateBid) DetailEntFormat(existProjectMap map[string]string, isValid, isAllow bool, bidEndTime int64) (formatData *bxcore.ParticipateDetailInfo) {
 	// 处理成 要返回的返回数据
 	formatData = &bxcore.ParticipateDetailInfo{}
 	if len(existProjectMap) == 0 && isValid {
@@ -153,6 +153,7 @@ func (p *ParticipateBid) DetailEntFormat(existProjectMap map[string]string, isVa
 		formatData.ShowParticipate = true
 		return
 	}
+	formatData.BidEndTime = bidEndTime
 	persons := ""
 	projectId := ""
 	for k, v := range existProjectMap { // 这是为了取参标人id信息 列表页是多条数据 详情页这里 map里面只会有一条数据
@@ -185,7 +186,7 @@ func (p *ParticipateBid) DetailEntFormat(existProjectMap map[string]string, isVa
 }
 
 // DetailPersonalFormat 详情页个人版 按钮格式化数据
-func (p *ParticipateBid) DetailPersonalFormat(existProjectSet map[string]struct{}, isValid bool) (formatData *bxcore.ParticipateDetailInfo) {
+func (p *ParticipateBid) DetailPersonalFormat(existProjectSet map[string]struct{}, isValid bool, bidEndTime int64) (formatData *bxcore.ParticipateDetailInfo) {
 	// 处理成 要返回的返回数据
 	formatData = &bxcore.ParticipateDetailInfo{}
 	if !isValid {
@@ -193,6 +194,7 @@ func (p *ParticipateBid) DetailPersonalFormat(existProjectSet map[string]struct{
 	}
 	// 存在在说明已经参标  显示终止参标
 	if len(existProjectSet) > 0 {
+		formatData.BidEndTime = bidEndTime
 		formatData.ShowStopParticipate = true
 	} else {
 		// 不存在则说明 未参标 参标按钮展示

+ 13 - 3
jyBXCore/rpc/type/bxcore/bxcore.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.28.0
-// 	protoc        v3.15.5
+// 	protoc        v3.19.4
 // source: bxcore.proto
 
 package bxcore
@@ -1538,6 +1538,7 @@ type ParticipateDetailInfo struct {
 	ShowTransfer        bool   `protobuf:"varint,3,opt,name=showTransfer,proto3" json:"showTransfer,omitempty"`               // 转给同事按钮是否展示:true-展示 false-不展示
 	UserName            string `protobuf:"bytes,4,opt,name=userName,proto3" json:"userName,omitempty"`                        //参标人姓名 逗号分割
 	ProjectId           string `protobuf:"bytes,5,opt,name=projectId,proto3" json:"projectId,omitempty"`                      // 项目id
+	BidEndTime          int64  `protobuf:"varint,6,opt,name=bidEndTime,proto3" json:"bidEndTime,omitempty"`                   // 投标截止时间
 }
 
 func (x *ParticipateDetailInfo) Reset() {
@@ -1607,6 +1608,13 @@ func (x *ParticipateDetailInfo) GetProjectId() string {
 	return ""
 }
 
+func (x *ParticipateDetailInfo) GetBidEndTime() int64 {
+	if x != nil {
+		return x.BidEndTime
+	}
+	return 0
+}
+
 type ParticipateInfoRes struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -4051,7 +4059,7 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
 	0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
 	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xd1, 0x01, 0x0a, 0x15, 0x50,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xf1, 0x01, 0x0a, 0x15, 0x50,
 	0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
 	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x68, 0x6f, 0x77, 0x50, 0x61, 0x72, 0x74,
 	0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x73,
@@ -4064,7 +4072,9 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x73, 0x66, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
 	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
 	0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x7b,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1e,
+	0x0a, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x7b,
 	0x0a, 0x12, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66,
 	0x6f, 0x52, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65,
 	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,

+ 1 - 1
jyBXCore/rpc/type/bxcore/bxcore_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.15.5
+// - protoc             v3.19.4
 // source: bxcore.proto
 
 package bxcore