username@email.com
2024-09-09 cc170291673472d3cda8d7ea77f6bd3a3b5dbb83
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IRepository;
using CoreCms.Net.Model.ViewModels.UI;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using CoreCms.Net.IServices;
using Microsoft.AspNetCore.Hosting;
using CoreCms.Net.Model.Entities.baifenbingfa.Promote.OffLineDistributor;
using System.Collections.Generic;
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Services;
using System.ComponentModel;
 
namespace CoreCms.Net.Web.WebApi.Controllers
{
    /// <summary>
    /// 百分兵法线上
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OfflineDistributorController : ControllerBase
    {
        private readonly IWebHostEnvironment _webHostEnvironment;
        private readonly IOfflineDistributorServices _OfflineDistributorServices;
        private readonly ICoreCmsAreaServices _coreCmsAreaServices;
        private readonly IUnitOfWork _unitOfWork;
 
        /// <summary>
        /// 构造函数
        ///</summary>
        public OfflineDistributorController(IWebHostEnvironment webHostEnvironment
            , IOfflineDistributorServices OfflineDistributorServices
            , ICoreCmsAreaServices CoreCmsAreaServices
            , IUnitOfWork unitOfWork
            )
        {
            _webHostEnvironment = webHostEnvironment;
            _OfflineDistributorServices = OfflineDistributorServices;
            _coreCmsAreaServices = CoreCmsAreaServices;
            _unitOfWork = unitOfWork;
        }
 
 
        [HttpPost]
        [Description("输入供应商")]
 
        public async Task<WebApiCallBack> addOfflineDistributor([FromBody] addOfflineDistributorIn param)
        {
            
            var item = new OfflineDistributor
            {
                Adder = param.Adder,
                BusinessManager = param.BusinessManager,
                Category = param.Category,
                CollectionTime = param.time,
                ContactPerson = param.ContactPerson,
                CooperationIntent = param.CooperationIntent,
                DealerName = param.DistributorName,
                PhoneNumber = param.PhoneNumber,
                School=param.School,
               
                meetings = new List<OfflineDistributorMeeting>()
                         {
                             new OfflineDistributorMeeting
                             {
                                  createBy="用户采集",
                                   createTime= param.time,
                                   time=param.time,
                                    Dec= param.NegotiationNotes,
 
                             }
                         },
                PUserID = param.UserID,
                Region = param.RegionCode,
                Remake = param.Remake,
                StoreLogoUrl = param.StoreImage,
 
 
            };
            var jm = new WebApiCallBack();
            var ret = await _OfflineDistributorServices.UserInsertAsync(item);
            jm.code = ret.code;
            jm.status = true;
            jm.msg = ret.msg;
            jm.data = ret.data;
            return jm;
 
        }
 
 
    }
    /// <summary>
    /// 采集输入
    /// </summary>
    public class addOfflineDistributorIn
    {
        public int UserID { get; set; }
        /// <summary>
        /// 采集时间
        /// </summary>
        public DateTime time { get; set; }
 
        /// <summary>
        /// 区域
        /// </summary>
        public string RegionCode { get; set; }
 
        /// <summary>
        /// 地址
        /// </summary>
        public string Adder { get; set; }
        /// <summary>
        /// 学校
        /// </summary>
        public string School { get; set; }
 
        /// <summary>
        /// 类别
        /// </summary>
        public string Category { get; set; }
 
        /// <summary>
        /// 经销商名称
        /// </summary>
        public string DistributorName { get; set; }
 
        /// <summary>
        /// 联系人
        /// </summary>
        public string ContactPerson { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string PhoneNumber { get; set; }
 
        /// <summary>
        /// 店招图片
        /// </summary>
        public string StoreImage { get; set; }
 
        /// <summary>
        /// 合作意向
        /// </summary>
        public string CooperationIntent { get; set; }
 
        /// <summary>
        /// 洽谈记录
        /// </summary>
        public string NegotiationNotes { get; set; }
        /// <summary>
        /// 业务经理
        /// </summary>
        public string BusinessManager { get; set; }
        public string Remake { get; set; }
    }
 
 
}