瀏覽代碼

feat:终止参标不参与统计

fuwencai 1 年之前
父節點
當前提交
36af40780a

+ 11 - 0
jyBXCore/rpc/model/mysql/participateBid.go

@@ -902,6 +902,17 @@ func InsertBidContent(recordData map[string]interface{}) (flag bool) {
 	return r2 > 0
 }
 
+// InsertBidContent 新增投标状态信息及操作记录
+func UpdateParticipateUserTable(projectId string, positionId int64) (flag bool) {
+	r2 := IC.BaseMysql.Update(ParticipateUserTable, map[string]interface{}{
+		"project_id":  projectId,
+		"position_id": positionId,
+	}, map[string]interface{}{
+		"update_date": date.NowFormat(date.Date_Full_Layout),
+	})
+	return r2
+}
+
 // GetBidRecordsEnt 获取操作记录列表企业
 func GetBidRecordsEnt(projectId string, entId, page, pageSize int64) (rs *[]map[string]interface{}, total int64) {
 	query := "SELECT * FROM " + ParticipateBidRecordsTable + " where project_id=? and ent_id=?   order by create_date desc limit ?,?"

+ 1 - 0
jyBXCore/rpc/service/participateBid.go

@@ -305,6 +305,7 @@ func (p *ParticipateBid) UpdateBidStatus(in *bxcore.UpdateBidStatusReq, projectI
 	if flag := mysql.InsertBidContent(recordData); !flag {
 		return fmt.Errorf("更新失败")
 	}
+	mysql.UpdateParticipateUserTable(projectId, p.PositionId)
 	return nil
 
 }

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

@@ -205,7 +205,8 @@ type ProjectData struct {
 	EndNumb                map[string]interface{} //终止数量
 	participateProjectNumb map[string]interface{} // 参标数量
 	Stage                  map[string]map[string]interface{}
-	StageStr               map[string]string // 字符串处理
+	StageStr               map[string]string   // 字符串处理
+	EndProject             map[string]struct{} // 终止参标项目不参与统计
 }
 
 func PushHandle(data *[]map[string]interface{}, users *[]map[string]interface{}, isAdmin bool, isManager bool) []*bxcore.PushStatisticsData {
@@ -359,7 +360,13 @@ func ProjectHandle(data *[]map[string]interface{}, users *[]map[string]interface
 					(*result)[userId].StageStr = map[string]string{}
 				}
 				(*result)[userId].StageStr[project_id] = stage
+				isEnd_ := common.IntAll(v["is_end"])
+				if isEnd_ == 1 {
+					// 标记成已结束
+					(*result)[userId].EndProject[project_id] = struct{}{}
+				}
 			}
+
 		}
 		existProject := map[string]struct{}{}
 		for _, v := range *data {
@@ -371,6 +378,14 @@ func ProjectHandle(data *[]map[string]interface{}, users *[]map[string]interface
 			}
 			project_id := common.InterfaceToStr(common.InterfaceToStr(v["project_id"]))
 			if (*result)[userId] != nil {
+				//终止参保统计
+				if common.Int64All(v["isend"]) != 0 {
+					(*result)[userId].EndNumb = DataHanle((*result)[userId].EndNumb, project_id)
+				}
+				// 已经终止的不参与统计数量
+				if _, ok := (*result)[userId].EndProject[project_id]; ok {
+					continue
+				}
 				//  参标数量
 				(*result)[userId].participateProjectNumb = DataHanle((*result)[userId].participateProjectNumb, project_id)
 				//投标数量
@@ -411,10 +426,7 @@ func ProjectHandle(data *[]map[string]interface{}, users *[]map[string]interface
 						delete((*result)[userId].DirectWinNumb, project_id)
 					}
 				}
-				//终止参保统计
-				if common.Int64All(v["isend"]) != 0 {
-					(*result)[userId].EndNumb = DataHanle((*result)[userId].EndNumb, project_id)
-				}
+
 				if bidWay == 0 {
 					// 投标类型为全部时不需要统计勾选的数量
 					continue