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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JiepeiWMS.Common.Enums;
 
namespace JiepeiWMS.Common.SaleAttribute {
    class BomSaleInfo : IBom {
        private string result = "";
        
        //2 订单类型
        public string GetBomType(int typeValue) {
            try {
                var name = ((EnumOrderMainTypeValue)typeValue).ToString();
                result = "0301";
                switch (name) {
                    case "BOM": { result = "0301"; }; break;
                    case "IC": { result = "0302"; }; break;
                }
                
            }
            catch {
                result = "";
            }
            return result;
        }
        //3 订单类别
        public string GetCategory(string category) {
            result = "0201";
            switch (category) {
                case "贴片": { result = "0201"; }; break;
                case "插件": { result = "0202"; }; break;
            }
            return result;
        }
        //4 精度
        public string GetAccuracy(decimal accuracyValue) {
            result = "0206";
            var val = accuracyValue.ToString("f2");
            switch (val) {
                case "0.10": { result = "0201"; }; break;
                case "1.00": { result = "0202"; }; break;
                case "5.00": { result = "0203"; }; break;
                case "10.00": { result = "0204"; }; break;
                case "20.00": { result = "0205"; }; break;
                    //case "其他": { result = "0206"; }; break;
            }
            return result;
        }
    }
}