12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- 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 CustomAddLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewCustomAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CustomAddLogic {
- return &CustomAddLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *CustomAddLogic) CustomAdd(req *types.CustomAddReq) (resp *types.Reply, err error) {
- // todo: add your logic here and delete this line
- resp = &types.Reply{}
- custom := &service.CustomService{
- BaseUserId: req.BaseUserId,
- PositionId: req.PositionId,
- EntUserId: req.EntUserId,
- EntId: req.EntId,
- AppId: req.AppId,
- AccountId: req.AccountId,
- EntDeptId: req.EntDeptId,
- CustomType: req.CustomType, //客户类型
- Summary: req.Summary, //概要信息
- CustomAllName: req.CustomAllName, //客户全称
- CustomAbbreviation: req.CustomAbbreviation, //客户简称
- CustomLevel: req.CustomLevel, //客户级别
- CustomIndustry: req.CustomIndustry, //客户行业
- CustomDetailIndustry: req.CustomDetailIndustry, //客户细分行业
- Province: req.Province, //省份
- City: req.City, //城市
- District: req.District, //地区
- Address: req.Address, //详细地址
- CompanyPhone: req.CompanyPhone, //公司电话
- NextfollowUpTime: req.NextfollowUpTime, //下次跟进时间戳
- Types: req.Types, //处理方式 1自办;2转办
- User: req.User, //转办用户
- EmployCustomId: req.EmployCustomId, //客户收录id
- EmployInfoId: req.EmployInfoId, //资讯收录id
- Remarks: req.Remarks, //备注
- CreateName: req.CreateName, //创建人
- Source: req.Source, //来源
- OwnerId: req.OwnerId,
- BusinessId: req.BusinessId,
- }
- status, error_msg := service.CanAdd(req.EntId, "more_create_custom", req.EmployInfoId, req.EmployCustomId, req.PositionId)
- if status <= 0 {
- resp.Error_code = -1
- resp.Error_msg = error_msg
- resp.Data = map[string]interface{}{
- "status": -1,
- }
- return
- }
- status, _ = custom.Add(l.ctx)
- resp.Data = map[string]interface{}{
- "status": status,
- }
- return
- }
|