|
|
@@ -12,6 +12,7 @@ import (
|
|
|
"github.com/gogf/gf/container/garray"
|
|
|
"github.com/gogf/gf/text/gstr"
|
|
|
"github.com/gogf/gf/util/gvalid"
|
|
|
+ "github.com/mozillazg/go-pinyin"
|
|
|
"math"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
@@ -26,7 +27,6 @@ import (
|
|
|
"github.com/gogf/gf/frame/g"
|
|
|
"github.com/gogf/gf/os/gtime"
|
|
|
"github.com/gogf/gf/util/gconv"
|
|
|
- "github.com/mozillazg/go-pinyin"
|
|
|
excelizev2 "github.com/xuri/excelize/v2"
|
|
|
|
|
|
"dashoo.cn/micro/app/dao/cust"
|
|
|
@@ -397,7 +397,13 @@ func (s *CustomerService) Import(ctx context.Context, req *contract.ExcelImportR
|
|
|
}
|
|
|
id, err := s.Create(insertCustomer)
|
|
|
if err != nil {
|
|
|
- return err
|
|
|
+ if err.Error() == "该客户信息已存在,不可重复添加" {
|
|
|
+ g.Log(fmt.Sprintf("[%s]%s", data.CustName, "该客户信息已存在,不可重复添加"))
|
|
|
+ g.Log().Error(err)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ g.Log().Error(err)
|
|
|
+ return myerrors.TipsError(fmt.Sprintf("[%s]%s", data.CustName, "数据有误,请联系管理员"))
|
|
|
}
|
|
|
s.CreateDynamics("创建客户", req, id)
|
|
|
data.CuctName = gstr.Trim(data.CuctName)
|