Ver código fonte

任务预览不同状态时间展示

Ethan 4 dias atrás
pai
commit
07579babcb

+ 1 - 0
app/entity/local_life_info.go

@@ -34,6 +34,7 @@ type LocalLifeInfo struct {
 	AutoFailAt          time.Time `gorm:"column:auto_fail_at"`                              // 失效自动处理时间
 	AutoTaskID          int64     `gorm:"column:auto_task_id;default:0;NOT NULL"`           // 定时任务id
 	AutoDefaultID       int64     `gorm:"column:auto_default_id;default:0;NOT NULL"`        // 违约状态id
+	FailAt              time.Time `gorm:"column:fail_at"`                                   // 失效时间
 	FailReason          int64     `gorm:"column:fail_reason"`                               // 失效原因,1、2分别表示逾期未支付、项目存在风险
 	PaymentAmount       float64   `gorm:"column:payment_amount"`                            // 支付金额
 	PayAt               time.Time `gorm:"column:pay_at"`                                    // 支付时间

+ 1 - 0
app/entity/project.go

@@ -33,6 +33,7 @@ type Project struct {
 	PayAt             time.Time `gorm:"column:pay_at"`                         // 支付时间
 	AutoScriptBreakAt time.Time `gorm:"column:auto_script_break_at"`           // 脚本违约自动处理时间
 	AutoSketchBreakAt time.Time `gorm:"column:auto_sketch_break_at"`           // 初稿违约自动处理时间
+	FailAt            time.Time `gorm:"column:fail_at"`                        // 失效时间
 	FailReason        int64     `gorm:"column:fail_reason"`                    // 失效原因,1、2分别表示逾期未支付、项目存在风险
 	PassAt            time.Time `gorm:"column:pass_at"`                        // 审核通过时间
 	FinishAt          time.Time `gorm:"column:finish_at"`                      // 结案时间

+ 1 - 0
app/entity/selection_info.go

@@ -36,6 +36,7 @@ type SelectionInfo struct {
 	UpdatedAt        time.Time `gorm:"column:updated_at"`                    // 修改时间
 	SubmitAt         time.Time `gorm:"column:submit_at"`                     // 提交审核时间
 	PassAt           time.Time `gorm:"column:pass_at"`                       // 审核通过时间
+	FailAt           time.Time `gorm:"column:fail_at"`                       // 失效时间
 	FailReason       int64     `gorm:"column:fail_reason"`                   // 失效原因,1、2分别表示逾期未支付、项目存在风险
 	PayAt            time.Time `gorm:"column:pay_at"`                        // 支付时间
 	FinishAt         time.Time `gorm:"column:finish_at"`                     // 结案时间

+ 7 - 0
app/schedule/auto_task_invalid.go

@@ -53,6 +53,8 @@ func AutoProjectInvalidTask() {
 			_ = dao.ProjectDAO{}.UpdateProject(entity.Project{
 				ProjectId:     projectId,
 				ProjectStatus: 9,
+				FailReason:    1,
+				FailAt:        time.Now(),
 			})
 			continue
 		}
@@ -79,6 +81,7 @@ func AutoProjectInvalidTask() {
 				ProjectId:     projectId,
 				ProjectStatus: 9,
 				FailReason:    1,
+				FailAt:        time.Now(),
 			})
 			fmt.Println(fmt.Sprintf("已更新品牌种草项目 %s 状态为超时未支付的失效状态", projectId))
 			dao.Db.Model(entity.ProjectTaskInfo{}).Where("project_id = ?", projectId).Updates(entity.ProjectTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: time.Now()})
@@ -109,6 +112,7 @@ func AutoSelectionInvalidTask() {
 				SelectionID:     selectionId,
 				SelectionStatus: 7,
 				FailReason:      1,
+				FailAt:          time.Now(),
 			})
 			fmt.Println(fmt.Sprintf("已更新电商带货项目 %s 状态为超时未支付的失效状态", selectionId))
 			dao.Db.Model(entity.SelectionInfo{}).Where("selection_id = ?", selectionId).Updates(entity.SelectionTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: time.Now()})
@@ -130,6 +134,8 @@ func AutoLocalLifeInvalidTask() {
 			_ = dao.LocalLifeDao{}.UpdateLocal(entity.LocalLifeInfo{
 				LocalID:    localId,
 				TaskStatus: 9,
+				FailReason: 1,
+				FailAt:     time.Now(),
 			})
 			continue
 		}
@@ -156,6 +162,7 @@ func AutoLocalLifeInvalidTask() {
 				LocalID:    localId,
 				TaskStatus: 9,
 				FailReason: 1,
+				FailAt:     time.Now(),
 			})
 			fmt.Println(fmt.Sprintf("已更新本地生活项目 %s 状态为超时未支付的失效状态", localId))
 			dao.Db.Model(entity.LocalLifeTaskInfo{}).Where("local_id = ?", localId).Updates(entity.LocalLifeTaskInfo{TaskStage: 3, CompleteStatus: 3, CompleteDate: time.Now()})

+ 9 - 0
app/service/local_life_service.go

@@ -487,12 +487,21 @@ func (s LocalLifeService) GetLocalLifeDetail(localId string) (*vo.ReLocalDetail,
 		logrus.Errorf("[localLifeDB service] call GetLocalById error,err:%+v", err)
 		return nil, err
 	}
+	if localLife == nil {
+		return nil, errors.New("数据不存在")
+	}
 	// 系统信息
 	reLocalDetail.LocalName = localLife.LocalName
 	reLocalDetail.LocalId = localId
 	reLocalDetail.LocalStatus = localLife.TaskStatus
 	reLocalDetail.LocalPlatform = localLife.LocalPlatform
 	reLocalDetail.CreatedAt = localLife.CreatedAt.Format("2006-01-02 15:04:05")
+	reLocalDetail.SubmitAt = localLife.SubmitAt.Format("2006-01-02 15:04:05")
+	reLocalDetail.PassAt = localLife.AutoFailAt.Format("2006-01-02 15:04:05")
+	reLocalDetail.AutoFailAt = localLife.AutoFailAt.Format("2006-01-02 15:04:05")
+	reLocalDetail.StartAt = localLife.PayAt.Format("2006-01-02 15:04:05")
+	reLocalDetail.FinishAt = localLife.FinishAt.Format("2006-01-02 15:04:05")
+	reLocalDetail.FailAt = localLife.FailAt.Format("2006-01-02 15:04:05")
 	if localLife.TaskStatus < 6 {
 		reLocalDetail.EstimatedCost = localLife.EstimatedCost
 	} else {

+ 9 - 0
app/service/project_service.go

@@ -508,12 +508,21 @@ func (s ProjectService) GetProjectDetail(projectId string) (*vo.ReProjectDetail,
 		logrus.Errorf("[projectDB service] call GetProject error,err:%+v", err)
 		return nil, err
 	}
+	if project == nil {
+		return nil, errors.New("数据不存在")
+	}
 	reProjectDetail.ProjectName = project.ProjectName
 	// 系统信息
 	reProjectDetail.ProjectId = projectId
 	reProjectDetail.ProjectStatus = project.ProjectStatus
 	reProjectDetail.ProjectPlatform = project.ProjectPlatform
 	reProjectDetail.CreatedAt = project.CreatedAt.Format("2006-01-02 15:04:05")
+	reProjectDetail.SubmitAt = project.SubmitAt.Format("2006-01-02 15:04:05")
+	reProjectDetail.PassAt = project.PassAt.Format("2006-01-02 15:04:05")
+	reProjectDetail.AutoFailAt = project.AutoFailAt.Format("2006-01-02 15:04:05")
+	reProjectDetail.StartAt = project.PayAt.Format("2006-01-02 15:04:05")
+	reProjectDetail.FinishAt = project.FinishAt.Format("2006-01-02 15:04:05")
+	reProjectDetail.FailAt = project.FailAt.Format("2006-01-02 15:04:05")
 	if project.ProjectStatus < 6 {
 		reProjectDetail.EstimatedCost = project.EstimatedCost
 	} else {

+ 8 - 0
app/service/selection_info_service.go

@@ -431,6 +431,9 @@ func (s SelectionInfoService) GetSelectionDetail(selectionId string) (*vo.ReSele
 		logrus.Errorf("[selectionInfoDB service] call GetSelection error,err:%+v", err)
 		return nil, err
 	}
+	if selection == nil {
+		return nil, errors.New("数据不存在")
+	}
 	reSelectionDetail.SelectionName = selection.SelectionName
 	// 系统信息
 	reSelectionDetail.SelectionId = selection.SelectionID
@@ -438,6 +441,11 @@ func (s SelectionInfoService) GetSelectionDetail(selectionId string) (*vo.ReSele
 	reSelectionDetail.SelectionPlatform = selection.Platform
 	reSelectionDetail.CreatedAt = selection.CreatedAt.Format("2006-01-02 15:04:05")
 	reSelectionDetail.SubmitAt = selection.SubmitAt.Format("2006-01-02 15:04:05")
+	reSelectionDetail.PassAt = selection.PassAt.Format("2006-01-02 15:04:05")
+	reSelectionDetail.AutoFailAt = selection.AutoFailAt.Format("2006-01-02 15:04:05")
+	reSelectionDetail.StartAt = selection.PayAt.Format("2006-01-02 15:04:05")
+	reSelectionDetail.FinishAt = selection.FinishAt.Format("2006-01-02 15:04:05")
+	reSelectionDetail.FailAt = selection.FailAt.Format("2006-01-02 15:04:05")
 	reSelectionDetail.RewardSum = selection.EstimatedCost
 	var creatorName, phone string
 	//var rewardSum float64

+ 6 - 0
app/vo/re_local_detail.go

@@ -11,6 +11,12 @@ type ReLocalDetail struct {
 	LocalStatus       int64   `json:"localStatus"`       // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
 	LocalPlatform     int64   `json:"localPlatform"`     //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
 	CreatedAt         string  `json:"createdAt"`         // 创建时间
+	SubmitAt          string  `json:"submitAt"`          // 提交审核时间
+	PassAt            string  `json:"passAt"`            // 招募开始时间(审核通过时间)
+	AutoFailAt        string  `json:"payEndAt"`          // 支付截止时间
+	StartAt           string  `json:"startAt"`           // 执行开始时间(支付时间)
+	FinishAt          string  `json:"finishAt"`          // 结案时间
+	FailAt            string  `json:"failAt"`            // 失效时间
 	CreatorName       string  `json:"creatorName"`       // 创建者
 	Phone             string  `json:"phone"`             // 联系方式
 	WX                string  `json:"wx"`                // 微信

+ 6 - 0
app/vo/re_project_detail.go

@@ -11,6 +11,12 @@ type ReProjectDetail struct {
 	ProjectStatus     int64   `json:"projectStatus"`     // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
 	ProjectPlatform   int64   `json:"projectPlatform"`   //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
 	CreatedAt         string  `json:"createdAt"`         // 创建时间
+	SubmitAt          string  `json:"submitAt"`          // 提交审核时间
+	PassAt            string  `json:"passAt"`            // 招募开始时间(审核通过时间)
+	AutoFailAt        string  `json:"payEndAt"`          // 支付截止时间
+	StartAt           string  `json:"startAt"`           // 执行开始时间(支付时间)
+	FinishAt          string  `json:"finishAt"`          // 结案时间
+	FailAt            string  `json:"failAt"`            // 失效时间
 	CreatorName       string  `json:"creatorName"`       // 创建者
 	Phone             string  `json:"phone"`             // 联系方式
 	WX                string  `json:"wx"`                // 微信

+ 6 - 1
app/vo/re_selection_detail.go

@@ -11,11 +11,16 @@ type ReSelectionDetail struct {
 	SelectionStatus   int64   `json:"selectionStatus"`   // 项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
 	SelectionPlatform int64   `json:"selectionPlatform"` //  项目平台,1-7分别代表红book、抖音、微博、快手、b站、大众点评、知乎
 	CreatedAt         string  `json:"createdAt"`         // 创建时间
+	SubmitAt          string  `json:"submitAt"`          // 提交审核时间
+	PassAt            string  `json:"passAt"`            // 招募开始时间(审核通过时间)
+	AutoFailAt        string  `json:"payEndAt"`          // 支付截止时间
+	StartAt           string  `json:"startAt"`           // 执行开始时间(支付时间)
+	FinishAt          string  `json:"finishAt"`          // 结案时间
+	FailAt            string  `json:"failAt"`            // 失效时间
 	CreatorName       string  `json:"creatorName"`       // 创建者
 	Phone             string  `json:"phone"`             // 联系方式
 	WX                string  `json:"wx"`                // 微信
 	RewardSum         float64 `json:"rewardSum"`         // 悬赏池总金额
-	SubmitAt          string  `json:"submitAt"`          // 提交审核时间
 	// 支付方式参数待定
 	// 关联商品
 	ProductInfo *ReProductPreview `json:"productInfo"`