tx
2025-04-10 2538101febc78f525945da72c7cdcb2589f9e6ea
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks; 
 
namespace TProduct.OpenDto
{
    public class FeatTestPackInfoHelper
    {
        protected TProduct.Model.ProductSeries _currentPumpSeries = null;
        public TProduct.Model.ProductSeries CurrentPumpSeries { get => _currentPumpSeries; set => _currentPumpSeries = value; }
 
        protected TProduct.Model.ProductMainExPump _currentPump = null;
        public TProduct.Model.ProductMainExPump CurrentPump { get => _currentPump; set => _currentPump = value; }
 
        protected TProduct.Model.ProductMainExMotor _currentMotor = null;
        public TProduct.Model.ProductMainExMotor CurrentMotor { get => _currentMotor; set => _currentMotor = value; }
 
        protected TProduct.Model.PartBase _currentPart = null;
        public TProduct.Model.PartBase CurrentPart { get => _currentPart; set => _currentPart = value; }
 
        protected TProduct.Model.RatedParas4Pump _ratedParas = null;
        public TProduct.Model.RatedParas4Pump RatedParas { get => _ratedParas; set => _ratedParas = value; }
 
        protected TProduct.Model.WorkBenchBase _workBenchInfo = null;
        public TProduct.Model.WorkBenchBase WorkBenchInfo { get => _workBenchInfo; set => _workBenchInfo = value; }
 
        protected TProduct.Model.TestProjectItemView _testItem = null;
        public TProduct.Model.TestProjectItemView TestItem { get => _testItem; set => _testItem = value; }
 
        protected List<TProduct.Model.WorkBenchMonitorPoint> _allMonitorPointList = null;
        public List<TProduct.Model.WorkBenchMonitorPoint> AllMonitorPointList { get => _allMonitorPointList; set => _allMonitorPointList = value; }
 
        protected List<Model.LoginUser> _allLoginUser { get; set; } = null;
        public List<Model.LoginUser> AllLoginUser { get => _allLoginUser; set => _allLoginUser = value; }
 
        protected List<Model.ManufacturerBase> allManufacturer { get; set; } = null;
        public List<Model.ManufacturerBase> AllManufacturer { get => allManufacturer; set => allManufacturer = value; }
 
        protected List<TProduct.Model.PumpFeatTestRecordViewModel> _allRecords = null;
        public List<Model.PumpFeatTestRecordViewModel> AllRecords { get => _allRecords; set => _allRecords = value; }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="error_info"></param>
        /// <returns></returns>
        public TProduct.OpenDto.IStationSynResult Synch(out string error_info)
        {
            error_info = null;
            FeatTestPackInfoV1 packInfo = new FeatTestPackInfoV1();
            packInfo.Version = "V1";
 
            if (_allRecords == null || _allRecords.Count < 3)
            {
                error_info = "测试记录过少, 无法同步";
                return null;
            }
 
            string url_type = TProduct.CorpConfig.Instance.TestPackRemoteService.ServiceName;
            string url = null;
 
            if (url_type == "SqiIStation")
            {
                if (TProduct.CorpConfig.Instance.IStation == null)
                {
                    error_info = "对接配置未设置 IStation";
                    return null;
                }
                if (string.IsNullOrEmpty(TProduct.CorpConfig.Instance.IStation.SoftClientID))
                {
                    error_info = "未设置 IStation SoftClientID";
                    return null;
                }
                if (string.IsNullOrEmpty(TProduct.CorpConfig.Instance.IStation.WebApiUrl))
                {
                    error_info = "未设置 IStation WebApiUrl";
                    return null;
                }
                packInfo.TenantID = TProduct.CorpConfig.Instance.IStation.TenantID;
                packInfo.TenantTag = TProduct.CorpConfig.Instance.IStation.TenantTag; 
                packInfo.SoftClientID = TProduct.CorpConfig.Instance.IStation.SoftClientID;
                url = TProduct.CorpConfig.Instance.IStation.WebApiUrl + "SQI/Test/TProduct/SynProject@V1.0";
            }
            else
            {
                error_info = "TestPackRemoteService ServiceName 无法识别";
                return null;
            }
 
 
 
 
 
            TProduct.OpenDto.ProductPump pump_dto = new OpenDto.ProductPump();
 
            #region 泵信息
            pump_dto.ID = _currentPump.ID;
            pump_dto.CreateUserName = (from x in _allLoginUser where x.ID == _currentPump.CreateUserID select x.RealName).FirstOrDefault();
            pump_dto.CreateTime = _currentPump.CreateTime;
            pump_dto.UpdateUserName = (from x in _allLoginUser where x.ID == _currentPump.UpdateUserID select x.RealName).FirstOrDefault();
            pump_dto.UpdateTime = _currentPump.UpdateTime;
            pump_dto.Code = _currentPump.Code;
            pump_dto.Name = _currentPump.Name;
            pump_dto.SeriesName = this._currentPumpSeries.Name;
            if (_ratedParas != null)
            {
 
                pump_dto.RatedParas = new OpenDto.RatedParas4Pump();
                pump_dto.RatedParas.Q = _ratedParas.Q;
                pump_dto.RatedParas.H = _ratedParas.H;
                pump_dto.RatedParas.P = _ratedParas.P;
                pump_dto.RatedParas.E = _ratedParas.E;
                pump_dto.RatedParas.NPSHr = _ratedParas.NPSHr;
                pump_dto.RatedParas.IsFrequency = _ratedParas.IsFrequency;
                pump_dto.RatedParas.IsSxp = _ratedParas.IsSxp;
                pump_dto.RatedParas.StageNumber = _ratedParas.StageNumber;
                pump_dto.RatedParas.OutletDia = _ratedParas.OutletDia;
                pump_dto.RatedParas.InletDia = _ratedParas.InletDia;
                pump_dto.RatedParas.NpshGaoChaZd = _ratedParas.NpshGaoChaZd;
                pump_dto.RatedParas.IsInletPress = _ratedParas.IsInletPress;
                pump_dto.RatedParas.CurrentType = _ratedParas.CurrentType.ToString();
                pump_dto.RatedParas.Voltage = _ratedParas.Voltage;
                pump_dto.RatedParas.CurrentI = _ratedParas.CurrentI;
                pump_dto.RatedParas.MaxQ = _ratedParas.MaxQ;
                pump_dto.RatedParas.MaxH = _ratedParas.MaxH;
            }
 
 
            pump_dto.SortCode = _currentPump.SortCode;
            pump_dto.Ratedn = _currentPump.Ratedn;
            pump_dto.D2 = _currentPump.D2;
            pump_dto.PosiAngle = _currentPump.PosiAngle;
            pump_dto.CurveFitTypeQH = (int)_currentPump.CurveFitTypeQH;
            pump_dto.CurveFitTypeQE = (int)_currentPump.CurveFitTypeQE;
            pump_dto.CurveFitTypeQP = (int)_currentPump.CurveFitTypeQP;
 
            pump_dto.PartID = _currentPart.ID;
            pump_dto.PartCode = _currentPart.Code;
            pump_dto.PartName = _currentPart.Name;
            pump_dto.LastTestUserName = (from x in _allLoginUser where x.ID == _currentPart.LastTestUserID select x.RealName).FirstOrDefault();
            pump_dto.LastTestTime = _currentPart.LastTestTime;
 
            pump_dto.ManufacturerName = (from x in allManufacturer where x.ID == _currentPart.ManufacturerID select x.FullName).FirstOrDefault();
            pump_dto.ManufactureTime = _currentPart.ManufactureTime;
            #endregion
 
 
            #region 电机
            if (_currentMotor != null)
            {
 
                pump_dto.Motor = new OpenDto.ProductMotor();
 
                #region 电机信息
                pump_dto.Motor.ID = _currentMotor.ID;
                pump_dto.Motor.CreateUserName = (from x in _allLoginUser where x.ID == _currentMotor.CreateUserID select x.RealName).FirstOrDefault();
                pump_dto.Motor.CreateTime = _currentMotor.CreateTime;
                pump_dto.Motor.UpdateUserName = (from x in _allLoginUser where x.ID == _currentMotor.UpdateUserID select x.RealName).FirstOrDefault();
                pump_dto.Motor.UpdateTime = _currentMotor.UpdateTime;
                pump_dto.Motor.Code = _currentMotor.Code;
                pump_dto.Motor.Name = _currentMotor.Name;
                //pump_dto.Motor.SeriesName = (from x in allSereis where x.ID == _currentMotor.SeriesID select x.Name).FirstOrDefault();
 
                if (!string.IsNullOrEmpty(_currentMotor.RatedParas))
                {
                    var _ratedParas = Model.RatedParas4Motor.ToModel(_currentMotor.RatedParas);
 
                    pump_dto.Motor.IsFrequency = _ratedParas.IsFrequency;
                    pump_dto.Motor.E_PLC = _ratedParas.E_PLC;
                    pump_dto.Motor.E_Self = _ratedParas.E_Self;
                    pump_dto.Motor.CurrentType = _ratedParas.CurrentType.ToString();
                }
 
 
 
                #endregion
 
            }
 
            #endregion
 
            packInfo.Pump = pump_dto;
 
 
 
            #region 测试台
            OpenDto.WorkBenchBase dto_bench = new OpenDto.WorkBenchBase();
            dto_bench.ID = _workBenchInfo.ID;
            dto_bench.IStationID = _workBenchInfo.IStationID;
            if (string.IsNullOrEmpty(_workBenchInfo.IStationID))
            {
                error_info = "测试台未设置外部ID, 无法同步";
                return null;
            }
            dto_bench.CreateUserName = (from x in _allLoginUser where x.ID == _workBenchInfo.CreateUserID select x.RealName).FirstOrDefault();
            //_workBenchInfo.CreateUserID;
            dto_bench.CreateTime = _workBenchInfo.CreateTime;
            dto_bench.UpdateUserName = (from x in _allLoginUser where x.ID == _workBenchInfo.UpdateUserID select x.RealName).FirstOrDefault();
            //_workBenchInfo.UpdateUserID;
            dto_bench.UpdateTime = _workBenchInfo.UpdateTime;
            dto_bench.Code = _workBenchInfo.Code;
            dto_bench.Name = _workBenchInfo.Name;
 
            dto_bench.LastUseTime = _workBenchInfo.LastUseTime;
            dto_bench.LastUseUserID = _workBenchInfo.LastUseUserID;
            dto_bench.UseStatus = _workBenchInfo.UseStatus.ToString();
            dto_bench.PipeIndex = _workBenchInfo.PipeIndex;
            dto_bench.PipeParas = _workBenchInfo.PipeParas;
            dto_bench.LinkType = _workBenchInfo.LinkType.ToString();
            //dto_bench.TestMethod = _workBenchInfo.TestMethod;
            //dto_bench.TestSetting = _workBenchInfo.TestSetting;
 
            dto_bench.Tag = _workBenchInfo.Tag;
            dto_bench.LinkTag = _workBenchInfo.LinkTag;
            dto_bench.SortCode = _workBenchInfo.SortCode;
 
            if (_workBenchInfo.LinkInfo != null)
            {
                dto_bench.ReceiveWaitTime = _workBenchInfo.LinkInfo.ReceiveWaitTime;
                dto_bench.PollTime = _workBenchInfo.LinkInfo.PollTime;
            }
 
            var test_setting = new Model.WorkBenchSetting4Pump(_workBenchInfo.TestSetting);
            dto_bench.NpshCriterion = test_setting.NpshCriterion;
            dto_bench.IsTemperatureTrn = test_setting.IsTemperatureTrn;
            dto_bench.Elevation = test_setting.Elevation;
            dto_bench.AtmosphericPressure = test_setting.AtmosphericPressure;
            dto_bench.IsAutoTestAble = test_setting.IsAutoTestAble;
            dto_bench.IsOperateValveDegree = test_setting.IsOperateValveDegree;
            dto_bench.IsInitialElectricalAble = test_setting.IsInitialElectricalAble;
 
            var method = new Model.WorkBenchMethod4Pump(_workBenchInfo.TestMethod);
            dto_bench.TestMethodPower = method.Power == null ? "" : method.Power.ToString();
            dto_bench.TestMethodPress = method.Press == null ? "" : method.Press.ToString();
            dto_bench.TestMethodTorque = method.Torque == null ? "" : method.Torque.ToString();
            dto_bench.TestMethodNpsh = method.Npsh == null ? "" : method.Npsh.ToString();
            dto_bench.InletIsUseWaterLevel = method.InletIsUseWaterLevel;
 
            //
            if (_allMonitorPointList != null)
            {
                dto_bench.Points = new List<OpenDto.MonitorPointBase>();
                foreach (var mp in _allMonitorPointList)
                {
                    var mp_dto = new TProduct.OpenDto.MonitorPointBase();
 
                    mp_dto.ID = mp.ID;
                    mp_dto.IStationID = mp.IStationID;
                    mp_dto.Code = mp.Code;
                    mp_dto.Name = mp.Name;
                    mp_dto.MonitorType = (OpenDto.eMonitorType)(int)mp.MonitorType;
                    mp_dto.Property = mp.Property;
                    mp_dto.PipeDia = mp.PipeDia;
                    mp_dto.Elevation = mp.Elevation;
                    mp_dto.SortCode = mp.SortCode;
                    if (mp.ValueCoeffParas != null)
                    {
                        mp_dto.ValueCoeffParas = new OpenDto.ValueCoeffParas();
 
                        mp_dto.ValueCoeffParas.Method = mp.ValueCoeffParas.Method;
                        mp_dto.ValueCoeffParas.Multiply1 = mp.ValueCoeffParas.Multiply1;
                        mp_dto.ValueCoeffParas.Add1 = mp.ValueCoeffParas.Add1;
 
                        mp_dto.ValueCoeffParas.InterpolationType = mp.ValueCoeffParas.InterpolationType;
                        mp_dto.ValueCoeffParas.RealValues = mp.ValueCoeffParas.RealValues;
 
                        mp_dto.ValueCoeffParas.Multiplys = mp.ValueCoeffParas.Multiplys;
 
                        mp_dto.ValueCoeffParas.Adds = mp.ValueCoeffParas.Adds;
                    }
 
                    mp_dto.SumCalcCoeff = mp.SumCalcCoeff;
                    //mp_dto.AnalogParas = mp.AnalogParas;
                    //mp_dto.DigitalParas = mp.DigitalParas;
 
 
                    dto_bench.Points.Add(mp_dto);
                }
            }
 
            packInfo.TestBench = dto_bench;
            #endregion
 
 
            #region 测试数据
 
 
            var testItem_dto = new TProduct.OpenDto.TestProjectItem();
          
            testItem_dto.SeriesID = _testItem.SeriesID;
            testItem_dto.ProductID = _testItem.ProductID;
            testItem_dto.PartID = _testItem.PartID;
            testItem_dto.ProjectUseStatus = _testItem.ProjectUseStatus.ToString();
            testItem_dto.PrjIStationID = _testItem.IStationID;
 
            testItem_dto.ProjectID = _testItem.ProjectID;
            testItem_dto.ProjectCode = _testItem.ProjectCode;
            testItem_dto.ProjectName = _testItem.ProjectName;
            testItem_dto.IsFixed = _testItem.IsFixed;
            testItem_dto.ProjectJudgeResult = _testItem.ProjectJudgeResult.ToString();
            testItem_dto.ReportFileNO = _testItem.ReportFileNO; 
            testItem_dto.TestStandardID = _testItem.TestStandardID;
            testItem_dto.TestGradeID = _testItem.TestGradeID;
            testItem_dto.BenchID = _testItem.BenchID;
 
            testItem_dto.ItemID = _testItem.ItemID;
            testItem_dto.ItemCode = _testItem.ItemCode;
            testItem_dto.ItemName = _testItem.ItemName;
            testItem_dto.ItemUseStatus = _testItem.ItemUseStatus.ToString();
            testItem_dto.ItemCreateUserName = (from x in _allLoginUser where x.ID == _testItem.ItemCreateUserID select x.RealName).FirstOrDefault();
            testItem_dto.ItemCreateTime = _testItem.ItemCreateTime;
            testItem_dto.LastTestUserName = (from x in _allLoginUser where x.ID == _testItem.LastTestUserID select x.RealName).FirstOrDefault();
 
 
 
            if (!string.IsNullOrEmpty(_testItem.ItemTestResult))
            {
                Model.FeatTestResult result = new Model.FeatTestResult(_testItem.ItemTestResult);
                testItem_dto.ProjectJudgeParas = new Dictionary<string, double>();
                testItem_dto.ProjectJudgeParas["Qt"] = result.Flow;
                testItem_dto.ProjectJudgeParas["Ht"] = result.Head;
                testItem_dto.ProjectJudgeParas["Et"] = result.Eta;
            }
 
 
            testItem_dto.ItemParas = new OpenDto.TestProjectItemParas();
 
            if (_testItem.ProjectParas != null)
            {
                testItem_dto.ItemParas.Elevation = _testItem.ProjectParas.Elevation;
                testItem_dto.ItemParas.AtmosphericPressure = _testItem.ProjectParas.AtmosphericPressure;
                testItem_dto.ItemParas.IsTemperatureTrn = _testItem.ProjectParas.IsTemperatureTrn;
                testItem_dto.ItemParas.JzWenDu = _testItem.ProjectParas.JzWenDu;
                testItem_dto.ItemParas.InspectionNumber = _testItem.ProjectParas.InspectionNumber;
                testItem_dto.ItemParas.TestNature = _testItem.ProjectParas.TestNature.ToString();
                testItem_dto.ItemParas.SpeedSimuMethod = _testItem.ProjectParas.SpeedSimuMethod == null ? "" :
                    _testItem.ProjectParas.SpeedSimuMethod.ToString();
            }
 
            //testItem_dto.AlarmSetting = _testItem.AlarmSetting;
 
            if(_testItem.TestStartTime == null)
            {
                _testItem.TestStartTime = (from x in _allRecords select x.Time).FirstOrDefault(); 
            }
            if (_testItem.TestEndTime == null)
            {
                _testItem.TestEndTime = (from x in _allRecords select x.Time).LastOrDefault();
            }
            testItem_dto.TestStartTime = _testItem.TestStartTime;
            testItem_dto.TestEndTime = _testItem.TestEndTime;
            testItem_dto.ItemLogContent = _testItem.ItemLogContent;
            testItem_dto.ItemJudgeResult = _testItem.ItemJudgeResult.ToString();
            if (_testItem.ItemParas != null)
            {
                testItem_dto.ItemParas.NpshJudgeThreshold = _testItem.ItemParas.NpshJudgeThreshold;
                testItem_dto.ItemParas.IsEntendZeroH = _testItem.ItemParas.IsEntendZeroH;
                testItem_dto.ItemParas.FlowInZeroH = _testItem.ItemParas.FlowInZeroH;
            }
 
            testItem_dto.CoordinateParas = _testItem.CoordinateParas;
            //testItem_dto.PointNumber = _testItem.PointNumber;
            //testItem_dto.AutoTestInfo = _testItem.AutoTestInfo;
            //testItem_dto.DurabilityTestInfo = _testItem.DurabilityTestInfo;
            if (_testItem.InstrumentInfo != null)
            {
                testItem_dto.ItemParas.OutletPressureMeterID = _testItem.InstrumentInfo.OutletPressureMeterID;
                testItem_dto.ItemParas.OutletPressureMeterElevation = _testItem.InstrumentInfo.OutletPressureMeterElevation;
                testItem_dto.ItemParas.OutletPressureMeterPipeDia = _testItem.InstrumentInfo.OutletPressureMeterPipeDia;
                testItem_dto.ItemParas.InletPressureMeterID = _testItem.InstrumentInfo.OutletPressureMeterID;
                testItem_dto.ItemParas.InletPressureMeterElevation = _testItem.InstrumentInfo.InletPressureMeterElevation;
                testItem_dto.ItemParas.InletPressureMeterPipeDia = _testItem.InstrumentInfo.InletPressureMeterPipeDia;
                testItem_dto.ItemParas.FlowMeterRangeMin = _testItem.InstrumentInfo.FlowMeterRangeMin;
                testItem_dto.ItemParas.FlowMeterRangeMax = _testItem.InstrumentInfo.FlowMeterRangeMax;
            }
 
            if (_testItem.ElectricInfo != null)
            {
                testItem_dto.ItemParas.Ct = _testItem.ElectricInfo.Ct;
                testItem_dto.ItemParas.Pt = _testItem.ElectricInfo.Pt;
            }
 
            testItem_dto.ItemTestResult = _testItem.ItemTestResult;
            testItem_dto.ItemTestTarget = _testItem.ItemTestTarget;
 
 
            
 
 
 
            if (_allRecords != null && _allRecords.Count > 0)
            {
                testItem_dto.PointNumber = _allRecords.Count();
 
                testItem_dto.Records = new List<OpenDto.PumpFeatTestRecord>();
 
                foreach (var record in _allRecords)
                {
                    var record_dt0 = new OpenDto.PumpFeatTestRecord();
                    record_dt0.ID = record.ID;
                    record_dt0.Time   = record.Time;
                    record_dt0.CorrectPtQ = record.CorrectPtQ;
                    record_dt0.CorrectPtH = record.CorrectPtH;
                    record_dt0.CorrectPtE = record.CorrectPtE;
                    record_dt0.CorrectPtP = record.CorrectPtP;
 
                    record_dt0.TestPtQ = record.TestPtQ;
                    record_dt0.TestPtH = record.TestPtH;
                    record_dt0.TestPtE = record.CorrectPtE;
                    record_dt0.TestPtP = record.TestPtP;
 
                    record_dt0.Speed = record.Speed;
 
 
                    var vvvMonitorRecordList = new Model.MonitorRecord4DsList(record.MonitorRecords);
 
                    record_dt0.Records = new List<TProduct.OpenDto.MonitorPointValue>();
                    foreach (var mp in _allMonitorPointList)
                    {
                        var mp_dto = new TProduct.OpenDto.MonitorPointValue();
 
                        mp_dto.ID = mp.ID;
                        mp_dto.IStationID = mp.IStationID;
                        mp_dto.Code = mp.Code;
                        mp_dto.Name = mp.Name;
                        mp_dto.MonitorType = (OpenDto.eMonitorType)(int)mp.MonitorType;
                        mp_dto.Property = mp.Property;
                        mp_dto.PipeDia = mp.PipeDia;
                        mp_dto.Elevation = mp.Elevation;
                        mp_dto.SortCode = mp.SortCode;
                        if (mp.ValueCoeffParas != null)
                        {
                            mp_dto.ValueCoeffParas = new OpenDto.ValueCoeffParas();
 
                            mp_dto.ValueCoeffParas.Method = mp.ValueCoeffParas.Method;
                            mp_dto.ValueCoeffParas.Multiply1 = mp.ValueCoeffParas.Multiply1;
                            mp_dto.ValueCoeffParas.Add1 = mp.ValueCoeffParas.Add1;
 
                            mp_dto.ValueCoeffParas.InterpolationType = mp.ValueCoeffParas.InterpolationType;
                            mp_dto.ValueCoeffParas.RealValues = mp.ValueCoeffParas.RealValues;
 
                            mp_dto.ValueCoeffParas.Multiplys = mp.ValueCoeffParas.Multiplys;
 
                            mp_dto.ValueCoeffParas.Adds = mp.ValueCoeffParas.Adds;
                        }
 
                        mp_dto.SumCalcCoeff = mp.SumCalcCoeff;
                        //mp_dto.AnalogParas = mp.AnalogParas;
                        //mp_dto.DigitalParas = mp.DigitalParas;
 
                        var va = vvvMonitorRecordList.Find(x => x.ID == mp.ID);
                        if (va != null)
                        {
                            mp_dto.Value = va.Value;
                        }
 
                        record_dt0.Records.Add(mp_dto);
                    }
 
                    testItem_dto.Records.Add(record_dt0);
                }
            }
 
 
 
            packInfo.TestItem = testItem_dto;
 
 
            #endregion
 
 
 
            var ret = Request(packInfo, url_type,url);
            if(ret.Data != null)
            error_info = ret.Data.ErrorCode;
 
            return ret;
        }
 
 
        //请求
        private static TProduct.OpenDto.IStationSynResult Request(FeatTestPackInfoV1 packInfo,string type, string url)
        { 
            string jsonStringContent = TProduct.JsonHelper.Object2Json(packInfo);
 
 
            var request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = "POST";
            request.ContentType = "application/json";
 
            //Version version = null;
            //if (version != null)
            //{ //默认是HttpVersion.Version11
            //    request.ProtocolVersion = version;
            //}
 
 
            //Dictionary<string, string> headers = null;
            //if (headers != null && headers.Count > 0)
            //{
            //    foreach (var header in headers)
            //    {
            //        request.Headers.Add(header.Key, header.Value);
            //    }
            //}
 
 
 
 
            using (var streamWriter = new StreamWriter(request.GetRequestStream()))
            {
                streamWriter.Write(jsonStringContent);
                streamWriter.Flush();
            }
 
 
            string responseText;
            using (var response = (HttpWebResponse)request.GetResponse())
            using (var reader = new StreamReader(response.GetResponseStream()))
            {
                responseText = reader.ReadToEnd();
            }
            return TProduct.JsonHelper.Json2Object<TProduct.OpenDto.IStationSynResult>(responseText);
 
        }
 
 
 
 
    }
}