作者 linmadan

修复bug

... ... @@ -11,7 +11,7 @@ type SearchSuMoneyTransactionRecordCommand struct {
// 统一用户UID
Uid int64 `json:"uid" valid:"Required"`
// 记录类型(1兑换,2任务奖励)
RecordType int `json:"recordType" valid:"Required"`
RecordType int `json:"recordType,omitempty"`
// 操作人UID
// 事务时间区间-开始时间
TransactionStartTime time.Time `json:"transactionStartTime,omitempty"`
... ...
... ... @@ -35,6 +35,16 @@ type SearchTaskCommand struct {
IsFilterCloseStatus bool `json:"isFilterCloseStatus,omitempty"`
//是否过滤待发布状态任务
IsFilterUnReleasedStatus bool `json:"isFilterUnReleasedStatus,omitempty"`
//按创建任务时间排序(ASC,DESC)
SortByCreateTime int `json:"sortByCreateTime,omitempty"`
//按发布任务时间排序(ASC,DESC)
SortByReleaseTime int `json:"sortByReleaseTime,omitempty"`
//按领取任务时间排序(ASC,DESC)
SortByReceiveTime int `json:"sortByReceiveTime,omitempty"`
//按完成任务操作时间排序(ASC,DESC)
SortByCompleteTime int `json:"sortByCompleteTime,omitempty"`
//按验收方验收时间排序(ASC,DESC)
SortByAcceptanceTime int `json:"sortByAcceptanceTime,omitempty"`
// 查询偏离量
Offset int `json:"offset,omitempty"`
// 查询限制
... ...
... ... @@ -37,6 +37,16 @@ type ListTaskQuery struct {
IsFilterCloseStatus bool `json:"isFilterCloseStatus,omitempty"`
//是否过滤待发布状态任务
IsFilterUnReleasedStatus bool `json:"isFilterUnReleasedStatus,omitempty"`
//按创建任务时间排序(ASC,DESC)
SortByCreateTime int `json:"sortByCreateTime,omitempty"`
//按发布任务时间排序(ASC,DESC)
SortByReleaseTime int `json:"sortByReleaseTime,omitempty"`
//按领取任务时间排序(ASC,DESC)
SortByReceiveTime int `json:"sortByReceiveTime,omitempty"`
//按完成任务操作时间排序(ASC,DESC)
SortByCompleteTime int `json:"sortByCompleteTime,omitempty"`
//按验收方验收时间排序(ASC,DESC)
SortByAcceptanceTime int `json:"sortByAcceptanceTime,omitempty"`
// 查询偏离量
Offset int `json:"offset,omitempty"`
// 查询限制
... ...
... ... @@ -180,10 +180,12 @@ func (status *UnClaimedStatus) Rob(task *Task, receiver *EmployeeInfo) error {
if task.TaskType != TASK_TYPE_ROB {
return fmt.Errorf("类型不符合的任务不允许抢单")
}
currentTime := time.Now()
task.RobInfo = &RobInfo{
Receiver: receiver,
ReceiveTime: time.Now(),
ReceiveTime: currentTime,
}
task.ReceiveTime = currentTime
task.TaskStatus = TASK_STATUS_UNDERWAY
task.CurrentStatus = &UnderwayStatus{}
return nil
... ... @@ -193,10 +195,11 @@ func (status *UnClaimedStatus) Bib(task *Task, bidder *EmployeeInfo) error {
if task.TaskType != TASK_TYPE_BID {
return fmt.Errorf("类型不符合的任务不允许竞标")
}
currentTime := time.Now()
if task.BidInfo == nil {
return fmt.Errorf("无效的竞标信息")
} else {
bidTime := time.Now()
bidTime := currentTime
if bidTime.Before(task.BidInfo.BidStartTime) {
return fmt.Errorf("竞标还没开始")
}
... ... @@ -221,6 +224,7 @@ func (status *UnClaimedStatus) ChooseSuccessfulBidder(task *Task, successfulBidd
winBidTime := time.Now()
task.BidInfo.SuccessfulBidder = successfulBidder
task.BidInfo.WinBidTime = winBidTime
task.ReceiveTime = winBidTime
task.TaskStatus = TASK_STATUS_UNDERWAY
task.CurrentStatus = &UnderwayStatus{}
return nil
... ... @@ -265,6 +269,7 @@ func (status *UnderwayStatus) ChooseSuccessfulBidder(task *Task, successfulBidde
func (status *UnderwayStatus) ApplyComplete(task *Task) error {
task.TaskStatus = TASK_STATUS_UNACCEPTANCE
task.CompleteTime = time.Now()
task.CurrentStatus = &UnAcceptanceStatus{}
return nil
}
... ... @@ -327,6 +332,7 @@ func (status *UnAcceptanceStatus) Acceptance(task *Task, participators []*Employ
}
}
task.TaskStatus = TASK_STATUS_COMPLETED
task.AcceptanceTime = time.Now()
task.CurrentStatus = &CompletedStatus{}
return nil
}
... ...
... ... @@ -107,7 +107,6 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri
} else {
suMoneyTransactionRecords = append(suMoneyTransactionRecords, suMoneyTransactionRecord)
}
suMoneyTransactionRecords = append(suMoneyTransactionRecords, &domain.SuMoneyTransactionRecord{})
}
return int64(count), suMoneyTransactionRecords, nil
}
... ...