get eneity
This commit is contained in:
@@ -140,7 +140,7 @@ func CancelPublishJob(ctx *jxcontext.Context, jobID int) (err error) {
|
|||||||
)
|
)
|
||||||
job := &model.Job{}
|
job := &model.Job{}
|
||||||
job.ID = jobID
|
job.ID = jobID
|
||||||
err = dao.GetEntity(db, &job)
|
err = dao.GetEntity(db, job)
|
||||||
if job.UserID == "" || job.Status == model.JobStatusFailed || job.Status == model.JobStatusOverdue || job.FinishedAt.Sub(time.Now()) <= 0 || job.SurplusCount <= 0 || job.LimitCountType <= 0 {
|
if job.UserID == "" || job.Status == model.JobStatusFailed || job.Status == model.JobStatusOverdue || job.FinishedAt.Sub(time.Now()) <= 0 || job.SurplusCount <= 0 || job.LimitCountType <= 0 {
|
||||||
return fmt.Errorf("未找到该任务或该任务状态不正常,无法取消!")
|
return fmt.Errorf("未找到该任务或该任务状态不正常,无法取消!")
|
||||||
}
|
}
|
||||||
@@ -289,10 +289,10 @@ func CancelAcceptJob(ctx *jxcontext.Context, jobID int, jobOrderID int64) (err e
|
|||||||
)
|
)
|
||||||
jobOrder := &model.JobOrder{}
|
jobOrder := &model.JobOrder{}
|
||||||
jobOrder.JobOrderID = jobOrderID
|
jobOrder.JobOrderID = jobOrderID
|
||||||
err = dao.GetEntity(db, &jobOrder, "JobOrderID")
|
err = dao.GetEntity(db, jobOrder, "JobOrderID")
|
||||||
job := &model.Job{}
|
job := &model.Job{}
|
||||||
job.ID = jobID
|
job.ID = jobID
|
||||||
err = dao.GetEntity(db, &job)
|
err = dao.GetEntity(db, job)
|
||||||
dao.Begin(db)
|
dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
@@ -377,10 +377,10 @@ func SubmitJob(ctx *jxcontext.Context, jobOrder *model.JobOrder) (err error) {
|
|||||||
}
|
}
|
||||||
job := &model.Job{}
|
job := &model.Job{}
|
||||||
job.ID = jobOrder.JobID
|
job.ID = jobOrder.JobID
|
||||||
err = dao.GetEntity(db, &job)
|
err = dao.GetEntity(db, job)
|
||||||
jobOrder2 := &model.JobOrder{}
|
jobOrder2 := &model.JobOrder{}
|
||||||
jobOrder2.JobOrderID = jobOrder.JobOrderID
|
jobOrder2.JobOrderID = jobOrder.JobOrderID
|
||||||
err = dao.GetEntity(db, &jobOrder2, "JobOrderID")
|
err = dao.GetEntity(db, jobOrder2, "JobOrderID")
|
||||||
if jobOrder2.JobID == 0 {
|
if jobOrder2.JobID == 0 {
|
||||||
return fmt.Errorf("未查询到相应的任务!")
|
return fmt.Errorf("未查询到相应的任务!")
|
||||||
}
|
}
|
||||||
@@ -407,10 +407,10 @@ func AuditJob(ctx *jxcontext.Context, jobOrderID, status int, comment string) (e
|
|||||||
)
|
)
|
||||||
jobOrder := &model.JobOrder{}
|
jobOrder := &model.JobOrder{}
|
||||||
jobOrder.JobOrderID = int64(jobOrderID)
|
jobOrder.JobOrderID = int64(jobOrderID)
|
||||||
err = dao.GetEntity(db, &jobOrder, "JobOrderID")
|
err = dao.GetEntity(db, jobOrder, "JobOrderID")
|
||||||
job := &model.Job{}
|
job := &model.Job{}
|
||||||
job.ID = jobOrder.JobID
|
job.ID = jobOrder.JobID
|
||||||
err = dao.GetEntity(db, &job)
|
err = dao.GetEntity(db, job)
|
||||||
if ctx.GetUserID() != job.UserID {
|
if ctx.GetUserID() != job.UserID {
|
||||||
return fmt.Errorf("任务发起人才能审核!")
|
return fmt.Errorf("任务发起人才能审核!")
|
||||||
}
|
}
|
||||||
@@ -593,7 +593,7 @@ func CancelJdDelivery(ctx *jxcontext.Context, vendorWaybillID, reason string) (e
|
|||||||
VendorWaybillID: vendorWaybillID,
|
VendorWaybillID: vendorWaybillID,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
err = dao.GetEntity(db, &dOrder, "VendorWaybillID")
|
err = dao.GetEntity(db, dOrder, "VendorWaybillID")
|
||||||
userBill, err := dao.GetUserBill(db, ctx.GetUserID(), "")
|
userBill, err := dao.GetUserBill(db, ctx.GetUserID(), "")
|
||||||
dOrders, err := dao.GetDeliveryOrdersNoPage(db, []string{ctx.GetUserID()}, []int{model.OrderStatusCanceled}, DayTimeBegin, DayTimeEnd)
|
dOrders, err := dao.GetDeliveryOrdersNoPage(db, []string{ctx.GetUserID()}, []int{model.OrderStatusCanceled}, DayTimeBegin, DayTimeEnd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ func UpdateMessageGroup(ctx *jxcontext.Context, groupID int, payload map[string]
|
|||||||
GroupID: groupID,
|
GroupID: groupID,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if err = dao.GetEntity(db, &messageGroup, "GroupID"); err != nil {
|
if err = dao.GetEntity(db, messageGroup, "GroupID"); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
valid := dao.StrictMakeMapByStructObject(payload, messageGroup, ctx.GetUserName())
|
valid := dao.StrictMakeMapByStructObject(payload, messageGroup, ctx.GetUserName())
|
||||||
@@ -283,7 +283,7 @@ func DeleteMessageGroup(ctx *jxcontext.Context, groupID int, userID string) (err
|
|||||||
GroupID: groupID,
|
GroupID: groupID,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if err = dao.GetEntity(db, &messageGroup, "GroupID"); err != nil {
|
if err = dao.GetEntity(db, messageGroup, "GroupID"); err != nil {
|
||||||
return errCode, err
|
return errCode, err
|
||||||
}
|
}
|
||||||
//token中用户与传入user不一致就判定为踢人
|
//token中用户与传入user不一致就判定为踢人
|
||||||
|
|||||||
Reference in New Issue
Block a user