xiaojiao
6 小时以前 557f02072fa311eefe3123aa44afebac22adc465
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
using System;
using System.Collections.Generic;
using System.Text;
using WIDESEA.Entity.DomainModels;
using WIDESEA.Services.Repositories;
 
namespace WIDESEA.Services.Services
{
    public partial class CommonFunction
    {
        public static object GetZCInfo(VV_ContainerInfo container, string materiel, string barcode, string fcbAVG, string ydAVG, string zjAVG, string ldCode
            , string target, string direction)
        {
            decimal fcbMes = string.IsNullOrEmpty(fcbAVG) ? 0 : decimal.Parse(fcbAVG);
            decimal fcbWms = string.IsNullOrEmpty(container.csize_four_3) ? 0 : decimal.Parse(container.csize_four_3);
            decimal fcbdiff = 0;
            if (fcbMes != 0 && fcbWms != 0)
                fcbdiff = fcbMes - fcbWms;
 
            decimal ydMes = string.IsNullOrEmpty(ydAVG) ? 0 : decimal.Parse(ydAVG);
            decimal ydWms = string.IsNullOrEmpty(container.csize_three_3) ? 0 : decimal.Parse(container.csize_three_3);
            decimal yddiff = 0;
            if (ydMes != 0 && ydWms != 0)
                yddiff = ydMes - ydWms;
 
            decimal zjMes = string.IsNullOrEmpty(zjAVG) ? 0 : decimal.Parse(zjAVG);
            decimal zjWms = string.IsNullOrEmpty(container.csize_in_value) ? 0 : decimal.Parse(container.csize_in_value);
            decimal zjdiff = 0;
            if (zjMes != 0 && zjWms != 0)
                zjdiff = zjMes - zjWms;
 
 
            //decimal fcbDiff = ((string.IsNullOrEmpty(fcbAVG) ? 0 : decimal.Parse(fcbAVG)) - (string.IsNullOrEmpty(container.csize_four_3) ? 0 : decimal.Parse(container.csize_four_3)));
            //decimal ydDiff = ((string.IsNullOrEmpty(ydAVG) ? 0 : decimal.Parse(ydAVG) - (string.IsNullOrEmpty(container.csize_three_3) ? 0 : decimal.Parse(container.csize_three_3))));
            //decimal zjdDiff = ((string.IsNullOrEmpty(zjAVG) ? 0 : decimal.Parse(zjAVG) - (string.IsNullOrEmpty(container.csize_in_value) ? 0 : decimal.Parse(container.csize_in_value))));
 
            dt_selectionRecord record = new dt_selectionRecord()
            {
                record_barcode = container.containerdtl_barcode,
                record_createTime = DateTime.Now,
                record_fcbAVG_diff = fcbdiff,
                record_fcbAVG_mes = fcbMes,
                record_fcbAVG_wms = fcbWms,
                record_id = Guid.NewGuid(),
                record_ldCode = ldCode,
                record_ldNumber = barcode,
                record_locationId = container.location_id,
                record_madeUnit = container.containerdtl_madeUnit,
                record_materielId = container.materiel_id,
                record_materielNumber = container.containerdtl_goodsCode,
                record_materielType = container.containerdtl_type,
                record_standa = container.containerdtl_standard,
                record_userName = Core.ManageUser.UserContext.Current.UserTrueName,
                record_weight = string.IsNullOrEmpty(container.containerdtl_goodsWeight) ? 0 : decimal.Parse(container.containerdtl_goodsWeight),
                record_ydAVG_diff = yddiff,
                record_ydAVG_mes = ydMes,
                record_ydAVG_wms = ydWms,
                record_zjAVG_diff = zjdiff,
                record_zjAVG_mes = zjMes,
                record_zjAVG_wms = zjWms,
                record_direction = "left".Equals(direction) ? "左侧" : "右侧",
                record_outstation = target,
                record_inboundTime = container.DateDiffResult,
                record_lotNumber = container.containerdtl_lotNumber == "" ? "0" : container.containerdtl_lotNumber,
                record_ProductDate = container.containerdtl_ProductDate == "" ? "0" : container.containerdtl_ProductDate,
                Standard_value = container.Standard_value,
                Standard_value_NumResult = container.Standard_value_NumResult,
                Placeoforigin = container.Placeoforigin
            };
            dt_selectionRecordRepository.Instance.Add(record, true);
 
            //object zcInfo = new
            //{
            //    mesInfo = new
            //    {
            //        materielId = materiel,
            //        barcode = barcode,
            //        fcbAVG = fcbAVG,
            //        ydAVG = ydAVG,
            //        zjAVG = zjAVG,
            //        //轮对号
            //        ldCode = ldCode,
            //    },
 
            //    wmsInfo = new
            //    {
            //        materielId = container.materiel_id,
            //        barcode = container.containerdtl_barcode,
            //        fcbAVG = record.record_fcbAVG_wms,
            //        fcbDiff = record.record_fcbAVG_diff,
            //        ydAVG = record.record_ydAVG_wms,
            //        ydDiff = record.record_ydAVG_diff,
            //        zjAVG = record.record_zjAVG_wms,
            //        zjdDiff = record.record_zjAVG_diff,
            //        standa = container.containerdtl_standard,
            //        weight = container.containerdtl_goodsWeight,
            //        materielType = container.containerdtl_type,
            //        //轴承编号
            //        materielNumber = container.containerdtl_number
            //    }
            //};
 
            //object zcInfo = new
            //{
            //    wmsInfo = new List<object>(){
            //    new
            //    {
            //        name = "托盘号",
            //        value =record.record_barcode,
            //        column2Name="车型",
            //        column2Value=record.record_materielId
            //    },
            //    new
            //    {
            //        name = "轮对号",
            //        value = ldCode,
            //        column2Name = "轮对编码",
            //        column2Value =barcode,
            //    },
 
            //    new
            //    {  name = "轴承型号",
            //        value = record.record_materielType,
            //        column2Name = "轴承编码",
            //        column2Value = record.record_materielNumber,
            //    },
            //    new
            //    {
            //        name = "重量(克)",
            //        value = record.record_weight,
            //        column2Name = "测量标准",
            //        column2Value = record.record_standa,
            //    },
            //    new
            //    {
            //        name = "轴颈平均值",
            //        value = record.record_zjAVG_mes,
            //        column2Name = "防尘板座平均值",
            //        column2Value = record.record_fcbAVG_mes,
            //    },
            //    new
            //    {
            //        name = "轴承内径平均值",
            //        value = record.record_zjAVG_wms,
            //        column2Name = "后档平均值",
            //        column2Value =record.record_fcbAVG_wms,
            //    },
            //    new
            //    {
            //        name = "轴承内径过盈量",
            //        value =record.record_zjAVG_diff,
            //        column2Name = "防尘板座过盈量",
            //        column2Value = record.record_fcbAVG_diff,
            //    },
            //}
            //};
 
            object zcInfo = new
            {
                wmsInfo = new List<object>(){
                new
                {
                    name = "轮对号",
                    value = ldCode,
                },
                new{
                    name = "轴承编号",
                    value = record.record_materielNumber,
                },
                new
                {
                    name = "轴承类别",
                    value = record.record_standa,
                },
                 new
                 {
                    name="轴承内径平均值",
                    value = record.record_zjAVG_wms,
                },
                new
                {
                    name = "轴承内径过盈量",
                    value = record.record_zjAVG_diff,
                },
                new 
                {
                    name = "重量(克)",
                    value = record.record_weight,
                }
             }
            };
 
            return zcInfo;
        }
 
        public static object GetZCInfo2(Dt_container_size_info_hty size_info_hty, Dt_container_detail_hty detail_hty, string materiel, string barcode, string fcbAVG, string ydAVG, string zjAVG, string ldCode
            , string target, string direction,string materiel_id)
        {
            decimal fcbMes = string.IsNullOrEmpty(fcbAVG) ? 0 : decimal.Parse(fcbAVG);
            decimal fcbWms = string.IsNullOrEmpty(size_info_hty.csize_four_3) ? 0 : decimal.Parse(size_info_hty.csize_four_3);
            decimal fcbdiff = 0;
            if (fcbMes != 0 && fcbWms != 0)
                fcbdiff = fcbMes - fcbWms;
 
            decimal ydMes = string.IsNullOrEmpty(ydAVG) ? 0 : decimal.Parse(ydAVG);
            decimal ydWms = string.IsNullOrEmpty(size_info_hty.csize_three_3) ? 0 : decimal.Parse(size_info_hty.csize_three_3);
            decimal yddiff = 0;
            if (ydMes != 0 && ydWms != 0)
                yddiff = ydMes - ydWms;
 
            decimal zjMes = string.IsNullOrEmpty(zjAVG) ? 0 : decimal.Parse(zjAVG);
            decimal zjWms = string.IsNullOrEmpty(size_info_hty.csize_in_value) ? 0 : decimal.Parse(size_info_hty.csize_in_value);
            decimal zjdiff = 0;
            if (zjMes != 0 && zjWms != 0)
                zjdiff = zjMes - zjWms;
 
 
            //decimal fcbDiff = ((string.IsNullOrEmpty(fcbAVG) ? 0 : decimal.Parse(fcbAVG)) - (string.IsNullOrEmpty(container.csize_four_3) ? 0 : decimal.Parse(container.csize_four_3)));
            //decimal ydDiff = ((string.IsNullOrEmpty(ydAVG) ? 0 : decimal.Parse(ydAVG) - (string.IsNullOrEmpty(container.csize_three_3) ? 0 : decimal.Parse(container.csize_three_3))));
            //decimal zjdDiff = ((string.IsNullOrEmpty(zjAVG) ? 0 : decimal.Parse(zjAVG) - (string.IsNullOrEmpty(container.csize_in_value) ? 0 : decimal.Parse(container.csize_in_value))));
 
            dt_selectionRecord record = new dt_selectionRecord()
            {
                record_barcode = detail_hty.containerdtl_barcode,
                record_createTime = DateTime.Now,
                record_fcbAVG_diff = fcbdiff,
                record_fcbAVG_mes = fcbMes,
                record_fcbAVG_wms = fcbWms,
                record_id = Guid.NewGuid(),
                record_ldCode = ldCode,
                record_ldNumber = barcode,
                record_locationId = "手动选配,没有库位",
                record_madeUnit = detail_hty.containerdtl_madeUnit,
                record_materielId = materiel_id,
                record_materielNumber = detail_hty.containerdtl_goodsCode,
                record_materielType = detail_hty.containerdtl_type,
                record_standa = detail_hty.containerdtl_standard,
                record_userName = Core.ManageUser.UserContext.Current.UserTrueName,
                record_weight = string.IsNullOrEmpty(detail_hty.containerdtl_goodsWeight) ? 0 : decimal.Parse(detail_hty.containerdtl_goodsWeight),
                record_ydAVG_diff = yddiff,
                record_ydAVG_mes = ydMes,
                record_ydAVG_wms = ydWms,
                record_zjAVG_diff = zjdiff,
                record_zjAVG_mes = zjMes,
                record_zjAVG_wms = zjWms,
                record_direction = "left".Equals(direction) ? "左侧" : "右侧",
                record_outstation = "手动选配",
                record_inboundTime = "手动选配",
                record_lotNumber = "手动选配",
                record_ProductDate = "手动选配",
                Standard_value = detail_hty.Standard_value,
                Standard_value_NumResult = detail_hty.Standard_value_NumResult,
                Placeoforigin = detail_hty.Placeoforigin
                
 
            };
            dt_selectionRecordRepository.Instance.Add(record, true);
 
            object zcInfo = new
            {
                wmsInfo = new List<object>(){
                new
                {
                    name = "轮对号",
                    value = ldCode,
                },
                new{
                    name = "轴承编号",
                    value = record.record_materielNumber,
                },
                new
                {
                    name = "轴承类别",
                    value = record.record_standa,
                },
                 new
                 {
                    name="轴承内径平均值",
                    value = record.record_zjAVG_wms,
                },
                new
                {
                    name = "轴承内径过盈量",
                    value = record.record_zjAVG_diff,
                },
                new
                {
                    name = "重量(克)",
                    value = record.record_weight,
                }
             }
            };
 
            return zcInfo;
        }
    }
}