导入美团绘图那
This commit is contained in:
@@ -221,7 +221,7 @@ func AcceptJob(ctx *jxcontext.Context, jobID int) (err error) {
|
|||||||
// Status: model.JobOrderStatusAccept,
|
// Status: model.JobOrderStatusAccept,
|
||||||
}
|
}
|
||||||
//美团会员任务
|
//美团会员任务
|
||||||
if jobID == 1 {
|
if jobID == model.JobIDMtMembers {
|
||||||
jobOrder.Status = model.JobOrderStatusSpec
|
jobOrder.Status = model.JobOrderStatusSpec
|
||||||
} else {
|
} else {
|
||||||
jobOrder.Status = model.JobOrderStatusAccept
|
jobOrder.Status = model.JobOrderStatusAccept
|
||||||
@@ -447,3 +447,22 @@ func RefreshJobStatus(ctx *jxcontext.Context) (err error) {
|
|||||||
globals.SugarLogger.Debugf("RefreshJobStatus end...")
|
globals.SugarLogger.Debugf("RefreshJobStatus end...")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ImprotMtMembers(ctx *jxcontext.Context, mtMembers []*model.MtMember) (err error) {
|
||||||
|
var (
|
||||||
|
db = dao.GetDB()
|
||||||
|
)
|
||||||
|
for _, v := range mtMembers {
|
||||||
|
dao.WrapAddIDCULDEntity(v, ctx.GetUserName())
|
||||||
|
}
|
||||||
|
if err = dao.CreateMultiEntities(db, mtMembers); err == nil {
|
||||||
|
job := &model.Job{}
|
||||||
|
job.ID = model.JobIDMtMembers
|
||||||
|
dao.GetEntity(db, job)
|
||||||
|
if job != nil {
|
||||||
|
job.Count += len(mtMembers)
|
||||||
|
dao.UpdateEntity(db, job, "Count")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ const (
|
|||||||
JobOrderStatusAuditUnPass = 20
|
JobOrderStatusAuditUnPass = 20
|
||||||
JobOrderStatusFinish = 110
|
JobOrderStatusFinish = 110
|
||||||
JobOrderStatusCancel = 115
|
JobOrderStatusCancel = 115
|
||||||
|
|
||||||
|
JobIDMtMembers = 1
|
||||||
)
|
)
|
||||||
|
|
||||||
type Job struct {
|
type Job struct {
|
||||||
|
|||||||
@@ -190,11 +190,16 @@ func (c *JobController) AuditJob() {
|
|||||||
// @Title 导入美团会员
|
// @Title 导入美团会员
|
||||||
// @Description 导入美团会员
|
// @Description 导入美团会员
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
|
// @Param payload formData string true "mtmembers struct"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /ImprotMtMembers [post]
|
// @router /ImprotMtMembers [post]
|
||||||
func (c *JobController) ImprotMtMembers() {
|
func (c *JobController) ImprotMtMembers() {
|
||||||
c.callImprotMtMembers(func(params *tJobImprotMtMembersParams) (retVal interface{}, errCode string, err error) {
|
c.callImprotMtMembers(func(params *tJobImprotMtMembersParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
var mtMembers []*model.MtMember
|
||||||
|
if err = jxutils.Strings2Objs(params.Payload, &mtMembers); err == nil {
|
||||||
|
|
||||||
|
}
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user