schangxiang@126.com
2025-09-17 ff43ddf18764629ff875478e4e47a7281cbd230a
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
using Admin.NET.Core.ReceivingModule.Enum;
using Admin.NET.Core.WareHouse.Enum;
using System;
using Admin.NET.Core;
 
namespace Admin.NET.Application
{
    /// <summary>
    /// 出库单 帮助类
    /// </summary>
    public class OrderCommonHelper
    {
        /// <summary>
        /// 修改 单据创建波次状态    
        /// </summary>
        /// <param name="qty"></param>
        /// <param name="one_qty"></param>
        /// <returns></returns>
        public static OrderCreateWaveStatusEnum UpdateStatusForOrderCreateWaveStatus(decimal qty, decimal one_qty)
        {
            var title = "已创建波次数量";
 
            if (one_qty == 0)
            {
                return OrderCreateWaveStatusEnum.未创建波次;
            }
            if (one_qty < 0)
            {
                throw new Exception($"计算的{title}{one_qty}不能小于0");
            }
            if (qty == one_qty)
            {
                return OrderCreateWaveStatusEnum.全部创建波次;
            }
            else if (qty > one_qty)
            {
                return OrderCreateWaveStatusEnum.部分创建波次;
            }
            else
            {
               throw new Exception($"计算的{title}{one_qty}不能大于需求数{qty}");
            }
        }
 
 
        /// <summary>
        /// 修改 下发状态    
        /// </summary>
        /// <param name="qty"></param>
        /// <param name="one_qty"></param>
        /// <returns></returns>
        public static SortOrderIssueStatusEnum UpdateStatusForSortOrderIssueStatus(decimal qty, decimal one_qty)
        {
            var title = "下发数量";
 
            if (one_qty == 0)
            {
                return SortOrderIssueStatusEnum.未下发;
            }
            if (one_qty < 0)
            {
                throw new Exception($"计算的{title}{one_qty}不能小于0");
            }
            if (qty == one_qty)
            {
                return SortOrderIssueStatusEnum.全部下发;
            }
            else if (qty > one_qty)
            {
                return SortOrderIssueStatusEnum.部分下发;
            }
            else
            {
                throw new Exception($"计算的{title}{one_qty}不能大于需求数{qty}");
            }
        }
 
        ///// <summary>
        ///// 修改 取货状态    
        ///// </summary>
        ///// <param name="qty"></param>
        ///// <param name="one_qty"></param>
        ///// <returns></returns>
        //public static OrderPickStatusEnum UpdateStatusForOrderPickStatus(decimal qty, decimal one_qty)
        //{
        //    var title = "取货数量";
 
        //    if (one_qty == 0)
        //    {
        //        return OrderPickStatusEnum.未取货;
        //    }
        //    if (one_qty < 0)
        //    {
        //        throw new Exception($"计算的{title}{one_qty}不能小于0");
        //    }
        //    if (qty == one_qty)
        //    {
        //        return OrderPickStatusEnum.全部取货;
        //    }
        //    else if (qty > one_qty)
        //    {
        //        return OrderPickStatusEnum.部分取货;
        //    }
        //    else
        //    {
        //        throw new Exception($"计算的{title}{one_qty}不能大于需求数{qty}");
        //    }
        //}
 
        
 
        /// <summary>
        /// 修改 发货状态
        /// </summary>
        /// <param name="qty"></param>
        /// <param name="one_qty"></param>
        /// <returns></returns>
        public static OrderDeliverGoodsStatusEnum UpdateStatusForOrderDeliverGoodsStatus(decimal qty, decimal one_qty)
        {
            var title = "发货数量";
 
            if (one_qty == 0)
            {
                return OrderDeliverGoodsStatusEnum.未发货;
            }
            if (one_qty < 0)
            {
                throw new Exception($"计算的{title}{one_qty}不能小于0");
            }
            if (qty == one_qty)
            {
                return OrderDeliverGoodsStatusEnum.全部发货;
            }
            else if (qty > one_qty)
            {
                return OrderDeliverGoodsStatusEnum.部分发货;
            }
            else
            {
                throw new Exception($"计算的{title}{one_qty}不能大于需求数{qty}");
            }
        }
 
 
        /// <summary>
        /// 修改 单据收货状态
        /// </summary>
        /// <param name="qty"></param>
        /// <param name="one_qty"></param>
        /// <returns></returns>
        public static EnumSignStatus UpdateSignStatus(decimal qty, decimal one_qty)
        {
            var title = "已收货数量";
 
            if (one_qty == 0)
            {
                return EnumSignStatus.待收货;
            }
            if (one_qty < 0)
            {
                throw new Exception($"计算的{title}{one_qty}不能小于0");
            }
            if (qty == one_qty)
            {
                return EnumSignStatus.收货完成;
            }
            else if (qty > one_qty)
            {
                return EnumSignStatus.收货中;
            }
            else
            {
                throw new Exception($"计算的{title}{one_qty}不能大于需求数{qty}");
            }
        }
 
 
        
    }
}