From 6c756e2a0ec1d67b1c13d3b9c2a387e046456ffa Mon Sep 17 00:00:00 2001
From: 张宇恒 <bxyun0@163.com>
Date: 星期五, 15 四月 2022 18:04:48 +0800
Subject: [PATCH] NFM612报修子单相关

---
 force-app/main/default/classes/ChoiceAssetController.cls |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/ChoiceAssetController.cls b/force-app/main/default/classes/ChoiceAssetController.cls
index e5729b9..14da60f 100644
--- a/force-app/main/default/classes/ChoiceAssetController.cls
+++ b/force-app/main/default/classes/ChoiceAssetController.cls
@@ -76,8 +76,9 @@
                                             Order_No__c,Account.Name,Status,Department_Class__c,Hospital__r.Owner.Name,
                                             Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c,
                                             Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name ,
-                                            Department_Class__r.Id,Ji_Zhong_Guan_Li_Ku_Cun__c
+                                            Department_Class__r.Id,Ji_Zhong_Guan_Li_Ku_Cun__c,Account.RecordTypeId
                                             ,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c
+                                            ,Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c
                                         FROM Asset where Id != null AND Repairing_Count__c >= 0 AND SerialNumber like :serialNumber LIMIT 100
 
                                         ];
@@ -126,6 +127,10 @@
             if (info.check) {
                 ast = info.ast;
                 quantity += 1;
+                // if (info.ast.Ji_Zhong_Guan_Li_Ku_Cun__c <= 0){
+                //     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '璁惧闆嗕腑绠$悊搴撳瓨涓嶈冻'));
+                //     return null;
+                // }
             }
         }
         if (quantity == 0) {
@@ -154,6 +159,9 @@
             String zhanlueKeshiId = '00N10000002Dx5t'; //鎴樼暐绉戝
             String keshiId = '00N10000002Dx5n'; //绉戝
             String guzhang = '00N10000002Dx5y'; //鏁呴殰鍙戠敓鏃�
+            //add     wangweipeng        2022/01/26       start
+            String guzhangxcx = '00N1m000006vXqw'; //1.鏁呴殰鍙戠敓鏃ワ紙灏忕▼搴忥級
+            //add     wangweipeng        2022/01/26       end
             String Repair_Source_Id = '00N10000002FH86';//鏂板缓淇悊鏉ユ簮
             String Incharge_Staff_Id = '00N10000002EMHw';//淇悊濮旀墭鑰�(FSE)   
 
@@ -232,10 +240,13 @@
             url += joint_4 + RepairApplicantHospital_Id + joint_1 + repairSubOrder.Hospital__r.Name;//鎶ヤ慨浜哄尰闄�
             url += joint_4 + RepairApplicantDepartment_Id + joint_1 + repairSubOrder.Department__r.Name;//鎶ヤ慨浜虹瀹�
 
-            if (repairSubOrder.ProblemDescription__c != null) {
-                url += joint_4 + Repair_Detail_Id + joint_1 + repairSubOrder.ProblemDescription__c;
+            if (repairSubOrder.ResponseResultDesc__c != null) { //2022/04/07   zhangyuheng  ProblemDescription__c>ResponseResultDesc__c
+                url += joint_4 + Repair_Detail_Id + joint_1 + repairSubOrder.ResponseResultDesc__c;
             }
             url += joint_4 + guzhang + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.FaultTime__c);
+            //add         wangweipeng                 2022/02/11              start
+            url += joint_4 + guzhangxcx + joint_1 + NFMUtil.formatDateTime2StrDateTime(repairSubOrder.FaultTime__c);
+            //add         wangweipeng                 2022/02/11              end
             url += joint_4 + faqiri + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.RepairsReportDate__c);
             url += joint_4 +  PlannedVisitDay_Id + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.PlannedVisitDay__c);//璁″垝涓婇棬鏃�
             url += joint_4 +  ActualVisitDateFirst_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ActualVisitDateFirst__c);//涓�娆′笂闂ㄦ棩
@@ -247,8 +258,42 @@
             url += joint_4 + shouliri + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ReceiverTime__c);
 
             //add     wangweipeng        2022/01/26       start
-            url += joint_4 +  SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//淇悊鍝佽繑閫佸湴
+            // url += joint_4 +  SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//淇悊鍝佽繑閫佸湴      //2022/4/7  zhangyuheng 娉ㄩ噴
             //add     wangweipeng        2022/01/26       end
+            //add     zhangyuheng        2022/04/07       start
+            if (String.isNotBlank(ast.Account.RecordTypeId)) {
+                if (ast.Account.RecordTypeId == '01210000000QemQAAS' || //鎴樼暐绉戝 ET
+                    ast.Account.RecordTypeId == '01210000000QemL' || //鎴樼暐绉戝 娑堝寲绉�
+                    ast.Account.RecordTypeId == '01210000000Qezy' || //鎴樼暐绉戝 鍏朵粬
+                    ast.Account.RecordTypeId == '01210000000Qf03' || //鎴樼暐绉戝 涓嶆槑
+                    ast.Account.RecordTypeId == '01210000000QezZ' || //鎴樼暐绉戝 鍛煎惛绉�
+                    ast.Account.RecordTypeId == '01210000000Qezo' || //鎴樼暐绉戝 濡囩
+                    ast.Account.RecordTypeId == '01210000000Qeze' || //鎴樼暐绉戝 鏅绉�
+                    ast.Account.RecordTypeId == '01210000000Qezj' || //鎴樼暐绉戝 娉屽翱绉�
+                    ast.Account.RecordTypeId == '01210000000Qezt'    //鎴樼暐绉戝 鑰抽蓟鍠夌
+                    ) { //鎴樼暐绉戝
+                    if (String.isNotBlank(ast.Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c)) {
+                        url += joint_4 +  SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//淇悊鍝佽繑閫佸湴
+                    }else {
+                        // continue;
+                    }
+                }
+                if (ast.Account.RecordTypeId == '01210000000QfmRAAS' || //绉戝 鍛煎惛绉�
+                    ast.Account.RecordTypeId == '01210000000QfmH' || //绉戝 鏅绉�
+                    ast.Account.RecordTypeId == '01210000000Qfmb' || //绉戝 鍏朵粬
+                    ast.Account.RecordTypeId == '01210000000QfmM' || //绉戝 濡囩
+                    ast.Account.RecordTypeId == '01210000000QfmC' || //绉戝 娉屽翱绉�
+                    ast.Account.RecordTypeId == '01210000000Qfm7' || //绉戝 娑堝寲绉�
+                    ast.Account.RecordTypeId == '01210000000Qfm2'    //绉戝 鑰抽蓟鍠夌
+                    ) { //绉戝
+                    if (String.isNotBlank(ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c)) {
+                        url += joint_4 +  SalesOfficeCode_selection_Id+ joint_1 + ast.Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c;//淇悊鍝佽繑閫佸湴
+                    }else {
+                        // continue;
+                    }
+                }
+            }
+            //add     zhangyuheng        2022/04/07       end
             
             url += joint_3 + Incharge_Staff_Id + joint_1 + repairSubOrder.Owner.Name;
             url += joint_3 + Incharge_Staff_Id + joint_2 + repairSubOrder.OwnerId;
@@ -310,7 +355,7 @@
         String soql = 'select Id,name,SerialNumber,InstallDate,Information_From__c,Asset_situation__c,Order_No__c,Account.Name,Status,Department_Class__c, ';
 
         soql += 'Hospital__r.Owner.Name,Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c,Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name ,Department_Class__r.Id,';
-        soql += 'Ji_Zhong_Guan_Li_Ku_Cun__c,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c';
+        soql += 'Ji_Zhong_Guan_Li_Ku_Cun__c,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c,Account.RecordTypeId';
         soql += ' from Asset where Id != null AND Repairing_Count__c = 0 ';
         if (String.isNotBlank(FuselageNumber) || String.isNotBlank(AssetModel) || String.isNotBlank(HospitalName)) {
             soql += ' AND (';

--
Gitblit v1.9.1