using CoreCms.Net.IServices.CYOAServices; using CoreCms.Net.Model.FromBody; using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Utility.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace CoreCms.Net.Web.WebApi.Controllers.CyinOsAPI { /// /// 川印配送管理员 /// [Route("api/[controller]/[action]")] [ApiController] [Authorize] public class CyDeliverMangerController: ControllerBase { private readonly ICyinOAService _cyinOAService; /// /// /// public CyDeliverMangerController(ICyinOAService cyinOAService) { _cyinOAService = cyinOAService; } /// /// 是否是配送管理员 /// /// [HttpGet] public async Task IsDeliverManage() { return new WebApiCallBack { status = true, data = await _cyinOAService.IsDeliverManage() }; } /// /// 获取配送管理员订单 /// /// /// [HttpPost] public async Task GetOderListOfDeliveryManage(FMPageByWhereOrder entity) { return await _cyinOAService.GetOderListOfDeliveryManage(entity); } /// /// 获取配送管理订单 /// /// /// [HttpPost] public async Task GetSetDeliveryOderListOfDeliveryManage(FMPageByWhereOrder entity) { return await _cyinOAService.GetSendDeliveryOderListOfDeliveryManage(entity); } /// /// 获取新建配送信息 /// /// /// [HttpPost] public async Task GetDeliveryOderInfoe(FMIntId entity) { return await _cyinOAService.GetDeliveryOderInfoOfDeliveryManage(entity); } /// /// 修改或者配送管理订单 /// /// /// [HttpPost] public async Task SetDeliveryOderInfoe(DeliveryOrderDto entity) { if(!string.IsNullOrEmpty( entity.DeliveryMoble)) { //配送元不为空时检测是不是手机号码 if(!entity.DeliveryMoble.IsPhoneNumberValid()) { return new WebApiCallBack { status = false, msg = "DeliveryMoble 必须是手机号码" }; } } return await _cyinOAService.SetDeliveryOderOfDeliveryManage(entity); } } }