Ver código fonte

feat:开标时间字段调整为投标截止时间

fuwencai 2 anos atrás
pai
commit
ac8ea3936b

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

@@ -59,11 +59,10 @@ func (l *ParticipateInfoLogic) ParticipateInfo(in *bxcore.ParticipateInfoReq) (*
 		result.ErrMsg = "未查到此项目信息"
 		result.ErrMsg = "未查到此项目信息"
 		return &result, nil
 		return &result, nil
 	}
 	}
-	// 判断是否已经过了开标时间
+	// 判断是否已经过了投标截止时间
 	var isValid bool
 	var isValid bool
-	bidopentime := common.Int64All((*projectInfos)[0]["bidopentime"])
 	bidendtime := common.Int64All((*projectInfos)[0]["bidendtime"])
 	bidendtime := common.Int64All((*projectInfos)[0]["bidendtime"])
-	if time.Now().Unix() < bidopentime || bidopentime == 0 {
+	if time.Now().Unix() < bidendtime || bidendtime == 0 {
 		isValid = true
 		isValid = true
 	}
 	}
 	//   获取项目id
 	//   获取项目id

+ 4 - 8
jyBXCore/rpc/internal/logic/updatebidstatuslogic.go

@@ -54,15 +54,11 @@ func (l *UpdateBidStatusLogic) UpdateBidStatus(in *bxcore.UpdateBidStatusReq) (*
 		result.ErrMsg = "未查询到项目信息"
 		result.ErrMsg = "未查询到项目信息"
 		return result, nil
 		return result, nil
 	}
 	}
-	// 判断是否已经过了开标时间
-	var isValid bool
-	bidopentime := common.Int64All((*projectInfos)[0]["bidopentime"])
+	// 判断是否已经过了投标截止时间
+	bidendtime := common.Int64All((*projectInfos)[0]["bidendtime"])
 	projectId := common.ObjToString((*projectInfos)[0]["_id"])
 	projectId := common.ObjToString((*projectInfos)[0]["_id"])
-	if time.Now().Unix() < bidopentime || bidopentime == 0 {
-		isValid = true
-	}
-	if !isValid {
-		result.ErrMsg = "已经过开标时间,无法更新"
+	if !(time.Now().Unix() < bidendtime || bidendtime == 0) {
+		result.ErrMsg = "已经过投标截止时间,无法更新"
 		return result, nil
 		return result, nil
 	}
 	}
 	// 验证身份
 	// 验证身份

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

@@ -32,7 +32,7 @@ func GetValidProjectByInfoId(infoIds []string) *[]map[string]interface{} {
 	}
 	}
 	nowTime := time.Now().Unix()
 	nowTime := time.Now().Unix()
 	query := `{"_source":["_id","list.infoid"],"query": {"bool": {"must": [{"terms": {"list.infoid": ["` + strings.Join(infoIds, "\",\"") + `"]}},
 	query := `{"_source":["_id","list.infoid"],"query": {"bool": {"must": [{"terms": {"list.infoid": ["` + strings.Join(infoIds, "\",\"") + `"]}},
-        {"bool": {"should": [{"range": {"bidopentime": {"gte": ` + fmt.Sprint(nowTime) + `}}},
+        {"bool": {"should": [{"range": {"bidendtime": {"gte": ` + fmt.Sprint(nowTime) + `}}},
         {
         {
     "bool": {
     "bool": {
         "must_not": [
         "must_not": [
@@ -40,7 +40,7 @@ func GetValidProjectByInfoId(infoIds []string) *[]map[string]interface{} {
                 "constant_score": {
                 "constant_score": {
                     "filter": {
                     "filter": {
                         "exists": {
                         "exists": {
-                            "field": "bidopentime"
+                            "field": "bidendtime"
                         }
                         }
                     }
                     }
                 }
                 }