| | |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.Caching.AutoMate.RedisCache; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.CYOAServices; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | | using CoreCms.Net.Model.FromBody; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using CoreCms.Net.Repository.UnitOfWork; |
| | | using CoreCms.Net.Services; |
| | | using CoreCms.Net.Services.CYOAServices; |
| | | using EC_SeckillInfo; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Nest; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace CoreCms.Net.Web.WebApi.Controllers.CyinOsAPI |
| | |
| | | /// </summary> |
| | | [Route("api/[controller]/[action]")] |
| | | [ApiController] |
| | | |
| | | [Authorize] |
| | | public class CyDriverController : ControllerBase |
| | | { |
| | | |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | private readonly ICyinOAService _cyinOAService; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public CyDriverController(IUnitOfWork unitOfWork) |
| | | public CyDriverController(ICyinOAService cyinOAService) |
| | | { |
| | | _unitOfWork = unitOfWork; |
| | | _cyinOAService = cyinOAService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取是否是司机的标志 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public async Task<WebApiCallBack> GetData() |
| | | public async Task<WebApiCallBack> GetIsDrive() |
| | | { |
| | | var ret = new WebApiCallBack(); |
| | | var db = _unitOfWork.GetDbClient().GetConnection(AppSettingsConstVars.CYDbDbID) ; |
| | | //db.DbFirst.IsCreateAttribute().CreateClassFile("c:\\Demo\\5", "EC_SeckillInfo"); ; |
| | | var data= db.Queryable<EC_PrizeInfo>().ToList(); |
| | | ret.data= data; |
| | | return ret; |
| | | |
| | | return new WebApiCallBack |
| | | { |
| | | status = true, |
| | | data = await _cyinOAService.IsDrive() |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取送货任务 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> GetDeliverOderList(FMPageByWhereOrder entity) |
| | | { |
| | | |
| | | return |
| | | await _cyinOAService.GetDeliverOderListOfDrver(entity); |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 送货单历史 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> ManageDeliverOderListOfDrver(FMPageByWhereOrder entity) |
| | | { |
| | | |
| | | return |
| | | await _cyinOAService.ManageDeliverOderListOfDrver(entity); |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取送货任务详情 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> GetDeliverOderInfo(FMStringId entity) |
| | | { |
| | | |
| | | return new WebApiCallBack |
| | | { |
| | | status = true, |
| | | data = await _cyinOAService.GetDeliverInfoOfDrver(entity) |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置完 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> SetDeliverOderInfo(DeliveryOrderDto entity) |
| | | { |
| | | |
| | | return new WebApiCallBack |
| | | { |
| | | status = true, |
| | | data = await _cyinOAService.SetDeliverOrdeOfDrver(entity) |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开始配送 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> StartDeliverOrder(FMStringId entity) |
| | | { |
| | | |
| | | return new WebApiCallBack |
| | | { |
| | | status = true, |
| | | data = await _cyinOAService.StartDeliverOrderOfDrver(entity) |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 完成订单 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> FinishDeliverOrder(FMStringId entity) |
| | | { |
| | | |
| | | return new WebApiCallBack |
| | | { |
| | | status = true, |
| | | data = await _cyinOAService.FinishDeliverOrdeOfDrver(entity) |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存坐标 |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<WebApiCallBack> SetTarcks(TracksDto entity) |
| | | { |
| | | |
| | | return new WebApiCallBack |
| | | { |
| | | status = true, |
| | | data = await _cyinOAService.SetTarcks(entity) |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | ///// <param name="unitOfWork"></param> |
| | | ///// <returns></returns> |
| | | //[HttpPost] |
| | | //[AllowAnonymous] |
| | | //public bool CreatModeFile([FromServices] IUnitOfWork unitOfWork) |
| | | //{ |
| | | // var _CyDbClient = unitOfWork.GetDbClient().GetConnection(AppSettingsConstVars.CYDbDbID); |
| | | // _CyDbClient.DbFirst.IsCreateAttribute().StringNullable().CreateClassFile("c:\\Demo", "EC_SeckillInfo"); |
| | | // return true; |
| | | //} |
| | | } |
| | | |
| | | |
| | | } |