customaddlogic.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
  5. "bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
  6. "bp.jydev.jianyu360.cn/CRM/application/service"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type CustomAddLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewCustomAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CustomAddLogic {
  15. return &CustomAddLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *CustomAddLogic) CustomAdd(req *types.CustomAddReq) (resp *types.Reply, err error) {
  22. // todo: add your logic here and delete this line
  23. resp = &types.Reply{}
  24. custom := &service.CustomService{
  25. BaseUserId: req.BaseUserId,
  26. PositionId: req.PositionId,
  27. EntUserId: req.EntUserId,
  28. EntId: req.EntId,
  29. CustomType: req.CustomType, //客户类型
  30. Summary: req.Summary, //概要信息
  31. CustomAllName: req.CustomAllName, //客户全称
  32. CustomAbbreviation: req.CustomAbbreviation, //客户简称
  33. CustomLevel: req.CustomLevel, //客户级别
  34. CustomIndustry: req.CustomIndustry, //客户行业
  35. CustomDetailIndustry: req.CustomDetailIndustry, //客户细分行业
  36. Province: req.Province, //省份
  37. City: req.City, //城市
  38. District: req.District, //地区
  39. Address: req.Address, //详细地址
  40. CompanyPhone: req.CompanyPhone, //公司电话
  41. NextfollowUpTime: req.NextfollowUpTime, //下次跟进时间戳
  42. Types: req.Types, //处理方式 1自办;2转办
  43. User: req.User, //转办用户
  44. EmployCustomId: req.EmployCustomId, //客户收录id
  45. EmployInfoId: req.EmployInfoId, //资讯收录id
  46. Remarks: req.Remarks, //备注
  47. CreateName: req.CreateName, //创建人
  48. }
  49. status := custom.Add(l.ctx)
  50. resp.Data = map[string]interface{}{
  51. "status": status,
  52. }
  53. return
  54. }