123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package logic
- import (
- "context"
- "bp.jydev.jianyu360.cn/CRM/application/api/internal/svc"
- "bp.jydev.jianyu360.cn/CRM/application/api/internal/types"
- "bp.jydev.jianyu360.cn/CRM/application/service"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type ClueAddLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewClueAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ClueAddLogic {
- return &ClueAddLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *ClueAddLogic) ClueAdd(req *types.ClueAddReq) (resp *types.Reply, err error) {
- // todo: add your logic here and delete this line
- resp = &types.Reply{}
- clue := &service.SaleClueService{
- AppId: req.AppId,
- PositionId: req.PositionId,
- EntId: req.EntId,
- EntUserId: req.EntUserId,
- AccountId: req.AccountId,
- ClueName: req.ClueName,
- CluesSource: req.CluesSource,
- Summary: req.Summary,
- EmployInfoId: req.EmployInfoId,
- Types: req.Types,
- User: req.User,
- FollowUpTime: req.FollowUpTime,
- CreateName: req.CreateName,
- BaseUserId: req.BaseUserId,
- EntDeptId: req.EntDeptId,
- Channel: req.Channel,
- }
- status, error_msg := service.CanAdd(req.EntId, "more_create_clue", req.EmployInfoId, 0, req.PositionId)
- if status <= 0 {
- resp.Error_code = -1
- resp.Error_msg = error_msg
- resp.Data = map[string]interface{}{
- "status": -1,
- }
- return
- }
- status, _ = clue.Add(l.ctx)
- resp.Data = map[string]interface{}{
- "status": status,
- }
- return
- }
|