|
@@ -2,6 +2,7 @@ package sectask_service
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "github.com/issue9/conv"
|
|
|
"github.com/sirupsen/logrus"
|
|
|
"time"
|
|
|
"youngee_b_api/db"
|
|
@@ -41,13 +42,25 @@ func (*logistics) Create(ctx context.Context, request http_model.CreateSecTaskLo
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
+ var createLogisticUserType int
|
|
|
+ var createLogisticUserId string
|
|
|
+ if request.SubAccountId == 0 {
|
|
|
+ createLogisticUserType = 1
|
|
|
+ createLogisticUserId = request.EnterpriseId
|
|
|
+ } else if request.SubAccountId != 0 {
|
|
|
+ createLogisticUserType = 2
|
|
|
+ createLogisticUserId = conv.MustString(request.SubAccountId)
|
|
|
+ }
|
|
|
+
|
|
|
// 修改task_info中发货时间、任务阶段
|
|
|
updatdSecTask := gorm_model.YounggeeSecTaskInfo{
|
|
|
- TaskID: request.TaskID,
|
|
|
- LogisticsStatus: 2,
|
|
|
- TaskStage: 8,
|
|
|
- DeliveryDate: time.Now(),
|
|
|
- FreeStage: 4,
|
|
|
+ TaskID: request.TaskID,
|
|
|
+ LogisticsStatus: 2,
|
|
|
+ TaskStage: 8,
|
|
|
+ DeliveryDate: time.Now(),
|
|
|
+ FreeStage: 4,
|
|
|
+ CreateLogisticUserId: createLogisticUserId,
|
|
|
+ CreateLogisticUserType: createLogisticUserType,
|
|
|
}
|
|
|
|
|
|
_, err = db.UpdateSecTask(ctx, updatdSecTask)
|