Browse Source

wip:开发中

fuwencai 1 year ago
parent
commit
891df4c39a

+ 9 - 0
.gitignore

@@ -0,0 +1,9 @@
+/jyBXBuyer/rpc/jylog/
+/jyBXBuyer/api/jylog/
+*.exe
+*_linux
+/jyBXBase/.output/
+/jyBXBase/rpc/jylog/
+/jyBXBase/api/jylog/
+/jyBXCore/rpc/jylog/
+*.log

+ 9 - 1
jyBXCore/api/bxcore.api

@@ -48,6 +48,12 @@ type (
 		Err_msg  string      `json:"error_msg"`
 		Data     interface{} `json:"data"`
 	}
+	commonPushResp {
+		Err_code   int64       `json:"error_code"`
+		Err_msg    string      `json:"error_msg"`
+		Data       interface{} `json:"data"`
+		SourceItem interface{} `json:"sourceItem"`
+	}
 	//
 	searchLimitReq {
 		AppId      string `header:"appId,optional"`    //appid
@@ -164,6 +170,8 @@ type (
 		EntUserIdArr []string `json:"entUserIdArr,optional"`
 		StartTime    int64    `json:"startTime,optional"`
 		EndTime      int64    `json:"endTime,optional"`
+		Source       int64    `json:"source,optional"` // 标讯项目来源 -1:全部  1:个人订阅 2:企业自动分发 3:企业手动分发
+		BidWay       int64    `json:"bidWay,optional"` // 投标类型 -1:全部 1:直接投标 2:渠道投标
 	}
 	polymerizeSearchReq {
 		SearchCode   string `json:"searchCode"`
@@ -202,7 +210,7 @@ service bxcore-api {
 	@handler participateList //我的参标项目列表|企业参标项目列表
 	post /jybx/core/participate/:identity/list(participateListReq) returns (commonResp)
 	@handler pushStatistics //	订阅推送统计
-	post /jybx/core/statistics/pushStatistics(ptatisticsListReq) returns (commonResp)
+	post /jybx/core/statistics/pushStatistics(ptatisticsListReq) returns (commonPushResp)
 	@handler projectStatistics//参标项目统计
 	post /jybx/core/statistics/projectStatistics(ptatisticsListReq) returns (commonResp)
 	@handler polymerizeSearch//参标项目统计

+ 5 - 3
jyBXCore/api/internal/logic/pushStatisticsLogic.go

@@ -25,7 +25,7 @@ func NewPushStatisticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Pu
 	}
 }
 
-func (l *PushStatisticsLogic) PushStatistics(req *types.PtatisticsListReq) (resp *types.CommonResp, err error) {
+func (l *PushStatisticsLogic) PushStatistics(req *types.PtatisticsListReq) (resp *types.CommonPushResp, err error) {
 	// todo: add your logic here and delete this line
 	for k, v := range req.EntUserIdArr {
 		req.EntUserIdArr[k] = encrypt.SE.Decode4Hex(v)
@@ -38,11 +38,13 @@ func (l *PushStatisticsLogic) PushStatistics(req *types.PtatisticsListReq) (resp
 		DeptId:       req.DeptId,
 		StartTime:    req.StartTime,
 		EndTime:      req.EndTime,
+		Source:       req.Source,
 	})
 	if err != nil {
 		return nil, err
 	}
-	return &types.CommonResp{
-		Data: res.Data,
+	return &types.CommonPushResp{
+		Data:       res.Data,
+		SourceItem: res.SourceItem,
 	}, nil
 }

+ 9 - 0
jyBXCore/api/internal/types/types.go

@@ -42,6 +42,13 @@ type CommonResp struct {
 	Data     interface{} `json:"data"`
 }
 
+type CommonPushResp struct {
+	Err_code   int64       `json:"error_code"`
+	Err_msg    string      `json:"error_msg"`
+	Data       interface{} `json:"data"`
+	SourceItem interface{} `json:"sourceItem"`
+}
+
 type SearchLimitReq struct {
 	AppId      string `header:"appId,optional"`    //appid
 	TimeOut    int64  `json:"timeOut,optional"`    //过滤过期时间
@@ -157,6 +164,8 @@ type PtatisticsListReq struct {
 	EntUserIdArr []string `json:"entUserIdArr,optional"`
 	StartTime    int64    `json:"startTime,optional"`
 	EndTime      int64    `json:"endTime,optional"`
+	Source       int64    `json:"source,optional"` // 标讯项目来源 -1:全部  1:个人订阅 2:企业自动分发 3:企业手动分发
+	BidWay       int64    `json:"bidWay,optional"` // 投标类型 -1:全部 1:直接投标 2:渠道投标
 }
 
 type PolymerizeSearchReq struct {

+ 17 - 0
jyBXCore/rpc/bxcore.proto

@@ -450,11 +450,20 @@ message StatisticsListReq{
   int64  deptId = 5; //部门id
   int64 startTime = 6;
   int64 endTime = 7;
+  int64 source = 8; // source  0:全部  1:个人订阅 2:企业自动分发 3:企业手动分发
+  int64 bidWay = 9; //   -1:全部 1:直接投标 2:渠道投标
+
+}
+// 筛选项
+message sourceItem{
+ string Name =1;
+ int64  Value =2;
 }
 message PushStatisticsDataRes{
   int64 err_code = 1;
   string err_msg = 2;
   repeated PushStatisticsData data = 3;
+  repeated sourceItem sourceItem = 4; // 来源的筛选项
 }
 message PushStatisticsData{
   string  personName = 1;
@@ -483,6 +492,14 @@ message ProjectStatisticsData{
   int64   notBidNumber = 9; //未中标数量
   int64   endNumb = 10; //终止数量
   string  entUserId = 11;
+  int64   participateProjectNumb = 12;// 参标数量
+  int64   registeredNumb = 13;// 已报名数量
+  int64   decisionMakingNumb = 14;// 投标决策阶段
+  int64   compileDocsNumb = 15;// 编织投标文件阶段
+  int64   submitDocsNumb = 16;// 递交投标文件
+  int64   bidPublicityNumb = 17;// 中标公示
+  int64   signContractNumb = 18;// 签合同
+  int64   endedNumb = 19;// 已结束
 }
 message  PolymerizeSearchReq{
   int64  entId = 1; //企业id

+ 1 - 0
jyBXCore/rpc/bxcore/bxcore.go

@@ -57,6 +57,7 @@ type (
 	SearchResp               = bxcore.SearchResp
 	SearchReturn             = bxcore.SearchReturn
 	ShowInfo                 = bxcore.ShowInfo
+	SourceItem               = bxcore.SourceItem
 	StatisticsListReq        = bxcore.StatisticsListReq
 	TipInfo                  = bxcore.TipInfo
 	UpdateBidStatusReq       = bxcore.UpdateBidStatusReq

+ 1 - 1
jyBXCore/rpc/internal/logic/pushstatisticslogic.go

@@ -33,7 +33,7 @@ func (l *PushStatisticsLogic) PushStatistics(in *bxcore.StatisticsListReq) (*bxc
 		DeptId:     in.EntId,
 		EntUserId:  in.EntUserId,
 	}
-	data := participateService.PushStatistics(in.EntUserIdArr, in.StartTime, in.EndTime)
+	data := participateService.PushStatistics(in.EntUserIdArr, in.StartTime, in.EndTime, in.Source)
 	return &bxcore.PushStatisticsDataRes{
 		ErrCode: 0,
 		ErrMsg:  "",

+ 11 - 5
jyBXCore/rpc/service/participateStatistics.go

@@ -24,11 +24,11 @@ type ParticipateStatistics struct {
 	EntUserId  int64
 }
 
-func (in *ParticipateStatistics) PushStatistics(entUserIdArr []string, startTime, endTime int64) (result []*bxcore.PushStatisticsData) {
+func (in *ParticipateStatistics) PushStatistics(entUserIdArr []string, startTime, endTime int64, source int64) (result []*bxcore.PushStatisticsData) {
 	//判断是企业、部门还是个人
 	isAdmin, personArrStr, users := in.PersonHandle(entUserIdArr)
 	//时间处理
-	query := QueryHandle(isAdmin, startTime, endTime, personArrStr)
+	query := QueryHandle(isAdmin, startTime, endTime, personArrStr, source, -1)
 	//推送数据查询
 	dataList := IC.BaseMysql.SelectBySql(fmt.Sprintf("select  * from  participate_push_statistics where %s order  by ymd", strings.Join(query, " and ")))
 	if users != nil && len(*users) > 0 {
@@ -37,10 +37,10 @@ func (in *ParticipateStatistics) PushStatistics(entUserIdArr []string, startTime
 	return
 }
 
-func (in *ParticipateStatistics) ProjectStatistics(entUserIdArr []string, startTime, endTime int64) (result []*bxcore.ProjectStatisticsData) {
+func (in *ParticipateStatistics) ProjectStatistics(entUserIdArr []string, startTime, endTime, bidWay int64) (result []*bxcore.ProjectStatisticsData) {
 	//判断是企业、部门还是个人
 	isAdmin, personArrStr, users := in.PersonHandle(entUserIdArr)
-	query := QueryHandle(isAdmin, startTime, endTime, personArrStr)
+	query := QueryHandle(isAdmin, startTime, endTime, personArrStr, -1, bidWay)
 	//订阅推送数处理
 	//推送数据查询
 	dataList := IC.BaseMysql.SelectBySql(fmt.Sprintf("select  * from  participate_project_statistics where %s order  by ymd", strings.Join(query, "and ")))
@@ -385,7 +385,7 @@ func DataHanle(data map[string]interface{}, project_id string) map[string]interf
 	}
 	return data
 }
-func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string) []string {
+func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string, source int64, bidWay int64) []string {
 	//时间处理
 	query := []string{}
 	if isAdmin {
@@ -406,5 +406,11 @@ func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string) []
 	if endTime != 0 {
 		query = append(query, fmt.Sprintf(" ymd <= %d ", endTime))
 	}
+	if source != -1 {
+		query = append(query, fmt.Sprintf("source = %d", source))
+	}
+	if bidWay != -1 {
+		query = append(query, fmt.Sprintf("bid_way = %d", bidWay))
+	}
 	return query
 }

File diff suppressed because it is too large
+ 387 - 295
jyBXCore/rpc/type/bxcore/bxcore.pb.go


Some files were not shown because too many files changed in this diff