wangshan пре 3 година
родитељ
комит
89680c4c03

+ 2 - 2
jyBXCore/api/bxcore.api

@@ -9,7 +9,7 @@ info (
 
 type (
 	searchReq {
-		AppId          string `header:"appId"`
+		AppId          string `header:"appId,optional"`
 		PageNum        int64  `json:"pageNum"`
 		PageSize       int64  `json:"pageSize"`
 		KeyWords       string `json:"keyWords,optional"`
@@ -36,7 +36,7 @@ type (
 	}
 	//
 	searchLimitReq {
-		AppId      string `header:"appId"`             //appid
+		AppId      string `header:"appId,optional"`    //appid
 		TimeOut    int64  `json:"timeOut,optional"`    //过滤过期时间
 		Count      int64  `json:"count,optional"`      //并发量
 		Flag       int64  `json:"flag,optional"`       //开关 1:打开;-1:关闭;-2:重置

+ 2 - 2
jyBXCore/api/internal/types/types.go

@@ -2,7 +2,7 @@
 package types
 
 type SearchReq struct {
-	AppId          string `header:"appId"`
+	AppId          string `header:"appId,optional"`
 	PageNum        int64  `json:"pageNum"`
 	PageSize       int64  `json:"pageSize"`
 	KeyWords       string `json:"keyWords,optional"`
@@ -29,7 +29,7 @@ type CommonResp struct {
 }
 
 type SearchLimitReq struct {
-	AppId      string `header:"appId"`             //appid
+	AppId      string `header:"appId,optional"`    //appid
 	TimeOut    int64  `json:"timeOut,optional"`    //过滤过期时间
 	Count      int64  `json:"count,optional"`      //并发量
 	Flag       int64  `json:"flag,optional"`       //开关 1:打开;-1:关闭;-2:重置

+ 7 - 4
jyBXCore/rpc/bxcore.proto

@@ -68,10 +68,13 @@ message  SearchList {
 }
 //
 message PInfo {
-  string approveCode =1;
-  string approveContent = 2;
-  string approveDept = 3;
-  string approveStatus = 4 ;
+  string approveCode =1;//项目代码
+  string approveContent = 2;//项目内容
+  string approveDept = 3;//审批部门
+  string approveStatus = 4 ;//审批状态
+  string approveTime = 5;//审批时间
+  string projectType = 6;//审批类型
+  string approveNumber = 7;//
 }
 //
 message SearchLimitReq {

+ 64 - 33
jyBXCore/rpc/type/bxcore/bxcore.pb.go

@@ -611,10 +611,13 @@ type PInfo struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	ApproveCode    string `protobuf:"bytes,1,opt,name=approveCode,proto3" json:"approveCode,omitempty"`
-	ApproveContent string `protobuf:"bytes,2,opt,name=approveContent,proto3" json:"approveContent,omitempty"`
-	ApproveDept    string `protobuf:"bytes,3,opt,name=approveDept,proto3" json:"approveDept,omitempty"`
-	ApproveStatus  string `protobuf:"bytes,4,opt,name=approveStatus,proto3" json:"approveStatus,omitempty"`
+	ApproveCode    string `protobuf:"bytes,1,opt,name=approveCode,proto3" json:"approveCode,omitempty"`       //项目代码
+	ApproveContent string `protobuf:"bytes,2,opt,name=approveContent,proto3" json:"approveContent,omitempty"` //项目内容
+	ApproveDept    string `protobuf:"bytes,3,opt,name=approveDept,proto3" json:"approveDept,omitempty"`       //审批部门
+	ApproveStatus  string `protobuf:"bytes,4,opt,name=approveStatus,proto3" json:"approveStatus,omitempty"`   //审批状态
+	ApproveTime    string `protobuf:"bytes,5,opt,name=approveTime,proto3" json:"approveTime,omitempty"`       //审批时间
+	ProjectType    string `protobuf:"bytes,6,opt,name=projectType,proto3" json:"projectType,omitempty"`       //审批类型
+	ApproveNumber  string `protobuf:"bytes,7,opt,name=approveNumber,proto3" json:"approveNumber,omitempty"`   //
 }
 
 func (x *PInfo) Reset() {
@@ -677,6 +680,27 @@ func (x *PInfo) GetApproveStatus() string {
 	return ""
 }
 
+func (x *PInfo) GetApproveTime() string {
+	if x != nil {
+		return x.ApproveTime
+	}
+	return ""
+}
+
+func (x *PInfo) GetProjectType() string {
+	if x != nil {
+		return x.ProjectType
+	}
+	return ""
+}
+
+func (x *PInfo) GetApproveNumber() string {
+	if x != nil {
+		return x.ApproveNumber
+	}
+	return ""
+}
+
 //
 type SearchLimitReq struct {
 	state         protoimpl.MessageState
@@ -940,7 +964,7 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x0d, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b,
 	0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x70,
 	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x99, 0x01,
+	0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x83, 0x02,
 	0x0a, 0x05, 0x50, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x72, 0x6f,
 	0x76, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x70,
 	0x70, 0x72, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x70, 0x70,
@@ -950,34 +974,41 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x44,
 	0x65, 0x70, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x74,
 	0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x72,
-	0x6f, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x0e, 0x53, 0x65,
-	0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05,
-	0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70,
-	0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05,
-	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75,
-	0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e,
-	0x74, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63,
-	0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
-	0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e,
-	0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x59,
-	0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73,
-	0x70, 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, 0x17, 0x0a, 0x07,
-	0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65,
-	0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x80, 0x01, 0x0a, 0x06, 0x42, 0x78,
-	0x43, 0x6f, 0x72, 0x65, 0x12, 0x36, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63,
-	0x68, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53,
-	0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72,
-	0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x0b,
-	0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x2e, 0x62, 0x78,
-	0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74,
-	0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61,
-	0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x5a, 0x08,
-	0x2e, 0x2f, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6f, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70,
+	0x72, 0x6f, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
+	0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a,
+	0x0d, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x4e, 0x75, 0x6d,
+	0x62, 0x65, 0x72, 0x22, 0xc2, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69,
+	0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07,
+	0x74, 0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74,
+	0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
+	0x66, 0x6c, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67,
+	0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x05,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65,
+	0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x61, 0x72,
+	0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65,
+	0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x59, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72,
+	0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 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, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73,
+	0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12,
+	0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x32, 0x80, 0x01, 0x0a, 0x06, 0x42, 0x78, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x36,
+	0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x12,
+	0x11, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52,
+	0x65, 0x71, 0x1a, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72,
+	0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
+	0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53,
+	0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e,
+	0x62, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4c, 0x69, 0x6d,
+	0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x62, 0x78, 0x63, 0x6f,
+	0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 9 - 27
jyBXCore/rpc/util/search.go

@@ -18,7 +18,6 @@ import (
 	"regexp"
 	"strconv"
 	"strings"
-	"time"
 	"unicode"
 )
 
@@ -224,6 +223,9 @@ func GetBidSearchData(in *bxcore.SearchReq) (count int64, list []*bxcore.SearchL
 					searchList.ProjectInfo.ApproveContent = MC.ObjToString((*pinfo)["approvecontent"])
 					searchList.ProjectInfo.ApproveDept = MC.ObjToString((*pinfo)["approvedept"])
 					searchList.ProjectInfo.ApproveStatus = MC.ObjToString((*pinfo)["approvestatus"])
+					searchList.ProjectInfo.ProjectType = MC.ObjToString((*pinfo)["projecttype"])
+					searchList.ProjectInfo.ApproveNumber = MC.ObjToString((*pinfo)["approvenumber"])
+					searchList.ProjectInfo.ApproveTime = MC.ObjToString((*pinfo)["approvetime"])
 				}
 				searchList.Winner = MC.ObjToString(v["winner"])
 				searchList.Buyer = MC.ObjToString(v["buyer"])
@@ -268,35 +270,12 @@ func GetBidSearchQuery(in *bxcore.SearchReq) string {
 	}
 	//发布时间
 	publishtime := in.PublishTime
-	if publishtime != "" {
+	if publishtime != "" && len(strings.Split(publishtime, "-")) > 1 {
 		if len(query) > 0 {
 			query += ","
 		}
-		starttime, endtime := "", ""
-		now := time.Now()
-		if publishtime == "lately-7" { //最近7天
-			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
-		} else if publishtime == "lately-30" { //最近30天
-			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
-		} else if publishtime == "thisyear" { //最近一年
-			starttime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
-			endtime = fmt.Sprint(now.Unix())
-		} else if publishtime == "threeyear" { //最近三年
-			starttime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
-			endtime = fmt.Sprint(now.Unix())
-		} else if publishtime == "fiveyear" { //最近五年
-			starttime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
-			endtime = fmt.Sprint(now.Unix())
-		} else {
-			starttime = strings.Split(publishtime, "_")[0]
-			endtime = strings.Split(publishtime, "_")[1]
-			etTime := time.Now()
-			if endtime != "" {
-				et, _ := strconv.ParseInt(endtime, 0, 64)
-				etTime = time.Unix(et, 0)
-			}
-			endtime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
-		}
+		starttime := strings.Split(publishtime, "-")[0]
+		endtime := strings.Split(publishtime, "-")[1]
 		query += `{"range":{"publishtime":{`
 		if starttime != "" {
 			query += `"gte":` + starttime
@@ -600,6 +579,9 @@ func SearchCahcheData(in *bxcore.SearchReq) (count int64, list []*bxcore.SearchL
 					searchList.ProjectInfo.ApproveContent = MC.ObjToString((*pinfo)["approvecontent"])
 					searchList.ProjectInfo.ApproveDept = MC.ObjToString((*pinfo)["approvedept"])
 					searchList.ProjectInfo.ApproveStatus = MC.ObjToString((*pinfo)["approvestatus"])
+					searchList.ProjectInfo.ProjectType = MC.ObjToString((*pinfo)["projecttype"])
+					searchList.ProjectInfo.ApproveNumber = MC.ObjToString((*pinfo)["approvenumber"])
+					searchList.ProjectInfo.ApproveTime = MC.ObjToString((*pinfo)["approvetime"])
 				}
 				searchList.Winner = MC.ObjToString(v["winner"])
 				searchList.Buyer = MC.ObjToString(v["buyer"])