高章伟
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
public with sharing class ISO_DemandOAD_PDFController {
    //公共变量:list
    public List<IS_Opportunity_Demand_Operating__c> pageQueryoDoList{get;set;}
    public List<IS_Opportunity_Demand_Demonstration__c> pageQueryoDDList{get;set;}
    //公共变量:对象数据
    public IS_Opportunity_Demand_Operating__c pageShwoElement{get;set;}
    public String ISodcIdStr {get;set;}
    public String OpporIdStr {get;set;}
    public String fileName {get;set;} 
    public IS_Opportunity_Demand__c ISOhead {get;set;}
    public ISOpportunityDemandInfo pageShowSet{get;set;}
    public ISOpportunityDemandInfo pageShowSetClone{get;set;}
    public List<IS_Opportunity_Demand__c> ISOheadList{get;set;}
    //页面用公共变量
    public String NowDate{get;set;}
    public integer PageSum{get;set;}
    public ISO_DemandOAD_PDFController() {
        ISodcIdStr = ApexPages.currentPage().getParameters().get('id');
        OpporIdStr = ApexPages.currentPage().getParameters().get('OppoerID');
        fileName = ApexPages.currentPage().getParameters().get('fileName');
        ApexPages.currentPage().getHeaders().put('content-disposition','inline;filename='+fileName+'.pdf');
        pageQueryoDoList = new List<IS_Opportunity_Demand_Operating__c>();
        pageQueryoDDList = new List<IS_Opportunity_Demand_Demonstration__c>();
        pageShwoElement = new IS_Opportunity_Demand_Operating__c();
        pageShowSetClone = new ISOpportunityDemandInfo();
        pageShowSet = new ISOpportunityDemandInfo();
        ISOheadList = new List<IS_Opportunity_Demand__c>();
 
    }
    public void init(){ 
        NowDate = System.now().format('yyyy-MM-dd');
        ISOhead = new IS_Opportunity_Demand__c();
        if(ISodcIdStr!=''&&ISodcIdStr!=null){
            pageQueryoDDList = [ SELECT 
                                    Id,
                                    IsDeleted,
                                    Name,
                                    Microphone_Exsit_TF__c,
                                    IS_Opportunity_Demand__c,
                                    Demand_Demonstration_Area_Sum__c,
                                    Display_Separate_TF__c,
                                    Mobile_Equip_Controller_TF__c,
                                    Display_Equipment_List__c,
                                    HD_Camera_Panorama_TF__c,
                                    Microphone_Type_List__c,
                                    Position_To_Operating_Room_List__c,
                                    Share_With_Other_Firm_TF__c,
                                    Other_Require_Text__c,
                                    Microphone_Number__c,
                                    Brand_Name__c 
                                FROM 
                                    IS_Opportunity_Demand_Demonstration__c
                                where
                                    IS_Opportunity_Demand__c =:ISodcIdStr
                                ];
            ISOheadList = [SELECT 
                                    Id,
                                    OwnerId,
                                    IsDeleted,
                                    Name,
                                    Phone_Of_Nuers__c,
                                    Phone_Of_HDOA__c,
                                    Phone_of_ImfD__c,
                                    Phone_of_GAD__c,
                                    Phone_of_EDC__c,
                                    Phone_of_CCD__c,
                                    Lead_Of_Nurses__c,
                                    Opportunity_ID__r.Opportunity_No__c,
                                    Opportunity_ID__r.State__c,
                                    Opportunity_ID__r.old_Oppo_No__c,
                                    Lead_Of_Department_Of_Anesthesia__c,
                                    Lead_Of_Information_Department__c,
                                    Lead_of_General_Affairs_Department__c,
                                    Lead_of_Equipment_Department__c,
                                    Lead_of_Capital_Construction_Department__c,
                                    Table_Create_Date__c,
                                    Public_Hospital_TF__c,
                                    Private_Hospital_TF__c,
                                    Other_Hospital_TF__c,
                                    Operating_Room_Sum__c,
                                    Demand_Demonstration_Cnt__c,
                                    OperatingCnt__c,
                                    Demonstration_Area_Sum__c,
                                    Preparation_Stage_TF__c,
                                    Building_Phase_Stage_TF__c,
                                    Purification_Construction_Stage_TF__c,
                                    Other_Stage_Text__c,
                                    Operating_Room_Plane_Graph_TF__c,
                                    Head_Mast_Position_Graph_TF__c,
                                    Operating_Room_Clear_Graph_TF__c,
                                    Demonstration_Area_Plane_Graph_TF__c,
                                    Buliding_Plane_Graph_TF__c,
                                    Other_Enginee_List_Text__c,
                                    Func_SOD_Status__c
                            FROM 
                                    IS_Opportunity_Demand__c
                            where
                                    Id  =:  ISodcIdStr
            ];
            if(ISOheadList.size()==1){
                ISOhead = ISOheadList[0];
                ISOhead.Operating_Room_Sum__c = ISOhead.OperatingCnt__c;
                ISOhead.Demonstration_Area_Sum__c = ISOhead.Demand_Demonstration_Cnt__c;
            }else{
                ISOhead = new IS_Opportunity_Demand__c(Operating_Room_Sum__c = 1,Demonstration_Area_Sum__c = 1);
            }
            pageQueryoDoList = [SELECT Id,
                                    Name,
                                    IS_Opportunity_Demand__c,
                                    Operating_Room_Num_or_Name__c,
                                    Operating_Room_Position_Area__c,
                                    Operating_Room_Position_Building__c,
                                    Operating_Room_Position_Stage__c,
                                    Operating_Room_Length__c,
                                    Operating_Room_Width__c,
                                    Operating_Room_Build_Heigth__c,
                                    Operating_Room_Top_heigth__c,
                                    isChirurgery_TF__c,
                                    isGynaecology_TF__c,
                                    isUrological_TF__c,
                                    isOrthopedics_TF__c,
                                    isENT_TF__c,
                                    isPlanned_TF__c,
                                    isAural_Sursery_TF__c,
                                    isGastroenterology_TF__c,
                                    isRespirationDept_TF__c,
                                    isInvasive_Technology_TF__c,
                                    Wall_Mounting_Type_TF__c,
                                    Dept_Others_Text__c,
                                    Centre_Air_Support_System_TF__c,
                                    Purify_Operating_Room_TF__c,
                                    Lamp_Panel_Type_List__c,
                                    Lamp_Panel_Sum__c,
                                    Planning_Blue_Room_TF__c,
                                    Need_to_Transform_TF__c,
                                    Centralized_Control_TF__c,
                                    Reform_Lamp_Plane_List__c,
                                    Reform_Lamp_Plane_Sum__c,
                                    Equipment_Centralized_Control_TF__c,
                                    OTV_S190_TF__c,
                                    OTV_S7_Pro_TF__c,
                                    T3D_System_TF__c,
                                    CV_180_TF__c,
                                    CV_190_TF__c,
                                    Olympus_Endoscope_Other_Text__c,
                                    UHI_4_TF__c,
                                    UHI_3_TF__c,
                                    Storz_Main__c,
                                    Storz_Main_Model__c,
                                    Stryker_Main__c,
                                    Stryker_Main_Model__c,
                                    Compatible_Signal_TF__c,
                                    Compatible_Signal_Format_Text__c,
                                    Compatible_Signal_Sum__c,
                                    Party_a_Purchase_TF__c,
                                    Olympus_Package_Purchase_TF__c,
                                    Party_A_Hold_TF__c,
                                    Laparoscopy_Tower_TF__c,
                                    Anesthesia_Tower_TF__c,
                                    Surgical_Tower_TF__c,
                                    Display_Tower_Radiation_TF__c,
                                    Other_Tower_TF__c,
                                    Brand_of_Laparoscopy_Tower_List__c,
                                    Other_Brand_Laparoscopy_Text__c,
                                    Laparoscopy_Tower_Type_List__c,
                                    Laparoscopy_Tower_Model_Desciption_Text__c,
                                    Brand_Surgical_Tower_List__c,
                                    Surgical_Tower_Model_Or_Decription_Text__c,
                                    Brand_Of_Display_Tower_Radiation_List__c,
                                    Display_Tower_Model_Or_Description__c,
                                    Other_Tower_Brand__c,
                                    Other_Medic_Displayer__c,
                                    Performanc_60inch_Display__c ,
                                    Other_Tower_Brand_List__c,
                                    Other_Tower_Model_Description__c,
                                    Purchase_Plan_SpringArm_List__c,
                                    Brand_Of_SpringArm__c,
                                    Other_FullHD_Display__c ,
                                    SpringArm_AC2000_Sum__c,
                                    SpringArm_AC3000_Sum__c,
                                    SpringArm_Other_Name__c,
                                    Shadowless_Lamp_Procurement_Plan__c,
                                    Other_Main_And_Model_Text__c,
                                    Equipment_Centralized_Control_List__c,
                                    Brand_Of_Shadowless_Lamp_List__c,
                                    ShadowlessLamp_Model_Or_Description_Text__c,
                                    Shadowless_Lamp_Type_List__c,
                                    Brand_Of_Mid_Camera_List__c,
                                    Mid_Camera_Model_Or_Descirption_Text__c,
                                    Mid_Camera_Signal_Type_List__c,
                                    Side_Camera_Procurement_Plan__c,
                                    Brand_Of_Side_Camera__c,
                                    Side_Camera_Model_Or_Description_Text__c,
                                    Side_Camera_Signal_Type_List__c,
                                    Endoscopic_Other_Video_Src_ListM__c,
                                    OEV_262_2D_Sum__c,
                                    Other_2D_Sum__c,
                                    Other_2D_Name__c,
                                    Dept_Others_TF__c,
                                    Olympus_Endoscope_2_Model_List__c,
                                    Pneumoperitoneum_Other__c,
                                    Other_Main_And_Model_TF__c,
                                    Energy_Portable_ESG_400_TF__c,
                                    Energy_Portable_USG_400_TF__c,
                                    Energy_Portable_UES_40_TF__c,
                                    Energy_Portable_SSG_2_TF__c,
                                    Energy_Portable_Other_Text__c,
                                    Covidien_Brand_TF__c,
                                    Force_FX_C_Brand_TF__c,
                                    Force_Triad_Brand_TF__c,
                                    ERBE_Brand_TF__c,
                                    VIO300D_Brand_TF__c,
                                    Anesthesia_Tower_Text_Description__c,
                                    Brand_Of_Anesthesia_Tower_List__c,
                                    Operating_Room_Plan__c,
                                    Brand_Of_Operating_Bed_List__c,
                                    Operating_Bed_Model_Or_Description_Text__c,
                                    Operating_Equipment_Ctrl_TF__c,
                                    Other_Vs_Arm_Type_C_TF__c,
                                    Other_Vs_DSA_TF__c,
                                    Other_Vs_EUS_TF__c,
                                    Other_Vs_Type_B_ultrasonic_TF__c,
                                    Other_Vs_Other_Text__c,
                                    LMD_2451TC_Sum__c,
                                    LMD_3251TC_Sum__c,
                                    Other_3D_Displayer_Sum__c,
                                    Size60_3D_Displayer_Sum__c,
                                    Other_3D_Displayer__c,
                                    Sony_42_3D_Displayer_Pro_Sum__c,
                                    In_Cell_InstallType_TF__c,
                                    Display_60_Install_TF__c,
                                    IMF_IO_System__c,
                                    IMH_20_Model_TF__c,
                                    IMH_10_Model_TF__c,
                                    Install_Type_60Display_List__c,
                                    MultiTouch_Display_Equip_Ctrl_TF__c,
                                    Wireless_Music_Input_Ctrl_TF__c,
                                    Reserved_Video_Channels_Sum__c,
                                    Reserved_Audio_Channels_Sum__c,
                                    Remarks_Text__c 
                            FROM 
                                    IS_Opportunity_Demand_Operating__c
                            where
                                    IS_Opportunity_Demand__c =: ISodcIdStr
                                ];
        }else{
            ISOhead = new IS_Opportunity_Demand__c(Operating_Room_Sum__c = 1,Demonstration_Area_Sum__c = 1);
        }
        
        if(pageQueryoDoList.size()==1){
            pageShwoElement = pageQueryoDoList[0];
        }else if(pageQueryoDoList.size()==0){
            pageQueryoDoList.add(new IS_Opportunity_Demand_Operating__c(name=' '));
        }
        if(pageQueryoDDList.size()==0){
            pageQueryoDDList.add(new IS_Opportunity_Demand_Demonstration__c(name=' '));
        }
        System.debug('ididididid'+ISOhead);
        System.debug('ddddd'+pageQueryoDoList.size());
        pageShowSet = new ISOpportunityDemandInfo(ISOhead,pageQueryoDoList,pageQueryoDDList);
        PageSum = 1+pageQueryoDoList.size()*6 +pageQueryoDDList.size();
        
    }
    class ISOpportunityDemandInfo{
        //主题数据组
        public IS_Opportunity_Demand__c ISOdcInfoHead{get;set;}
        public List<IS_Opportunity_Demand_Operating__c> ISodoc_InfoList {get;set;}
        public List<IS_Opportunity_Demand_Demonstration__c> ISOdd_InfoList{get;set;}
        //验证关系
        boolean isCheckPass{get;set;}
        public ISOpportunityDemandInfo(){
            isCheckPass =false;
        }
        public ISOpportunityDemandInfo(IS_Opportunity_Demand__c ISHead,List<IS_Opportunity_Demand_Operating__c> ISodocInfoList,List<IS_Opportunity_Demand_Demonstration__c> ISOddInfoList){
            isCheckPass = false;
            this.ISOdcInfoHead = ISHead;
            this.ISodoc_InfoList = ISodocInfoList;
            this.ISOdd_InfoList =ISOddInfoList;
            if(ISOdcInfoHead!=null){
                if(ISOdcInfoHead.Demonstration_Area_Sum__c!=ISOdd_InfoList.size()
                    ||ISOdcInfoHead.Operating_Room_Sum__c!=ISodoc_InfoList.size()
                        ||ISOdd_InfoList.size()==0
                            ||ISodoc_InfoList.size()==0){
                }else{
                    isCheckPass = true;
                }
            }
        }
    }
}