作者 tangxvhui
... ... @@ -273,20 +273,20 @@ func (controller *ImportController) ZipImport() {
})
continue
}
if err := controller.parserAndInsert(f, fn); err != nil {
if err = controller.parserAndInsert(f, fn); err != nil {
failure = append(failure, command.ErrorI{
FileName: fn,
Message: err.Error(),
})
continue
}
} else {
success = append(success, command.ErrorI{
FileName: fn,
Message: "",
})
}
}
// 解析完成
out = command.OutResult{
Status: "completed",
Success: success,
... ... @@ -409,9 +409,9 @@ func (controller *ImportController) parserAndInsert(file *os.File, fileName stri
return application.ThrowError(application.ARG_ERROR, "没有数据内容")
}
var filenameWithSuffix = path.Base(fileName)
var fileSuffix = path.Ext(filenameWithSuffix)
var filenameOnly = strings.TrimSuffix(filenameWithSuffix, fileSuffix)
var nameWithSuffix = path.Base(fileName)
var suffix = path.Ext(nameWithSuffix)
var nameOnly = strings.TrimSuffix(nameWithSuffix, suffix)
ruService := service.NewEvaluationTemplateService()
in := &templateCommand.CreateTemplateCommand{}
... ... @@ -419,7 +419,7 @@ func (controller *ImportController) parserAndInsert(file *os.File, fileName stri
ua := middlewares.GetUser(controller.Ctx)
in.CompanyId = ua.CompanyId
in.CreatorId = ua.UserId
in.Name = filenameOnly
in.Name = nameOnly
in.Describe = ""
in.NodeContents = list
... ...