...
|
...
|
@@ -34,19 +34,14 @@ func (dao *TaskDao) ListNearThePlannedCompletionTimeTask() ([]*models.Task, erro |
|
|
|
|
|
// 更新已过期的竞标任务的状态
|
|
|
func (dao *TaskDao) UpdateExpiredPlannedCompletionTimeBidTask() error {
|
|
|
tx := dao.transactionContext.PgTx
|
|
|
var taskModels []*models.Task
|
|
|
currentTime := time.Now()
|
|
|
currentDay := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, time.Now().Location())
|
|
|
query := tx.Model(&taskModels).Relation("RobInfo").Relation("BidInfo").
|
|
|
Set("task.task_type = ", domain.TASK_STATUS_EXPIRED).
|
|
|
Where("task.planned_completion_time > ?", currentDay).
|
|
|
Where(`task.task_type = ?`, domain.TASK_TYPE_BID).
|
|
|
Where(`task.task_status = ?`, domain.TASK_STATUS_UNCLAIMED)
|
|
|
if _, err := query.Update(); err != nil {
|
|
|
tx := dao.transactionContext.PgTx
|
|
|
_, err := tx.Query(
|
|
|
pg.Scan(),
|
|
|
"UPDATE tasks SET task_status = ? WHERE planned_completion_time > ? AND task_type = ? AND task_status = ?",
|
|
|
domain.TASK_STATUS_EXPIRED, currentDay, domain.TASK_TYPE_BID, domain.TASK_STATUS_UNCLAIMED)
|
|
|
return err
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 返回接近竞标截止时间的竞标任务
|
...
|
...
|
|