移动系统liao
2024-11-12 1cb49b04ae6709e6054c328f5ed12bff9ca014c8
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
using CoreCms.Net.IRepository;
using CoreCms.Net.IServices;
using CoreCms.Net.IServices.baifenbingfa;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SKIT.FlurlHttpClient.Wechat.Api.Models;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading.Tasks;
 
namespace CoreCms.Net.Web.WebApi.Controllers.baifenbingfa
{
    /// <summary>
    /// 经销商发货单处理
    /// </summary>
    /// <summary>
    /// 页面接口
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize]
    public class DistributorDeliveryController: ControllerBase
    {
 
        IDistributorDeliveryServices _distributorDeliveryServices ;
      
        public DistributorDeliveryController(IDistributorDeliveryServices distributorDeliveryServices )
        {
            _distributorDeliveryServices= distributorDeliveryServices ;
        }
        /// <summary>
        /// 获取list
        /// </summary>
        /// <returns></returns>
        [HttpPost("GetList")]
        [SwaggerResponse(200, "返回数据", typeof(WebApiCallBack))]
        [SwaggerResponse(201, "Data类型", typeof(IPageList<CoreCmsBillDelivery>))]
 
        public async Task<WebApiCallBack> GetList(GetDeliveryListPost param)
        {
            var datalist = await _distributorDeliveryServices.GetDeliveryList(param);
            return new WebApiCallBack
            {
                status = true,
                data =new { datalist= datalist.Item1,
                total=datalist.Item2
                }
 
            };
            
        }
 
        /// <summary>
        /// 接受发货单
        /// </summary>
        /// <returns></returns>
        [HttpPost("Accepted")]      
        public async Task<WebApiCallBack> Accepted([FromBody] AccptedInParam param)
        {
            var datalist = await _distributorDeliveryServices.SetDeliveryAccepted( param.acceptType, param.id,param.noAcceptTypeMsg);
            return new WebApiCallBack
            {
                status = true,
                data = datalist
 
            };
 
        }
 
 
    }
    public class AccptedInParam
    {
        /// <summary>
        /// 状态 0 为接受 3 为拒绝/取消
        /// </summary>
        public sendDistributionAcceptType  acceptType { get; set; }
        /// <summary>
        /// 发货单ID
        /// 
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 校园代理拒绝原因
        /// </summary>
        public string noAcceptTypeMsg { get; set; }
    }
 
 
}