作者 linmadan

修复bug

@@ -11,7 +11,7 @@ type SearchSuMoneyTransactionRecordCommand struct { @@ -11,7 +11,7 @@ type SearchSuMoneyTransactionRecordCommand struct {
11 // 统一用户UID 11 // 统一用户UID
12 Uid int64 `json:"uid" valid:"Required"` 12 Uid int64 `json:"uid" valid:"Required"`
13 // 记录类型(1兑换,2任务奖励) 13 // 记录类型(1兑换,2任务奖励)
14 - RecordType int `json:"recordType" valid:"Required"` 14 + RecordType int `json:"recordType,omitempty"`
15 // 操作人UID 15 // 操作人UID
16 // 事务时间区间-开始时间 16 // 事务时间区间-开始时间
17 TransactionStartTime time.Time `json:"transactionStartTime,omitempty"` 17 TransactionStartTime time.Time `json:"transactionStartTime,omitempty"`
@@ -35,6 +35,16 @@ type SearchTaskCommand struct { @@ -35,6 +35,16 @@ type SearchTaskCommand struct {
35 IsFilterCloseStatus bool `json:"isFilterCloseStatus,omitempty"` 35 IsFilterCloseStatus bool `json:"isFilterCloseStatus,omitempty"`
36 //是否过滤待发布状态任务 36 //是否过滤待发布状态任务
37 IsFilterUnReleasedStatus bool `json:"isFilterUnReleasedStatus,omitempty"` 37 IsFilterUnReleasedStatus bool `json:"isFilterUnReleasedStatus,omitempty"`
  38 + //按创建任务时间排序(ASC,DESC)
  39 + SortByCreateTime int `json:"sortByCreateTime,omitempty"`
  40 + //按发布任务时间排序(ASC,DESC)
  41 + SortByReleaseTime int `json:"sortByReleaseTime,omitempty"`
  42 + //按领取任务时间排序(ASC,DESC)
  43 + SortByReceiveTime int `json:"sortByReceiveTime,omitempty"`
  44 + //按完成任务操作时间排序(ASC,DESC)
  45 + SortByCompleteTime int `json:"sortByCompleteTime,omitempty"`
  46 + //按验收方验收时间排序(ASC,DESC)
  47 + SortByAcceptanceTime int `json:"sortByAcceptanceTime,omitempty"`
38 // 查询偏离量 48 // 查询偏离量
39 Offset int `json:"offset,omitempty"` 49 Offset int `json:"offset,omitempty"`
40 // 查询限制 50 // 查询限制
@@ -37,6 +37,16 @@ type ListTaskQuery struct { @@ -37,6 +37,16 @@ type ListTaskQuery struct {
37 IsFilterCloseStatus bool `json:"isFilterCloseStatus,omitempty"` 37 IsFilterCloseStatus bool `json:"isFilterCloseStatus,omitempty"`
38 //是否过滤待发布状态任务 38 //是否过滤待发布状态任务
39 IsFilterUnReleasedStatus bool `json:"isFilterUnReleasedStatus,omitempty"` 39 IsFilterUnReleasedStatus bool `json:"isFilterUnReleasedStatus,omitempty"`
  40 + //按创建任务时间排序(ASC,DESC)
  41 + SortByCreateTime int `json:"sortByCreateTime,omitempty"`
  42 + //按发布任务时间排序(ASC,DESC)
  43 + SortByReleaseTime int `json:"sortByReleaseTime,omitempty"`
  44 + //按领取任务时间排序(ASC,DESC)
  45 + SortByReceiveTime int `json:"sortByReceiveTime,omitempty"`
  46 + //按完成任务操作时间排序(ASC,DESC)
  47 + SortByCompleteTime int `json:"sortByCompleteTime,omitempty"`
  48 + //按验收方验收时间排序(ASC,DESC)
  49 + SortByAcceptanceTime int `json:"sortByAcceptanceTime,omitempty"`
40 // 查询偏离量 50 // 查询偏离量
41 Offset int `json:"offset,omitempty"` 51 Offset int `json:"offset,omitempty"`
42 // 查询限制 52 // 查询限制
@@ -180,10 +180,12 @@ func (status *UnClaimedStatus) Rob(task *Task, receiver *EmployeeInfo) error { @@ -180,10 +180,12 @@ func (status *UnClaimedStatus) Rob(task *Task, receiver *EmployeeInfo) error {
180 if task.TaskType != TASK_TYPE_ROB { 180 if task.TaskType != TASK_TYPE_ROB {
181 return fmt.Errorf("类型不符合的任务不允许抢单") 181 return fmt.Errorf("类型不符合的任务不允许抢单")
182 } 182 }
  183 + currentTime := time.Now()
183 task.RobInfo = &RobInfo{ 184 task.RobInfo = &RobInfo{
184 Receiver: receiver, 185 Receiver: receiver,
185 - ReceiveTime: time.Now(), 186 + ReceiveTime: currentTime,
186 } 187 }
  188 + task.ReceiveTime = currentTime
187 task.TaskStatus = TASK_STATUS_UNDERWAY 189 task.TaskStatus = TASK_STATUS_UNDERWAY
188 task.CurrentStatus = &UnderwayStatus{} 190 task.CurrentStatus = &UnderwayStatus{}
189 return nil 191 return nil
@@ -193,10 +195,11 @@ func (status *UnClaimedStatus) Bib(task *Task, bidder *EmployeeInfo) error { @@ -193,10 +195,11 @@ func (status *UnClaimedStatus) Bib(task *Task, bidder *EmployeeInfo) error {
193 if task.TaskType != TASK_TYPE_BID { 195 if task.TaskType != TASK_TYPE_BID {
194 return fmt.Errorf("类型不符合的任务不允许竞标") 196 return fmt.Errorf("类型不符合的任务不允许竞标")
195 } 197 }
  198 + currentTime := time.Now()
196 if task.BidInfo == nil { 199 if task.BidInfo == nil {
197 return fmt.Errorf("无效的竞标信息") 200 return fmt.Errorf("无效的竞标信息")
198 } else { 201 } else {
199 - bidTime := time.Now() 202 + bidTime := currentTime
200 if bidTime.Before(task.BidInfo.BidStartTime) { 203 if bidTime.Before(task.BidInfo.BidStartTime) {
201 return fmt.Errorf("竞标还没开始") 204 return fmt.Errorf("竞标还没开始")
202 } 205 }
@@ -221,6 +224,7 @@ func (status *UnClaimedStatus) ChooseSuccessfulBidder(task *Task, successfulBidd @@ -221,6 +224,7 @@ func (status *UnClaimedStatus) ChooseSuccessfulBidder(task *Task, successfulBidd
221 winBidTime := time.Now() 224 winBidTime := time.Now()
222 task.BidInfo.SuccessfulBidder = successfulBidder 225 task.BidInfo.SuccessfulBidder = successfulBidder
223 task.BidInfo.WinBidTime = winBidTime 226 task.BidInfo.WinBidTime = winBidTime
  227 + task.ReceiveTime = winBidTime
224 task.TaskStatus = TASK_STATUS_UNDERWAY 228 task.TaskStatus = TASK_STATUS_UNDERWAY
225 task.CurrentStatus = &UnderwayStatus{} 229 task.CurrentStatus = &UnderwayStatus{}
226 return nil 230 return nil
@@ -265,6 +269,7 @@ func (status *UnderwayStatus) ChooseSuccessfulBidder(task *Task, successfulBidde @@ -265,6 +269,7 @@ func (status *UnderwayStatus) ChooseSuccessfulBidder(task *Task, successfulBidde
265 269
266 func (status *UnderwayStatus) ApplyComplete(task *Task) error { 270 func (status *UnderwayStatus) ApplyComplete(task *Task) error {
267 task.TaskStatus = TASK_STATUS_UNACCEPTANCE 271 task.TaskStatus = TASK_STATUS_UNACCEPTANCE
  272 + task.CompleteTime = time.Now()
268 task.CurrentStatus = &UnAcceptanceStatus{} 273 task.CurrentStatus = &UnAcceptanceStatus{}
269 return nil 274 return nil
270 } 275 }
@@ -327,6 +332,7 @@ func (status *UnAcceptanceStatus) Acceptance(task *Task, participators []*Employ @@ -327,6 +332,7 @@ func (status *UnAcceptanceStatus) Acceptance(task *Task, participators []*Employ
327 } 332 }
328 } 333 }
329 task.TaskStatus = TASK_STATUS_COMPLETED 334 task.TaskStatus = TASK_STATUS_COMPLETED
  335 + task.AcceptanceTime = time.Now()
330 task.CurrentStatus = &CompletedStatus{} 336 task.CurrentStatus = &CompletedStatus{}
331 return nil 337 return nil
332 } 338 }
@@ -107,7 +107,6 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri @@ -107,7 +107,6 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri
107 } else { 107 } else {
108 suMoneyTransactionRecords = append(suMoneyTransactionRecords, suMoneyTransactionRecord) 108 suMoneyTransactionRecords = append(suMoneyTransactionRecords, suMoneyTransactionRecord)
109 } 109 }
110 - suMoneyTransactionRecords = append(suMoneyTransactionRecords, &domain.SuMoneyTransactionRecord{})  
111 } 110 }
112 return int64(count), suMoneyTransactionRecords, nil 111 return int64(count), suMoneyTransactionRecords, nil
113 } 112 }