WYB
2021-03-22 91b8cdad021ab052e4991f3d41834a6f0ddc36b8
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
 
using JiepeiWMS.IServices;
using JiepeiWMS.Model.Models;
using JiepeiWMS.Services.BASE;
using JiepeiWMS.IRepository.Base;
using System.Threading.Tasks;
using JiepeiWMS.Common.Enums;
using System.Collections.Generic;
 
namespace JiepeiWMS.Services
{
    public class WMOrderInfoServices : BaseServices<WMOrderInfo>, IWMOrderInfoServices
    {
        private readonly IBaseRepository<WMOrderInfo> _dal;
        public WMOrderInfoServices(IBaseRepository<WMOrderInfo> dal)
        {
            this._dal = dal;
            base.BaseDal = dal;
        }
 
        /// <summary>
        /// 验证子订单信息非空字段
        /// </summary>
        /// <param name="orderInfoModel"></param>
        /// <returns></returns>
        public async Task<string> ValidateReconParams(WMOrderInfo orderInfoModel)
        {
            var msg = "";
 
            if (orderInfoModel == null)
                return msg = "子订单信息不能为空";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.OrderNo))
                return msg = "订单编号不能为空";
 
            if (orderInfoModel.Num <= 0)
                return msg = "数量不能为0";
 
            if (orderInfoModel.TotalMoney <= 0)
                return msg = "销售价不能为0";
 
            if (orderInfoModel.CostMoney <= 0)
                return msg = "成本价不能为0";
 
            if (orderInfoModel.TotalArea <= 0)
                return msg = "面积不能为空";
 
            if (orderInfoModel.TypeValue <= 0)
                return msg = "NC产品规格型号对应值不能为空";
 
            if (orderInfoModel.CodeType <= 0)
                return msg = "NC产品类型不能为空";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.TgValue))
                return msg = "TG值(PCB用)不能为空";
 
            if (orderInfoModel.Layers <= 0)
                return msg = "层数(PCB、SMT用)不能为0";
 
            if (orderInfoModel.Thickness <= 0)
                return msg = "板厚(PCB、钢网用)不能为0";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.Surface))
                return msg = "表面处理(PCB用)不能为0";
 
            if (orderInfoModel.InnerCopperThickness <= 0)
                return msg = "内层铜厚(PCB用)不能为0";
 
            if (orderInfoModel.CopperThickness <= 0)
                return msg = "外层铜厚(PCB用)不能为0";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.SolderTopColor))
                return msg = "阻焊颜色(PCB用)不能为空";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.SolderDownColor))
                return msg = "底层阻焊颜色(PCB用)不能为空";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.FontTopColor))
                return msg = "文字颜色(PCB用)不能为空";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.FontDownColor))
                return msg = "底层文字颜色(PCB用)不能为空";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.FlyingTest))
                return msg = "飞针测试(PCB用)不能为空";
 
            if (orderInfoModel.MaterialType <= 0)
                return msg = "物料种类(SMT用)不能为空";
 
            if (orderInfoModel.SinglePoint <= 0)
                return msg = "单片贴片点数(SMT用)不能为0";
 
            if (orderInfoModel.SingleInsertPoint <= 0)
                return msg = "单片插件点数(SMT用)不能为0";
 
            if (orderInfoModel.Width <= 0)
                return msg = "宽度(钢网用)不能为0";
 
            if (orderInfoModel.Height <= 0)
                return msg = "高度(钢网用)不能为0";
 
            if (orderInfoModel.ReferenceHole <= 0)
                return msg = "基准孔值(钢网用)不能为0";
 
            if (string.IsNullOrWhiteSpace(orderInfoModel.BomCategory))
                return msg = "元器件类别(BOM用)不能为空";
 
            if (orderInfoModel.AccuracyValue <= 0)
                return msg = "精度(BOM用)不能为0";
 
            return msg;
        }
    }
}