New file |
| | |
| | | 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; } |
| | | } |
| | | |
| | | |
| | | } |