错误信息超长
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package act
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"mime/multipart"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -1300,3 +1303,42 @@ func SyncSpecialAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func CreateActByExcel(ctx *jxcontext.Context, files []*multipart.FileHeader, vendorID int, vendorOrgCode string, mixType int, isFocus, isSync, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
if len(files) == 0 {
|
||||
return "", errors.New("没有文件上传!")
|
||||
}
|
||||
fileHeader := files[0]
|
||||
file, err := fileHeader.Open()
|
||||
hint, err = CreateActByExcelBin(ctx, file, vendorID, vendorOrgCode, mixType, isFocus, isSync, isAsync, isContinueWhenError)
|
||||
file.Close()
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func CreateActByExcelBin(ctx *jxcontext.Context, reader io.Reader, vendorID int, vendorOrgCode string, mixType int, isFocus, isSync, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
switch step {
|
||||
case 0:
|
||||
//读取excel文件
|
||||
// xlsx, err := excelize.OpenReader(reader)
|
||||
// if err != nil {
|
||||
// return "", err
|
||||
// }
|
||||
// rows, _ := xlsx.GetRows(xlsx.GetSheetName(1))
|
||||
// for rowNum, row := range rows {
|
||||
|
||||
// }
|
||||
case 1:
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
taskSeq := tasksch.NewSeqTask2("根据Excel创建活动-序列任务", ctx, isContinueWhenError, taskSeqFunc, 5)
|
||||
tasksch.HandleTask(taskSeq, nil, true).Run()
|
||||
if !isAsync {
|
||||
_, err = taskSeq.GetResult(0)
|
||||
hint = "1"
|
||||
} else {
|
||||
hint = taskSeq.GetID()
|
||||
}
|
||||
return hint, err
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCod
|
||||
}
|
||||
jsonData = strings.ReplaceAll(jsonData, regexpToken.FindString(jsonData), "")
|
||||
jsonData = utils.LimitUTF8StringLen(jsonData, 3200)
|
||||
errMsg = utils.LimitUTF8StringLen(errMsg, 3200)
|
||||
event := &model.OperateEvent{
|
||||
CreatedAt: time.Now(),
|
||||
LastOperator: ctx.GetUserName(),
|
||||
|
||||
Reference in New Issue
Block a user