sync: 对齐小程序 v1.0.2 生产代码并脱敏
This commit is contained in:
@@ -3,17 +3,18 @@ package batchimport
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/consts"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/dao"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/library/batchmetadata"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/model/do"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/model/entity"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/utility/hash"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-app/utility/iot_excelize"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/crypto/gmd5"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
@@ -25,6 +26,9 @@ import (
|
||||
)
|
||||
|
||||
func SubmitAndRun(ctx context.Context, req SubmitRequest, p Processor) (*Result, error) {
|
||||
if err := batchmetadata.ValidateCreation(req.SourceChannel, req.ExecutionMode); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg := p.Config()
|
||||
if req.File == nil {
|
||||
return nil, gerror.New("请选择上传文件")
|
||||
@@ -107,6 +111,9 @@ func SubmitAndRun(ctx context.Context, req SubmitRequest, p Processor) (*Result,
|
||||
}
|
||||
|
||||
func RunRows(ctx context.Context, req SubmitRequest, p Processor, rows []Row, sourceName string) (*Result, error) {
|
||||
if err := batchmetadata.ValidateCreation(req.SourceChannel, req.ExecutionMode); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg := p.Config()
|
||||
batchNo, err := NextBatchNoContext(ctx, cfg.BatchNoPrefix)
|
||||
if err != nil {
|
||||
@@ -268,6 +275,8 @@ func saveBatchAndExecute(ctx context.Context, req *SubmitRequest, p Processor, r
|
||||
BatchStatus: batchStatusByImportStatus(result.ImportStatus),
|
||||
BatchAsyncStatus: batchStatusByImportStatus(result.ImportStatus),
|
||||
SourceType: req.SourceType,
|
||||
SourceChannel: batchmetadata.Channel(req.SourceChannel),
|
||||
ExecutionMode: batchmetadata.NormalizeMode(req.ExecutionMode),
|
||||
SourceBatchNo: sourceBatchNo,
|
||||
IsCrossDept: 0,
|
||||
TargetDeptId: req.TargetDeptId,
|
||||
|
||||
Reference in New Issue
Block a user