| | |
| | | BarCode: snowflake.GenerateIdStr(), |
| | | } |
| | | err = model.WithTransaction(func(db *gorm.DB) error { |
| | | err = model.NewReportWorkSearch(nil).Create(record) |
| | | err = model.NewReportWorkSearch(db).Create(record) |
| | | if err != nil { |
| | | return err |
| | | } |
| | |
| | | if err != nil { |
| | | return err |
| | | } |
| | | err = model.NewReportsToCloudSearch(nil).Create(&model.ReportsToCloud{ |
| | | err = model.NewReportsToCloudSearch(db).Create(&model.ReportsToCloud{ |
| | | ReportType: constvar.ReportTypeReportWork, |
| | | Content: string(content), |
| | | }) |
| | | return err |
| | | if err != nil { |
| | | return err |
| | | } |
| | | |
| | | return nil |
| | | }) |
| | | if err != nil { |
| | | logx.Errorf("save report work transaction error: %v", err) |
| | | return err |
| | | } |
| | | _ = NewProgressService().UpdateProgressByProceduresId(procedure.ID, int64(params.ReportAmount)) |
| | | |
| | | err = NewProgressService().UpdateProgressByProceduresId(procedure.ID, int64(params.ReportAmount)) |
| | | |
| | | return nil |
| | | } |
| | | |