|
@@ -23,7 +23,6 @@ func (*logistics) Create(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
ThingsType := newLogistics.ThingsType
|
|
|
StrategyID := newLogistics.StrategyID
|
|
|
Logistics := gorm_model.YoungeeTaskLogistics{
|
|
|
- LogisticsID: newLogistics.LogisticsID,
|
|
|
TaskID: newLogistics.TaskID,
|
|
|
ThingsType: int64(ThingsType),
|
|
|
ExplorestoreStarttime: time.Now(),
|
|
@@ -35,7 +34,6 @@ func (*logistics) Create(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
if ThingsType == 1 {
|
|
|
Logistics.CompanyName = newLogistics.CompanyName
|
|
|
Logistics.LogisticsNumber = newLogistics.LogisticsNumber
|
|
|
- Logistics.DeliveryTime = time.Now()
|
|
|
} else if ThingsType == 3 {
|
|
|
fmt.Println("开始时间:", newLogistics.ExplorestoreStarttime)
|
|
|
fmt.Println("结束时间:", newLogistics.ExplorestoreEndtime)
|
|
@@ -53,6 +51,29 @@ func (*logistics) Create(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
+ // 修改task_info中发货状态
|
|
|
+ err = db.UpdateLogisticsStatus(ctx, Logistics.TaskID, 2)
|
|
|
+ if err != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogisticsStatus error,err:%+v", err)
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ updateTaskData := gorm_model.YoungeeTaskInfo{
|
|
|
+ TaskID: newLogistics.TaskID,
|
|
|
+ }
|
|
|
+ if newLogistics.SubAccountId == 0 {
|
|
|
+ updateTaskData.CreateLogisticUserId = newLogistics.EnterpriseId
|
|
|
+ updateTaskData.CreateLogisticUserType = 1
|
|
|
+ } else {
|
|
|
+ updateTaskData.CreateLogisticUserId = conv.MustString(newLogistics.SubAccountId)
|
|
|
+ updateTaskData.CreateLogisticUserType = 2
|
|
|
+ }
|
|
|
+ _, err5 := db.UpdateTask(ctx, updateTaskData, nil)
|
|
|
+ if err5 != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err5)
|
|
|
+ return nil, err5
|
|
|
+ }
|
|
|
+
|
|
|
projectId, err1 := db.GetProjectIdByTaskId(ctx, newLogistics.TaskID)
|
|
|
if err1 != nil {
|
|
|
logrus.WithContext(ctx).Errorf("[project service] call GetProjectIdByTaskId error,err:%+v", err1)
|
|
@@ -74,20 +95,12 @@ func (*logistics) Create(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- // 修改task_info中发货状态
|
|
|
- err = db.UpdateLogisticsStatus(ctx, Logistics.TaskID, 2)
|
|
|
- if err != nil {
|
|
|
- logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogisticsStatus error,err:%+v", err)
|
|
|
- return nil, err
|
|
|
- }
|
|
|
-
|
|
|
// 修改task_info中发货时间
|
|
|
err = db.UpdateLogisticsDate(ctx, Logistics.TaskID)
|
|
|
if err != nil {
|
|
|
logrus.WithContext(ctx).Errorf("[logistics service] call UpdateLogisticsDate error,err:%+v", err)
|
|
|
return nil, err
|
|
|
}
|
|
|
-
|
|
|
// 修改task_info中任务阶段
|
|
|
err = db.UpdateTaskStageByTaskId(ctx, Logistics.TaskID, 2, 5) //修改为待传初稿
|
|
|
if err != nil {
|
|
@@ -113,7 +126,6 @@ func (*logistics) Create(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
res := &http_model.CreateLogisticsData{
|
|
|
LogisticsID: *logisticsID,
|
|
|
}
|
|
|
-
|
|
|
return res, nil
|
|
|
}
|
|
|
|
|
@@ -149,6 +161,23 @@ func (*logistics) Update(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
res := &http_model.CreateLogisticsData{
|
|
|
LogisticsID: *logisticsID,
|
|
|
}
|
|
|
+
|
|
|
+ updateTaskData := gorm_model.YoungeeTaskInfo{
|
|
|
+ TaskID: newLogistics.TaskID,
|
|
|
+ }
|
|
|
+ if newLogistics.SubAccountId == 0 {
|
|
|
+ updateTaskData.CreateLogisticUserId = newLogistics.EnterpriseId
|
|
|
+ updateTaskData.CreateLogisticUserType = 1
|
|
|
+ } else {
|
|
|
+ updateTaskData.CreateLogisticUserId = conv.MustString(newLogistics.SubAccountId)
|
|
|
+ updateTaskData.CreateLogisticUserType = 2
|
|
|
+ }
|
|
|
+ _, err5 := db.UpdateTask(ctx, updateTaskData, nil)
|
|
|
+ if err5 != nil {
|
|
|
+ logrus.WithContext(ctx).Errorf("[projectPay service] call SpecialSettlePay error,err:%+v", err5)
|
|
|
+ return nil, err5
|
|
|
+ }
|
|
|
+
|
|
|
return res, nil
|
|
|
}
|
|
|
|