From 7fdf7d7bd39cd0381c3969ad6302be0e693cad2d Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 02 四月 2024 10:56:33 +0800 Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/baifenbaishop --- CoreCms.Net.Web.WebApi/Controllers/OfflineDistributorController.cs | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 161 insertions(+), 0 deletions(-) diff --git a/CoreCms.Net.Web.WebApi/Controllers/OfflineDistributorController.cs b/CoreCms.Net.Web.WebApi/Controllers/OfflineDistributorController.cs new file mode 100644 index 0000000..6d8ac48 --- /dev/null +++ b/CoreCms.Net.Web.WebApi/Controllers/OfflineDistributorController.cs @@ -0,0 +1,161 @@ +锘縰sing 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; } + } + + +} -- Gitblit v1.9.1