|
@@ -538,7 +538,7 @@ func (in *ParticipateStatistics) ProjectDetails(entUserIdArr []string, detailReq
|
|
if dataList == nil && len(*dataList) == 0 {
|
|
if dataList == nil && len(*dataList) == 0 {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- // 处理数据 补充项目名称、推送表字段 格式化数据
|
|
|
|
|
|
+ // 处理数据 补充项目名称、推送表字段 、格式化数据
|
|
rs := ProjectDetailHandle(*dataList, in.EntId)
|
|
rs := ProjectDetailHandle(*dataList, in.EntId)
|
|
result = bxcore.DetailData{
|
|
result = bxcore.DetailData{
|
|
List: rs,
|
|
List: rs,
|
|
@@ -571,7 +571,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
query2 = append(query2, fmt.Sprintf(" FIND_IN_SET('%s', b.position_id) ", personArrStr))
|
|
query2 = append(query2, fmt.Sprintf(" FIND_IN_SET('%s', b.position_id) ", personArrStr))
|
|
query3 = append(query3, fmt.Sprintf(" FIND_IN_SET('%s', b.position_id) ", personArrStr))
|
|
query3 = append(query3, fmt.Sprintf(" FIND_IN_SET('%s', b.position_id) ", personArrStr))
|
|
}
|
|
}
|
|
- q := `SELECT A.project_id, B.stage,B.is_participate,B.bid_way
|
|
|
|
|
|
+ q := `SELECT A.project_id, B.stage
|
|
FROM
|
|
FROM
|
|
(SELECT DISTINCT(project_id)
|
|
(SELECT DISTINCT(project_id)
|
|
FROM
|
|
FROM
|
|
@@ -629,7 +629,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
if req.IsParticipate != -1 {
|
|
if req.IsParticipate != -1 {
|
|
query = append(query, fmt.Sprintf("a.isparticipate = %d", req.IsParticipate))
|
|
query = append(query, fmt.Sprintf("a.isparticipate = %d", req.IsParticipate))
|
|
}
|
|
}
|
|
- q = "select distinct(a.project_id),b.stage,b.is_participate,b.bid_way from participate_push_statistics a left join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
|
|
|
|
+ q = "select distinct(a.project_id),b.stage from participate_push_statistics a left join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
qCount = "select count(distinct(a.project_id),b.stage) from participate_push_statistics a left join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
qCount = "select count(distinct(a.project_id),b.stage) from participate_push_statistics a left join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
} else if queryType == 2 {
|
|
} else if queryType == 2 {
|
|
if isAdmin {
|
|
if isAdmin {
|
|
@@ -653,7 +653,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
if req.IsParticipate == 1 {
|
|
if req.IsParticipate == 1 {
|
|
query = append(query, fmt.Sprintf("b.isparticipate = %d", req.IsParticipate))
|
|
query = append(query, fmt.Sprintf("b.isparticipate = %d", req.IsParticipate))
|
|
}
|
|
}
|
|
- q = "select distinct(b.project_id),b.stage,b.is_participate,b.bid_way from participate_stage_statistics b %s"
|
|
|
|
|
|
+ q = "select distinct(b.project_id),b.stage from participate_stage_statistics b %s"
|
|
qCount = "select count(distinct(b.project_id),b.stage) from participate_stage_statistics b %s"
|
|
qCount = "select count(distinct(b.project_id),b.stage) from participate_stage_statistics b %s"
|
|
} else {
|
|
} else {
|
|
if isAdmin {
|
|
if isAdmin {
|
|
@@ -695,7 +695,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
if req.BidUpdateEndTime != "" {
|
|
if req.BidUpdateEndTime != "" {
|
|
query = append(query, fmt.Sprintf("b.update_date > %s", req.BidUpdateStartTime))
|
|
query = append(query, fmt.Sprintf("b.update_date > %s", req.BidUpdateStartTime))
|
|
}
|
|
}
|
|
- q = "select distinct(a.project_id),b.stage,b.is_participate,b.bid_way from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
|
|
|
|
+ q = "select distinct(a.project_id),b.stage from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
qCount = "select count(distinct(a.project_id),b.stage) from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
qCount = "select count(distinct(a.project_id),b.stage) from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id ) %s"
|
|
}
|
|
}
|
|
if len(query) > 0 {
|
|
if len(query) > 0 {
|
|
@@ -719,12 +719,11 @@ type PushInfoStruct struct {
|
|
}
|
|
}
|
|
|
|
|
|
func ProjectDetailHandle(dataList []map[string]interface{}, entId int64) []*bxcore.ProjectDetailData {
|
|
func ProjectDetailHandle(dataList []map[string]interface{}, entId int64) []*bxcore.ProjectDetailData {
|
|
- //dataList 里面包含 项目id、各阶段勾选时间、
|
|
|
|
|
|
+ //dataList 里面包含 项目id、各阶段信息
|
|
// 处理项目名称
|
|
// 处理项目名称
|
|
projectIdList := []string{}
|
|
projectIdList := []string{}
|
|
for i := 0; i < len(dataList); i++ {
|
|
for i := 0; i < len(dataList); i++ {
|
|
projectIdList = append(projectIdList, common.ObjToString(dataList[i]["project_id"]))
|
|
projectIdList = append(projectIdList, common.ObjToString(dataList[i]["project_id"]))
|
|
-
|
|
|
|
}
|
|
}
|
|
// 项目名称处理成map用于后续使用
|
|
// 项目名称处理成map用于后续使用
|
|
projectNameMap := map[string]string{}
|
|
projectNameMap := map[string]string{}
|
|
@@ -738,7 +737,6 @@ func ProjectDetailHandle(dataList []map[string]interface{}, entId int64) []*bxco
|
|
}
|
|
}
|
|
// 获取推送最新状态
|
|
// 获取推送最新状态
|
|
newPushInfo := getNewPushInfo(projectIdList, int(entId))
|
|
newPushInfo := getNewPushInfo(projectIdList, int(entId))
|
|
-
|
|
|
|
newPushInfoMap := map[string]PushInfoStruct{}
|
|
newPushInfoMap := map[string]PushInfoStruct{}
|
|
// 处理推送最新状态
|
|
// 处理推送最新状态
|
|
if newPushInfo != nil && len(*newPushInfo) > 0 {
|
|
if newPushInfo != nil && len(*newPushInfo) > 0 {
|
|
@@ -767,18 +765,15 @@ func ProjectDetailHandle(dataList []map[string]interface{}, entId int64) []*bxco
|
|
tmp.IsDistribute = int64(pushInfo_.IsDistribute)
|
|
tmp.IsDistribute = int64(pushInfo_.IsDistribute)
|
|
tmp.DisDate = pushInfo_.DisDate
|
|
tmp.DisDate = pushInfo_.DisDate
|
|
} //
|
|
} //
|
|
- // 处理阶段勾选信息和参标、终止参标信息 todo
|
|
|
|
- stageInfo := map[string]string{}
|
|
|
|
- err := json.Unmarshal(dataList[i]["stage"].([]byte), &stageInfo)
|
|
|
|
- if err != nil {
|
|
|
|
- tmp.ParticipateDate = common.ObjToString(stageInfo["参标"])
|
|
|
|
- tmp.StopParticipateDate = stageInfo["终止参标"]
|
|
|
|
- delete(stageInfo, "参标")
|
|
|
|
- delete(stageInfo, "终止参标")
|
|
|
|
- tmp.Stage = stageInfo
|
|
|
|
- }
|
|
|
|
- tmp.IsParticipate = common.Int64All(dataList[i]["is_participate"])
|
|
|
|
- tmp.BidWay = common.Int64All(dataList[i]["bid_way"])
|
|
|
|
|
|
+ // 处理阶段勾选信息和参标、终止参标信息
|
|
|
|
+ if dataList[i]["stage"] != nil {
|
|
|
|
+ if stage_, err := json.Marshal(dataList[i]["stage"]); err == nil {
|
|
|
|
+ err := json.Unmarshal(stage_, &tmp.Stage)
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Println("stage 反序列失败", err)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
results = append(results, &tmp)
|
|
results = append(results, &tmp)
|
|
}
|
|
}
|
|
return results
|
|
return results
|