高章伟
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
public with sharing class intProCommonMethodController {
    public intProCommonMethodController() {
        
    }
    public static Product2 buildPro(){
        Product2 pro = new Product2(
            Name = 'proName',
            // ProductCode='pro001',
            Asset_Model_No__c = 'pro001',
            SFDA_Status__c = '有効',
            Dealer_special_Object__c = true,
            Packing_list_manual__c = 1,
            Family='GI',
            Fixture_Model_No__c='n01',
            Serial_Lot_No__c='S/N tracing',
            Fixture_Model_No_T__c = 'n01',
            ProductCode_Ext__c='pc01',
            Manual_Entry__c=false
            );
        insert pro;
        System.debug('-----pro插入成功-----');
        return pro;
        
    }
    public static Asset buildAssetConsume(String assName, String accId, String hpAccId, String departAccId, String statu){
        Product2 pro1 = buildPro();
        System.debug('-----pro插入成功11-----');
        Asset Ast = new Asset(
            Name = assName,
            Product2Id = pro1.Id,
            Hospital__c = hpAccId,
            Department_Class__c = departAccId,
            AccountId = accId, 
            Status = statu,
            Asset_Owner__c = '病院資産',
            IsCompetitorProduct = True,
            AssetMark__c = '耗材',
            RecordTypeId = System.Label.Asset_RecordType,
            SerialNumber = 'asset1',
            Quantity = 1,
            Manage_type__c = '个体管理',
            Loaner_accsessary__c = false,
            Out_of_wh__c = 0,
            Salesdepartment__c = '1.华北营业本部',
            Internal_asset_location__c = '北京 备品中心',
            Product_category__c = 'GI',
            Equipment_Type__c = '产品试用',
            SalesProvince__c = '大连',
            CompanyOfEquipment__c = '北京',
            Internal_Asset_number__c = '0001',
            Rental_Count__c = 0,
            Asset_loaner_category__c = '固定资产',
            Consumable_Guaranteen_end__c = System.Today() + 1,
            WH_location__c = '货架号1'
            );
        insert Ast;
        System.debug('-----Ass插入成功-----');
        return Ast;
    }
    public static Asset buildAssetHost(String assName, String accId, String hpAccId, String departAccId, String statu){
        Product2 pro1 = buildPro();
        System.debug('-----pro插入成功11-----');
        Asset Ast = new Asset(
            Name = assName,
            Product2Id = pro1.Id,
            Hospital__c = hpAccId,
            Department_Class__c = departAccId,
            AccountId = accId,
            Status = statu,
            Asset_Owner__c = '病院資産',
            IsCompetitorProduct = True,
            AssetMark__c = '主机',
            RecordTypeId = System.Label.Asset_RecordType,
            SerialNumber = 'asset1',
            Quantity = 1,
            Manage_type__c = '个体管理',
            Loaner_accsessary__c = false,
            Out_of_wh__c = 0,
            Salesdepartment__c = '1.华北营业本部',
            Internal_asset_location__c = '北京 备品中心',
            Product_category__c = 'GI',
            Equipment_Type__c = '产品试用',
            SalesProvince__c = '大连',
            CompanyOfEquipment__c = '北京',
            Internal_Asset_number__c = '0001',
            Rental_Count__c = 0,
            Asset_loaner_category__c = '固定资产',
            Consumable_Guaranteen_end__c = System.Today() + 1,
            WH_location__c = '货架号1'
            );
        insert Ast;
        System.debug('-----Ass插入成功-----');
        return Ast;
    }
}