|
@@ -122,6 +122,30 @@ func (*logistics) Update(ctx context.Context, newLogistics http_model.CreateLogi
|
|
|
|
|
|
// 签收
|
|
// 签收
|
|
func (*logistics) SignForReceipt(ctx *gin.Context, data http_model.SignForReceiptRequest) interface{} {
|
|
func (*logistics) SignForReceipt(ctx *gin.Context, data http_model.SignForReceiptRequest) interface{} {
|
|
|
|
+ projectId, err1 := db.GetProjectIdByTaskId(ctx, conv.MustInt64(data.TaskStrategyIds[0].TaskId))
|
|
|
|
+ if err1 != nil {
|
|
|
|
+ logrus.WithContext(ctx).Errorf("[project service] call GetProjectIdByTaskId error,err:%+v", err1)
|
|
|
|
+ return err1
|
|
|
|
+ }
|
|
|
|
+ // 签收时更新任务阶段
|
|
|
|
+ project, err3 := db.GetProjectDetail(ctx, conv.MustInt64(*projectId))
|
|
|
|
+ if err3 != nil {
|
|
|
|
+ logrus.WithContext(ctx).Errorf("[project service] call GetPorjectDetail error,err:%+v", err3)
|
|
|
|
+ return err3
|
|
|
|
+ }
|
|
|
|
+ if project.ContentType == 1 {
|
|
|
|
+ err := db.UpdateTaskStage(ctx, conv.MustInt64(*projectId), 2, 11)
|
|
|
|
+ if err != nil {
|
|
|
|
+ logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateTaskStatusPaying error,err:%+v", err)
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ err := db.UpdateTaskStage(ctx, conv.MustInt64(*projectId), 2, 8)
|
|
|
|
+ if err != nil {
|
|
|
|
+ logrus.WithContext(ctx).Errorf("[projectPay service] call UpdateTaskStatusPaying error,err:%+v", err)
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for _, value := range data.TaskStrategyIds {
|
|
for _, value := range data.TaskStrategyIds {
|
|
taskId := conv.MustInt64(value.TaskId)
|
|
taskId := conv.MustInt64(value.TaskId)
|
|
strategyId := conv.MustInt64(value.StrategyId)
|
|
strategyId := conv.MustInt64(value.StrategyId)
|
|
@@ -138,12 +162,6 @@ func (*logistics) SignForReceipt(ctx *gin.Context, data http_model.SignForReceip
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- projectId, err1 := db.GetProjectIdByTaskId(ctx, taskId)
|
|
|
|
- if err1 != nil {
|
|
|
|
- logrus.WithContext(ctx).Errorf("[project service] call GetProjectIdByTaskId error,err:%+v", err1)
|
|
|
|
- return err1
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 查询StrategyID 通过 StrategyID 和 projectId
|
|
// 查询StrategyID 通过 StrategyID 和 projectId
|
|
StrategyID, err2 := db.GetRecruitStrategyIdByTS(ctx, *projectId, strategyId)
|
|
StrategyID, err2 := db.GetRecruitStrategyIdByTS(ctx, *projectId, strategyId)
|
|
if err2 != nil {
|
|
if err2 != nil {
|