|
|
@@ -24,7 +24,6 @@ func (c *CustomerHeader) GetList(ctx context.Context, req *model.CustCustomerSea
|
|
|
return err
|
|
|
}
|
|
|
total, list, err := customerServer.GetList(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -44,7 +43,6 @@ func (c *CustomerHeader) PublicGetList(ctx context.Context, req *model.CustCusto
|
|
|
req.IsPublic = noCustomer
|
|
|
|
|
|
total, list, err := customerServer.GetList(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
|
|
|
return err
|
|
|
@@ -66,7 +64,6 @@ func (c *CustomerHeader) Create(ctx context.Context, req *model.CustomerAddSeq,
|
|
|
|
|
|
}
|
|
|
id, err := s.Create(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
|
|
|
return err
|
|
|
@@ -84,7 +81,6 @@ func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustom
|
|
|
return err
|
|
|
}
|
|
|
err = s.UpdateById(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
|
|
|
return err
|
|
|
@@ -96,7 +92,7 @@ func (c *CustomerHeader) UpdateById(ctx context.Context, req *model.UpdateCustom
|
|
|
//GetEntityById 客户详情
|
|
|
func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 {
|
|
|
- return myerrors.NewMsgError(nil, "参数有误")
|
|
|
+ return myerrors.ValidError("参数有误")
|
|
|
}
|
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
|
@@ -104,7 +100,6 @@ func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq
|
|
|
return err
|
|
|
}
|
|
|
list, err := customerServer.GetEntityById(req.Ids)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -115,14 +110,13 @@ func (c *CustomerHeader) GetEntityById(ctx context.Context, req *comm_def.IdsReq
|
|
|
//DeleteById 删除客户
|
|
|
func (c *CustomerHeader) DeleteById(ctx context.Context, req *model.DelCustomer, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 {
|
|
|
- return myerrors.NewMsgError(nil, "参数有误")
|
|
|
+ return myerrors.ValidError("参数有误")
|
|
|
}
|
|
|
s, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
err = s.DeleteByIds(req.Ids)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -141,7 +135,6 @@ func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsEx
|
|
|
return err
|
|
|
}
|
|
|
exist, err := customerServer.GetCustNameIsExist(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -152,14 +145,13 @@ func (c *CustomerHeader) GetCustNameIsExist(ctx context.Context, req *model.IsEx
|
|
|
//TransCustomer 转移客户
|
|
|
func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 || req.SalesId == 0 {
|
|
|
- return myerrors.NewMsgError(nil, "参数有误")
|
|
|
+ return myerrors.ValidError("参数有误")
|
|
|
}
|
|
|
s, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
err = s.TransCustomer(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -172,7 +164,7 @@ func (c *CustomerHeader) TransCustomer(ctx context.Context, req *model.AssignCus
|
|
|
//AssignCustomer 分配,领取客户
|
|
|
func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCustomerReq, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 || req.SalesId == 0 {
|
|
|
- return myerrors.NewMsgError(nil, "参数有误")
|
|
|
+ return myerrors.ValidError("参数有误")
|
|
|
}
|
|
|
s, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
|
@@ -185,7 +177,6 @@ func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCu
|
|
|
behavior = "领取"
|
|
|
}
|
|
|
err = s.AssignCustomer(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -197,14 +188,13 @@ func (c *CustomerHeader) AssignCustomer(ctx context.Context, req *model.AssignCu
|
|
|
//MoveToPubic 移入公海
|
|
|
func (c *CustomerHeader) MoveToPubic(ctx context.Context, req *model.MoveToPubicRep, rsp *comm_def.CommonMsg) error {
|
|
|
if len(req.Ids) == 0 {
|
|
|
- return myerrors.NewMsgError(nil, "参数有误")
|
|
|
+ return myerrors.ValidError("参数有误")
|
|
|
}
|
|
|
s, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
err = s.MoveToPubic(req.Ids)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
|
|
|
return err
|
|
|
@@ -223,7 +213,6 @@ func (c *CustomerHeader) GetDynamicsList(ctx context.Context, req *model.Custome
|
|
|
return err
|
|
|
}
|
|
|
total, list, err := customerServer.GetDynamicsList(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -241,7 +230,6 @@ func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCust
|
|
|
return err
|
|
|
}
|
|
|
err = s.MergeCustomer(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -253,14 +241,13 @@ func (c *CustomerHeader) MergeCustomer(ctx context.Context, req *model.MergeCust
|
|
|
//GetCustAbstract 客户摘要
|
|
|
func (c *CustomerHeader) GetCustAbstract(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
|
if req.Id == 0 {
|
|
|
- return myerrors.NewMsgError(nil, "参数有误")
|
|
|
+ return myerrors.ValidError("参数有误")
|
|
|
}
|
|
|
customerServer, err := server.NewCustomerService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
list, err := customerServer.CustAbstract(req.Id)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -275,7 +262,6 @@ func (c *CustomerHeader) Export(ctx context.Context, req *model.CustCustomerExpo
|
|
|
return err
|
|
|
} //Export
|
|
|
buffer, err := customerServer.Export(req)
|
|
|
- _, err, rsp.Code, rsp.Msg = myerrors.CheckError(err)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|