customaddlogic.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. AppId: req.AppId,
  30. AccountId: req.AccountId,
  31. CustomType: req.CustomType, //客户类型
  32. Summary: req.Summary, //概要信息
  33. CustomAllName: req.CustomAllName, //客户全称
  34. CustomAbbreviation: req.CustomAbbreviation, //客户简称
  35. CustomLevel: req.CustomLevel, //客户级别
  36. CustomIndustry: req.CustomIndustry, //客户行业
  37. CustomDetailIndustry: req.CustomDetailIndustry, //客户细分行业
  38. Province: req.Province, //省份
  39. City: req.City, //城市
  40. District: req.District, //地区
  41. Address: req.Address, //详细地址
  42. CompanyPhone: req.CompanyPhone, //公司电话
  43. NextfollowUpTime: req.NextfollowUpTime, //下次跟进时间戳
  44. Types: req.Types, //处理方式 1自办;2转办
  45. User: req.User, //转办用户
  46. EmployCustomId: req.EmployCustomId, //客户收录id
  47. EmployInfoId: req.EmployInfoId, //资讯收录id
  48. Remarks: req.Remarks, //备注
  49. CreateName: req.CreateName, //创建人
  50. }
  51. status, groupId := custom.Add(l.ctx)
  52. resp.Data = map[string]interface{}{
  53. "status": status,
  54. "groupId": groupId,
  55. }
  56. return
  57. }