高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
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
@isTest
private class NFM301RestTest {
    static testMethod void resend_test() {
 
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectCo.size() == 0) {
            return;
        }
        List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科'];
        if (rectSct.size() == 0) {
            return;
        }
        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科'];
        if (rectDpt.size() == 0) {
            return;
        }
 
        Account company = new Account();
        company.RecordTypeId = rectCo[0].Id;
        company.AgentCode_Ext__c = '9999999';
        company.Name         = 'NFM301TestCompany';
        upsert company;
        Account section = new Account();
        section.RecordTypeId = rectSct[0].Id;
        section.Name         = '*';
        section.AgentCode_Ext__c = '9999964';
        section.Department_Class_Label__c = '消化科';
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
        depart.AgentCode_Ext__c = '7271439';
        depart.Department_Name__c  = 'NFM301TestDepart';
        depart.ParentId            = section.Id;
        depart.Department_Class__c = section.Id;
        depart.Hospital__c         = company.Id;
        upsert depart;
        // 再取得
        List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id};
        List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id In :accountIds order by Management_Code_Auto__c];
 
        Product2 prd = new Product2();
        prd.ProductCode_Ext__c     = 'NFM301Prd1';
        prd.ProductCode            = 'K10021616';
        prd.Name                   = 'NFM301Prd1';
        prd.Manual_Entry__c        = false;
        insert prd;
 
        Asset ast = new Asset();
        ast.Name = 'NFM301Ast1';
        ast.Product2Id = prd.Id;
        ast.SerialNumber = '21858736';
        ast.Product_Serial_No__c = 'K10021616:21858736';
        ast.Hospital__c = accList[0].Id;
        ast.Department_Class__c = accList[1].Id;
        ast.AccountId = accList[2].Id;
        insert ast;
 
        TracingCode__c tracCode = new TracingCode__c();
        tracCode.trscingcode__c = 1;
        tracCode.name__c = '第三方收货';
        tracCode.Name = 'TracingCode';
        insert tracCode;
 
        User loginUser = [Select Id, Alias, Province__c from User where Id =: UserInfo.getUserId()];
        loginUser.Batch_User__c = true;
        update loginUser;
 
 
        NFM301Rest.GeneralData GeneralData = new NFM301Rest.GeneralData();
        NFM301Rest.ProductsDelivery ProductsDelivery = new NFM301Rest.ProductsDelivery();
        ProductsDelivery.Monitoring = new NFMUtil.Monitoring();
        ProductsDelivery.GeneralData  = new NFM301Rest.GeneralData[]{ 
            GeneralData };
        NFM301Rest.DnInformation DnInformation = new NFM301Rest.DnInformation();
        GeneralData.DnInformation = new NFM301Rest.DnInformation[]{ 
            DnInformation };
        GeneralData.SendTo = '番禺C-TEC';
        GeneralData.SalesOrderNumber = '1000067367';
        GeneralData.Purpose = '培训中心-C-TEC';
        GeneralData.ProcessType = '1';
        GeneralData.OtherGeneral3 = '';
        GeneralData.OtherGeneral2 = '';
        GeneralData.OtherGeneral1 = '';
        GeneralData.OrderNumber = 'GZDE-SP-18016';
        GeneralData.DeliveryDate = '20181018';
        GeneralData.ContactPerson = '张洋';
        GeneralData.CompanyCode = '5113';
        GeneralData.Comment = '培训需求,4K备品采购';
        GeneralData.Category = '固定资产';
        GeneralData.ApprovalNumber = 'ME151P07-0267';
 
        DnInformation.ValidTo = '';
        DnInformation.TracingCode = 'EXSEN';
        DnInformation.SorLMark = 'S';
        DnInformation.SerialNumber = '21858736';
        DnInformation.ProductCode = 'K10021616';
        DnInformation.NMPA_ValidTo = '20201101';
        DnInformation.NMPA_ValidFrom = '20151102';
        DnInformation.NMPA_ValidDate = '不适用';
        DnInformation.LocationName = '广州番禺';
        DnInformation.LocationCD = '3013';
        DnInformation.InchargeProvinceCD = '190';
        DnInformation.InchargeProvince = '广州';
        DnInformation.CostCenterMemo = 'CTEC教育本部-培训中心备品 GZ';
        DnInformation.CostCenterCD = '5133010501';
        DnInformation.Barcode = '011501977800377111180800105401372121858736250EXSEN';
        DnInformation.AssetNumber = '18207244';
        DnInformation.AssetDay = '20181019';
 
        BatchIF_Log__c rowData = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData.Log__c) == false) {
            NFM301Rest.executefuture(rowData.Id);
        }
 
        GeneralData.ProcessType = '2';
        
        BatchIF_Log__c rowData1 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData1.Log__c) == false) {
            NFM301Rest.executefuture(rowData1.Id);
        }
 
        GeneralData.ProcessType = '0';
        
        BatchIF_Log__c rowData2 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData2.Log__c) == false) {
            NFM301Rest.executefuture(rowData2.Id);
        }
 
        GeneralData.ProcessType = '1';
        GeneralData.CompanyCode = '';
        BatchIF_Log__c rowData3 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData3.Log__c) == false) {
            NFM301Rest.executefuture(rowData3.Id);
        }
 
        GeneralData.CompanyCode = '5113';
        GeneralData.SalesOrderNumber = '';
        BatchIF_Log__c rowData4 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData4.Log__c) == false) {
            NFM301Rest.executefuture(rowData4.Id);
        }
 
        GeneralData.SalesOrderNumber = '1000067367';
        GeneralData.DeliveryDate = '';
        BatchIF_Log__c rowData5 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData5.Log__c) == false) {
            NFM301Rest.executefuture(rowData5.Id);
        }
 
        GeneralData.DeliveryDate = '20181018';
        DnInformation.SerialNumber = '';
        BatchIF_Log__c rowData6 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData6.Log__c) == false) {
            NFM301Rest.executefuture(rowData6.Id);
        }
 
        DnInformation.SerialNumber = '21858736';
        DnInformation.ProductCode = '';
        BatchIF_Log__c rowData7 = NFMUtil.saveRowData(ProductsDelivery.Monitoring, 'NFM301', ProductsDelivery.GeneralData);
        if (String.isBlank(rowData7.Log__c) == false) {
            NFM301Rest.executefuture(rowData7.Id);
        }
    }
 
    @isTest static void test_method_execute1() {
 
        Test.startTest();
        
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectCo.size() == 0) {
            return;
        }
        List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科'];
        if (rectSct.size() == 0) {
            return;
        }
        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科'];
        if (rectDpt.size() == 0) {
            return;
        }
 
        Account company = new Account();
        company.RecordTypeId = rectCo[0].Id;
        company.AgentCode_Ext__c = '9999999';
        company.Name         = 'NFM301TestCompany';
        upsert company;
        Account section = new Account();
        section.RecordTypeId = rectSct[0].Id;
        section.Name         = '*';
        section.AgentCode_Ext__c = '9999964';
        section.Department_Class_Label__c = '消化科';
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
        depart.AgentCode_Ext__c = '7271439';
        depart.Department_Name__c  = 'NFM301TestDepart';
        depart.ParentId            = section.Id;
        depart.Department_Class__c = section.Id;
        depart.Hospital__c         = company.Id;
        upsert depart;
 
        TracingCode__c tracCode = new TracingCode__c();
        tracCode.trscingcode__c = 1;
        tracCode.SerialNumber__c = 1;
        tracCode.name__c = '第三方收货';
        tracCode.Name = 'TracingCode';
        insert tracCode;
 
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
 
        // String JsonMsg = '{    "ProductsDelivery": {        "Monitoring": {},        "GeneralData": []    }}';
        String JsonMsg = '{"ProductsDelivery": {       "Monitoring": {},  "GeneralData": [{"SendTo": "OCM成都分公司","SalesOrderNumber": "1000067424","Purpose": "RC", "ProcessType": "1","OtherGeneral3": "","OtherGeneral2": "","OtherGeneral1": "","OrderNumber": "GZDE-SP-18018-1","DnInformation": [{"ValidTo": "","TracingCode": "EXSET","SorLMark": "S","SerialNumber": "21858514","ProductCode": "K10021616","NMPA_ValidTo": "20201101","NMPA_ValidFrom": "20151102","NMPA_ValidDate": "不适用","LocationName": "成都","NMPA_NO": "新增","Provider": "新增Provider","LocationCD": "3010","InchargeProvinceCD": "190", "InchargeProvince": "广州","CostCenterMemo": "南方技术服务部","CostCenterCD": "5133990803","Barcode": "011501977800377111180700105378842121858514250EXSET","AssetNumber": "19200484","AssetDay": "20181019"}],"DeliveryDate": "20181018","ContactPerson": "章锐","CompanyCode": "5113","Comment": "服务部4K备品导入","Category": "固定资产","ApprovalNumber": "ME151P07-0113"}]}}';
        req.requestURI = 'services/apexrest/NFM301/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
 
        NFM301Rest.execute();
 
        // JsonMsg = '{"ProductsDelivery": {       "Monitoring": {},  "GeneralData": [{"SendTo": "OCM成都分公司","SalesOrderNumber": "1000067424","Purpose": "RC", "ProcessType": "1","OtherGeneral3": "","OtherGeneral2": "","OtherGeneral1": "","OrderNumber": "GZDE-SP-18018-1","DnInformation": [{"ValidTo": "","TracingCode": "EXSET","SorLMark": "S","SerialNumber": "","ProductCode": "K10021616","NMPA_ValidTo": "","NMPA_ValidFrom": "","NMPA_ValidDate": "","LocationName": "成都","NMPA_NO": "新增","Provider": "新增Provider","LocationCD": "3010","InchargeProvinceCD": "190", "InchargeProvince": "广州","CostCenterMemo": "南方技术服务部","CostCenterCD": "5133990803","Barcode": "011501977800377111180700105378842121858514250EXSET","AssetNumber": "19200484","AssetDay": "20181019"}],"DeliveryDate": "20181018","ContactPerson": "章锐","CompanyCode": "5113","Comment": "服务部4K备品导入","Category": "固定资产","ApprovalNumber": "ME151P07-0113"}]}}';
        // req.requestBody = Blob.valueof(JsonMsg);
        // NFM301Rest.execute();
 
        Test.stopTest();
    }
 
    @isTest static void test_method_execute2() {
 
        Test.startTest();
        
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectCo.size() == 0) {
            return;
        }
        List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科'];
        if (rectSct.size() == 0) {
            return;
        }
        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科'];
        if (rectDpt.size() == 0) {
            return;
        }
 
        Account company = new Account();
        company.RecordTypeId = rectCo[0].Id;
        company.AgentCode_Ext__c = '9999999';
        company.Name         = 'NFM301TestCompany';
        upsert company;
        Account section = new Account();
        section.RecordTypeId = rectSct[0].Id;
        section.Name         = '*';
        section.AgentCode_Ext__c = '9999964';
        section.Department_Class_Label__c = '消化科';
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
        depart.AgentCode_Ext__c = '7271439';
        depart.Department_Name__c  = 'NFM301TestDepart';
        depart.ParentId            = section.Id;
        depart.Department_Class__c = section.Id;
        depart.Hospital__c         = company.Id;
        upsert depart;
 
        TracingCode__c tracCode = new TracingCode__c();
        tracCode.trscingcode__c = 1;
        tracCode.SerialNumber__c = 1;
        tracCode.name__c = '第三方收货';
        tracCode.Name = 'TracingCode';
        insert tracCode;
 
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
 
        // String JsonMsg = '{  "ProductsDelivery": {       "Monitoring": {},       "GeneralData": []   }}';
        String  JsonMsg = '{"ProductsDelivery": {       "Monitoring": {},  "GeneralData": [{"SendTo": "OCM成都分公司","SalesOrderNumber": "1000067424","Purpose": "RC", "ProcessType": "1","OtherGeneral3": "","OtherGeneral2": "","OtherGeneral1": "","OrderNumber": "GZDE-SP-18018-1","DnInformation": [{"ValidTo": "","TracingCode": "EXSET","SorLMark": "S","SerialNumber": "","ProductCode": "K10021616","NMPA_ValidTo": "20201101","NMPA_ValidFrom": "20151102","NMPA_ValidDate": "不适用","LocationName": "成都","NMPA_NO": "新增","Provider": "新增Provider","LocationCD": "3010","InchargeProvinceCD": "190", "InchargeProvince": "广州","CostCenterMemo": "南方技术服务部","CostCenterCD": "5133990803","Barcode": "011501977800377111180700105378842121858514250EXSET","AssetNumber": "19200484","AssetDay": "20181019"}],"DeliveryDate": "20181018","ContactPerson": "章锐","CompanyCode": "5113","Comment": "服务部4K备品导入","Category": "固定资产","ApprovalNumber": "ME151P07-0113"}]}}';
        req.requestURI = 'services/apexrest/NFM301/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
 
        NFM301Rest.execute();
        Test.stopTest();
    }
 
    @isTest static void test_method_execute3() {
 
        Test.startTest();
        
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectCo.size() == 0) {
            return;
        }
        List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科'];
        if (rectSct.size() == 0) {
            return;
        }
        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科'];
        if (rectDpt.size() == 0) {
            return;
        }
 
        Account company = new Account();
        company.RecordTypeId = rectCo[0].Id;
        company.AgentCode_Ext__c = '9999999';
        company.Name         = 'NFM301TestCompany';
        upsert company;
        Account section = new Account();
        section.RecordTypeId = rectSct[0].Id;
        section.Name         = '*';
        section.AgentCode_Ext__c = '9999964';
        section.Department_Class_Label__c = '消化科';
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
        depart.AgentCode_Ext__c = '7271439';
        depart.Department_Name__c  = 'NFM301TestDepart';
        depart.ParentId            = section.Id;
        depart.Department_Class__c = section.Id;
        depart.Hospital__c         = company.Id;
        upsert depart;
 
        TracingCode__c tracCode = new TracingCode__c();
        tracCode.trscingcode__c = 1;
        tracCode.SerialNumber__c = 1;
        tracCode.name__c = '第三方收货';
        tracCode.Name = 'TracingCode';
        insert tracCode;
 
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
 
        // String JsonMsg = '{  "ProductsDelivery": {       "Monitoring": {},       "GeneralData": []   }}';
        String  JsonMsg = '{"ProductsDelivery": {       "Monitoring": {},  "GeneralData": [{"SendTo": "OCM成都分公司","SalesOrderNumber": "1000067424","Purpose": "RC", "ProcessType": "1","OtherGeneral3": "","OtherGeneral2": "","OtherGeneral1": "","OrderNumber": "GZDE-SP-18018-1","DnInformation": [{"ValidTo": "","TracingCode": "","SorLMark": "S","SerialNumber": "","ProductCode": "K10021616","NMPA_ValidTo": "20201101","NMPA_ValidFrom": "20151102","NMPA_ValidDate": "不适用","LocationName": "成都","NMPA_NO": "新增","Provider": "新增Provider","LocationCD": "3010","InchargeProvinceCD": "190", "InchargeProvince": "广州","CostCenterMemo": "南方技术服务部","CostCenterCD": "5133990803","Barcode": "011501977800377111180700105378842121858514250EXSET","AssetNumber": "19200484","AssetDay": "20181019"}],"DeliveryDate": "20181018","ContactPerson": "章锐","CompanyCode": "5113","Comment": "服务部4K备品导入","Category": "固定资产","ApprovalNumber": "ME151P07-0113"}]}}';
        req.requestURI = 'services/apexrest/NFM301/execute';
        req.httpMethod = 'POST';
        req.requestBody = Blob.valueof(JsonMsg);
        RestContext.request = req;
        RestContext.response= res;
 
        NFM301Rest.execute();
        Test.stopTest();
    }
    /*
    @isTest static void test_method_SendEmail() {
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
        if (rectCo.size() == 0) {
            return;
        }
        List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科'];
        if (rectSct.size() == 0) {
            return;
        }
        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科'];
        if (rectDpt.size() == 0) {
            return;
        }
 
        Account company = new Account();
        company.RecordTypeId = rectCo[0].Id;
        company.AgentCode_Ext__c = '9999999';
        company.Name         = 'NFM301TestCompany';
        upsert company;
        Account section = new Account();
        section.RecordTypeId = rectSct[0].Id;
        section.Name         = '*';
        section.AgentCode_Ext__c = '9999964';
        section.Department_Class_Label__c = '消化科';
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
        depart.AgentCode_Ext__c = '7271439';
        depart.Department_Name__c  = 'NFM301TestDepart';
        depart.ParentId            = section.Id;
        depart.Department_Class__c = section.Id;
        depart.Hospital__c         = company.Id;
        upsert depart;
        // 再取得
        List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id};
        List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id In :accountIds order by Management_Code_Auto__c];
 
        Product2 prd = new Product2();
        prd.ProductCode_Ext__c     = 'NFM301Prd1';
        prd.ProductCode            = 'K10021616';
        prd.Name                   = 'NFM301Prd1';
        prd.Manual_Entry__c        = false;
        insert prd;
 
        Asset ast = new Asset();
        ast.Name = 'NFM301Ast1';
        ast.Product2Id = prd.Id;
        ast.SerialNumber = '21858736';
        ast.Product_Serial_No__c = 'K10021616:21858736';
        ast.Hospital__c = accList[0].Id;
        ast.Department_Class__c = accList[1].Id;
        ast.AccountId = accList[2].Id;
        insert ast;
 
        ReceivingNote__c rectivingNote = new ReceivingNote__c();
        rectivingNote.DateOfDelivery__c = Date.today();
        rectivingNote.Sales_order_number__c = '20191212';
        rectivingNote.Managment_Code__c = '20191212';
        insert rectivingNote;
        ReceivingNoteSummary__c rectivingNoteSum = new ReceivingNoteSummary__c();
        rectivingNoteSum.Product_Serial_No__c = '20191212';
        rectivingNoteSum.ReceivingNote__c = rectivingNote.Id;
        insert rectivingNoteSum;
        ReceivingNoteDetail__c rectivingNoteDet = new ReceivingNoteDetail__c();
        rectivingNoteDet.Product_Serial_No__c = '20191212';
        rectivingNoteDet.ReceivingNoteSummary__c = rectivingNoteSum.Id;
        insert rectivingNoteDet;
 
        List<String> rectivingNoteId = new List<String>();
        rectivingNoteId.add(rectivingNote.Id);
        List<String> rectivingNoteSumId = new List<String>();
        rectivingNoteSumId.add(rectivingNoteSum.Id);
        List<String> rectivingNoteDetId = new List<String>();
        rectivingNoteDetId.add(rectivingNoteDet.Id);
        List<String> assetYId = new List<String>();
        assetYId.add(ast.Id);
        List<String> assetNId = new List<String>();
        assetNId.add(ast.Id);
        NFM301SendEmail.sendEmailOnNFM301(rectivingNoteId, rectivingNoteSumId, rectivingNoteDetId, assetYId, assetNId);
 
    }*/
}