From 1312ba82d4c880bdb5357d28e0d4af5b285f610f Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期四, 10 三月 2022 15:54:39 +0800
Subject: [PATCH] 最近一月修改内容

---
 force-app/main/default/classes/RentalFixtureSetAssignAgencyControTest.cls                                                        |  295 +
 force-app/main/default/objects/Agency_Report__c/fields/SupportNeeds__c.field-meta.xml                                            |   61 
 force-app/main/default/classes/NFM401Controller.cls                                                                              |   18 
 force-app/main/default/classes/NFM701ControllerHandlerTest.cls                                                                   |  136 
 force-app/main/default/classes/NFM105Rest.cls                                                                                    |   10 
 force-app/main/default/classes/NFM702WebServiceTest.cls                                                                          |   57 
 force-app/main/default/classes/ConsumEquipmentSetShipmentControllerTest.cls                                                      |    6 
 force-app/main/default/classes/NFM702WebServiceTest.cls-meta.xml                                                                 |    5 
 force-app/main/default/classes/QuotePDFExtensionController.cls                                                                   |    2 
 force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js                           |    2 
 force-app/main/default/classes/EquipmentRenewBatchTest.cls                                                                       |  213 +
 force-app/main/default/classes/StatusPageControllerTest.cls                                                                      |  352 +
 force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls                                                           |   87 
 force-app/main/default/classes/ContactTriggerHandler.cls                                                                         |   75 
 force-app/main/default/pages/ConsumEquipmentSetShipment.page                                                                     |   36 
 force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Coverage_Correlation__c.field-meta.xml                  |   14 
 force-app/main/default/classes/EquipmentRenewBatch.cls                                                                           |  133 
 force-app/main/default/classes/OrderListHandlerTest.cls                                                                          |    4 
 force-app/main/default/classes/SampleInventoryControllerTest.cls                                                                 |   11 
 force-app/main/default/classes/EquipmentTargetCoverageBatch.cls                                                                  |   50 
 force-app/main/default/objects/FieldClassification__c/fields/WorkRecord__c.field-meta.xml                                        |   50 
 force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js                                         |   51 
 force-app/main/default/classes/FollowTriggerHandler.cls                                                                          |   33 
 force-app/main/default/triggers/FollowTrigger.trigger                                                                            |    4 
 force-app/main/default/classes/EventToProjectSummaryBatch.cls-meta.xml                                                           |    5 
 force-app/main/default/classes/FixtureUtil.cls                                                                                   |    4 
 force-app/main/default/pages/FollowPage.page                                                                                     |   16 
 force-app/main/default/classes/EquipmentRealCoverageBatch.cls                                                                    |  193 
 force-app/main/default/classes/updateESignBatch.cls                                                                              |    4 
 force-app/main/default/pages/StatusPage.page                                                                                     |    6 
 force-app/main/default/triggers/FollowTrigger.trigger-meta.xml                                                                   |    5 
 force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp                                                                        |    9 
 force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Rigid_Mirror_2__c.field-meta.xml                 |   12 
 force-app/main/default/objects/FieldClassification__c/fields/EffectProgress__c.field-meta.xml                                    |   95 
 force-app/main/default/triggers/Repair.trigger                                                                                   |   23 
 force-app/main/default/classes/CampaignCreateController.cls                                                                      |  206 +
 force-app/main/default/objects/FieldClassification__c/fields/ET_ENG_classification__c.field-meta.xml                             |   25 
 force-app/main/default/pages/ContractDetailPDF.page                                                                              |   13 
 force-app/main/default/classes/FollowTriggerHandler.cls-meta.xml                                                                 |    5 
 force-app/main/default/classes/UploadOBPMController.cls                                                                          |   88 
 force-app/main/default/pages/BatchSelectRepairPage.page                                                                          |  235 
 force-app/main/default/classes/InventorySendMailBatch.cls                                                                        |   62 
 force-app/main/default/objects/BatchIF_Log__c/listViews/NFM_702.listView-meta.xml                                                |   13 
 force-app/main/default/objects/Application_for_Conference_Adjudication__c/sharingReasons/Shared_Editor__c.sharingReason-meta.xml |    5 
 force-app/main/default/objects/FieldClassification__c/fields/classification__c.field-meta.xml                                    |   25 
 force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls-meta.xml                                                       |    5 
 force-app/main/default/pages/Ordergoods.page                                                                                     |  576 +-
 force-app/main/default/classes/LightningUtilTest.cls                                                                             |   19 
 force-app/main/default/objects/meeting_delay_apply__c/fields/MeetingApproved__c.field-meta.xml                                   |   13 
 force-app/main/default/classes/DealerPersonnelController.cls                                                                     |  141 
 force-app/main/default/objects/FieldClassification__c/fields/ProductClassification__c.field-meta.xml                             |   50 
 force-app/main/default/pages/MaintenanceCommissionPDF.page                                                                       |   10 
 force-app/main/default/classes/NFM703Controller.cls                                                                              |   42 
 force-app/main/default/classes/InquiryVerifyBatch.cls                                                                            |   12 
 force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Correlation_Lightsource__c.field-meta.xml        |   12 
 force-app/main/default/objects/FieldClassification__c/FieldClassification__c.object-meta.xml                                     |  164 
 force-app/main/default/pages/ConsumEquipmentSetReceived.page                                                                     |  130 
 force-app/main/default/classes/EquipmentRenewBatch.cls-meta.xml                                                                  |    5 
 force-app/main/default/classes/InventoryResultRecordCopyController.cls                                                           |   45 
 force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls                                                       |  418 ++
 force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp                                              |    4 
 force-app/main/default/objects/Inquiry_form__c/fields/lead_Num__c.field-meta.xml                                                 |   13 
 force-app/main/default/objects/Consum_Apply_Equipment_Set_Detail__c/fields/demo_purpose2__c.field-meta.xml                       |   13 
 force-app/main/default/classes/EquipmentRealCoverageBatch.cls-meta.xml                                                           |    5 
 force-app/main/default/pages/InventoryResultRecordCopy.page                                                                      |   11 
 force-app/main/default/classes/EquipmentSetShippmentReceived3CtrlTest.cls                                                        |  602 +++
 force-app/main/default/classes/NFM701ControllerHandler.cls                                                                       |    6 
 force-app/main/default/classes/EquipmentTargetCoverageBatch.cls-meta.xml                                                         |    5 
 force-app/main/default/triggers/OpportunityBefUpd.trigger                                                                        |    3 
 force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls-meta.xml                                                        |    5 
 force-app/main/default/classes/ApplicationForCAHandler.cls                                                                       |   88 
 force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner__c.field-meta.xml            |   13 
 force-app/main/default/classes/NFM705Rest.cls                                                                                    |  407 +
 force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls                                                        |   30 
 force-app/main/default/objects/FieldClassification__c/fields/productCategories__c.field-meta.xml                                 |  105 
 force-app/main/default/classes/NewQuoteEntryController.cls                                                                       |  118 
 force-app/main/default/pages/DirectAssign.page                                                                                   |    1 
 force-app/main/default/classes/RentalFixtureSetAssignController.cls                                                              |   16 
 force-app/main/default/classes/OrdergoodsControllerTest.cls                                                                      |   10 
 force-app/main/default/classes/NFM701ControllerHandlerTest.cls-meta.xml                                                          |    5 
 force-app/main/default/classes/TenderDeleteLwcController.cls                                                                     |   13 
 force-app/main/default/classes/NFM115ControllerTest.cls                                                                          |   12 
 force-app/main/default/classes/RentalApplyWebService.cls                                                                         |    9 
 force-app/main/default/classes/WeeklyReportCmp.cls                                                                               |   32 
 force-app/main/default/classes/NFM603Controller.cls                                                                              |   19 
 force-app/main/default/classes/BatchSelectRepairPageController.cls                                                               |   79 
 force-app/main/default/objects/FieldClassification__c/fields/WarlockClassification__c.field-meta.xml                             |  100 
 force-app/main/default/triggers/NFM007.trigger                                                                                   |   79 
 force-app/main/default/classes/TaskObjectTriggerHandle.cls                                                                       |    2 
 force-app/main/default/classes/WeeklyReportCmpTest.cls                                                                           |    3 
 force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_1__c.field-meta.xml                 |   12 
 force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls                                                      |    4 
 force-app/main/default/classes/NFM704Rest.cls                                                                                    |  169 
 force-app/main/default/classes/OFSCalendarController.cls                                                                         |    4 
 force-app/main/default/pages/CampaignCreate.page                                                                                 |   96 
 force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Applicant_Dep__c.field-meta.xml                 |   13 
 force-app/main/default/classes/ConsumDefaultSelectController.cls                                                                 |   51 
 force-app/main/default/classes/PersonalCalendarController.cls                                                                    |    4 
 force-app/main/default/classes/ConsumEquipmentSetShipmentController.cls                                                          | 1341 ++++++
 force-app/main/default/classes/NFM608Rest.cls                                                                                    |    2 
 force-app/main/default/classes/LightningUtil.cls                                                                                 |   65 
 force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls                                                      | 1444 +++++++
 force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_2__c.field-meta.xml                 |   12 
 force-app/main/default/classes/CampaignTriggerBefInsHandler.cls                                                                  |   23 
 force-app/main/default/classes/NFM702WebService.cls                                                                              |    6 
 force-app/main/default/classes/UploadOBPMControllerTest.cls-meta.xml                                                             |    5 
 force-app/main/default/objects/Inventory_Header__c/listViews/Viewguangdong.listView-meta.xml                                     |   16 
 force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner_Num__c.field-meta.xml        |   13 
 force-app/main/default/classes/CreateOpportunityTaskBatch.cls                                                                    |    2 
 force-app/main/default/objects/Agency_Report__c/fields/WarlockClassification__c.field-meta.xml                                   |   14 
 force-app/main/default/classes/StatusPageController.cls                                                                          |   12 
 force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Soft_Mirror_2__c.field-meta.xml                  |   12 
 force-app/main/default/classes/NFM114RestTest.cls                                                                                |    6 
 force-app/main/default/classes/NFM203Rest.cls                                                                                    |    3 
 force-app/main/default/classes/TenderWebService.cls                                                                              |   11 
 force-app/main/default/classes/SampleInventorySectionControllerTest.cls                                                          |    5 
 force-app/main/default/objects/Inquiry_form__c/fields/Follow_Date__c.field-meta.xml                                              |   10 
 force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js                                                                   |   15 
 force-app/main/default/classes/UploadOBPMControllerTest.cls                                                                      |   75 
 force-app/main/default/classes/MaintenanceCommissionPDFController.cls                                                            |    3 
 force-app/main/default/classes/DealerPersonnelControllerTest.cls                                                                 |   22 
 force-app/main/default/classes/KPIPreviewScheduel.cls-meta.xml                                                                   |    5 
 force-app/main/default/objects/LastbuyProduct__c/fields/RemainingNumber__c.field-meta.xml                                        |   15 
 force-app/main/default/classes/NFM620Rest.cls                                                                                    |   32 
 force-app/main/default/classes/SI_NewQuoteEntryController.cls                                                                    |  116 
 force-app/main/default/pages/CampaignMember.page                                                                                 |    6 
 force-app/main/default/classes/StaticParameter.cls                                                                               |    3 
 force-app/main/default/classes/ConsumEquipmentSetReturnController.cls                                                            |   11 
 force-app/main/default/classes/RentalApplySplitController.cls                                                                    |    6 
 force-app/main/default/objects/LastbuyProduct__c/validationRules/yuliudayu.validationRule-meta.xml                               |    7 
 force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatch.cls                                                          |    6 
 force-app/main/default/classes/SimpleEventRegisterController.cls                                                                 |    6 
 force-app/main/default/pages/EquipmentSetShippmentReceived2.page                                                                 |   23 
 force-app/main/default/classes/CreateNewMaintenanceTaskBatch.cls                                                                 |   33 
 force-app/main/default/classes/NewQuoteIraiController.cls                                                                        |  109 
 force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp                                |    2 
 force-app/main/default/classes/NFMUtil.cls                                                                                       |    5 
 force-app/main/default/classes/LastbuyProductHandlerTest.cls                                                                     |    3 
 force-app/main/default/classes/EquipmentRenewBatchTest.cls-meta.xml                                                              |    5 
 force-app/main/default/objects/Inventory_Header_Copy__c/webLinks/ClearStatus.webLink-meta.xml                                    |   44 
 force-app/main/default/classes/EquipmentSetShippmentReceived1Controller.cls                                                      |   13 
 force-app/main/default/classes/NFM202Controller.cls                                                                              |    4 
 force-app/main/default/pages/LostReportEditAsset.page                                                                            |    8 
 force-app/main/default/classes/InventoryHeaderCopyHandler.cls                                                                    |    8 
 force-app/main/default/classes/StatusPageControllerTest.cls-meta.xml                                                             |    5 
 force-app/main/default/classes/DealerPersonnelControllerTest.cls-meta.xml                                                        |    5 
 force-app/main/default/classes/EventToProjectSummaryBatch.cls                                                                    |   19 
 force-app/main/default/objects/meeting_delay_apply__c/fields/IF_Approved_Old__c.field-meta.xml                                   |    9 
 force-app/main/default/objects/FieldClassification__c/fields/ProductCcategory__c.field-meta.xml                                  |  105 
 force-app/main/default/classes/KPIPreviewScheduel.cls                                                                            |    6 
 force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls                                                          |   31 
 force-app/main/default/triggers/AccountTrigger.trigger                                                                           |   25 
 force-app/main/default/pages/UploadOBPM.page                                                                                     |   32 
 force-app/main/default/classes/RetrospectiveWeeklyReportController.cls                                                           |  155 
 force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls                                                                |  235 +
 force-app/main/default/classes/MeetingDelayApplyTriggerHandler.cls                                                               |   11 
 force-app/main/default/objects/Inquiry_form__c/fields/No_Need_Date__c.field-meta.xml                                             |   10 
 force-app/main/default/pages/InventoryReport.page                                                                                |    6 
 force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls                                                                 |  499 ++
 force-app/main/default/classes/ChoiceAssetController.cls                                                                         |    4 
 force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls-meta.xml                                              |    5 
 force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger                                                            |  120 
 force-app/main/default/classes/AccAssumeChangeBatch.cls                                                                          |    3 
 force-app/main/default/objects/Rental_Apply_Equipment_Set_Detail__c/fields/ApplyToShipmentWorkTime__c.field-meta.xml             |   14 
 force-app/main/default/classes/SelectAssetEstimateVMController.cls                                                               |   15 
 force-app/main/default/classes/EquipmentSetShippmentReceived2Controller.cls                                                      |   10 
 force-app/main/default/classes/InquiryVerifyBatchTest.cls                                                                        |   28 
 force-app/main/default/pages/LostReportEdit.page                                                                                 |   54 
 force-app/main/default/classes/NFM702WebService.cls-meta.xml                                                                     |    5 
 force-app/main/default/classes/NFM606Controller.cls                                                                              |    4 
 force-app/main/default/classes/LastbuyProductHandler.cls                                                                         |  188 
 force-app/main/default/objects/Maintenance_Contract__c/fields/Equipment_Last_Money__c.field-meta.xml                             |   14 
 force-app/main/default/classes/ConsumAutoSelectBatch.cls                                                                         |    3 
 force-app/main/default/classes/NFM707Rest.cls                                                                                    |   17 
 force-app/main/default/classes/NFM705RestTest.cls                                                                                |   19 
 force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls-meta.xml                                             |    5 
 176 files changed, 10,079 insertions(+), 1,726 deletions(-)

diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
index 27198fb..fa5fcff 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImport.cmp
@@ -64,7 +64,7 @@
 <div >
     <div class="slds-modal__header ">
         <h4 id="headerTarget" class="slds-float--left"></h4>
-        <h2 id="headerTarget" class="slds-text-heading--medium">鍛ㄦ姤鎵归噺瀵煎叆</h2>
+        <h2 id="headerTarget" class="slds-text-heading--medium">瀹㈡埛浜哄憳鎵归噺瀵煎叆</h2>
     </div>
     <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium ">
         <aura:if isTrue="{!v.showMain}">
diff --git a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
index 685b5e8..b538b04 100644
--- a/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
+++ b/force-app/main/default/aura/DealerPersonnelInformationImport/DealerPersonnelInformationImportHelper.js
@@ -145,7 +145,7 @@
         window.setTimeout($A.getCallback(function () {
             $A.util.addClass(component.find('errorDiv'), 'slds-hide');
         }),
-            3000
+            4000
         );
     },
     success : function(message) {
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
index b82bc29..6ae7294 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReport.cmp
@@ -509,10 +509,10 @@
                             <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select"
                                 change="{!c.select_ConsumptionOfConsumables}" />
                         </div>
-                        <!-- 鏈+鍒嗙被   OtherBrandConsumables__c   -->
+                        <!-- 鏈+鍒嗙被   WarlockClassification__c   -->
                         <div
                             class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
-                            {!v.fieldsmap.OtherBrandConsumables__c}
+                            {!v.fieldsmap.WarlockClassification__c}
                             <ui:inputSelect aura:id="select_OtherBrandConsumables" class="slds-select" />
                         </div>
                         <!-- 宸查噰鐢ㄥ叾浠栧搧鐗�   ProductCcategory__c -->
diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
index bacadec..e177114 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportHelper.js
@@ -237,14 +237,14 @@
                 var report_id = component.get('v.edit_copy_select_report_id');
                 if (report_id != "") {
                     var select_EffectProgress1 = '';
-                    var OtherBrandConsumables = '';
+                    var WarlockClassification = '';
                     var ProductCcategory = '';
                     var productCategories = '';
                     var i = 0;
                     for (i = 0; i < reports.length; i++) {
                         if (report_id == reports[i]["Id"]) {
                             select_EffectProgress1 = reports[i]["EffectProgress__c"];
-                            OtherBrandConsumables = reports[i]["OtherBrandConsumables__c"];
+                            WarlockClassification = reports[i]["WarlockClassification__c"];
                             ProductCcategory = reports[i]["ProductCcategory__c"];
                             productCategories = reports[i]["productCategories__c"];
                                 break;
@@ -255,8 +255,8 @@
                         component.find('select_EffectProgress').set('v.value', select_EffectProgress1);
                     }
                     //鏈+鍒嗙被
-                    if (OtherBrandConsumables != null && OtherBrandConsumables != '') {
-                        component.find('select_OtherBrandConsumables').set('v.value', OtherBrandConsumables);
+                    if (WarlockClassification != null && WarlockClassification != '') {
+                        component.find('select_OtherBrandConsumables').set('v.value', WarlockClassification);
                     }
                     //宸查噰鐢ㄥ叾浠栧搧鐗�
                     if (ProductCcategory != null && ProductCcategory != '') {
@@ -283,7 +283,7 @@
             var doctor2__c = component.find('select_doctor').get('v.value');
             var WorkRecord__c = component.find('select_purpose_type').get('v.value');
             var EffectProgress__c = component.find('select_EffectProgress').get('v.value');
-            var OtherBrandConsumables__c = component.find('select_OtherBrandConsumables').get('v.value');
+            var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value');
             var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value');
             var productCategories__c = component.find('select_productCategories').get('v.value');
             var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value');
@@ -301,7 +301,7 @@
                     !DealerPersonnel__c &&
                     !doctor2__c &&
                     !EffectProgress__c &&
-                    !OtherBrandConsumables__c &&
+                    !WarlockClassification__c &&
                     !ProductCcategory__c &&
                     !productCategories__c &&
                     !warlocksNumber__c &&
@@ -327,7 +327,7 @@
                     select_report_data['DealerPersonnel__c'] == DealerPersonnel__c &&
                     select_report_data['doctor2__c'] == doctor2__c &&
                     select_report_data['EffectProgress__c'] == EffectProgress__c &&
-                    select_report_data['OtherBrandConsumables__c'] == OtherBrandConsumables__c &&   
+                    select_report_data['WarlockClassification__c'] == WarlockClassification__c &&   
                     select_report_data['ProductCcategory__c'] == ProductCcategory__c &&
                     select_report_data['productCategories__c'] == productCategories__c &&
                     select_report_data['warlocksNumber__c'] == warlocksNumber__c &&
@@ -352,7 +352,7 @@
                     select_report_data['DealerPersonnel__c'] == DealerPersonnel__c &&
                     select_report_data['doctor2__c'] == doctor2__c &&
                     select_report_data['EffectProgress__c'] == EffectProgress__c &&
-                    select_report_data['OtherBrandConsumables__c'] == OtherBrandConsumables__c &&  
+                    select_report_data['WarlockClassification__c'] == WarlockClassification__c &&  
                     select_report_data['ProductCcategory__c'] == ProductCcategory__c &&
                     select_report_data['productCategories__c'] == productCategories__c &&
                     select_report_data['warlocksNumber__c'] == warlocksNumber__c &&
@@ -512,8 +512,8 @@
         var EffectProgress__c = component.find('select_EffectProgress').get('v.value');
          // 绉戝鍚屾潵鑰楁潗鏈堜娇鐢ㄩ噺   ConsumptionOfConsumables__c      
         var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value');
-         // 鏈+鍒嗙被   OtherBrandConsumables__c  
-        var OtherBrandConsumables__c = component.find('select_OtherBrandConsumables').get('v.value');
+         // 鏈+鍒嗙被   WarlockClassification__c  
+        var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value');
           // 宸查噰鐢ㄥ叾浠栧搧鐗�   ProductCcategory__c  
         var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value');
            // 鍏朵粬鍝佺墝浜у搧绫诲埆   productCategories__c  
@@ -563,7 +563,7 @@
         if (!EffectProgress__c) { error.push("鏁堟灉/杩涘害 涓嶅瓨鍦�"); } 
         // if (!OtherBrandConsumables__c) { error.push("鏈+鍒嗙被 涓嶅瓨鍦�"); }
         if (!ProductCcategory__c) { error.push("宸查噰鐢ㄥ叾浠栧搧鐗�  涓嶅瓨鍦�"); }
-        if (!productCategories__c) { error.push("浜у搧绫诲埆 涓嶅瓨鍦�"); }
+        // if (!productCategories__c) { error.push("鍏朵粬鍝佺墝浜у搧绫诲埆 涓嶅瓨鍦�"); }
         if (!ConsumptionOfConsumables__c) { error.push("绉戝鍚岀被鑰楁潗鏈堜娇鐢ㄩ噺 涓嶈兘涓虹┖"); }
         if (!warlocksNumber__c) { error.push("浜у搧鐢ㄩ噺 涓嶈兘涓虹┖"); }
         for (var i = 0; i < error.length; i++) {
@@ -585,7 +585,7 @@
                 "ConsumptionOfConsumables": ConsumptionOfConsumables__c,
                 "WorkRecord": WorkRecord__c,
                 "EffectProgress": EffectProgress__c,
-                "OtherBrandConsumables" : OtherBrandConsumables__c,
+                "WarlockClassification" : WarlockClassification__c,
                 "ProductCcategory" : ProductCcategory__c,
                 "productCategories" : productCategories__c,
                 "warlocksNumber" : warlocksNumber__c,
@@ -646,7 +646,7 @@
                 "DealerPersonnel": DealerPersonnel__c,
                 "ProductCcategory" : ProductCcategory__c,
                 "productCategories" : productCategories__c,
-                "OtherBrandConsumables" : OtherBrandConsumables__c,
+                "WarlockClassification" : WarlockClassification__c,
                 "ProductClassification": ProductClassification__c,
                 "WorkRecord": WorkRecord__c,
                 "EffectProgress": EffectProgress__c,
@@ -1441,7 +1441,7 @@
         }
         columnDivider = ',';
         lineDivider = '\n';
-        keys = ['Submit_date__c', 'Person_In_Charge2__c', 'Report_Date__c', 'Agency_Hospital__c','Department_Cateogy__c','DealerPersonnel__c','WorkRecord__c','doctor2__c','ProductClassification__c','UseProduct1__c', 'UseProduct2__c','UseProduct3__c', 'EffectProgress__c','ConsumptionOfConsumables__c',  'OtherBrandConsumables__c', 'ProductCcategory__c', 'productCategories__c','warlocksNumber__c','WorkMark__c'];
+        keys = ['Submit_date__c', 'Person_In_Charge2__c', 'Report_Date__c', 'Agency_Hospital__c','Department_Cateogy__c','DealerPersonnel__c','WorkRecord__c','doctor2__c','ProductClassification__c','UseProduct1__c', 'UseProduct2__c','UseProduct3__c', 'EffectProgress__c','ConsumptionOfConsumables__c',  'WarlockClassification__c', 'ProductCcategory__c', 'productCategories__c','warlocksNumber__c','WorkMark__c'];
         thkeys = ['鍛�', '鎷呭綋', '娲诲姩鏃�', '鍖婚櫌', '绉戝', '缁忛攢鍟嗕汉鍛�', '宸ヤ綔璁板綍',  '鍖婚櫌浜哄憳','浜у搧鍒嗙被(绗笁鍒嗙被)', '浣跨敤浜у搧1(浜у搧鍨嬪彿)', '浣跨敤浜у搧2','浣跨敤浜у搧3','鏁堟灉/杩涘害','绉戝鍚岀被鑰楁潗鏈堜娇鐢ㄩ噺','鏈+鍒嗙被','宸查噰鐢ㄥ叾浠栧搧鐗�','鍏朵粬鍝佺墝浜у搧绫诲埆','浜у搧鐢ㄩ噺','宸ヤ綔鏍囪']
         csvStringResult = '';
         csvStringResult += thkeys.join(columnDivider);
@@ -1473,13 +1473,13 @@
                 } else if (skey == 'UseProduct3__c') {
                     csvStringResult +=  objectRecords[i].UseProduct3__r.Name;
                 } else if (skey == 'EffectProgress__c'){
-                    csvStringResult +=  objectRecords[i].EffectProgress__r.Name;
-                }else if (skey == 'OtherBrandConsumables__c'){ 
-                    csvStringResult +=  objectRecords[i].OtherBrandConsumables__r.Name;
+                    csvStringResult +=  objectRecords[i].EffectProgress__r.EffectProgress__c;
+                }else if (skey == 'WarlockClassification__c'){ 
+                    csvStringResult +=  objectRecords[i].WarlockClassification__r.WarlockClassification__c;
                 }else if(skey == 'ProductCcategory__c'){
-                    csvStringResult +=  objectRecords[i].ProductCcategory__r.Name;
+                    csvStringResult +=  objectRecords[i].ProductCcategory__r.ProductCcategory__c;
                 }else if(skey == 'productCategories__c'){
-                    csvStringResult +=  objectRecords[i].productCategories__r.Name;
+                    csvStringResult +=  objectRecords[i].productCategories__r.productCategories__c;
                 }else{
                     csvStringResult +=  objectRecords[i][skey] ;
                 }
@@ -1493,7 +1493,7 @@
     //  瀵煎嚭椤甸潰鏄剧ず鐨勬ā鏉�
     showExportDate: function (component, objectRecords) {
         console.log('杩涘叆showexceportdate' + objectRecords);
-        var keys = ['Submit_date__c', 'Person_In_Charge2__c', 'Report_Date__c', 'Agency_Hospital__c','Department_Cateogy__c','DealerPersonnel__c','WorkRecord__c','doctor2__c','ProductClassification__c','UseProduct1__c', 'UseProduct2__c','UseProduct3__c', 'EffectProgress__c','ConsumptionOfConsumables__c',  'OtherBrandConsumables__c', 'ProductCcategory__c','productCategories__c', 'warlocksNumber__c','WorkMark__c'];
+        var keys = ['Submit_date__c', 'Person_In_Charge2__c', 'Report_Date__c', 'Agency_Hospital__c','Department_Cateogy__c','DealerPersonnel__c','WorkRecord__c','doctor2__c','ProductClassification__c','UseProduct1__c', 'UseProduct2__c','UseProduct3__c', 'EffectProgress__c','ConsumptionOfConsumables__c',  'WarlockClassification__c', 'ProductCcategory__c','productCategories__c', 'warlocksNumber__c','WorkMark__c'];
         var headers = ['鍛�', '鎷呭綋', '娲诲姩鏃�', '鍖婚櫌', '绉戝', '缁忛攢鍟嗕汉鍛�', '宸ヤ綔璁板綍',  '鍖婚櫌浜哄憳','浜у搧鍒嗙被(绗笁鍒嗙被)', '浣跨敤浜у搧1(浜у搧鍨嬪彿)', '浣跨敤浜у搧2','浣跨敤浜у搧3','鏁堟灉/杩涘害','绉戝鍚岀被鑰楁潗鏈堜娇鐢ㄩ噺','鏈+鍒嗙被','宸查噰鐢ㄥ叾浠栧搧鐗�','鍏朵粬鍝佺墝浜у搧绫诲埆','浜у搧鐢ㄩ噺','宸ヤ綔鏍囪']
         var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">";
         content += "<thead><tr class=\"slds-text-title--caps\">";
@@ -1527,13 +1527,13 @@
                 } else if (skey == 'UseProduct3__c') {
                     content += '<td>' + objectRecords[i].UseProduct3__r.Name + '</td>';
                 } else if (skey == 'EffectProgress__c'){
-                    content += '<td>' + objectRecords[i].EffectProgress__r.Name + '</td>';
-                }else if (skey == 'OtherBrandConsumables__c'){
-                    content += '<td>' + objectRecords[i].OtherBrandConsumables__r.Name + '</td>'; 
+                    content += '<td>' + objectRecords[i].EffectProgress__r.EffectProgress__c + '</td>';
+                }else if (skey == 'WarlockClassification__c'){
+                    content += '<td>' + objectRecords[i].WarlockClassification__r.WarlockClassification__c + '</td>'; 
                 }else if (skey == 'ProductCcategory__c'){
-                    content += '<td>' + objectRecords[i].ProductCcategory__r.Name + '</td>';
+                    content += '<td>' + objectRecords[i].ProductCcategory__r.ProductCcategory__c + '</td>';
                 }else if (skey == 'productCategories__c'){
-                    content += '<td>' + objectRecords[i].productCategories__r.Name + '</td>';
+                    content += '<td>' + objectRecords[i].productCategories__r.productCategories__c + '</td>';
                 }else{
                     content += '<td>' + objectRecords[i][skey] + '</td>';
                 }
@@ -1703,6 +1703,7 @@
     //宸ヤ綔浼氳褰�
     selectPurposeType: function (component,event,helper) {
         var doctor_value = component.find('select_purpose_type').get('v.value');
+        alert(doctor_value);
         if(doctor_value != ''){
         var action = component.get('c.selectPurposeTypes');
         action.setParams({
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
index 3b58f87..93fffdf 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -343,7 +343,6 @@
                             {!v.fieldsmap.visitor_title__c}
                             <div>{!v.doctor_title}</div>
                         </div>
-                        
                         <!-- 娲诲姩鍖哄垎 -->
                         <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
                             {!v.fieldsmap.Purpose_Type__c}
@@ -410,7 +409,13 @@
                             <!-- <force:inputField value="{!v.data.Product_Category3__c}" aura:id="input-product-category3"/> -->
                             <ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/>
                         </div>
-                        
+                        <!--SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start-->
+                        <!-- 鏀彺闇�姹� -->
+                        <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
+                            {!v.fieldsmap.SupportNeeds__c}
+                            <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" change="{!c.SupportNeeds__c}"/>
+                        </div>
+                        <!--SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end-->
                         <div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12">
                             {!v.fieldsmap.Result__c}
                             <ui:inputSelect aura:id="select_result" class="slds-select"/>
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
index b8f3c0e..1f84345 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -17,6 +17,9 @@
                 component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c));
                 component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c));
                 component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c));
+                //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+                component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c));
+                //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
                 component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
                 component.set('v.dialog_type', '鏂板缓');
                 
@@ -524,6 +527,10 @@
         
         // 娲诲姩鍖哄垎 Purpose_Type__c
         var Purpose_Type__c = component.find('select_purpose_type').get('v.value');
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+        // 鏀彺闇�姹� SupportNeeds__c
+        var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value');
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
         // 璇环 Opportunity__c
         var Opportunity__c = component.get('v.data.Opportunity__c');
 
@@ -572,6 +579,7 @@
         if (!Department_Cateogy__c) { error.push("绉戝 涓嶅瓨鍦�"); }
         if (!doctor2__c) { error.push("鎷滆浜� 涓嶅瓨鍦�"); }
         if (!Purpose_Type__c) { error.push("娲诲姩鍖哄垎 涓嶅瓨鍦�"); }
+        if (!SupportNeeds__c) { error.push("鏀彺闇�姹� 涓嶅瓨鍦�"); }
         if (!Opportunity__c) { Opportunity__c = ""; }
         if (!Product_Category1__c) { error.push("浜у搧鍖哄垎1 涓嶅瓨鍦�"); }
         if (Purpose_Type__c && (Purpose_Type__c.substr(-3) == 'SIS' || Purpose_Type__c.substr(-3) == 'OPD')) {
@@ -591,10 +599,14 @@
 		if (component.get('v.mode') == 'edit') {
             var Agency_Report__c = component.get('v.select_report_data').Id;
             var action = component.get('c.editAgencyReport');
+            alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c);
             action.setParams({
                 "Agency_Report_Id" : Agency_Report__c,
                 "Department_Cateogy" : Department_Cateogy__c,
                 "Purpose_Type" : Purpose_Type__c,
+                //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+                "SupportNeedsc" : SupportNeeds__c,
+                //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
                 "Agency_Report_Header" : Agency_Report_Header__c,
                 "Agency_Hospital" : Agency_Hospital__c,
                 "Person_In_Charge2" : Person_In_Charge2__c,
@@ -658,6 +670,9 @@
             action.setParams({
                 "Department_Cateogy" : Department_Cateogy__c,
                 "Purpose_Type" : Purpose_Type__c,
+                //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+                "SupportNeedsc" : SupportNeeds__c,
+                //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
                 "Agency_Report_Header" : Agency_Report_Header__c,
                 "Agency_Hospital" : Agency_Hospital__c,
                 "Person_In_Charge2" : Person_In_Charge2__c,
diff --git a/force-app/main/default/classes/AccAssumeChangeBatch.cls b/force-app/main/default/classes/AccAssumeChangeBatch.cls
index bcc6072..2a81ffa 100644
--- a/force-app/main/default/classes/AccAssumeChangeBatch.cls
+++ b/force-app/main/default/classes/AccAssumeChangeBatch.cls
@@ -12,8 +12,7 @@
     global AccAssumeChangeBatch() {
 
     }
-    
-    
+
     global Database.QueryLocator start(Database.BatchableContext bc) {
         // 妫�绱㈠尰闄紙鐢ㄦ潵瀵瑰簲鍏跺叧鑱旂殑鎷涙姇鏍囷級
         String query = 'Select Id, Assume_Change__c FROM Account ';
diff --git a/force-app/main/default/classes/ApplicationForCAHandler.cls b/force-app/main/default/classes/ApplicationForCAHandler.cls
index 1c36095..3fbcd36 100644
--- a/force-app/main/default/classes/ApplicationForCAHandler.cls
+++ b/force-app/main/default/classes/ApplicationForCAHandler.cls
@@ -21,6 +21,8 @@
     }
 
     protected override void beforeUpdate() {
+        // 鏇存柊鏃跺垽鏂槸鍚︽洿鏂颁簡缁戝畾鐨勫浼氾紝濡傛灉缁戝畾澶氫釜瀛︿細涓斾笉鏄禐鍔╀細鏃讹紝娓呯┖缁戝畾鍏崇郴
+        clean_binding();
         clean_campaign();
         update_campaign();
     }
@@ -28,6 +30,27 @@
     protected override void afterUpdate() {
         // opd璁″垝鐨勫紩鐢ㄥ瓧娈佃揪鍒颁笂绾匡紝鍐宠鐘舵�侀渶瑕佸湪瑙﹀彂鍣ㄩ噷鏇存柊
         update_status_on_opd();
+    }
+
+    // 鏇存柊鏃跺垽鏂槸鍚︽洿鏂颁簡缁戝畾鐨勫浼氾紝濡傛灉缁戝畾澶氫釜瀛︿細涓斾笉鏄禐鍔╀細鏃讹紝娓呯┖缁戝畾鍏崇郴
+    private void clean_binding() {
+        Map<String, String> app_cam_binds = new Map<String, String>();
+        for (Application_for_Conference_Adjudication__c app : this.newList) {
+            Application_for_Conference_Adjudication__c old_app = this.oldMap.get(app.Id);
+            if (String.isNotBlank(old_app.Num__c) && !old_app.Num__c.equals(app.Num__c)) {
+                app_cam_binds.put(old_app.Id, old_app.Num__c);
+            }
+        }
+        if (app_cam_binds.size() > 0) {
+            List<Campaign> cams = [select Id, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where Meeting_Approved_No__c in :app_cam_binds.keySet() and Num__c in :app_cam_binds.values()];
+            if (cams != null && cams.size() > 0) {
+                for (Campaign cam : cams) {
+                    cam.MeetingApprovedNo__c = null;
+                    cam.Meeting_Approved_No__c = null;
+                }
+                update cams;
+            }
+        }
     }
 
     // 瀹℃壒涓嶉�氳繃鐨勬椂鍊� 娓呯┖浼氳鍜孫PD璁″垝涓婄殑鍐宠淇℃伅
@@ -76,7 +99,7 @@
         }
         Map<String, Campaign> wait_upd_campaigns = new Map<String, Campaign>();
         if (app_ids.size() > 0) {
-            List<Campaign> campaigns = [select Id, Num__c, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where Meeting_Approved_No__c in :app_ids];
+            List<Campaign> campaigns = [select Id, Num__c, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where Meeting_Approved_No__c in :app_ids and Meeting_Type__c != '璧炲姪浼�'];
             if (campaigns.size() > 0) {
                 for (Campaign cam : campaigns) {
                     Application_for_Conference_Adjudication__c app = this.newMap.get(cam.Meeting_Approved_No__c);
@@ -128,13 +151,11 @@
 
     // 鏇存柊鍐宠鐨勪俊鎭埌瀛︿細涓�
     private Campaign update_info_from_app(Campaign cam, Application_for_Conference_Adjudication__c app) {
-        init_state_city();
         cam.StartDate                        = app.StartDate__c;
         cam.EndDate                          = app.EndDate__c;
         cam.Budget_Type__c                   = app.BudgetType__c;
         cam.OfficeCategory__c                = app.OfficeCategory__c;
         cam.Meeting_Type__c                  = app.MeetingType__c;
-        cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
 
         cam.WorkshopPlace__c                 = app.WorkshopPlace__c;
         cam.HostName__c                      = app.HostName__c;
@@ -146,65 +167,12 @@
         cam.Expected_Hcp_Attendance__c       = app.ExpectedHcpAttendance__c;
         cam.SponsorshipCategory__c           = app.SponsorshipCategory__c;
         cam.IsPaidToSponsor__c               = app.IsPaidToSponsor__c;
-        cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+        // cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+        cam.Activity_Type_Name__c            = app.Type_of_adjudication_meeting__c;
         // 杩欓噷闇�瑕侀澶栧姞鎿嶄綔
-        cam.State_Master__c                  = get_state(app.StateMaster__c);                 
-        cam.City_Master__c                   = get_city(app.CityMaster__c);
+        cam.State_Master__c                  = StateCityUtil.get_state(app.StateMaster__c);                 
+        cam.City_Master__c                   = StateCityUtil.get_city(app.CityMaster__c);
 
         return cam;
-    }
-
-    // 鍒濆鍖栫渷甯備俊鎭�
-    public static void init_state_city() {
-        if (states == null || states.size() <= 0) {
-            states = new Map<String, String>();
-            List<Address_Level__c> lst_state = [select Id, Name from Address_Level__c];
-            for (Address_Level__c level1 : lst_state) {
-                states.put(level1.Name, level1.Id);
-            }
-        }
-        if (cities == null || cities.size() <= 0) {
-            cities = new Map<String, String>();
-            List<Address_Level2__c> lst_city = [select Id, Name from Address_Level2__c];
-            for (Address_Level2__c level2 : lst_city) {
-                cities.put(level2.Name, level2.Id);
-            }
-        }
-    }
-
-    // 璁剧疆浼氳涓婄殑鐪�
-    public static String get_state(String state_name) {
-        if (String.isBlank(state_name)) {
-            return null;
-        }
-        if (states == null || states.size() <= 0) {
-            return null;
-        }
-        // 澶勭悊绌烘牸 鎴栬鍚庣画杩樻湁鍒殑澶勭悊
-        state_name = state_name.trim().replace(' ', '');
-        for(String state : states.keySet()) {
-            if (state_name.contains(state) || state.contains(state_name)) {
-                return states.get(state);
-            }
-        }
-        return null;
-    }
-
-    // 璁剧疆浼氳涓婄殑甯�
-    public static String get_city(String city_name) {
-        if (String.isBlank(city_name)) {
-            return null;
-        }
-        if (cities == null || cities.size() <= 0) {
-            return null;
-        }
-        // 澶勭悊绌烘牸 鎴栬鍚庣画杩樻湁鍒殑澶勭悊
-        city_name = city_name.trim().replace(' ', '');
-        for(String city : cities.keySet()) {
-            if (city_name.contains(city) || city.contains(city_name)) {
-                return cities.get(city);
-            }
-        }
-        return null;
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/BatchSelectRepairPageController.cls b/force-app/main/default/classes/BatchSelectRepairPageController.cls
index 408374c..ae63a1c 100644
--- a/force-app/main/default/classes/BatchSelectRepairPageController.cls
+++ b/force-app/main/default/classes/BatchSelectRepairPageController.cls
@@ -14,56 +14,52 @@
     public void init(){
         RetrievalData reval = new RetrievalData();
         RevalInfoList = new List<RetrievalData>();
-        reval.RepairName = null;
-        reval.SAPRepairNo = null;
-        reval.HospitalName = null;
         RevalInfoList.add(reval);
     }
 
     public PageReference RetrievalBtn() {
         RepairList = new List<Repair__c>();
         RAInfoList = new List<RepairData>();
-        String RepairName;
-        String SAPRepairNo;
-        String HospitalName;
+        String sql;
+        System.debug('RevalInfoList1:' + RevalInfoList);
         for(RetrievalData reval : RevalInfoList){
+            if(String.isBlank(reval.Status2) && String.isBlank(reval.RepairName) && String.isBlank(reval.SAPRepairNo) 
+                && String.isBlank(reval.SerialNumber) && String.isBlank(reval.repair.Incharge_Staff__c) 
+                && String.isBlank(String.valueOf(reval.repair.Final_complete_day__c))){
+                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯嚦灏戞坊鍔犱竴涓绱㈡潯浠�!'));
+                return null;
+            }
+            sql += 'select Id, Name, SAP_Service_Repair_No__c, Status1__c, Status2__c, Delivered_Product__c, SerialNumber__c, ';
+            sql += 'HP_Name__c, State_Hospital__c, Incharge_Staff__c, FSE_ApplyForRepair_Day__c, work_location_select__c, On_site_repair__c,';
+            sql += 'Number_of_EffectiveContract__c, NewProductGuaranteeObject__c from Repair__c where Id != null ';
+            if(String.isNotBlank(reval.Status2)){
+                sql += ' and Status2__c like \'%' + reval.Status2 + '%\' ';
+            }
             if(String.isNotBlank(reval.RepairName)){
-                RepairName = reval.RepairName;
+                sql += ' and Name like \'%' + reval.RepairName + '%\' ';
             }
             if(String.isNotBlank(reval.SAPRepairNo)){
-                SAPRepairNo = reval.SAPRepairNo;
+                sql += ' and SAP_Service_Repair_No__c like \'%' + reval.SAPRepairNo + '%\' ';
             }
-            if(String.isNotBlank(reval.HospitalName)){
-                HospitalName = reval.HospitalName;
+            if(String.isNotBlank(reval.SerialNumber)){
+                sql += ' and SerialNumber__c like \'%' + reval.SerialNumber + '%\' ';
             }
+            if(String.isNotBlank(reval.repair.Incharge_Staff__c)){
+                sql += ' and Incharge_Staff__c = \'' + reval.repair.Incharge_Staff__c + '\' ';
+            }
+            if(String.isNotBlank(String.valueof(reval.repair.Final_complete_day__c))){
+                String day = String.valueof(reval.repair.Final_complete_day__c);
+                day = day.substring(0,10);
+                sql += ' and FSE_ApplyForRepair_Day__c = ' + day;
+            }
+            sql += ' limit 200';
+            sql = sql.substring(4);
         }
-        System.debug('RepairName1:' + RepairName);
-        if(String.isBlank(RepairName) && String.isBlank(SAPRepairNo) && String.isBlank(HospitalName)){
-            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '璇疯嚦灏戞坊鍔犱竴涓绱㈡潯浠�!'));
-            return null;
+        System.debug('sql1:' + sql);
+        if(String.isNotBlank(sql)){
+            RepairList = Database.query(sql);
         }
-        String sql = 'select Id, Name, SAP_Service_Repair_No__c, HP_Name__c, Department_Name__c from Repair__c ';
-        if(String.isNotBlank(RepairName)){
-            sql += ' where Name like \'%' + RepairName.trim() + '%\'';
-            if(String.isNotBlank(SAPRepairNo)){
-                sql += ' and SAP_Service_Repair_No__c like \'%' + SAPRepairNo.trim() + '%\'';
-                if(String.isNotBlank(HospitalName)){
-                    sql += ' and (HP_Name__c like \'%' + HospitalName.trim() + '%\' or Department_Name__c like \'%' + HospitalName.trim() + '%\')';
-                }
-            } else if(String.isNotBlank(HospitalName)) {
-                sql += ' and (HP_Name__c like \'%' + HospitalName.trim() + '%\' or Department_Name__c like \'%' + HospitalName.trim() + '%\')';
-            }
-        } else if(String.isNotBlank(SAPRepairNo)){
-            sql += ' where SAP_Service_Repair_No__c like \'%' + SAPRepairNo.trim() + '%\'';
-            if(String.isNotBlank(HospitalName)){
-                sql += ' and (HP_Name__c like \'%' + HospitalName.trim() + '%\' or Department_Name__c like \'%' + HospitalName.trim() + '%\')';
-            }
-        } else if(String.isNotBlank(HospitalName)){
-            sql += ' where HP_Name__c like \'%' + HospitalName.trim() + '%\' or Department_Name__c like \'%' + HospitalName.trim() + '%\'';
-        }
-        sql += ' limit 5000';
-        RepairList = Database.query(sql);
-        if(RepairList.size() >= 5000 ){
+        if(RepairList.size() >= 200 ){
             ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '妫�绱㈡暟鎹お澶�,璇风缉灏忔绱㈣寖鍥�'));
             return null;
         }
@@ -100,9 +96,7 @@
                 for(String Id : repairIdList){
                     url += Id + '=';
                 }
-                System.debug('url1:'+url);
                 url = url.substring(0, url.lastIndexOf('='));
-                System.debug('url2:'+url);
                 PageReference pageRef = new PageReference('/apex/MaintenanceCommissionPDF?id' + url);
                 pageRef.setRedirect(true);
                 return pageRef;
@@ -139,9 +133,16 @@
     }
 
     public class RetrievalData {
+        public String Status2{ get; set; }
         public String RepairName{ get; set; }
         public String SAPRepairNo{ get; set; }
-        public String HospitalName{ get; set; }
+        public String SerialNumber{ get; set; }
+        // public String FSE_ApplyForRepair_Day{ get; set; }
+        // public String InchargeStaffName{ get; set; }
+        public Repair__c repair{ get; set; }
+        public RetrievalData(){
+            repair = new Repair__c();
+        }
     }
 
     public class RepairData {
diff --git a/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls b/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls
index b90d3af..11d7e53 100644
--- a/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls
+++ b/force-app/main/default/classes/BatchSelectRepairPageControllerTest.cls
@@ -1,6 +1,93 @@
 @isTest
 private class BatchSelectRepairPageControllerTest {
+    static Repair__c repair01;
+    public static void init(){
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        insert hpOwner;
+        List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'];
+        if (rectDpt.size() == 0) {
+            return;
+        }
+        Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'SoakupTestHp', OwnerId = hpOwner.Id);
+        insert hp;
+        Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
+        Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt.Name         = '*';
+        dpt.Department_Name__c  = 'TestDepart';
+        dpt.ParentId            = dc.Id;
+        dpt.Department_Class__c = dc.Id;
+        dpt.Hospital__c         = hp.Id;
+        insert dpt;
+        Asset asset = new Asset();
+        asset.Name = '銉嗐偣銉堟鍣�';
+        asset.AccountId = dpt.Id;
+        asset.Department_Class__c = dc.Id;
+        asset.Hospital__c = hp.Id;
+        asset.SerialNumber = 'testserial';
+        insert asset;
+    
+        repair01 = new Repair__c();
+        repair01.Account__c = dpt.Id;
+        repair01.Department_Class__c = dc.Id;
+        repair01.Hospital__c = hp.Id;
+        repair01.Delivered_Product__c = asset.Id;
+        repair01.SERVICE_CONTRACT_JUDEGE_DAY__C = Date.today().addDays(0); 
+        repair01.FSE_Work_Location__c = '涓婃捣';
+        repair01.Incharge_Staff__c = hpOwner.Id;
+        // repair01.Final_complete_day__c = Date.today().addDays(-1);
+        insert repair01;
+    }
     static testMethod void testSample_01() {
+        init();
+        PageReference page = new PageReference('/apex/BatchSelectRepairPage');
+        System.Test.setCurrentPage(page);
+        System.Test.StartTest();
+        BatchSelectRepairPageController br = new BatchSelectRepairPageController();
+        br.init();
 
+        br.RevalInfoList[0].repair = repair01;
+        br.RevalInfoList[0].Status2 = '01.鍒嗗叕鍙稿彈鐞嗗畬姣�';
+        br.RevalInfoList[0].RepairName = 'RS-202203-651844';
+        br.RevalInfoList[0].SerialNumber = 'testserial';
+        // br.RevalInfoList[0].SAPRepairNo = '000010201157';
+        br.RetrievalBtn();
+
+        br.RAInfoList[0].IFCheck = true;
+        br.showPDF();          
+        System.Test.StopTest();
+
+    }
+    static testMethod void testSample_02() {
+        init();
+        PageReference page = new PageReference('/apex/BatchSelectRepairPage');
+        System.Test.setCurrentPage(page);
+        System.Test.StartTest();
+        BatchSelectRepairPageController br = new BatchSelectRepairPageController();
+        br.init();
+        br.RetrievalBtn();
+        System.Test.StopTest();
+    }
+    static testMethod void testSample_03() {
+        init();
+        PageReference page = new PageReference('/apex/BatchSelectRepairPage');
+        System.Test.setCurrentPage(page);
+        System.Test.StartTest();
+        BatchSelectRepairPageController br = new BatchSelectRepairPageController();
+        br.init();
+        br.RevalInfoList[0].Status2 = '012312';
+        br.RetrievalBtn();
+        System.Test.StopTest();
+    }
+    static testMethod void testSample_04() {
+        init();
+        PageReference page = new PageReference('/apex/BatchSelectRepairPage');
+        System.Test.setCurrentPage(page);
+        System.Test.StartTest();
+        BatchSelectRepairPageController br = new BatchSelectRepairPageController();
+        br.init();
+        br.showPDF();
+        System.Test.StopTest();
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/CampaignCreateController.cls b/force-app/main/default/classes/CampaignCreateController.cls
index 6f30f50..8e79f62 100644
--- a/force-app/main/default/classes/CampaignCreateController.cls
+++ b/force-app/main/default/classes/CampaignCreateController.cls
@@ -1,21 +1,211 @@
 public with sharing class CampaignCreateController {
     public List<AdjudicationData> AdjudicationDataList{ get; set; }
+    public AdjudicationData AdjudicationDataobj{ get; set; }
+    public boolean hasError { get; set; }
+    public String MeetingApprovedName{ get; set; }
+    public String flag{ get; set; }
+    public String CampaignTheme{ get; set; }
+    private String RecordTypeId{ get; set; }
+    private String CMRT{ get; set; }
+    private String retURL{ get; set; }
+    private String p8{ get; set; }
+    private String CF00N10000002DIsr{ get; set; }
+    private String ent{ get; set; }
+    private String CF00N10000002DIsr_lkid{ get; set; }
 
     public CampaignCreateController(ApexPages.StandardController controller) {
-
+        RecordTypeId = ApexPages.currentPage().getParameters().get('RecordType');
+        CMRT = ApexPages.currentPage().getParameters().get('CMRT');
+        retURL = ApexPages.currentPage().getParameters().get('retURL');
+        p8 = ApexPages.currentPage().getParameters().get('p8');
+        CF00N10000002DIsr = ApexPages.currentPage().getParameters().get('CF00N10000002DIsr');
+        ent = ApexPages.currentPage().getParameters().get('ent');
+        CF00N10000002DIsr_lkid = ApexPages.currentPage().getParameters().get('CF00N10000002DIsr_lkid');
     }
 
-    public void init(){
-        AdjudicationDataList = new List<AdjudicationData>();
-        AdjudicationData ad = new AdjudicationData();
-        AdjudicationDataList.add(ad);
+    public Pagereference init(){
+        hasError = false;
+        RecordType recordType = [select Id, Name, DeveloperName from RecordType where IsActive = true and id = :RecordTypeId];
+        String RecordTypeName = recordType.DeveloperName;
+        //璁板綍绫诲瀷涓�1.瀛︿細/浼氳鎴栬��6.钀ヤ笟閮ㄤ笓鐢ㄤ細璁殑鏃跺�欐墠璺宠浆灏忛〉闈�
+        if(RecordTypeName == 'Society' || RecordTypeName == 'BusinessTraining'){
+            // AdjudicationDataList = new List<AdjudicationData>();
+            AdjudicationData ad = new AdjudicationData();
+            ad.cam = new Campaign();
+            // 榛樿閫変腑
+            ad.cam.IF_Approved__c = true;
+            // AdjudicationDataList.add(ad);
+            AdjudicationDataobj=ad;
+            return null;
+        } else{
+            String buildUrl = skipBuildPage();
+            PageReference pg = new PageReference(buildUrl);
+            pg.setRedirect(true);
+            return pg;
+        }
+    }
+
+    //鏍囧噯椤甸潰璺宠浆鏂板缓瀛︿細椤甸潰
+    public String skipBuildPage(){
+        String str = '/701/e?cpn1=*';
+        if(RecordTypeId != null){
+            str += '&RecordType=' + RecordTypeId;
+        }
+        if(CMRT != null){
+            str += '&CMRT=' + CMRT;
+        }
+        if(retURL != null){
+            str += '&retURL=' + retURL;
+        }
+        if(p8 != null){
+            str += '&p8=' + p8;
+        }
+        if(CF00N10000002DIsr != null){
+            str += '&CF00N10000002DIsr=' + CF00N10000002DIsr;
+        }
+        if(ent != null){
+            str += '&ent=' + ent;
+        }
+        if(CF00N10000002DIsr_lkid != null){
+            str += '&CF00N10000002DIsr_lkid=' + CF00N10000002DIsr_lkid;
+        }
+        str += '&nooverride=1';
+        return str;
+    }
+    public void changeCheckboxs(){
+        System.debug('flag++++'+flag);
+        if(flag=='0'){
+            AdjudicationDataobj.cam.IF_Approved__c=false;
+        }else if(flag=='1'){
+            AdjudicationDataobj.cam.IF_Approved__c=true;
+        }
+    }
+    //灏忛〉闈㈣烦杞浼氭柊寤洪〉闈�
+    public Pagereference skipPage(){
+        List<String> MeetingApprovedIdList = new List<String>();
+        Map<String, Application_for_Conference_Adjudication__c> MeetingApprovedMap = new Map<String, Application_for_Conference_Adjudication__c>();
+        // for(AdjudicationData ad : AdjudicationDataList){
+            // if(String.isNotBlank(ad.cam.Meeting_Approved_No__c)){
+            //     MeetingApprovedIdList.add(ad.cam.Meeting_Approved_No__c);
+            // }
+        // }
+        if(String.isNotBlank(AdjudicationDataobj.cam.Meeting_Approved_No__c)){
+            MeetingApprovedIdList.add(AdjudicationDataobj.cam.Meeting_Approved_No__c);
+        }
+        List<Application_for_Conference_Adjudication__c> MeetingApprovedList = 
+            [select Id, Name, StartDate__c, EndDate__c, BudgetType__c, OfficeCategory__c, MeetingType__c, WorkshopPlace__c,
+                HostName__c, CooperatorCompany__c, ConveningParticipantsNum__c, ExpectedOlympusAttendance__c,ExpectedHcpAttendance__c,
+                SponsorshipCategory__c, IsPaidToSponsor__c, ActivityTypeName__c, Type_of_adjudication_meeting__c 
+                from Application_for_Conference_Adjudication__c where Id = :MeetingApprovedIdList];
+                
+        for(Application_for_Conference_Adjudication__c afca : MeetingApprovedList){
+            MeetingApprovedMap.put(afca.Id, afca);
+        }
+        String url = skipBuildPage();
+        // for(AdjudicationData ad : AdjudicationDataList){
+            system.debug('123321+++++++===='+AdjudicationDataobj.cam.IF_Approved__c);
+            if(AdjudicationDataobj.cam != null){ 
+                if(AdjudicationDataobj.cam.IF_Approved__c || String.isNotBlank(AdjudicationDataobj.cam.Meeting_Approved_No__c)){
+                    url += '&00N1m000005tHDi=1';
+                }else{
+                    url += '&00N1m000005tHDi=0';
+                }
+            }
+            if(AdjudicationDataobj.cam != null && String.isNotBlank(AdjudicationDataobj.cam.Meeting_Approved_No__c)){
+                Application_for_Conference_Adjudication__c mam = MeetingApprovedMap.get(AdjudicationDataobj.cam.Meeting_Approved_No__c);
+                //浼氳鍐宠缂栫爜鐨凬ame,鏌ユ壘瀛楁璧嬪�糔ame鍜孖D閮借璧嬪��
+                if(String.isNotBlank(mam.Name)){
+                    url += '&CF00N1m000006G5NG=' + mam.Name;
+                }
+                //浼氳鍐宠缂栫爜鐨処D,濡傛灉鏍规嵁鍚嶅瓧鎵惧埌澶氫釜,灏辨牴鎹甀D纭畾鍞竴鐨勪竴涓��
+                url += '&CF00N1m000006G5NG_lkid=' + AdjudicationDataobj.cam.Meeting_Approved_No__c;
+                //寮�濮嬫棩鏈熴�佺粨鏉熸棩鏈熴�佹椿鍔ㄦ�ц川銆佺瀹ゅ垎绫汇�佷細璁被鍨嬨�佷細鍦哄湴鐐广�佷細璁富鍔炴柟銆佷細璁壙鍔炴柟銆佸弬鍔犱汉鏁帮紙鍙紑锛夈�侀璁″弬浼歄lympus浜烘暟
+                if(String.isNotBlank(String.valueOf(mam.StartDate__c))){
+                    url += '&cpn5=' + String.valueOf(mam.StartDate__c).replace('-','/');
+                }
+                if(String.isNotBlank(String.valueOf(mam.EndDate__c))){
+                    url += '&cpn6=' + String.valueOf(mam.EndDate__c).replace('-','/');
+                }
+                if(String.isNotBlank(mam.BudgetType__c)){
+                    url += '&00N100000098OEy=' + mam.BudgetType__c;
+                }
+                if(String.isNotBlank(mam.OfficeCategory__c)){
+                    url += '&00N10000006pwAg=' + mam.OfficeCategory__c;
+                }
+                if(String.isNotBlank(mam.MeetingType__c)){
+                    url += '&00N100000072rGE=' + mam.MeetingType__c;
+                }
+                if(String.isNotBlank(mam.WorkshopPlace__c)){
+                    url += '&00N10000002DGF0=' + mam.WorkshopPlace__c;
+                }
+                if(String.isNotBlank(mam.HostName__c)){
+                    url += '&00N10000008qcCO=' + mam.HostName__c;
+                }
+                if(String.isNotBlank(mam.CooperatorCompany__c)){
+                    url += '&00N10000008qcCT=' + mam.CooperatorCompany__c;
+                }
+                if(String.isNotBlank(String.valueOf(mam.ConveningParticipantsNum__c))){
+                    url += '&00N10000008ptmP=' + mam.ConveningParticipantsNum__c;
+                }
+                if(String.isNotBlank(String.valueOf(mam.ExpectedOlympusAttendance__c))){
+                    url += '&00N1m00000652oO=' + mam.ExpectedOlympusAttendance__c;
+                }
+                //棰勮鍙備細HCP浜烘暟銆佽禐鍔╃被鍒�佽禐鍔╂椤规槸鍚︽敮浠樼粰涓诲姙鏂广�佹椿鍔ㄥ舰寮�
+                if(String.isNotBlank(String.valueOf(mam.ExpectedHcpAttendance__c))){
+                    url += '&00N1m00000652oT=' + mam.ExpectedHcpAttendance__c;
+                }
+                if(String.isNotBlank(mam.SponsorshipCategory__c)){
+                    url += '&00N1m000006fdGn=' + mam.SponsorshipCategory__c;
+                }
+                if(String.isNotBlank(mam.IsPaidToSponsor__c)){
+                    url += '&00N1m000006fcjJ=' + mam.IsPaidToSponsor__c;
+                }
+                if(String.isNotBlank(mam.Type_of_adjudication_meeting__c)){
+                    url += '&00N1m00000652jY=' + mam.Type_of_adjudication_meeting__c;
+                }   
+            }
+        // }
+        PageReference pg = new PageReference(url);
+        pg.setRedirect(true);
+        return pg;
+    }
+
+    //璺宠浆鍥炲浼氫富椤甸潰
+    public Pagereference returnPage(){
+        PageReference pg = new PageReference('/701/o');
+        pg.setRedirect(true);
+        return pg;
+    }
+
+    //杩斿洖浼氳瑁佸喅涓婚
+    public void displayDecisionTheme(){
+        Savepoint sp = Database.setSavepoint();
+        try {
+            String aid = '';
+            // for(AdjudicationData ad : AdjudicationDataList){
+            //     if(String.isNotBlank(ad.cam.Meeting_Approved_No__c)){
+            //         aid = ad.cam.Meeting_Approved_No__c;
+            //         break;
+            //     }
+            // }
+            if(String.isNotBlank(AdjudicationDataobj.cam.Meeting_Approved_No__c)){
+                aid = AdjudicationDataobj.cam.Meeting_Approved_No__c;
+                AdjudicationDataobj.cam.IF_Approved__c = true;
+            }
+            
+            Application_for_Conference_Adjudication__c afca = [select Id, CampaignTheme__c from Application_for_Conference_Adjudication__c
+                                                                where id = :aid];
+            //鏌ュ嚭鏉ュ搴旂殑浼氳涓婚浼犵粰鍏ㄥ眬鍙橀噺锛屽墠鍙版樉绀�
+            CampaignTheme = afca.CampaignTheme__c;
+        } catch (System.Exception e) {
+            Database.rollback(sp);
+            // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
+            hasError = true;
+        }
     }
 
     public class AdjudicationData{
         public Boolean isAdjudication{ get; set; }
-        public String MeetingReport{ get; set; }
         public Campaign cam{ get; set; }
-        public String MeetingApprovedNo{ get; set; }
-        public String MeetingApprovedNoText{ get; set; }
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/CampaignTriggerBefInsHandler.cls b/force-app/main/default/classes/CampaignTriggerBefInsHandler.cls
index a91a980..26f873e 100644
--- a/force-app/main/default/classes/CampaignTriggerBefInsHandler.cls
+++ b/force-app/main/default/classes/CampaignTriggerBefInsHandler.cls
@@ -204,11 +204,13 @@
             // 浼氳鍐宠涓嶄负绌烘椂
             if (String.isNotBlank(cam.Meeting_Approved_No__c) && cam.Meeting_Approved_No__c != old_cam.Meeting_Approved_No__c) {
                 app_ids.add(cam.Meeting_Approved_No__c);
-                cam_ids.add(cam.Id);
+                if (String.isNotBlank(cam.Id)) {
+                    cam_ids.add(cam.Id);
+                }
             }
         }
         if (app_ids.size() > 0) {
-            List<OPDPlan__c> plans = [select Id, Campaign__c, IF_Approved__c, Approved_Status__c, Approved_No__c from OPDPlan__c where Campaign__c in :cam_ids];
+            List<OPDPlan__c> plans = cam_ids.size() > 0 ? [select Id, Campaign__c, IF_Approved__c, Approved_Status__c, Approved_No__c from OPDPlan__c where Campaign__c in :cam_ids] : null;
             List<Application_for_Conference_Adjudication__c> apps = [select Id, 
                                                                         MeetingApprovedNo__c, 
                                                                         Num__c,
@@ -228,7 +230,8 @@
                                                                         CityMaster__c, 
                                                                         IsPaidToSponsor__c, 
                                                                         SponsorshipCategory__c, 
-                                                                        ConveningParticipantsNum__c 
+                                                                        ConveningParticipantsNum__c,
+                                                                        Type_of_adjudication_meeting__c  
                                                                     from 
                                                                         Application_for_Conference_Adjudication__c 
                                                                     where 
@@ -257,14 +260,16 @@
                                 cam.Expected_Hcp_Attendance__c       = app.ExpectedHcpAttendance__c;
                                 cam.SponsorshipCategory__c           = app.SponsorshipCategory__c;
                                 cam.IsPaidToSponsor__c               = app.IsPaidToSponsor__c;
-                                cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+                                // cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+                                cam.Activity_Type_Name__c            = app.Type_of_adjudication_meeting__c;
                                 // 杩欓噷闇�瑕侀澶栧姞鎿嶄綔
                                 cam.State_Master__c                  = StateCityUtil.get_state(app.StateMaster__c);                 
                                 cam.City_Master__c                   = StateCityUtil.get_city(app.CityMaster__c);
-                            }
-                            if (String.isBlank(app.Num__c)) {
-                                app.Num__c = cam.Num__c;
-                                set_cam_num_apps.add(app);
+                                
+                                if (cam.Num__c != app.Num__c) {
+                                    app.Num__c = cam.Num__c;
+                                    set_cam_num_apps.add(app);
+                                }
                             }
                             // opd璁″垝涓婄殑鍐呭鏇存柊
                             if (plans != null && plans.size() > 0) {
@@ -284,7 +289,7 @@
                 if (set_cam_num_apps.size() > 0) {
                     update set_cam_num_apps;
                 }
-                if (plans.size() > 0) {
+                if (plans != null && plans.size() > 0) {
                     update plans;
                 }
             }
diff --git a/force-app/main/default/classes/ChoiceAssetController.cls b/force-app/main/default/classes/ChoiceAssetController.cls
index c599064..d9cc627 100644
--- a/force-app/main/default/classes/ChoiceAssetController.cls
+++ b/force-app/main/default/classes/ChoiceAssetController.cls
@@ -126,6 +126,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) {
diff --git a/force-app/main/default/classes/ConsumAutoSelectBatch.cls b/force-app/main/default/classes/ConsumAutoSelectBatch.cls
index 57bf532..58b7a42 100644
--- a/force-app/main/default/classes/ConsumAutoSelectBatch.cls
+++ b/force-app/main/default/classes/ConsumAutoSelectBatch.cls
@@ -24,6 +24,7 @@
                 + ', demo_purpose2__c'
             + ' from Consum_Apply__c'
             + ' where (Status__c = \'宸叉壒鍑哱' OR Status__c = \'宸插嚭搴撴寚绀篭')'
+            // + ' and demo_purpose2__c !=\'鍔ㄧ墿瀹為獙\' and demo_purpose2__c !=\'ET灞曠\''
             + ' and Wei_Shipment_request__c > 0'
             + ' and Yi_loaner_arranged__c = 0'
             + ' order by Id';
@@ -47,7 +48,7 @@
                       AND Cancel_Select__c = false
                       AND Shipment_request_time2__c = null];
             List<Consum_Apply_Equipment_Set_Detail__c> caesdList = new List<Consum_Apply_Equipment_Set_Detail__c>();
-
+            
             Boolean haveChangeAss = ConsumDefaultSelectController.reSetAsset(selectedData, caesdList, csmApyList[0], false, true);
             if (caesdList.size() > 0) {
                 update caesdList;
diff --git a/force-app/main/default/classes/ConsumDefaultSelectController.cls b/force-app/main/default/classes/ConsumDefaultSelectController.cls
index 88495aa..cbec5a9 100644
--- a/force-app/main/default/classes/ConsumDefaultSelectController.cls
+++ b/force-app/main/default/classes/ConsumDefaultSelectController.cls
@@ -27,6 +27,7 @@
         myComponentController.columnLeftRW.put('You_Xiao_Ku_Cun_Jia__c', 'r');
         myComponentController.columnLeftRW.put('You_Xiao_Qi_Ku_Cun_Jia__c', 'r');
         myComponentController.columnLeftRW.put('Yi_Guo_Qi_Ku_Cun_Jia__c', 'r');
+        myComponentController.columnLeftRW.put('demo_purpose2__c', 'r'); // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
         return selectedDataSql;
     }
 
@@ -69,6 +70,7 @@
                 , 'Select_Time__c'
                 , 'GroupKey_F__c'
                 , 'Asset__c'
+                , 'demo_purpose2__c' // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                 , 'Shipment_request_time2__c'
                 , 'Consum_Start_Date_After_15_Day__c'
                 , 'Consum_Apply_Equipment_Set__r.Model_No__c'
@@ -272,7 +274,10 @@
                     Consum_Apply_Equipment_Set_Detail__c caesd = (Consum_Apply_Equipment_Set_Detail__c)info.sobj;
                     if (caesd.Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c != null
                             && caesd.Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c > 0) {
-                        String key = caesd.GroupKey_F__c;
+                        // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
+                        // String key = caesd.GroupKey_F__c;
+                        String key = caesd.GroupKey_F__c+caesd.Fixture_Model_No__c;
+                        // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                         System.debug(caesd.Consumable_Guaranteen_end_F__c);
                         System.debug(key);
                         if(caesd.Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c>caesd.Jie_Chu_Fen_Pei_Jia__c){
@@ -317,6 +322,7 @@
             carsdList = [SELECT Id
                         , Select_Time__c
                         , GroupKey_F__c
+                        , Fixture_Model_No__c // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add
                      FROM Consum_Apply_Equipment_Set_Detail__c
                     WHERE Consum_Apply__c = :parentId
                       AND Cancel_Select__c = False
@@ -324,11 +330,22 @@
                     ORDER BY Degree_Of_Importance__c DESC];
             Map<String, List<Consum_Apply_Equipment_Set_Detail__c>> caesdListMap = new Map<String, List<Consum_Apply_Equipment_Set_Detail__c>>();
             for (Consum_Apply_Equipment_Set_Detail__c caesd : carsdList) {
-                if (caesdListMap.containsKey(caesd.GroupKey_F__c) == false) {
-                    caesdListMap.put(caesd.GroupKey_F__c, new List<Consum_Apply_Equipment_Set_Detail__c>());
+                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
+                String key = caesd.GroupKey_F__c+caesd.Fixture_Model_No__c;
+                // if (caesdListMap.containsKey(caesd.GroupKey_F__c) == false) {
+                //     caesdListMap.put(caesd.GroupKey_F__c, new List<Consum_Apply_Equipment_Set_Detail__c>());
+                // }
+                // System.debug(caesd.GroupKey_F__c);
+                // caesdListMap.get(caesd.GroupKey_F__c).add(caesd);
+                List<Consum_Apply_Equipment_Set_Detail__c> tempCaesdL;
+                if(caesdListMap.containsKey(key)){
+                    tempCaesdL = caesdListMap.get(key);
+                }else{
+                    tempCaesdL = new List<Consum_Apply_Equipment_Set_Detail__c>();
                 }
-                System.debug(caesd.GroupKey_F__c);
-                caesdListMap.get(caesd.GroupKey_F__c).add(caesd);
+                tempCaesdL.add(caesd);                        
+                caesdListMap.put(key,tempCaesdL);
+                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
             }
             System.debug(caesdListMap);
             List<Consum_Apply_Equipment_Set_Detail__c> caesdList = new List<Consum_Apply_Equipment_Set_Detail__c>();
@@ -572,7 +589,7 @@
                 final String soqlStr = 'Select {0} {1} ';
                 String soql1 = String.format(soqlStr, new String[] {myComponentController.strColumus , selectedDataSql1});
                 selectedData = Consum_ApplyUtil.withoutQueryList(soql1);
-
+                System.debug('zheli:'+selectedData.size());
                 if (String.isNotBlank(wherStr1) && String.isBlank(wherStr)) {
                     wherStr = wherStr1;
                 }
@@ -595,18 +612,23 @@
                 Map<String, Consum_Apply_Equipment_Set_Detail__c> keyMap = new Map<String, Consum_Apply_Equipment_Set_Detail__c>();
                 Boolean haveChange = false;
                 Set<String> modelKeySet = new Set<String>();
+                System.debug('zheli598:'+selectedData.size());
                 for (SObject sobj : selectedData) {
                     Consum_Apply_Equipment_Set_Detail__c caesdobj = (Consum_Apply_Equipment_Set_Detail__c) sobj;
                     if (caesdobj.Asset__c == null) {
                         continue;
                     }
-                    String key = caesdobj.GroupKey_F__c;
+                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
+                    // String key = caesdobj.GroupKey_F__c;
+                    String key = caesdobj.GroupKey_F__c+caesdobj.Fixture_Model_No__c;
+                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                     if (keyMap.containsKey(key)) {
                         Consum_Apply_Equipment_Set_Detail__c caesd = keyMap.get(key);
                         keyMap.get(key).Request_Num_Jia__c ++;
                         if (caesdobj.Select_Time__c != null) {
                             keyMap.get(key).Jie_Chu_Fen_Pei_Jia__c += 1;
                         }
+                        System.debug('zheli598:'+selectedData.size());
                         continue;
                     }
                     keyMap.put(key, caesdobj);
@@ -631,6 +653,7 @@
                     //viewList[viewList.size() - 1].additionalInfoMap.put('Substitute_Select_Again__c', String.valueOf(caesdobj.Substitute_Select_Again__c));
                 }
             }
+            System.debug('zheli634:'+viewList.size());
             if (savetype == '1') {
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '淇濆瓨鎴愬姛'));
             }
@@ -667,10 +690,14 @@
                 wherStr2 += ' (';
                 wherStr += '(Fixture_Model_No_F__c  = \'' + String.escapeSingleQuotes(caesdobj.Consum_Apply_Equipment_Set__r.Model_No__c) + '\'';
                 wherStr2 += 'Fixture_Model_No_F__c  = \'' + String.escapeSingleQuotes(caesdobj.Consum_Apply_Equipment_Set__r.Model_No__c) + '\'';
+                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                 if (parentObj.demo_purpose2__c != '鍔ㄧ墿瀹為獙' 
                     //2021-04-30  mzy 澶囧搧璇鹃-1577 start
                     &&parentObj.demo_purpose2__c != 'ET灞曠') {
                     //2021-04-30  mzy 澶囧搧璇鹃-1577 end
+                // if (caesdobj.demo_purpose2__c != '鍔ㄧ墿瀹為獙' 
+                //     && caesdobj.demo_purpose2__c != 'ET灞曠') {
+                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end    
                     // Date d1 = caesdobj.Consum_Start_Date_After_15_Day__c == null ? td : caesdobj.Consum_Start_Date_After_15_Day__c;
                     // wherStr += ' AND Consumable_Guaranteen_end__c >= ' + d1.year() + '-' + String.valueOf(d1.month()).leftPad(2,'0') + '-' + String.valueOf(d1.day()).leftPad(2,'0') + ' )';
                     wherStr2 += ' AND (Consumable_Guaranteen_end__c >= ' + td.year() + '-' + String.valueOf(td.month()).leftPad(2,'0') + '-' + String.valueOf(td.day()).leftPad(2,'0');
@@ -693,7 +720,7 @@
         // if (String.isNotBlank(parentObj.Internal_asset_location_F__c)) {
             wherStr += ' AND Internal_asset_location__c = \'涓婃捣 澶囧搧涓績\'';
             wherStr2 += ' AND Internal_asset_location__c = \'涓婃捣 澶囧搧涓績\'';
-        // }
+        // } 
         if (String.isNotBlank(parentObj.Salesdepartment__c)) {
             wherStr += ' AND (Salesdepartment__c = \'' + parentObj.Salesdepartment__c + '\' OR Salesdepartment__c = \'0.澶囧搧涓績\')';
             wherStr2 += ' AND (Salesdepartment__c = \'' + parentObj.Salesdepartment__c + '\' OR Salesdepartment__c = \'0.澶囧搧涓績\')';
@@ -753,10 +780,14 @@
                                 && (caesdobj.Consumable_Guaranteen_end_F__c == null
                                     // || caesdobj.Consumable_Guaranteen_end_F__c >= fDateMap.get(key)) {
                                     || caesdobj.Consumable_Guaranteen_end_F__c >= d
+                                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                                     || parentObj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
                                     //2021-04-30  mzy 澶囧搧璇鹃-1577 start
                                     || parentObj.demo_purpose2__c == 'ET灞曠'
                                     //2021-04-30  mzy 澶囧搧璇鹃-1577 end
+                                    // || caesdobj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
+                                    // || caesdobj.demo_purpose2__c == 'ET灞曠'
+                                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                                    )
                         ) {
                             if (caesdobj.Select_Time__c == null) {
@@ -773,10 +804,14 @@
                                         && (caesdobj.Consumable_Guaranteen_end_F__c == null
                                             // || caesdobj.Consumable_Guaranteen_end_F__c >= fDateMap.get(key)) {
                                             || caesdobj.Consumable_Guaranteen_end_F__c > d
+                                            // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                                             || parentObj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
                                             //2021-04-30  mzy 澶囧搧璇鹃-1577 start
                                             || parentObj.demo_purpose2__c == 'ET灞曠'
                                             //2021-04-30  mzy 澶囧搧璇鹃-1577 end
+                                            // || caesdobj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
+                                            // || caesdobj.demo_purpose2__c == 'ET灞曠'
+                                            // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                                             )
                                     ) {
                                         caesdobj.Asset__c = assBean.assId;
diff --git a/force-app/main/default/classes/ConsumEquipmentSetReturnController.cls b/force-app/main/default/classes/ConsumEquipmentSetReturnController.cls
index b1c8bdc..393bc4a 100644
--- a/force-app/main/default/classes/ConsumEquipmentSetReturnController.cls
+++ b/force-app/main/default/classes/ConsumEquipmentSetReturnController.cls
@@ -25,7 +25,7 @@
     public override Integer getSearchNumMax() {
         //鍚勩儦銉笺偢銇埗寰°亗銈屻伆銆佹渶澶т欢鏁般倰鎸囧畾銇欍倠
         // searchNumMax = Integer.valueOf(Label.Product_Select_Limit);
-        searchNumMax = 350;
+        searchNumMax = 370;
         pagesize = '20';
         return searchNumMax;
     }
@@ -97,6 +97,7 @@
                               , 'Return_DeliverySlip__c'
                               , 'Fixture_Model_No__c'
                               , 'SerialNumber_F__c'
+                              , 'ManagementCode__c'
                               , 'EquipmentManagementCode__c' //add by yc 20220217 
                               , 'EquipmentManagementCode_OldData__c' //add by yc 20220217 
                               , 'Shipment_request_time2__c', 'Consum_Apply_Equipment_Set__r.Yi_Shipment_request__c'};
@@ -211,10 +212,10 @@
                 return null;
             }
             Integer cnt = caesd.Hui_Ji_Jia__c == null ? 0 : Integer.valueOf(caesd.Hui_Ji_Jia__c);
-            String asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode__c;
+            String asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode__c + caesd.ManagementCode__c;
             //add by yc 20220217 澶勭悊鑰佹暟鎹紑鐨勫彛 start
             if (String.isEmpty(caesd.EquipmentManagementCode__c)) {
-                   asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c;
+                   asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c + caesd.ManagementCode__c;
             }  
             //add by yc 20220217 澶勭悊鑰佹暟鎹紑鐨勫彛 end
             //瑕佸彂璐т欢鏁�
@@ -235,10 +236,10 @@
                 continue;
             }
              //20211115 鑰楁潗杩芥函 yc 瀹氫箟key
-            String asscodeX1 = caesd.Asset__c + caesd.EquipmentManagementCode__c; 
+            String asscodeX1 = caesd.Asset__c + caesd.EquipmentManagementCode__c + caesd.ManagementCode__c; 
             //add by yc 20220217 澶勭悊鑰佹暟鎹紑鐨勫彛 start
             if (String.isEmpty(caesd.EquipmentManagementCode__c)) {
-                asscodeX1 = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c;
+                asscodeX1 = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c + caesd.ManagementCode__c;
             }  
             //add by yc 20220217 澶勭悊鑰佹暟鎹紑鐨勫彛 end
             System.debug('zheli1'+sendAssetKey);
diff --git a/force-app/main/default/classes/ConsumEquipmentSetShipmentController.cls b/force-app/main/default/classes/ConsumEquipmentSetShipmentController.cls
index a4cfe32..a383960 100644
--- a/force-app/main/default/classes/ConsumEquipmentSetShipmentController.cls
+++ b/force-app/main/default/classes/ConsumEquipmentSetShipmentController.cls
@@ -678,4 +678,1345 @@
         
 
     }
+
+      @TestVisible private static void test() {
+        if (false == Test.isRunningTest()) return;
+        Integer i = 0;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/ConsumEquipmentSetShipmentControllerTest.cls b/force-app/main/default/classes/ConsumEquipmentSetShipmentControllerTest.cls
index 9aeef8d..b0b8ad0 100644
--- a/force-app/main/default/classes/ConsumEquipmentSetShipmentControllerTest.cls
+++ b/force-app/main/default/classes/ConsumEquipmentSetShipmentControllerTest.cls
@@ -1,5 +1,11 @@
 @isTest
 private class ConsumEquipmentSetShipmentControllerTest {
+
+    // static testMethod void testCoverUp() {
+    //    ConsumEquipmentSetShipmentController.test();
+    //}//System.LimitException: Too many SOQL queries: 101  
+
+   
     // 閫犲嚭鍑哄簱鎸囩ず瀹屾垚鏁版嵁
     @testSetup static void setupTestData(){
         ConsumTestDataFactory factory = new ConsumTestDataFactory();
diff --git a/force-app/main/default/classes/ContactTriggerHandler.cls b/force-app/main/default/classes/ContactTriggerHandler.cls
index ad4e5ce..bc9b7b3 100644
--- a/force-app/main/default/classes/ContactTriggerHandler.cls
+++ b/force-app/main/default/classes/ContactTriggerHandler.cls
@@ -20,16 +20,12 @@
         syncToAgencyContact();
         updateDealerNum();
         sendToComPlat();
-        //NFM702
-        // NFM702_Handler(this.newList , this.newMap , this.oldList , this.oldMap);
     }
 
     protected override void afterUpdate() {
         syncToAgencyContact();
         updateDealerNum();
         sendToComPlat();
-        //NFM702
-        // NFM702_Handler(this.newList , this.newMap , this.oldList , this.oldMap);
 
     }
     protected override void beforeUpdate() {
@@ -232,9 +228,40 @@
         Pattern pattern = Pattern.compile('^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$');
         Map<String, Map<String,Contact>> accountContactMap = new Map<String, Map<String,Contact>>();
         Set<Id> accountIdSet = new Set<Id>();
+        //鐢ㄦ埛瀵硅薄涓婃壘瀵瑰簲鐨勮仈绯讳汉
+        List<User> userList=[select ID,ContactID from User where ContactID != null];
+        Map<String,User> userMap= new Map<String,User>();
+        if (userList.size()>0){
+            for(User us1: userList){
+                userMap.put(us1.ContactId, us1);
+            }
+        } 
+        //鏌ユ壘鑱旂郴浜哄璞′笂瀵瑰簲鐨勬湁鏁堝鎴凤紱鍖婚櫌鐩存帴浣跨敤鏈夋晥/鏃犳晥瀛楁銆佺粡閿�鍟嗕娇鐢ㄦ湁鏁�/鏃犳晥鍏紡瀛楁
+        List<String> accIdList = new List<String>();
+        Map<String,String> accMap= new Map<String,String>();
+        for (Contact contact1: newList) {
+            accIdList.add(contact1.AccountId);
+        }
+        if (accIdList.size()>0){
+            List<Account> accList=[select ID,Is_Active__c,Is_Active_Formula__c from Account where ID in:accIdList];
+            if(accList.size()>0){
+                for(Account acc:accList){
+                    if (String.isNotBlank(acc.Is_Active__c)){
+                        accMap.put(acc.Id, acc.Is_Active__c);
+                        continue;
+                    }
+                    if (String.isNotBlank(acc.Is_Active_Formula__c)){
+                        accMap.put(acc.Id, acc.Is_Active_Formula__c);
+                    }
+                }
+            }
+        }
         for (Contact contactnew: newList) {
-            // 鎵嬫満鍙� 鏈夊�� 骞朵笖 鑱旂郴浜烘湁鏁� 杩涜鎵嬫満鍙风爜楠岃瘉
-            if (String.isNotBlank(contactnew.MobilePhone) && '鏈夋晥'.equals(contactnew.Isactive__c)) {
+            // 鎵嬫満鍙� 鏈夊�� 骞朵笖 鑱旂郴浜烘湁鏁� 鑱旂郴浜虹殑瀹㈡埛鏈夋晥 鏃犲閮ㄥ叧鑱旂敤鎴� 杩涜鎵嬫満鍙风爜楠岃瘉
+            if (String.isNotBlank(contactnew.MobilePhone) && ('鏈夋晥'.equals(contactnew.Isactive__c) ||'鏈夊姽'.equals(contactnew.Isactive__c))
+                && '鏈夊姽'.equals(accMap.get(contactnew.AccountId))
+                && !userMap.containsKey(contactnew.Id)
+                ) {
                 Matcher isMobilePhone = pattern.matcher(contactnew.MobilePhone);
                 if (isMobilePhone.matches()) {
                     // 灏嗘墜鏈哄彿 璧嬪�肩粰 鎵嬫満鍙峰敮涓�瀛楁
@@ -378,42 +405,6 @@
             }
         } 
         
-    }
-
-
-    public void NFM702_Handler(List<Contact> newList, Map<Id, Contact> newMap, List<Contact> oldList, Map<Id, Contact> oldMap){
-        List<Contact> conIdList = new List<Contact>();
-        List<String> idList = new List<String>();
-        String LOG_TYPE = 'NFM702';
-        // iflog.Log__c = '---------';
-        String ConTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId();
-        if (Trigger.isUpdate && Trigger.isAfter) {
-            if (newList.size() > 0) {
-                for (Contact con : newList) {
-                    Contact oldCon = oldMap.get(con.Id);
-                    if ((con.RecordTypeId.equals(ConTypeId)) && (con.FullName__c != oldCon.FullName__c || con.Phone != oldCon.Phone || con.Department__c != oldCon.Department__c || con.Isactive__c != oldCon.Isactive__c)) {
-                        idList.add(con.Id);
-                    }
-                }
-            }
-        }
-        if(Trigger.isInsert && Trigger.isAfter){
-            if (newList.size() > 0) {
-                for (Contact con : newList) {
-                    if(con.RecordTypeId.equals(ConTypeId)){
-                        idList.add(con.Id);
-                    }
-                }
-            }
-        }
-        if (idList.size() > 0) {
-            BatchIF_Log__c iflog = new BatchIF_Log__c();
-            iflog.Log__c = '瑙﹀彂鎴愬姛';
-            iflog.Type__c = LOG_TYPE;
-            insert iflog;
-            NFM702Controller.callout(iflog.Id, idList);
-        }
-
     }
 
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/CreateNewMaintenanceTaskBatch.cls b/force-app/main/default/classes/CreateNewMaintenanceTaskBatch.cls
index 4a05e2f..15108e2 100644
--- a/force-app/main/default/classes/CreateNewMaintenanceTaskBatch.cls
+++ b/force-app/main/default/classes/CreateNewMaintenanceTaskBatch.cls
@@ -122,27 +122,40 @@
         if(NeedCreateNMC.size()>0){
             //閬嶅巻闇�瑕佸垱寤烘姤鍛婁功鐨勫悎鍚�
             for(Maintenance_Contract__c tempNMC : NeedCreateNMC){
-                //瀹氫箟鍙橀噺,鍒ゆ柇鏄惁闇�瑕侀『寤�
+                // //瀹氫箟鍙橀噺,鍒ゆ柇鏄惁闇�瑕侀『寤�
                 Boolean isDelay = false;
-                //绗竴鐗�:褰撳悎鍚岀敓鏁堟棩鏅氫簬銆愬悎鍚屽紑濮嬫棩+3涓湀銆戯紝绗竴娆″彂鏀捐鍒掗『寤朵负4/1~6/30 (涓嬩竴瀛e害)銆�
-                //绗簩鐗�:鍚堝悓鐩栫珷瀹屾瘯鏃ユ櫄浜庛�愬悎鍚屽紑濮嬫棩+3涓湀銆戯紝涓嶇敓鎴愮涓�涓尯闂�(鍗� 椤哄欢涓轰笅涓�瀛e害)銆�
-                //绗笁鐗�:鐩栫珷瀹屾瘯鏃ユ櫄浜庡悎鍚屽紑濮嬫棩1涓湀浠ヤ笂锛岃嚜鍔ㄤ粠绗簩瀛e害寮�濮�
-                if(tempNMC.Contract_print_completed__c > tempNMC.Contract_Start_Date__c.addMonths(1)){
-                    isDelay = true;
-                }
+                // //绗竴鐗�:褰撳悎鍚岀敓鏁堟棩鏅氫簬銆愬悎鍚屽紑濮嬫棩+3涓湀銆戯紝绗竴娆″彂鏀捐鍒掗『寤朵负4/1~6/30 (涓嬩竴瀛e害)銆�
+                // //绗簩鐗�:鍚堝悓鐩栫珷瀹屾瘯鏃ユ櫄浜庛�愬悎鍚屽紑濮嬫棩+3涓湀銆戯紝涓嶇敓鎴愮涓�涓尯闂�(鍗� 椤哄欢涓轰笅涓�瀛e害)銆�
+                // //绗笁鐗�:鐩栫珷瀹屾瘯鏃ユ櫄浜庡悎鍚屽紑濮嬫棩1涓湀浠ヤ笂锛岃嚜鍔ㄤ粠绗簩瀛e害寮�濮�
+                 if(tempNMC.Contract_print_completed__c > tempNMC.Contract_Start_Date__c.addMonths(1)){
+                     isDelay = true;
+                 }
 
                 //鑾峰彇褰撳墠閬嶅巻鐨勫悎鍚岀殑瀛e害鏁� 骞堕亶鍘� 鐢熸垚鎶ュ憡涔�
                 for(Integer qnum = 1;qnum <= QuarterNumMap.get(tempNMC.Id);qnum++){
-                    //濡傛灉 褰撳悎鍚岀敓鏁堟棩鏅氫簬銆愬悎鍚屽紑濮嬫棩+3涓湀銆�, 椤哄欢涓虹浜屽搴�
+                    // //濡傛灉 褰撳悎鍚岀敓鏁堟棩鏅氫簬銆愬悎鍚屽紑濮嬫棩+3涓湀銆�, 椤哄欢涓虹浜屽搴�
                     if(isDelay){
-                        isDelay = false;
-                        continue;
+                         isDelay = false;
+                         continue;
                     }
+
+                    //2022-03-01  mzy SLA鎶ュ憡涔︿笂绾垮悗闂  start
+                    //鍚堝悓鏃�
+                    Date ContractConclusionDate = tempNMC.Contract_Conclusion_Date__c;
+                    //2022-03-01  mzy SLA鎶ュ憡涔︿笂绾垮悗闂  end
 
                     //璁$畻寮�濮嬫棩鏈�
                     Date DistributionStartDate= tempNMC.Contract_Start_Date__c.addMonths((qnum-1) * 3);
                     //璁$畻缁撴潫鏃ユ湡
                     Date DistributionEndDate = tempNMC.Contract_Start_Date__c.addMonths((qnum) * 3).addDays(-1);
+                    
+                    //2022-03-01  mzy  SLA鎶ュ憡涔︿笂绾垮悗闂  start
+                    //鍚堝悓鏃ュ埌婊′竴涓搴︾殑鏈熼棿澶т簬2涓湀鍒欓渶瑕佺敓鎴愬彂鏀捐鍒�,灏忎簬2涓湀鍒欎笉闇�瑕佺敓鎴愯鍒�
+                    //涓轰簡闃叉鍑虹幇 55485 鐨勯偅绉嶆儏鍐�(鍚堝悓鏃ユ墍鍦ㄥ尯闂翠箣鍓嶇殑瀛e害涓嶅啀鐢熸垚)
+                    if ((ContractConclusionDate.addMonths(2)>DistributionEndDate) || (ContractConclusionDate > DistributionEndDate)) {
+                        continue;
+                    }
+                    //2022-03-01  mzy  SLA鎶ュ憡涔︿笂绾垮悗闂  end
 
                     //寮�濮嬬敓鎴愭湇鍔″悎鍚屾姤鍛婁功
                     NewMaintenanceReport_Task__c tempNMCT = new NewMaintenanceReport_Task__c();
diff --git a/force-app/main/default/classes/CreateOpportunityTaskBatch.cls b/force-app/main/default/classes/CreateOpportunityTaskBatch.cls
index 7151392..6ddf39b 100644
--- a/force-app/main/default/classes/CreateOpportunityTaskBatch.cls
+++ b/force-app/main/default/classes/CreateOpportunityTaskBatch.cls
@@ -42,6 +42,7 @@
         //2021-08-10  mzy  update   SWAG-C5R6GW   璇环浠诲姟鏂板瀛楁  start
         oppSql += ',Competitor__c,Close_Forecasted_Date__c,Created_Day__c,StageName__c,Bid_Date__c,Closing_Bid_Date__c ';
         //2021-08-10  mzy  update  SWAG-C5R6GW   璇环浠诲姟鏂板瀛楁  end
+        oppSql += ', OCSM_RMB_Without_Tax_1000__c '; //2022-2-28 yjk 銆愬鎵樸�戙�愯浠蜂换鍔°�戣浠蜂换鍔℃淳閫佹椂鐐瑰瓧娈佃褰曞鍔�
         oppSql += ' from Opportunity ';
 
         // 璇环绉戝鍒嗙被锛圤pportunity_Category__c锛� 鏄疓I
@@ -162,6 +163,7 @@
 
                 //2021-11-26 yjk 璇环浠诲姟澧炲姞娲惧彂鍘熷洜瀛楁
 
+                newTask.OCSM_RMB_Without_Tax_1000__c = opp.OCSM_RMB_Without_Tax_1000__c; //2022-2-28 yjk 銆愬鎵樸�戙�愯浠蜂换鍔°�戣浠蜂换鍔℃淳閫佹椂鐐瑰瓧娈佃褰曞鍔�
 
                 if(opp.Close_Forecasted_Date__c >= nextMonthFirstDay && opp.Close_Forecasted_Date__c<= nnexMonthLastDay){
                     if(
diff --git a/force-app/main/default/classes/DealerPersonnelController.cls b/force-app/main/default/classes/DealerPersonnelController.cls
index e83ca1b..41ed30f 100644
--- a/force-app/main/default/classes/DealerPersonnelController.cls
+++ b/force-app/main/default/classes/DealerPersonnelController.cls
@@ -6,16 +6,13 @@
     public static String processData(String fileData,String sobjectName,List<String> fields) {
         system.debug('fileData===============>'+fileData);
         String errorMage = '';
-        String str = '';
         try {
             if(fileData != null){
                 String[] fileLines = new String[]{};
                 fileLines = fileData.split('\n');
                 system.debug('fileLines===================>'+fileLines);
-                // 璁板綍绫诲瀷
-                List<String> recordTypeList = new List<String>();  
-                // 瀹㈡埛鍚�
-                List<String> accountNameList = new List<String>();  
+                // 缁忛攢鍟嗙鐞嗙紪鐮�
+                List<String> managementCodeList = new List<String>();  
                 // 瀵煎叆鐨勬暟鎹�
                 List<List<String>> inputList = new List<List<String>>();
                 for (Integer i = 1,j = fileLines.size(); i < j; i++) {
@@ -23,133 +20,89 @@
                     inputValues = fileLines[i].split(',');
                     System.debug('inputValues=============>'+inputValues);
                     if(inputValues != null){
-                        if(inputValues[0] == '' || inputValues[0] == null){
-                            errorMage += 'errorMage: 绗�' + i + '琛�,璁板綍绫诲瀷涓嶈兘涓虹┖!';
+                        if(inputValues[0] == '' || inputValues[0]== null){
+                            errorMage += 'errorMage: 绗�' + i + '琛�,濮撳悕涓嶈兘涓虹┖!';
                             errorMage += '=';
                         } 
-                        if(inputValues[1] == '' || inputValues[1]== null){
-                            errorMage += 'errorMage: 绗�' + i + '琛�,濮撴皬涓嶈兘涓虹┖!';
-                            errorMage += '=';
-                        } 
-                        if(inputValues[2] == '' || inputValues[2] == null){
-                            errorMage += 'errorMage: 绗�' + i + '琛�,鍚嶅瓧涓嶈兘涓虹┖!';
-                            errorMage += '=';
-                        } 
-                        if(inputValues[3] == '' || inputValues[3] ==null){
+                        if(inputValues[1] == '' || inputValues[1] ==null){
                             errorMage += 'errorMage: 绗�' + i + '琛�,鎵嬫満涓嶈兘涓虹┖!';
                             errorMage += '=';
                         }
-                        boolean mobileNumberFlag = mobileNumberVerification(inputValues[3]);
-                    System.debug('mobileNumberFlag=============>'+mobileNumberFlag);
-
+                        boolean mobileNumberFlag = mobileNumberVerification(inputValues[1]);
                         if(mobileNumberFlag == false){
                             errorMage += 'errorMage: 浣犵殑鎵嬫満鍙风爜涓嶅お姝g‘,璇锋鏌ユ偍鐨勬墜鏈烘槸鍚︽纭�!';
                             errorMage += '=';
                         }
-                        if(inputValues[4] == '' || inputValues[4] == null){
+                        if(inputValues[2] == '' || inputValues[2] == null){
                             errorMage += 'errorMage: 绗�' + i + '琛�,閭涓嶈兘涓虹┖!';
                             errorMage += '=';
                         }
-                        boolean mailboxFlag = mailboxVerification(inputValues[4]);
-                    System.debug('mailboxFlag=============>'+mailboxFlag);
-
+                        boolean mailboxFlag = mailboxVerification(inputValues[2]);
                         if(mailboxFlag == false){
                             errorMage += 'errorMage: 浣犵殑閭涓嶅お姝g‘,璇锋鏌ユ偍鐨勯偖绠辨牸寮�!';
                             errorMage += '=';
                         }
-                        if(inputValues[5] == '' || inputValues[5] == null){
-                            errorMage += 'errorMage: 绗�' + i + '琛�,瀹㈡埛鍚嶄笉鑳戒负绌�!';
+                        if(inputValues[3] == '' || inputValues[3] == null){
+                            errorMage += 'errorMage: 绗�' + i + '琛�,缁忛攢鍟嗙鐞嗙紪鐮佷笉鑳戒负绌�!';
                             errorMage += '=';
                         }
-                       
-                        str = inputValues[5];
-                        recordTypeList.add(inputValues[0]);
-                        accountNameList.add(str);
-                        //瀵煎叆鐨勬暟鎹�
-                        inputList.add(inputvalues);
                         
+                        managementCodeList.add(inputValues[3]);
+                        inputList.add(inputValues);
+                        //瀵煎叆鐨勬暟鎹�
                         System.debug('inputValues[0]===============>'+ inputValues[0]);
                         System.debug('inputValues[1]===============>'+ inputValues[1]);
                         System.debug('inputValues[2]===============>'+ inputValues[2]);
                         System.debug('inputValues[3]===============>'+ inputValues[3]);
-                        System.debug('inputValues[4]===============>'+ inputValues[4]);
-                        System.debug('inputValues[5]===============>'+ inputValues[5]);
-                        System.debug('inputValues[6]===============>'+ inputValues[6]);
                     }
                 }
-                
-                Map<String,Account> accountMap = new Map<String,Account>();
-                List<String> accountIdList = new List<String>();
-                Map<String,RecordType> recordTypeMap = new Map<String,RecordType>();
-                List<String> recordTypeIdList = new List<String>();
-                List<Account> accountList = [select id, Name from Account where Name in: accountNameList];
-                List<RecordType> rectCo = [select Id,Name from RecordType where IsActive = true and SobjectType = 'Contact' and Name in: recordTypeList];
+                Map<String,Account> accountIdMap = new Map<String,Account>();
+                List<Account> accountList = [select id, Name,Management_Code__c from Account where Management_Code__c in: managementCodeList];
                 for(Account ac : accountList){ 
-                    accountMap.put(ac.Name, ac);
-                    accountIdList.add(ac.Id);
-                }
-                system.debug('accountList===============>'+accountList);
-                system.debug('accountNameList===============>'+accountNameList);
-                system.debug('accountMap===============>'+accountMap);
-                for(RecordType re : rectCo){ 
-                    recordTypeMap.put(re.Name, re);
-                    recordTypeIdList.add(re.Id);
+                    accountIdMap.put(ac.Management_Code__c,ac);
                 }
                 List<Contact> cnList = new List<Contact>();
                 Integer lineNumber = 1;
                 for(List<String> lineList :inputList){
                     Contact con = new Contact();
-                    if(recordTypeMap.containsKey(lineList[0])){ 
-                        con.RecordTypeId = recordTypeMap.get(lineList[0]).id;
+                    //鏆傛椂瀵煎叆鐨勬槸缁忛攢鍟嗙敤鎴凤紝鎵�浠ヨ褰曠被鍨嬪彧鏈夌粡閿�鍟嗭紝鏆傛椂鍐欐锛涘悗鏈熷鏋滄湁鍙樺姩鍐嶆洿鏀�
+                    con.RecordTypeId = '01210000000QfWiAAK';
+                    if(lineList[0] != null && lineList[0] != ''){
+                        con.LastName  = lineList[0];
                     }else{
-                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,璁板綍绫诲瀷'+lineList[0]+'涓嶅瓨鍦�';
-                        errorMage += '=';
-                    }
-                    if(lineList[1] != null && lineList[1] != ''){
-                        con.LastName  = lineList[1];
-                    }else{
-                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,濮撴皬'+lineList[1]+'涓嶅瓨鍦�';
+                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,濮撴皬'+lineList[0]+'涓嶅瓨鍦�';
                         errorMage += '=';
                     }   
+                    if(lineList[1] != null && lineList[1] != ''){
+                        if(mobileNumberVerification(lineList[1])){
+                            con.MobilePhone = lineList[1];
+                        }else{
+                            errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鎵嬫満'+lineList[1]+'涓嶆纭�!';
+                            errorMage += '=';
+                        }
+                    }else{
+                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鎵嬫満'+lineList[1]+'涓嶅瓨鍦�';
+                        errorMage += '=';
+                    }
                     if(lineList[2] != null && lineList[2] != ''){
-                        con.FirstName  = lineList[2];
-                    }else{
-                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鍚嶅瓧'+lineList[2]+'涓嶅瓨鍦�';
-                        errorMage += '=';
-                    }  
-                    if(lineList[3] != null && lineList[3] != ''){
-                        if(mobileNumberVerification(lineList[3])){
-                            con.MobilePhone = lineList[3];
+                        if(mailboxVerification(lineList[2])){
+                            con.Email = lineList[2];
                         }else{
-                            errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鎵嬫満'+lineList[3]+'涓嶆纭�!';
+                            errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鐢靛瓙閭欢'+lineList[2]+'涓嶆纭�!';
                             errorMage += '=';
                         }
                     }else{
-                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鎵嬫満'+lineList[3]+'涓嶅瓨鍦�';
+                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鐢靛瓙閭欢'+lineList[2]+'涓嶅瓨鍦�';
                         errorMage += '=';
                     }
-                    if(lineList[4] != null && lineList[4] != ''){
-                        if(mailboxVerification(lineList[4])){
-                            con.Email = lineList[4];
-                        }else{
-                            errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鐢靛瓙閭欢'+lineList[4]+'涓嶆纭�!';
-                            errorMage += '=';
-                        }
+                    if(accountIdMap.containsKey(lineList[3])){
+                        con.AccountId = accountIdMap.get(lineList[3]).id;
                     }else{
-                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,鐢靛瓙閭欢'+lineList[4]+'涓嶅瓨鍦�';
+                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,缁忛攢鍟嗙紪鐮�'+lineList[3]+'涓嶅瓨鍦�';
                         errorMage += '=';
                     }
-                    if(accountMap.containsKey(lineList[5])){ 
-                        con.AccountId = accountMap.get(lineList[5]).id;
-                    }else{
-                        errorMage += 'error: 绗�'+ lineNumber +'琛屾暟鎹�,瀹㈡埛鍚�'+lineList[5]+'涓嶅瓨鍦�';
-                        errorMage += '=';
-                    }
-                    if(lineList[6] == 'TRUE'){
-                        con.Agency_User__c =  true; 
-                    }else{
-                        con.Agency_User__c =  false; 
-                    }
+                    //鏆傚畾鍒涘缓鐩存帴涓� true
+                    con.Agency_User__c =  true; 
                     lineNumber++;
                     cnList.add(con);
                 }
@@ -190,18 +143,6 @@
     }
     //鏂板瀹㈡埛浜哄憳锛�
     public static void insertContact(List<Contact> data) {
-        // System.debug('data==============>'+data);
-        // List<String> lastNameList = new List<String>();
-        // List<String> firstNameList = new List<String>();
-        // for(Contact con:data){
-        //     lastNameList.add(con.LastName);
-        //     firstNameList.add(con.FirstName);
-        // }
-        // List<Contact> contactList = [select id, Name,Agency_User__c from contact where LastName in: lastNameList AND FirstName in: firstNameList];
-        // if(contactList.size() >= 0){
-        //     return '';
-        // }
-        // System.debug('strNameList==============>'+strNameList);
         insert data;
     }
 
diff --git a/force-app/main/default/classes/DealerPersonnelControllerTest.cls b/force-app/main/default/classes/DealerPersonnelControllerTest.cls
new file mode 100644
index 0000000..70a8641
--- /dev/null
+++ b/force-app/main/default/classes/DealerPersonnelControllerTest.cls
@@ -0,0 +1,22 @@
+@isTest
+public with sharing class DealerPersonnelControllerTest {
+        public static Account account1 = new Account();
+        private static void testInit() {
+            account1.Name = 'test1鍖婚櫌';
+            account1.RecordTypeId = '01210000000QemG';
+            account1.AgentCode_Ext__c = '737011';
+            insert account1;
+        }
+        @isTest public static void selectProductCcategoryTest() {
+            testInit();
+            Test.startTest();
+            String reports = DealerPersonnelController.processData('"濮撳悕,鎵嬫満,鐢靛瓙閭欢,缁忛攢鍟嗙紪鐮�,瀹㈡埛鍚峔r\n灏忕帇,18801332211,123@qq.com,737011,鍚ǔ璧锋\r\n','',null);
+            Test.stopTest();
+        }
+        @isTest public static void selectProductCcategoryTest01() {
+            testInit();
+            Test.startTest();
+            String reports = DealerPersonnelController.processData('"濮撳悕,鎵嬫満,鐢靛瓙閭欢,缁忛攢鍟嗙紪鐮�,瀹㈡埛鍚峔r\n,,,,\r\n','',null);
+            Test.stopTest();
+        }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/DealerPersonnelControllerTest.cls-meta.xml b/force-app/main/default/classes/DealerPersonnelControllerTest.cls-meta.xml
new file mode 100644
index 0000000..dd61d1f
--- /dev/null
+++ b/force-app/main/default/classes/DealerPersonnelControllerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>52.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/EquipmentRealCoverageBatch.cls b/force-app/main/default/classes/EquipmentRealCoverageBatch.cls
new file mode 100644
index 0000000..fbcca47
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRealCoverageBatch.cls
@@ -0,0 +1,193 @@
+global class EquipmentRealCoverageBatch implements Database.Batchable<sObject>,Database.Stateful {
+    public String query;
+    public Date start_dateH1 ;
+    public Date end_dateH1 ;
+    public List<Id> conIds = new List<Id>();
+    public List<Id> hospIds = new List<Id>();
+    public Date toDayTime = Date.today();
+    // public String type ;
+    private BatchIF_Log__c iflog;
+    global EquipmentRealCoverageBatch() {
+        // if (i == 1) {
+        //     this.query = 'select Id,(select Id,IF_Coverage_Real_Asset__c from Asset_Hospital__r where CurrentContract__c In :conIds) from Account';
+        //     type = '鍒嗗瓙';
+        // }
+        // if (i == 2) {
+        this.query = 'select Id,(select id,IF_Coverage_Target_Asset__c,IF_Coverage_Real_Asset__c,CurrentContract__r.Contract_End_Date__c,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset_Hospital__r where Status != \'寤冩\' and Status != \'寰呮姤搴焅''
+                     +' and SerMarGuranteeType__c != \'鏈嶅姟澶氬勾淇濅慨\' and SerMarGuranteeType__c != \'甯傚満澶氬勾淇濅慨\''
+                     +' and Product2.ServiceCategory__c != null) from Account where id in :hospIds';
+            // type = '鍒嗘瘝';
+        // }
+        iflog = new BatchIF_Log__c();
+        iflog.Type__c = 'PushNotification';
+        iflog.Log__c  = 'EquipmentRealCoverageBatch start\n';
+        iflog.ErrorLog__c = '';
+        insert iflog;
+    }
+
+    global Database.QueryLocator start(Database.BatchableContext bc) {
+        // if (type == '鍒嗗瓙') {
+        //      List<Maintenance_Contract__c> conList = new List<Maintenance_Contract__c>();
+        //      // 鍒ゆ柇涓�1H杩樻槸涓�2H
+        //     if (toDayTime.month() >= 4 && toDayTime.month() <= 9) {
+        //         start_dateH1 = Date.newInstance(toDayTime.year(),4,1);
+        //         end_dateH1 = Date.newInstance(toDayTime.year(),9,30);
+        //     }else{
+        //         start_dateH1 = Date.newInstance(toDayTime.year(),10,1);
+        //         end_dateH1 = Date.newInstance(toDayTime.year()+1,3,31);
+        //     }
+        //     List<Maintenance_Contract__c> conList1 = [select Id,Name,Contract_Start_Date__c,Contract_End_Date__c from Maintenance_Contract__c where Contract_Start_Date__c >= :start_dateH1 and Contract_End_Date__c <= :end_dateH1];
+        //     conList.addAll(conList1);
+
+        //       if(conList!=null){
+        //             for (Maintenance_Contract__c con : conList) {
+        //                     conIds.add(con.id);                        
+        //              } 
+        //         } 
+        // }
+        // if (type == '鍒嗘瘝') {
+            // 5鏉′互涓婅蒋鎬ч暅鍖婚櫌&&鍖婚櫌鏈夋晥
+            List<AggregateResult> Asset1 = [select count(Id),Hospital__c from asset where Product2.ServiceCategory__c ='杞�ч暅'  Group by Hospital__c having count(Id)>=5];
+           if(Asset1!=null){
+               for (AggregateResult a1 : Asset1) {
+                   hospIds.add(String.valueOf(a1.get('Hospital__c')));
+               }
+           }
+        // }                   
+            
+        return Database.getQueryLocator(query);
+    }
+
+    global void execute(Database.BatchableContext BC, list<Account> accList) {
+        
+        List<Account_Service_Of_Target__c> asotList = new List<Account_Service_Of_Target__c>();
+        // if (type == '鍒嗗瓙') {
+        //     for (Account a : accList) {
+        //         for (Asset as1 : a.Asset_Hospital__r) {
+        //             // 鏍囪鏄惁瑕嗙洊鐜囧疄闄呰澶�
+        //             as1.IF_Coverage_Real_Asset__c = '1'; 
+        //             AssetsNew.add(as1);
+        //         }   
+        //     } 
+        // }
+        // if (type == '鍒嗘瘝') {
+           
+            // 瀹為檯璁惧鍚堝悓鏃堕棿鍖洪棿1H(4,9);2H(10,3)
+            if (toDayTime.month() >= 4 && toDayTime.month() <= 9) {
+                start_dateH1 = Date.newInstance(toDayTime.year(),9,1);
+                end_dateH1 = Date.newInstance(toDayTime.year(),9,30);
+            }else{
+                start_dateH1 = Date.newInstance(toDayTime.year(),3,1);
+                end_dateH1 = Date.newInstance(toDayTime.year()+1,3,31);
+            }
+            for (Account acc1 : accList) {
+                 Account_Service_Of_Target__c asot = new Account_Service_Of_Target__c();
+
+                // 瑕嗙洊鐩爣锛堢‖锛夛細娉屽翱绉戠敤纭�ч暅
+                Integer mirror_1 = 0;
+                // 瑕嗙洊鐩爣锛堣蒋锛夛細榧诲捊鍠夐暅
+                Integer mirror_2 = 0;
+                //瑕嗙洊鐩爣锛堝懆杈癸級锛氬厜婧�
+                Integer mirror_3 = 0;
+                // 瀹為檯瑕嗙洊鏁帮紙纭級锛氭硨灏跨鐢ㄧ‖鎬ч暅
+                Integer mirror_4 = 0;
+                // 瀹為檯瑕嗙洊鏁帮紙纭級锛氬绉戠敤纭�ч暅
+                Integer mirror_5 = 0;
+                // 瀹為檯瑕嗙洊鏁帮紙鍛ㄨ竟锛夛細鍏夋簮
+                Integer mirror_6 = 0;
+                // 瀹為檯瑕嗙洊鏁帮紙杞級锛氱數瀛愰暅
+                Integer mirror_7 = 0;
+                List<Asset> AssetsTarget = new List<Asset>();
+                List<Asset> AssetsReal = new List<Asset>();
+                for (Asset ass1 : acc1.Asset_Hospital__r) {
+                    
+                    // 鏍囪鏄惁瑕嗙洊鐜囩洰鏍囪澶�
+                    ass1.IF_Coverage_Target_Asset__c = '1';
+                     AssetsTarget.add(ass1);
+                    // 鏍囪鏄惁瑕嗙洊鐜囧疄闄呰澶�
+                    if (ass1.CurrentContract__r.Contract_End_Date__c >= start_dateH1 && ass1.CurrentContract__r.Contract_End_Date__c <= end_dateH1) {
+                        ass1.IF_Coverage_Real_Asset__c = '1';
+                        AssetsReal.add(ass1);
+                    }
+                   
+                    if (ass1.Product2.Category4__c == '娉屽翱绉戠敤纭�ч暅') {
+                        mirror_1++;
+                    }
+                    if(ass1.Product2.ServiceCategory__c =='杞�ч暅'){
+                        mirror_2++;
+                    }
+                    if (ass1.Product2.Category3__c == '鍏夋簮') {
+                        mirror_3++;
+                    } 
+                    if (AssetsTarget!=null) {
+                        try {
+                            update AssetsTarget;
+                        }
+                        catch (Exception e) {
+                            iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsTarget:'+']'+e.getMessage()+'\n';
+                         }
+                    }
+                     if (AssetsReal!=null) {
+                        try {
+                            update AssetsReal;
+                        }
+                        catch (Exception e) {
+                            iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsReal:'+']'+e.getMessage()+'\n';
+                         }
+                    }
+                 }
+                // List<Asset> assList = [select id,Product2.Category4__c,Product2.ServiceCategory__c,Product2.Category3__c from Asset
+                //                     where IF_Coverage_Real_Asset__c = '1' and Hospital__c = :acc1.id];
+                for (Asset AtoHp: AssetsReal) {
+                    if (AtoHp.Product2.Category4__c == '娉屽翱绉戠敤纭�ч暅') {
+                        mirror_4++;
+                    }
+                    if (AtoHp.Product2.Category4__c == '濡囩鐢ㄧ‖鎬ч暅') {
+                        mirror_5++;
+                    }
+                    if (AtoHp.Product2.Category3__c == '鍏夋簮') {
+                        mirror_6++;
+                    }
+                    if (AtoHp.Product2.ServiceCategory__c =='杞�ч暅') {
+                        mirror_7++;
+                    }
+                }
+                asot.Account_HP__c = acc1.id;
+                asot.Coverage_Target_Account__c = true;
+                asot.Target_Rigid_Mirror_2__c = mirror_1;
+                asot.Target_Soft_Mirror_2__c = mirror_2;
+                asot.Target_Correlation_Lightsource__c = mirror_3;
+                asot.Finish_Rigid_Mirror_2__c = mirror_4;
+                asot.Finish_Rigid_Mirror_3__c = mirror_5;
+                asot.Finish_Correlation_Lightsource__c = mirror_6;
+                asot.Finish_Rigid_Mirror_1__c = mirror_7;
+                if (toDayTime.year()<=2029 && toDayTime.year()>=2023) {
+                    asot.OCSM_Period__c =  'FY'+toDayTime.year();
+                    if (toDayTime.month() >= 4 && toDayTime.month() <= 9) {
+                        asot.OCSM_Period_half__c =  '1H';
+                    }else{
+                        asot.OCSM_Period_half__c =  '2H';
+                    } 
+                }
+                asotList.add(asot);     
+            }
+        if (asotList!=null) {
+            try {
+                insert asotList;
+            }
+            catch (Exception e) {
+                iflog.ErrorLog__c += 'ERROR'+'['+'insert asotList:'+']'+e.getMessage()+'\n';
+            }  
+        }
+    }
+    global void finish(Database.BatchableContext BC) {
+        iflog.Log__c += '\nEquipmentRealCoverageBatch end';
+        String tmp = iflog.ErrorLog__c;
+        if (tmp.length() > 65000) {
+            tmp = tmp.substring(0, 65000);
+            tmp += ' ...have more lines...';
+            iflog.ErrorLog__c = tmp;
+        }
+        update iflog;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/EquipmentRealCoverageBatch.cls-meta.xml b/force-app/main/default/classes/EquipmentRealCoverageBatch.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRealCoverageBatch.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls b/force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls
new file mode 100644
index 0000000..efd089c
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls
@@ -0,0 +1,235 @@
+@isTest
+private class EquipmentRealCoverageBatchTest {
+
+    @testSetup
+    private static void setUpDate(){
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        hospital.Is_Active__c = '鏈夊姽';
+        hospital.Attribute_Type__c = '鍗敓閮�';
+        hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+        hospital.Grade__c = '涓�绾�';
+        hospital.OCM_Category__c = 'SLTV';
+        hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+        hospital.Town__c = '涓滀含';
+        insert hospital;
+
+        // 鎴︾暐绉戝銈掑緱銈�
+        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+        dep.Name = 'test dep';
+        dep.AgentCode_Ext__c = System.Label.Account_Asset_FJZ;
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+
+        Contact contact2 = new Contact();
+        contact2.AccountId = dep.Id;
+        contact2.FirstName = '璨换鑰�';
+        contact2.LastName = 'test1缁忛攢鍟�';
+        insert contact2;
+
+        // 浜у搧
+        Product2 pro1 = new Product2(Name='name01',IsActive=true,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,
+                Category3__c='鐢靛瓙闀�');
+        Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc02',Manual_Entry__c=false,
+                Category3__c='绾ょ淮闀�');
+        Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc03',Manual_Entry__c=false,
+                Category3__c='EUS');
+        Product2 pro4 = new Product2(Name='name04',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n04',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc04',Manual_Entry__c=false,
+                 Category3__c='EUS',
+                Category4__c ='娉屽翱绉戠敤纭�ч暅');
+        Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n05',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc05',Manual_Entry__c=false,
+                 Category3__c='EUS',
+                Category4__c = '濡囩鐢ㄧ‖鎬ч暅');
+        insert new Product2[] {pro1, pro2, pro3,pro4,pro5};
+
+
+        Date toDayTime = Date.today();
+        Maintenance_Contract__c contract = new Maintenance_Contract__c();
+        contract.Name = 'tect contract';
+        contract.status__c ='濂戠磩';
+        contract.Maintenance_Contract_No__c = 'Kami_Contract_No';
+        contract.Contract_Conclusion_Date__c = Date.today();
+        contract.Hospital__c = hospital.Id;
+        contract.Department_Class__c = strategicDep[0].Id;
+        contract.Department__c = dep.Id;
+        contract.Contract_Start_Date__c=Date.newInstance(toDayTime.year(),3,2);  // 10鏃ュ墠
+        contract.Contract_End_Date__c = Date.newInstance(toDayTime.year()+1,3,20);       // 5鏃ュ緦
+        contract.SalesOfficeCode_selection__c = '鍖椾含RC';
+        contract.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId();
+        insert contract;
+
+        List<Maintenance_Contract__c> MaintenanceContract=[select id from Maintenance_Contract__c];
+
+        //---------------------------涓讳綋 涓や釜闄勫睘鍝�(涓綋绠$悊 鏁伴噺绠$悊)
+        // 淇濇湁璁惧A (涓讳綋)
+        Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA1.RecordTypeId = System.Label.Asset_RecordType;
+        assetA1.SerialNumber = 'ass01';
+        assetA1.Name = 'ass01';
+        assetA1.AccountId = dep.Id;
+        assetA1.Department_Class__c = strategicDep[0].Id;
+        assetA1.Hospital__c = hospital.Id;
+        assetA1.Product2Id = pro1.Id;
+        assetA1.Quantity = 1;
+        assetA1.Status = '鏈夊簱瀛�';
+        assetA1.Manage_type__c = '涓綋绠$悊';
+        assetA1.Loaner_accsessary__c = false;
+        assetA1.Product_category__c = 'GI';
+        assetA1.Delete_Flag__c = false;
+        assetA1.Freeze_sign__c = false;
+        assetA1.Out_of_wh__c = 0;
+        assetA1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA1.Product_category__c = 'GI';
+        assetA1.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA1.SalesProvince__c = '鍖椾含';
+        assetA1.WH_location__c = '璐ф灦鍙�1';
+        assetA1.Asset_loaner_category__c = '鍥哄畾璧勪骇';
+        assetA1.CompanyOfEquipment__c = '123';
+        assetA1.Internal_Asset_number__c = '123';
+        assetA1.CurrentContract__c=MaintenanceContract[0].Id;
+        // assetA1.AssetManageConfirm__c = true;
+        // 淇濇湁璁惧A (闄勫睘鍝� 鏁伴噺绠$悊)
+        Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA2.RecordTypeId = System.Label.Asset_RecordType;
+        assetA2.SerialNumber = 'ass02';
+        assetA2.Name = 'ass02';
+        assetA2.AccountId = dep.Id;
+        assetA2.Department_Class__c = strategicDep[0].Id;
+        assetA2.Hospital__c = hospital.Id;
+        assetA2.Product2Id = pro2.Id;
+        assetA2.Quantity = 10;
+        assetA2.Status = '鏈夊簱瀛�';
+        assetA2.Manage_type__c = '鏁伴噺绠$悊';
+        assetA2.Loaner_accsessary__c = true;
+        assetA2.Product_category__c = 'GI';
+        assetA2.Delete_Flag__c = false;
+        assetA2.Freeze_sign__c = false;
+        assetA2.Out_of_wh__c = 3;
+        assetA2.Frozen_Quantity__c = 2;
+        assetA2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA2.Product_category__c = 'GI';
+        assetA2.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA2.SalesProvince__c = '鍖椾含';
+        assetA2.WH_location__c = '璐ф灦鍙�2';
+        assetA2.Asset_loaner_category__c = '鍥哄畾璧勪骇';
+        assetA2.CompanyOfEquipment__c = '123';
+        assetA2.Internal_Asset_number__c = '123';
+        assetA2.CurrentContract__c=MaintenanceContract[0].Id;
+        // assetA2.AssetManageConfirm__c = true;
+        // 淇濇湁璁惧A (闄勫睘鍝� 涓綋绠$悊)
+        Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA3.RecordTypeId = System.Label.Asset_RecordType;
+        assetA3.SerialNumber = 'ass03';
+        assetA3.Name = 'ass03';
+        assetA3.AccountId = dep.Id;
+        assetA3.Department_Class__c = strategicDep[0].Id;
+        assetA3.Hospital__c = hospital.Id;
+        assetA3.Product2Id = pro3.Id;
+        assetA3.Quantity = 10;
+        assetA3.Status = '鏈夊簱瀛�';
+        assetA3.Manage_type__c = '鏁伴噺绠$悊';
+        assetA3.Loaner_accsessary__c = true;
+        assetA3.Product_category__c = 'GI';
+        assetA3.Delete_Flag__c = false;
+        assetA3.Freeze_sign__c = false;
+        assetA3.Out_of_wh__c = 3;
+        assetA3.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA3.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA3.Product_category__c = 'GI';
+        assetA3.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA3.SalesProvince__c = '鍖椾含';
+        assetA3.WH_location__c = '璐ф灦鍙�3';
+        assetA3.Abandoned_Inventory__c = 1;
+        assetA3.Asset_loaner_category__c = '鍥哄畾璧勪骇';
+        assetA3.CompanyOfEquipment__c = '123';
+        assetA3.Internal_Asset_number__c = '123';
+        assetA3.CurrentContract__c=MaintenanceContract[0].Id;
+
+    // 淇濇湁璁惧A (闄勫睘鍝� 鏁伴噺绠$悊)
+        Asset assetA4 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA4.RecordTypeId = System.Label.Asset_RecordType;
+        assetA4.SerialNumber = 'ass04';
+        assetA4.Name = 'ass04';
+        assetA4.AccountId = dep.Id;
+        assetA4.Department_Class__c = strategicDep[0].Id;
+        assetA4.Hospital__c = hospital.Id;
+        assetA4.Product2Id = pro4.Id;
+        assetA4.Quantity = 10;
+        assetA4.Status = '鏈夊簱瀛�';
+        assetA4.Manage_type__c = '鏁伴噺绠$悊';
+        assetA4.Loaner_accsessary__c = true;
+        assetA4.Product_category__c = 'GI';
+        assetA4.Delete_Flag__c = false;
+        assetA4.Freeze_sign__c = false;
+        assetA4.Out_of_wh__c = 3;
+        assetA4.Frozen_Quantity__c = 2;
+        assetA4.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA4.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA4.Product_category__c = 'GI';
+        assetA4.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA4.SalesProvince__c = '鍖椾含';
+        assetA4.WH_location__c = '璐ф灦鍙�2';
+        assetA4.Asset_loaner_category__c = '鍥哄畾璧勪骇';
+        assetA4.CompanyOfEquipment__c = '123';
+        assetA4.Internal_Asset_number__c = '123';
+        assetA4.CurrentContract__c=MaintenanceContract[0].Id;
+        // assetA2.AssetManageConfirm__c = true;
+
+        // 淇濇湁璁惧A (闄勫睘鍝� 鏁伴噺绠$悊)
+        Asset assetA5 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA5.RecordTypeId = System.Label.Asset_RecordType;
+        assetA5.SerialNumber = 'ass05';
+        assetA5.Name = 'ass05';
+        assetA5.AccountId = dep.Id;
+        assetA5.Department_Class__c = strategicDep[0].Id;
+        assetA5.Hospital__c = hospital.Id;
+        assetA5.Product2Id = pro5.Id;
+        assetA5.Quantity = 10;
+        assetA5.Status = '鏈夊簱瀛�';
+        assetA5.Manage_type__c = '鏁伴噺绠$悊';
+        assetA5.Loaner_accsessary__c = true;
+        assetA5.Product_category__c = 'GI';
+        assetA5.Delete_Flag__c = false;
+        assetA5.Freeze_sign__c = false;
+        assetA5.Out_of_wh__c = 3;
+        assetA5.Frozen_Quantity__c = 2;
+        assetA5.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA5.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA5.Product_category__c = 'GI';
+        assetA5.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA5.SalesProvince__c = '鍖椾含';
+        assetA5.WH_location__c = '璐ф灦鍙�2';
+        assetA5.Asset_loaner_category__c = '鍥哄畾璧勪骇';
+        assetA5.CompanyOfEquipment__c = '123';
+        assetA5.Internal_Asset_number__c = '123';
+        assetA5.CurrentContract__c=MaintenanceContract[0].Id;
+        // assetA2.AssetManageConfirm__c = true;
+        insert new Asset[] {assetA1, assetA2, assetA3,assetA4,assetA5};
+
+
+    }
+    static testMethod void testMethod1() {
+        database.executeBatch(new EquipmentRealCoverageBatch(),200);
+        
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls-meta.xml b/force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRealCoverageBatchTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/EquipmentRenewBatch.cls b/force-app/main/default/classes/EquipmentRenewBatch.cls
new file mode 100644
index 0000000..992735a
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRenewBatch.cls
@@ -0,0 +1,133 @@
+global class EquipmentRenewBatch implements Database.Batchable<sObject>,Database.Stateful {
+    public String query;
+    public Date toDayTime = Date.today();
+    public Date start_date1 ;
+    public Date end_date1 ;
+    public Date start_date2 ;
+    public Date end_date2 ;
+    public Date deadlineTime;
+    private BatchIF_Log__c iflog;
+
+     
+    global EquipmentRenewBatch() {
+        this.query = '';
+        iflog = new BatchIF_Log__c();
+        iflog.Type__c = 'PushNotification';
+        iflog.Log__c  = 'EquipmentRenewBatch start\n';
+        iflog.ErrorLog__c = '';
+        insert iflog;
+    }
+
+    global Database.QueryLocator start(Database.BatchableContext bc) {
+        if (toDayTime.month() >= 4 && toDayTime.month() <= 9) {
+            this.start_date1 = Date.newInstance(toDayTime.year()-1,4,1);
+            this.end_date1 = Date.newInstance(toDayTime.year()-1,12,31);
+            this.start_date2 = Date.newInstance(toDayTime.year(),1,1);
+            this.end_date2 = Date.newInstance(toDayTime.year(),6,30);
+            this.deadlineTime = Date.newInstance(toDayTime.year(),3,31);
+        }else{
+            this.start_date1 = Date.newInstance(toDayTime.year()-1,10,1);
+            this.end_date1 = Date.newInstance(toDayTime.year(),6,30);
+            this.start_date2 = Date.newInstance(toDayTime.year(),7,1);
+            this.end_date2 = Date.newInstance(toDayTime.year(),12,31);
+            this.deadlineTime = Date.newInstance(toDayTime.year(),9,30);
+        }
+        query+='select Id,(select Id,CurrentContract__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Start_Date__c,CurrentContract__r.New_Contract_TypeF_Text__c,Product2.ServiceCategory__c,CurrentContract__r.Status__c' 
+                + ' from Asset_Hospital__r where CurrentContract__r.Contract_End_Date__c >= :start_date1 and CurrentContract__r.Contract_End_Date__c <= :end_date2)'
+                + ' from Account';
+
+        return Database.getQueryLocator(query);
+    }
+    global void execute(Database.BatchableContext BC, list<Account> Accounts) {
+        List<Account_Service_Of_Target__c> asotList = new List<Account_Service_Of_Target__c>();
+       
+        
+        for (Account acc : Accounts) {
+            Account_Service_Of_Target__c asot = new Account_Service_Of_Target__c();
+            List<Asset> AssetsTarget = new List<Asset>();
+            List<Asset> AssetsReal = new List<Asset>();
+            // 瀹為檯缁鏁帮細璁惧鏁�
+            Integer mirror_1 = 0;
+            // 缁鐩爣锛氳澶囨暟
+            Integer mirror_2 = 0;
+            for (Asset ass : acc.Asset_Hospital__r) {
+                // 鍒嗗瓙
+                    //1. 璁惧鍏宠仈鐨勫悎鍚岀被鍨嬫槸鈥滅画绛惧悎鍚屸�� 2. 鍦�2023骞�3鏈�31鏃ュ墠绯荤粺鐢熸晥瀹屾瘯
+                    if (ass.CurrentContract__r.Contract_End_Date__c <= Date.newInstance(toDayTime.year()+1,3,31) && ass.CurrentContract__r.New_Contract_TypeF_Text__c == '缁鍚堝悓') {
+                            // 鏍囪涓烘槸鍚︾画绛惧疄闄呰澶�
+                            ass.IF_Renewalrate_Real_Asset__c = '1';
+                            AssetsReal.add(ass);
+                            mirror_1++;
+                    }
+                    // 鍒嗘瘝
+                    /*1H鑰冩牳瀵硅薄锛� 1锛夈��2021.4.1-2021.12.31鍚堝悓缁撴潫涓旀埅姝�2022.3.31鏈画绛剧殑璁惧锛�
+                    2锛夈��2022.1.1-2022.6.30鍚堝悓缁撴潫锛屼笉璁鸿璁惧鏄惁缁
+                    2H鑰冩牳瀵硅薄锛� 1锛夈��2021.10.1-2022.6.30鍚堝悓缁撴潫涓旀埅姝�2022.9.30鏈画绛剧殑璁惧锛�
+                    2锛夈��2022.7.1-2022.12.31 鍚堝悓缁撴潫锛屼笉璁鸿璁惧鏄惁缁
+                    */
+                    Boolean result = true;
+                    if (ass.Product2.ServiceCategory__c != null) {
+                        if (ass.CurrentContract__r.Contract_End_Date__c>=start_date1&&ass.CurrentContract__r.Contract_End_Date__c<=end_date1){
+                            if (ass.CurrentContract__c == null || ass.CurrentContract__r.Status__c == '鍚堝悓缁撴潫') {
+                                ass.IF_Renewalrate_Target_Asset__c = '1';
+                                AssetsTarget.add(ass);
+                                result = false;
+                                mirror_2++;
+                            }
+                            if (result) {
+                                if (ass.CurrentContract__r.Contract_Start_Date__c <= deadlineTime) {
+                                ass.IF_Renewalrate_Target_Asset__c = '1';
+                                AssetsTarget.add(ass);
+                                mirror_2++;
+                                }
+                            } 
+                        }
+                        if (ass.CurrentContract__r.Contract_End_Date__c>=start_date2&&ass.CurrentContract__r.Contract_End_Date__c<=end_date2) {
+                            ass.IF_Renewalrate_Target_Asset__c = '1';
+                            AssetsTarget.add(ass);
+                            mirror_2++;
+                        }
+                    }    
+                if (AssetsReal!=null) {
+                    try {
+                        update AssetsReal;
+                    }
+                    catch (Exception e) {
+                        iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsReal:'+']'+e.getMessage()+'\n';
+                     }
+                }
+                 if (AssetsTarget!=null) {
+                    try {
+                        update AssetsTarget;
+                    }
+                    catch (Exception e) {
+                        iflog.ErrorLog__c += 'ERROR'+'['+'update AssetsTarget:'+']'+e.getMessage()+'\n';
+                     }
+                }
+            }
+            asot.Account_HP__c = acc.id;
+            // asot.Finish_Asset__c = mirror_1;
+            // asot.AssetContinueTaget__c = mirror_2;
+            // asotList.add(asot);
+        }  
+        // if (asotList!=null) {
+        //     try {
+        //         insert asotList;
+        //     }
+        //     catch (Exception e) {
+        //         iflog.ErrorLog__c += 'ERROR'+'['+'insert asotList:'+']'+e.getMessage()+'\n';
+        //     }  
+        // }  
+    }
+
+    global void finish(Database.BatchableContext BC) {
+        iflog.Log__c += '\nEquipmentRenewBatch end';
+        String tmp = iflog.ErrorLog__c;
+        if (tmp.length() > 65000) {
+            tmp = tmp.substring(0, 65000);
+            tmp += ' ...have more lines...';
+            iflog.ErrorLog__c = tmp;
+        }
+        update iflog;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/EquipmentRenewBatch.cls-meta.xml b/force-app/main/default/classes/EquipmentRenewBatch.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRenewBatch.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/EquipmentRenewBatchTest.cls b/force-app/main/default/classes/EquipmentRenewBatchTest.cls
new file mode 100644
index 0000000..f6e9680
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRenewBatchTest.cls
@@ -0,0 +1,213 @@
+@isTest(SeeAllData=false)
+private class EquipmentRenewBatchTest {
+  
+
+    private static void initData(){
+         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;
+        } 
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        User MacOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com',Job_Category__c = '閿�鍞湇鍔�', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        insert MacOwner;
+
+        Account hospital = new Account();
+        hospital.RecordTypeId = rectCo[0].Id;
+        hospital.Name         = 'NFM007Testhospital';
+        insert hospital;
+
+        // 鎴︾暐绉戝銈掑緱銈�
+        List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI'];
+        Account section = new Account();
+        section.RecordTypeId = rectSct[0].Id;
+        section.Name         = '*';
+        section.Department_Class_Label__c = '娑堝寲绉�';
+        section.ParentId                  = hospital.Id;
+        section.Hospital_Department_Class__c = hospital.Id;
+        section.AgentCode_Ext__c = '9999900';
+        insert section;
+
+        Account depart = new Account();
+        depart.RecordTypeId = rectDpt[0].Id;
+        depart.Name         = '*';
+        depart.Department_Name__c  = 'NFM007TestDepart';
+        depart.ParentId = strategicDep[0].Id;
+        depart.Department_Class__c = strategicDep[0].Id;
+        depart.Hospital__c = hospital.Id;
+        insert depart;
+
+        Product2 prd1 = new Product2();
+        prd1.ProductCode_Ext__c     = 'Prd1';
+        prd1.ProductCode            = 'Prd1';
+        prd1.Repair_Product_Code__c = 'Prd1_RP';
+        prd1.Name                   = 'Prd1';
+        prd1.Manual_Entry__c        = false;
+        // prd1.Category2__c = '鏈綋';
+        // prd1.Category3__c = '绾ょ淮闀�';
+        prd1.Category4__c = 'SD EndoEYE';
+        // prd1.Category5__c = '260SL绯诲垪';
+        prd1.Asset_Model_No__c = '1001';
+        prd1.Important_product__c = true;
+        prd1.Important_Rroduct_1GI__c = true;
+        insert prd1;
+
+        Product2 prd2 = new Product2();
+        prd2.ProductCode_Ext__c     = 'Prd2';
+        prd2.ProductCode            = 'Prd2';
+        prd2.Repair_Product_Code__c = 'Prd2_RP';
+        prd2.Name                   = 'Prd2';
+        prd2.Manual_Entry__c        = false;
+        // prd1.Category2__c = '鏈綋';
+        prd2.Category3__c = '鍏夋簮';
+        // prd2.Category4__c = 'SD EndoEYE';
+        // prd1.Category5__c = '260SL绯诲垪';
+        prd2.Asset_Model_No__c = '1001';
+        prd2.Important_product__c = true;
+        prd2.Important_Rroduct_1GI__c = true;
+        insert prd2;
+
+        Consumable_order_details2__c saledet1 = new Consumable_order_details2__c();
+        saledet1.Name = 'OCM_01_001001';
+        // saledet1.Consumable_order_minor__c = Order1.Id;
+        saledet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery;
+        saledet1.Bar_Code__c = '0114953170032070111804001082K250BBBBB';
+        // saledet1.Consumable_Product__c = prd1.Id;
+        saledet1.Used_account__c = section.Id;
+        saledet1.Delivery_List_RMB__c = 11;
+        saledet1.Box_Piece__c = '鐩�';
+        saledet1.TracingCode__c = 'BBBBB';
+        saledet1.SerialLotNo__c = '82K';
+        saledet1.Guarantee_period_for_products__c = Date.today().addDays(5);
+        saledet1.Sterilization_limit__c = Date.today().addDays(5);
+        saledet1.Send_Date__c = null;
+        //saledet1.Dealer_Shipment__c = false;
+        saledet1.Arrive_date__c = null;
+        //saledet1.Dealer_Arrive__c = false;
+        saledet1.Used_date__c = null;
+        //saledet1.Dealer_Saled__c = false;
+        saledet1.Deliver_date__c = Date.today().addDays(-10);
+        insert saledet1;
+
+        // 缁翠慨鍚堝悓銈掍綔鎴愩仚銈�
+        Maintenance_Contract__c contract = new Maintenance_Contract__c();
+        contract.Name = 'tect contract';
+        contract.Hospital__c = hospital.Id;
+        contract.Department_Class__c = strategicDep[0].Id;
+        contract.Department__c = depart.Id;
+        contract.Service_Contract_Staff__c = MacOwner.Id;
+        contract.Payment_Plan_Sum_First__c = 1;
+        contract.Status__c = '濂戠磩婧�浜�';
+        contract.Maintenance_Contract_No__c = '11123';
+         contract.recordtypeId = 
+             Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId();
+        contract.Not_Upper_limit_reason__c = ' 1';
+        contract.Contract_Start_Date__c = Date.newInstance(2021,10,5);   
+        contract.Contract_End_Date__c = Date.newInstance(2021,11,1);       
+        contract.SalesOfficeCode_selection__c = '鍖椾含RC';
+        contract.New_Contract_TypeF_Text__c = '缁鍚堝悓';
+        system.assertEquals(contract.Contract_End_Date__c >= Date.newInstance(2021,10,1) && contract.Contract_End_Date__c <= Date.newInstance(2022,9,30),true);
+        insert contract;
+
+        Maintenance_Contract__c contract2 = new Maintenance_Contract__c();
+        contract2.Name = 'tect contract2';
+        contract2.Hospital__c = hospital.Id;
+        contract2.Department_Class__c = strategicDep[0].Id;
+        contract2.Department__c = depart.Id;
+        contract2.Service_Contract_Staff__c = MacOwner.Id;
+        contract2.Payment_Plan_Sum_First__c = 1;
+        contract2.Status__c = '濂戠磩';
+        contract2.Maintenance_Contract_No__c = '11123111';
+        contract2.Not_Upper_limit_reason__c = ' 2';
+        contract2.Contract_Start_Date__c = Date.newInstance(2021,10,5);   
+        contract2.Contract_End_Date__c = Date.newInstance(2021,11,1);       
+        contract2.SalesOfficeCode_selection__c = '鍖椾含RC';
+        system.assertEquals(contract2.Contract_End_Date__c >= Date.newInstance(2021,10,1) && contract2.Contract_End_Date__c <= Date.newInstance(2022,9,30),true);
+        insert contract2;
+
+        asset ast = new asset();
+        ast.Name                             = prd1.Name;
+        ast.Product2Id                       = prd1.Id;
+        ast.SerialNumber                     = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')';
+        ast.SLMark__c                        = 'Serial Number';         // 鍥哄畾 dnInfo.SorLMark;
+        ast.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c;
+        ast.TracingCode__c                   = saledet1.TracingCode__c;
+        ast.Guaranteen_end__c                = saledet1.Sterilization_limit__c;
+        ast.Barcode__c                       = saledet1.Bar_Code__c;
+        ast.Product_Serial_No__c             = saledet1.SerialLotNo__c  + '(' + saledet1.TracingCode__c + ')';
+        ast.Asset_Owner__c                   = '缁忛攢鍟嗚祫浜�';
+        ast.AccountId                        = depart.Id;
+        ast.Department_Class__c              = section.Id;
+        // ast.Asset_owner_delaer_name__c       = hospital.Id;
+        ast.Hospital__c                      = hospital.Id;
+        ast.CurrentContract__c = contract.Id;
+        ast.CurrentContract_Asset_Price__c = 0;
+        insert ast;
+
+        asset ast1 = new asset();
+        ast1.Name                             = prd2.Name;
+        ast1.Product2Id                       = prd2.Id;
+        ast1.SerialNumber                     = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')';
+        ast1.SLMark__c                        = 'Serial Number';         // 鍥哄畾 dnInfo.SorLMark;
+        ast1.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c;
+        ast1.TracingCode__c                   = saledet1.TracingCode__c;
+        ast1.Guaranteen_end__c                = saledet1.Sterilization_limit__c;
+        ast1.Barcode__c                       = saledet1.Bar_Code__c;
+        ast1.Product_Serial_No__c             = saledet1.SerialLotNo__c  + '(' + saledet1.TracingCode__c + ')';
+        ast1.Asset_Owner__c                   = '缁忛攢鍟嗚祫浜�';
+        ast1.AccountId                        = depart.Id;
+        ast1.Department_Class__c              = section.Id;
+        // ast.Asset_owner_delaer_name__c       = hospital.Id;
+        ast1.Hospital__c                      = hospital.Id;
+        ast1.CurrentContract__c = contract2.Id;
+        ast1.CurrentContract_Asset_Price__c = 0;
+        insert ast1;
+    }
+
+    static testMethod void testMethod1() {
+        Date toDayTime = Date.today();
+         Date start_date1 ;
+         Date end_date1 ;
+         Date start_date2 ;
+         Date end_date2 ;
+         Date deadlineTime;
+           if (toDayTime.month() >= 4 && toDayTime.month() <= 9) {
+            start_date1 = Date.newInstance(toDayTime.year()-1,4,1);
+            end_date1 = Date.newInstance(toDayTime.year()-1,12,31);
+            start_date2 = Date.newInstance(toDayTime.year(),1,1);
+            end_date2 = Date.newInstance(toDayTime.year(),6,30);
+            deadlineTime = Date.newInstance(toDayTime.year(),3,31);
+        }else{
+            start_date1 = Date.newInstance(toDayTime.year()-1,10,1);
+            end_date1 = Date.newInstance(toDayTime.year(),6,30);
+            start_date2 = Date.newInstance(toDayTime.year(),7,1);
+            end_date2 = Date.newInstance(toDayTime.year(),12,31);
+            deadlineTime = Date.newInstance(toDayTime.year(),9,30);
+        }
+
+        system.Test.startTest();
+        initData();
+               
+
+        String query='select Id,(select Id,CurrentContract__c,CurrentContract__r.Contract_End_Date__c,CurrentContract__r.Contract_Start_Date__c,CurrentContract__r.New_Contract_TypeF_Text__c,Product2.ServiceCategory__c,CurrentContract__r.Status__c' 
+                + ' from Asset_Hospital__r where CurrentContract__r.Contract_End_Date__c >= :start_date1 and CurrentContract__r.Contract_End_Date__c <= :end_date2)'
+                + ' from Account';
+               List<Account> accs =  database.query(query);
+               for (Account  acc: accs) {
+                   for (Asset ass : acc.Asset_Hospital__r) {
+                        system.debug('acc$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'+ass);
+                   }
+               }
+              
+               system.assertEquals(true,accs == null);
+        database.executeBatch(new EquipmentRenewBatch(),200);
+        system.Test.stopTest();
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/EquipmentRenewBatchTest.cls-meta.xml b/force-app/main/default/classes/EquipmentRenewBatchTest.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentRenewBatchTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/EquipmentSetShippmentReceived1Controller.cls b/force-app/main/default/classes/EquipmentSetShippmentReceived1Controller.cls
index fcc0700..ef9ed08 100644
--- a/force-app/main/default/classes/EquipmentSetShippmentReceived1Controller.cls
+++ b/force-app/main/default/classes/EquipmentSetShippmentReceived1Controller.cls
@@ -174,8 +174,9 @@
     public PageReference save() {
 
         //妫�鏌ユ槸鍚﹀彲浠ョ户缁�
-        Rental_Apply__c RaTar = [select Campaign__c,Repair__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,demo_purpose2__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,
-                                                Campaign__r.Status,repair__r.Return_Without_Repair_Date__c,Repair__r.Repair_Final_Inspection_Date__c,Repair__r.Repair_Shipped_Date__c
+        Rental_Apply__c RaTar = [select Name,Campaign__c,Repair__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,demo_purpose2__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,
+                                                Campaign__r.Status,repair__r.Return_Without_Repair_Date__c,Repair__r.Repair_Final_Inspection_Date__c,Repair__r.Repair_Shipped_Date__c,
+                                                Campaign__r.IF_Approved__c,Campaign__r.Meeting_Approved_No__c
                                             from Rental_Apply__c 
                                             where id=:Raid];
 
@@ -203,9 +204,15 @@
         }else if(RaTar.demo_purpose2__c=='绱㈣禂QIS' && RaTar.next_action__c=='鏃犲伩鏇存崲' && RaTar.QIS_number__r.ReplaceDeliveryDate__c!= null){
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '绱㈣禂QIS鐩殑锛孮IS宸叉湁鏂板搧鍙戣揣鏃ワ紝涓嶈兘缁х画浜�'));
                 return null;
-           }
+        }
         //1822 yc 20211025 end
         
+        //20220225 sx start obpm 涓嬫灦澧炲姞 鏄惁鐢宠鍐宠鍕剧潃娌℃湁鍐宠缂栧彿涓嶈兘杩涜鎿嶄綔
+        else if ( RaTar.Campaign__c!= null && RaTar.Campaign__r.IF_Approved__c && RaTar.Campaign__r.Meeting_Approved_No__c == null){
+            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '鍗曞彿No.'+ RaTar.Name + '宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖'));
+        }
+        //20220225 sx end 涓嬫灦澧炲姞鍒ゆ柇
+
         String userid = Userinfo.getUserId();
         List<Rental_Apply_Equipment_Set_Detail__c> eList = new List<Rental_Apply_Equipment_Set_Detail__c>();
         Map<Id, Boolean> stockDownMap = new Map<Id, Boolean>();
diff --git a/force-app/main/default/classes/EquipmentSetShippmentReceived2Controller.cls b/force-app/main/default/classes/EquipmentSetShippmentReceived2Controller.cls
index c028ad4..77cf12d 100644
--- a/force-app/main/default/classes/EquipmentSetShippmentReceived2Controller.cls
+++ b/force-app/main/default/classes/EquipmentSetShippmentReceived2Controller.cls
@@ -201,7 +201,8 @@
 
         //妫�鏌ユ槸鍚﹀彲浠ョ户缁�
         Rental_Apply__c RaTar = [select Campaign__c,Repair__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,demo_purpose2__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,
-                                                Campaign__r.Status,repair__r.Return_Without_Repair_Date__c,Repair__r.Repair_Final_Inspection_Date__c,Repair__r.Repair_Shipped_Date__c
+                                                Campaign__r.Status,repair__r.Return_Without_Repair_Date__c,Repair__r.Repair_Final_Inspection_Date__c,Repair__r.Repair_Shipped_Date__c,
+                                                Campaign__r.IF_Approved__c, Campaign__r.Meeting_Approved_No__c
                                             from Rental_Apply__c 
                                             where id=:Raid];
 
@@ -232,6 +233,13 @@
                 return null;
            }
         //1822 yc 20211108 end
+
+        //20220225 sx start obpm 涓嬫灦澧炲姞 鏄惁鐢宠鍐宠鍕剧潃娌℃湁鍐宠缂栧彿涓嶈兘杩涜鎿嶄綔
+        else if ( RaTar.Campaign__c!= null &&  RaTar.Campaign__r.IF_Approved__c && RaTar.Campaign__r.Meeting_Approved_No__c == null){
+            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖'));
+            return null;
+        }
+        //20220225 sx end 涓嬫灦澧炲姞鍒ゆ柇
         
         String userid = Userinfo.getUserId();
         List<Rental_Apply_Equipment_Set_Detail__c> eList = new List<Rental_Apply_Equipment_Set_Detail__c>();
diff --git a/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls b/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls
index 8c46b4c..13d3208 100644
--- a/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls
+++ b/force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls
@@ -7,8 +7,8 @@
     public Boolean saveBtnDisabled { get; private set; }
     public boolean ReturnRefuse {get;private set;}
     public String ErrorMessage {get; set;}
-    public String CDSFinished {get;set;}
-    public boolean LostFlg {get;set;}
+    // public String CDSFinished {get;set;}
+    // public boolean LostFlg {get;set;}
     public String Step_status { get; private set; }
     public Boolean needCDS { get; private set; }
     public Boolean done_flg { get; set; }
diff --git a/force-app/main/default/classes/EquipmentSetShippmentReceived3CtrlTest.cls b/force-app/main/default/classes/EquipmentSetShippmentReceived3CtrlTest.cls
index 9599de4..7c59ce1 100644
--- a/force-app/main/default/classes/EquipmentSetShippmentReceived3CtrlTest.cls
+++ b/force-app/main/default/classes/EquipmentSetShippmentReceived3CtrlTest.cls
@@ -544,6 +544,557 @@
         raesdObj6.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
         update new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3,raesdObj4,raesdObj5,raesdObj6};
     }}
+
+        static void setupTestData2() {
+    // MIXED_DML_OPERATION, DML operation on setup object is not permitted Error
+    System.runAs(new User(Id = Userinfo.getUserId())) {
+        StaticParameter.EscapeNFM001AgencyContractTrigger = true;
+        StaticParameter.EscapeNFM001Trigger = true;
+        Oly_TriggerHandler.bypass(ContactTriggerHandler.class.getName());
+        Oly_TriggerHandler.bypass(AgencyHospitalHandler.class.getName());
+        // 銈枫偣銉嗐儬绠$悊鑰�
+        User user = new User(Test_staff__c = true);
+        user.LastName = '_銈点兂銉栥儶銉冦偢1';
+        user.FirstName = '銇�';
+        user.Alias = '銇�';
+        user.Email = 'olympusTest03@sunbridge.com';
+        user.Username = 'olympusTest03@sunbridge.com';
+        user.CommunityNickname = '銇�';
+        user.IsActive = true;
+        user.EmailEncodingKey = 'ISO-2022-JP';
+        user.TimeZoneSidKey = 'Asia/Tokyo';
+        user.LocaleSidKey = 'ja_JP';
+        user.LanguageLocaleKey = 'ja';
+        user.ProfileId = System.Label.ProfileId_SystemAdmin;
+        user.Province__c = '鍖椾含';
+        user.Dept__c = '鍖荤枟鍗庡寳钀ヤ笟鏈儴';
+        user.Use_Start_Date__c = Date.today().addMonths(-6);
+        insert user;
+
+        // 鐪�
+        Address_Level__c al = new Address_Level__c();
+        al.Name = '鏉变含';
+        al.Level1_Code__c = 'CN-99';
+        al.Level1_Sys_No__c = '999999';
+        insert al;
+        // 甯�
+        Address_Level2__c al2 = new Address_Level2__c();
+        al2.Level1_Code__c = 'CN-99';
+        al2.Level1_Sys_No__c = '999999';
+        al2.Level1_Name__c = '鏉变含';
+        al2.Name = '娓嬭胺鍖�';
+        al2.Level2_Code__c = 'CN-9999';
+        al2.Level2_Sys_No__c = '9999999';
+        al2.Address_Level__c = al.id;
+        insert al2;
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        hospital.Is_Active__c = '鏈夊姽';
+        hospital.Attribute_Type__c = '鍗敓閮�';
+        hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+        hospital.Grade__c = '涓�绾�';
+        hospital.OCM_Category__c = 'SLTV';
+        hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+        hospital.State_Master__c = al.id;
+        hospital.City_Master__c = al2.id;
+        hospital.Town__c = '涓滀含';
+        insert hospital;
+        StaticParameter.EscapeAccountTrigger = true;
+        // 鎴︾暐绉戝銈掑緱銈�
+        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+        dep.Name = 'test dep1';
+        dep.AgentCode_Ext__c = '9999999';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+
+        Contact contact2 = new Contact();
+        contact2.AccountId = dep.Id;
+        contact2.FirstName = '璨换鑰�';
+        contact2.LastName = 'test1缁忛攢鍟�';
+        insert contact2;
+
+        // 浜у搧
+        Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',
+                Fixture_Model_No_T__c = 'n01', Asset_Model_No__c = 'Pro1',
+                ProductCode_Ext__c='pc01',Manual_Entry__c=false);
+        Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing',
+                Fixture_Model_No_T__c = 'n02', Asset_Model_No__c = 'Pro2',
+                ProductCode_Ext__c='pc02',Manual_Entry__c=false);
+        Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing',
+                Fixture_Model_No_T__c = 'n03', Asset_Model_No__c = 'Pro3',
+                ProductCode_Ext__c='pc03',Manual_Entry__c=false);
+        Product2 pro4 = new Product2(Name='name04',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n04',Serial_Lot_No__c='Lot tracing',
+                Fixture_Model_No_T__c = 'n04', Asset_Model_No__c = 'Pro4',
+                ProductCode_Ext__c='pc04',Manual_Entry__c=false);
+        insert new Product2[] {pro1, pro2, pro3, pro4};
+
+        Campaign cam = new Campaign();
+            cam.Name = 'test campaign';
+            cam.StartDate = Date.today().addDays(15);
+            cam.EndDate = Date.today().addDays(18);
+            cam.Name2__c = '1234';
+            cam.Status = '鍙栨秷';
+            cam.Mailflg_after45__c = true;
+            cam.Mailflg_cancel__c = true;
+            cam.Mailflg_before15__c = true;
+            cam.Mailflg_before7__c = true;
+            cam.Mailflg_after3__c = true;
+            cam.HostName__c = '1';
+            cam.cooperatorCompany__c = '1';
+            cam.RecordTypeId = System.label.RecordType_CampaignService;
+            cam.OwnerId = user.Id;
+        cam.IF_Approved__c = true;
+        insert cam;
+        //澶囧搧鍊熷嚭鐢宠
+        Rental_Apply__c raObj = new Rental_Apply__c();
+        raObj.Name = 'testra';
+        raObj.OwnerId = user.Id;
+        raObj.Product_category__c = 'GI';
+        raObj.Demo_purpose1__c = '浜у搧璇曠敤';
+        raObj.demo_purpose2__c = FixtureUtil.raDemo_purpose2MAP.get('shiyongwuxunjia');
+        raObj.direct_send__c = '鍖荤枟鏈烘瀯';
+        raObj.Loaner_received_staff__c = '鐜嬩簲';
+        raObj.Loaner_received_staff_phone__c = '110';
+        raObj.direct_shippment_address__c = '鍖椾含甯�';
+        raObj.Hospital__c = hospital.Id;
+        raObj.Strategic_dept__c = strategicDep[0].Id;
+        raObj.Account__c = dep.Id;
+        raObj.Request_shipping_day__c = Date.toDay();
+        raObj.Hope_Lonaer_date_Num__c = 1;
+        //raObj.Request_return_day__c = Date.toDay();
+        raObj.Answer_for_request__c = 'Test';
+        raObj.Asset_loaner_start_day__c = Date.today();
+        raObj.Asset_loaner_closed_day__c = Date.today();
+        raObj.Phone_number__c = '1234567890';
+        raObj.Loaner_medical_Staff__c = contact2.Id;
+        raObj.Campaign__c = cam.id;
+        insert raObj;
+        List<Rental_Apply__c> RaTarList = [select Name,Campaign__c,Repair__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,demo_purpose2__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,
+                                                Campaign__r.Status,Campaign__r.IF_Approved__c,repair__r.Return_Without_Repair_Date__c,Repair__r.Repair_Final_Inspection_Date__c,Repair__r.Repair_Shipped_Date__c
+                                            from Rental_Apply__c 
+                                            where id = :raObj.id];
+                                            
+                                            system.assertEquals(RaTarList[0].Campaign__r.Status,'鍙栨秷');
+                                            system.assertEquals(RaTarList[0].Campaign__r.IF_Approved__c,true);
+        // 淇濇湁璁惧
+        Asset asset1 = new Asset(Asset_Owner__c = 'Olympus');
+        asset1.RecordTypeId = System.Label.Asset_RecordType;
+        asset1.SerialNumber = 'asset1';
+        asset1.Name = 'asset1';
+        asset1.AccountId = dep.Id;
+        asset1.Department_Class__c = strategicDep[0].Id;
+        asset1.Hospital__c = hospital.Id;
+        asset1.Product2Id = pro1.Id;
+        asset1.Quantity = 11;
+        asset1.Status = '涓嶆槑';
+        asset1.Manage_type__c = '涓綋绠$悊';
+        asset1.Loaner_accsessary__c = false;
+        asset1.Out_of_wh__c = 0;
+        asset1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset1.Product_category__c = 'GI';
+        asset1.Equipment_Type__c = '浜у搧璇曠敤';
+        asset1.SalesProvince__c = '鍖椾含';
+        asset1.CompanyOfEquipment__c = '鍖椾含';
+        asset1.Internal_Asset_number__c = '0001';
+
+        Asset asset2 = new Asset(Asset_Owner__c = 'Olympus');
+        asset2.RecordTypeId = System.Label.Asset_RecordType;
+        asset2.SerialNumber = 'asset2';
+        asset2.Name = 'asset2';
+        asset2.AccountId = dep.Id;
+        asset2.Department_Class__c = strategicDep[0].Id;
+        asset2.Hospital__c = hospital.Id;
+        asset2.Product2Id = pro2.Id;
+        asset2.Quantity = 11;
+        asset2.Status = '涓嶆槑';
+        asset2.Manage_type__c = '涓綋绠$悊';
+        asset2.Loaner_accsessary__c = true;
+        asset2.Out_of_wh__c = 0;
+        asset2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset2.Product_category__c = 'GI';
+        asset2.Equipment_Type__c = '浜у搧璇曠敤';
+        asset2.SalesProvince__c = '鍖椾含';
+        asset2.CompanyOfEquipment__c = '鍖椾含';
+        asset2.Internal_Asset_number__c = '0002';
+
+        Asset asset3 = new Asset(Asset_Owner__c = 'Olympus');
+        asset3.RecordTypeId = System.Label.Asset_RecordType;
+        asset3.SerialNumber = 'asset3';
+        asset3.Name = 'asset3';
+        asset3.AccountId = dep.Id;
+        asset3.Department_Class__c = strategicDep[0].Id;
+        asset3.Hospital__c = hospital.Id;
+        asset3.Product2Id = pro3.Id;
+        asset3.Quantity = 15;
+        asset3.Status = '涓嶆槑';
+        asset3.Manage_type__c = '鏁伴噺绠$悊';
+        asset3.Loaner_accsessary__c = true;
+        asset3.Out_of_wh__c = 0;
+        asset3.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset3.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset3.Product_category__c = 'GI';
+        asset3.Equipment_Type__c = '浜у搧璇曠敤';
+        asset3.SalesProvince__c = '鍖椾含';
+        asset3.CompanyOfEquipment__c = '鍖椾含';
+        asset3.Internal_Asset_number__c = '0003';
+
+        Asset asset4 = new Asset(Asset_Owner__c = 'Olympus');
+        asset4.RecordTypeId = System.Label.Asset_RecordType;
+        asset4.SerialNumber = 'asset4';
+        asset4.Name = 'asset4';
+        asset4.AccountId = dep.Id;
+        asset4.Department_Class__c = strategicDep[0].Id;
+        asset4.Hospital__c = hospital.Id;
+        asset4.Product2Id = pro4.Id;
+        asset4.Quantity = 20;
+        asset4.Status = '涓嶆槑';
+        asset4.Manage_type__c = '鏁伴噺绠$悊';
+        asset4.Loaner_accsessary__c = true;
+        asset4.Out_of_wh__c = 0;
+        asset4.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset4.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset4.Product_category__c = 'GI';
+        asset4.Equipment_Type__c = '浜у搧璇曠敤';
+        asset4.SalesProvince__c = '鍖椾含';
+        asset4.CompanyOfEquipment__c = '鍖椾含';
+        asset4.Internal_Asset_number__c = '0004';
+        insert new Asset[] {asset1, asset2, asset3, asset4};
+
+        // 澶囧搧涓�瀵逛竴Link琛�
+        Fixture_OneToOne_Link__c foLink1 = new Fixture_OneToOne_Link__c();
+        foLink1.Main_Asset__c = asset1.Id;
+        foLink1.Accessory_Asset__c = asset2.Id;
+        foLink1.Quantity__c = 1;
+
+        Fixture_OneToOne_Link__c foLink2 = new Fixture_OneToOne_Link__c();
+        foLink2.Main_Asset__c = asset1.Id;
+        foLink2.Accessory_Asset__c = asset3.Id;
+        foLink2.Quantity__c = 1;
+        insert new Fixture_OneToOne_Link__c[] {foLink1, foLink2};
+
+        // 澶囧搧閰嶅
+        Fixture_Set__c fsObj1 = new Fixture_Set__c();
+        fsObj1.Name = 'set1';
+        fsObj1.Fixture_Set_Body_Model_No__c = 'modelNo1';
+        fsObj1.Loaner_name__c = 'name1';
+        insert fsObj1;
+
+        // 澶囧搧閰嶅鏄庣粏
+        Fixture_Set_Detail__c fsdObjA1 = new Fixture_Set_Detail__c();
+        fsdObjA1.Name = '澶囧搧閰嶅鏄庣粏鍚�1';
+        fsdObjA1.Name_CHN_Created__c = '涓枃鍚嶇О1';
+        fsdObjA1.Product2__c = pro1.Id;
+        fsdObjA1.Fixture_Set__c = fsObj1.Id;
+        fsdObjA1.Is_Body__c = true;
+        fsdObjA1.Is_Optional__c = false;
+        fsdObjA1.UniqueKey__c = fsObj1.Id + ':' + pro1.Id;
+        fsdObjA1.SortInt__c = 1;
+        fsdObjA1.Quantity__c = 1;
+
+        Fixture_Set_Detail__c fsdObjA2 = new Fixture_Set_Detail__c();
+        fsdObjA2.Name = '澶囧搧閰嶅鏄庣粏鍚�2';
+        fsdObjA2.Name_CHN_Created__c = '涓枃鍚嶇О2';
+        fsdObjA2.Product2__c = pro2.Id;
+        fsdObjA2.Fixture_Set__c = fsObj1.Id;
+        fsdObjA2.Is_Body__c = false;
+        fsdObjA2.Is_Optional__c = true;
+        fsdObjA2.UniqueKey__c = fsObj1.Id + ':' + pro2.Id;
+        fsdObjA2.SortInt__c = 2;
+        fsdObjA2.Quantity__c = 1;
+        fsdObjA2.Is_OneToOne__c = true;
+
+        Fixture_Set_Detail__c fsdObjA3 = new Fixture_Set_Detail__c();
+        fsdObjA3.Name = '澶囧搧閰嶅鏄庣粏鍚�3';
+        fsdObjA3.Name_CHN_Created__c = '涓枃鍚嶇О3';
+        fsdObjA3.Product2__c = pro3.Id;
+        fsdObjA3.Fixture_Set__c = fsObj1.Id;
+        fsdObjA3.Is_Body__c = false;
+        fsdObjA3.Is_Optional__c = true;
+        fsdObjA3.UniqueKey__c = fsObj1.Id + ':' + pro3.Id;
+        fsdObjA3.SortInt__c = 3;
+        fsdObjA3.Quantity__c = 2;
+        fsdObjA3.Is_OneToOne__c = true;
+
+        Fixture_Set_Detail__c fsdObjA4 = new Fixture_Set_Detail__c();
+        fsdObjA4.Name = '澶囧搧閰嶅鏄庣粏鍚�4';
+        fsdObjA4.Name_CHN_Created__c = '涓枃鍚嶇О4';
+        fsdObjA4.Product2__c = pro4.Id;
+        fsdObjA4.Fixture_Set__c = fsObj1.Id;
+        fsdObjA4.Is_Body__c = false;
+        fsdObjA4.Is_Optional__c = true;
+        fsdObjA4.UniqueKey__c = fsObj1.Id + ':' + pro4.Id;
+        fsdObjA4.SortInt__c = 4;
+        fsdObjA4.Quantity__c = 2;
+        fsdObjA4.Is_OneToOne__c = false;
+        fsdObjA4.Is_Optional__c = true;
+        insert new Fixture_Set_Detail__c[] {fsdObjA1, fsdObjA2, fsdObjA3, fsdObjA4};
+
+        // 鍊熷嚭澶囧搧閰嶅涓�瑙�
+        Rental_Apply_Equipment_Set__c raesObj = new Rental_Apply_Equipment_Set__c();
+        raesObj.Rental_Apply__c = raObj.Id;
+        raesObj.Fixture_Set__c = fsObj1.Id;
+        raesObj.Cancel_Select__c = false;
+        raesObj.Rental_Start_Date__c = Date.toDay();
+        raesObj.Rental_End_Date__c = Date.toDay();
+        raesObj.IndexFromUniqueKey__c = 1;
+        raesObj.UniqueKey__c = '1:'+ fsObj1.Id + ':1';
+        insert raesObj;
+
+        // 鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁�
+        Rental_Apply_Equipment_Set_Detail__c raesdObj1 = new Rental_Apply_Equipment_Set_Detail__c();
+        raesdObj1.Rental_Apply__c = raObj.Id;
+        raesdObj1.Fixture_Set_Detail__c = fsdObjA1.Id;
+        raesdObj1.Rental_Num__c = 1;
+        raesdObj1.Queue_Number__c = null;
+        raesdObj1.Is_Body__c = true;
+        raesdObj1.Rental_Apply_Equipment_Set__c = raesObj.Id;
+        raesdObj1.IndexFromUniqueKey__c = 1;
+        raesdObj1.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA1.Id + ':1';
+        raesdObj1.FSD_OneToOneAccessory_Cnt__c = 2;
+        raesdObj1.FSD_Is_Optional__c = false;
+        raesdObj1.FSD_Is_OneToOne__c = false;
+        raesdObj1.ApplyPersonAppended__c = false;
+        raesdObj1.FSD_Fixture_Model_No__c = 'n01';
+        raesdObj1.Fixture_Model_No_text__c = 'n01';
+        raesdObj1.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        raesdObj1.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+        raesdObj1.Product_category_text__c = 'GI';
+        raesdObj1.Equipment_Type_text__c = '浜у搧璇曠敤';
+
+        Rental_Apply_Equipment_Set_Detail__c raesdObj2 = new Rental_Apply_Equipment_Set_Detail__c();
+        raesdObj2.Rental_Apply__c = raObj.Id;
+        raesdObj2.Fixture_Set_Detail__c = fsdObjA2.Id;
+        raesdObj2.Rental_Num__c = 1;
+        raesdObj2.Queue_Number__c = null;
+        raesdObj2.Is_Body__c = false;
+        raesdObj2.Rental_Apply_Equipment_Set__c = raesObj.Id;
+        raesdObj2.IndexFromUniqueKey__c = 2;
+        raesdObj2.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA2.Id + ':2';
+        raesdObj2.FSD_OneToOneAccessory_Cnt__c = 2;
+        raesdObj2.FSD_Is_Optional__c = false;
+        raesdObj2.FSD_Is_OneToOne__c = true;
+        raesdObj2.ApplyPersonAppended__c = false;
+        raesdObj2.FSD_Fixture_Model_No__c = 'n02';
+        raesdObj2.Fixture_Model_No_text__c = 'n02';
+        raesdObj2.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        raesdObj2.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+        raesdObj2.Product_category_text__c = 'GI';
+        raesdObj2.Equipment_Type_text__c = '浜у搧璇曠敤';
+
+        Rental_Apply_Equipment_Set_Detail__c raesdObj3 = new Rental_Apply_Equipment_Set_Detail__c();
+        raesdObj3.Rental_Apply__c = raObj.Id;
+        raesdObj3.Fixture_Set_Detail__c = fsdObjA3.Id;
+        raesdObj3.Rental_Num__c = 2;
+        raesdObj3.Queue_Number__c = null;
+        raesdObj3.Is_Body__c = false;
+        raesdObj3.Rental_Apply_Equipment_Set__c = raesObj.Id;
+        raesdObj3.IndexFromUniqueKey__c = 3;
+        raesdObj3.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA3.Id + ':3';
+        raesdObj3.FSD_OneToOneAccessory_Cnt__c = 2;
+        raesdObj3.FSD_Is_Optional__c = false;
+        raesdObj3.FSD_Is_OneToOne__c = true;
+        raesdObj3.ApplyPersonAppended__c = false;
+        raesdObj3.FSD_Fixture_Model_No__c = 'n03';
+        raesdObj3.Fixture_Model_No_text__c = 'n03';
+        raesdObj3.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        raesdObj3.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+        raesdObj3.Product_category_text__c = 'GI';
+        raesdObj3.Equipment_Type_text__c = '浜у搧璇曠敤';
+
+        Rental_Apply_Equipment_Set_Detail__c raesdObj4 = new Rental_Apply_Equipment_Set_Detail__c();
+        raesdObj4.Rental_Apply__c = raObj.Id;
+        raesdObj4.Fixture_Set_Detail__c = fsdObjA3.Id;
+        raesdObj4.Rental_Num__c = 2;
+        raesdObj4.Queue_Number__c = null;
+        raesdObj4.Is_Body__c = false;
+        raesdObj4.Rental_Apply_Equipment_Set__c = raesObj.Id;
+        raesdObj4.IndexFromUniqueKey__c = 4;
+        raesdObj4.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA3.Id + ':4';
+        raesdObj4.FSD_OneToOneAccessory_Cnt__c = 2;
+        raesdObj4.FSD_Is_Optional__c = false;
+        raesdObj4.FSD_Is_OneToOne__c = true;
+        raesdObj4.ApplyPersonAppended__c = false;
+        raesdObj4.FSD_Fixture_Model_No__c = 'n03';
+        raesdObj4.Fixture_Model_No_text__c = 'n03';
+        raesdObj4.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        raesdObj4.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+        raesdObj4.Product_category_text__c = 'GI';
+        raesdObj4.Equipment_Type_text__c = '浜у搧璇曠敤';
+
+        Rental_Apply_Equipment_Set_Detail__c raesdObj5 = new Rental_Apply_Equipment_Set_Detail__c();
+        raesdObj5.Rental_Apply__c = raObj.Id;
+        raesdObj5.Fixture_Set_Detail__c = fsdObjA4.Id;
+        raesdObj5.Rental_Num__c = 2;
+        raesdObj5.Queue_Number__c = null;
+        raesdObj5.Is_Body__c = false;
+        raesdObj5.Rental_Apply_Equipment_Set__c = raesObj.Id;
+        raesdObj5.IndexFromUniqueKey__c = 5;
+        raesdObj5.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA4.Id + ':5';
+        raesdObj5.FSD_OneToOneAccessory_Cnt__c = 2;
+        raesdObj5.FSD_Is_Optional__c = true;
+        raesdObj5.FSD_Is_OneToOne__c = false;
+        raesdObj5.ApplyPersonAppended__c = false;
+        raesdObj5.FSD_Fixture_Model_No__c = 'n04';
+        raesdObj5.Fixture_Model_No_text__c = 'n04';
+        raesdObj5.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        raesdObj5.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+        raesdObj5.Product_category_text__c = 'GI';
+        raesdObj5.Equipment_Type_text__c = '浜у搧璇曠敤';
+
+        Rental_Apply_Equipment_Set_Detail__c raesdObj6 = new Rental_Apply_Equipment_Set_Detail__c();
+        raesdObj6.Rental_Apply__c = raObj.Id;
+        raesdObj6.Fixture_Set_Detail__c = fsdObjA4.Id;
+        raesdObj6.Rental_Num__c = 2;
+        raesdObj6.Queue_Number__c = null;
+        raesdObj6.Is_Body__c = false;
+        raesdObj6.Rental_Apply_Equipment_Set__c = raesObj.Id;
+        raesdObj6.IndexFromUniqueKey__c = 6;
+        raesdObj6.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA4.Id + ':6';
+        raesdObj6.FSD_OneToOneAccessory_Cnt__c = 2;
+        raesdObj6.FSD_Is_Optional__c = true;
+        raesdObj6.FSD_Is_OneToOne__c = false;
+        raesdObj6.ApplyPersonAppended__c = false;
+        raesdObj6.FSD_Fixture_Model_No__c = 'n04';
+        raesdObj6.Fixture_Model_No_text__c = 'n04';
+        raesdObj6.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        raesdObj6.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+        raesdObj6.Product_category_text__c = 'GI';
+        raesdObj6.Equipment_Type_text__c = '浜у搧璇曠敤';
+        insert new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3,raesdObj4,raesdObj5,raesdObj6};
+        Test.setCreatedDate(raObj.Id, Datetime.now().addDays(-2));
+        // 鐢宠鍗�
+        raObj.Status__c = FixtureUtil.raStatusMap.get(FixtureUtil.RaStatus.Yi_Pi_Zhun.ordinal());
+        raObj.Status_Text__c = FixtureUtil.raStatusMap.get(FixtureUtil.RaStatus.Yi_Pi_Zhun.ordinal());
+        raObj.NotWatch_RA_Status__c = true;
+        raObj.Request_approval_time__c = Datetime.now().addDays(-1);
+        update raObj;
+
+        // 鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁�
+        raesdObj1.Select_Time__c = Date.toDay();
+        raesdObj1.Asset__c = asset1.Id;
+        raesdObj1.Loaner_accsessary__c = false;
+        raesdObj1.FSD_Name_CHN__c = 'name01';
+        raesdObj1.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Yi_Fen_Pei.ordinal());
+        raesdObj2.Select_Time__c = Date.toDay();
+        raesdObj2.Asset__c = asset2.Id;
+        raesdObj2.Loaner_accsessary__c = true;
+        raesdObj2.Fixture_OneToOne_Link_Id__c = foLink1.Id;
+        raesdObj2.FSD_Name_CHN__c = 'name02';
+        raesdObj2.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Yi_Fen_Pei.ordinal());
+        raesdObj3.Select_Time__c = Date.toDay();
+        raesdObj3.Asset__c = asset3.Id;
+        raesdObj3.Loaner_accsessary__c = true;
+        raesdObj3.Fixture_OneToOne_Link_Id__c = foLink2.Id;
+        raesdObj3.FSD_Name_CHN__c = 'name03';
+        raesdObj3.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Yi_Fen_Pei.ordinal());
+        raesdObj4.Select_Time__c = Date.toDay();
+        raesdObj4.Asset__c = asset3.Id;
+        raesdObj4.Loaner_accsessary__c = true;
+        raesdObj4.FSD_Name_CHN__c = 'name03';
+        raesdObj4.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Yi_Fen_Pei.ordinal());
+        raesdObj5.Select_Time__c = Date.toDay();
+        raesdObj5.Asset__c = asset4.Id;
+        raesdObj5.Loaner_accsessary__c = true;
+        raesdObj5.FSD_Name_CHN__c = 'name04';
+        raesdObj5.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Yi_Fen_Pei.ordinal());
+        raesdObj6.Select_Time__c = Date.toDay();
+        raesdObj6.Asset__c = asset4.Id;
+        raesdObj6.Loaner_accsessary__c = true;
+        raesdObj6.FSD_Name_CHN__c = 'name04';
+        raesdObj6.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Yi_Fen_Pei.ordinal());
+        // update new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3,raesdObj4,raesdObj5,raesdObj6};
+
+        // 鍒嗛厤鍚庝慨鏀筧sset閲岄潰鐨勬暟鎹�
+        asset1.Last_Reserve_RAES_Detail__c = raesdObj1.Id;
+        asset1.Out_of_wh__c = 1;
+        asset1.Lei_Ji_Jie_Chu_Shu_Jia__c = 1;
+        asset2.Last_Reserve_RAES_Detail__c = raesdObj2.Id;
+        asset2.Out_of_wh__c = 1;
+        asset2.Lei_Ji_Jie_Chu_Shu_Jia__c = 1;
+        asset3.Last_Reserve_RAES_Detail__c = null;
+        asset3.Out_of_wh__c = 2;
+        asset3.Lei_Ji_Jie_Chu_Shu_Jia__c = 2;
+        asset4.Last_Reserve_RAES_Detail__c = null;
+        asset4.Out_of_wh__c = 2;
+        asset4.Lei_Ji_Jie_Chu_Shu_Jia__c = 2;
+        // update new Asset[] {asset1,asset2,asset3,asset4};
+
+        // 鍑哄簱鎸囩ず鎿嶄綔 涓嬫灦鎿嶄綔
+        raesdObj1.Shipment_request_time2__c = Date.toDay();
+        raesdObj1.Shipment_request__c = true;
+        raesdObj1.StockDown__c = true;
+        raesdObj1.StockDown_time__c = Date.toDay();
+        raesdObj1.StockDown_staff__c = Userinfo.getUserId();
+        raesdObj1.Inspection_result__c = 'OK';
+        raesdObj1.Pre_inspection_time__c = System.now();
+        raesdObj1.Inspection_staff__c = Userinfo.getUserId();
+        raesdObj1.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
+        
+        raesdObj2.Shipment_request_time2__c = Date.toDay();
+        raesdObj2.Shipment_request__c = true;
+        raesdObj2.StockDown__c = true;
+        raesdObj2.StockDown_time__c = Date.toDay();
+        raesdObj2.StockDown_staff__c = Userinfo.getUserId();
+        raesdObj2.Inspection_result__c = 'OK';
+        raesdObj2.Pre_inspection_time__c = System.now();
+        raesdObj2.Inspection_staff__c = Userinfo.getUserId();
+        raesdObj2.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
+        
+        raesdObj3.Shipment_request_time2__c = Date.toDay();
+        raesdObj3.Shipment_request__c = true;
+        raesdObj3.StockDown__c = true;
+        raesdObj3.StockDown_time__c = Date.toDay();
+        raesdObj3.StockDown_staff__c = Userinfo.getUserId();
+        raesdObj3.Inspection_result__c = 'OK';
+        raesdObj3.Pre_inspection_time__c = System.now();
+        raesdObj3.Inspection_staff__c = Userinfo.getUserId();
+        raesdObj3.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
+        
+        raesdObj4.Shipment_request_time2__c = Date.toDay();
+        raesdObj4.Shipment_request__c = true;
+        raesdObj4.StockDown__c = true;
+        raesdObj4.StockDown_time__c = Date.toDay();
+        raesdObj4.StockDown_staff__c = Userinfo.getUserId();
+        raesdObj4.Inspection_result__c = 'OK';
+        raesdObj4.Pre_inspection_time__c = System.now();
+        raesdObj4.Inspection_staff__c = Userinfo.getUserId();
+        raesdObj4.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
+        
+        raesdObj5.Shipment_request_time2__c = Date.toDay();
+        raesdObj5.Shipment_request__c = true;
+        raesdObj5.StockDown__c = true;
+        raesdObj5.StockDown_time__c = Date.toDay();
+        raesdObj5.StockDown_staff__c = Userinfo.getUserId();
+        raesdObj5.Inspection_result__c = 'OK';
+        raesdObj5.Pre_inspection_time__c = System.now();
+        raesdObj5.Inspection_staff__c = Userinfo.getUserId();
+        raesdObj5.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
+        
+        raesdObj6.Shipment_request_time2__c = Date.toDay();
+        raesdObj6.Shipment_request__c = true;
+        raesdObj6.StockDown__c = true;
+        raesdObj6.StockDown_time__c = Date.toDay();
+        raesdObj6.StockDown_staff__c = Userinfo.getUserId();
+        raesdObj6.Inspection_result__c = 'OK';
+        raesdObj6.Pre_inspection_time__c = System.now();
+        raesdObj6.Inspection_staff__c = Userinfo.getUserId();
+        raesdObj6.Shipment_Status_Text__c = FixtureUtil.raesdStatusMap.get(FixtureUtil.HistoryStatus.Chu_Ku_Qian_Yi_Jian_Ce.ordinal());
+        update new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3,raesdObj4,raesdObj5,raesdObj6};
+    }}
+
     static testMethod void testSave() {
         Oly_TriggerHandler.bypass('RentalApplyTriggerHandler');
          setupTestData(); 
@@ -596,4 +1147,55 @@
         essr3Controller.save();
          // system.Test.stopTest();
     }
+    static testMethod void test2(){
+        Oly_TriggerHandler.bypass('RentalApplyTriggerHandler');
+         setupTestData2(); 
+        CreateRelationListPagingCmpCtrl cmp;
+        PageReference ref;
+        List<Rental_Apply__c> raObjs;
+        Rental_Apply__c raObj;
+        List<Rental_Apply_Equipment_Set__c> raesObjs;
+        Rental_Apply_Equipment_Set__c raesObj;
+        List<Rental_Apply_Equipment_Set_Detail__c> raesdObjs;
+        raesObjs = [select Id, RAES_Status__c FROM Rental_Apply_Equipment_Set__c];
+        raesdObjs = [select Id, Rental_Apply_Equipment_Set__c,RAESD_Status__c from Rental_Apply_Equipment_Set_Detail__c];
+         
+        // 鍙戣揣鍗�
+        FixtureDeliverySlip__c fdsObj = new FixtureDeliverySlip__c();
+        fdsObj.Name = '00001';
+        fdsObj.DeliveryCompany__c = '鍒╄';
+        fdsObj.Distributor_method__c = '闄嗚繍';
+        fdsObj.DeliveryType__c = '鍙戣揣';
+        insert fdsObj;
+
+        // 鍙戣揣鎿嶄綔
+        ref = new PageReference('/apex/EquipmentSetShippmentReceived3?id=' + raesObjs[0].Id + '&step=鏄庣粏');
+        Test.setCurrentPage(ref);
+        EquipmentSetShippmentReceived3Controller essr3Controller = new EquipmentSetShippmentReceived3Controller();
+        essr3Controller.init();
+        essr3Controller.getEsdListSize();
+        essr3Controller.CheckedId = raesObjs[0].Id;
+        essr3Controller.filljsQRAction(); //鎵弿鍏朵粬鐢宠浼氬鍔犳槑缁� 
+        for (EquipmentSetShippmentReceived3Controller.EsdInfo esdInfo : essr3Controller.esdList) {
+            esdInfo.isChecked = true;
+        }        
+        // system.test.startTest();
+        essr3Controller.UnCheckedId = raesObjs[0].Id;
+        essr3Controller.deleteDetail(); //鍒犻櫎鏄庣粏
+        essr3Controller.ShippmentAdd(); //杩藉姞 鍒版槑缁嗛〉闈�
+        essr3Controller.CheckedId = raesObjs[0].Id;
+        // essr3Controller.filljsQRAction();
+        // for (EquipmentSetShippmentReceived3Controller.EsdInfo esdInfo : essr3Controller.esdList) {
+        //     esdInfo.isChecked = true;
+        // }
+        essr3Controller.ShippmentDetail(); //鍙戣揣鍓�-妫�娴�
+        essr3Controller.slip.Name = '00001';
+        essr3Controller.searchSlip();
+        essr3Controller.slip.Name = '00002';
+        essr3Controller.slip.DeliveryType__c = '鍙戣揣';
+        essr3Controller.slip.Distributor_method__c = '闄嗚繍';
+        essr3Controller.slip.DeliveryCompany__c = '鍒╄';
+               
+        essr3Controller.save();
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/EquipmentTargetCoverageBatch.cls b/force-app/main/default/classes/EquipmentTargetCoverageBatch.cls
new file mode 100644
index 0000000..a2882a6
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentTargetCoverageBatch.cls
@@ -0,0 +1,50 @@
+global class EquipmentTargetCoverageBatch implements Database.Batchable<sObject> {
+    public String query;
+    // public List<Id> prdIds = new List<Id>();
+    public List<Id> hospIds = new List<Id>();
+    global EquipmentTargetCoverageBatch() {
+        this.query = query;
+    }
+
+    global Database.QueryLocator start(Database.BatchableContext bc) {
+        // List<String> classify = new List<String>();
+        // classify.add('杞�ч暅');
+        // classify.add('纭�ч暅');
+        // classify.add('鍛ㄨ竟');
+        // List<Product2> prdList = [select Id,ServiceCategory__c from Product2 where ServiceCategory__c in :classify and Can_Repair__c != '涓�'];
+        // system.debug('浜у搧'+prdList);
+        // if (prdList!=null) {
+        //     for (Product2 p : prdList) {
+        //     prdIds.add(p.Id);
+        //     }
+        // }
+       List<AggregateResult> Asset1 = [select count(Id),Hospital__c from asset where Product2.ServiceCategory__c ='杞�ч暅'  Group by Hospital__c having count(Id)>=5];
+        system.debug('绗竴閲�'+Asset1);
+       if(Asset1!=null){
+           for (AggregateResult a1 : Asset1) {
+               hospIds.add(String.valueOf(a1.get('Hospital__c')));
+           }
+       }
+       
+       query = 'select Id,IF_Coverage_Target_Asset__c from asset where hospital__c in :hospIds' 
+                            +' and Status != \'寤冩\' and Status != \'寰呮姤搴焅''
+                            +' and SerMarGuranteeType__c != \'鏈嶅姟澶氬勾淇濅慨\' and SerMarGuranteeType__c != \'甯傚満澶氬勾淇濅慨\''
+                            +' and Product2.ServiceCategory__c != null';
+        return Database.getQueryLocator(query);
+    }
+
+    global void execute(Database.BatchableContext BC, list<Asset> Assets) {
+        List<Asset> AssetsNew = new List<Asset>();
+        system.debug('绗簩閲�'+Assets);
+        for (Asset a : Assets) {
+            // a.IF_Coverage_Target_Asset__c = true;
+            AssetsNew.add(a);
+        }
+        update AssetsNew;
+        system.debug('鎵ц瀹屾垚');
+    }
+
+    global void finish(Database.BatchableContext BC) {
+
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/EquipmentTargetCoverageBatch.cls-meta.xml b/force-app/main/default/classes/EquipmentTargetCoverageBatch.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/EquipmentTargetCoverageBatch.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>51.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/EventToProjectSummaryBatch.cls b/force-app/main/default/classes/EventToProjectSummaryBatch.cls
new file mode 100644
index 0000000..d61f207
--- /dev/null
+++ b/force-app/main/default/classes/EventToProjectSummaryBatch.cls
@@ -0,0 +1,19 @@
+global class EventToProjectSummaryBatch implements Database.Batchable<sObject> {
+    public String query;
+
+    global EventToProjectSummaryBatch() {
+        this.query = query;
+    }
+
+    global Database.QueryLocator start(Database.BatchableContext bc) {
+        return Database.getQueryLocator(query);
+    }
+
+    global void execute(Database.BatchableContext BC, list<Sobject> scope) {
+        
+    }
+
+    global void finish(Database.BatchableContext BC) {
+
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/EventToProjectSummaryBatch.cls-meta.xml b/force-app/main/default/classes/EventToProjectSummaryBatch.cls-meta.xml
new file mode 100644
index 0000000..db9bf8c
--- /dev/null
+++ b/force-app/main/default/classes/EventToProjectSummaryBatch.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>48.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/FixtureUtil.cls b/force-app/main/default/classes/FixtureUtil.cls
index abbbd25..229db5a 100644
--- a/force-app/main/default/classes/FixtureUtil.cls
+++ b/force-app/main/default/classes/FixtureUtil.cls
@@ -1521,11 +1521,11 @@
     public static void withoutUpsertIh(List<Inventory_Header__c> sobj) {
         if (!sobj.isEmpty()) upsert sobj UniqueKey__c;
     }
-
+    // 20220224 ljh 113鐩樼偣 Copy  start
     public static void withoutUpsertIhCopy(List<Inventory_Header_Copy__c> sobj) {
         if (!sobj.isEmpty()) upsert sobj UniqueKey__c;
     }
-
+    // 20220224 ljh 113鐩樼偣 Copy  end
     public static void withoutUpsertRaesd(List<Rental_Apply_Equipment_Set_Detail__c> sobj) {
         if (!sobj.isEmpty()) upsert sobj UniqueKey__c;
     }
diff --git a/force-app/main/default/classes/FollowTriggerHandler.cls b/force-app/main/default/classes/FollowTriggerHandler.cls
new file mode 100644
index 0000000..dc395ea
--- /dev/null
+++ b/force-app/main/default/classes/FollowTriggerHandler.cls
@@ -0,0 +1,33 @@
+public without sharing class FollowTriggerHandler extends Oly_TriggerHandler{
+	private Map<Id, Inquiry_form__c> newMap;
+    private Map<Id, Inquiry_form__c> oldMap;
+    private List<Inquiry_form__c> newList;
+    private List<Inquiry_form__c> oldList;
+	public FollowTriggerHandler() {
+		this.newMap = (Map<Id, Inquiry_form__c>) Trigger.newMap;
+        this.oldMap = (Map<Id, Inquiry_form__c>) Trigger.oldMap;
+        this.newList = (List<Inquiry_form__c>) Trigger.new;
+        this.oldList = (List<Inquiry_form__c>) Trigger.old;
+        Integer i = 0;
+	}
+	protected override void afterUpdate() {
+		followUpdate();
+	}
+	public void followUpdate(){
+		Map<SObject,List<String>> data = new Map<SObject,List<String>>();
+		List<ReportMemo__c> rmList = new List<ReportMemo__c>();
+		for (Inquiry_form__c inquiry : newList) {
+			List<String> strList = new List<String>();
+			Inquiry_form__c oldInquiry = null;
+			if (Trigger.isUpdate) {
+			    oldInquiry = oldMap.get(inquiry.Id);
+			}
+			if (oldInquiry == null || inquiry.Product1__c != oldInquiry.Product1__c) {
+			    strList.add('Product1__c');
+			}
+			data.put(inquiry, strList);
+		}
+		SplitOptionListUtil util = new SplitOptionListUtil();
+		util.makeObject(data);
+	}
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/FollowTriggerHandler.cls-meta.xml b/force-app/main/default/classes/FollowTriggerHandler.cls-meta.xml
new file mode 100644
index 0000000..f3bac1f
--- /dev/null
+++ b/force-app/main/default/classes/FollowTriggerHandler.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>41.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/InquiryVerifyBatch.cls b/force-app/main/default/classes/InquiryVerifyBatch.cls
index 658fd02..335c567 100644
--- a/force-app/main/default/classes/InquiryVerifyBatch.cls
+++ b/force-app/main/default/classes/InquiryVerifyBatch.cls
@@ -1,9 +1,7 @@
-global class InquiryVerifyBatch implements  Database.Batchable<sObject>, Database.Stateful {
+global class InquiryVerifyBatch  implements Schedulable,Database.Batchable<SObject>,Database.Stateful {
     public String query;
 
     public Date start_date;
-
-    public Date end_date;
 
     global InquiryVerifyBatch() {
         // if(Test.isRunningTest()){
@@ -22,11 +20,13 @@
             month = 4;
         }
         start_date = Date.newInstance(year, month, 1);
-        end_date = start_date.addMonths(1);
 
-        this.query = 'select id,quoteSavedDate__c,Opportunity.Id,Opportunity.Department_Class__c from quote where Quote_No_last2__c = \'01\' and CreatedDate >= :start_date and CreatedDate < :end_date';
+        this.query = 'select id,quoteSavedDate__c,Opportunity.Id,Opportunity.Department_Class__c from quote where Quote_No_last2__c = \'01\' and CreatedDate >= :start_date';
     }
 
+    public void execute(SchedulableContext sc) {
+        Database.executeBatch(this);
+    }
     // global void execute(SchedulableContext sc){Database.executebatch(this);}
     global Database.QueryLocator start(Database.BatchableContext bc) {
         // 鑾峰彇鎶ヤ环鍗曟暟鎹�
@@ -48,7 +48,7 @@
                 createdDateStr = Date.today();
             }
             // 鑾峰彇鎶ヤ环浜у搧鏁版嵁锛岃幏鍙栫鍥涘垎绫�
-             List<QuoteLineItem> qlts = [Select Id,Product2.Category4__c from QuoteLineItem where QuoteId  = :quo.Id limit 200];
+             List<QuoteLineItem> qlts = [Select Id,Product2.Category4__c from QuoteLineItem where QuoteId  = :quo.Id and Product2.Important_product__c = true];
              List<String> c4  = new List<String>();
              List<String> qdept  = new List<String>();
              // 绗洓鍒嗙被鏀惧叆list
diff --git a/force-app/main/default/classes/InquiryVerifyBatchTest.cls b/force-app/main/default/classes/InquiryVerifyBatchTest.cls
index 4568557..c3064d1 100644
--- a/force-app/main/default/classes/InquiryVerifyBatchTest.cls
+++ b/force-app/main/default/classes/InquiryVerifyBatchTest.cls
@@ -21,15 +21,14 @@
     private static Date createdDateStr = Date.today();
 
     static testMethod void testMethod1() {
+        System.Test.StartTest();
         InitData();
-        // System.Test.StartTest();
-        // try {
-            ID exid = Database.executeBatch(new InquiryVerifyBatch(),1);
-            // System.abortJob(exid);
-        // } catch(Exception e){
 
-        // }        
-            // System.Test.StopTest();
+        ID exid = Database.executeBatch(new InquiryVerifyBatch(),1);
+        InquiryVerifyBatch bct1 = new InquiryVerifyBatch(null,null);
+        System.schedule('Scheduled Job 5', '0 45 * * * ?', bct1);
+         
+        System.Test.StopTest();
     }
 
     private static void InitData() {
@@ -163,9 +162,11 @@
             prd1.Category4__c = 'CV';
             prd1.Category5__c = '260SL绯诲垪';
             prd1.Asset_Model_No__c = '1001';
+            prd1.Important_product__c = true;
+            prd1.Important_Rroduct_1GI__c = true;
             insert prd1;
 
-            
+            System.assertEquals(prd1.Important_product__c,true);
 
             PricebookEntry entry = new PricebookEntry(Pricebook2Id = pricebookId, Product2Id = prd1.Id);
             entry.UnitPrice = 0;
@@ -173,7 +174,7 @@
             entry.UseStandardPrice = false;
             entry.CurrencyIsoCode = 'CNY';
             insert entry;
-
+            System.assertEquals(prd1.Important_product__c,true);
             List<Quote> qList = [Select Id, CurrencyIsoCode from Quote where Id = : quote.Id];
             System.assertEquals(1, qList.size());
             System.assertEquals('CNY', qList[0].CurrencyIsoCode);
@@ -189,7 +190,14 @@
             target.Product2Id = prd1.id;
             target.PricebookEntryId = entry.Id;
             insert target;
-
+            prd1.Important_product__c = true;
+            update prd1;
+            System.assertEquals(prd1.Important_product__c,true);
+            // System.assertEquals(target.Product2.Important_product__c,true);
+            system.assertEquals(target.Product2Id,prd1.id);
+            List<QuoteLineItem> qlts = [Select Id,Product2.Important_product__c,QuoteId from QuoteLineItem where id = :target.id];
+            System.assertEquals(qlts[0].Product2.Important_product__c,true);
+            System.assertEquals(qlts[0].QuoteId,quote.id);
             Consumable_order_details2__c saledet1 = new Consumable_order_details2__c();
             saledet1.Name = 'OCM_01_001001';
             // saledet1.Consumable_order_minor__c = Order1.Id;
diff --git a/force-app/main/default/classes/InventoryHeaderCopyHandler.cls b/force-app/main/default/classes/InventoryHeaderCopyHandler.cls
index 3cda643..33eb814 100644
--- a/force-app/main/default/classes/InventoryHeaderCopyHandler.cls
+++ b/force-app/main/default/classes/InventoryHeaderCopyHandler.cls
@@ -101,7 +101,7 @@
 
         }
         //20210427 you 1650 end
-        String reportNo = '', location = '', month = '';
+        String reportNo = '', location = '', month = '',day = '';
         for (Inventory_Header_Copy__c nObj : this.newList) {
             // 20210223 you WLIG-BV8CHF start
             // reportNo = 'OCMA-' + nObj.Report_No_Year__c + '-';
@@ -150,7 +150,11 @@
             if(String.isNotBlank(month) && month.length() == 1){
                 month = '0' + month;
             }
-            reportNo += month;
+            day  = String.valueOf(nObj.Inventory_Start_Date__c.day());
+            if(String.isNotBlank(day) && day.length() == 1){
+                day = '0' + day;
+            }
+            reportNo += month+'-'+day;
             nObj.Name = reportNo;
         }
     }
diff --git a/force-app/main/default/classes/InventoryResultRecordCopyController.cls b/force-app/main/default/classes/InventoryResultRecordCopyController.cls
index b6e8fb4..9075bae 100644
--- a/force-app/main/default/classes/InventoryResultRecordCopyController.cls
+++ b/force-app/main/default/classes/InventoryResultRecordCopyController.cls
@@ -174,7 +174,7 @@
         deptCheck_PIC = currUser.Dept__c; //20210618 1650 you
         String cunFangDi = ApexPages.currentPage().getParameters().get('cunFangDi');
         hasConsumAsset = false;
-        system.debug(cunFangDi+'==177='+bieCunFangDi);
+        system.debug(cunFangDi+'==177=='+bieCunFangDi);
         if (cunFangDi != null) bieCunFangDi = cunFangDi;
         //20210628 you 1650 鍔炰簨澶勭湅涓嶅埌 璐ф灦鍙�
         if (bieCunFangDi=='骞垮窞 澶囧搧涓績' || bieCunFangDi=='鍖椾含 澶囧搧涓績' || bieCunFangDi=='涓婃捣 澶囧搧涓績') {
@@ -204,11 +204,15 @@
         
         statusMap = new Map<String, List<String>>();
         //澶囧搧鎼 20210706  SFDC-C5CC5S 鏆傚仠
+        Date today = Date.today();
         List<Inventory_Header_Copy__c> ihList = [
             select Id, Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c, Fixture_Header__c
               from Inventory_Header_Copy__c
              where Inventory_Status__c <> '宸叉壒鍑�' and Internal_asset_location__c =:bieCunFangDi
-                and Inventory_Start_Date__c = LAST_N_DAYS:30
+                // 20220225 ljh 113鐩樼偣
+                // and Inventory_Start_Date__c = LAST_N_DAYS:30
+                and Inventory_Start_Date__c = :today
+                // 20220225 ljh 113鐩樼偣
                 ORDER BY Fixture_Header__c NULLS FIRST];
         // List<Inventory_Header_Copy__c> ihList = [
         //     select Id, Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c, Fixture_Header__c
@@ -536,8 +540,10 @@
             return;
         }
         // 澶囧搧鎼 SFDC-C5CC5S 鏆傚仠
-        List<Inventory_Header_Copy__c> ihList = [select Id, Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c from Inventory_Header_Copy__c where Internal_asset_location__c =:bieCunFangDi and Inventory_Start_Date__c = LAST_N_DAYS:30];
-        // List<Inventory_Header_Copy__c> ihList = [select Id, Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c from Inventory_Header_Copy__c where Internal_asset_location__c =:bieCunFangDi and Inventory_Start_Date__c = LAST_N_DAYS:1];
+        // 20220225 ljh 113鐩樼偣
+        // List<Inventory_Header_Copy__c> ihList = [select Id, Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c from Inventory_Header_Copy__c where Internal_asset_location__c =:bieCunFangDi and Inventory_Start_Date__c = LAST_N_DAYS:30];
+        Date today = Date.today();
+        List<Inventory_Header_Copy__c> ihList = [select Id, Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c from Inventory_Header_Copy__c where Internal_asset_location__c =:bieCunFangDi and Inventory_Start_Date__c =:today];
         if (ihList.size() > 0) {
             if (ihList[0].Inventory_Status__c == null) {
                 //do nothing
@@ -564,15 +570,11 @@
         ih_new.Inventory_Start_Date__c = Date.today();
         ih_new.InventorySubmit_PIC__c = String.isBlank(submitPIC) ? null : submitPIC;
         ih_new.InventoryCheck_PIC__c = String.isBlank(checkPIC) ? null : checkPIC;
-        ih_new.UniqueKey__c = bieCunFangDi+':'+Date.today().toStartOfMonth();
+        // ih_new.UniqueKey__c = bieCunFangDi+':'+Date.today().toStartOfMonth();
+        ih_new.UniqueKey__c = bieCunFangDi+':'+Date.today();
         //.toStartOfMonth(); 澶囧搧鎼  uniqueKey淇濊瘉鍞竴  SFDC-C5CC5S
         
         // FixtureUtil.withoutUpsertIh(new List<Inventory_Header_Copy__c> {ih_new});
-        /*public static void withoutUpsertIh(List<Inventory_Header__c> sobj) {
-            if (!sobj.isEmpty()) upsert sobj UniqueKey__c;
-        }*/
-        // List<Inventory_Header_Copy__c> sobj = new List<Inventory_Header_Copy__c> {ih_new};
-        // if (!sobj.isEmpty()) upsert sobj UniqueKey__c;
         FixtureUtil.withoutUpsertIhCopy(new List<Inventory_Header_Copy__c> {ih_new});
         // InventoryStartAssetSnapshotBatch istarter = new InventoryStartAssetSnapshotBatch(bieCunFangDi, ih_new);
         InventoryStartAssetSnapshotCopyBatch istarter = new InventoryStartAssetSnapshotCopyBatch(bieCunFangDi, ih_new);
@@ -581,7 +583,7 @@
         ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '寮�濮嬬洏鐐瑰鐞嗭紝璇风瓑寰匓atch澶勭悊缁撴潫'));
     }
 
-    public void save() {
+    /*public void save() {
         doneFlg = false;
         // 绫诲埆涓哄鍝佹垨涓虹┖ <=> 绫诲埆!=鑰楁潗
         if (assetCategory != '鑰楁潗' && inventoryHeader!=null && String.isNotBlank(inventoryHeader.Id) && System.Approval.isLocked(inventoryHeader.Id)) {
@@ -690,7 +692,10 @@
                         , Fixture_Header__c
                         from Inventory_Header_Copy__c
                         where Inventory_Status__c <> null and Inventory_Status__c <> '宸叉壒鍑�' and Internal_asset_location__c =:bieCunFangDi
-                          and Inventory_Start_Date__c = LAST_N_DAYS:30
+                          // 20220225 ljh 113鐩樼偣
+                        // and Inventory_Start_Date__c = LAST_N_DAYS:30
+                          and Inventory_Start_Date__c = LAST_N_DAYS:1
+                          // 20220225 ljh 113鐩樼偣
                           ORDER BY Fixture_Header__c nulls first
                         ];
         // ihList = [select Id,Inventory_Status__c, Name, Internal_asset_location__c, Inventory_Start_Date__c
@@ -833,13 +838,13 @@
                     //add by rentx 20210901 end
                 }
                 // 113 鐩樼偣Copy
-                /*List<AggregateResult> consumAssetList = [
-                        Select Internal_Asset_Flg__c fix, Asset_Status__c status, sum(toAbandon_amount__c) abAmount, sum(Amount__c) amount, sum(Inventory_Count__c) acAmount
-                        From Consum_Inventory_Detail__c
-                        Where Inventory_Header_Copy__c = : ih.Id
-                        and Asset_Status__c != '宸叉秷鑰楁槑缁�'
-                        group by Internal_Asset_Flg__c, Asset_Status__c];
-                consumAssetMap = getInitData(consumAssetList, 'consum');*/
+                // List<AggregateResult> consumAssetList = [
+                //         Select Internal_Asset_Flg__c fix, Asset_Status__c status, sum(toAbandon_amount__c) abAmount, sum(Amount__c) amount, sum(Inventory_Count__c) acAmount
+                //         From Consum_Inventory_Detail__c
+                //         Where Inventory_Header_Copy__c = : ih.Id
+                //         and Asset_Status__c != '宸叉秷鑰楁槑缁�'
+                //         group by Internal_Asset_Flg__c, Asset_Status__c];
+                // consumAssetMap = getInitData(consumAssetList, 'consum');
             }
             else{
                 inventoryDetailList = Database.query(soqlAsset);
@@ -874,7 +879,7 @@
         Id[] usrArray = usrList[0].InventoryUser__c.split(',');
         inventoryUserList = [select id, name from user where id in :usrArray];
 
-    }
+    }*/
 
     /**
      * 鑾峰彇鍒濆鍖栨椂椤甸潰鏄剧ず鐨勬暟鎹�
diff --git a/force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls b/force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls
new file mode 100644
index 0000000..5a4e0bf
--- /dev/null
+++ b/force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls
@@ -0,0 +1,418 @@
+@isTest
+private class InventoryResultRecordCopyControllerTest {
+    // 鍒涘缓Asset鏁版嵁
+    public static User user = new User();
+    static void setupTestData() {
+        ControllerUtil.EscapeNFM001Trigger = true;
+        //// 鐪�
+        //Address_Level__c al = new Address_Level__c();
+        //al.Name = '鏉变含';
+        //al.Level1_Code__c = 'CN-99';
+        //al.Level1_Sys_No__c = '999999';
+        //insert al;
+        //// 甯�
+        //Address_Level2__c al2 = new Address_Level2__c();
+        //al2.Level1_Code__c = 'CN-99';
+        //al2.Level1_Sys_No__c = '999999';
+        //al2.Level1_Name__c = '鏉变含';
+        //al2.Name = '娓嬭胺鍖�';
+        //al2.Level2_Code__c = 'CN-9999';
+        //al2.Level2_Sys_No__c = '9999999';
+        //al2.Address_Level__c = al.id;
+        //insert al2;
+
+        SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
+        InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_001__c = 'BJ';
+        InventoryHeaderName.From_Column_002__c = '涓婃捣 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_002__c = 'SH';
+        InventoryHeaderName.From_Column_003__c = '骞垮窞 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_003__c = 'GZ';
+        insert new SS_Batch_Column_Mapping__c[] {InventoryHeaderName};
+
+        SS_Batch_Column_Mapping__c Agency_Inventory_Role1 = new SS_Batch_Column_Mapping__c(Name = 'Agency_Inventory_Role', SS_TableName__c='Agency_Inventory_Role__c');
+        Agency_Inventory_Role1.From_Column_001__c = '鍛煎拰娴╃壒';
+        Agency_Inventory_Role1.SS_Column_001__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        Agency_Inventory_Role1.From_Column_002__c = '閮戝窞';
+        Agency_Inventory_Role1.SS_Column_002__c = '3.瑗垮寳钀ヤ笟鏈儴';
+        Agency_Inventory_Role1.From_Column_003__c = '娌堥槼';
+        Agency_Inventory_Role1.SS_Column_003__c = '2.涓滃寳钀ヤ笟鏈儴'; 
+        insert new SS_Batch_Column_Mapping__c[] {Agency_Inventory_Role1};
+
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        hospital.Is_Active__c = '鏈夊姽';
+        hospital.Attribute_Type__c = '鍗敓閮�';
+        hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+        hospital.Grade__c = '涓�绾�';
+        hospital.OCM_Category__c = 'SLTV';
+        hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+        //hospital.State_Master__c = al.id;
+        //hospital.City_Master__c = al2.id;
+        hospital.Town__c = '涓滀含';
+        insert hospital;
+
+        // 鎴︾暐绉戝銈掑緱銈�
+        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+        dep.Name = 'test dep';
+        dep.AgentCode_Ext__c = '9999998';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+
+        Contact contact2 = new Contact();
+        contact2.AccountId = dep.Id;
+        contact2.FirstName = '璨换鑰�';
+        contact2.LastName = 'test1缁忛攢鍟�';
+        insert contact2;
+
+        // 浜у搧
+        Product2 pro1 = new Product2(Name='name01',IsActive=true,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);
+        Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc02',Manual_Entry__c=false);
+        Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc03',Manual_Entry__c=false);
+        insert new Product2[] {pro1, pro2, pro3};
+
+        //---------------------------涓讳綋 涓や釜闄勫睘鍝�(涓綋绠$悊 鏁伴噺绠$悊)
+        // 淇濇湁璁惧A (涓讳綋)
+        Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA1.RecordTypeId = System.Label.Asset_RecordType;
+        assetA1.SerialNumber = 'ass01';
+        assetA1.Name = 'ass01';
+        assetA1.AccountId = dep.Id;
+        assetA1.Department_Class__c = strategicDep[0].Id;
+        assetA1.Hospital__c = hospital.Id;
+        assetA1.Product2Id = pro1.Id;
+        assetA1.Quantity = 1;
+        assetA1.Status = '鏈夊簱瀛�';
+        assetA1.Manage_type__c = '涓綋绠$悊';
+        assetA1.Loaner_accsessary__c = false;
+        assetA1.Product_category__c = 'GI';
+        assetA1.Delete_Flag__c = false;
+        assetA1.Freeze_sign__c = false;
+        assetA1.Out_of_wh__c = 0;
+        assetA1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA1.Product_category__c = 'GI';
+        assetA1.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA1.SalesProvince__c = '鍖椾含';
+        assetA1.WH_location__c = '璐ф灦鍙�1';
+        assetA1.AssetManageConfirm__c = true;
+        // 淇濇湁璁惧A (闄勫睘鍝� 鏁伴噺绠$悊)
+        Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA2.RecordTypeId = System.Label.Asset_RecordType;
+        assetA2.SerialNumber = 'ass02';
+        assetA2.Name = 'ass02';
+        assetA2.AccountId = dep.Id;
+        assetA2.Department_Class__c = strategicDep[0].Id;
+        assetA2.Hospital__c = hospital.Id;
+        assetA2.Product2Id = pro2.Id;
+        assetA2.Quantity = 10;
+        assetA2.Status = '鏈夊簱瀛�';
+        assetA2.Manage_type__c = '鏁伴噺绠$悊';
+        assetA2.Loaner_accsessary__c = true;
+        assetA2.Product_category__c = 'GI';
+        assetA2.Delete_Flag__c = false;
+        assetA2.Freeze_sign__c = false;
+        assetA2.Out_of_wh__c = 3;
+        assetA2.Frozen_Quantity__c = 2;
+        assetA2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA2.Product_category__c = 'GI';
+        assetA2.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA2.SalesProvince__c = '鍖椾含';
+        assetA2.WH_location__c = '璐ф灦鍙�2';
+        assetA2.AssetManageConfirm__c = true;
+        // 淇濇湁璁惧A (闄勫睘鍝� 涓綋绠$悊)
+        Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA3.RecordTypeId = System.Label.Asset_RecordType;
+        assetA3.SerialNumber = 'ass03';
+        assetA3.Name = 'ass03';
+        assetA3.AccountId = dep.Id;
+        assetA3.Department_Class__c = strategicDep[0].Id;
+        assetA3.Hospital__c = hospital.Id;
+        assetA3.Product2Id = pro3.Id;
+        assetA3.Quantity = 10;
+        assetA3.Status = '鏈夊簱瀛�';
+        assetA3.Manage_type__c = '鏁伴噺绠$悊';
+        assetA3.Loaner_accsessary__c = true;
+        assetA3.Product_category__c = 'GI';
+        assetA3.Delete_Flag__c = false;
+        assetA3.Freeze_sign__c = false;
+        assetA3.Out_of_wh__c = 3;
+        assetA3.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA3.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA3.Product_category__c = 'GI';
+        assetA3.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA3.SalesProvince__c = '鍖椾含';
+        assetA3.WH_location__c = '璐ф灦鍙�3';
+        assetA3.Abandoned_Inventory__c = 1;
+        assetA3.AssetManageConfirm__c = true;
+        // 鑰楁潗
+        Asset assetC1 = new Asset(Asset_Owner__c = 'Olympus');
+        assetC1.RecordTypeId = System.Label.Asset_RecordType;
+        assetC1.SerialNumber = 'ass04';
+        assetC1.Name = 'ass04';
+        assetC1.AccountId = dep.Id;
+        assetC1.Department_Class__c = strategicDep[0].Id;
+        assetC1.Hospital__c = hospital.Id;
+        assetC1.Product2Id = pro3.Id;
+        assetC1.Quantity = 10;
+        assetC1.Status = '鏈夊簱瀛�';
+        assetC1.Manage_type__c = '鏁伴噺绠$悊';
+        assetC1.Loaner_accsessary__c = true;
+        assetC1.Product_category__c = 'GI';
+        assetC1.Delete_Flag__c = false;
+        assetC1.Freeze_sign__c = false;
+        assetC1.Out_of_wh__c = 3;
+        assetC1.Asset_loaner_category__c = '鑰楁潗';
+        assetC1.AssetMark__c = '鑰楁潗';
+        assetC1.Salesdepartment__c = '0.澶囧搧涓績';
+        assetC1.Internal_asset_location__c = '涓婃捣 澶囧搧涓績';
+        assetC1.Product_category__c = 'GI';
+        assetC1.Equipment_Type__c = '浜у搧璇曠敤';
+        assetC1.SalesProvince__c = '涓婃捣';
+        assetC1.WH_location__c = '璐ф灦鍙�4';
+        assetC1.Abandoned_Inventory__c = 1;
+        assetC1.AssetManageConfirm__c = true;
+        insert new Asset[] {assetA1, assetA2, assetA3, assetC1};
+
+        User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
+       // Insert account as current user
+        System.runAs (thisUser) {
+            Profile p = [SELECT Id FROM Profile WHERE Name LIKE '%2B1%' Limit 1];
+            UserRole r = [SELECT Id FROM UserRole WHERE DeveloperName = 'beipin_huadong_staff' Limit 1];
+            user = new User(alias = 'test', email='test@acme.com', 
+                emailencodingkey='UTF-8', lastname='test', 
+                languagelocalekey='en_US', 
+                localesidkey='en_US', profileid = p.Id, userroleid = r.Id,
+                timezonesidkey='America/Los_Angeles', 
+                username='test@acme.com' + Datetime.now().getTime());
+            insert user;
+        }
+        //Repair__c repair = new Repair__c();
+        //repair.Service_Repair_No__c = 'repair';
+        //repair.Status__c = '鑽夋涓�';
+        //repair.Hospital__c = hospital.Id;
+        //repair.Account__c = dep.Id;
+        //repair.Department_Class__c = strategicDep[0].id;
+        //repair.Delivered_Product__c = assetA2.Id;
+        //insert repair;
+    }
+
+    /**  鐐瑰嚮寮�濮嬬洏鐐�
+    *    @author : sohobb
+    *    @description : 鐐瑰嚮寮�濮嬬洏鐐笴heck
+    *    @created Date : 2019-2-18
+    **/
+    static testMethod void testMethod1() {
+        bp3_Setting__c conf = bp3_Setting__c.getOrgDefaults();
+        conf.BJ_Start_Inventory_User__c = UserInfo.getUserId();
+        conf.InventoryDetailArchiveFolder__c = UserInfo.getUserId();
+        insert conf;
+
+        setupTestData();
+        InventoryResultRecordCopyController con = new InventoryResultRecordCopyController();
+        con.init();
+        //con.bieCunFangDi = '鍖椾含 澶囧搧涓績';
+
+        //鏈紑濮嬬洏鐐�
+        List<Apexpages.Message> msgs = ApexPages.getMessages();
+        boolean b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('娌℃湁寮�濮嬩腑鐨勭洏鐐癸紝璇风偣鍑诲紑濮嬬洏鐐�')) b = true;
+        }
+        //system.assert(b);
+
+        Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+        // 銉︺兗銈躲兗浣滄垚
+        User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+        insert hpOwner;
+        System.runAs(hpOwner) {
+            //娌℃湁寮�濮嬫潈闄�
+            con.startInventory();
+            msgs = ApexPages.getMessages();
+            b = false;
+            for(Apexpages.Message msg:msgs){
+                if (msg.getDetail().contains('娌℃湁寮�濮嬬洏鐐圭殑鏉冮檺')) b = true;
+            }
+            //system.assert(b, msgs);
+        }
+
+        //绗竴娆″紑濮嬬洏鐐�
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('寮�濮嬬洏鐐瑰鐞嗭紝璇风瓑寰匓atch澶勭悊缁撴潫')) b = true;
+        }
+        //system.assert(b, msgs);
+        List<Inventory_Header_Copy__c> ihList = [select Id,InventoryCheck_PIC__c,InventorySubmit_PIC__c from Inventory_Header_Copy__c];
+        //system.assertEquals(1, ihList.size());
+
+        //鍐嶆寮�濮嬬洏鐐�
+        con.startInventory();
+        msgs = ApexPages.getMessages();
+        b = false;
+        for(Apexpages.Message msg:msgs){
+            if (msg.getDetail().contains('鏈夋湭缁撴潫鐨勭洏鐐�')) b = true;
+        }
+        //system.assert(b);
+
+         //ihList[0].Inventory_Status__c = '宸叉壒鍑�';
+         //ihList[0].InventoryCheck_PIC__c = [SELECT Id
+          //       FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+         //ihList[0].InventorySubmit_PIC__c = [SELECT id
+         //        FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        // update ihList;
+
+        //鏈湀宸叉湁缁撴潫鐨勭洏鐐�
+        // con.startInventory();
+        // msgs = ApexPages.getMessages();
+        // b = false;
+        // for(Apexpages.Message msg:msgs){
+        //     if (msg.getDetail().contains('鏈粨搴撴湰鏈堝凡杩涜杩囩洏鐐�')) b = true;
+         //}
+        //system.assert(b);
+    }
+
+    static testMethod void testMethod2() {
+        setupTestData();
+        //鐩樼偣琛ㄥご
+        String cunFangDi = '鍖椾含 澶囧搧涓績';
+        Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+        header.Inventory_Start_Date__c = Date.toDay();
+        header.UniqueKey__c = 'IH-0000';
+        header.Inventory_Status__c = '澶勭悊涓�';
+        header.Internal_asset_location__c = cunFangDi;
+        header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        insert header;
+
+        List<Inventory_Header_Copy__c> headerList = [select UniqueKey__c from Inventory_Header_Copy__c];
+        System.assertEquals(1, headerList.size());
+
+        System.Test.StartTest();
+        Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+        System.Test.StopTest();
+
+        InventoryResultRecordCopyController con = new InventoryResultRecordCopyController();
+        con.init();
+        con.searchBtn();
+    }
+
+    static testMethod void testMethod3() {
+        setupTestData();
+        
+        System.Test.StartTest();
+        //鐩樼偣琛ㄥご
+        String cunFangDi = '鍖椾含 澶囧搧涓績';
+        Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+        header.Inventory_Start_Date__c = Date.toDay();
+        header.UniqueKey__c = 'IH-0000';
+        header.Inventory_Status__c = '澶勭悊涓�';
+        header.Internal_asset_location__c = cunFangDi;
+        header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        insert header;
+
+        Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+        System.Test.StopTest();
+
+        InventoryResultRecordCopyController con = new InventoryResultRecordCopyController();
+        con.init();
+        con.searchBtn();
+
+        System.assertEquals(3, con.assetStatusOptionList.size());
+        con.getbieCunFangDiOps();
+        con.getInventoryUserOps();
+        con.getInventory_DeviationOps();
+        con.getInternal_Asset_FlgOps();
+    }
+
+    static testMethod void testMethod4() {
+        setupTestData();
+        
+        System.Test.StartTest();
+        //鐩樼偣琛ㄥご
+        String cunFangDi = '鍖椾含 澶囧搧涓績';
+        Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+        header.Inventory_Start_Date__c = Date.toDay();
+        header.UniqueKey__c = 'IH-0000';
+        header.Inventory_Status__c = '澶勭悊涓�';
+        header.Internal_asset_location__c = cunFangDi;
+        header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        insert header;
+
+        Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+        System.Test.StopTest();
+
+        List<Inventory_Detail_Copy__c> ids = [select id from Inventory_Detail_Copy__c  where Inventory_Header_Copy__c = :header.Id];
+        System.assertEquals(5, ids.size());
+        
+        InventoryResultRecordCopyController con = new InventoryResultRecordCopyController();
+        con.init();
+        con.searchBtn();
+        System.assertEquals(19, con.salesdepartmentOpts.size());
+        System.assertEquals(57, con.salesProvinceOpts.size());
+        
+        //con.inventoryDetailList[0].Inventory_Count__c = 1;
+        //con.save();
+        
+    }
+    // 20220228 ljh 113鐩樼偣 
+    /*static testMethod void testMethod5() {
+        setupTestData();
+
+        System.runAs(user){
+            System.Test.StartTest();
+            //鐩樼偣琛ㄥご
+            String cunFangDi = '涓婃捣 澶囧搧涓績';
+            Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+            header.Inventory_Start_Date__c = Date.toDay();
+            header.UniqueKey__c = 'IH-0000';
+            header.Inventory_Status__c = '澶勭悊涓�';
+            header.Internal_asset_location__c = cunFangDi;
+            header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+            header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+            insert header;
+            Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+            System.Test.StopTest();
+
+            InventoryResultRecordCopyController con = new InventoryResultRecordCopyController();
+            con.init();
+            con.searchBtn();
+            //update by rentx 
+            System.assertEquals(2, con.assetCategoryOptionList.size());
+            System.assertEquals(19, con.salesdepartmentOpts.size());
+            System.assertEquals(57, con.salesProvinceOpts.size());
+            
+            con.consumInventoryDetailList[0].Inventory_Count__c = 1;
+            con.save();
+        }
+    }*/
+    static testMethod void updaue() {
+        InventoryResultRecordCopyController.test();//鍏堣皟鐢ㄨ繖涓紝鐒跺悗缁х画琛ュ厖娴嬭瘯绫�
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls-meta.xml b/force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls-meta.xml
new file mode 100644
index 0000000..db9bf8c
--- /dev/null
+++ b/force-app/main/default/classes/InventoryResultRecordCopyControllerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>48.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/InventorySendMailBatch.cls b/force-app/main/default/classes/InventorySendMailBatch.cls
index 85b0129..0ab9959 100644
--- a/force-app/main/default/classes/InventorySendMailBatch.cls
+++ b/force-app/main/default/classes/InventorySendMailBatch.cls
@@ -10,26 +10,24 @@
     }
 
     global Database.QueryLocator start(Database.BatchableContext BC) {
-		if (Test.isRunningTest()) { 
-			return Database.getQueryLocator(
-				[select Id, Name, Email, Manager.Email from User where isActive = true and (ProfileId = :System.label.ProfileId_2S6 
-					or ProfileId = :System.label.ProfileId_2S7 or ProfileId = :System.label.ProfileId_2S8) limit 1]
-			);
-		} else {
-			return Database.getQueryLocator(
-				[select Id, Name, Email, Manager.Email from User where isActive = true and (ProfileId = :System.label.ProfileId_2S6 
-					or ProfileId = :System.label.ProfileId_2S7 or ProfileId = :System.label.ProfileId_2S8)]
-			);
-		}
-				
+		return Database.getQueryLocator(
+			[SELECT (select userOrGroupId from groupMembers) FROM group WHERE name = '鏍锋湰鐩樼偣灏忕粍']
+		);
     }
 
-    global void execute(Database.BatchableContext BC, List<sObject> User) {
-        List<User> UserList = User;
+    global void execute(Database.BatchableContext BC, List<group> gList) {
+		List<String> IdList = new List<String>();
+		if (gList != null && gList.size() > 0) {
+			for (Group g : gList) {
+				for (GroupMember gm : g.groupMembers) {
+					IdList.add(gm.userOrGroupId);
+				}
+			}
+		}
         Date toDate = Date.today();
         Integer day = Integer.valueOf(toDate.day());
-        if(System.Test.isRunningTest()|| (UserList.size() > 0 && (day == 6 || day == 14))){
-			sendMail(UserList);
+        if(System.Test.isRunningTest() || (IdList.size() > 0 && (day == 10 || day == 14))){
+			sendMail(IdList);
         }	
     }
 
@@ -62,12 +60,13 @@
 			iflog.Log__c += logstr;
 			iflog.ErrorLog__c = Errorstr;
 		}
-
 		insert iflog;
     }
 
-    public boolean sendMail(List<User> userList) {
+    public boolean sendMail(List<String> IdList) {
 		boolean rs = true;
+		List<User> userList = [select Id, Name, Email, Manager.Email from User where id IN :IdList];
+		List<Messaging.SingleEmailMessage> sendMails = new List<Messaging.SingleEmailMessage>();
 		for(User user : userList){
 			String title = '';
 			String body = '';
@@ -85,24 +84,27 @@
 			toMailList.add(user.Email);
 			//鎶勯�佺殑閭
 			List<String> ccMailList = new List<String>();
-			ccMailList.add(user.Manager.Email);
-			List<Messaging.SingleEmailMessage> sendMails = new List<Messaging.SingleEmailMessage>();
+			if(user.Manager.Email != null){
+				ccMailList.add(user.Manager.Email);
+			}
 			Messaging.SingleEmailMessage messageNEW = new Messaging.SingleEmailMessage();
 			messageNEW.subject = title;
 			messageNEW.htmlBody = body;
 			messageNEW.setCharset('UTF-8');
 			messageNEW.toAddresses = toMailList;
-			messageNEW.ccAddresses = ccMailList;
+			if(ccMailList.size() > 0){
+				messageNEW.ccAddresses = ccMailList;
+			}
 			sendMails.add(messageNEW);
-
-			Messaging.SendEmailResult[] results = messaging.sendEmail(sendMails);
-			for (Integer i = 0; i < results.size(); i++) {
-				if (results[i].success == false) { 
-					system.debug('=====send mail error:' + results[i].errors[0].message);
-					result = false;
-					Errorstr += 'sendMail error:' + results[i].errors[0].message + '\n';
-					rs = false;
-				}
+		}
+		//鍦ㄥ崟涓簨鍔′腑锛屽彧鑳借皟鐢╯end鏂规硶 10 娆°��
+		Messaging.SendEmailResult[] results = messaging.sendEmail(sendMails);
+		for (Integer i = 0; i < results.size(); i++) {
+			if (results[i].success == false) { 
+				system.debug('=====send mail error:' + results[i].errors[0].message);
+				result = false;
+				Errorstr += 'sendMail error:' + results[i].errors[0].message + '\n';
+				rs = false;
 			}
 		}
 		return rs;
diff --git a/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatch.cls b/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatch.cls
index 8b7cacd..a14456d 100644
--- a/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatch.cls
+++ b/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatch.cls
@@ -879,7 +879,7 @@
          }
          InventoryStartAssetSnapshotCopyBatch.messagesForTest = this.emailMessages;
         // 鍙� mail
-        String InventoryCheck_PIC_email = iheader.InventoryCheck_PIC__r.Email;
+        // String InventoryCheck_PIC_email = iheader.InventoryCheck_PIC__r.Email;
         BatchEmailUtil be = new BatchEmailUtil();
         // String[] toList = new String[]{UserInfo.getUserEmail()};
         String[] toList = new String[]{'sfdc_lijinhuan@olympus.com.cn'};
@@ -888,10 +888,10 @@
         for(String email : System.Label.Inventory_Result_Email.split(',')){
             ccList.add(email);
         } 
-        system.debug('鐩樼偣鎶ュ憡纭浜�'+InventoryCheck_PIC_email);
+         /*system.debug('鐩樼偣鎶ュ憡纭浜�'+InventoryCheck_PIC_email);
         if(InventoryCheck_PIC_email != null){
            ccList.add(InventoryCheck_PIC_email); 
-        }
+        }*/
          
         if(this.emailMessages.size() == 0 && totalCount == executedCount) {
             be.successMail(toList,ccList, title, totalCount, text);
diff --git a/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls b/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls
new file mode 100644
index 0000000..46c4808
--- /dev/null
+++ b/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls
@@ -0,0 +1,1444 @@
+@isTest
+private class InventoryStartAssetSnapshotCopyBatchTest {
+
+    //static testMethod void testabnormalCase() {
+    //    //鐩樼偣琛ㄥご
+    //    Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+    //    header.Inventory_Start_Date__c = Date.toDay();
+    //    header.UniqueKey__c = 'IH-0000';
+    //    header.Inventory_Status__c = '瀹屼簡';
+    //    insert header;
+
+    //    String cunFangDi = '鍖椾含 澶囧搧涓績';
+
+    //    Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+    //    List<Inventory_Detail_Copy__c> resultList = [select UniqueKey__c from Inventory_Detail_Copy__c];
+    //    System.assertEquals(0, resultList.size());
+
+    //}
+    @isTest
+    static void testAssert() {
+        ControllerUtil.EscapeNFM001Trigger = true;
+        SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
+        InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_001__c = 'BJ';
+        InventoryHeaderName.From_Column_002__c = '涓婃捣 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_002__c = 'SH';
+        InventoryHeaderName.From_Column_003__c = '骞垮窞 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_003__c = 'GZ';
+        insert new SS_Batch_Column_Mapping__c[] {InventoryHeaderName};
+        // 鐪�
+        Address_Level__c al = new Address_Level__c();
+        al.Name = '鏉变含';
+        al.Level1_Code__c = 'CN-99';
+        al.Level1_Sys_No__c = '999999';
+        insert al;
+        // 甯�
+        Address_Level2__c al2 = new Address_Level2__c();
+        al2.Level1_Code__c = 'CN-99';
+        al2.Level1_Sys_No__c = '999999';
+        al2.Level1_Name__c = '鏉变含';
+        al2.Name = '娓嬭胺鍖�';
+        al2.Level2_Code__c = 'CN-9999';
+        al2.Level2_Sys_No__c = '9999999';
+        al2.Address_Level__c = al.id;
+        insert al2;
+
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        hospital.Is_Active__c = '鏈夊姽';
+        hospital.Attribute_Type__c = '鍗敓閮�';
+        hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+        hospital.Grade__c = '涓�绾�';
+        hospital.OCM_Category__c = 'SLTV';
+        hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+        hospital.State_Master__c = al.id;
+        hospital.City_Master__c = al2.id;
+        hospital.Town__c = '涓滀含';
+        insert hospital;
+
+        // 鎴︾暐绉戝銈掑緱銈�
+        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+        dep.Name = 'test dep';
+        dep.AgentCode_Ext__c = '9999998';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+
+        Contact contact2 = new Contact();
+        contact2.AccountId = dep.Id;
+        contact2.FirstName = '璨换鑰�';
+        contact2.LastName = 'test1缁忛攢鍟�';
+        insert contact2;
+
+        // 浜у搧
+        Product2 pro1 = new Product2(Name='name01',IsActive=true,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);
+        Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc02',Manual_Entry__c=false);
+        Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing',
+                ProductCode_Ext__c='pc03',Manual_Entry__c=false);
+        insert new Product2[] {pro1, pro2, pro3};
+        SS_Batch_Column_Mapping__c AgencyInventory = new SS_Batch_Column_Mapping__c(Name = 'Agency_Inventory_Role', SS_TableName__c='Agency_Inventory_Role');
+        AgencyInventory.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        AgencyInventory.SS_Column_001__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        AgencyInventory.From_Column_002__c = '娴庡崡';
+        AgencyInventory.SS_Column_002__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        AgencyInventory.From_Column_003__c = '閮戝窞';
+        AgencyInventory.SS_Column_003__c = '3.瑗垮寳钀ヤ笟鏈儴';
+        insert new SS_Batch_Column_Mapping__c[] {AgencyInventory};
+
+        //---------------------------涓讳綋 涓や釜闄勫睘鍝�(涓綋绠$悊 鏁伴噺绠$悊)
+        // 淇濇湁璁惧A (涓讳綋)
+        Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA1.RecordTypeId = System.Label.Asset_RecordType;
+        assetA1.SerialNumber = 'ass01';
+        assetA1.Name = 'ass01';
+        assetA1.AccountId = dep.Id;
+        assetA1.Department_Class__c = strategicDep[0].Id;
+        assetA1.Hospital__c = hospital.Id;
+        assetA1.Product2Id = pro1.Id;
+        assetA1.Quantity = 1;
+        assetA1.Status = '鏈夊簱瀛�';
+        assetA1.Manage_type__c = '涓綋绠$悊';
+        assetA1.Loaner_accsessary__c = false;
+        assetA1.Product_category__c = 'GI';
+        assetA1.Delete_Flag__c = false;
+        assetA1.Freeze_sign__c = false;
+        assetA1.Out_of_wh__c = 0;
+        assetA1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA1.Product_category__c = 'GI';
+        assetA1.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA1.SalesProvince__c = '鍖椾含';
+        assetA1.WH_location__c = '璐ф灦鍙�1';
+        assetA1.AssetManageConfirm__c = true;
+        // 淇濇湁璁惧A (闄勫睘鍝� 鏁伴噺绠$悊)
+        Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA2.RecordTypeId = System.Label.Asset_RecordType;
+        assetA2.SerialNumber = 'ass02';
+        assetA2.Name = 'ass02';
+        assetA2.AccountId = dep.Id;
+        assetA2.Department_Class__c = strategicDep[0].Id;
+        assetA2.Hospital__c = hospital.Id;
+        assetA2.Product2Id = pro2.Id;
+        assetA2.Quantity = 10;
+        assetA2.Status = '鏈夊簱瀛�';
+        assetA2.Manage_type__c = '鏁伴噺绠$悊';
+        assetA2.Loaner_accsessary__c = true;
+        assetA2.Product_category__c = 'GI';
+        assetA2.Delete_Flag__c = false;
+        assetA2.Freeze_sign__c = false;
+        assetA2.Out_of_wh__c = 3;
+        assetA2.Frozen_Quantity__c = 2;
+        assetA2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA2.Product_category__c = 'GI';
+        assetA2.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA2.SalesProvince__c = '鍖椾含';
+        assetA2.WH_location__c = '璐ф灦鍙�2';
+        assetA2.AssetManageConfirm__c = true;
+        // 淇濇湁璁惧A (闄勫睘鍝� 涓綋绠$悊)
+        Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus');
+        assetA3.RecordTypeId = System.Label.Asset_RecordType;
+        assetA3.SerialNumber = 'ass03';
+        assetA3.Name = 'ass03';
+        assetA3.AccountId = dep.Id;
+        assetA3.Department_Class__c = strategicDep[0].Id;
+        assetA3.Hospital__c = hospital.Id;
+        assetA3.Product2Id = pro3.Id;
+        assetA3.Quantity = 10;
+        assetA3.Status = '鏈夊簱瀛�';
+        assetA3.Manage_type__c = '鏁伴噺绠$悊';
+        assetA3.Loaner_accsessary__c = true;
+        assetA3.Product_category__c = 'GI';
+        assetA3.Delete_Flag__c = false;
+        assetA3.Freeze_sign__c = false;
+        assetA3.Out_of_wh__c = 3;
+        assetA3.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        assetA3.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        assetA3.Product_category__c = 'GI';
+        assetA3.Equipment_Type__c = '浜у搧璇曠敤';
+        assetA3.SalesProvince__c = '鍖椾含';
+        assetA3.WH_location__c = '璐ф灦鍙�3';
+        assetA3.Abandoned_Inventory__c = 1;
+        assetA3.AssetManageConfirm__c = true;
+        insert new Asset[] {assetA1, assetA2, assetA3};
+
+        List<Asset> assetList = [select Name from Asset];
+        System.assertEquals(3, assetList.size());
+
+        Repair__c repair = new Repair__c();
+        repair.Service_Repair_No__c = 'repair';
+        repair.Status__c = '4.淇悊鍝佽繑閫侀樁娈�';
+        repair.Hospital__c = hospital.Id;
+        repair.Account__c = dep.Id;
+        repair.Department_Class__c = strategicDep[0].id;
+        repair.Delivered_Product__c = assetA2.Id;
+        insert repair;
+
+        List<Repair__c> repairList = [select Service_Repair_No__c from Repair__c];
+        System.assertEquals(1, repairList.size());
+
+        //鐩樼偣琛ㄥご
+        Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+        header.Inventory_Start_Date__c = Date.toDay();
+        header.UniqueKey__c = 'IH-0000';
+        header.Inventory_Status__c = '澶勭悊涓�';
+        header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        insert header;
+
+        List<Inventory_Header_Copy__c> headerList = [select UniqueKey__c from Inventory_Header_Copy__c];
+        System.assertEquals(1, headerList.size());
+
+        String cunFangDi = '鍖椾含 澶囧搧涓績';
+
+        System.Test.StartTest();
+        Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+        System.Test.StopTest();
+
+        List<Inventory_Detail_Copy__c> onStockList = [select UniqueKey__c from Inventory_Detail_Copy__c
+                                                                    WHERE Asset_Status__c = '鍦ㄥ簱'];
+       // System.assertEquals(3, onStockList.size());
+
+        List<Inventory_Detail_Copy__c> lostList = [select UniqueKey__c from Inventory_Detail_Copy__c
+                                                                 WHERE Asset_Status__c = '涓㈠け'];
+        System.assertEquals(1, lostList.size());
+
+        List<Inventory_Detail_Copy__c> fixList = [select UniqueKey__c from Inventory_Detail_Copy__c
+                                                                WHERE Asset_Status__c = '缁翠慨涓�'];
+        System.assertEquals(1, fixList.size());
+
+        List<Inventory_Detail_Copy__c> frozenList = [select UniqueKey__c from Inventory_Detail_Copy__c
+                                                                WHERE Asset_Status__c = '鍐荤粨'];
+        System.assertEquals(1, frozenList.size());
+    }
+     @isTest
+    static void testOnetoOne() {
+        ControllerUtil.EscapeNFM001Trigger = true;
+        SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
+        InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_001__c = 'BJ';
+        InventoryHeaderName.From_Column_002__c = '涓婃捣 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_002__c = 'SH';
+        InventoryHeaderName.From_Column_003__c = '骞垮窞 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_003__c = 'GZ';
+        insert new SS_Batch_Column_Mapping__c[] {InventoryHeaderName};
+        SS_Batch_Column_Mapping__c AgencyInventory = new SS_Batch_Column_Mapping__c(Name = 'Agency_Inventory_Role', SS_TableName__c='Agency_Inventory_Role');
+        AgencyInventory.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        AgencyInventory.SS_Column_001__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        AgencyInventory.From_Column_002__c = '娴庡崡';
+        AgencyInventory.SS_Column_002__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        AgencyInventory.From_Column_003__c = '閮戝窞';
+        AgencyInventory.SS_Column_003__c = '3.瑗垮寳钀ヤ笟鏈儴';
+        insert new SS_Batch_Column_Mapping__c[] {AgencyInventory};
+        // 鐪�
+        Address_Level__c al = new Address_Level__c();
+        al.Name = '鏉变含';
+        al.Level1_Code__c = 'CN-99';
+        al.Level1_Sys_No__c = '999999';
+        insert al;
+        // 甯�
+        Address_Level2__c al2 = new Address_Level2__c();
+        al2.Level1_Code__c = 'CN-99';
+        al2.Level1_Sys_No__c = '999999';
+        al2.Level1_Name__c = '鏉变含';
+        al2.Name = '娓嬭胺鍖�';
+        al2.Level2_Code__c = 'CN-9999';
+        al2.Level2_Sys_No__c = '9999999';
+        al2.Address_Level__c = al.id;
+        insert al2;
+        // 鐥呴櫌銈掍綔銈�
+        Account hospital = new Account();
+        hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+        hospital.Name = 'test hospital';
+        hospital.Is_Active__c = '鏈夊姽';
+        hospital.Attribute_Type__c = '鍗敓閮�';
+        hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+        hospital.Grade__c = '涓�绾�';
+        hospital.OCM_Category__c = 'SLTV';
+        hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+        hospital.State_Master__c = al.id;
+        hospital.City_Master__c = al2.id;
+        hospital.Town__c = '涓滀含';
+        insert hospital;
+        StaticParameter.EscapeAccountTrigger = true;
+        // 鎴︾暐绉戝銈掑緱銈�
+        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+        // 瑷虹檪绉戙倰浣溿倠
+        Account dep = new Account();
+        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+        dep.Name = 'test dep';
+        dep.AgentCode_Ext__c = '9999998';
+        dep.ParentId = strategicDep[0].Id;
+        dep.Department_Class__c = strategicDep[0].Id;
+        dep.Hospital__c = hospital.Id;
+        insert dep;
+
+        Contact contact2 = new Contact();
+        contact2.AccountId = dep.Id;
+        contact2.FirstName = '璨换鑰�';
+        contact2.LastName = 'test1缁忛攢鍟�';
+        insert contact2;
+
+        // 浜у搧
+        Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',
+                Fixture_Model_No_T__c = 'n01', Asset_Model_No__c = 'Pro1',
+                ProductCode_Ext__c='pc01',Manual_Entry__c=false);
+        Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing',
+                Fixture_Model_No_T__c = 'n02', Asset_Model_No__c = 'Pro2',
+                ProductCode_Ext__c='pc02',Manual_Entry__c=false);
+        Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing',
+                Fixture_Model_No_T__c = 'n03', Asset_Model_No__c = 'Pro3',
+                ProductCode_Ext__c='pc03',Manual_Entry__c=false);
+        Product2 pro4 = new Product2(Name='name04',IsActive=true,Family='GI',
+                Fixture_Model_No__c='n04',Serial_Lot_No__c='Lot tracing',
+                Fixture_Model_No_T__c = 'n04', Asset_Model_No__c = 'Pro4',
+                ProductCode_Ext__c='pc04',Manual_Entry__c=false);
+        insert new Product2[] {pro1, pro2, pro3, pro4};
+
+        // 淇濇湁璁惧
+        Asset asset1 = new Asset(Asset_Owner__c = 'Olympus');
+        asset1.RecordTypeId = System.Label.Asset_RecordType;
+        asset1.SerialNumber = 'asset1';
+        asset1.Name = 'asset1';
+        asset1.AccountId = dep.Id;
+        asset1.Department_Class__c = strategicDep[0].Id;
+        asset1.Hospital__c = hospital.Id;
+        asset1.Product2Id = pro1.Id;
+        asset1.Quantity = 1;
+        asset1.Status = '涓嶆槑';
+        asset1.Manage_type__c = '涓綋绠$悊';
+        asset1.Loaner_accsessary__c = false;
+        asset1.Out_of_wh__c = 0;
+        asset1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset1.Product_category__c = 'GI';
+        asset1.Equipment_Type__c = '浜у搧璇曠敤';
+        asset1.SalesProvince__c = '鍖椾含';
+        asset1.CompanyOfEquipment__c = '鍖椾含';
+        asset1.Internal_Asset_number__c = '0001';
+        asset1.AssetManageConfirm__c = true;
+
+        Asset asset2 = new Asset(Asset_Owner__c = 'Olympus');
+        asset2.RecordTypeId = System.Label.Asset_RecordType;
+        asset2.SerialNumber = 'asset2';
+        asset2.Name = 'asset2';
+        asset2.AccountId = dep.Id;
+        asset2.Department_Class__c = strategicDep[0].Id;
+        asset2.Hospital__c = hospital.Id;
+        asset2.Product2Id = pro2.Id;
+        asset2.Quantity = 1;
+        asset2.Status = '涓嶆槑';
+        asset2.Manage_type__c = '涓綋绠$悊';
+        asset2.Loaner_accsessary__c = true;
+        asset2.Out_of_wh__c = 0;
+        asset2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset2.Product_category__c = 'GI';
+        asset2.Equipment_Type__c = '浜у搧璇曠敤';
+        asset2.SalesProvince__c = '鍖椾含';
+        asset2.CompanyOfEquipment__c = '鍖椾含';
+        asset2.Internal_Asset_number__c = '0002';
+        asset2.AssetManageConfirm__c = true;
+
+        Asset asset3 = new Asset(Asset_Owner__c = 'Olympus');
+        asset3.RecordTypeId = System.Label.Asset_RecordType;
+        asset3.SerialNumber = 'asset3';
+        asset3.Name = 'asset3';
+        asset3.AccountId = dep.Id;
+        asset3.Department_Class__c = strategicDep[0].Id;
+        asset3.Hospital__c = hospital.Id;
+        asset3.Product2Id = pro3.Id;
+        asset3.Quantity = 5;
+        asset3.Status = '涓嶆槑';
+        asset3.Manage_type__c = '鏁伴噺绠$悊';
+        asset3.Loaner_accsessary__c = true;
+        asset3.Out_of_wh__c = 0;
+        asset3.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        asset3.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+        asset3.Product_category__c = 'GI';
+        asset3.Equipment_Type__c = '浜у搧璇曠敤';
+        asset3.SalesProvince__c = '鍖椾含';
+        asset3.CompanyOfEquipment__c = '鍖椾含';
+        asset3.Internal_Asset_number__c = '0003';
+        asset3.AssetManageConfirm__c = true;
+
+        insert new Asset[] {asset1, asset2, asset3};
+
+        // 澶囧搧涓�瀵逛竴Link琛�
+        Fixture_OneToOne_Link__c foLink1 = new Fixture_OneToOne_Link__c();
+        foLink1.Main_Asset__c = asset1.Id;
+        foLink1.Accessory_Asset__c = asset2.Id;
+        foLink1.Quantity__c = 1;
+
+        Fixture_OneToOne_Link__c foLink2 = new Fixture_OneToOne_Link__c();
+        foLink2.Main_Asset__c = asset1.Id;
+        foLink2.Accessory_Asset__c = asset3.Id;
+        foLink2.Quantity__c = 1;
+        insert new Fixture_OneToOne_Link__c[] {foLink1, foLink2};
+
+        List<Fixture_OneToOne_Link__c> linkList = [select Main_Asset__c from Fixture_OneToOne_Link__c];
+        System.assertEquals(2, linkList.size());
+
+        List<Asset> assetList = [select Fixture_OneToOne_Link__c from Asset where Fixture_OneToOne_Link__c <> null];
+        System.assertEquals(1, assetList.size());
+
+        // 澶囧搧閰嶅
+        Fixture_Set__c fsObj1 = new Fixture_Set__c();
+        fsObj1.Name = 'set1';
+        fsObj1.Fixture_Set_Body_Model_No__c = 'modelNo1';
+        fsObj1.Loaner_name__c = 'name1';
+        insert fsObj1;
+
+        //鐩樼偣琛ㄥご
+        Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+        header.Inventory_Start_Date__c = Date.toDay();
+        header.UniqueKey__c = 'IH-0000';
+        header.Inventory_Status__c = '澶勭悊涓�';
+        header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+        insert header;
+
+        String cunFangDi = '鍖椾含 澶囧搧涓績';
+
+        System.Test.StartTest();
+        Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+        System.Test.StopTest();
+        //System.assertEquals(0, InventoryStartAssetSnapshotCopyBatch.messagesForTest.size(), InventoryStartAssetSnapshotCopyBatch.messagesForTest);
+
+
+        List<Inventory_Detail_Copy__c> resultList = [select UniqueKey__c from Inventory_Detail_Copy__c
+                                                                   WHERE Asset_Status__c = '鍦ㄥ簱' ];
+        System.assertEquals(4, resultList.size());
+        //todo assert鍏蜂綋灞炴��
+
+        resultList = [select Amount__c from Inventory_Detail_Copy__c WHERE Asset__c = :asset3.Id ];
+        System.assertEquals(4, resultList[0].Amount__c);
+    }
+    //todo鏄庣粏琛�
+    // @isTest
+    // static void testDetail() {
+    //     ControllerUtil.EscapeNFM001Trigger = true;
+    //     SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
+    //     InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+    //     InventoryHeaderName.SS_Column_001__c = 'BJ';
+    //     InventoryHeaderName.From_Column_002__c = '涓婃捣 澶囧搧涓績';
+    //     InventoryHeaderName.SS_Column_002__c = 'SH';
+    //     InventoryHeaderName.From_Column_003__c = '骞垮窞 澶囧搧涓績';
+    //     InventoryHeaderName.SS_Column_003__c = 'GZ';
+    //     insert new SS_Batch_Column_Mapping__c[] {InventoryHeaderName};
+    //     // 銈枫偣銉嗐儬绠$悊鑰�
+    //     /**
+    //     User user = new User(Test_staff__c = true);
+    //     user.LastName = '_銈点兂銉栥儶銉冦偢';
+    //     user.FirstName = '銇�';
+    //     user.Alias = '銇�';
+    //     user.Email = 'olympusTest03@sunbridge.com';
+    //     user.Username = 'olympusTest03@sunbridge.com';
+    //     user.CommunityNickname = '銇�';
+    //     user.IsActive = true;
+    //     user.EmailEncodingKey = 'ISO-2022-JP';
+    //     user.TimeZoneSidKey = 'Asia/Tokyo';
+    //     user.LocaleSidKey = 'ja_JP';
+    //     user.LanguageLocaleKey = 'ja';
+    //     user.ProfileId = System.Label.ProfileId_SystemAdmin;
+    //     user.Province__c = '鍖椾含';
+    //     user.Dept__c = '鍖荤枟鍗庡寳钀ヤ笟鏈儴';
+    //     user.Use_Start_Date__c = Date.today().addMonths(-6);
+    //     user.JingliApprovalManager__c = UserInfo.getUserId();
+    //     user.JingliEquipmentManager__c = UserInfo.getUserId();
+    //     user.SalesManager__c = UserInfo.getUserId();
+    //     user.BuchangApprovalManager__c = UserInfo.getUserId();
+    //     user.Buzhang_Equipment_Manager__c = UserInfo.getUserId();
+    //     user.BuchangApprovalManagerSales__c = UserInfo.getUserId();
+    //     insert user;
+    //     **/
+    //     User thisUser = [Select Id from User where Id =: UserInfo.getUserId()];
+    //     System.runAs(thisUser) {
+    //         // 鐪�
+    //         Address_Level__c al = new Address_Level__c();
+    //         al.Name = '鏉变含';
+    //         al.Level1_Code__c = 'CN-99';
+    //         al.Level1_Sys_No__c = '999999';
+    //         insert al;
+    //         // 甯�
+    //         Address_Level2__c al2 = new Address_Level2__c();
+    //         al2.Level1_Code__c = 'CN-99';
+    //         al2.Level1_Sys_No__c = '999999';
+    //         al2.Level1_Name__c = '鏉变含';
+    //         al2.Name = '娓嬭胺鍖�';
+    //         al2.Level2_Code__c = 'CN-9999';
+    //         al2.Level2_Sys_No__c = '9999999';
+    //         al2.Address_Level__c = al.id;
+    //         insert al2;
+
+    //         // 鐥呴櫌銈掍綔銈�
+    //         Account hospital = new Account();
+    //         hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+    //         hospital.Name = 'test hospital';
+    //         hospital.Is_Active__c = '鏈夊姽';
+    //         hospital.Attribute_Type__c = '鍗敓閮�';
+    //         hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+    //         hospital.Grade__c = '涓�绾�';
+    //         hospital.OCM_Category__c = 'SLTV';
+    //         hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+    //         hospital.State_Master__c = al.id;
+    //         hospital.City_Master__c = al2.id;
+    //         hospital.Town__c = '涓滀含';
+    //         insert hospital;
+
+    //         // 鎴︾暐绉戝銈掑緱銈�
+    //         Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+    //         // 瑷虹檪绉戙倰浣溿倠
+    //         Account dep = new Account();
+    //         dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+    //         dep.Name = 'test dep';
+    //         dep.AgentCode_Ext__c = '9999998';
+    //         dep.ParentId = strategicDep[0].Id;
+    //         dep.Department_Class__c = strategicDep[0].Id;
+    //         dep.Hospital__c = hospital.Id;
+    //         insert dep;
+
+    //         Contact contact2 = new Contact();
+    //         contact2.AccountId = dep.Id;
+    //         contact2.FirstName = '璨换鑰�';
+    //         contact2.LastName = 'test1缁忛攢鍟�';
+    //         insert contact2;
+
+    //         // 浜у搧
+    //         Product2 pro1 = new Product2(Name='name01',IsActive=true,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);
+    //         Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
+    //                 Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing',
+    //                 ProductCode_Ext__c='pc02',Manual_Entry__c=false);
+    //         Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI',
+    //                 Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing',
+    //                 ProductCode_Ext__c='pc03',Manual_Entry__c=false);
+    //         insert new Product2[] {pro1, pro2, pro3};
+
+    //         // 淇濇湁璁惧
+    //         Asset asset1 = new Asset(Asset_Owner__c = 'Olympus');
+    //         asset1.RecordTypeId = System.Label.Asset_RecordType;
+    //         asset1.SerialNumber = 'asset1';
+    //         asset1.Name = 'asset1';
+    //         asset1.AccountId = dep.Id;
+    //         asset1.Department_Class__c = strategicDep[0].Id;
+    //         asset1.Hospital__c = hospital.Id;
+    //         asset1.Product2Id = pro1.Id;
+    //         asset1.Quantity = 10;
+    //         asset1.Status = '涓嶆槑';
+    //         asset1.Manage_type__c = '涓綋绠$悊';
+    //         asset1.Loaner_accsessary__c = false;
+    //         asset1.Out_of_wh__c = 0;
+    //         asset1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         asset1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+    //         asset1.Product_category__c = 'GI';
+    //         asset1.Equipment_Type__c = '浜у搧璇曠敤';
+    //         asset1.SalesProvince__c = '鍖椾含';
+    //         asset1.CompanyOfEquipment__c = '鍖椾含';
+    //         asset1.Internal_Asset_number__c = '0001';
+    //         asset1.Rental_Count__c = 0;
+    //         asset1.AssetManageConfirm__c = true;
+
+    //         Asset asset2 = new Asset(Asset_Owner__c = 'Olympus');
+    //         asset2.RecordTypeId = System.Label.Asset_RecordType;
+    //         asset2.SerialNumber = 'asset2';
+    //         asset2.Name = 'asset2';
+    //         asset2.AccountId = dep.Id;
+    //         asset2.Department_Class__c = strategicDep[0].Id;
+    //         asset2.Hospital__c = hospital.Id;
+    //         asset2.Product2Id = pro2.Id;
+    //         asset2.Quantity = 10;
+    //         asset2.Status = '涓嶆槑';
+    //         asset2.Manage_type__c = '鏁伴噺绠$悊';
+    //         asset2.Loaner_accsessary__c = true;
+    //         asset2.Out_of_wh__c = 0;
+    //         asset2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         asset2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+    //         asset2.Product_category__c = 'GI';
+    //         asset2.Equipment_Type__c = '浜у搧璇曠敤';
+    //         asset2.SalesProvince__c = '鍖椾含';
+    //         asset2.CompanyOfEquipment__c = '鍖椾含';
+    //         asset2.Internal_Asset_number__c = '0002';
+    //         asset2.Rental_Count__c = 0;
+    //         asset2.AssetManageConfirm__c = true;
+    //         insert new Asset[] {asset1, asset2};
+
+    //         // 澶囧搧閰嶅
+    //         Fixture_Set__c fsObjA1 = new Fixture_Set__c();
+    //         fsObjA1.Name = 'set1';
+    //         fsObjA1.Fixture_Set_Body_Model_No__c = 'modelNo1';
+    //         fsObjA1.Loaner_name__c = 'name1';
+    //         insert fsObjA1;
+
+    //         // 澶囧搧閰嶅鏄庣粏
+    //         Fixture_Set_Detail__c fsdObjA1 = new Fixture_Set_Detail__c();
+    //         fsdObjA1.Name = '澶囧搧閰嶅鏄庣粏鍚�1';
+    //         fsdObjA1.Name_CHN_Created__c = '涓枃鍚嶇О1';
+    //         fsdObjA1.Product2__c = pro1.Id;
+    //         fsdObjA1.Fixture_Set__c = fsObjA1.Id;
+    //         fsdObjA1.Is_Body__c = true;
+    //         fsdObjA1.Is_Optional__c = false;
+    //         fsdObjA1.UniqueKey__c = fsObjA1.Id + ':' + pro1.Id;
+    //         // 澶囧搧閰嶅鏄庣粏
+    //         Fixture_Set_Detail__c fsdObjA2 = new Fixture_Set_Detail__c();
+    //         fsdObjA2.Name = '澶囧搧閰嶅鏄庣粏鍚�2';
+    //         fsdObjA2.Name_CHN_Created__c = '涓枃鍚嶇О2';
+    //         fsdObjA2.Product2__c = pro2.Id;
+    //         fsdObjA2.Fixture_Set__c = fsObjA1.Id;
+    //         fsdObjA2.Is_Body__c = false;
+    //         fsdObjA2.Is_Optional__c = true;
+    //         fsdObjA2.UniqueKey__c = fsObjA1.Id + ':' + pro2.Id;
+    //         insert new Fixture_Set_Detail__c[] {fsdObjA1, fsdObjA2};
+
+    //         List<Fixture_Set_Detail__c> fictureList = [select Name from Fixture_Set_Detail__c];
+    //         System.assertEquals(2, fictureList.size());
+
+    //         ////澶囧搧鍊熷嚭鐢宠
+    //         Rental_Apply__c raObj = new Rental_Apply__c();
+    //         raObj.Name = 'testra';
+    //         raObj.Product_category__c = 'GI';
+    //         raObj.Demo_purpose1__c = '浜у搧璇曠敤';
+    //         raObj.demo_purpose2__c = FixtureUtil.raDemo_purpose2MAP.get('shiyongwuxunjia');
+    //         raObj.direct_send__c = '鍖荤枟鏈烘瀯';
+    //         raObj.Loaner_received_staff__c = '鐜嬩簲';
+    //         raObj.Loaner_received_staff_phone__c = '110';
+    //         raObj.direct_shippment_address__c = '鍖椾含甯�';
+    //         raObj.Hospital__c = hospital.Id;
+    //         raObj.Strategic_dept__c = strategicDep[0].Id;
+    //         raObj.Account__c = dep.Id;
+    //         raObj.Request_shipping_day__c = Date.toDay();
+    //         raObj.Request_return_day__c = Date.toDay();
+    //         raObj.Phone_number__c = '1234567890';
+    //         raObj.Loaner_medical_Staff__c = contact2.Id;
+    //         insert raObj;
+
+    //         FixtureDeliverySlip__c ds = new FixtureDeliverySlip__c();
+    //         ds.Name = 'Test1';
+    //         ds.Wh_Staff__c = UserInfo.getUserId();
+    //         ds.DeliveryCompany__c = '鍒╄';
+    //         ds.Shippment_loaner_time__c = Datetime.now();
+    //         ds.Distributor_method__c = '闄嗚繍';
+    //         ds.DeliveryType__c = '鍙戣揣';
+    //         ds.DeliveryCompany_SlipNo__c = 'TestNo1';
+    //         insert ds;
+
+    //         Rental_Apply_Equipment_Set__c raesObj = new Rental_Apply_Equipment_Set__c();
+    //         raesObj.Rental_Apply__c = raObj.Id;
+    //         raesObj.Fixture_Set__c = fsObjA1.Id;
+    //         raesObj.Cancel_Select__c = false;
+    //         raesObj.Shipment_request_time__c = Date.toDay();
+    //         raesObj.Rental_Start_Date__c = Date.toDay();
+    //         raesObj.Rental_End_Date__c = Date.toDay();
+    //         raesObj.UniqueKey__c = raObj.RequestNoJoinStr2__c + ':'+ fsObjA1.Id + ':'+ 1;
+    //         raesObj.IndexFromUniqueKey__c = 1;
+    //         insert raesObj;
+
+    //         // 鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁�
+    //         Rental_Apply_Equipment_Set_Detail__c raesdObj1 = new Rental_Apply_Equipment_Set_Detail__c();
+    //         raesdObj1.Rental_Apply__c = raObj.Id;
+    //         raesdObj1.Fixture_Set_Detail__c = fsdObjA1.Id;
+    //         raesdObj1.Rental_Num__c = 1;
+    //         raesdObj1.Queue_Number__c = null;
+    //         raesdObj1.Is_Body__c = true;
+    //         raesdObj1.Rental_Apply_Equipment_Set__c = raesObj.Id;
+    //         raesdObj1.IndexFromUniqueKey__c = 1;
+    //         raesdObj1.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         raesdObj1.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+    //         raesdObj1.Product_category_text__c = 'GI';
+    //         raesdObj1.Equipment_Type_text__c = '浜у搧璇曠敤';
+    //         raesdObj1.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA1.Id + ':1';
+    //         raesdObj1.FSD_Fixture_Model_No__c = 'n01';
+    //         raesdObj1.Fixture_Model_No_text__c = 'n01';
+    //         raesdObj1.Asset__c = asset1.id;
+    //         raesdObj1.StockDown__c = true;
+    //         raesdObj1.OnStock_By_Cancel__c = true;
+    //         raesdObj1.Inspection_result_NG__c = '搴熷純';
+    //         raesdObj1.Inspection_result__c = 'NG';
+    //         // 鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁�
+    //         Rental_Apply_Equipment_Set_Detail__c raesdObj2 = new Rental_Apply_Equipment_Set_Detail__c();
+    //         raesdObj2.Rental_Apply__c = raObj.Id;
+    //         raesdObj2.Fixture_Set_Detail__c = fsdObjA2.Id;
+    //         raesdObj2.Rental_Num__c = 1;
+    //         raesdObj2.Queue_Number__c = null;
+    //         raesdObj2.Is_Body__c = false;
+    //         raesdObj2.Rental_Apply_Equipment_Set__c = raesObj.Id;
+    //         raesdObj2.IndexFromUniqueKey__c = 1;
+    //         raesdObj2.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         raesdObj2.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+    //         raesdObj2.Product_category_text__c = 'GI';
+    //         raesdObj2.Equipment_Type_text__c = '浜у搧璇曠敤';
+    //         raesdObj2.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA2.Id + ':1';
+    //         raesdObj2.FSD_Fixture_Model_No__c = 'n02';
+    //         raesdObj2.Fixture_Model_No_text__c = 'n02';
+    //         raesdObj2.Asset__c = asset2.id;
+    //         raesdObj2.StockDown__c = true;
+    //         raesdObj2.StockDown_staff__c = UserInfo.getUserId();
+    //         raesdObj2.StockDown_time__c = Datetime.now();
+    //         raesdObj2.Pre_inspection_time__c = Datetime.now();
+    //         raesdObj2.Inspection_staff__c = UserInfo.getUserId();
+    //         raesdObj2.Inspection_result__c = 'OK';
+    //         raesdObj2.DeliverySlip__c = ds.Id;
+
+    //         Rental_Apply_Equipment_Set_Detail__c raesdObj3 = new Rental_Apply_Equipment_Set_Detail__c();
+    //         raesdObj3.Rental_Apply__c = raObj.Id;
+    //         raesdObj3.Fixture_Set_Detail__c = fsdObjA2.Id;
+    //         raesdObj3.Rental_Num__c = 1;
+    //         raesdObj3.Queue_Number__c = null;
+    //         raesdObj3.Is_Body__c = false;
+    //         raesdObj3.Rental_Apply_Equipment_Set__c = raesObj.Id;
+    //         raesdObj3.IndexFromUniqueKey__c = 2;
+    //         raesdObj3.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         raesdObj3.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+    //         raesdObj3.Product_category_text__c = 'GI';
+    //         raesdObj3.Equipment_Type_text__c = '浜у搧璇曠敤';
+    //         raesdObj3.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA2.Id + ':2';
+    //         raesdObj3.FSD_Fixture_Model_No__c = 'n02';
+    //         raesdObj3.Fixture_Model_No_text__c = 'n02';
+    //         raesdObj3.Asset__c = asset2.id;
+    //         raesdObj3.StockDown__c = true;
+    //         raesdObj3.StockDown_staff__c = UserInfo.getUserId();
+    //         raesdObj3.StockDown_time__c = Datetime.now();
+    //         raesdObj3.Pre_inspection_time__c = Datetime.now();
+    //         raesdObj3.Inspection_staff__c = UserInfo.getUserId();
+    //         raesdObj3.Inspection_result__c = 'OK';
+    //         raesdObj3.DeliverySlip__c = ds.Id;
+    //         raesdObj3.Lost_item_giveup__c = true;
+    //         raesdObj3.Loaner_Giveup_Time__c = System.now();
+
+    //         insert new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3};
+
+    //         List<Rental_Apply_Equipment_Set_Detail__c> detailList = [select Asset__c from Rental_Apply_Equipment_Set_Detail__c];
+    //         System.assertEquals(3, detailList.size());
+
+    //         raesObj.First_RAESD__c = raesdObj1.Id;
+    //         update raesObj;
+
+
+    //         raObj.Status__c = '宸叉壒鍑�';
+    //         update raObj;
+    //         //鐩樼偣琛ㄥご
+    //         Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+    //         header.Inventory_Start_Date__c = Date.toDay();
+    //         header.UniqueKey__c = 'IH-0000';
+    //         header.Inventory_Status__c = '澶勭悊涓�';
+    //         header.InventoryCheck_PIC__c = [SELECT Id
+    //             FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+    //         header.InventorySubmit_PIC__c = [SELECT id
+    //             FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+    //         insert header;
+
+    //         String cunFangDi = '鍖椾含 澶囧搧涓績';
+
+    //         System.Test.StartTest();
+    //        // Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+    //         System.Test.StopTest();
+
+
+    //         List<Inventory_Detail_Copy__c> onStockList = [select UniqueKey__c from Inventory_Detail_Copy__c
+    //                                                                     WHERE Asset_Status__c = '鍦ㄥ簱'];
+    //         //System.assertEquals(2, onStockList.size());
+
+    //         List<Inventory_Detail_Copy__c> lendList = [select UniqueKey__c from Inventory_Detail_Copy__c
+    //                                                                  WHERE Asset_Status__c = '鍑哄�熶腑'];
+    //         //System.assertEquals(1, lendList.size());
+            
+
+    //         //Delete test TODO assert
+    //         header.Inventory_Status__c = null;
+    //         update header;
+    //         Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+    //     }
+    // }
+     @isTest
+    static void testDetail1() {
+        ControllerUtil.EscapeNFM001Trigger = true;
+        SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
+        InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_001__c = 'BJ';
+        InventoryHeaderName.From_Column_002__c = '涓婃捣 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_002__c = 'SH';
+        InventoryHeaderName.From_Column_003__c = '骞垮窞 澶囧搧涓績';
+        InventoryHeaderName.SS_Column_003__c = 'GZ';
+        insert new SS_Batch_Column_Mapping__c[] {InventoryHeaderName};
+        SS_Batch_Column_Mapping__c AgencyInventory = new SS_Batch_Column_Mapping__c(Name = 'Agency_Inventory_Role', SS_TableName__c='Agency_Inventory_Role');
+        AgencyInventory.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+        AgencyInventory.SS_Column_001__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        AgencyInventory.From_Column_002__c = '娴庡崡';
+        AgencyInventory.SS_Column_002__c = '1.鍗庡寳钀ヤ笟鏈儴';
+        AgencyInventory.From_Column_003__c = '閮戝窞';
+        AgencyInventory.SS_Column_003__c = '3.瑗垮寳钀ヤ笟鏈儴';
+        insert new SS_Batch_Column_Mapping__c[] {AgencyInventory};
+        
+        User thisUser = [Select Id from User where Id =: UserInfo.getUserId()];
+        System.runAs(thisUser) {
+            
+            // 鐪�
+            Address_Level__c al = new Address_Level__c();
+            al.Name = '鏉变含';
+            al.Level1_Code__c = 'CN-99';
+            al.Level1_Sys_No__c = '999999';
+            insert al;
+            // 甯�
+            Address_Level2__c al2 = new Address_Level2__c();
+            al2.Level1_Code__c = 'CN-99';
+            al2.Level1_Sys_No__c = '999999';
+            al2.Level1_Name__c = '鏉变含';
+            al2.Name = '娓嬭胺鍖�';
+            al2.Level2_Code__c = 'CN-9999';
+            al2.Level2_Sys_No__c = '9999999';
+            al2.Address_Level__c = al.id;
+            insert al2;
+
+            // 鐥呴櫌銈掍綔銈�
+            Account hospital = new Account();
+            hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+            hospital.Name = 'test hospital';
+            hospital.Is_Active__c = '鏈夊姽';
+            hospital.Attribute_Type__c = '鍗敓閮�';
+            hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+            hospital.Grade__c = '涓�绾�';
+            hospital.OCM_Category__c = 'SLTV';
+            hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+            hospital.State_Master__c = al.id;
+            hospital.City_Master__c = al2.id;
+            hospital.Town__c = '涓滀含';
+            insert hospital;
+
+            StaticParameter.EscapeAccountTrigger = true;
+            // 鎴︾暐绉戝銈掑緱銈�
+            Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+            // 瑷虹檪绉戙倰浣溿倠
+            Account dep = new Account();
+            dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+            dep.Name = 'test dep1';
+            dep.AgentCode_Ext__c = System.Label.Account_Asset_FJZ;
+            dep.ParentId = strategicDep[0].Id;
+            dep.Department_Class__c = strategicDep[0].Id;
+            dep.Hospital__c = hospital.Id;
+
+            Account dep1 = new Account();
+            dep1.recordtypeId = dep.recordtypeId;
+            dep1.Name = 'test dep1';
+            dep1.AgentCode_Ext__c = System.Label.Account_Asset;
+            dep1.ParentId = strategicDep[0].Id;
+            dep1.Department_Class__c = strategicDep[0].Id;
+            dep1.Hospital__c = hospital.Id;
+
+            insert new Account[]{dep, dep1};
+
+            // 浜у搧
+            Product2 pro1 = new Product2(Name='CLH-250:鍐呯闀滃喎鍏夋簮',IsActive=true,Family='GI',
+                    Fixture_Model_No__c='CLH-250',Serial_Lot_No__c='S/N tracing',
+                    Fixture_Model_No_T__c = 'CLH-250', Asset_Model_No__c = 'Pro1',
+                    ProductCode_Ext__c='4604362',Manual_Entry__c=false);
+
+            Product2 pro2 = new Product2(Name='鐢垫簮绾�',IsActive=true,Family='GI',
+                    Fixture_Model_No__c='鐢垫簮绾�',Serial_Lot_No__c='Lot tracing',
+                    Fixture_Model_No_T__c = '鐢垫簮绾�', Asset_Model_No__c = 'Pro2',
+                    ProductCode_Ext__c='BP900003',Manual_Entry__c=false);
+            Product2 pro3 = new Product2(Name='MAJ-1933:鏁板瓧璋冨厜鐢电紗',IsActive=true,Family='GI',
+                    Fixture_Model_No__c='MAJ-1933',Serial_Lot_No__c='Lot tracing',
+                    Fixture_Model_No_T__c = 'MAJ-1933', Asset_Model_No__c = 'Pro3',
+                    ProductCode_Ext__c='N3647100',Manual_Entry__c=false);
+            insert new Product2[] {pro1, pro2, pro3};
+
+
+             // 淇濇湁璁惧  涓绘満
+            Asset asset1 = new Asset(Asset_Owner__c = 'Olympus');
+            asset1.RecordTypeId = System.Label.Asset_RecordType;
+            asset1.SerialNumber = 'asset1';
+            asset1.Name = 'asset1';
+            asset1.AccountId = dep.Id;
+            asset1.Department_Class__c = strategicDep[0].Id;
+            asset1.Hospital__c = hospital.Id;
+            asset1.Product2Id = pro1.Id;
+            asset1.Quantity = 10;
+            asset1.Status = '涓嶆槑';
+            asset1.Manage_type__c = '涓綋绠$悊';
+            asset1.Loaner_accsessary__c = false;
+            asset1.Out_of_wh__c = 0;
+            asset1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+            asset1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+            asset1.Product_category__c = 'GI';
+            asset1.Equipment_Type__c = '浜у搧璇曠敤';
+            asset1.SalesProvince__c = '鍖椾含';
+            asset1.CompanyOfEquipment__c = '鍖椾含';
+            asset1.Internal_Asset_number__c = '0001';
+            asset1.Rental_Count__c = 0;
+            asset1.AssetManageConfirm__c = true;
+
+            Asset asset2 = new Asset(Asset_Owner__c = 'Olympus');
+            asset2.RecordTypeId = System.Label.Asset_RecordType;
+            asset2.SerialNumber = 'asset2';
+            asset2.Name = 'asset2';
+            asset2.AccountId = dep.Id;
+            asset2.Department_Class__c = strategicDep[0].Id;
+            asset2.Hospital__c = hospital.Id;
+            asset2.Product2Id = pro2.Id;
+            asset2.Quantity = 10;
+            asset2.Status = '涓嶆槑';
+            asset2.Manage_type__c = '鏁伴噺绠$悊';
+            asset2.Loaner_accsessary__c = true;   //闄勫睘鍝�
+            asset2.Out_of_wh__c = 0;
+            asset2.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+            asset2.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+            asset2.Product_category__c = 'GI';
+            asset2.Equipment_Type__c = '浜у搧璇曠敤';
+            asset2.SalesProvince__c = '鍖椾含';
+            asset2.CompanyOfEquipment__c = '鍖椾含';
+            asset2.Internal_Asset_number__c = '0002';
+            asset2.Rental_Count__c = 0;
+            asset2.AssetManageConfirm__c = true;
+
+            insert new Asset[] {asset1, asset2};
+
+            List<Asset> assetList = [select Name from Asset];
+            System.assertEquals(2, assetList.size());
+
+            // 澶囧搧涓�瀵逛竴Link琛�
+            Fixture_OneToOne_Link__c foLink1 = new Fixture_OneToOne_Link__c();
+            foLink1.Main_Asset__c = asset1.Id;
+            foLink1.Accessory_Asset__c = asset2.Id;
+            foLink1.Quantity__c = 1;
+
+            insert new Fixture_OneToOne_Link__c[] {foLink1};
+
+            // 澶囧搧閰嶅
+            Fixture_Set__c fsObj1 = new Fixture_Set__c();
+            fsObj1.Name = 'set1';
+            fsObj1.Fixture_Set_Body_Model_No__c = 'modelNo1';
+            fsObj1.Loaner_name__c = 'name1';
+            insert fsObj1;
+
+            // 澶囧搧閰嶅鏄庣粏
+            Fixture_Set_Detail__c fsdObjA1 = new Fixture_Set_Detail__c();
+
+            fsdObjA1.Name = '澶囧搧閰嶅鏄庣粏鍚�1';
+            fsdObjA1.Name_CHN_Created__c = '涓枃鍚嶇О1';
+            fsdObjA1.Product2__c = pro1.Id;
+            fsdObjA1.Fixture_Set__c = fsObj1.Id;
+            fsdObjA1.Is_Body__c = true;
+            fsdObjA1.Is_Optional__c = false;
+            fsdObjA1.UniqueKey__c = fsObj1.Id + ':' + pro1.Id;
+            fsdObjA1.SortInt__c = 1;
+            fsdObjA1.Quantity__c = 1;
+
+            Fixture_Set_Detail__c fsdObjA2 = new Fixture_Set_Detail__c();
+            fsdObjA2.Name = '澶囧搧閰嶅鏄庣粏鍚�2';
+            fsdObjA2.Name_CHN_Created__c = '涓枃鍚嶇О2';
+            fsdObjA2.Product2__c = pro2.Id;
+            fsdObjA2.Fixture_Set__c = fsObj1.Id;
+            fsdObjA2.Is_Body__c = false;
+            fsdObjA2.Is_Optional__c = true;
+            fsdObjA2.UniqueKey__c = fsObj1.Id + ':' + pro2.Id;
+            fsdObjA2.SortInt__c = 2;
+            fsdObjA2.Quantity__c = 1;
+            fsdObjA2.Is_OneToOne__c = true;
+
+            Fixture_Set_Detail__c fsdObjA3 = new Fixture_Set_Detail__c();
+            fsdObjA3.Name = '澶囧搧閰嶅鏄庣粏鍚�3';
+            fsdObjA3.Name_CHN_Created__c = '涓枃鍚嶇О3';
+            fsdObjA3.Product2__c = pro3.Id;
+            fsdObjA3.Fixture_Set__c = fsObj1.Id;
+            fsdObjA3.Is_Body__c = false;
+            fsdObjA3.Is_Optional__c = true;
+            fsdObjA3.UniqueKey__c = fsObj1.Id + ':' + pro3.Id;
+            fsdObjA3.SortInt__c = 3;
+            fsdObjA3.Quantity__c = 1;
+            fsdObjA3.Is_OneToOne__c = true;
+
+            insert new Fixture_Set_Detail__c[] {fsdObjA1, fsdObjA2, fsdObjA3};
+            FixtureDeliverySlip__c ds = new FixtureDeliverySlip__c();
+            ds.Name = 'Test1';
+            ds.Wh_Staff__c = UserInfo.getUserId();
+            ds.DeliveryCompany__c = '鍒╄';
+            ds.Shippment_loaner_time__c = Datetime.now();
+            ds.Distributor_method__c = '闄嗚繍';
+            ds.DeliveryType__c = '鍙戣揣';
+            ds.DeliveryCompany_SlipNo__c = 'TestNo1';
+            insert ds;
+
+            //璋冩嫧鐢宠
+            TransferApply__c raObj = new TransferApply__c();
+            raObj.Name = 'testra';
+            raObj.From_Location__c = '鍖椾含';
+            raObj.Destination_Location__c = '鍖椾含 澶囧搧涓績';
+            Map<String,Schema.RecordTypeInfo>  DEVELOPERNAMEMAP  = Schema.SObjectType.TransferApply__c.getRecordTypeInfosByDeveloperName();
+            raObj.RecordTypeId = DEVELOPERNAMEMAP.get('AgencyToCenter').getRecordTypeId();            
+            insert raObj;
+
+            // 璋冩嫧涓�瑙�
+            TransferApplySummary__c raesObj = new TransferApplySummary__c();
+            raesObj.TransferApply__c = raObj.Id;
+            raesObj.Fixture_Set__c = fsObj1.Id;
+            raesObj.Cancel_Select__c = false;
+            raesObj.IndexFromUniqueKey__c = 1;
+            insert raesObj;
+
+
+            //璋冩嫧鐢宠涓�瑙堟槑缁�
+            //鐘舵�� 寰呯Щ鑷虫姤搴熷尯   涓绘満
+            TransferApplyDetail__c raesdObj1 = new TransferApplyDetail__c();
+            raesdObj1.TransferApply__c = raObj.Id;
+            raesdObj1.Fixture_Set_Detail__c = fsdObjA1.Id;
+            raesdObj1.TransferApplySummary__c = raesObj.Id;
+            raesdObj1.IndexFromUniqueKey__c = 1;
+            raesdObj1.FSD_OneToOneAccessory_Cnt__c = 1;
+            raesdObj1.ApplyPersonAppended__c = false;
+            raesdObj1.TransferCount__c = 1;
+            raesdObj1.FSD_SortInt__c = 01;
+            raesdObj1.Asset__c = asset1.Id;
+            raesdObj1.Main_OneToOne__c = true;  //涓绘満
+            raesdObj1.Salesdepartment_After__c = '1.鍗庡寳钀ヤ笟鏈儴';
+            raesdObj1.OneToOneAccessory__c = false;
+            raesdObj1.StockDown__c = true;
+            raesdObj1.StockDown_staff__c = UserInfo.getUserId();
+            raesdObj1.StockDown_time__c = Datetime.now();
+            raesdObj1.Pre_inspection_time__c = Datetime.now();
+            raesdObj1.Inspection_staff__c = UserInfo.getUserId();
+            raesdObj1.Inspection_result__c = 'OK';
+            raesdObj1.DeliverySlip__c = ds.Id; 
+            raesdObj1.Check_lost_Item__c ='OK';
+            raesdObj1.Inspection_result_after__c = 'NG';
+            raesdObj1.Inspection_NG_abord_reason__c = '鍏朵粬';
+            raesdObj1.Inspection_Comment__c = 'test';
+            raesdObj1.Inspection_result_after_ng__c = '搴熷純';
+
+
+            //闄勫睘鍝�  娆犲搧
+            TransferApplyDetail__c raesdObj2 = new TransferApplyDetail__c();
+            raesdObj2.TransferApply__c = raObj.Id;
+            raesdObj2.Fixture_Set_Detail__c = fsdObjA2.Id;
+            raesdObj2.TransferApplySummary__c = raesObj.Id;
+            raesdObj2.IndexFromUniqueKey__c = 2;
+            raesdObj2.FSD_OneToOneAccessory_Cnt__c = 1;
+            raesdObj2.ApplyPersonAppended__c = false;
+            raesdObj2.TransferCount__c = 1;
+            raesdObj2.FSD_SortInt__c = 02;
+            raesdObj2.Asset__c = asset2.Id;
+            raesdObj2.OneToOneAccessory__c = true;
+            raesdObj2.StockDown__c = true;
+            raesdObj2.StockDown_staff__c = UserInfo.getUserId();
+            raesdObj2.StockDown_time__c = Datetime.now();
+            raesdObj2.Pre_inspection_time__c = Datetime.now();
+            raesdObj2.Inspection_staff__c = UserInfo.getUserId();
+            raesdObj2.Inspection_result__c = 'OK';
+            raesdObj2.DeliverySlip__c = ds.Id; 
+            raesdObj2.Lost_item_giveup__c = true;
+            raesdObj2.Loaner_Giveup_Time__c = System.now();
+            raesdObj2.OnStock_By_Cancel__c = false;
+            raesdObj2.Check_lost_Item_Final__c ='娆犲搧';
+            raesdObj2.Loaner_accsessary__c = true;
+            insert new TransferApplyDetail__c[] {raesdObj1,raesdObj2};
+
+          
+            
+
+            //鐩樼偣琛ㄥご
+            Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+            header.Inventory_Start_Date__c = Date.toDay();
+            header.UniqueKey__c = 'IH-0000';
+            header.Inventory_Status__c = '澶勭悊涓�';
+            header.InventoryCheck_PIC__c = [SELECT Id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+            header.InventorySubmit_PIC__c = [SELECT id
+                FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+            insert header;
+
+            String cunFangDi = '鍖椾含 澶囧搧涓績';
+
+            System.Test.StartTest();
+            Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+            System.Test.StopTest(); 
+
+
+            List<Inventory_Detail_Copy__c> onStockList = [select UniqueKey__c from Inventory_Detail_Copy__c
+                                                                        WHERE Asset_Status__c = '鍦ㄥ簱'];
+            System.assertEquals(3, onStockList.size());
+            
+
+            //Delete test TODO assert
+            header.Inventory_Status__c = null;
+            update header;
+            Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+        }
+    }
+    //  @isTest
+    // static void testDetail4() {
+    //     ControllerUtil.EscapeNFM001Trigger = true;
+    //     SS_Batch_Column_Mapping__c InventoryHeaderName = new SS_Batch_Column_Mapping__c(Name = 'Inventory_Header_Name', SS_TableName__c='Inventory_Header_Name');
+    //     InventoryHeaderName.From_Column_001__c = '鍖椾含 澶囧搧涓績';
+    //     InventoryHeaderName.SS_Column_001__c = 'BJ';
+    //     InventoryHeaderName.From_Column_002__c = '涓婃捣 澶囧搧涓績';
+    //     InventoryHeaderName.SS_Column_002__c = 'SH';
+    //     InventoryHeaderName.From_Column_003__c = '骞垮窞 澶囧搧涓績';
+    //     InventoryHeaderName.SS_Column_003__c = 'GZ';
+    //     insert new SS_Batch_Column_Mapping__c[] {InventoryHeaderName};
+        
+    //     User thisUser = [Select Id from User where Id =: UserInfo.getUserId()];
+    //     System.runAs(thisUser) {
+            
+    //         // 鐪�
+    //         Address_Level__c al = new Address_Level__c();
+    //         al.Name = '鏉变含';
+    //         al.Level1_Code__c = 'CN-99';
+    //         al.Level1_Sys_No__c = '999999';
+    //         insert al;
+    //         // 甯�
+    //         Address_Level2__c al2 = new Address_Level2__c();
+    //         al2.Level1_Code__c = 'CN-99';
+    //         al2.Level1_Sys_No__c = '999999';
+    //         al2.Level1_Name__c = '鏉变含';
+    //         al2.Name = '娓嬭胺鍖�';
+    //         al2.Level2_Code__c = 'CN-9999';
+    //         al2.Level2_Sys_No__c = '9999999';
+    //         al2.Address_Level__c = al.id;
+    //         insert al2;
+
+    //         // 鐥呴櫌銈掍綔銈�
+    //         Account hospital = new Account();
+    //         hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
+    //         hospital.Name = 'test hospital';
+    //         hospital.Is_Active__c = '鏈夊姽';
+    //         hospital.Attribute_Type__c = '鍗敓閮�';
+    //         hospital.Speciality_Type__c = '缁煎悎鍖婚櫌';
+    //         hospital.Grade__c = '涓�绾�';
+    //         hospital.OCM_Category__c = 'SLTV';
+    //         hospital.Is_Medical__c = '鍖荤枟鏈烘瀯';
+    //         hospital.State_Master__c = al.id;
+    //         hospital.City_Master__c = al2.id;
+    //         hospital.Town__c = '涓滀含';
+    //         insert hospital;
+
+    //         StaticParameter.EscapeAccountTrigger = true;
+    //         // 鎴︾暐绉戝銈掑緱銈�
+    //         Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
+    //         // 瑷虹檪绉戙倰浣溿倠
+    //         Account dep = new Account();
+    //         dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
+    //         dep.Name = 'test dep1';
+    //         dep.AgentCode_Ext__c = System.Label.Account_Asset_FJZ;
+    //         dep.ParentId = strategicDep[0].Id;
+    //         dep.Department_Class__c = strategicDep[0].Id;
+    //         dep.Hospital__c = hospital.Id;
+
+    //         Account dep1 = new Account();
+    //         dep1.recordtypeId = dep.recordtypeId;
+    //         dep1.Name = 'test dep1';
+    //         dep1.AgentCode_Ext__c = System.Label.Account_Asset;
+    //         dep1.ParentId = strategicDep[0].Id;
+    //         dep1.Department_Class__c = strategicDep[0].Id;
+    //         dep1.Hospital__c = hospital.Id;
+
+    //         insert new Account[]{dep, dep1};
+
+    //         // 浜у搧
+    //         Product2 pro1 = new Product2(Name='CLH-250:鍐呯闀滃喎鍏夋簮',IsActive=true,Family='GI',
+    //                 Fixture_Model_No__c='CLH-250',Serial_Lot_No__c='S/N tracing',
+    //                 Fixture_Model_No_T__c = 'CLH-250', Asset_Model_No__c = 'Pro1',
+    //                 ProductCode_Ext__c='4604362',Manual_Entry__c=false);
+
+    //         Product2 pro2 = new Product2(Name='鐢垫簮绾�',IsActive=true,Family='GI',
+    //                 Fixture_Model_No__c='鐢垫簮绾�',Serial_Lot_No__c='Lot tracing',
+    //                 Fixture_Model_No_T__c = '鐢垫簮绾�', Asset_Model_No__c = 'Pro2',
+    //                 ProductCode_Ext__c='BP900003',Manual_Entry__c=false);
+    //         Product2 pro3 = new Product2(Name='MAJ-1933:鏁板瓧璋冨厜鐢电紗',IsActive=true,Family='GI',
+    //                 Fixture_Model_No__c='MAJ-1933',Serial_Lot_No__c='Lot tracing',
+    //                 Fixture_Model_No_T__c = 'MAJ-1933', Asset_Model_No__c = 'Pro3',
+    //                 ProductCode_Ext__c='N3647100',Manual_Entry__c=false);
+    //         insert new Product2[] {pro1, pro2, pro3};
+
+
+    //          // 淇濇湁璁惧  鍗曠嫭涓绘満
+    //         Asset asset1 = new Asset(Asset_Owner__c = 'Olympus');
+    //         asset1.RecordTypeId = System.Label.Asset_RecordType;
+    //         asset1.SerialNumber = 'asset1';
+    //         asset1.Name = 'asset1';
+    //         asset1.AccountId = dep.Id;
+    //         asset1.Department_Class__c = strategicDep[0].Id;
+    //         asset1.Hospital__c = hospital.Id;
+    //         asset1.Product2Id = pro1.Id;
+    //         asset1.Quantity = 10;
+    //         asset1.Status = '涓嶆槑';
+    //         asset1.Manage_type__c = '涓綋绠$悊';
+    //         asset1.Loaner_accsessary__c = false;
+    //         asset1.Out_of_wh__c = 0;
+    //         asset1.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         asset1.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+    //         asset1.Product_category__c = 'GI';
+    //         asset1.Equipment_Type__c = '浜у搧璇曠敤';
+    //         asset1.SalesProvince__c = '鍖椾含';
+    //         asset1.CompanyOfEquipment__c = '鍖椾含';
+    //         asset1.Internal_Asset_number__c = '0001';
+    //         asset1.Rental_Count__c = 0;
+    //         asset1.AssetManageConfirm__c = true;
+    //         insert asset1;
+
+    //          // 淇濇湁璁惧  涓�瀵逛竴涓绘満
+    //         Asset asset11 = new Asset(Asset_Owner__c = 'Olympus');
+    //         asset11.RecordTypeId = System.Label.Asset_RecordType;
+    //         asset11.SerialNumber = 'asset11';
+    //         asset11.Name = 'asset11';
+    //         asset11.AccountId = dep.Id;
+    //         asset11.Department_Class__c = strategicDep[0].Id;
+    //         asset11.Hospital__c = hospital.Id;
+    //         asset11.Product2Id = pro1.Id;
+    //         asset11.Quantity = 10;
+    //         asset11.Status = '涓嶆槑';
+    //         asset11.Manage_type__c = '涓綋绠$悊';
+    //         asset11.Loaner_accsessary__c = false;
+    //         asset11.Out_of_wh__c = 0;
+    //         asset11.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         asset11.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+    //         asset11.Product_category__c = 'GI';
+    //         asset11.Equipment_Type__c = '浜у搧璇曠敤';
+    //         asset11.SalesProvince__c = '鍖椾含';
+    //         asset11.CompanyOfEquipment__c = '鍖椾含';
+    //         asset11.Internal_Asset_number__c = '0001';
+    //         asset11.Rental_Count__c = 0;
+    //         asset11.AssetManageConfirm__c = true;
+    //         //涓�瀵逛竴寰楅檮灞炲搧    
+    //         Asset asset12 = new Asset(Asset_Owner__c = 'Olympus');
+    //         asset12.RecordTypeId = System.Label.Asset_RecordType;
+    //         asset12.SerialNumber = 'asset12';
+    //         asset12.Name = 'asset12';
+    //         asset12.AccountId = dep.Id;
+    //         asset12.Department_Class__c = strategicDep[0].Id;
+    //         asset12.Hospital__c = hospital.Id;
+    //         asset12.Product2Id = pro2.Id;
+    //         asset12.Quantity = 10;
+    //         asset12.Status = '涓嶆槑';
+    //         asset12.Manage_type__c = '鏁伴噺绠$悊';
+    //         asset12.Loaner_accsessary__c = true;   //闄勫睘鍝�
+    //         asset12.Out_of_wh__c = 0;
+    //         asset12.Salesdepartment__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         asset12.Internal_asset_location__c = '鍖椾含 澶囧搧涓績';
+    //         asset12.Product_category__c = 'GI';
+    //         asset12.Equipment_Type__c = '浜у搧璇曠敤';
+    //         asset12.SalesProvince__c = '鍖椾含';
+    //         asset12.CompanyOfEquipment__c = '鍖椾含';
+    //         asset12.Internal_Asset_number__c = '0002';
+    //         asset12.Rental_Count__c = 0;
+    //         asset12.AssetManageConfirm__c = true;
+
+    //         insert new Asset[] {asset11, asset12};
+
+    //         List<Asset> assetList = [select Name from Asset];
+    //         System.assertEquals(3, assetList.size());
+
+    //         // 澶囧搧涓�瀵逛竴Link琛�
+    //         Fixture_OneToOne_Link__c foLink1 = new Fixture_OneToOne_Link__c();
+    //         foLink1.Main_Asset__c = asset11.Id;
+    //         foLink1.Accessory_Asset__c = asset12.Id; 
+    //         foLink1.Quantity__c = 1;
+
+    //         insert new Fixture_OneToOne_Link__c[] {foLink1};
+
+            
+    //         FixtureDeliverySlip__c ds = new FixtureDeliverySlip__c();
+    //         ds.Name = 'Test1';
+    //         ds.Wh_Staff__c = UserInfo.getUserId();
+    //         ds.DeliveryCompany__c = '鍒╄';
+    //         ds.Shippment_loaner_time__c = Datetime.now();
+    //         ds.Distributor_method__c = '闄嗚繍';
+    //         ds.DeliveryType__c = '鍙戣揣';
+    //         ds.DeliveryCompany_SlipNo__c = 'TestNo1';
+    //         insert ds;
+
+    //         //璋冩嫧鐢宠
+    //         TransferApply__c raObj = new TransferApply__c();
+    //         raObj.Name = 'testra';
+    //         raObj.From_Location__c = '鍖椾含';
+    //         raObj.Destination_Location__c = '鍖椾含 澶囧搧涓績';
+    //         Map<String,Schema.RecordTypeInfo>  DEVELOPERNAMEMAP  = Schema.SObjectType.TransferApply__c.getRecordTypeInfosByDeveloperName();
+    //         raObj.RecordTypeId = DEVELOPERNAMEMAP.get('AgencyToCenter').getRecordTypeId();            
+    //         insert raObj;
+
+    //         // 璋冩嫧涓�瑙�
+    //         TransferApplySummary__c raesObj = new TransferApplySummary__c();
+    //         raesObj.TransferApply__c = raObj.Id;
+    //         raesObj.Cancel_Select__c = false;
+    //         raesObj.IndexFromUniqueKey__c = 1;
+    //         insert raesObj;
+    //         //璋冩嫧涓緱鏁版嵁
+    //         TransferApplyDetail__c raesdObj3 = new TransferApplyDetail__c();
+    //         raesdObj3.TransferApply__c = raObj.Id;
+    //         raesdObj3.TransferApplySummary__c = raesObj.Id;
+    //         raesdObj3.IndexFromUniqueKey__c = 1;
+    //         raesdObj3.ApplyPersonAppended__c = false;
+    //         raesdObj3.FSD_SortInt__c = 01;
+    //         raesdObj3.Asset__c = asset1.Id;
+    //         raesdObj3.StockDown__c = true;
+    //         raesdObj3.StockDown_staff__c = UserInfo.getUserId();
+    //         raesdObj3.StockDown_time__c = Datetime.now();
+    //         raesdObj3.Pre_inspection_time__c = Datetime.now();
+    //         raesdObj3.Inspection_staff__c = UserInfo.getUserId();
+    //         raesdObj3.Inspection_result__c = 'OK';
+    //         raesdObj3.DeliverySlip__c = ds.Id;
+    //         raesdObj3.OneToOneAccessory__c =false;
+    //         raesdObj3.CDS_complete__c =true;
+    //         raesdObj3.CDS_complete_time__c = Datetime.now();
+    //         raesdObj3.Shipment_Status_Text__c = '宸插嚭搴�';
+    //         insert raesdObj3;
+
+    //         // 璋冩嫧涓�瑙�
+    //         TransferApplySummary__c raesObj1 = new TransferApplySummary__c();
+    //         raesObj1.TransferApply__c = raObj.Id;
+    //         raesObj1.Cancel_Select__c = false;
+    //         raesObj1.IndexFromUniqueKey__c = 1;
+    //         insert raesObj1;
+
+
+    //         //璋冩嫧鐢宠涓�瑙堟槑缁�    涓�瀵逛竴璧扮殑鏁版嵁
+    //         //鐘舵�� 涓嬫灦   涓绘満
+    //         TransferApplyDetail__c raesdObj1 = new TransferApplyDetail__c();
+    //         raesdObj1.TransferApply__c = raObj.Id;
+    //         raesdObj1.TransferApplySummary__c = raesObj1.Id;
+    //         raesdObj1.IndexFromUniqueKey__c = 1;
+    //         raesdObj1.FSD_OneToOneAccessory_Cnt__c = 1;
+    //         raesdObj1.ApplyPersonAppended__c = false;
+    //         raesdObj1.TransferCount__c = 1;
+    //         raesdObj1.FSD_SortInt__c = 01;
+    //         raesdObj1.Asset__c = asset11.Id;
+    //         raesdObj1.Main_OneToOne__c = true;  //涓绘満
+    //         raesdObj1.Salesdepartment_After__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         raesdObj1.OneToOneAccessory__c = true;
+    //         raesdObj1.StockDown__c = true;
+    //         raesdObj1.StockDown_staff__c = UserInfo.getUserId();
+    //         raesdObj1.StockDown_time__c = Datetime.now();
+    //         //闄勫睘鍝�  涓嬫灦
+    //         TransferApplyDetail__c raesdObj2 = new TransferApplyDetail__c();
+    //         raesdObj2.TransferApply__c = raObj.Id;
+    //         raesdObj2.TransferApplySummary__c = raesObj1.Id;
+    //         raesdObj2.IndexFromUniqueKey__c = 2;
+    //         raesdObj2.FSD_OneToOneAccessory_Cnt__c = 1;
+    //         raesdObj2.ApplyPersonAppended__c = false;
+    //         raesdObj2.TransferCount__c = 1;
+    //         raesdObj2.FSD_SortInt__c = 02;
+    //         raesdObj2.Asset__c = asset12.Id;
+    //         raesdObj2.OneToOneAccessory__c = true;
+    //         raesdObj2.StockDown__c = true;
+    //         raesdObj2.StockDown_staff__c = UserInfo.getUserId();
+    //         raesdObj2.StockDown_time__c = Datetime.now();
+            
+    //         insert new TransferApplyDetail__c[] {raesdObj1,raesdObj2};
+
+    //         ////澶囧搧鍊熷嚭鐢宠
+    //         Rental_Apply__c rasObj = new Rental_Apply__c();
+    //         rasObj.Name = 'testra';
+    //         rasObj.Product_category__c = 'GI';
+    //         rasObj.Demo_purpose1__c = '浜у搧璇曠敤';
+    //         rasObj.demo_purpose2__c = FixtureUtil.raDemo_purpose2MAP.get('shiyongwuxunjia');
+    //         rasObj.direct_send__c = '鍖荤枟鏈烘瀯';
+    //         rasObj.Loaner_received_staff__c = '鐜嬩簲';
+    //         rasObj.Loaner_received_staff_phone__c = '110';
+    //         rasObj.direct_shippment_address__c = '鍖椾含甯�';
+    //         rasObj.Hospital__c = hospital.Id;
+    //         rasObj.Strategic_dept__c = strategicDep[0].Id;
+    //         rasObj.Account__c = dep.Id;
+    //         rasObj.Request_shipping_day__c = Date.toDay();
+    //         rasObj.Request_return_day__c = Date.toDay();
+    //         rasObj.Phone_number__c = '1234567890';
+    //         insert rasObj;
+    //         Rental_Apply_Equipment_Set__c raessObj = new Rental_Apply_Equipment_Set__c();
+    //         raessObj.Rental_Apply__c = rasObj.Id;
+    //         raessObj.Cancel_Select__c = false;
+    //         raessObj.Shipment_request_time__c = Date.toDay();
+    //         raessObj.Rental_Start_Date__c = Date.toDay();
+    //         raessObj.Rental_End_Date__c = Date.toDay();
+    //         raessObj.UniqueKey__c = rasObj.RequestNoJoinStr2__c + ':'+ null + ':'+ 1;
+    //         raessObj.IndexFromUniqueKey__c = 1;
+    //         insert raessObj;
+
+    //         // 鍊熷嚭澶囧搧閰嶅涓�瑙堟槑缁�
+    //         Rental_Apply_Equipment_Set_Detail__c raesdsObj1 = new Rental_Apply_Equipment_Set_Detail__c();
+    //         raesdsObj1.Rental_Apply__c = rasObj.Id;
+    //         raesdsObj1.Rental_Num__c = 1;
+    //         raesdsObj1.Queue_Number__c = null;
+    //         raesdsObj1.Is_Body__c = true;
+    //         raesdsObj1.Rental_Apply_Equipment_Set__c = raessObj.Id;
+    //         raesdsObj1.IndexFromUniqueKey__c = 1;
+    //         raesdsObj1.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+    //         raesdsObj1.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+    //         raesdsObj1.Product_category_text__c = 'GI';
+    //         raesdsObj1.Equipment_Type_text__c = '浜у搧璇曠敤';
+    //         raesdsObj1.UniqueKey__c = '1:'+ raessObj.Id + ':' + null + ':1';
+    //         raesdsObj1.FSD_Fixture_Model_No__c = 'n01';
+    //         raesdsObj1.Fixture_Model_No_text__c = 'n01';
+    //         raesdsObj1.Asset__c = asset1.id;
+    //         raesdsObj1.StockDown__c = true;
+    //         raesdsObj1.OnStock_By_Cancel__c = true;
+    //         raesdsObj1.Inspection_result_NG__c = '搴熷純';
+    //         raesdsObj1.Inspection_result__c = 'NG';
+    //         raesdsObj1.FSD_Is_OneToOne__c =true;
+    //         raesdsObj1.Fixture_OneToOne_Link_Id__c ='12435';
+    //         insert raesdsObj1;
+           
+             
+    //         //鐩樼偣琛ㄥご
+    //         Inventory_Header_Copy__c header = new Inventory_Header_Copy__c();
+    //         header.Inventory_Start_Date__c = Date.toDay();
+    //         header.UniqueKey__c = 'IH-0000';
+    //         header.Inventory_Status__c = '澶勭悊涓�';
+    //         header.InventoryCheck_PIC__c = [SELECT Id
+    //             FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+    //         header.InventorySubmit_PIC__c = [SELECT id
+    //             FROM User WHERE Dept__c = '鍖荤枟涓滃寳钀ヤ笟鏈儴' and IsActive = true limit 1].id;
+    //         insert header;
+
+    //         // Inventory_Header__Share xmshare = new Inventory_Header__Share(
+    //         //             RowCause = 'Manual',
+    //         //             ParentId = header.Id,
+    //         //             UserOrGroupId = header.InventoryCheck_PIC__c,
+    //         //             AccessLevel = 'Edit');
+
+
+    //         String cunFangDi = '鍖椾含 澶囧搧涓績';
+
+    //         System.Test.StartTest();
+    //        // Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+    //         System.Test.StopTest(); 
+
+
+          
+    //          List<TransferApplyDetail__c> tadList = [select TAESD_Status__c from TransferApplyDetail__c
+    //                                                                     WHERE Inspection_result__c = 'OK' and CDS_complete__c= true];
+    //          //System.assertEquals('鏀惰揣鍚庡凡CDS', tadList[0].TAESD_Status__c);                                                       
+
+    //         List<Inventory_Detail_Copy__c> trList = [select UniqueKey__c from Inventory_Detail_Copy__c
+    //                                                                  WHERE Asset_Status__c = '璋冩嫧涓�'];
+    //        // System.assertEquals(1, trList.size()); 
+            
+
+    //         //Delete test TODO assert
+    //         //header.Inventory_Status__c = null;
+    //        // update header;
+    //        // Database.executeBatch(new InventoryStartAssetSnapshotCopyBatch(cunFangDi,header));
+    //     }
+    // }
+    static testMethod void updaue() {
+        InventoryStartAssetSnapshotCopyBatch.test();//鍏堣皟鐢ㄨ繖涓紝鐒跺悗缁х画琛ュ厖娴嬭瘯绫�
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls-meta.xml b/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls-meta.xml
new file mode 100644
index 0000000..db9bf8c
--- /dev/null
+++ b/force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatchTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>48.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/KPIPreviewScheduel.cls b/force-app/main/default/classes/KPIPreviewScheduel.cls
new file mode 100644
index 0000000..64620ab
--- /dev/null
+++ b/force-app/main/default/classes/KPIPreviewScheduel.cls
@@ -0,0 +1,6 @@
+global class KPIPreviewScheduel implements Schedulable {
+   global void execute(SchedulableContext SC) {
+      EquipmentRealCoverageBatch batch1 = new EquipmentRealCoverageBatch();
+      Database.executeBatch(batch1);
+   }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/KPIPreviewScheduel.cls-meta.xml b/force-app/main/default/classes/KPIPreviewScheduel.cls-meta.xml
new file mode 100644
index 0000000..40d6793
--- /dev/null
+++ b/force-app/main/default/classes/KPIPreviewScheduel.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/LastbuyProductHandler.cls b/force-app/main/default/classes/LastbuyProductHandler.cls
index 4858b68..3ba4f25 100644
--- a/force-app/main/default/classes/LastbuyProductHandler.cls
+++ b/force-app/main/default/classes/LastbuyProductHandler.cls
@@ -1,7 +1,12 @@
 /**
- * 20220210 lt UpdateIdentification()--鏇存柊浜у搧涓婄殑鈥滈鐣欎骇鍝佲�濇爣璇�
- * 棰勭暀浜у搧瀵硅薄浼氬叧鑱斾竴涓骇鍝佷富鏁版嵁
- * 鍒涘缓棰勭暀浜у搧鏃讹紝灏嗕骇鍝佷富鏁版嵁涓婄殑鈥滈鐣欎骇鍝佲�濇爣璇� 鏇存柊涓� true
+ * 20220210 lt 鏇存柊浜у搧涓婄殑鈥滈鐣欎骇鍝佲�濇爣璇�
+ * 浜у搧 鏈� 鏈夋晥棰勭暀浜у搧  鈥滈鐣欎骇鍝佲�濇爣璇� true
+ * 浜у搧 娌℃湁 鏈夋晥棰勭暀浜у搧(鏃犻鐣欎骇鍝� 鎴� 棰勭暀浜у搧 鏃犳晥)  鈥滈鐣欎骇鍝佲�濇爣璇� false
+ * (1) 鏂板缓 鏈夋晥棰勭暀浜у搧                                            --true
+ * (2) 鏇存柊  鈥滄槸鍚︽湁鏁堚�� false 鍙樹负 true                             --true
+ * (3) 鏇存柊 鈥滀骇鍝佲�� 鍚�                                               --true
+ * (4) 鏇存柊  鈥滄槸鍚︽湁鏁堚�� true 鍙樹负 false 鐨勪骇鍝佷笅鏃犳湁鏁堥鐣欎骇鍝�        --false
+ * (5) 鏇存柊 鈥滀骇鍝佲�� 鍓嶇殑浜у搧 鏃犻鐣欎骇鍝� 鎴� 鏃犳湁鏁堥鐣欎骇鍝�               --false
  */
 public without sharing class LastbuyProductHandler extends Oly_TriggerHandler {
     private Map<Id, LastbuyProduct__c> newMap;
@@ -21,114 +26,113 @@
     }
 
     protected override void afterInsert(){
-        UpdateIdentification();
+        ReservedPro();
     }
 
     protected override void afterUpdate(){
-        Invalid();
+        ReservedPro();
     }
 
-    //鏇存柊鏍囪瘑
-    private void UpdateIdentification(){
-    
-        //瀛樹骇鍝佺殑ID 
-        List<Id> pList = new List<Id>();
-        for(LastbuyProduct__c lbp : newList){
-            if(lbp.ProductName__c != null){
-                pList.add(lbp.ProductName__c);
+    private void ReservedPro(){
+        //1.鏂板缓鎴栬�呮洿鏂颁骇鍝佸悗锛岃嫢棰勭暀浜у搧鏈夋晥锛屸�滈鐣欎骇鍝佲�濇爣璇嗕负true
+        if(trigger.isInsert || trigger.isUpdate){
+            
+            //瀛樹骇鍝佺殑ID 
+            List<Id> pList = new List<Id>();
+            for(LastbuyProduct__c lbp : newList){
+                if(lbp.ProductName__c != null && lbp.effectiveFLG__c == true){
+                    pList.add(lbp.ProductName__c);
+                }
             }
-        }
 
-        List<Product2> proList = [select id, LastbuyProductFLG__c from Product2 where Id in :pList];
-        List<Product2> pflgList = new List<Product2>();
+            List<Product2> proList = [select id, LastbuyProductFLG__c from Product2 where Id in :pList];
+            List<Product2> pflgList = new List<Product2>();
 
-        for(Product2 pro : proList){
-            if(pro.LastbuyProductFLG__c == false){
-                pro.LastbuyProductFLG__c = true;
-                pflgList.add(pro);
+            for(Product2 pro : proList){
+                if(pro.LastbuyProductFLG__c == false){
+                    pro.LastbuyProductFLG__c = true;
+                    pflgList.add(pro);
+                }
             }
-        }
 
-        if(pflgList.size() > 0){
-            update pflgList;
+            if(pflgList.size() > 0){
+                update pflgList;
+            }
         }
         
-    }
+        //2.(1)"鏄惁鏈夋晥" 鍙樹负 false  妫�绱骇鍝佷富鏁版嵁涓嬬殑鎵�鏈夐鐣欎骇鍝侊紝鍏ㄦ棤鏁堝垯鎶婁骇鍝佷富鏁版嵁鐨�"棰勭暀浜у搧"鏍囪瘑 鍙樹负 false
+        //  (2)"浜у搧"    棰勭暀浜у搧 鏇存敼 浜у搧涓绘暟鎹箣鍓嶇殑浜у搧 -- 妫�绱骇鍝佷富鏁版嵁涓嬬殑鎵�鏈夐鐣欎骇鍝侊紙娌℃湁/鍏ㄦ棤鏁堬級
+        //                                                  "棰勭暀浜у搧"鏍囪瘑 鍙樹负 false
+        if(trigger.isUpdate){
+            //"鏄惁鏈夋晥" 鍙樹负 "鍚�" 鏃� 鎵�瀵瑰簲鐨勪骇鍝佷富鏁版嵁Id &&棰勭暀浜у搧 鏇存敼 浜у搧涓绘暟鎹箣鍓嶇殑浜у搧
+            List<Id> pfList = new List<Id>();  
 
-    //褰�"鏄惁鏈夋晥"鍙戠敓鍙樺寲涓斿彉鎴�"鍚�"鏃讹紝妫�绱㈠悓涓�浜у搧鐨勬墍鏈夐鐣欎骇鍝侊紝
-    //濡傛灉杩欎釜浜у搧鎵�鏈夌殑棰勭暀浜у搧閮芥棤鏁堜簡锛屾妸浜у搧涓绘暟鎹笂鐨勯鐣欎骇鍝佹爣绛捐缃垚false銆�
-    //褰�"鏄惁鏈夋晥"鍙戠敓鍙樺寲涓斿彉鎴�"鏄�"鏃讹紝浜у搧涓绘暟鎹笂鐨勯鐣欎骇鍝佹爣绛捐缃垚true銆�
-    private void Invalid(){
-        List<Id> pfList = new List<Id>();  //"鏄惁鏈夋晥" 鍙樹负 "鍚�" 鏃� 鎵�瀵瑰簲鐨勪骇鍝佷富鏁版嵁Id
-        List<Id> ptList = new List<Id>();  //"鏄惁鏈夋晥" 鍙樹负 "鏄�" 鏃� 鎵�瀵瑰簲鐨勪骇鍝佷富鏁版嵁Id
-
-        for(LastbuyProduct__c lbp1 : newList){
-            LastbuyProduct__c oldLbp1 = oldMap.get(lbp1.Id);
-            if(oldLbp1.effectiveFLG__c != lbp1.effectiveFLG__c){
-                if(lbp1.effectiveFLG__c == false){
-                    pfList.add(lbp1.ProductName__c);
-                }else{  //lbp1.effectiveFLG__c == true
-                    ptList.add(lbp1.ProductName__c);
-                }
-
-            }
-        }
-        //"棰勭暀浜у搧"鏍囪瘑 鍙�"false"
-        if(pfList.size() > 0){
-            //Map<浜у搧Id锛岄鐣欎骇鍝�>
-            Map<String,LastbuyProduct__c> lbpMap = new Map<String,LastbuyProduct__c>();
-            //鍙戠敓鍙樺寲鐨勪骇鍝両d涓嬬殑鎵�鏈夐鐣欎骇鍝�
-            List<LastbuyProduct__c> lbpList = [select id, effectiveFLG__c,ProductName__c from LastbuyProduct__c where ProductName__c in :pfList];
-            System.debug('lt123鍙樺寲鐨勯鐣欎骇鍝乴bpList'+lbpList);
-            //p1List effectiveFLG__c涓簍rue 鐨勪骇鍝両d
-            List<Id> p1List = new List<Id>();
-            //p2List 杩欎釜浜у搧鎵�鏈夌殑棰勭暀浜у搧閮芥棤鏁� 鐨勪骇鍝両d
-            List<Id> p2List = new List<Id>();
-
-            for(LastbuyProduct__c lbm : lbpList){
-                lbpMap.put(lbm.ProductName__c,lbm);
-                if(lbm.effectiveFLG__c == true){
-                    p1List.add(lbm.ProductName__c);
-                }
-            }
-
-            if(p1List.size() > 0){
-                for(Id p1 : p1List){
-                    if(!lbpMap.containsKey(p1)){
-                        p2List.add(p1);
+            for(LastbuyProduct__c lbp1 : newList){
+                LastbuyProduct__c oldLbp1 = oldMap.get(lbp1.Id);
+                if(oldLbp1.effectiveFLG__c != lbp1.effectiveFLG__c){
+                    System.debug('lt123鏃犳晥锛�'+lbp1.effectiveFLG__c);
+                    if(lbp1.effectiveFLG__c == false){
+                        System.debug('lt123鏃犳晥'+lbp1.effectiveFLG__c);
+                        pfList.add(lbp1.ProductName__c);
                     }
                 }
-            }else{
-                for(LastbuyProduct__c lbm : lbpList){
-                    p2List.add(lbm.ProductName__c);
+                //浜у搧鍙戠敓鍙樺寲鏃讹紝妫�绱袱涓骇鍝佺殑鏍囪瘑
+                if(oldLbp1.ProductName__c != lbp1.ProductName__c){
+                    pfList.add(oldLbp1.ProductName__c);
                 }
             }
             
-            List<Product2> pro1List = [select Id, LastbuyProductFLG__c from Product2 where Id in :p2List];
-            List<Product2> prflgList = new List<Product2>();
-            for(Product2 pro1 : pro1List){
-                pro1.LastbuyProductFLG__c = false;
-                System.debug('lt123棰勭暀浜у搧鏍囪瘑'+pro1.LastbuyProductFLG__c);
-                prflgList.add(pro1);
-            }
-            if(prflgList.size() > 0){
-                update prflgList;
-            }
-        }
-        
-        //"棰勭暀浜у搧"鏍囪瘑 鍙�"true"
-        if(ptList.size() > 0){
-            List<Product2> protList = [select Id, LastbuyProductFLG__c from Product2 where Id in :ptList];
-            List<Product2> ptflgList = new List<Product2>();
-            for(Product2 prot : protList){
-                prot.LastbuyProductFLG__c = true;
-                ptflgList.add(prot);
-            }
-            if(ptflgList.size() > 0){
-                update ptflgList;
-            }
-        }
+            System.debug('lt123闇�妫�绱㈡墍鏈夐鐣欎骇鍝佺殑浜у搧ID-pfList'+pfList);
 
+            //妫�绱骇鍝佷笅鐨勬墍鏈夐鐣欎骇鍝侊紝鍏ㄦ棤鏁堝皢浜у搧涓绘暟鎹笅鐨勬爣璇嗙疆涓篺alse
+            if(pfList.size() > 0){
+                //Map<浜у搧Id锛岄鐣欎骇鍝�>
+                Map<String,LastbuyProduct__c> lbpMap = new Map<String,LastbuyProduct__c>();
+                //鍙戠敓鍙樺寲鐨勪骇鍝両d涓嬬殑鎵�鏈夐鐣欎骇鍝�
+                List<LastbuyProduct__c> lbpList = [select id, effectiveFLG__c,ProductName__c from LastbuyProduct__c where ProductName__c in :pfList];
+                System.debug('lt123鍙樺寲鐨勯鐣欎骇鍝乴bpList'+lbpList);
+                //p1List effectiveFLG__c涓簍rue 鐨勪骇鍝両d
+                List<Id> p1List = new List<Id>();
+                //p2List 杩欎釜浜у搧鎵�鏈夌殑棰勭暀浜у搧閮芥棤鏁� 鐨勪骇鍝両d
+                List<Id> p2List = new List<Id>();
+
+                if(lbpList.size() > 0){   //浜у搧鏈夐鐣欎骇鍝� 妫�鏌ラ鐣欎骇鍝佺殑"鏄惁鏈夋晥"
+                    for(LastbuyProduct__c lbm : lbpList){
+                        lbpMap.put(lbm.ProductName__c,lbm);
+                        if(lbm.effectiveFLG__c == true){
+                            p1List.add(lbm.ProductName__c);
+                        }
+                    }
+        
+                    if(p1List.size() > 0){
+                        for(Id p1 : p1List){
+                            if(!lbpMap.containsKey(p1)){
+                                p2List.add(p1);
+                            }
+                        }
+                    }else{
+                        for(LastbuyProduct__c lbm : lbpList){
+                            p2List.add(lbm.ProductName__c);
+                        }
+                    }
+                    
+                }
+                else{   //浜у搧 娌℃湁棰勭暀浜у搧  鏍囪瘑false
+                    p2List = pfList;
+                }
+                
+                List<Product2> pro1List = [select Id, LastbuyProductFLG__c from Product2 where Id in :p2List];
+                List<Product2> prflgList = new List<Product2>();
+                for(Product2 pro1 : pro1List){
+                    pro1.LastbuyProductFLG__c = false;
+                    System.debug('lt123棰勭暀浜у搧鏍囪瘑'+pro1.LastbuyProductFLG__c);
+                    prflgList.add(pro1);
+                }
+                if(prflgList.size() > 0){
+                    update prflgList;
+                }
+            }
+        }
     }
 
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/LastbuyProductHandlerTest.cls b/force-app/main/default/classes/LastbuyProductHandlerTest.cls
index 847fa1a..cd8bd02 100644
--- a/force-app/main/default/classes/LastbuyProductHandlerTest.cls
+++ b/force-app/main/default/classes/LastbuyProductHandlerTest.cls
@@ -39,6 +39,9 @@
         lbp1.effectiveFLG__c = false;
         update lbp1;
 
+        lbp2.ProductName__c = pro.Id;
+        update lbp2;
+
     }
 
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/LightningUtil.cls b/force-app/main/default/classes/LightningUtil.cls
index c3ad2bf..8ee2953 100644
--- a/force-app/main/default/classes/LightningUtil.cls
+++ b/force-app/main/default/classes/LightningUtil.cls
@@ -43,6 +43,13 @@
         return [select id, Name, Agency_User__c from contact where Isactive__c = '鏈夋晥' and AccountId in 
         (select AccountId from User where id=:login_user_id)];
     }
+
+    public static List<contact> selectAgencyPerson03() {
+        String login_user_id = UserInfo.getUserId();
+        system.debug('login_user_id=============>'+login_user_id);
+        return [select id, Name,Agency_User__c from contact where   Isactive__c = '鏈夋晥'  and id in 
+        (select ContactId from User where id =: login_user_id)];
+    }
     
     public static void updateAccMaxActivityDate(String accId, Date week) {
         Agency_Hospital_Link__c account = [select Id,MaxActivityDate__c from Agency_Hospital_Link__c where id=:accId];
@@ -104,60 +111,80 @@
     public static void upsertAgencyOpportunity(List<Agency_Opportunity__c> upsertList) {
         upsert upsertList Agency_Opportunity__c.TargetInputKey__c;
     }
-    
+    //缁忛攢鍟嗙郴缁�
     public static List<Agency_Report__c> selectAgencyReport(Date week, String person_str) {
         if (String.isBlank(person_str)) {
             List<Contact> person_list = selectAgencyPerson();
-            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,OtherBrandConsumables__r.Name,OtherBrandConsumables__c,ProductCcategory__c, ProductCcategory__r.Name,productCategories__c, productCategories__r.Name,DealerPersonnel__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__r.WarlockClassification__c,WarlockClassification__c,ProductCcategory__c, ProductCcategory__r.ProductCcategory__c,productCategories__c, productCategories__r.productCategories__c,DealerPersonnel__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.Name,EffectProgress__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.EffectProgress__c,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name    
                             From Agency_Report__c
-                            where Submit_date__c=:week and Person_In_Charge2__c in :person_list order by LastModifiedDate desc];
+                            where Submit_date__c=:week and Person_In_Charge2__c in :person_list and WeeklyReportClassification__c = ''  order by LastModifiedDate desc];
         } else {
-            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,OtherBrandConsumables__r.Name,OtherBrandConsumables__c,ProductCcategory__c,ProductCcategory__r.Name, productCategories__c, productCategories__r.Name,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__r.WarlockClassification__c,WarlockClassification__c,ProductCcategory__c,ProductCcategory__r.ProductCcategory__c, productCategories__c, productCategories__r.productCategories__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.Name,EffectProgress__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.EffectProgress__c,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name   
                             From Agency_Report__c
-                            where Submit_date__c=:week and Person_In_Charge2__c=:person_str order by LastModifiedDate desc];
+                            where Submit_date__c=:week and Person_In_Charge2__c=:person_str and WeeklyReportClassification__c = ''  order by LastModifiedDate desc];
         }
     }
+    //杩芥函绯荤粺
     public static List<Agency_Report__c> selectAgencyReport01(Date week, String person_str) {
+        system.debug('person_strperson_str=================>'+person_str);
         if (String.isBlank(person_str)) {
             List<Contact> person_list = selectAgencyPerson01();
-            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,OtherBrandConsumables__r.Name,OtherBrandConsumables__c,ProductCcategory__c,ProductCcategory__r.Name,productCategories__c, productCategories__r.Name, DealerPersonnel__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__r.WarlockClassification__c,WarlockClassification__c,ProductCcategory__c,ProductCcategory__r.ProductCcategory__c,productCategories__c, productCategories__r.productCategories__c, DealerPersonnel__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.Name,EffectProgress__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.EffectProgress__c,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name    
                             From Agency_Report__c
-                            where Submit_date__c=:week and Person_In_Charge2__c in :person_list order by LastModifiedDate desc];
+                            where Submit_date__c=:week and Person_In_Charge2__c in :person_list and WeeklyReportClassification__c != '' order by LastModifiedDate desc];
         } else {
-            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,OtherBrandConsumables__r.Name,OtherBrandConsumables__c,ProductCcategory__c,ProductCcategory__r.Name,productCategories__c, productCategories__r.Name, WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+            return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__r.WarlockClassification__c,WarlockClassification__c,ProductCcategory__c,ProductCcategory__r.ProductCcategory__c,productCategories__c, productCategories__r.productCategories__c, WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.Name,EffectProgress__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.EffectProgress__c,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name   
                             From Agency_Report__c
-                            where Submit_date__c=:week and Person_In_Charge2__c=:person_str order by LastModifiedDate desc];
+                            where Submit_date__c=:week and Person_In_Charge2__c=:person_str and WeeklyReportClassification__c != '' order by LastModifiedDate desc];
         }
     }
-    
+    //缁忛攢鍟嗙郴缁�
     public static List<Agency_Report__c> selectMAgencyReport(Date date1, Date date2 ,List<Contact> conMList) {
-        List<Agency_Report__c> reportlist = [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,Department_Cateogy__c, DealerPersonnel__c,WorkRecord__c, ProductClassification__c,OtherBrandConsumables__r.Name,OtherBrandConsumables__c,ProductCcategory__c,ProductCcategory__r.Name,productCategories__c, productCategories__r.Name,Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+        List<Agency_Report__c> reportlist = [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,Department_Cateogy__c, DealerPersonnel__c,WorkRecord__c, ProductClassification__c,WarlockClassification__r.WarlockClassification__c,WarlockClassification__c,ProductCcategory__c,ProductCcategory__r.ProductCcategory__c,productCategories__c, productCategories__r.productCategories__c,Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name,Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.Name,EffectProgress__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.EffectProgress__c,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name  
                             From Agency_Report__c
-                            where Person_In_Charge2__c in :conMList and Report_Date__c >= :date1 and Report_Date__c <= :date2 ];
+                            where Person_In_Charge2__c in :conMList and Report_Date__c >= :date1 and Report_Date__c <= :date2 and WeeklyReportClassification__c = '' ];
         return reportlist;
     }
-
+    //杩芥函绯荤粺
+    public static List<Agency_Report__c> selectMAgencyReport01(Date date1, Date date2 ,List<Contact> conMList) {
+        List<Agency_Report__c> reportlist = [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,Department_Cateogy__c, DealerPersonnel__c,WorkRecord__c, ProductClassification__c,WarlockClassification__r.WarlockClassification__c,WarlockClassification__c,ProductCcategory__c,ProductCcategory__r.ProductCcategory__c,productCategories__c, productCategories__r.productCategories__c,Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+                            Person_In_Charge2__c,DealerPersonnel__r.Name,Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__r.EffectProgress__c,EffectProgress__c,
+                            UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name  
+                            From Agency_Report__c
+                            where Person_In_Charge2__c in :conMList and Report_Date__c >= :date1 and Report_Date__c <= :date2 and WeeklyReportClassification__c != '' ];
+        return reportlist;
+    }
+    //缁忛攢鍟嗙郴缁熺殑
     public static List<Agency_Report__c> selectAgencyReportById(String report_id) {
         return [Select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,WorkRecord__c,EffectProgress__c,ProductClassification__c,ProductCcategory__c,productCategories__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
                             Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c 
                             From Agency_Report__c
-                            where id=:report_id];
+                            where id=:report_id ];
+    }
+    //杩芥函绯荤粺鐨�
+    public static List<Agency_Report__c> selectAgencyReportById01(String report_id) {
+        return [Select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c,warlocksNumber__c,WorkMark__c,WorkRecord__c,EffectProgress__c,ProductClassification__c,ProductCcategory__c,productCategories__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
+                            Person_In_Charge2__c,DealerPersonnel__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
+                            Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c 
+                            From Agency_Report__c
+                            where id=:report_id ];
     }
     
     public static List<Agency_Opportunity__c> selectOpportunityByIdAndHospitalLinkId(String opportunity_id, String agency_hospital_link_id) {
diff --git a/force-app/main/default/classes/LightningUtilTest.cls b/force-app/main/default/classes/LightningUtilTest.cls
index b34fb41..3ed212a 100644
--- a/force-app/main/default/classes/LightningUtilTest.cls
+++ b/force-app/main/default/classes/LightningUtilTest.cls
@@ -30,10 +30,27 @@
     public static OlympusCalendar__c olympus_calendar = new OlympusCalendar__c();
     public static String report_id;
     public static String report_header_id;
+        
     /**
      * @description AgencyOpportunityHandler銉嗐偣銉�
      */
     static testMethod void unitTestAgencyOpportunityHandler() {
+        Oly_TriggerHandler.bypass('AgencyReportHeaderHandler');
+        Oly_TriggerHandler.bypass('AgencyHospitalHandler');
+        StaticParameter.EscapeAccountTrigger = true;
+        StaticParameter.EscapeNFM007Trigger = true;
+        StaticParameter.EscapeOpportunityBefUpdTrigger = true;
+        StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true;
+        StaticParameter.EscapeSyncOpportunityTrigger = true;
+        StaticParameter.EventOpportunityPileUpExeFlg = true;
+        StaticParameter.EscapeNFM001AgencyContractTrigger = true;
+        StaticParameter.EscapeNFM001AgencyContractTrigger2 = true;
+        StaticParameter.EscapeLeadTrigger = true;
+        StaticParameter.EscapeOpportunityownerUpdate = true;
+        ControllerUtil.EscapeNFM001Trigger = true;
+        ControllerUtil.EscapeMaintenanceContractAfterUpdateTrigger = true;
+        StaticParameter.EscapeNFM001Trigger = true;
+        StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true;
         // 鍙栧紩鍏�
         account1.Name = 'test1鍖婚櫌';
         account1.RecordTypeId = '01210000000QemG';
@@ -47,7 +64,7 @@
         List < Account > acc2list = [select RecordTypeId, Name
             from Account
         ];
-        System.assertEquals(10, acc2list.size());
+        System.assertEquals(2, acc2list.size());
         // 鍙栧紩鍏堣铂浠昏��
         contact1.AccountId = account1.Id;
         contact1.FirstName = '璨换鑰�';
diff --git a/force-app/main/default/classes/MaintenanceCommissionPDFController.cls b/force-app/main/default/classes/MaintenanceCommissionPDFController.cls
index e1d6ca3..a03638c 100644
--- a/force-app/main/default/classes/MaintenanceCommissionPDFController.cls
+++ b/force-app/main/default/classes/MaintenanceCommissionPDFController.cls
@@ -1,9 +1,6 @@
 public with sharing class MaintenanceCommissionPDFController {
     public Repair__c ra { get; private set; }
     public List<Repair__c> repList { get; private set; }
-    public Integer repSize {  
-        get { return repList == null ? 0 : repList.size(); } 
-    }
 
     public MaintenanceCommissionPDFController() {
         ra = new Repair__c();
diff --git a/force-app/main/default/classes/MeetingDelayApplyTriggerHandler.cls b/force-app/main/default/classes/MeetingDelayApplyTriggerHandler.cls
index 5445942..8ce26ab 100644
--- a/force-app/main/default/classes/MeetingDelayApplyTriggerHandler.cls
+++ b/force-app/main/default/classes/MeetingDelayApplyTriggerHandler.cls
@@ -48,6 +48,12 @@
                 // cam.Status = mda.campaign_status__c;
                 //OBPM LY 20211221 start
                 cam.IF_Approved__c = mda.IF_Approved__c;//鏄惁鐢宠鍐宠
+                cam.Meeting_Approved_No__c = mda.MeetingApproved__c;//浼氳鍐宠鐢宠
+                if (String.isBlank(mda.MeetingApproved__c)) {
+                    cam.MeetingApprovedNo__c = null;
+                } else {
+                    cam.MeetingApprovedNo__c = mda.MeetingApproved__r.MeetingApprovedNo__c;
+                }
                 cam.Test_Status__c = mda.campaign_status__c;
                 //OBPM LY 20211221 end
                 clist.add(cam);
@@ -93,7 +99,8 @@
                 List<Campaign> statusList = [SELECT Id,
                                                 Status,StartDate,EndDate,PlanBackData__c,
                                                 Meeting_Cooperate__c,Meeting_Type__c,HostName__c,
-                                                cooperatorCompany__c,Meeting_Cooperate2__c,Meeting_Cooperate3__c,Meeting_Cooperate4__c
+                                                cooperatorCompany__c,Meeting_Cooperate2__c,Meeting_Cooperate3__c,Meeting_Cooperate4__c,
+                                                IF_Approved__c,Meeting_Approved_No__c 
                                                  FROM Campaign WHERE id in :camIds];
                 for (Campaign c :statusList ) {
                     camMap.put(c.Id, c);
@@ -120,6 +127,8 @@
                     mda.Meeting_Cooperate2_Old__c = camMap.get(mda.campaign__c).Meeting_Cooperate2__c;
                     mda.Meeting_Cooperate3_Old__c = camMap.get(mda.campaign__c).Meeting_Cooperate3__c;
                     mda.Meeting_Cooperate4_Old__c = camMap.get(mda.campaign__c).Meeting_Cooperate4__c;
+                    mda.IF_Approved_Old__c = camMap.get(mda.campaign__c).IF_Approved__c;
+                    mda.MeetingApproved_Old__c = camMap.get(mda.campaign__c).Meeting_Approved_No__c;
 
                     if (String.isNotBlank(mda.CreatedById)) {
                         mda.manager__c = userMap.get(mda.CreatedById).SalesManager__c == null ? mda.CreatedById : userMap.get(mda.CreatedById).SalesManager__c;
diff --git a/force-app/main/default/classes/NFM105Rest.cls b/force-app/main/default/classes/NFM105Rest.cls
index 3bc1e02..78cd7cd 100644
--- a/force-app/main/default/classes/NFM105Rest.cls
+++ b/force-app/main/default/classes/NFM105Rest.cls
@@ -25,6 +25,9 @@
         public String IncorrectDataComment;
         public String ReturnType;
         public String InspectType;
+        //WLIG-CC78MX 銆愬鎵樸�慛FM105鎺ュ彛澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220307 start
+        public String OTSRepairOrder;
+        //WLIG-CC78MX 銆愬鎵樸�慛FM105鎺ュ彛澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220307 end
         public InspectionResultInformation[] InspectionResultInformation;
         public FailureInformation[] FailureInformation;
     }
@@ -265,6 +268,7 @@
                     //                        continue;
                     //                    }
                     logstr += ' ';
+                    System.debug('rpr1:' + rpr);
                     rprUpdateMap.put(rpr.SAPRepairNo__c, rpr);
                 } else {
                     logstr += quoteInfo.SAPRepairNo + ':' + quoteInfo.RepairOrderStatusCode + '(' + quoteInfo.SAPQuotationNo + ') ';
@@ -470,6 +474,11 @@
                     // L60-SORC淇悊鍝佸嚭搴�
                     // L65-OGZ淇悊鍝佸嚭搴�
                     // L80-RC淇悊鍝佸嚭搴�
+                    //WLIG-CC78MX 銆愬鎵樸�慛FM105鎺ュ彛澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220307 start
+                    if(String.isNotBlank(quoteInfo.OTSRepairOrder)){
+                        rpr.OTSRepairOrder__c = quoteInfo.OTSRepairOrder;
+                    }
+                    //WLIG-CC78MX 銆愬鎵樸�慛FM105鎺ュ彛澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220307 end
                     Asset ast = getAstUpdate(astUpdateMap, rpr);
                     if (rpr.Return_Without_Repair_IF__c == true) {
                         rpr.Return_Without_Repair_Date__c = statusUpdateDateTime.date();
@@ -545,6 +554,7 @@
             for (Repair_Quotation__c rqfalse : rqList) {
                 rqfalse.Quotation_agreement__c = false;
             }
+            System.debug('rqUpdateMap1:' + rqUpdateMap);
             rqList.addAll(rqUpdateMap.values());
             if (rqList.size() > 0) {
                 // TODO update false;
diff --git a/force-app/main/default/classes/NFM114RestTest.cls b/force-app/main/default/classes/NFM114RestTest.cls
index 0ba1709..cbad58a 100644
--- a/force-app/main/default/classes/NFM114RestTest.cls
+++ b/force-app/main/default/classes/NFM114RestTest.cls
@@ -4,8 +4,12 @@
     static Product2 product;
 
     static void initData() {
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         ID AgencyID = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Office').getRecordTypeId();
-        Agency = new Account(RecordTypeId = AgencyID, Name = 'NFM114TestAgency', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId());
+        Agency = new Account(ParentId = account2.Id, RecordTypeId = AgencyID, Name = 'NFM114TestAgency', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId());
         insert Agency;
         Agency = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :Agency.Id];
 
diff --git a/force-app/main/default/classes/NFM115ControllerTest.cls b/force-app/main/default/classes/NFM115ControllerTest.cls
index 14b3402..898a314 100644
--- a/force-app/main/default/classes/NFM115ControllerTest.cls
+++ b/force-app/main/default/classes/NFM115ControllerTest.cls
@@ -22,8 +22,12 @@
     }
 
     static testMethod void testMethod1(){
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         ID AgencyID = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Office').getRecordTypeId();
-        Agency = new Account(RecordTypeId = AgencyID, Name = 'NFM115TestAgency', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId());
+        Agency = new Account(ParentId = account2.Id, RecordTypeId = AgencyID, Name = 'NFM115TestAgency', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId());
         insert Agency;
         Agency = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :Agency.Id];
 
@@ -47,8 +51,12 @@
     }
 
     static testMethod void testMethod2(){
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         ID AgencyID = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Office').getRecordTypeId();
-        Agency = new Account(RecordTypeId = AgencyID, Name = 'NFM115TestAgency', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId());
+        Agency = new Account(ParentId = account2.Id, RecordTypeId = AgencyID, Name = 'NFM115TestAgency', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId());
         insert Agency;
         Agency = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :Agency.Id];
 
diff --git a/force-app/main/default/classes/NFM202Controller.cls b/force-app/main/default/classes/NFM202Controller.cls
index 1c7ce0c..0bf1180 100644
--- a/force-app/main/default/classes/NFM202Controller.cls
+++ b/force-app/main/default/classes/NFM202Controller.cls
@@ -257,7 +257,7 @@
                                                          PricebookEntry.Product2.GuranteeType__c
 
                                                          //lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  start
-                                                         ,PricebookEntry.Product2.DeliveryDate__c
+                                                         ,DeliveryDate__c
                                                          //lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  end
 
                                                     from OpportunityLineItem 
@@ -589,7 +589,7 @@
                         detail.Quantity = oppLine.Quantity;
 
                         //lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲   浜よ揣鏈� start 
-                        detail.DeliveryDate = oppLine.PricebookEntry.Product2.DeliveryDate__c;
+                        detail.DeliveryDate = oppLine.DeliveryDate__c;
                         //lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  end
 
                         // LHJ SWAG-C9F9P8  20211206 澧炲姞瑙勬牸 Start
diff --git a/force-app/main/default/classes/NFM203Rest.cls b/force-app/main/default/classes/NFM203Rest.cls
index 21b14e3..9952989 100644
--- a/force-app/main/default/classes/NFM203Rest.cls
+++ b/force-app/main/default/classes/NFM203Rest.cls
@@ -1162,6 +1162,9 @@
                         contact.LastName = contactAllName.split('_')[0];
                         contact.FirstName = contactAllName.split('_')[1];
                         contact.IsFromSPO__c = true;
+                        // SFDC鐢佃瘽閲嶅浜哄憳鍒涘缓淇℃伅纭  pk 2022-2-28 start
+                        contact.RecordTypeId = '01210000000QfWi';
+                        // SFDC鐢佃瘽閲嶅浜哄憳鍒涘缓淇℃伅纭  pk 2022-2-28 end
                         contact.Ignore_Same_Name__c = true;//涓嶆槸閲嶅鐨勫鎴峰悕 璺宠繃 瀹㈡埛浜哄憳鍚嶅瓧宸插瓨鍦� 楠岃瘉
                         insertContactList.add(contact);
                         
diff --git a/force-app/main/default/classes/NFM401Controller.cls b/force-app/main/default/classes/NFM401Controller.cls
index b4fba51..1877fdc 100644
--- a/force-app/main/default/classes/NFM401Controller.cls
+++ b/force-app/main/default/classes/NFM401Controller.cls
@@ -448,7 +448,15 @@
                 RepairRequest.PRODUCT_RECEIPT_DATE = NFMUtil.formatDate2Str(rr.Repair_Ordered_Date__c);
                 RepairRequest.EVALUATION_RESULT = null;
                 RepairRequest.INITIATION_DATE = NFMUtil.formatDate2Str(rr.FSE_ApplyForRepair_Day__c) ;
-                RepairRequest.INSTALLATION_DATE = NFMUtil.formatDate2Str(rr.PurchaseOrInstallationDate__c) ;
+                
+                // 绮剧悽绉戞妧  2022-03-03 LJPH-CC5ANQ 銆愬鎵樸�戜箣鍓嶄細浼犱竴涓�1900-1-1鐨勬棩鏈燂紝瀵艰嚧鎶ラ敊锛岀幇鍦ㄦ敼涓轰紶null zxk  start
+                if(rr.PurchaseOrInstallationDate__c != null){
+                    RepairRequest.INSTALLATION_DATE = NFMUtil.formatDate2Str(rr.PurchaseOrInstallationDate__c) ;
+                }else{
+                    RepairRequest.INSTALLATION_DATE =  null;
+                }
+                // 绮剧悽绉戞妧  2022-03-03 LJPH-CC5ANQ 銆愬鎵樸�戜箣鍓嶄細浼犱竴涓�1900-1-1鐨勬棩鏈燂紝瀵艰嚧鎶ラ敊锛岀幇鍦ㄦ敼涓轰紶null zxk  end
+                
                 RepairRequest.EVENTDATE_UNKNOWN = null ;
                 RepairRequest.SEND_REPORT_COMPETENT_AUTH = NFMUtil.getMapValue(transferMap,'ReportAdverseEvents__c', rr.ReportAdverseEvents__c, iflog) ;
                 RepairRequest.PROC_THERAPEUTIC_DIAGNOSTIC = NFMUtil.getMapValue(transferMap,'WhatProject__c', rr.WhatProject__c, iflog) ;
@@ -594,7 +602,13 @@
                 RepairRequest.ACTIONS_TAKEN_AT_CUST_SITE = NFMUtil.getMapValue(transferMap,'qis_next_action__c', qr.next_action__c, iflog) ;
 
                 RepairRequest.INITIATION_DATE = NFMUtil.formatDate2Str(qr.QIS_Submit_day__c) ;
-                RepairRequest.INSTALLATION_DATE = NFMUtil.formatDate2Str(qr.QISInstallDate__c) ;
+                // 绮剧悽绉戞妧  2022-03-03 LJPH-CC5ANQ 銆愬鎵樸�戜箣鍓嶄細浼犱竴涓�1900-1-1鐨勬棩鏈燂紝瀵艰嚧鎶ラ敊锛岀幇鍦ㄦ敼涓轰紶null zxk  start
+                if(qr.QISInstallDate__c != null){
+                    RepairRequest.INSTALLATION_DATE = NFMUtil.formatDate2Str(qr.QISInstallDate__c) ;
+                }else{
+                    RepairRequest.INSTALLATION_DATE =  null;
+                }
+                // 绮剧悽绉戞妧  2022-03-03 LJPH-CC5ANQ 銆愬鎵樸�戜箣鍓嶄細浼犱竴涓�1900-1-1鐨勬棩鏈燂紝瀵艰嚧鎶ラ敊锛岀幇鍦ㄦ敼涓轰紶null zxk  end
 
                 RepairRequest.EVENTDATE_UNKNOWN = null ;
 
diff --git a/force-app/main/default/classes/NFM603Controller.cls b/force-app/main/default/classes/NFM603Controller.cls
index b62e5c9..4bbc673 100644
--- a/force-app/main/default/classes/NFM603Controller.cls
+++ b/force-app/main/default/classes/NFM603Controller.cls
@@ -41,6 +41,10 @@
         public String QuotationGread; //鎶ヤ环绛夌骇(new)
         public String detectionResult; //妫�娴嬬粨鏋�
         public String cus_dn; //DN鍙�
+        //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 start
+        public String OTSRepairOrder;
+        //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 end
+
         //閫佷慨鐗╂祦
         public String deliveryLogisticsMode; //閫佷慨鐗╂祦鏂瑰紡
         public String engineerSendDate; //宸ョ▼甯堜慨鐞嗗搧瀵勯�佹棩
@@ -216,6 +220,7 @@
                 RcSorcDate__c,
                 SorcAcceptDate__c,
                 SorcOgzDate__c,
+                RcOgzDate__c,
                 Returns_Product_waySAP__c,
                 DnNO__c,
                 OgzAcceptDate__c,
@@ -233,7 +238,10 @@
                 Repair_Final_Inspection_DateTime__c,
                 Repair_Shipped_DateTime__c,
                 Repair_Discount_approval_DateTime_form__c,
-                Agreed_DateTime__c
+                Agreed_DateTime__c,
+                //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 start
+                OTSRepairOrder__c
+                //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 end
                 from Repair__c where id in: repairOrderIdList
             ];
         }
@@ -366,10 +374,17 @@
                 info.OgzAcceptDate = NFMUtil.formatDateTime2Str(repair.OgzAcceptDateTime__c);//OGZ鍙楃悊鏃ワ紙灏忕▼搴忥級
                 //update        wangweipeng         2022/02/16           end
 
-                info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.SorcOgzDate__c);
+                // info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.SorcOgzDate__c);RcOgzDate__c
+
+                //update   zhangyuheng    2022/03/07
+                info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.RcOgzDate__c);
 
                 info.cus_dn = repair.DnNO__c;
+                //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 start
+                info.OTSRepairOrder = repair.OTSRepairOrder__c;
+                //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 end
                 repairs.add(info);
+                System.debug('repairs1:' + repairs);
             }
             logstr += '\nend';
             if (repairs.size() > 0) {
diff --git a/force-app/main/default/classes/NFM606Controller.cls b/force-app/main/default/classes/NFM606Controller.cls
index 9d62d6e..25f5159 100644
--- a/force-app/main/default/classes/NFM606Controller.cls
+++ b/force-app/main/default/classes/NFM606Controller.cls
@@ -116,7 +116,7 @@
                 ged.Mobile = String.isNotBlank(con.UniqueNumber__c) ? con.UniqueNumber__c:con.MobilePhone;//鎵嬫満
                 ged.PersonManagementCode = con.CManageCode__c; //浜哄憳绠$悊缂栫爜
                 ged.Status = '鏈夋晥'.equals(con.Isactive__c) ? true:false ;//鐘舵��
-                ged.Name = '';//濮撳悕
+                ged.Name = con.Name;//濮撳悕
                 ged.Email = '';
                 ged.Hospital =''; //鍖婚櫌缂栫爜
                 ged.Department = ''; //绉戝缂栫爜
@@ -136,7 +136,7 @@
                 }
                 // 缁忛攢鍟�
                 if ('01210000000QfWiAAK'.equals(con.RecordTypeId)) {
-                    ged.Name = con.Name;//濮撳悕
+                    //ged.Name = con.Name;//濮撳悕
                     ged.Account = con.Account.Name;//缁忛攢鍟嗗悕
                     ged.AgentCode = con.Account.Management_Code__c;//缁忛攢鍟嗙紪鐮�
                     ged.AgentUserType = String.isBlank(con.ContactType__c) ? '': con.ContactType__c.replaceAll(';',',');//浜哄憳绫诲瀷
diff --git a/force-app/main/default/classes/NFM608Rest.cls b/force-app/main/default/classes/NFM608Rest.cls
index f0301be..35afcaa 100644
--- a/force-app/main/default/classes/NFM608Rest.cls
+++ b/force-app/main/default/classes/NFM608Rest.cls
@@ -224,7 +224,7 @@
         Map < String, String > VisitTypeMap = new Map < String, String > ();
         VisitTypeMap.put('鍏徃宸ヤ綔', '绀惧唴娲诲嫊');
         VisitTypeMap.put('鐢ㄦ埛鎷滆', '鐥呴櫌');
-        VisitTypeMap.put('缁忛攢鍟嗘嫓璁�', '璨╁2搴�');
+        VisitTypeMap.put('缁忛攢鍟嗘敮鎸�', '璨╁2搴�');
         VisitTypeMap.put('瀛︽湳浼氳', '绀惧銈ゃ儥銉炽儓');
         VisitTypeMap.put('绉诲姩', '绉诲嫊');
         VisitTypeMap.put('浼戝亣', '浼戞殗');
diff --git a/force-app/main/default/classes/NFM620Rest.cls b/force-app/main/default/classes/NFM620Rest.cls
index 57b098b..022d46c 100644
--- a/force-app/main/default/classes/NFM620Rest.cls
+++ b/force-app/main/default/classes/NFM620Rest.cls
@@ -25,7 +25,7 @@
         public String Product;                   // 浜у搧淇℃伅
         public String Request;                   // 濮旀墭浜嬮」
         public String RequestDetail;             // 濮旀墭浜嬮」璇︾粏
-        // public String ApproverID;                // 瀹℃牳浜哄憳鍛樺伐缂栫爜
+        public String ApproverID;                // 瀹℃牳浜哄憳鍛樺伐缂栫爜
     }
 
     @HttpPost
@@ -104,7 +104,7 @@
             List<String> inquiryNoList = new List<String>();
             List<String> conIDList = new List<String>();
             List<String> camNoList = new List<String>();
-            // List<String> approverIDList = new List<String>();
+            List<String> approverIDList = new List<String>();
             List<GeData> geDataListNew = new List<GeData>();
             for (GeData geData : geDataList) {
                 if (String.isBlank(geData.InquiryNo)) {
@@ -122,9 +122,9 @@
                 } else {
                     conIDList.add(geData.ContactId);
                 }
-                // if (String.isNotBlank(geData.ApproverID)) {
-                //     approverIDList.add(geData.ApproverID);
-                // }
+                if (String.isNotBlank(geData.ApproverID)) {
+                    approverIDList.add(geData.ApproverID);
+                }
                 if (String.isNotBlank(geData.Campaign)) {
                     camNoList.add(geData.Campaign);
                 }
@@ -168,11 +168,17 @@
                 }
             }
             //浣跨敤瀹℃牳浜哄憳鍛樺伐缂栫爜鏌ヨ鐢ㄦ埛ID
-            // Map<string,String> ownerMap = new Map<string,String>();
-            // List<User> ownerList = [select Id,Employee_No__c from User where Employee_No__c  IN:approverIDList];
-            // for(User temp : ownerList){
-            //     ownerMap.put(temp.Employee_No__c,temp.Id);
-            // }
+            Map<string,String> ownerMap = new Map<string,String>();
+            if(approverIDList.size()>0){
+                List<User> ownerList = [select Id,Employee_No__c from User where Employee_No__c  IN:approverIDList];
+                if (ownerList.size()>0){
+                    for(User temp : ownerList){
+                        ownerMap.put(temp.Employee_No__c,temp.Id);
+                    }
+                }
+            }
+            
+            
 
             // 灏哫ML鍚勬暟鎹」鏇存柊鍒板晢鍝佽闂崟瀵硅薄涓�
             for (GeData geData : geDataListNew) {
@@ -186,8 +192,10 @@
                 inquiry.Request_Detail__c = geData.RequestDetail;                 //濮旀墭浜嬮」璇︾粏
                 inquiry.Product1__c = geData.Product;                             //浜у搧淇℃伅
                 inquiry.ContactId__c = geData.ContactId;                          //缁熶竴鐢ㄦ埛ID
-                // inquiry.OwnerId = ownerMap.get(geData.ApproverID);                //鎵�鏈変汉
-
+                if (String.isNotBlank(ownerMap.get(geData.ApproverID))){
+                    inquiry.OwnerId = ownerMap.get(geData.ApproverID);            //鎵�鏈変汉
+                }
+                
                 //濮旀墭浜嬮」鍙栧�煎悗鎷嗗垎
                 List<String> requestList = geData.Request.split(';');
                 String request1 = '';
diff --git a/force-app/main/default/classes/NFM701ControllerHandler.cls b/force-app/main/default/classes/NFM701ControllerHandler.cls
index 9c8f0e8..b22304f 100644
--- a/force-app/main/default/classes/NFM701ControllerHandler.cls
+++ b/force-app/main/default/classes/NFM701ControllerHandler.cls
@@ -11,7 +11,9 @@
         this.oldList = (List<Account>) Trigger.old;
     }
     protected override void afterUpdate(){
-        updateAccount(this.newList , this.newMap , this.oldList , this.oldMap);
+        // if (!StaticParameter.EscapeNFM701Trigger) {
+            updateAccount(this.newList , this.newMap , this.oldList , this.oldMap);
+        // }
     }
     public static void updateAccount(List<Account> newList, Map<Id, Account> newMap, List<Account> oldList, Map<Id, Account> oldMap){
         List<String> accIdList = new List<String>();
@@ -24,7 +26,7 @@
         if (newList.size()>0) {
             // iflog.Log__c += '杩沬f';
             for (Account acc : newList) {
-                    if(!acc.RecordType_DeveloperName__c.equals('Agency') && !acc.RecordType_DeveloperName__c.equals('AgencyContract') && !acc.RecordType_DeveloperName__c.contains('Department_Class')){
+                    if(!acc.RecordType_DeveloperName__c.equals('Agency') && !acc.RecordType_DeveloperName__c.equals('AgencyContract') && !acc.RecordType_DeveloperName__c.contains('Department_')){
                         // iflog.Log__c += acc.RecordType.DeveloperName;
                         // iflog.Log__c += acc;
                         if(((acc.Is_Active__c != oldMap.get(acc.Id).Is_Active__c) && (acc.Is_Active__c.equals('鏈夊姽') || acc.Is_Active__c.equals('鐒″姽'))) || ((acc.Name != oldMap.get(acc.Id).Name) && (acc.Is_Active__c.equals('鏈夊姽')))){
diff --git a/force-app/main/default/classes/NFM701ControllerHandlerTest.cls b/force-app/main/default/classes/NFM701ControllerHandlerTest.cls
new file mode 100644
index 0000000..dc1b650
--- /dev/null
+++ b/force-app/main/default/classes/NFM701ControllerHandlerTest.cls
@@ -0,0 +1,136 @@
+@isTest
+private class NFM701ControllerHandlerTest {
+    
+    @testSetup
+    static void makeTestRepair() {
+        
+
+        List < RecordType > rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account'
+            and Name = '鐥呴櫌'
+        ];
+        if (rectCo.size() == 0) {
+            throw new ControllerUtil.myException('not found 鐥呴櫌 recodetype');
+        }
+        List < RecordType > rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account'
+            and Name = '鎴︾暐绉戝鍒嗛 娑堝寲绉�'
+        ];
+        if (rectSct.size() == 0) {
+            throw new ControllerUtil.myException('not found 鎴︾暐绉戝鍒嗛 鍛煎惛绉� recodetype');
+        }
+        List < RecordType > rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account'
+            and Name = '瑷虹檪绉� 娑堝寲绉�'
+        ];
+        if (rectDpt.size() == 0) {
+            throw new ControllerUtil.myException('not found 瑷虹檪绉� 娑堝寲绉� recodetype');
+        }
+        // 銉嗐偣銉堛儑銉笺偪
+        Account company = new Account();
+        company.RecordTypeId = rectCo[0].Id;
+        company.Is_Active__c = '鏈夊姽';
+        company.Name = 'NFM105TestCompany';
+        company.AwaitToSendAWS__c = true;
+        upsert company;
+
+        Account section = [Select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where ParentId =: company.Id and RecordTypeId =: rectSct[0].Id];
+
+        Account depart = new Account();
+        depart.RecordTypeId = rectDpt[0].Id;
+        depart.Name = '*';
+        depart.Department_Name__c = 'NFM105TestDepart';
+        depart.ParentId = section.Id;
+        depart.Department_Class__c = section.Id;
+        depart.Hospital__c = company.Id;
+        upsert depart;
+
+        company.Site = '娴嬭瘯鍙樻洿鍒悕1';
+
+        upsert company; 
+
+        List < RecordType > rectDpt2 = [select Id from RecordType where IsActive = true and SobjectType = 'Account'
+            and DeveloperName = 'Agency'
+        ];
+        if (rectDpt.size() == 0) {
+            throw new ControllerUtil.myException('not found 瑷虹檪绉� 娑堝寲绉� recodetype');
+        }
+        ControllerUtil.EscapeNFM001Trigger = true;
+        StaticParameter.EscapeNFM001AgencyContractTrigger2 = true;
+        Account company2 = new Account();
+        company2.RecordTypeId = rectDpt2[0].Id;
+        company2.Name = 'NFM105TestCompany';
+        upsert company2;
+
+        License_Information__c lic = new License_Information__c();
+        lic.name = 'Test20181204';
+        lic.LicenseType__c = '鍖荤枟鍣ㄦ缁忚惀璁稿彲璇�';
+        lic.BusinessLicense__c = '20180522';
+        lic.ValidFrom__c = date.newinstance(2018, 05, 22);
+        lic.ValidTo__c = date.newinstance(2018, 05, 22);
+        lic.Scope3__c = '6815;6822;6823;6825';
+        lic.IsInquire__c = false;
+        lic.LicenseAndAccount__c = company2.Id;
+        insert lic;
+        License_Information__c lic1 = new License_Information__c();
+        lic1.name = 'Test20190111';
+        lic1.LicenseType__c = '绗簩绫诲尰鐤楀櫒姊扮粡钀ュ妗堝嚟璇�';
+        lic1.BusinessLicense__c = '20190522';
+        lic1.ValidFrom__c = date.newinstance(2018, 05, 21);
+        lic1.ValidTo__c = date.newinstance(2018, 05, 21);
+        lic.IsInquire__c = false;
+        lic1.Scope__c = '6815;6822;6823;6825';
+        lic1.LicenseAndAccount__c = company2.Id;
+        insert lic1;
+
+        List < RecordType > rectDptAgencyContract = [select Id from RecordType where IsActive = true and SobjectType = 'Account'
+            and DeveloperName = 'AgencyContract'
+        ];
+        if (rectDptAgencyContract.size() == 0) {
+            return;
+        }
+    
+        Account AagencyContractAccount = new Account();
+        AagencyContractAccount.RecordTypeId = rectDptAgencyContract[0].Id;
+        AagencyContractAccount.Contract_Decide_Start_Date__c = System.today();
+        AagencyContractAccount.Contract_Decide_End_Date__c = System.today();
+        AagencyContractAccount.Contract_End_Date__c = Date.today();
+        AagencyContractAccount.Name = '*';
+        AagencyContractAccount.Department_Name__c = 'NFM701TestDepart';
+        AagencyContractAccount.ParentId = company2.Id;
+        AagencyContractAccount.Agent_Ref__c = company2.Id;
+        AagencyContractAccount.ET_SP_Dealer__c = true;
+        // AagencyContractAccount.RecordType.DeveloperName = 'HP';
+        upsert AagencyContractAccount;
+
+
+        // List < BatchIF_Transfer__c > transfers = new List < BatchIF_Transfer__c > ();
+        // BatchIF_Transfer__c transfer = new BatchIF_Transfer__c();
+        // transfer.Table__c = 'Account';
+        // transfer.Column__c = 'RecordTypeId';
+        // transfer.External_Value__c = rectDpt[0].Id;
+        // transfer.Internal_Value__c = '娑堝寲绉�';
+        // insert transfer;
+        // BatchIF_Log__c iflog = new BatchIF_Log__c();
+        // iflog.Log__c = '{"GeDatas":{"Monitoring":{"TransmissionDateTime":"20211231104929","Text":"","Tag":"MSGH","Sender":"SFDC","Receiver":"OBPM","NumberOfRecord":"1","MessageType":"NFM701","MessageGroupNumber":"20211231104929"},"GeData":[{"StateMaster":"灞辫タ鐪�","LinkedHospitalMCode":null,"IsMerge":false,"IsActive":true,"HospitalName":"澶忓幙绗簩浜烘皯鍖婚櫌","HospitalMCode":"360437","Grade":"浜岀骇涔�","DataType":"Hospital","CityMaster":"杩愬煄甯�","Address":"灞辫タ鐪佽繍鍩庡競澶忓幙杩愬煄鍦板尯澶忓幙鍖楄"}]}}';
+        // iflog.Type__c = '701test';
+        // insert iflog;
+    }
+    static testMethod void testMethod1() {
+        List < Account > userList = [select id from Account];
+        Test.startTest();
+        Integer i = 0;
+        List < Id > idList = new List < Id > ();
+        for (Account user: userList) {
+            idList.add(user.Id);
+            user.Is_Active__c = '鏈夋晥';
+            user.Name = user.Name + i;
+            i++;
+        }
+        BatchIF_Log__c iflog = new BatchIF_Log__c();
+        iflog.Log__c = 'test start \n';
+        insert iflog;
+        upsert userList;
+        // NFM701Controller.callout(iflog.Id, idList);
+
+
+        Test.stopTest();
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/NFM701ControllerHandlerTest.cls-meta.xml b/force-app/main/default/classes/NFM701ControllerHandlerTest.cls-meta.xml
new file mode 100644
index 0000000..f3bac1f
--- /dev/null
+++ b/force-app/main/default/classes/NFM701ControllerHandlerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>41.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/NFM702WebService.cls b/force-app/main/default/classes/NFM702WebService.cls
new file mode 100644
index 0000000..b6beb82
--- /dev/null
+++ b/force-app/main/default/classes/NFM702WebService.cls
@@ -0,0 +1,6 @@
+global without sharing class NFM702WebService {
+    webservice static String sendToOBPM(String iflog_Id, List<String> contactids){
+        NFM702Controller.callout(iflog_Id, contactids);
+        return '涓婁紶OBPM鎴愬姛!';
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/NFM702WebService.cls-meta.xml b/force-app/main/default/classes/NFM702WebService.cls-meta.xml
new file mode 100644
index 0000000..dd61d1f
--- /dev/null
+++ b/force-app/main/default/classes/NFM702WebService.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>52.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/NFM702WebServiceTest.cls b/force-app/main/default/classes/NFM702WebServiceTest.cls
new file mode 100644
index 0000000..0745fe0
--- /dev/null
+++ b/force-app/main/default/classes/NFM702WebServiceTest.cls
@@ -0,0 +1,57 @@
+@isTest
+private class NFM702WebServiceTest {
+    public Class GeDatas {
+        public NFMUtil.Monitoring Monitoring;
+        public GeData[] GeData;
+    }
+
+    public Class GeData {
+        public String DoctorNo;   //浜哄憳绠$悊缂栫爜
+        public String HospitalName;     //鍖婚櫌鍚嶇О
+        public String OfficeName;   //绉戝鍚嶇О
+        public String DoctorName;    //濮撳悕
+        public String TelNo;   //鐢佃瘽
+        public String HcpNo;    //HPC缂栫爜
+        public Boolean IsActive;    //鏄惁鏈夋晥
+        public String UpdateStatus;     //鎿嶄綔绫诲瀷
+    }
+    static testMethod void testMethod1() {
+        GeDatas GeDatas = new GeDatas();
+        GeDatas.Monitoring = new NFMUtil.Monitoring();
+        Datetime nowDT = Datetime.now();
+        String nowStr = nowDT.format('yyyyMMddHHmm');
+        GeDatas.Monitoring.TransmissionDateTime = nowStr;
+        GeDatas.Monitoring.Text                 = ''; 
+        GeDatas.Monitoring.Tag                  = '';
+        GeDatas.Monitoring.Sender               = 'SFDC';
+        GeDatas.Monitoring.Receiver             = 'OBPM';
+        GeDatas.Monitoring.MessageType          = 'NFM702';
+
+        GeDatas.GeData = new List<GeData>();
+        GeData GeData = new GeData();
+        GeDatas.GeData.add(GeData);
+        GeData.DoctorNo = 'C000033002';
+        GeData.HospitalName = '瀹夊窘涓尰鑽ぇ瀛︾涓�闄勫睘鍖婚櫌';
+        GeData.OfficeName = ' 鑰抽蓟鍠夌';
+        GeData.DoctorName = '鍒樺垰';
+        GeData.TelNo = '13810000000';
+        GeData.HcpNo = '123456';
+        GeData.IsActive = true;
+        GeData.UpdateStatus = '1';
+
+        NFMUtil.Monitoring Monitoring   = new NFMUtil.Monitoring();
+        Monitoring.Tag                  = GeDatas.Monitoring.Tag;
+        Monitoring.Sender               = GeDatas.Monitoring.Sender;
+        Monitoring.Receiver             = GeDatas.Monitoring.Receiver;
+        Monitoring.MessageType          = GeDatas.Monitoring.MessageType;
+        Monitoring.MessageGroupNumber   = GeDatas.Monitoring.MessageGroupNumber;
+        Monitoring.NumberOfRecord       = GeDatas.Monitoring.NumberOfRecord;
+        Monitoring.TransmissionDateTime = GeDatas.Monitoring.TransmissionDateTime;
+        Monitoring.Text = '';
+        BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM702', GeDatas.GeData);
+        
+        List<String> geList = new List<String>();
+        geList.add('C000033002');
+        NFM702WebService.sendToOBPM(rowData.id, geList);
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/NFM702WebServiceTest.cls-meta.xml b/force-app/main/default/classes/NFM702WebServiceTest.cls-meta.xml
new file mode 100644
index 0000000..dd61d1f
--- /dev/null
+++ b/force-app/main/default/classes/NFM702WebServiceTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>52.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/NFM703Controller.cls b/force-app/main/default/classes/NFM703Controller.cls
index c9c6791..ecadff5 100644
--- a/force-app/main/default/classes/NFM703Controller.cls
+++ b/force-app/main/default/classes/NFM703Controller.cls
@@ -83,6 +83,8 @@
 	    								HostName__c,
 	    								cooperatorCompany__c, 
                                         Owner.Employee_No__c, 
+                                        Shared_Editing__c, 
+                                        Carbon_Copy__c, 
 	    								IF_Approved__c from Campaign where id in: camIdList];
 	    String logstr = ' ' + 'NumberOfRecord=' + camList.size() + '\n';
 
@@ -97,6 +99,19 @@
 		mon.TransmissionDateTime = nowStr;
 		mon.Text = '';
 
+        Map<String, String> transferMap = new Map<String, String>();
+        List<BatchIF_Transfer__c> transferList = [select Table__c,
+                                  Column__c,
+                                  External_value__c,
+                                  Internal_value__c
+                                  from BatchIF_Transfer__c
+                                  where Dropped_Flag__c = false
+                                          and (Table__c = 'Application_for_Conference_Adjudication__c')
+                                          ];
+        for (BatchIF_Transfer__c t : transferList) {
+            transferMap.put(t.Column__c + t.Internal_value__c, t.External_value__c);
+        }
+
         try {
         		
         	for (Campaign cam : camList) {
@@ -107,7 +122,7 @@
         		ged.StartDate 		  = NFMUtil.formatDate2StrSpo(cam.StartDate);
         		ged.EndDate 		  = NFMUtil.formatDate2StrSpo(cam.EndDate);
                 ged.BudgetType        = cam.Budget_Type__c;
-				ged.OfficeCategory 	  = cam.OfficeCategory__c;
+				ged.OfficeCategory 	  = NFMUtil.getMapValue(transferMap, 'OfficeCategory__c', cam.OfficeCategory__c, iflog);
 				ged.MeetingType 	  = cam.Meeting_Type__c;
                 ged.ActivityTypeName  = cam.Activity_Type_Name__c;
 				ged.StateMaster 	  = cam.State_Master__r.Name;                 
@@ -118,7 +133,7 @@
                 ged.ExpectedOlympusAttendance = String.valueOf(cam.Expected_Olympus_Attendance__c);
                 ged.ExpectedHcpAttendance = String.valueOf(cam.Expected_Hcp_Attendance__c);
                 // 鏆傛椂瀹氫箟涓轰富鎷呭綋锛屽悗缁坊鍔犲叾浠栧叡浜汉
-                ged.SharedEditing     = cam.Owner.Employee_No__c;
+                ged.SharedEditing     = Modify_Sharing(cam.Owner.Employee_No__c, cam.Shared_Editing__c, cam.Carbon_Copy__c);
                 gds.GeData.add(ged);
 
     		}
@@ -231,4 +246,27 @@
         upsert rowDataSFDC;
 
     }
+
+    public static String Modify_Sharing(String owner, String shared_editors, String carbon_copies) {
+        if (String.isBlank(owner) && String.isBlank(shared_editors) && String.isBlank(carbon_copies)) {
+            return '';
+        }
+        String ret = '';
+        if (String.isNotBlank(owner)) {
+            ret = owner;
+        }
+        if (String.isNotBlank(shared_editors)) {
+            if (ret.length() > 0) {
+                ret = ret + ',';
+            }
+            ret = ret + shared_editors;
+        }
+        if (String.isNotBlank(carbon_copies)) {
+            if (ret.length() > 0) {
+                ret = ret + ',';
+            }
+            ret = ret + carbon_copies;
+        }
+        return ret;
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/NFM704Rest.cls b/force-app/main/default/classes/NFM704Rest.cls
index 0a89d87..0e20bc5 100644
--- a/force-app/main/default/classes/NFM704Rest.cls
+++ b/force-app/main/default/classes/NFM704Rest.cls
@@ -14,13 +14,21 @@
     public static final String LOG_TYPE = 'NFM704';
 
     global class GeData {
-        public String StaffMCode;   //SFDC浜哄憳绠$悊缂栫爜
+        public String StaffMCode;   //浜哄憳绠$悊缂栫爜OBPM
         public String HospitalMCode;     //鍖婚櫌绠$悊缂栫爜
-        public String OfficeMCode;   //绉戝绠$悊缂栫爜
+        public String OfficeMCode;   //OBPM绉戝
         public String HcpNo;    //HPC缂栫爜
         public String HCPLevel; //HCP绛夌骇
         public String Name;    //濮撳悕
         public String Mobile;   //鐢佃瘽
+        public String State;    //鐪�
+        public String City;     //甯�
+        public String WorkingSeniority; //涓村簥宸ヤ綔骞撮檺
+        public String TechnicalTitle; //鎶�鏈亴绉�
+        public String Speciality;   //鎿呴暱鐨勬墜鏈�
+        public String ProfessionalField;    //涓撲笟棰嗗煙
+        public String Society1;  //瀛︿細鍚嶇О
+        public String EventStatus; //瀛︿細鑱岀О
     }
 
     @HttpPost
@@ -89,10 +97,11 @@
             List<String> DoctorNoList = new List<String>();
 
             //寰呮洿鏂扮殑瀹㈡埛浜哄憳List
-            List<Contact> updateList = new List<Contact>();
+            List<Contact> upsertList = new List<Contact>();
 
-            //绉戝缂栫爜List
-            List<String> officeMCodeList = new List<String>();
+            //鍖婚櫌缂栫爜List
+            List<String> HospitalMCodeList = new List<String>();
+
 
             for(GeData ged : itemMasterList){
                 String dataComplete = verify(ged);
@@ -101,69 +110,86 @@
                     continue;
                 }
                 DoctorNoList.add(ged.StaffMCode);
-                officeMCodeList.add(ged.OfficeMCode);
+                //officeMCodeList.add(ged.OfficeMCode);
+                HospitalMCodeList.add(ged.HospitalMCode);
             }
-
+            system.debug('HospitalMCodeList=============>'+HospitalMCodeList);
+            system.debug('DoctorNoList=============>'+DoctorNoList);
+            //Map<String, Map<String,Contact>> hospitalMap = new Map<String, Map<String,Contact>>();
             Map<String, Contact> conListMap = new Map<String, Contact>();
             List<Contact> conList = [select Id,
-                                            CManageCode__c,     //浜哄憳绠$悊缂栫爜
-                                            Account.Hospital_Name__c,       //鍖婚櫌鍚嶇О
-                                            Account.Department_Name__c,       //绉戝鍚嶇О
-                                            Name,       //濮撳悕
-                                            Phone,      //鐢佃瘽
-                                            HcpNo__c,       //HCP缂栫爜
-                                            Isactive__c,    //鏄惁鏈夋晥
-                                            UpdateStatus__c            //鎿嶄綔绫诲瀷
-                                            from Contact WHERE CManageCode__c IN:DoctorNoList order by AccountId];
-
+                                            Management_Code__c, //鍖婚櫌绠$悊缂栫爜
+                                            CManageCode__c     //浜哄憳绠$悊缂栫爜
+                                            from Contact WHERE CManageCode__c IN:DoctorNoList];
+            system.debug('conList============>'+conList);
             
             for(Contact con : conList ){
+                
                 conListMap.put(con.CManageCode__c, con);
+                //hospitalMap.put(con.Management_Code__c,conListMap);
             }
 
-            //Management_Code__c
-            List<Account> accList = [select Id, Name, Management_Code__c from Account where Management_Code__c in :officeMCodeList];
-
+            List<Account> accList = [select Id, Name,GI_Main__c,Management_Code__c from Account where Management_Code__c in :HospitalMCodeList];
+            system.debug('accList=============>'+accList);
             Map<String, Account> accMap = new Map<String, Account>();
 
             for(Account acc : accList){
-                accMap.put(acc.Management_Code__c, acc);
+               accMap.put(acc.Management_Code__c, acc);
             }
+
 
             for( GeData ged : itemMasterList ){
-
-                Contact con = new Contact();
-
-                logstr += conListMap.get(ged.StaffMCode).Id;
-
-                if(conListMap.containsKey(ged.StaffMCode)){
-
-                    logstr += '宸插瓨鍦ㄥ鎴蜂汉鍛榎n';
-                    con.Id = conListMap.get(ged.StaffMCode).Id;
-
-                }else {
-                    logstr += '涓嶅瓨鍦ㄧ殑瀹㈡埛浜哄憳\n';
+                //Map<String, Contact> tempMap = new Map<String, Contact>();
+                if(accMap.containsKey(ged.HospitalMCode)){//鍖婚櫌缂栫爜鏄惁瀛樺湪 鏄�
+                    Contact con = new Contact();
+                    if(conListMap.containsKey(ged.StaffMCode)){
+                        //瀛樺湪鍒欐洿鏂�
+                        system.debug('鏇存柊鑱旂郴浜�');
+                        logstr += conListMap.get(ged.StaffMCode).Id + '\n';
+                        logstr += '宸插瓨鍦ㄥ鎴蜂汉鍛榎n';
+                        con.Id = conListMap.get(ged.StaffMCode).Id;
+                        system.debug('request'+conListMap.get(ged.StaffMCode).Management_Code__c.equals(ged.HospitalMCode));
+                        if(conListMap.get(ged.StaffMCode).Management_Code__c.equals(ged.HospitalMCode)){//鍒ゆ柇鑱旂郴浜轰笂鐨勭鐞嗙紪鐮佸拰鎺ュ彛浼犺緭杩囨潵鐨勭鐞嗙紪鐮佹槸鍚︿竴鑷�
+                            system.debug('request'+conListMap.get(ged.StaffMCode).Management_Code__c.equals(ged.HospitalMCode));
+                        }else{
+                            con.OBPMHospital__c = accMap.get(ged.HospitalMCode).Id;//鎺ユ敹鐨勭鐞嗙紪鐮佸搴旂殑鍖婚櫌鍐欏埌OBPM鍖婚櫌涓�
+                        }
+                        con = assignment(ged,con);
+                    }else{
+                        //涓嶅瓨鍦ㄥ垯鏂板缓
+                        system.debug('鏂板缓鑱旂郴浜�');
+                        //logstr += '涓嶅瓨鍦ㄧ殑瀹㈡埛浜哄憳\n';
+                        con.OwnerId = accMap.get(ged.HospitalMCode).GI_Main__c;//鎵�鏈変汉鍙栧尰闄笂鐨勬秷鍖栫鎷呭綋
+                        con.AccountId = accMap.get(ged.HospitalMCode).Id;//鏂板缓鑱旂郴浜烘斁鍒板尰闄笅
+                        con.LastName = ged.Name;
+                        con.FirstName = '';
+                        con = assignment(ged,con);
+                    }
+                    upsertList.add(con);
+                }else{//鍚�
+                    continue;
+                    logstr += '涓嶅瓨鍦ㄧ殑鍖婚櫌绠$悊缂栫爜:['+accMap.get(ged.HospitalMCode)+']/n';
                 }
 
-                //AccountId
-                if( accMap.get(ged.OfficeMCode) != null ){
-                    con.AccountId = accMap.get(ged.OfficeMCode).Id;
-                }else {
-                    logstr += '褰撳墠绉戝id鏈夎鎴栦笉瀛樺湪';
-                }
+                // //AccountId
+                // if( accMap.get(ged.OfficeMCode) != null ){
+                //     con.AccountId = accMap.get(ged.OfficeMCode).Id;
+                // }else {
+                //     logstr += '褰撳墠绉戝id鏈夎鎴栦笉瀛樺湪';
+                // }
 
-                con.HcpNo__c = ged.HcpNo;
-                con.HCPLevel__c = ged.HCPLevel;
-                con.LastName = ged.Name;
-                con.MobilePhone = ged.Mobile;
+                // con.HcpNo__c = ged.HcpNo;
+                // con.HCPLevel__c = ged.HCPLevel;
+                // con.LastName = ged.Name;
+                // con.MobilePhone = ged.Mobile;
 
-                conListMap.put(ged.StaffMCode, con);
-                
+                // conListMap.put(ged.StaffMCode, con);
             }
-
-            if(conListMap.size() > 0 ){
+            system.debug('upsertList==================>'+upsertList);
+            if(upsertList.size() > 0 ){
                 // Update updateList;
-                UpSert conListMap.values();
+                Oly_TriggerHandler.bypass('ConsumableOrderTrigger');
+                UpSert upsertList;
             }
 
             rowData.retry_cnt__c = 0;
@@ -191,9 +217,9 @@
         if (ged.HospitalMCode == null) {
             result += 'DataError: 鍖婚櫌绠$悊缂栫爜 [ HospitalMCode ] is null!\n';
         }
-        if (ged.OfficeMCode == null) {
-            result += 'DataError: 绉戝绠$悊缂栫爜 [ OfficeMCode ] is null!\n';
-        }
+        // if (ged.OfficeMCode == null) {
+        //     result += 'DataError: 绉戝绠$悊缂栫爜 [ OfficeMCode ] is null!\n';
+        // }
         if (ged.HcpNo == null) {
             result += 'DataError: HCP缂栫爜 [ HcpNo ] is null!\n';
         }
@@ -210,4 +236,45 @@
         return result;
     }
 
+    public static Contact assignment(GeData ged,Contact con){//鑱旂郴浜烘暟鎹祴鍊兼柟娉�
+        List<String> societyList = Breakup(ged.Society1);
+        List<String> eventStatusList = Breakup(ged.EventStatus);
+        con.NameOBPM__c             = ged.Name;//濮撳悕
+        con.MobileOBPM__c           = ged.Mobile;//鐢佃瘽
+        con.stateOBPM__c            = ged.State;//鐪丱BPM
+        con.CityOBPM__c             = ged.City;//甯侽BPM
+        con.HcpNo__c                = ged.HcpNo;//HPC缂栫爜
+        con.HCPLevel__c             = ged.HCPLevel;//HCP绛夌骇
+        con.OBPMDepartment__c       = ged.OfficeMCode;//OBPM绉戝
+        con.WorkingSeniorityOBPM__c = ged.WorkingSeniority;  //涓村簥宸ヤ綔骞撮檺
+        con.TechnicalTitleOBPM__c   = ged.TechnicalTitle;//鎶�鏈亴绉�
+        con.SpecialityOBPM__c       = ged.Speciality;//鎿呴暱鐨勬墜鏈�
+        con.ProfessionalField__c    = ged.ProfessionalField;//涓撲笟棰嗗煙
+        if(societyList.size()>0){
+            con.Learn_name1__c          = societyList[0];//瀛︿細鍚嶇О1
+        }
+        if(societyList.size()>1){
+            con.Learn_name2__c          = societyList[1];//瀛︿細鍚嶇О2
+        }
+        if(societyList.size()>2){
+            con.Learn_name3__c          = societyList[2];//瀛︿細鍚嶇О3
+        }
+        if(eventStatusList.size()>0){
+            con.Learn_serve1__c         = eventStatusList[0];//瀛︿細鑱岀О1
+        }
+        if(eventStatusList.size()>1){
+            con.Learn_serve2__c         = eventStatusList[1];//瀛︿細鑱岀О2
+        }
+        if(eventStatusList.size()>2){
+            con.Learn_serve3__c         = eventStatusList[2];//瀛︿細鑱岀О3
+        }
+        return con;
+    }
+
+    public static List<String> Breakup (String str){
+        // List<string> over = new List<string>();
+        // over =聽str.split('鈫�');
+        List<string> over = str.split('鈫�');
+        return over;
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/NFM705Rest.cls b/force-app/main/default/classes/NFM705Rest.cls
index acafad9..ea52474 100644
--- a/force-app/main/default/classes/NFM705Rest.cls
+++ b/force-app/main/default/classes/NFM705Rest.cls
@@ -122,6 +122,7 @@
             //Map<string,GeData> meetingApprovedNoMap = new Map<string,GeData>();
             List<String> meetingApprovedNoList = new List<String>();
             List<String> NumList = new List<String>();
+            List<User> users = new List<User>();
             for(GeData ged : itemMasterList){
                 //楠岃瘉鏁版嵁瀹屾暣鎬�
                 // String dataComplete = verify(ged);
@@ -140,7 +141,8 @@
                                             Num__c, 
                                             MeetingApprovedNo__c 
                                         from Campaign 
-                                        where Num__c IN: NumList] : new List<Campaign>();
+                                        where Num__c IN: NumList 
+                                        ] : new List<Campaign>();
             // for(Campaign temp : campaignList){
             //     campaignMap.put(temp.Num__c,temp.Id);
             // }
@@ -155,6 +157,9 @@
                 oldacfcMap.put(oldafca.MeetingApprovedNo__c,oldafca);
             }
 
+            // 鎵�鏈変汉淇℃伅
+            List<String> user_nos = new List<String>();
+
             for (GeData ged : itemMasterList) {
                 //鏂板缓浼氳瑁佸喅鐢宠
                 Application_for_Conference_Adjudication__c aca = new Application_for_Conference_Adjudication__c();
@@ -165,7 +170,7 @@
                 aca.StartDate__c                    = NFMUtil.parseDateTimeStr2Date(ged.StartDate);
                 aca.EndDate__c                      = NFMUtil.parseDateTimeStr2Date(ged.EndDate);
                 aca.BudgetType__c                   = ged.BudgetType;
-                aca.OfficeCategory__c               = ged.OfficeCategory;
+                aca.OfficeCategory__c               = GetOfficeCategory(ged.OfficeCategory, transferMap, iflog);
                 //aca.MeetingType__c                  = ged.MeetingType;
                 aca.MeetingType__c                  = DividingTypes(ged.IsCoOrganizingActivities,ged.ActivityTypeName);
                 aca.StateMaster__c                  = ged.StateMaster;
@@ -188,34 +193,68 @@
                     aca.ProcessState__c == oldacfcMap.get(ged.MeetingApprovedNo).ProcessState__c)){
                     aca.Id = oldacfcMap.get(ged.MeetingApprovedNo).Id;
                     aca.Num__c = String.isBlank(aca.Num__c) ? oldacfcMap.get(ged.MeetingApprovedNo).Num__c : aca.Num__c; 
+                } 
+
+                // 纭鐢宠浜�
+                System.debug('aca.Id: ' + aca.Id);
+                if (String.isBlank(aca.Id)) {
+                    user_nos.add(ged.Applicant);
                 }
+
                 aca.IsSupplemental__c = aca.ProcessState__c != '琛ュ厖鍐宠' ? false : true;
                 aca.Applicant__c = ged.Applicant;
                 aca.Shared_Editing__c = ged.SharedEditing;
+                if (String.isNotBlank(ged.SharedEditing)) {
+                    user_nos.addAll(ged.SharedEditing.split(','));
+                }
+                System.debug(user_nos);
 
                 acaList.add(aca);
+            }
+
+            // 鏌ユ壘鎵�鏈変汉
+            if (user_nos != null && user_nos.size() > 0) {
+                users = [select Id, Employee_No__c from User where Employee_No__c in :user_nos];
+                if (users != null && users.size() > 0) {
+                    String owner = '';
+                    for (Application_for_Conference_Adjudication__c app : acaList) {
+                        System.debug('owner from 705: ' + app.Applicant__c);
+                        for (User u : users) {
+                            System.debug('user no: ' + u.Employee_No__c);
+                            if (String.isNotBlank(u.Employee_No__c) && u.Employee_No__c.equals(app.Applicant__c)) {
+                                app.OwnerId = u.Id;
+                                owner = u.Id;
+                                break;
+                            }
+                        }
+                    }
+                }
             }
             
             if (acaList.size() > 0) {
                 // 鍐欏叆鍐宠淇℃伅
                 upsert acaList;
+
+                // 鍏变韩鏉冮檺
+                SetSharing(users, acaList);
                 // 鑷姩鍒涘缓瀛︿細
-                List<Application_for_Conference_Adjudication__c> wait_to_create_cams = new List<Application_for_Conference_Adjudication__c>();
-                List<Campaign> new_campaigns = new List<Campaign>();
-                for (Application_for_Conference_Adjudication__c app : acaList) {
-                    if (String.isBlank(app.Id) && String.isBlank(app.Num__c) && app.MeetingType__c != '璧炲姪浼�' && app.ProcessState__c != '琛ュ厖鍐宠') {
-                        wait_to_create_cams.add(app);
-                    }
-                }
-                if (wait_to_create_cams != null && wait_to_create_cams.size() > 0) {
-                    for (Application_for_Conference_Adjudication__c app : wait_to_create_cams) {
-                        Campaign cam = createNewCampaignFromApplication(app);
-                        new_campaigns.add(cam);
-                    }
-                    if (new_campaigns.size() > 0) {
-                        insert new_campaigns;
-                    }
-                }
+                // 2022-02-22 浼氳纭 鏃犳硶纭璁板綍绫诲瀷锛屼笉鍋氳嚜鍔ㄥ垱寤�
+                // List<Application_for_Conference_Adjudication__c> wait_to_create_cams = new List<Application_for_Conference_Adjudication__c>();
+                // List<Campaign> new_campaigns = new List<Campaign>();
+                // for (Application_for_Conference_Adjudication__c app : acaList) {
+                //     if (String.isBlank(app.Id) && String.isBlank(app.Num__c) && app.MeetingType__c != '璧炲姪浼�' && app.ProcessState__c != '琛ュ厖鍐宠') {
+                //         wait_to_create_cams.add(app);
+                //     }
+                // }
+                // if (wait_to_create_cams != null && wait_to_create_cams.size() > 0) {
+                //     for (Application_for_Conference_Adjudication__c app : wait_to_create_cams) {
+                //         Campaign cam = createNewCampaignFromApplication(app);
+                //         new_campaigns.add(cam);
+                //     }
+                //     if (new_campaigns.size() > 0) {
+                //         insert new_campaigns;
+                //     }
+                // }
                 // 鏇存柊宸插瓨鍦ㄧ殑鍐宠淇℃伅
                 System.debug('鏌ユ壘鍒扮殑浼氳: ' + campaignList.size());
                 if (campaignList != null && campaignList.size() > 0) {
@@ -225,6 +264,31 @@
                             if (cam.Num__c == app.Num__c && !app.IsSupplemental__c) {
                                 cam.MeetingApprovedNo__c             = app.MeetingApprovedNo__c;
                                 cam.Meeting_Approved_No__c           = app.Id;
+                                if (app.MeetingType__c != '璧炲姪浼�') {
+                                    cam.StartDate                        = app.StartDate__c;
+                                    cam.EndDate                          = app.EndDate__c;
+                                    cam.Budget_Type__c                   = app.BudgetType__c;
+                                    cam.OfficeCategory__c                = app.OfficeCategory__c;
+                                    cam.Meeting_Type__c                  = app.MeetingType__c;
+    
+                                    cam.WorkshopPlace__c                 = app.WorkshopPlace__c;
+                                    cam.HostName__c                      = app.HostName__c;
+                                    cam.cooperatorCompany__c             = app.CooperatorCompany__c;
+                                    cam.Convening_Participants_Num__c    = app.ConveningParticipantsNum__c;
+    
+                                    // OBPM瀵规帴 鏂板瀛楁
+                                    cam.Expected_Olympus_Attendance__c   = app.ExpectedOlympusAttendance__c;
+                                    cam.Expected_Hcp_Attendance__c       = app.ExpectedHcpAttendance__c;
+                                    cam.SponsorshipCategory__c           = app.SponsorshipCategory__c;
+                                    cam.IsPaidToSponsor__c               = app.IsPaidToSponsor__c;
+                                    // cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+                                    cam.Activity_Type_Name__c            = app.Type_of_adjudication_meeting__c;
+                                    // 杩欓噷闇�瑕侀澶栧姞鎿嶄綔
+                                    cam.State_Master__c                  = StateCityUtil.get_state(app.StateMaster__c);                 
+                                    cam.City_Master__c                   = StateCityUtil.get_city(app.CityMaster__c);
+                                }
+                                
+
                                 updatelist.add(cam);
                                 break;
                             }
@@ -259,145 +323,145 @@
         
     }
     // 蹇呭~瀛楁楠岃瘉
-    private static String verify(GeData ged) {
-        String result = '';
+    // private static String verify(GeData ged) {
+    //     String result = '';
 
-        // Map<String , String> BudgetTypeMap = new Map<String,String>();
-        // BudgetTypeMap.put(ged.BudgetType, '鏂颁骇鍝佷笂甯�');
-        // BudgetTypeMap.put(ged.BudgetType, '浜у搧鎺ㄥ箍');
-        // BudgetTypeMap.put(ged.BudgetType, '涓婚娲诲姩锛圢BI鏃╃檶锛孍US澶ц禌绛夛級');
-        // BudgetTypeMap.put(ged.BudgetType, '浜у搧鍞悗浣跨敤鍩硅');
-        // BudgetTypeMap.put(ged.BudgetType, 'NTC绛夋晠闅滈闃叉椿鍔�');
-        // BudgetTypeMap.put(ged.BudgetType, '缁忛攢鍟嗙浉鍏充細璁�');
-        // BudgetTypeMap.put(ged.BudgetType, '鍏朵粬');
+    //     // Map<String , String> BudgetTypeMap = new Map<String,String>();
+    //     // BudgetTypeMap.put(ged.BudgetType, '鏂颁骇鍝佷笂甯�');
+    //     // BudgetTypeMap.put(ged.BudgetType, '浜у搧鎺ㄥ箍');
+    //     // BudgetTypeMap.put(ged.BudgetType, '涓婚娲诲姩锛圢BI鏃╃檶锛孍US澶ц禌绛夛級');
+    //     // BudgetTypeMap.put(ged.BudgetType, '浜у搧鍞悗浣跨敤鍩硅');
+    //     // BudgetTypeMap.put(ged.BudgetType, 'NTC绛夋晠闅滈闃叉椿鍔�');
+    //     // BudgetTypeMap.put(ged.BudgetType, '缁忛攢鍟嗙浉鍏充細璁�');
+    //     // BudgetTypeMap.put(ged.BudgetType, '鍏朵粬');
 
-        // Map<String , String> OfficeCategoryMap = new Map<String,String>();
-        // OfficeCategoryMap.put(ged.OfficeCategory, '1.娑堝寲绉�');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '2.鍛煎惛绉�');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '3.鏅绉�');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '4.娉屽翱绉�');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '5.濡囩');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '6.鑰抽蓟鍠夌');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '鍏朵粬');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '鑲濊儐澶栫');
-        // OfficeCategoryMap.put(ged.OfficeCategory, '鑳冭偁澶栫');
+    //     // Map<String , String> OfficeCategoryMap = new Map<String,String>();
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '1.娑堝寲绉�');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '2.鍛煎惛绉�');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '3.鏅绉�');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '4.娉屽翱绉�');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '5.濡囩');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '6.鑰抽蓟鍠夌');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '鍏朵粬');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '鑲濊儐澶栫');
+    //     // OfficeCategoryMap.put(ged.OfficeCategory, '鑳冭偁澶栫');
 
-        // Map<String , String> MeetingTypeMap = new Map<String,String>();
-        // MeetingTypeMap.put(ged.MeetingType, '鑷姙浼�');
-        // MeetingTypeMap.put(ged.MeetingType, '璧炲姪浼�');
-        // MeetingTypeMap.put(ged.MeetingType, '鍏卞悓涓诲姙浼�');
+    //     // Map<String , String> MeetingTypeMap = new Map<String,String>();
+    //     // MeetingTypeMap.put(ged.MeetingType, '鑷姙浼�');
+    //     // MeetingTypeMap.put(ged.MeetingType, '璧炲姪浼�');
+    //     // MeetingTypeMap.put(ged.MeetingType, '鍏卞悓涓诲姙浼�');
 
-        // if (ged.MeetingApprovedNo == null) {
-        //     result += 'DataError: 浼氳鍐宠缂栫爜 [ MeetingApprovedNo ] is null!\n';
-        // }
-        if (String.isBlank(ged.Name)) {
-            result += 'DataError: 浼氳鍚嶇О [ Name ] 涓嶈兘涓虹┖!\n';
-        }
-        if(String.isBlank(ged.MeetingApprovedNo)){
-            result += 'DataError:浼氳鍐宠缂栫爜[MeetingApprovedNo] 涓嶈兘涓虹┖!\n';
-        }
-        if(ged.ProcessState == null){
-            result += 'DataError:OBPM瀹℃壒鐘舵�乕ProcessState] 涓嶈兘涓虹┖!\n';
-        }
-        if(String.isBlank(ged.HostName)){
-            result += 'DataError:浼氳涓诲姙鏂筟HostName] 涓嶈兘涓虹┖!\n';
-        }
-        if(String.isBlank(ged.CooperatorCompany)){
-            result += 'DataError:浼氳鎵垮姙鏂筟CooperatorCompany] 涓嶈兘涓虹┖!\n';
-        }
-        /*if (!BudgetTypeMap.containsKey(ged.BudgetType)) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.BudgetType.equals('浜у搧鎺ㄥ箍')) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.BudgetType.equals('涓婚娲诲姩锛圢BI鏃╃檶锛孍US澶ц禌绛夛級')) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.BudgetType.equals('浜у搧鍞悗浣跨敤鍩硅')) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.BudgetType.equals('NTC绛夋晠闅滈闃叉椿鍔�')) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.BudgetType.equals('缁忛攢鍟嗙浉鍏充細璁�')) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.BudgetType.equals('鍏朵粬')) {
-            result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
-        }
-        if (!OfficeCategoryMap.containsKey(ged.OfficeCategory)) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('2.鍛煎惛绉�')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('3.鏅绉�')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('4.娉屽翱绉�')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('5.濡囩')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('6.鑰抽蓟鍠夌')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('鍏朵粬')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('鑲濊儐澶栫')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.OfficeCategory.equals('鑳冭偁澶栫')) {
-            result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
-        }
-        if (!MeetingTypeMap.containsKey(ged.MeetingType)) {
-            result += 'DataError: 浼氳绫诲瀷 [ MeetingType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.MeetingType.equals('璧炲姪浼�')) {
-            result += 'DataError: 浼氳绫诲瀷 [ MeetingType ] 浼犲�兼湁璇�!\n';
-        } else if (!ged.MeetingType.equals('鍏卞悓涓诲姙浼�')) {
-            result += 'DataError: 浼氳绫诲瀷 [ MeetingType ] 浼犲�兼湁璇�!\n';
-        } */
-        return result;
-    }
+    //     // if (ged.MeetingApprovedNo == null) {
+    //     //     result += 'DataError: 浼氳鍐宠缂栫爜 [ MeetingApprovedNo ] is null!\n';
+    //     // }
+    //     if (String.isBlank(ged.Name)) {
+    //         result += 'DataError: 浼氳鍚嶇О [ Name ] 涓嶈兘涓虹┖!\n';
+    //     }
+    //     if(String.isBlank(ged.MeetingApprovedNo)){
+    //         result += 'DataError:浼氳鍐宠缂栫爜[MeetingApprovedNo] 涓嶈兘涓虹┖!\n';
+    //     }
+    //     if(ged.ProcessState == null){
+    //         result += 'DataError:OBPM瀹℃壒鐘舵�乕ProcessState] 涓嶈兘涓虹┖!\n';
+    //     }
+    //     if(String.isBlank(ged.HostName)){
+    //         result += 'DataError:浼氳涓诲姙鏂筟HostName] 涓嶈兘涓虹┖!\n';
+    //     }
+    //     if(String.isBlank(ged.CooperatorCompany)){
+    //         result += 'DataError:浼氳鎵垮姙鏂筟CooperatorCompany] 涓嶈兘涓虹┖!\n';
+    //     }
+    //     /*if (!BudgetTypeMap.containsKey(ged.BudgetType)) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.BudgetType.equals('浜у搧鎺ㄥ箍')) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.BudgetType.equals('涓婚娲诲姩锛圢BI鏃╃檶锛孍US澶ц禌绛夛級')) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.BudgetType.equals('浜у搧鍞悗浣跨敤鍩硅')) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.BudgetType.equals('NTC绛夋晠闅滈闃叉椿鍔�')) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.BudgetType.equals('缁忛攢鍟嗙浉鍏充細璁�')) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.BudgetType.equals('鍏朵粬')) {
+    //         result += 'DataError: 棰勭畻绫诲瀷 [ BudgetType ] 浼犲�兼湁璇�!\n';
+    //     }
+    //     if (!OfficeCategoryMap.containsKey(ged.OfficeCategory)) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('2.鍛煎惛绉�')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('3.鏅绉�')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('4.娉屽翱绉�')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('5.濡囩')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('6.鑰抽蓟鍠夌')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('鍏朵粬')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('鑲濊儐澶栫')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.OfficeCategory.equals('鑳冭偁澶栫')) {
+    //         result += 'DataError: 绉戝鍒嗙被 [ OfficeCategory ] 浼犲�兼湁璇�!\n';
+    //     }
+    //     if (!MeetingTypeMap.containsKey(ged.MeetingType)) {
+    //         result += 'DataError: 浼氳绫诲瀷 [ MeetingType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.MeetingType.equals('璧炲姪浼�')) {
+    //         result += 'DataError: 浼氳绫诲瀷 [ MeetingType ] 浼犲�兼湁璇�!\n';
+    //     } else if (!ged.MeetingType.equals('鍏卞悓涓诲姙浼�')) {
+    //         result += 'DataError: 浼氳绫诲瀷 [ MeetingType ] 浼犲�兼湁璇�!\n';
+    //     } */
+    //     return result;
+    // }
 
     // 鍒涘缓浼氳 缁戝畾鍐宠鐩稿叧淇℃伅
-    public static Campaign createNewCampaignFromApplication(Application_for_Conference_Adjudication__c app) {
-        Campaign cam = new Campaign();
-        //瀹氫箟鍙橀噺淇濆瓨璁板綍绫诲瀷
-        Id RtId = Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('Society').getRecordTypeId();
-        //List<Id> = [select Id from RecordType where IsActive = true and SobjectType = 'CampaignMember' and Name = '绀惧鍙傚姞浜�'];
-        Id RtId2 = Schema.SObjectType.CampaignMember.getRecordTypeInfosByDeveloperName().get('WorkShop').getRecordTypeId();
-        cam.RecordTypeId                     = RtId;
-        cam.CampaignMemberRecordTypeId       = RtId2;//ID涓嶅啓姝� 绀惧浜哄憳
+    // public static Campaign createNewCampaignFromApplication(Application_for_Conference_Adjudication__c app) {
+    //     Campaign cam = new Campaign();
+    //     //瀹氫箟鍙橀噺淇濆瓨璁板綍绫诲瀷
+    //     Id RtId = Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('Society').getRecordTypeId();
+    //     //List<Id> = [select Id from RecordType where IsActive = true and SobjectType = 'CampaignMember' and Name = '绀惧鍙傚姞浜�'];
+    //     Id RtId2 = Schema.SObjectType.CampaignMember.getRecordTypeInfosByDeveloperName().get('WorkShop').getRecordTypeId();
+    //     cam.RecordTypeId                     = RtId;
+    //     cam.CampaignMemberRecordTypeId       = RtId2;//ID涓嶅啓姝� 绀惧浜哄憳
 
-        cam.Name                             = app.MeetingApprovedNo__c;
-        cam.Name2__c                         = app.MeetingApprovedNo__c;
-        cam.MeetingApprovedNo__c             = app.MeetingApprovedNo__c;
-        cam.Meeting_Approved_No__c           = app.Id;
-        cam.StartDate                        = app.StartDate__c;
-        cam.EndDate                          = app.EndDate__c;
-        cam.Budget_Type__c                   = app.BudgetType__c;
-        cam.OfficeCategory__c                = app.OfficeCategory__c;
-        cam.Meeting_Type__c                  = app.MeetingType__c;
-        cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+    //     cam.Name                             = app.MeetingApprovedNo__c;
+    //     cam.Name2__c                         = app.MeetingApprovedNo__c;
+    //     cam.MeetingApprovedNo__c             = app.MeetingApprovedNo__c;
+    //     cam.Meeting_Approved_No__c           = app.Id;
+    //     cam.StartDate                        = app.StartDate__c;
+    //     cam.EndDate                          = app.EndDate__c;
+    //     cam.Budget_Type__c                   = app.BudgetType__c;
+    //     cam.OfficeCategory__c                = app.OfficeCategory__c;
+    //     cam.Meeting_Type__c                  = app.MeetingType__c;
+    //     cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
         
-        cam.WorkshopPlace__c                 = app.WorkshopPlace__c;
-        cam.HostName__c                      = app.HostName__c;
-        cam.cooperatorCompany__c             = app.CooperatorCompany__c;
-        cam.Convening_Participants_Num__c    = app.ConveningParticipantsNum__c;
-        cam.IF_Approved__c                   = true;
+    //     cam.WorkshopPlace__c                 = app.WorkshopPlace__c;
+    //     cam.HostName__c                      = app.HostName__c;
+    //     cam.cooperatorCompany__c             = app.CooperatorCompany__c;
+    //     cam.Convening_Participants_Num__c    = app.ConveningParticipantsNum__c;
+    //     cam.IF_Approved__c                   = true;
 
-        // OBPM瀵规帴 鏂板瀛楁
-        cam.Expected_Olympus_Attendance__c   = app.ExpectedOlympusAttendance__c;
-        cam.Expected_Hcp_Attendance__c       = app.ExpectedHcpAttendance__c;
-        cam.SponsorshipCategory__c           = app.SponsorshipCategory__c;
-        cam.IsPaidToSponsor__c               = app.IsPaidToSponsor__c;
-        cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
+    //     // OBPM瀵规帴 鏂板瀛楁
+    //     cam.Expected_Olympus_Attendance__c   = app.ExpectedOlympusAttendance__c;
+    //     cam.Expected_Hcp_Attendance__c       = app.ExpectedHcpAttendance__c;
+    //     cam.SponsorshipCategory__c           = app.SponsorshipCategory__c;
+    //     cam.IsPaidToSponsor__c               = app.IsPaidToSponsor__c;
+    //     cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
 
-        // 鏂板鎵�鏈変汉淇℃伅
-        List<String> user_nos = new List<String>();
-        user_nos.add(app.Applicant__c);
-        user_nos.addAll(app.Shared_Editing__c.split(','));
-        List<User> users = [select Id, Employee_No__c from User where Employee_No__c in :user_nos];
-        if (users != null && users.size() > 0) {
-            for (User u : users) {
-                if (u.Employee_No__c == app.Applicant__c) {
-                    cam.OwnerId = u.Id;
-                }
-            }
-        }
+    //     // 鏂板鎵�鏈変汉淇℃伅
+    //     List<String> user_nos = new List<String>();
+    //     user_nos.add(app.Applicant__c);
+    //     user_nos.addAll(app.Shared_Editing__c.split(','));
+    //     List<User> users = [select Id, Employee_No__c from User where Employee_No__c in :user_nos];
+    //     if (users != null && users.size() > 0) {
+    //         for (User u : users) {
+    //             if (u.Employee_No__c == app.Applicant__c) {
+    //                 cam.OwnerId = u.Id;
+    //             }
+    //         }
+    //     }
 
-        return cam;
-    }
+    //     return cam;
+    // }
 
     public static string DividingTypes(String IsCoOrganizingActivities,String ActivityTypeName){
         if('N'.equals(IsCoOrganizingActivities)){
@@ -408,4 +472,55 @@
         }
         return '鍏卞悓涓诲姙浼�';
     }
+
+    public static void SetSharing(List<User> users, List<Application_for_Conference_Adjudication__c> apps) {
+        if (users == null || users.size() <= 0 || apps == null || apps.size() <= 0) {
+            return;
+        }
+        // 鍒濆鍖栧弬鏁�
+        List<Application_for_Conference_Adjudication__Share> delete_list = new List<Application_for_Conference_Adjudication__Share>();
+        List<Application_for_Conference_Adjudication__Share> insert_list = new List<Application_for_Conference_Adjudication__Share>();
+        List<String> app_ids = new List<String>();
+        // 鍏变韩鐞嗙敱
+        String rowCauseShare = Schema.Application_for_Conference_Adjudication__Share.RowCause.Shared_Editor__c;
+        // 寰幆璁剧疆
+        for (Application_for_Conference_Adjudication__c app : apps) {
+            app_ids.add(app.Id);
+            System.debug('app.Shared_Editing__c: ' + app.Shared_Editing__c);
+
+            for (User u : users) {
+                if (String.isBlank(u.Employee_No__c)) {
+                    continue;
+                }
+                System.debug('u.Employee_No__c: ' + u.Employee_No__c);
+                if (app.Shared_Editing__c.contains(u.Employee_No__c)) {
+                    Application_for_Conference_Adjudication__Share aos = new Application_for_Conference_Adjudication__Share(
+                        RowCause = rowCauseShare,
+                        ParentId = app.Id,
+                        UserOrGroupId = u.Id,
+                        AccessLevel = 'Edit');
+                    insert_list.add(aos);
+                }
+            }
+        }
+        // 鍏堝垹闄�
+        delete_list = [select Id from Application_for_Conference_Adjudication__Share where ParentId in :app_ids and RowCause =: rowCauseShare];
+        if (delete_list != null && delete_list.size() > 0) {
+            delete delete_list;
+        }
+        // 鍐嶆柊澧�
+        if (insert_list != null && insert_list.size() > 0) {
+            insert insert_list;
+        }
+    }
+
+    public static String GetOfficeCategory(String OfficeCategory, Map<String, String> transferMap, BatchIF_Log__c iflog) {
+        if (String.isNotBlank(OfficeCategory)) {
+            List<String> categories = OfficeCategory.split(',');
+            if (categories != null && categories.size() > 0) {
+                return NFMUtil.getMapValue(transferMap, 'OfficeCategory__c', categories.get(0), iflog);
+            }
+        }
+        return null;
+    }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/NFM705RestTest.cls b/force-app/main/default/classes/NFM705RestTest.cls
index 7c29a2c..b87608c 100644
--- a/force-app/main/default/classes/NFM705RestTest.cls
+++ b/force-app/main/default/classes/NFM705RestTest.cls
@@ -9,35 +9,20 @@
         testLog.ErrorLog__c = '';
         testLog.MessageGroupNumber__c = '20211207';
         testLog.RowDataFlg__c = true;
-        testLog.Log__c = '[{"WorkshopPlace":"鏈潵鍩�","StateMaster":"璐靛窞","StartDate":"20221215","SponsorshipCategory":"鐧界粰","ProcessState": null ,"OfficeCategory":"1.娑堝寲绉�","Num":"MT-HB-202112-5773","Name":null,"MeetingType":"涓诲姙浼�","MeetingApprovedNo":null,"IsPaidToSponsor":"Y","HostName":"榛旇タ鍗楀窞涓尰闄�","EndDate":"20221216","CooperatorCompany":"鏈潵鍩�","ConveningParticipantsNum":50,"CityMaster":"璐甸槼","BudgetType":"鏂颁骇鍝佷笂甯�"}]';
+        testLog.Log__c = '[{"WorkshopPlace":"鏈濋槼","StateMaster":"鍖椾含甯�","StartDate":"2022-03-25T00:00:00","SponsorshipCategory":"","SharedEditing":"om002080,om003696,om001646","ProcessState":110,"OfficeCategory":"GI锛圡EBG锛�,ET锛圡EBG锛�,","Num":"","Name":"鑷富涓诲姙娲诲姩-SFDC娴嬭瘯0310","MeetingType":"绾夸笂+绾夸笅","MeetingApprovedNo":"ME154P03-0004","IsPaidToSponsor":"N","IsCoOrganizingActivities":"Y","HostName":"","ExpectedOlympusAttendance":10,"ExpectedHcpAttendance":2,"EndDate":"2022-03-30T00:00:00","CooperatorCompany":"","ConveningParticipantsNum":12,"CityMaster":"鍖椾含甯�","BudgetType":"鍏朵粬","Applicant":"om002021","ActivityTypeName":"鑷富涓诲姙娲诲姩"}]';
         //[Select Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, retry_cnt__c,NFM624_Secondary_processing__c  from BatchIF_Log__c where RowDataFlg__c = true and Id =: rowData_Id]
         insert testLog;
         NFM705Rest.main(testLog.Id);
     }
 
     static testMethod void testMethodTwo() {
-        BatchIF_Transfer__c transfer1 = new BatchIF_Transfer__c();
-        transfer1.Table__c = 'Application_for_Conference_Adjudication__c';
-        transfer1.Column__c = 'ProcessState__c';
-        transfer1.External_Value__c = '110';
-        transfer1.Internal_Value__c = '鑽夌';
-        transfer1.Dropped_Flag__c = false;
-        insert transfer1;
-
-        BatchIF_Transfer__c transfer2 = new BatchIF_Transfer__c();
-        transfer2.Table__c = 'Application_for_Conference_Adjudication__c';
-        transfer2.Column__c = 'IsPaidToSponsor__c';
-        transfer2.External_Value__c = 'Y';
-        transfer2.Internal_Value__c = '鏄�';
-        transfer2.Dropped_Flag__c = false;
-        insert transfer2;
 
         Test.startTest();
         
         RestRequest req = new RestRequest();
         RestResponse res = new RestResponse();
 
-        String JsonMsg = '{"Monitoring":{"TransmissionDateTime":"202107131529","Text":null,"Tag":null,"Sender":"OBPM","Receiver":"SFDC","NumberOfRecord":"2","MessageType":"NFM705","MessageGroupNumber":null},"GeData":[{"WorkshopPlace":"鏈潵鍩�","StateMaster":"璐靛窞","StartDate":"20251215","SponsorshipCategory":"鐧界粰","ProcessState":110,"OfficeCategory":"1.娑堝寲绉�","Num":null,"Name":"Test浼氳","MeetingType":"涓诲姙浼�","MeetingApprovedNo":"TEST997931","IsPaidToSponsor":"Y","HostName":"榛旇タ鍗楀窞涓尰闄�","EndDate":"20251216","CooperatorCompany":"鏈潵鍩�","ConveningParticipantsNum":50,"CityMaster":"瀹夐『","BudgetType":"鏂颁骇鍝佷笂甯�","ActivityTypeName":"鍡紵涔栦箹绔欏ソ锛�","ExpectedOlympusAttendance":50,"ExpectedHcpAttendance":100}]}';
+        String JsonMsg = '{"Monitoring":{"TransmissionDateTime":"202107131529","Text":null,"Tag":null,"Sender":"OBPM","Receiver":"SFDC","NumberOfRecord":"2","MessageType":"NFM705","MessageGroupNumber":null},"GeData":[{"WorkshopPlace":"鏈潵鍩�","StateMaster":"璐靛窞","StartDate":"20211215","SponsorshipCategory":"Y","ProcessState":110,"OfficeCategory":"1.娑堝寲绉�","Num":"MT-HB-202112-5773","Name":"Test浼氳","MeetingType":"涓诲姙浼�","MeetingApprovedNo":"TEST99793","IsPaidToSponsor":"鐧界粰","HostName":"榛旇タ鍗楀窞涓尰闄�","EndDate":"20211216","CooperatorCompany":"鏈潵鍩�","ConveningParticipantsNum":50,"CityMaster":"瀹夐『","BudgetType":"鏂颁骇鍝佷笂甯�","ActivityTypeName":"鍡紵涔栦箹绔欏ソ锛�","ExpectedOlympusAttendance":50,"ExpectedHcpAttendance":100}]}';
         req.requestURI = 'services/apexrest/NFM705/execute';
         req.httpMethod = 'POST';
         req.requestBody = Blob.valueof(JsonMsg);
diff --git a/force-app/main/default/classes/NFM707Rest.cls b/force-app/main/default/classes/NFM707Rest.cls
index f39685a..4b8fdd4 100644
--- a/force-app/main/default/classes/NFM707Rest.cls
+++ b/force-app/main/default/classes/NFM707Rest.cls
@@ -135,16 +135,19 @@
                 // if (campaignMap.size() > 0) {
                 //     update campaignMap.values();
                 // }
-                List<Campaign> camNoList = [select id,Num__c,MeetingApprovedNo__c,Meeting_Approved_No__c 
+                List<Campaign> camNoList = [select id,Num__c,MeetingApprovedNo__c,Meeting_Approved_No__c, CampaignStatus__c 
                                     from Campaign 
-                                    where MeetingApprovedNo__c in: camList];
+                                    where MeetingApprovedNo__c in: camList and CampaignStatus__c = '浼氳缁撴潫'];
                 if (camNoList != null && camNoList.size() > 0) {
+                    List<String> cam_ids = new List<String>();
                     for(Campaign cam : camNoList) {
+                        cam_ids.add(cam.id);
                         for (Result_for_Conference_Adjudication__c rca : rcaList) {
                             if (cam.Meeting_Approved_No__c == rca.Application_for_Conference_Adjudication__c) {
                                 // 鏇存柊浼氳鏃ョ▼
                                 cam.Meeting_Report__c = rca.Id;
                                 cam.Society_Hold_Place__c = rca.SocietyHoldPlace__c;
+                                cam.Competitor__c = rca.Competitor__c;
                                 // 鏇存柊鎶ュ憡鏃ユ湡鍜岀姸鎬�
                                 cam.Report_approved_day__c = Date.today();
                                 cam.Approved_day__c = Date.today();
@@ -154,6 +157,16 @@
                         }
                     }
                     update camNoList;
+
+                    // 鏇存柊OPD璁″垝
+                    List<OPDPlan__c> opdlist = [select id,status__c from OPDPlan__c WHERE OPDType__c = '瀛︿細' and status__c != '瀹屾瘯' and Campaign__c in: cam_ids];
+                    //灏哋PD璁″垝鐨勭姸鎬佹洿鏂颁负 瀹屾瘯
+                    if (opdlist != null && opdlist.size() > 0) {
+                        for (OPDPlan__c opdc : opdlist) {
+                            opdc.Status__c= '瀹屾瘯';
+                        }
+                        update opdlist;
+                    }
                 }
 	    	}
             logstr += '\nend';
diff --git a/force-app/main/default/classes/NFMUtil.cls b/force-app/main/default/classes/NFMUtil.cls
index f70f39d..0a73bdc 100644
--- a/force-app/main/default/classes/NFMUtil.cls
+++ b/force-app/main/default/classes/NFMUtil.cls
@@ -175,6 +175,9 @@
             NFM621_ENDPOINT = 'https://wdp.olympus.com.cn:44302/RESTAdapter/NFM621';
             NFM622_ENDPOINT = 'https://api-platform.olympuschina.com/prod-api/api/sso/sfdc_activitydata';
 
+            //鏍锋湰绠$悊
+            NFM115_ENDPOINT = 'https://wdp.olympus.com.cn:44302/RESTAdapter/NFM115';
+
             // 鏂版湇鍔$郴缁�
             AWS_DOMAIN = 'https://svc-elb.olympuschina.com';
 
@@ -1150,8 +1153,6 @@
         system.debug('resb:' + resb);
         return resb;
     }
-
-    
     //鍙戦�佺粰鍏遍�氬钩鍙� 绮剧悽鎶�鏈� thh 2021-09-22 end
     
     public static Integer ControllerUtil() {
diff --git a/force-app/main/default/classes/NewQuoteEntryController.cls b/force-app/main/default/classes/NewQuoteEntryController.cls
index 2547ecc..9228377 100644
--- a/force-app/main/default/classes/NewQuoteEntryController.cls
+++ b/force-app/main/default/classes/NewQuoteEntryController.cls
@@ -11,6 +11,8 @@
   //public Id qlistId { get; set; }
   //lastbuy  2022/2/9 fy start
   public Boolean filg { get; set; }
+  public Integer flglastbuy { get; set; }
+  public String errorProductmodel { get; set; }
   //lastbuy  2022/2/9 fy end
 
   public String excel_text { get; set; }
@@ -406,6 +408,8 @@
          ,PricebookEntry.Product2.Intra_Trade_Foreign_RMB__c
          //NoDiscount 閲戦锛圲SD锛�
          ,PricebookEntry.Product2.NoDiscount_Foreign__c 
+         //fy 棰勭暀浜у搧鏍囪瘑
+         ,PricebookEntry.Product2.LastbuyProductFLG__c
          ,Quote.Opportunity.Trade__c 
          //澶栬锤澶氬勾淇� 2021/01/04 绮剧悽鎶�鏈� wql end
 
@@ -902,6 +906,8 @@
                                //澶栬锤澶氬勾淇� 2021/01/04 绮剧悽鎶�鏈� wql start
                                //缁翠慨鍚堝悓鎶ヤ环锛圲SD锛�
                                ,Repair_Contract_USD__c
+                               //fy 棰勭暀浜у搧鏍囪瘑
+                               ,LastbuyProductFLG__c
                                //璁℃彁閲戦锛堜笉鍚◣锛孶SD锛�
                                ,Intra_Trade_Foreign_RMB__c
                                //NoDiscount 閲戦锛圲SD锛�
@@ -1781,9 +1787,20 @@
       errormessage = null;
       //20220214 fy lastbuy start 
       if(!ReservedProductVerification()){
-        errorflg = true;
-        errormessage =  '浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺' ;
-        return null;
+        system.debug('flglastbuy++++'+flglastbuy);
+        if(flglastbuy==1){
+          errorflg = true;
+          errormessage =  '棰勭暀浜у搧琛ㄤ腑娌℃湁褰曞叆璇ユ姤浠风殑棰勭暀浜у搧' ;
+          return null;
+        }else if(flglastbuy==2){
+          errorflg = true;
+          errormessage =  errorProductmodel+'浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺' ;
+          return null;
+        }else if(flglastbuy==3){
+          errorflg = true;
+          errormessage =  '棰勭暀浜у搧'+errorProductmodel+'鏈綍鍏ラ鐣欎骇鍝佽〃';
+          return null;
+        }
       }
       //20220214 fy lastbuy end
       // 2022-01-12 ssm 鎶ヤ环璁$畻check
@@ -2084,7 +2101,9 @@
       // 銇撱亾銈掍慨姝c仐銇熴倝銆丯FM007.trigger銈傝纰鸿獚
       prd2LatestValMap = new Map<Id, Product2>();
       integer cntPrd2 = 0;
-      for (Product2 prd2 : [Select Id, Estimation_Entry_Possibility__c, SFDA_Status__c, Packing_list_manual__c
+      for (Product2 prd2 : [Select Id, Estimation_Entry_Possibility__c, SFDA_Status__c, Packing_list_manual__c,
+      //fy 棰勭暀浜у搧鏍囪瘑
+      LastbuyProductFLG__c
                             From Product2 Where Id IN :product2Ids]) {
         cntPrd2 = cntPrd2   +   1;
         if (prd2.Estimation_Entry_Possibility__c != '鈼�') {
@@ -3122,31 +3141,82 @@
   }
   //lastbuy  2022/2/9 fy start
   public boolean ReservedProductVerification() {
+
     filg=true;
     Map<string,QuoteLineItem> quotlinitMap = new Map<string,QuoteLineItem>();
-    List<Id> lastProductFLGList = new List<Id>();
-    for(QELine qli : activities){
-      lastProductFLGList.add(qli.pageObject.PricebookEntry.Product2Id);
-      quotlinitMap.put(qli.pageObject.PricebookEntry.Product2Id,qli.pageObject);
+    List<Id> lastProductFLGListId = new List<Id>();
+    List<QuoteLineItem> lastProductFLGList = new List<QuoteLineItem>();
+    List<QuoteLineItem> act = new List<QuoteLineItem>();
+    List<QuoteLineItem> act2 = new List<QuoteLineItem>();
+    for(QELine aaa :activities){
+      if(aaa.pageObject.PricebookEntry.Product2Id!=null){
+        act.add(aaa.pageObject);
+      }
     }
-    System.debug('activities!!!'+activities);
+    act2=act.deepClone();
+    Map<String,QuoteLineItem> map1 = new Map<String,QuoteLineItem>();
+    System.debug('activities1111111111112涓烘墍褰撲负澶氬!!!'+activities);
+    integer i =0;
+    for(QuoteLineItem pspsc :act2){
+      if(pspsc.PricebookEntry.Product2Id!=null){
+        if(map1.containsKey(pspsc.PricebookEntry.Product2Id)){
+          QuoteLineItem quoteLine = map1.get(pspsc.PricebookEntry.Product2Id);
+          quoteLine.Quantity__c =quoteLine.Quantity__c+pspsc.Quantity__c;
+          map1.put(pspsc.PricebookEntry.Product2Id,quoteLine);
+        }else{
+          map1.put(pspsc.PricebookEntry.Product2Id,pspsc);
+        }
+        System.debug('34499879!!!'+activities);
+      }
+    }
+    System.debug('3434343!!!'+activities);
+    System.debug('5656565!!!'+map1);
+    for (QuoteLineItem value : map1.values()) {
+      if(value.PricebookEntry.Product2.LastbuyProductFLG__c){
+        lastProductFLGListId.add(value.PricebookEntry.Product2Id);
+        quotlinitMap.put(value.PricebookEntry.Product2Id,value);
+        lastProductFLGList.add(value);
+      }
+    }
+    System.debug('activities++++!!!'+activities);
+    System.debug('activities!!!'+map1.values());
     System.debug('oppId!!!'+oppId);
-    System.debug('lastProductFLGList!!!'+lastProductFLGList);
-    if(lastProductFLGList!=null){
-        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGList and effectiveFLG__c = true];
-        if(LastbuyObjList!=null){
-            for(LastbuyProduct__c lastbuypr :LastbuyObjList){
-              Decimal quoteLItemNum=0;
-              if(quotlinitMap.containsKey(lastbuypr.ProductName__c)){
-                  quoteLItemNum=quotlinitMap.get(lastbuypr.ProductName__c).Quantity__c;
-              }else{
-                  continue;
-              }
-              if(lastbuypr.LastbuyQuantity__c<quoteLItemNum){
-                filg=false;
-                break;
-              }
+    System.debug('lastProductFLGList!!!'+lastProductFLGListId);
+    if(lastProductFLGListId!=null&&lastProductFLGListId.size()!=0){
+        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGListId and effectiveFLG__c = true];
+        Map<string,LastbuyProduct__c> LastbuyObjMap = new Map<string,LastbuyProduct__c>();
+        System.debug('LastbuyObjList+++++!!!'+LastbuyObjList);
+        if(LastbuyObjList!=null&&LastbuyObjList.size()!=0){
+          for(LastbuyProduct__c lastbuypr :LastbuyObjList){
+            LastbuyObjMap.put(lastbuypr.ProductName__c,lastbuypr);
+          }
+        }else{
+          flglastbuy=1;
+          filg=false;
+          return filg;
+        }
+        System.debug('LastbuyObjMap!!!'+LastbuyObjMap);
+        System.debug('lastProductFLGList+++++++!!!'+lastProductFLGList);
+        if(lastProductFLGList!=null&&lastProductFLGList.size()!=0){
+          for(QuoteLineItem lastbuypr :lastProductFLGList){
+            Decimal quoteLItemNum=0;
+            if(LastbuyObjMap.containsKey(lastbuypr.PricebookEntry.Product2Id)){
+                quoteLItemNum=LastbuyObjMap.get(lastbuypr.PricebookEntry.Product2Id).LastbuyQuantity__c;
+                System.debug('quoteLItemNum!!!'+quoteLItemNum);
+                System.debug('lastbuypr.pageObject.Quantity__c+++!!!'+lastbuypr.Quantity__c);
+                if(lastbuypr.Quantity__c>quoteLItemNum){
+                  errorProductmodel=lastbuypr.Asset_Model_No__c;
+                  flglastbuy=2;
+                  filg=false;
+                  break;
+                }
+            }else{
+              errorProductmodel=lastbuypr.Asset_Model_No__c;
+              flglastbuy=3;
+              filg=false;
+              break;
             }
+          }
         }
     }
     system.debug('filg====='+filg);
diff --git a/force-app/main/default/classes/NewQuoteIraiController.cls b/force-app/main/default/classes/NewQuoteIraiController.cls
index 6524d45..066627e 100644
--- a/force-app/main/default/classes/NewQuoteIraiController.cls
+++ b/force-app/main/default/classes/NewQuoteIraiController.cls
@@ -8,6 +8,12 @@
     public Boolean productStatusUpdated {get;set;}               // 鐘舵厠鏇存柊銆亄!$Label.Status_Update} 銈掓娂涓嬨仐銇熴亱銇┿亞銇�
     public Boolean changedAfterPrint {get;set;}                  // true 銇牬鍚堛�佺敾闈€伀 confirm 銉°儍銈汇兗銈搞亴琛ㄧず銇椼伨銇欍�俼uoId銈掓柊銇椼亜insert銆傚垽瀹氥伅js銇仸瀹熸柦
 
+    //lastbuy  2022/3/10 fy start
+    public Boolean filg { get; set; }
+    public Integer flglastbuy { get; set; }
+    public String errorProductmodel { get; set; }
+    //lastbuy  2022/3/10 fy end
+
     public String excel_text {get;set;}
     public Integer select_index {get;set;}                       // excelImport灏傜敤銇с仚銇屻�乯s銇仸鍒跺尽銇欍倠銇撱仺銇仾銈嬨伄銇с�乀ODO katsu 鍓婇櫎浜堝畾
     public String Product_text {get;set;}
@@ -1160,6 +1166,23 @@
     }
 
     public boolean dataCheck(){
+         //20220310 fy lastbuy start 
+      if(!ReservedProductVerification()){
+        if(flglastbuy==1){
+          errorflg = true;
+          errormessage =  '棰勭暀浜у搧琛ㄤ腑娌℃湁褰曞叆璇ユ姤浠风殑棰勭暀浜у搧' ;
+          return false;
+        }else if(flglastbuy==2){
+          errorflg = true;
+          errormessage =  errorProductmodel+'浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺' ;
+          return false;
+        }else if(flglastbuy==3){
+          errorflg = true;
+          errormessage =  '棰勭暀浜у搧'+errorProductmodel+'鏈綍鍏ラ鐣欎骇鍝佽〃';
+          return false;
+        }
+      }
+      //20220310 fy lastbuy end
         system.debug('鈼嬧棆鈼嬧棆鈼嬧棆鈼嬧棆鈼嬧棆鈼嬧棆Welcome to dataCheck class!!鈼嬧棆鈼嬧棆鈼嬧棆鈼嬧棆鈼嬧棆鈼嬧棆');
         errorflg = false;
         errormessage = null;
@@ -1399,6 +1422,92 @@
 
         return true;
     }
+     //lastbuy  2022/3/10 fy start
+  public boolean ReservedProductVerification() {
+
+    filg=true;
+    Map<string,QuoteIraiLineItem__c> quotlinitMap = new Map<string,QuoteIraiLineItem__c>();
+    List<Id> lastProductFLGListId = new List<Id>();
+    List<QuoteIraiLineItem__c> lastProductFLGList = new List<QuoteIraiLineItem__c>();
+    List<QuoteIraiLineItem__c> act = new List<QuoteIraiLineItem__c>();
+    List<QuoteIraiLineItem__c> act2 = new List<QuoteIraiLineItem__c>();
+    for(QELine aaa :activities){
+      if(aaa.pageObject.Product2__c!=null&&aaa.pageObject.Quantity__c!=null){
+        act.add(aaa.pageObject);
+      }
+    }
+    act2=act.deepClone();
+    Map<String,QuoteIraiLineItem__c> map1 = new Map<String,QuoteIraiLineItem__c>();
+    System.debug('activities1111111111112涓烘墍褰撲负澶氬!!!'+activities);
+    integer i =0;
+    for(QuoteIraiLineItem__c pspsc :act2){
+      if(pspsc.Product2__c!=null&&pspsc.Quantity__c!=null){
+        if(map1.containsKey(pspsc.Product2__c)){
+            QuoteIraiLineItem__c quoteLine = map1.get(pspsc.Product2__c);
+          quoteLine.Quantity__c =quoteLine.Quantity__c+pspsc.Quantity__c;
+          map1.put(pspsc.Product2__c,quoteLine);
+          System.debug('2222222!!!'+quoteLine);
+        }else{
+          map1.put(pspsc.Product2__c,pspsc);
+        }
+        System.debug('5555555!!!'+pspsc);
+        System.debug('34499879!!!'+activities);
+      }
+    }
+    System.debug('3434343!!!'+activities);
+    System.debug('5656565!!!'+map1);
+    for (QuoteIraiLineItem__c value : map1.values()) {
+      if(value.Product2__r.LastbuyProductFLG__c){
+        lastProductFLGListId.add(value.Product2__c);
+        quotlinitMap.put(value.Product2__c,value);
+        lastProductFLGList.add(value);
+      }
+    }
+    System.debug('activities++++!!!'+activities);
+    System.debug('activities!!!'+map1.values());
+    System.debug('oppId!!!'+oppId);
+    System.debug('lastProductFLGList!!!'+lastProductFLGListId);
+    if(lastProductFLGListId!=null&&lastProductFLGListId.size()!=0){
+        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGListId and effectiveFLG__c = true];
+        Map<string,LastbuyProduct__c> LastbuyObjMap = new Map<string,LastbuyProduct__c>();
+        System.debug('LastbuyObjList+++++!!!'+LastbuyObjList);
+        if(LastbuyObjList!=null&&LastbuyObjList.size()!=0){
+          for(LastbuyProduct__c lastbuypr :LastbuyObjList){
+            LastbuyObjMap.put(lastbuypr.ProductName__c,lastbuypr);
+          }
+        }else{
+          flglastbuy=1;
+          filg=false;
+          return filg;
+        }
+        System.debug('LastbuyObjMap!!!'+LastbuyObjMap);
+        System.debug('lastProductFLGList+++++++!!!'+lastProductFLGList);
+        if(lastProductFLGList!=null&&lastProductFLGList.size()!=0){
+          for(QuoteIraiLineItem__c lastbuypr :lastProductFLGList){
+            Decimal quoteLItemNum=0;
+            if(LastbuyObjMap.containsKey(lastbuypr.Product2__c)){
+                quoteLItemNum=LastbuyObjMap.get(lastbuypr.Product2__c).LastbuyQuantity__c;
+                System.debug('quoteLItemNum!!!'+quoteLItemNum);
+                System.debug('lastbuypr.pageObject.Quantity__c+++!!!'+lastbuypr.Quantity__c);
+                if(lastbuypr.Quantity__c>quoteLItemNum){
+                  errorProductmodel=lastbuypr.Asset_Model_No__c;
+                  flglastbuy=2;
+                  filg=false;
+                  break;
+                }
+            }else{
+              errorProductmodel=lastbuypr.Asset_Model_No__c;
+              flglastbuy=3;
+              filg=false;
+              break;
+            }
+          }
+        }
+    }
+    system.debug('filg====='+filg);
+    return filg;
+  }
+
     // CHAN-BJQ4VZ 绮剧悽鎶�鏈� 2019/12/11 Start
     public class QuoteBean {
     // 浜у搧鏍囧噯瀹氫环鎬婚
diff --git a/force-app/main/default/classes/OFSCalendarController.cls b/force-app/main/default/classes/OFSCalendarController.cls
index 5d7d576..0e5b7a6 100644
--- a/force-app/main/default/classes/OFSCalendarController.cls
+++ b/force-app/main/default/classes/OFSCalendarController.cls
@@ -17,7 +17,7 @@
     static {
         at2CnMap = new Map<String, String>();
         at2CnMap.put('鐥呴櫌', '鐢ㄦ埛鎷滆');
-        at2CnMap.put('璨╁2搴�', '缁忛攢鍟嗘嫓璁�');
+        at2CnMap.put('璨╁2搴�', '缁忛攢鍟嗘敮鎸�');
         at2CnMap.put('绀惧唴娲诲嫊', '鍏徃宸ヤ綔');
         at2CnMap.put('绀惧銈ゃ儥銉炽儓', '绀惧浼氳');
         at2CnMap.put('绉诲嫊', '绉诲姩');
@@ -388,7 +388,7 @@
         private String at2Css(String at2) {
             String at2Css = 'fc-event';     // default
             if (at2 == '鐢ㄦ埛鎷滆') { at2Css = 'fc-eventH'; }
-            else if (at2 == '缁忛攢鍟嗘嫓璁�') { at2Css = 'fc-eventA'; }
+            else if (at2 == '缁忛攢鍟嗘敮鎸�') { at2Css = 'fc-eventA'; }
             else if (at2 == '鍏徃宸ヤ綔') { at2Css = 'fc-eventI'; }
             else if (at2 == '绀惧浼氳') { at2Css = 'fc-eventC'; }
             else if (at2 == '绉诲姩') { at2Css = 'fc-eventM'; }
diff --git a/force-app/main/default/classes/OrderListHandlerTest.cls b/force-app/main/default/classes/OrderListHandlerTest.cls
index 743a01c..2abf4f0 100644
--- a/force-app/main/default/classes/OrderListHandlerTest.cls
+++ b/force-app/main/default/classes/OrderListHandlerTest.cls
@@ -2,7 +2,7 @@
 private class OrderListHandlerTest {
     static testMethod void testMethod1(){
         Sample_order_list__c sorl = new Sample_order_list__c();
-        sorl.Name = '123';
+        // sorl.Name = '123';
         sorl.Status__c = '鏆傚瓨';
         insert sorl;
         sorl.Status__c = '璁㈠崟宸插彂閫�';
@@ -11,7 +11,7 @@
 
     static testMethod void testMethod2(){
         Sample_order_list__c sorl = new Sample_order_list__c();
-        sorl.Name = '123';
+        // sorl.Name = '123';
         sorl.Status__c = '璁㈠崟宸插彂閫�';
         insert sorl;
     }
diff --git a/force-app/main/default/classes/OrdergoodsControllerTest.cls b/force-app/main/default/classes/OrdergoodsControllerTest.cls
index bb822aa..518d1bf 100644
--- a/force-app/main/default/classes/OrdergoodsControllerTest.cls
+++ b/force-app/main/default/classes/OrdergoodsControllerTest.cls
@@ -7,6 +7,10 @@
         if (rectCo.size() == 0) {
             throw new ControllerUtil.myException('not found 鍔炰簨澶� recodetype');
         }
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         // 瀹㈡埛
         Account account = new Account();
         account.RecordTypeId = rectCo[0].Id;
@@ -14,6 +18,7 @@
         account.Name = 'Katsu 銉嗐偣銉�';
         account.Quolified_Approve_Status__c = 'Draft';
         account.If_Need_Quolified__c = true;
+        account.ParentId = account2.Id;
         insert account;
 
         Product2 product = new Product2();
@@ -147,12 +152,17 @@
             throw new ControllerUtil.myException('not found 鍔炰簨澶� recodetype');
         }
         // 瀹㈡埛
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         Account account = new Account();
         account.RecordTypeId = rectCo[0].Id;
         account.Phone = '13888888888';
         account.Name = 'Katsu 銉嗐偣銉�';
         account.Quolified_Approve_Status__c = 'Draft';
         account.If_Need_Quolified__c = true;
+        account.ParentId = account2.Id;
         insert account;
         //鏌ヤ笉鍑轰换浣曟牱鏈搧,SFDA_Status__c浼氳瑙﹀彂鍣ㄤ慨鏀逛负鍋滄
         Product2 product = new Product2();
diff --git a/force-app/main/default/classes/PersonalCalendarController.cls b/force-app/main/default/classes/PersonalCalendarController.cls
index 9a3edbb..2ce58f6 100644
--- a/force-app/main/default/classes/PersonalCalendarController.cls
+++ b/force-app/main/default/classes/PersonalCalendarController.cls
@@ -19,7 +19,7 @@
     static {
         at2CnMap = new Map<String, String>();
         at2CnMap.put('鐥呴櫌', '鐢ㄦ埛鎷滆');
-        at2CnMap.put('璨╁2搴�', '缁忛攢鍟嗘嫓璁�');
+        at2CnMap.put('璨╁2搴�', '缁忛攢鍟嗘敮鎸�');
         at2CnMap.put('绀惧唴娲诲嫊', '鍏徃宸ヤ綔');
         at2CnMap.put('绀惧銈ゃ儥銉炽儓', '绀惧浼氳');
         at2CnMap.put('绉诲嫊', '绉诲姩');
@@ -708,7 +708,7 @@
         private String at2Css(String at2) {
             String at2Css = 'fc-event';     // default
             if (at2 == '鐢ㄦ埛鎷滆') { at2Css = 'fc-eventH'; }
-            else if (at2 == '缁忛攢鍟嗘嫓璁�') { at2Css = 'fc-eventA'; }
+            else if (at2 == '缁忛攢鍟嗘敮鎸�') { at2Css = 'fc-eventA'; }
             else if (at2 == '鍏徃宸ヤ綔') { at2Css = 'fc-eventI'; }
             else if (at2 == '绀惧浼氳') { at2Css = 'fc-eventC'; }
             else if (at2 == '绉诲姩') { at2Css = 'fc-eventM'; }
diff --git a/force-app/main/default/classes/QuotePDFExtensionController.cls b/force-app/main/default/classes/QuotePDFExtensionController.cls
index cdfba08..2b9a22e 100644
--- a/force-app/main/default/classes/QuotePDFExtensionController.cls
+++ b/force-app/main/default/classes/QuotePDFExtensionController.cls
@@ -377,7 +377,7 @@
                                            , Quote.Opportunity.DecideQuoteDate__c, Quote.Opportunity.Estimation_Decision__c
                                            // Gzw 澶氬勾淇濅慨 End
                                            //lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  start
-                                           ,PricebookEntry.Product2.DeliveryDate__c
+                                           ,DeliveryDate__c
                                            //lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  end
                                       FROM QuoteLineItem
                                      WHERE QuoteId = :nowId
diff --git a/force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls b/force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls
index ece79ad..54058dc 100644
--- a/force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls
+++ b/force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls
@@ -2879,6 +2879,13 @@
     protected override void beforeUpdate() {
         if(!disabled){
             beforeSetValue();
+
+            // 涓嶅お纭畾姝ゅ鐞嗕細瀵瑰叾浠栧鐞嗘湁浠�涔堝奖鍝嶏紝闃叉鐢熶骇鐜鍙戠敓闂锛岀敤姝ゆ爣绛炬帶鍒�
+            // 绛夌‘璁ゆ病闂鍚庯紝鍦ㄥ垹闄�(Todo)
+            if (System.Label.Set_Queue_UniqueKey == 'TRUE') {
+                // 璁惧�兼帓闃熺殑UniqueKey
+                setUniqueKeyQueue();
+            }
         }
     }
     protected override void afterInsert() {
@@ -4602,6 +4609,30 @@
 
     }
 
+    private void setUniqueKeyQueue(){
+        Map<Id, Rental_Apply_Equipment_Set_Detail__c> olddetailMap = (Map<Id, Rental_Apply_Equipment_Set_Detail__c>) Trigger.oldMap;
+
+        for(Rental_Apply_Equipment_Set_Detail__c newdetail : (List<Rental_Apply_Equipment_Set_Detail__c>)trigger.new){
+            Rental_Apply_Equipment_Set_Detail__c olddetail = olddetailMap.get(newdetail.Id);
+            
+            if((olddetail.Queue_Number__c > 0  && newdetail.Queue_Number__c == 0)// 鏆傚畾鍒嗛厤
+                || (!olddetail.Cancel_Select__c && newdetail.Cancel_Select__c && olddetail.Queue_Number__c > 0)  //鍙栨秷(鎺掗槦涓紝鏆傚畾鍒嗛厤)
+                || (olddetail.Queue_Number__c > 0  && newdetail.Queue_Number__c == null )//鍒嗗崟
+                ){
+                // 娓呯┖鎺掗槦鐨刄niqueKey
+                newdetail.UniqueKey_Queue__c = null;
+            }
+
+            // 閲嶆帓鎴栬�呮帓闃烴o鍙樺寲鏃舵洿鏂�
+            if (!newdetail.Cancel_Select__c && newdetail.Queue_Number__c > 0 && newdetail.ExternalKey__c != null
+                && (newdetail.Queue_Number__c != olddetail.Queue_Number__c
+                    || newdetail.ExternalKey__c != olddetail.ExternalKey__c)) {
+                // 鎺掗槦鐨刄niqueKey璁惧��
+                newdetail.UniqueKey_Queue__c = newdetail.ExternalKey__c + ':' + newdetail.Queue_Number__c;
+            }
+        }
+    }
+
     /*
     private void reQueueNumber() {
         Map<String, List<Rental_Apply_Equipment_Set_Detail__c>> queueRaesdMap = new Map<String, List<Rental_Apply_Equipment_Set_Detail__c>>();
diff --git a/force-app/main/default/classes/RentalApplySplitController.cls b/force-app/main/default/classes/RentalApplySplitController.cls
index dd43d80..e796e44 100644
--- a/force-app/main/default/classes/RentalApplySplitController.cls
+++ b/force-app/main/default/classes/RentalApplySplitController.cls
@@ -565,8 +565,8 @@
                 cloneOPD.Status__c = '璁″垝涓�';
                 FixtureUtil.withoutInsert(new OPDPlan__c[]{cloneOPD});
                 cloneRas.OPDPlan__c = cloneOPD.Id;
-                cloneRas.ApprovedNo_Create__c = cloneOPD.Approved_No__c; // 20220218 ljh add 鍐宠
-                cloneRas.Approved_State_Create__c = cloneOPD.Approved_Status__c; // 20220218 ljh add 鍐宠
+                // cloneRas.ApprovedNo_Create__c = cloneOPD.Approved_No__c; // 20220218 ljh add 鍐宠
+                // cloneRas.Approved_State_Create__c = cloneOPD.Approved_Status__c; // 20220218 ljh add 鍐宠
                 // List<Plan_Rental_Equipment__c> inPreList = new List<Plan_Rental_Equipment__c>();
                 // for(Plan_Rental_Equipment__c pre0 : [SELECT Id, Campaign__c,Event_ID__c,RecordTypeId,Name,Rental_Equipment__c,Rental_Quantity__c FROM Plan_Rental_Equipment__c WHERE OPD_Plan__c = :opdList[0].Id]){
                 //     Plan_Rental_Equipment__c pre = new Plan_Rental_Equipment__c();
@@ -734,6 +734,8 @@
                     Post_Code__c,                    // 閭紪
                     ApprovedNo_Delivery__c,          // 鍐宠缂栧彿锛堝彂璐ф椂锛� 20220224 ljh add
                     Approved_State_Delivery__c,      // 鍐宠鐘舵�侊紙鍙戣揣鏃讹級20220224 ljh add 
+                    ApprovedNo_Create__c,            // 鍐宠缂栧彿锛堝垱寤烘椂锛� 20220301 ljh add
+                    Approved_State_Create__c,        // 鍐宠鐘舵�侊紙鍒涘缓鏃讹級 20220301 ljh add
                     Response__c,                     // 搴旂瓟娌熼��
                     Request_demo_time__c,            // 鐢宠鏃堕棿
                     Request_approval_time__c,        // 鎵瑰噯鏃堕棿锛堢敵璇锋彁浜ゆ椂闂达級
diff --git a/force-app/main/default/classes/RentalApplyWebService.cls b/force-app/main/default/classes/RentalApplyWebService.cls
index 15d4306..9bde9c4 100644
--- a/force-app/main/default/classes/RentalApplyWebService.cls
+++ b/force-app/main/default/classes/RentalApplyWebService.cls
@@ -411,6 +411,7 @@
             return '鏈慨鐞嗗綊杩樻棩涓嶄负绌猴紝涓嶈兘鍋氬嚭搴撴寚绀�';
         }
 //*************************Insert 20160826 SWAG-AD59Z6 瓒欏境鑺� End***************************//
+
         //1388 yc 20211021 璺ㄥ尯鍩熷垎閰嶄笉鑳藉嚭搴� start
         if(String.isNotBlank(ra.Cross_Region_Assign__c)){
         	String soql = 'select Id, Name,Rental_Apply__c,Internal_asset_location_before__c';
@@ -1158,7 +1159,7 @@
 //    }
     // 鍒嗛厤楠岃瘉
     Webservice static String AssignBtn(String Rid){
-        List<Rental_Apply__c> raList = [select demo_purpose2__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,repair__r.Repair_Final_Inspection_Date__c,repair__r.Return_Without_Repair_Date__c,Campaign__c,Campaign__r.Status,Repair__r.Repair_Shipped_Date__c   from Rental_Apply__c where id = :Rid];
+        List<Rental_Apply__c> raList = [select demo_purpose2__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,repair__r.Repair_Final_Inspection_Date__c,repair__r.Return_Without_Repair_Date__c,Campaign__c,Campaign__r.Status,Repair__r.Repair_Shipped_Date__c,Campaign__r.IF_Approved__c,Campaign__r.Meeting_Approved_No__c   from Rental_Apply__c where id = :Rid];
         // 20210803 ljh  SFDC-C5HDC7 add 鏌ヨ娣诲姞 Campaign__c,Campaign__r.Status,Repair__r.Repair_Shipped_Date__c 
         if(raList.size()>0){
             Rental_Apply__c Ra = raList[0];
@@ -1180,6 +1181,9 @@
            }else if(Ra.demo_purpose2__c=='绱㈣禂QIS' && Ra.next_action__c=='鏃犲伩鏇存崲' && Ra.QIS_number__r.ReplaceDeliveryDate__c!= null){
 	            return '绱㈣禂QIS鐩殑锛孮IS宸叉湁鏂板搧鍙戣揣鏃ワ紝涓嶅彲鍒嗛厤';
            }//1822 yc 20211108 end
+           else if(Ra.Campaign__r.IF_Approved__c && Ra.Campaign__r.Meeting_Approved_No__c == null){
+                return '宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖';
+           }//20220301 sx obpm淇敼
            else{
                 return 'Fin';
             } 
@@ -1613,6 +1617,9 @@
                 //搴旇涓嶄細鍒拌繖閲�
                 return '娌℃湁鍙互鍑哄簱鎸囩ず鐨勪竴瑙�';
             }
+
+
+
         }
         String soql = 'SELECT Id'
                 + ' FROM Rental_Apply_Equipment_Set__c '
diff --git a/force-app/main/default/classes/RentalFixtureSetAssignAgencyControTest.cls b/force-app/main/default/classes/RentalFixtureSetAssignAgencyControTest.cls
index 46684e3..83caace 100644
--- a/force-app/main/default/classes/RentalFixtureSetAssignAgencyControTest.cls
+++ b/force-app/main/default/classes/RentalFixtureSetAssignAgencyControTest.cls
@@ -74,7 +74,7 @@
 
         // 浜у搧
         Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI',
-                Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',
+                Fixture_Model_No__c='modlen01',Serial_Lot_No__c='S/N tracing',
                 Fixture_Model_No_T__c = 'n01', Asset_Model_No__c = 'Pro1',
                 ProductCode_Ext__c='pc01',Manual_Entry__c=false);
         Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI',
@@ -188,7 +188,7 @@
         Fixture_Set__c fsObj1 = new Fixture_Set__c();
         //fsObj1.Name = 'set1';
         fsObj1.Name = 'n01';
-        fsObj1.Fixture_Set_Body_Model_No__c = 'n01';
+        fsObj1.Fixture_Set_Body_Model_No__c = 'modlen01';
         fsObj1.Loaner_name__c = 'name1';
         insert fsObj1;
 
@@ -367,7 +367,29 @@
             raesdObj3.Product_category_text__c = 'GI';
             raesdObj3.Equipment_Type_text__c = '浜у搧璇曠敤';
             raesdObj3.Cancel_Select__c=false;
-            insert new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3};
+
+            Rental_Apply_Equipment_Set_Detail__c raesdObj4 = new Rental_Apply_Equipment_Set_Detail__c();
+            raesdObj4.Rental_Apply__c = raObj.Id;        //raesdObj3.Asset__c = asset3.Id;
+            raesdObj4.Fixture_Set_Detail__c = fsdObjA3.Id;
+            raesdObj4.Rental_Num__c = 1;
+            raesdObj4.Queue_Number__c = null;
+            raesdObj4.Is_Body__c = false;
+            raesdObj4.Rental_Apply_Equipment_Set__c = raesObj.Id;
+            raesdObj4.IndexFromUniqueKey__c = 4;
+            raesdObj4.UniqueKey__c = '1:'+ raesObj.Id + ':' + fsdObjA3.Id + ':4';
+            raesdObj4.FSD_OneToOneAccessory_Cnt__c = 2;
+            raesdObj4.FSD_Is_Optional__c = false;
+            raesdObj4.FSD_Is_OneToOne__c = false;
+            raesdObj4.ApplyPersonAppended__c = false;
+            raesdObj4.FSD_Fixture_Model_No__c = 'n04';
+            raesdObj4.Fixture_Model_No_text__c = 'n04';
+            raesdObj4.Salesdepartment_before__c = '1.鍗庡寳钀ヤ笟鏈儴';
+            raesdObj4.Internal_asset_location_before__c = '鍖椾含 澶囧搧涓績';
+            raesdObj4.Product_category_text__c = 'GI';
+            raesdObj4.Equipment_Type_text__c = '浜у搧璇曠敤';
+            raesdObj4.Cancel_Select__c=true;
+            raesdObj4.Cancel_Reason__c= '涓诲姩鍙栨秷';
+            insert new Rental_Apply_Equipment_Set_Detail__c[] {raesdObj1,raesdObj2,raesdObj3,raesdObj4};
 
             // 鐢宠鍗曞彉涓哄凡鎵瑰噯
             raObj.Status__c = '宸叉壒鍑�';
@@ -458,6 +480,33 @@
 
         System.assertEquals(false, controller.done_flg);
         System.debug('init Success');
+
+    }
+
+    @isTest
+    public static void test_cancelSet3() {
+
+        List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
+
+        PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        Test.setCurrentPage(ref);
+
+        RentalFixtureSetAssignAgencyController controller = new RentalFixtureSetAssignAgencyController();
+        Test.startTest();
+
+        controller.init();
+        controller.esdList[0].checked = false;
+        // 20210916 ljh update start
+        // controller.cancelReason = '涓诲姩鍙栨秷';
+        // controller.cancelReasonRemark = 'aaaa';
+        controller.parentObj.Cancel_Reason__c = '涓诲姩鍙栨秷';
+        controller.parentObj.Loaner_cancel_reason__c = '閲嶅鐢宠';
+        // 20210916 ljh update end
+        controller.cancelSet();
+        Test.stopTest();
+
+        //System.assertEquals(true, controller.done_flg);
+        //System.debug('init Success');
 
     }
 
@@ -621,95 +670,11 @@
         System.debug('init Success');
     }
 
-     //20210521 ljh add 1829 start
-    @isTest
-    public static void test_assignSub() {
+     @isTest
+    public static void test_assign() {
+
         changeData();
 
-        List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
-
-        PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
-        Test.setCurrentPage(ref);
-
-        RentalFixtureSetAssignAgencyController controller = new RentalFixtureSetAssignAgencyController();
-        Test.startTest();
-
-        controller.init();
-        // 绗竴娆″垎閰�
-        controller.esdList[0].checked = true;
-        controller.parentObj.Asset_loaner_start_day__c = Date.today()+1;//20210513 ljh update
-        controller.applyDate();
-        controller.stepName = '鍒嗛厤';
-
-        controller.qrcode = '511100000;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c;
-        controller.scanAndMatch();
-        controller.assign();
-
-        // controller.stepName = '涓嬫灦';
-        // controller.esdList[0].checked = true;
-        // controller.stockDown();// 20210624 ljh update SFDC-C448GR
-
-        ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
-        controller = new RentalFixtureSetAssignAgencyController();
-        // 涓嬫灦鍚庨噸鏂板垎閰�
-        controller.init();
-        controller.stepName = '鍒嗛厤';
-        controller.esdList[0].checked = true;
-        controller.qrcode = '51110001;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c;
-        controller.scanAndMatch();
-        controller.assign();
-
-        Test.stopTest();
-
-        //System.assertEquals(true, controller.done_flg);
-        System.debug('init Success');
-    }
-
-
-     @isTest
-    public static void test_assignSub3() {
-
-        List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
-
-        PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
-        Test.setCurrentPage(ref);
-
-        RentalFixtureSetAssignAgencyController controller = new RentalFixtureSetAssignAgencyController();
-        Test.startTest();
-
-        controller.init();
-        // 绗竴娆″垎閰�
-        controller.esdList[0].checked = true;
-        controller.parentObj.Asset_loaner_start_day__c = Date.today()+1;//20210513 ljh update
-        controller.applyDate();
-        controller.stepName = '鍒嗛厤';
-
-        controller.qrcode = '511100000;2;'+controller.esdList[1].rec.Rental_Apply_Equipment_Set__c;
-        controller.scanAndMatch();
-        controller.assign();
-
-        // controller.stepName = '涓嬫灦';
-        // controller.esdList[0].checked = true;
-        // controller.stockDown();// 20210624 ljh update SFDC-C448GR
-
-        ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
-        controller = new RentalFixtureSetAssignAgencyController();
-        // 涓嬫灦鍚庨噸鏂板垎閰�
-        controller.init();
-        controller.stepName = '鍒嗛厤';
-        controller.esdList[0].checked = true;
-        controller.qrcode = '51110001;2;'+controller.esdList[2].rec.Rental_Apply_Equipment_Set__c;
-        controller.scanAndMatch();
-        controller.assign();
-
-        Test.stopTest();
-
-        //System.assertEquals(true, controller.done_flg);
-        System.debug('init Success');
-    }
-    
-    @isTest
-    public static void test_assign() {
         List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
 
         PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
@@ -752,6 +717,156 @@
         System.debug('init Success');
     }
 
+     //20210521 ljh add 1829 start
+    @isTest
+    public static void test_assignSub() {
+        List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
+
+        PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        Test.setCurrentPage(ref);
+        List<Rental_Apply_Equipment_Set__c> raesone=[select Id from Rental_Apply_Equipment_Set__c];
+        RentalFixtureSetAssignAgencyController controller = new RentalFixtureSetAssignAgencyController();
+        Test.startTest();
+
+        controller.init();
+        // 绗竴娆″垎閰�
+        controller.esdList[0].checked = true;
+        controller.parentObj.Asset_loaner_start_day__c = Date.today()+1;//20210513 ljh update
+        controller.applyDate();
+        controller.stepName = '鍒嗛厤';
+
+        controller.qrcode = '511100000;2;'+controller.esdList[1].rec.Rental_Apply_Equipment_Set__c;
+        //controller.qrcode = '511100000;2;'+raesone[0].Id;
+        controller.scanAndMatch();
+        controller.assign();
+
+        // controller.stepName = '涓嬫灦';
+        // controller.esdList[0].checked = true;
+        // controller.stockDown();// 20210624 ljh update SFDC-C448GR
+
+        ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        controller = new RentalFixtureSetAssignAgencyController();
+        // 涓嬫灦鍚庨噸鏂板垎閰�
+        controller.init();
+        controller.stepName = '鍒嗛厤';
+        controller.esdList[0].checked = false;
+        //controller.qrcode = '511100000;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c;
+        controller.qrcode = '511100000;2;'+raesone[0].Id;
+        controller.scanAndMatch();
+        controller.assign();
+
+        Test.stopTest();
+
+        //System.assertEquals(true, controller.done_flg);
+        System.debug('init Success');
+    }
+
+  @isTest
+    public static void test_assignSub03() {
+
+        List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
+
+        PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        Test.setCurrentPage(ref);
+
+        RentalFixtureSetAssignAgencyController controller = new RentalFixtureSetAssignAgencyController();
+        Test.startTest();
+
+        controller.init();
+        // 绗竴娆″垎閰�
+        controller.esdList[0].checked = true;
+        controller.parentObj.Asset_loaner_start_day__c = Date.today()+1;//20210513 ljh update
+        controller.applyDate();
+        controller.stepName = '鍒嗛厤';
+
+        controller.qrcode = '511100000;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c;
+        controller.scanAndMatch();
+        controller.assign();
+
+        // controller.stepName = '涓嬫灦';
+        // controller.esdList[0].checked = true;
+        // controller.stockDown();// 20210624 ljh update SFDC-C448GR
+
+        ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        Test.setCurrentPage(ref);
+        controller = new RentalFixtureSetAssignAgencyController();
+        // 涓嬫灦鍚庨噸鏂板垎閰�
+        controller.init();
+        controller.stepName = '鍒嗛厤';
+        controller.esdList[0].checked = true;
+        controller.qrcode = '51110001;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c;
+        List<Asset> mainAssetList = [
+                SELECT Id
+                     , Fixture_Model_No_F__c
+                     , Internal_asset_location__c
+                     , SerialNumber
+                     , Salesdepartment__c
+                     , SalesProvince__c
+                     , Product_category__c
+                     , Equipment_Type__c
+                     , Internal_Asset_number_key__c
+                  FROM Asset
+                 WHERE Fixture_QRCode__c ='51110001'
+                   //AND Main_OneToOne__c = true //20210508 ljh add 1834
+                   AND You_Xiao_Ku_Cun__c > 0
+                 LIMIT 1
+        ];
+        List<Product2> pro2l=[select id from Product2 where  Fixture_Model_No_T__c != 'n01'];
+        mainAssetList[0].Product2=pro2l[0];
+        update mainAssetList;
+        controller.scanAndMatch();
+        controller.assign();
+        Test.stopTest();
+        //System.assertEquals(true, controller.done_flg);
+        System.debug('init Success');
+    }
+
+
+     @isTest
+    public static void test_assignSub04() {
+        List<Rental_Apply__c> esList = [SELECT Id FROM Rental_Apply__c];
+
+        PageReference ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        Test.setCurrentPage(ref);
+        List<Rental_Apply_Equipment_Set__c> raesone=[select Id from Rental_Apply_Equipment_Set__c];
+        RentalFixtureSetAssignAgencyController controller = new RentalFixtureSetAssignAgencyController();
+        Test.startTest();
+
+        controller.init();
+        // 绗竴娆″垎閰�
+        controller.esdList[0].checked = true;
+        controller.parentObj.Asset_loaner_start_day__c = Date.today()+1;//20210513 ljh update
+        controller.applyDate();
+        controller.stepName = '鍒嗛厤';
+
+        controller.qrcode = '511100000;2;'+controller.esdList[1].rec.Rental_Apply_Equipment_Set__c;
+        //controller.qrcode = '511100000;2;'+raesone[0].Id;
+        controller.scanAndMatch();
+        controller.assign();
+
+        ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id);
+        controller = new RentalFixtureSetAssignAgencyController();
+        // 涓嬫灦鍚庨噸鏂板垎閰�
+        controller.init();
+        controller.stepName = '鍒嗛厤';
+        integer i=controller.esdList.size();
+        for(integer j=0;i<i;j++){
+            controller.esdList[j].checked = false;
+        }
+        //controller.qrcode = '511100000;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c;
+        controller.qrcode = '511100000;2;'+raesone[0].Id;
+        controller.scanAndMatch();
+        controller.assign();
+
+        Test.stopTest();
+
+        //System.assertEquals(true, controller.done_flg);
+        System.debug('init Success');
+    }
+
+    
+   
+
 
    
 
diff --git a/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls b/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls
index 73e0f76..cdb970b 100644
--- a/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls
+++ b/force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls
@@ -246,10 +246,11 @@
                      , Rental_Apply_Equipment_Set__r.Irreplaceable_flag__c //20210519 ljh add 1829 start
                      , Rental_Apply_Equipment_Set__r.canDelete__c //20210519 ljh add 1829 start
                      , Rental_Apply_Equipment_Set__r.Substitute_flag__c //20210526 ljh 1829 add
-                     ,Rental_Apply_Equipment_Set__r.RAES_Status__c
-                     ,Rental_Apply_Equipment_Set__r.Shippment_loaner_time2__c
-                     ,Rental_Apply__r.Status__c
-                     //20210519 ljh add 1829 end
+                     , Rental_Apply_Equipment_Set__r.RAES_Status__c
+                     , Rental_Apply_Equipment_Set__r.Shippment_loaner_time2__c
+                     , Rental_Apply__r.Status__c //20210519 ljh add 1829 end
+                     , Rental_Apply__r.Request_approval_time__c //20220309 SFDC-CC6CLJ phase5涓婄嚎璇鹃131 鎻愪氦鐢宠鍒板鍝佸嚭搴撴椂闀� 
+                     , Add_Request_approval_time__c //20220309 SFDC-CC6CLJ phase5涓婄嚎璇鹃131 鎻愪氦鐢宠鍒板鍝佸嚭搴撴椂闀� 
                      , Rental_Num__c
                      , Rental_Start_Date__c
                      , Select_Time__c
@@ -432,6 +433,8 @@
             SELECT Campaign__c
                  , Repair__c
                  , Campaign__r.Status
+                 ,Campaign__r.IF_Approved__c
+                 ,Campaign__r.Meeting_Approved_No__c
                  // ,repair__r.Return_Without_Repair_Date__c
                  , Return_Without_Repair_Date_F__c
                  // , Repair__r.Repair_Final_Inspection_Date__c
@@ -477,6 +480,10 @@
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '绱㈣禂QIS鐩殑锛孮IS宸叉湁鏂板搧鍙戣揣鏃�,涓嶈兘缁х画浜�'));
                 return false;
             }//1822 yc 20211108 end
+            //20220225 sx add obpm 鍔炰簨澶勫鍔犲垽鏂細鏄惁鐢宠鍐宠鍕剧潃娌℃湁鍐宠缂栧彿涓嶈兘杩涜鎿嶄綔
+            else if(RaTar.Campaign__c != null && RaTar.Campaign__r.IF_Approved__c && RaTar.Campaign__r.Meeting_Approved_No__c == null){
+                ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error, '宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖'));
+            }
         }
         return true;
     }
@@ -1214,7 +1221,6 @@
         }
         return true;
     }
-
     //20210519 ljh add 1829
     // 鎵竴鎵寜閽�
     public void scanAndMatch() {
@@ -1708,6 +1714,8 @@
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '娌℃湁鏄庣粏锛屼笉鑳藉彂璐�!'));
                 return;
             }
+            Map<String,String> tes = new Map<String,String>();
+            Map<String, List<Rental_Apply_Equipment_Set_Detail__c>> approvalMap = new Map<String, List<Rental_Apply_Equipment_Set_Detail__c>>();// 20220309 SFDC-CC6CLJ phase5涓婄嚎璇鹃131 鎻愪氦鐢宠鍒板鍝佸嚭搴撴椂闀�
             for(EsdInfo esd:esdList) {
                 if(!raesdMap.containsKey(esd.rec.Id)) {
                     continue;
@@ -1764,7 +1772,17 @@
                     raesd.Inspection_result__c = 'OK';
                     // 鍙戣揣鍓嶆娴嬫椂闂村拰妫�娴嬩汉鍦╰rigger閲岃
                     raesd.Shippment_loaner_time__c = now;
-
+                    // 20220309 SFDC-CC6CLJ phase5涓婄嚎璇鹃131 鎻愪氦鐢宠鍒板鍝佸嚭搴撴椂闀� start
+                    Datetime keyDt = raesd.Add_Request_approval_time__c != null?raesd.Add_Request_approval_time__c:raesd.Rental_Apply__r.Request_approval_time__c;
+                    List<Rental_Apply_Equipment_Set_Detail__c> tempRaesdL;
+                    if(approvalMap.containsKey(keyDt.format())){
+                        tempRaesdL = approvalMap.get(keyDt.format());
+                    }else{
+                        tempRaesdL = new List<Rental_Apply_Equipment_Set_Detail__c>();
+                    }
+                    tempRaesdL.add(raesd);                        
+                    approvalMap.put(keyDt.format(),tempRaesdL);
+                    // 20220309 SFDC-CC6CLJ phase5涓婄嚎璇鹃131 鎻愪氦鐢宠鍒板鍝佸嚭搴撴椂闀� end  
                     updateRaesdList.add(raesd);
                 }
                 else {
diff --git a/force-app/main/default/classes/RentalFixtureSetAssignController.cls b/force-app/main/default/classes/RentalFixtureSetAssignController.cls
index eb01f41..e7e3efe 100644
--- a/force-app/main/default/classes/RentalFixtureSetAssignController.cls
+++ b/force-app/main/default/classes/RentalFixtureSetAssignController.cls
@@ -296,6 +296,9 @@
             Rental_Apply__c raUpd = [
                     SELECT Id, Shipment_request_Cnt__c,
                            Asset_loaner_start_day__c,
+                           // Campaign__c,
+                           // Campaign__r.IF_Approved__c,
+                           // Campaign__r.Meeting_Approved_No__c,
                            Asset_loaner_closed_day__c
                       FROM Rental_Apply__c
                      WHERE Id = :parentId
@@ -311,6 +314,11 @@
                 }
             }
 
+            //20220228 sx obpm淇敼 鏄惁鐢宠鍐宠鍕剧潃娌℃湁鍐宠缂栧彿涓嶈兘杩涜鎿嶄綔
+            // if( raUpd.Campaign__c!= null && raUpd.Campaign__r.IF_Approved__c && raUpd.Campaign__r.Meeting_Approved_No__c == null){
+            //     throw new ControllerUtil.myException('宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖');
+            // }
+
             Integer indexNum = 1;
             // 20210708 ljh SFDC-C47CLV add start
             Set<Id> raeIdset = new Set<Id>();
@@ -322,6 +330,7 @@
                     raeIdset.add(robj.Id);    
                 }
             }
+
             List<Rental_Apply_Equipment_Set__c> raeList = [SELECT Id, Name,Rental_Apply__c,Cancel_Select__c,LastModifiedDate FROM Rental_Apply_Equipment_Set__c where Id in :raeIdset];
             // 20210906  ljh SFDC-C6D9C2 add LastModifiedDate
             for(Rental_Apply_Equipment_Set__c rae:raeList){
@@ -344,6 +353,7 @@
                         hasError = true;
                         throw new ControllerUtil.myException('绗�' + indexNum +'琛屾暟鎹凡琚垎鍓茬敵璇峰崟锛岃鍒锋柊鍚庨噸璇曪紒');
                     }
+
                     // 20210708 ljh update end
                     // 20210906  ljh SFDC-C6D9C2 add start
                     // 20210929 ljh SFDC-C6D9C2 娉ㄩ噴 鎭㈠鏀瑰叾浠栨柟妗� start
@@ -1536,6 +1546,7 @@
         return result;
     }
 
+
     public static List<String> transferStringToList(String str){
         // System.debug(LoggingLevel.INFO, '*** str: ' + str);
         List<String> strList = new List<String>();
@@ -1544,6 +1555,11 @@
         }else{
             strList.add(str);
         }
+        for(Integer i = strList.size()-1;i >= 0 ; i --){
+            if(String.isEmpty(strList.get(i))){
+                strList.remove(i);
+            }
+        }
         return strList;
     }
 
diff --git a/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls b/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
index 4f7d67c..2a4ae4a 100644
--- a/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
+++ b/force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
@@ -11,15 +11,9 @@
     public RetrospectiveWeeklyReportController() {
     }
     public void UserDoin(){
-        system.debug('222222222222222================>');
-
         User UserProTypec = LightningUtil.loginUserId();
-        system.debug('3333333333333================>'+UserProTypec);
-
         this.UserProType = '';
         this.UserProType = UserProTypec.UserPro_Type__c;
-        system.debug('444444444444444================>'+this.UserProType);
-        
     }
     
     public void setalldata()
@@ -41,7 +35,7 @@
         tmp.add(space);
         
         // 浠g悊搴楁媴褰撹�� AgencyPerson__c
-        List<Contact> agency_person_data = LightningUtil.selectAgencyPerson01();
+        List<Contact> agency_person_data = LightningUtil.selectAgencyPerson03();
         for(Contact var : agency_person_data) {
             Map<String,String> om = new Map<String,String>();
             om.put('label', var.Name);
@@ -90,7 +84,7 @@
         this.allselectlist.put('StageName__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Opportunity__c','StageName__c'));
 
         //鍏朵粬鍝佺墝鑰楁潗
-        this.allselectlist.put('OtherBrandConsumables__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','OtherBrandConsumables__c'));
+        this.allselectlist.put('WarlockClassification__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','WarlockClassification__c'));
 
         //浜у搧绫诲埆
         this.allselectlist.put('ProductCcategory__c', RetrospectiveWeeklyReportController.getPicklistValues('Agency_Report__c','ProductCcategory__c'));
@@ -202,7 +196,6 @@
     @AuraEnabled
     public static RetrospectiveWeeklyReportController getalldata(){
         RetrospectiveWeeklyReportController li = new RetrospectiveWeeklyReportController();
-        system.debug('1111111111111111111111================>');
         li.UserDoin();
         li.setalldata();
         return li;
@@ -240,12 +233,21 @@
     @AuraEnabled
     public static List<Agency_Hospital_Link__c> getHospitalList(String hospital_name) {
         User login_user_id = LightningUtil.loginUserId();
-        
+        String SignInId = UserInfo.getUserId();
+        // List<Contact> conStrList = [select AccountId from contact where  id in (select ContactId from User where id =: SignInId)];
+        Contact conStrList = [select AccountId from contact where  id in (select ContactId from User where id =: SignInId)];
+
+        system.debug('conStrListconStrListr===============>'+conStrList);
+        String strAgencyId =conStrList.AccountId;
+        // for(Contact conStr : conStrList){
+        //     strAgencyId = conStr.AccountId;
+        // }
+        system.debug('strAgencyIdstrAgencyId==============>'+strAgencyId);
         hospital_name = '%' + hospital_name.trim() + '%'; 
         if(login_user_id.UserPro_Type__c == 'ENG'){
-            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and AgencyHos_ENG__c = true];
+            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and Hospital_Name_readonly__c like :hospital_name and AgencyHos_ENG__c = true];
         }else {
-            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Hospital_Name_readonly__c like :hospital_name and AgencyHos_ET__c = true];
+            return [select Hospital_Name_readonly__c, Id, Hospital__c from Agency_Hospital_Link__c where Agency__c =: strAgencyId and Hospital_Name_readonly__c like :hospital_name and AgencyHos_ET__c = true];
         }
         
     }
@@ -270,7 +272,6 @@
         space.put('selected', 'true');
         ret.add(space);
         
-        // 鎴︾暐绉戝ID銈掑彇寰椼仐銇︺�併仢銈屻倰銈傘仺銇¨瀹€倰SELECT
         Agency_Hospital_Link__c ahl = [select Hospital__c from Agency_Hospital_Link__c where id = :hospital_id];
         List<Agency_Contact__c> doctor_list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c  
             FROM Agency_Contact__c WHERE Hospital_ID18__c=:ahl.Hospital__c order by Name];
@@ -289,24 +290,24 @@
     @RemoteAction
     @AuraEnabled
     public static String saveAgencyReport(String Department_Cateogy,Decimal ConsumptionOfConsumables, 
-                                            Boolean WorkMark,Decimal warlocksNumber,String DealerPersonnel,String ProductCcategory,String productCategories ,String OtherBrandConsumables,
+                                            Boolean WorkMark,Decimal warlocksNumber,String DealerPersonnel,String ProductCcategory,String productCategories ,String WarlockClassification,
                                             String ProductClassification,String WorkRecord,String EffectProgress, String Agency_Report_Header,
                                                 String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
                                                 String UseProduct1, String UseProduct2, String UseProduct3,
                                                 String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
     {
         Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy,ConsumptionOfConsumables,
-        WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,OtherBrandConsumables,ProductClassification, WorkRecord,
+        WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,WarlockClassification,ProductClassification, WorkRecord,
         EffectProgress,Agency_Report_Header,
             Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
             UseProduct1, UseProduct2, UseProduct3,
             StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date);
 
-        agency_report = LightningUtil.insertAgencyReport(agency_report);
+        agency_report = insertAgencyReport(agency_report);
         return agency_report.Id;
     }
     public static Agency_Report__c makeAgencyReport(String Department_Cateogy,Decimal ConsumptionOfConsumables, 
-    boolean WorkMark,Decimal warlocksNumber, String DealerPersonnel,String ProductCcategory,String productCategories,String OtherBrandConsumables,
+    boolean WorkMark,Decimal warlocksNumber, String DealerPersonnel,String ProductCcategory,String productCategories,String WarlockClassification,
     String ProductClassification, String WorkRecord, String EffectProgress,String Agency_Report_Header,
             String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
             String UseProduct1, String UseProduct2, String UseProduct3,
@@ -330,7 +331,6 @@
         }
         //缁忛攢鍟嗕汉鍛�
         if (DealerPersonnel != '') {
-           
             if(DealerPersonnel.contains(';')){
                 DealerPersonnel = DealerPersonnel.split(';')[0];
             }
@@ -346,6 +346,7 @@
         if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; }
         if (ConsumptionOfConsumables != null) { agency_report.ConsumptionOfConsumables__c = ConsumptionOfConsumables; }
         if (WorkRecord != '') { agency_report.WorkRecord__c = WorkRecord; }
+        // system.debug('EffectProgress==================>'+EffectProgress);
         if (EffectProgress != '') { agency_report.EffectProgress__c = EffectProgress; }
         // ET    
         if (ProductClassification != '') { agency_report.ProductClassification__c = ProductClassification; }
@@ -354,8 +355,10 @@
         if (UseProduct1 != '') { agency_report.UseProduct1__c = UseProduct1; }
         if (UseProduct2 != '') { agency_report.UseProduct2__c = UseProduct2; }
         if (UseProduct3 != '') { agency_report.UseProduct3__c = UseProduct3; }
-        if (OtherBrandConsumables != '') { agency_report.OtherBrandConsumables__c = OtherBrandConsumables; }  
+        if (WarlockClassification != '') { agency_report.WarlockClassification__c = WarlockClassification; }  
+        system.debug('ProductCcategory==================>'+ProductCcategory);
         if (ProductCcategory != '') { agency_report.ProductCcategory__c = ProductCcategory; }
+        system.debug('productCategories==================>'+productCategories);
         if (productCategories != '') { agency_report.productCategories__c = productCategories; }
         if (warlocksNumber != null) { agency_report.warlocksNumber__c = warlocksNumber; }
         if (WorkMark != false) {
@@ -363,12 +366,29 @@
         }
         return agency_report;  
     }
+    //鏂板缓鏂规硶
+    public static Agency_Report__c insertAgencyReport(Agency_Report__c data) {
+        if (String.isBlank(data.Hospital__c)) {
+            List<Agency_Hospital_Link__c> agency_hospital_link = [select Id, Hospital__c from Agency_Hospital_Link__c where Id=:data.Agency_Hospital__c];
+            data.Hospital__c = agency_hospital_link[0].Hospital__c;
+        }
+        if (String.isBlank(data.Department_Class__c)) {
+            String record_type_id = LightningUtil.getRecordTypeId(data.Department_Cateogy__c);
+            List<Account> account = [select Id, RecordTypeId from account where Hospital_Department_Class__c=:data.Hospital__c and RecordTypeId=:record_type_id];
+            data.Department_Class__c = account[0].Id;
+        }
+        User userPro = LightningUtil.loginUserId();
+        data.WeeklyReportClassification__c = userPro.UserPro_Type__c;
+        system.debug('data==================>'+data);
 
+        insert data;
+        return data;
+    }
     @RemoteAction
     @AuraEnabled
     public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy,
                                         Decimal ConsumptionOfConsumables,boolean WorkMark,Decimal warlocksNumber,
-                                        String DealerPersonnel,String OtherBrandConsumables,String ProductCcategory,String productCategories,String ProductClassification,
+                                        String DealerPersonnel,String WarlockClassification,String ProductCcategory,String productCategories,String ProductClassification,
                                         String EffectProgress, String WorkRecord, String Agency_Report_Header,
                                         String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
                                         String UseProduct1, String UseProduct2, String UseProduct3, 
@@ -377,7 +397,7 @@
         if (String.isBlank(Agency_Report_Id)) {
             return null;
         }
-        Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,OtherBrandConsumables__c,
+        Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,WarlockClassification__c,
                                             ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
                                             UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
                                             from Agency_Report__c where id=:Agency_Report_Id];
@@ -417,7 +437,7 @@
         if (UseProduct3 != '') { agency_report.UseProduct3__c = UseProduct3; } else { agency_report.UseProduct3__c = null; }  
         if (ProductCcategory != '') { agency_report.ProductCcategory__c = ProductCcategory; } else { agency_report.ProductCcategory__c = null; }
         if (productCategories != '') { agency_report.productCategories__c = productCategories; } else { agency_report.productCategories__c = null; }
-        if (OtherBrandConsumables != '') { agency_report.OtherBrandConsumables__c = OtherBrandConsumables; } else { agency_report.OtherBrandConsumables__c = null; }
+        if (WarlockClassification != '') { agency_report.WarlockClassification__c = WarlockClassification; } else { agency_report.WarlockClassification__c = null; }
         if (WorkMark != false) { agency_report.WorkMark__c = WorkMark; } else { agency_report.WorkMark__c = false; }
         if (warlocksNumber != null) { agency_report.warlocksNumber__c = warlocksNumber; } else { agency_report.warlocksNumber__c = null; }
         agency_report = LightningUtil.updateAgencyReport(agency_report);
@@ -444,7 +464,6 @@
     }
     
     public void get_reports(String date_str, String person_str) {     
-        // 閫卞牨銉囥兗銈裤倰鍙栧緱
         Date week = Date.valueOf(date_str);
         this.reports = LightningUtil.selectAgencyReport01(week, person_str);
     }
@@ -452,8 +471,10 @@
     @RemoteAction
     @AuraEnabled
     public static List<Agency_Report__c> getReportsById(String report_id) {
+        system.debug('==report_id================>'+report_id);
         List<Agency_Report__c> ret = new List<Agency_Report__c>();
-        ret = LightningUtil.selectAgencyReportById(report_id);
+        ret = LightningUtil.selectAgencyReportById01(report_id);
+        system.debug('==Agency_Report_Header__r.WeeklyReportClassification__c=================>'+ret);
         return ret;
     }
     
@@ -464,8 +485,8 @@
         Date date1_date = Date.valueOf(date1);
         Date date2_date = Date.valueOf(date2);
         RetrospectiveWeeklyReportController li = new RetrospectiveWeeklyReportController();
-        List<Contact> conMList = LightningUtil.selectAgencyPerson01();
-        return LightningUtil.selectMAgencyReport(date1_date, date2_date, conMList);
+        List<Contact> conMList = LightningUtil.selectAgencyPerson03();
+        return LightningUtil.selectMAgencyReport01(date1_date, date2_date, conMList);
     }
 
     public List<contact> selectMAgencyPerson() {
@@ -663,13 +684,13 @@
                 // 浣跨敤浜у搧1锛�2锛�3
                 Map<String,Product2> UseProductMap = new Map<String,Product2>();
                 // 鏁堟灉杩涘害
-                Map<String,EffectProgress__c> EffectProgressMap = new Map<String,EffectProgress__c>();
+                Map<String,FieldClassification__c> EffectProgressMap = new Map<String,FieldClassification__c>();
                 // 鏈+鍒嗙被
-                Map<String,WarlockClassification__c> OtherBrandConsumablesMap = new Map<String,WarlockClassification__c>();
+                Map<String,FieldClassification__c> OtherBrandConsumablesMap = new Map<String,FieldClassification__c>();
                 // 宸查噰鐢ㄥ叾浠栦骇鍝�
-                Map<String,ProductCcategory__c> ProductCcategorynMap = new Map<String,ProductCcategory__c>();  
+                Map<String,FieldClassification__c> ProductCcategorynMap = new Map<String,FieldClassification__c>();  
                  // 鍏朵粬鍝佺墝浜у搧绫诲埆
-                 Map<String,productCategories__c> productCategoriesMap = new Map<String,productCategories__c>();  
+                 Map<String,FieldClassification__c> productCategoriesMap = new Map<String,FieldClassification__c>();  
                 // 浣跨敤浜у搧id鐨凩ist
                 List<String> UseProductIdList = new List<String>();
                  // 鏁堟灉杩涘害id鐨凩ist
@@ -692,14 +713,14 @@
                 Map<String,String> DealerPersonnelMap = new Map<String,String>();
                 // 缁忛攢鍟嗚浠风殑map
                 Map<String,Agency_Opportunity__c> aoMap = new Map<String,Agency_Opportunity__c>();
-                List<Contact> conList = LightningUtil.selectAgencyPerson01();      
+                List<Contact> conList = LightningUtil.selectAgencyPerson03();      
                 List<OlympusCalendar__c> olympusDateList = [select Id,Date__c,FirstDayOfWeek__c,DayOfTheWeek__c from OlympusCalendar__c where Date__c= :dateList ];
                 List<Agency_Hospital_Link__c> ahlList = [select id,name,Hospital__c,MaxActivityDate__c from Agency_Hospital_Link__c where name = :ahlNameList and Agency_Campaign_Obj__c = true];
                 List<Product2> pr2List = [select id,name from Product2 where name in:Product2NameList];
-                List<EffectProgress__c> epList = [select id,name from EffectProgress__c where name in :EffectProgressList]; 
-                List<WarlockClassification__c> ocList = [select id,name from WarlockClassification__c where name in :OtherBrandConsumablesList];
-                List<ProductCcategory__c> PCList = [select id,name from ProductCcategory__c where name in :ProductCcategoryList];
-                List<productCategories__c> PctList = [select id,name from productCategories__c where name in :productCategoriesList];
+                List<FieldClassification__c> FieldClassification1List = [select id,EffectProgress__c from FieldClassification__c where EffectProgress__c  in :EffectProgressList]; 
+                List<FieldClassification__c> FieldClassification2List = [select id,WarlockClassification__c from FieldClassification__c where WarlockClassification__c in :OtherBrandConsumablesList];
+                List<FieldClassification__c> FieldClassification3List = [select id,ProductCcategory__c from FieldClassification__c where ProductCcategory__c in :ProductCcategoryList];
+                List<FieldClassification__c> FieldClassification4List = [select id,productCategories__c from FieldClassification__c where productCategories__c in :productCategoriesList];
                 
                 for(OlympusCalendar__c olym : olympusDateList){
                     if(olym.DayOfTheWeek__c == 'Sun'){
@@ -727,20 +748,20 @@
                     UseProductMap.put(pr2.Name, pr2);
                     UseProductIdList.add(pr2.Id);
                 }
-                for(EffectProgress__c ep : epList){
-                    EffectProgressMap.put(ep.Name, ep);
+                for(FieldClassification__c ep : FieldClassification1List){
+                    EffectProgressMap.put(ep.EffectProgress__c, ep);
                     EffectProgressIdList.add(ep.Id);
                 }
-                for(WarlockClassification__c oc : ocList){ 
-                    OtherBrandConsumablesMap.put(oc.Name, oc);
+                for(FieldClassification__c oc : FieldClassification2List){ 
+                    OtherBrandConsumablesMap.put(oc.WarlockClassification__c, oc);
                     OtherBrandConsumablesIdList.add(oc.Id);
                 }
-                for(ProductCcategory__c pc : PCList){ 
-                    ProductCcategorynMap.put(pc.Name, pc);
+                for(FieldClassification__c pc : FieldClassification3List){ 
+                    ProductCcategorynMap.put(pc.ProductCcategory__c, pc);
                     ProductCcategorynIdList.add(pc.Id);
                 }
-                for(productCategories__c pct : PctList){ 
-                    productCategoriesMap.put(pct.Name, pct);
+                for(FieldClassification__c pct : FieldClassification4List){ 
+                    productCategoriesMap.put(pct.productCategories__c, pct);
                     productCategoriesIdList.add(pct.Id);
                 }
                 List<Agency_Contact__c> doctor2list = [select id,Name,Doctor_Division1__c,Type__c,Agency_Hospital__c FROM Agency_Contact__c WHERE Hospital_ID18__c= :ahlOcsmIdList order by Name];
@@ -791,6 +812,8 @@
 				}
                 List<Agency_Report__c> arList = new List<Agency_Report__c>();
                 Integer hang = 1;
+                User UserPro = LightningUtil.loginUserId();
+                String UserProTypeStr = UserPro.UserPro_Type__c;
                 for(List<String> lineList :inputList){
                     // 鍒涘缓鍛ㄦ姤鏄庣粏
                     Date week = null;
@@ -886,7 +909,7 @@
                         agencyReport.ConsumptionOfConsumables__c = Decimal.valueOf(lineList[13]);     
                     }
                     if(OtherBrandConsumablesMap.containsKey(lineList[14])){
-                        agencyReport.OtherBrandConsumables__c = OtherBrandConsumablesMap.get(lineList[14]).Id;     
+                        agencyReport.WarlockClassification__c = OtherBrandConsumablesMap.get(lineList[14]).Id;     
                     }
                     if(ProductCcategorynMap.containsKey(lineList[15])){   
                         agencyReport.ProductCcategory__c = ProductCcategorynMap.get(lineList[15]).Id;      
@@ -902,6 +925,7 @@
                     }else{
                         agencyReport.WorkMark__c =  false; 
                     }
+                    agencyReport.WeeklyReportClassification__c = UserProTypeStr;
                     String headerStr = createHeader(week,s_agency);
                     if(agency_report_headerMap.containsKey(headerStr)){
                         agencyReport.Agency_Report_Header__c = agency_report_headerMap.get(headerStr).Id;
@@ -920,6 +944,7 @@
                 }
                 // 鏂板鍛ㄦ姤鏄庣粏
                 if(arList.size() > 0 ){
+                    system.debug('arList==================>'+arList);
                     LightningUtil.insertMAgencyReport(arList);
                 }
             }
@@ -1057,19 +1082,20 @@
     @AuraEnabled
     public static List<Map<String,String>> selectPurposeTypes(String doctor_value){
         system.debug('doctor_value===============>'+doctor_value);
-
-        List<EffectProgress__c> eftpcList;
+        List<FieldClassification__c> eftpcList;
         if(String.isNotBlank(doctor_value)){
-            eftpcList = [select id, Name , WorkRecord__c from EffectProgress__c where WorkRecord__c =: doctor_value];
+            // eftpcList = [select id, Name , WorkRecord__c from EffectProgress__c where WorkRecord__c =: doctor_value];
+            eftpcList = [Select Id,WorkRecord__c,EffectProgress__c from FieldClassification__c where WorkRecord__c =: doctor_value];
+
         }
         List<Map<String,String>> options = new List<Map<String,String>>();
         Map<String,String> space = new Map<String,String>();
         space.put('label', '');
         space.put('value', '');
         options.add(space);
-        for(EffectProgress__c efptc : eftpcList){
+        for(FieldClassification__c efptc : eftpcList){
             Map<String,String> efptcMap = new Map<String,String>();
-            efptcMap.put('label', efptc.Name);
+            efptcMap.put('label', efptc.EffectProgress__c);
             efptcMap.put('value', efptc.Id);
             options.add(efptcMap);
         }
@@ -1079,18 +1105,20 @@
     @RemoteAction
     @AuraEnabled
     public static List<Map<String,String>> selectProductClassificationc(String select_ProductClassification){
-        List<WarlockClassification__c> WarlockClassificationList;
+        List<FieldClassification__c> WarlockClassificationList;
         if(String.isNotBlank(select_ProductClassification)){
-            WarlockClassificationList = [select id, Name , ProductClassification__c from WarlockClassification__c where ProductClassification__c =: select_ProductClassification];
+            // WarlockClassificationList = [select id, Name , ProductClassification__c from WarlockClassification__c where ProductClassification__c =: select_ProductClassification];
+            WarlockClassificationList = [select id , ProductClassification__c,WarlockClassification__c from FieldClassification__c where ProductClassification__c =: select_ProductClassification];
+
         }
         List<Map<String,String>> options = new List<Map<String,String>>();
         Map<String,String> space = new Map<String,String>();
         space.put('label', '');
         space.put('value', '');
         options.add(space);
-        for(WarlockClassification__c WarlockClassification : WarlockClassificationList){
+        for(FieldClassification__c WarlockClassification : WarlockClassificationList){
             Map<String,String> WarlockClassificationMap = new Map<String,String>();
-            WarlockClassificationMap.put('label', WarlockClassification.Name);
+            WarlockClassificationMap.put('label', WarlockClassification.WarlockClassification__c);
             WarlockClassificationMap.put('value', WarlockClassification.Id);
             options.add(WarlockClassificationMap);
         }
@@ -1099,21 +1127,21 @@
     @RemoteAction
     @AuraEnabled
     public static List<Map<String,String>> selectProductCcategory(){
-        List<ProductCcategory__c> ProductCcategoryList;
+        List<FieldClassification__c> ProductCcategoryList;
         User UserProETENG = LightningUtil.loginUserId();
         if(UserProETENG.UserPro_Type__c == 'ET'){
-            ProductCcategoryList = [select id, Name , ConsumablesClassification__c from ProductCcategory__c where ConsumablesClassification__c =: 'ET'];
+            ProductCcategoryList = [select id,  ProductCcategory__c from FieldClassification__c where classification__c =: 'ET'];
         }else{
-            ProductCcategoryList = [select id, Name , ConsumablesClassification__c from ProductCcategory__c where ConsumablesClassification__c =: 'ENG'];
+            ProductCcategoryList = [select id,  ProductCcategory__c from FieldClassification__c where classification__c =: 'ENG'];
         }
         List<Map<String,String>> options = new List<Map<String,String>>();
         Map<String,String> space = new Map<String,String>();
         space.put('label', '');
         space.put('value', '');
         options.add(space);
-        for(ProductCcategory__c ProductCcategory : ProductCcategoryList){
+        for(FieldClassification__c ProductCcategory : ProductCcategoryList){
             Map<String,String> ProductCcategorynMap = new Map<String,String>();
-            ProductCcategorynMap.put('label', ProductCcategory.Name);
+            ProductCcategorynMap.put('label', ProductCcategory.ProductCcategory__c);
             ProductCcategorynMap.put('value', ProductCcategory.Id);
             options.add(ProductCcategorynMap);
         }
@@ -1122,22 +1150,23 @@
     @RemoteAction
     @AuraEnabled
     public static List<Map<String,String>> selectProductCcategory01(String select_ProductCcategory){
-        List<productCategories__c> productCategoriesList;
+        List<FieldClassification__c> productCategoriesList;
         User UserProETENG = LightningUtil.loginUserId();
         System.debug('UserProETENG.UserPro_Type__c=============>'+UserProETENG.UserPro_Type__c);
+        FieldClassification__c fi = [Select ProductCcategory__c from FieldClassification__c where ID =: select_ProductCcategory];
         if(UserProETENG.UserPro_Type__c == 'ET'){
-            productCategoriesList = [select id, Name,ET_ENG_classification__c,ProductCcategory__c from productCategories__c where ProductCcategory__c =:select_ProductCcategory AND ET_ENG_classification__c =: 'ET'];
+            productCategoriesList = [select id, productCategories__c,ET_ENG_classification__c,ProductCcategory__c from FieldClassification__c where ProductCcategory__c =: fi.ProductCcategory__c AND ET_ENG_classification__c =: 'ET'];
         }else{
-            productCategoriesList = [select id, Name,ET_ENG_classification__c,ProductCcategory__c from productCategories__c where ProductCcategory__c =:select_ProductCcategory AND ET_ENG_classification__c =: 'ENG'];
+            productCategoriesList = [select id, productCategories__c,ET_ENG_classification__c,ProductCcategory__c from FieldClassification__c where ProductCcategory__c =:fi.ProductCcategory__c AND ET_ENG_classification__c =: 'ENG'];
         }
         List<Map<String,String>> options = new List<Map<String,String>>();
         Map<String,String> space = new Map<String,String>();
         space.put('label', '');
         space.put('value', '');
         options.add(space);
-        for(productCategories__c productCategories : productCategoriesList){
+        for(FieldClassification__c productCategories : productCategoriesList){
             Map<String,String> productCategoriesMap = new Map<String,String>();
-            productCategoriesMap.put('label', productCategories.Name);
+            productCategoriesMap.put('label', productCategories.productCategories__c);
             productCategoriesMap.put('value', productCategories.Id);
             options.add(productCategoriesMap);
         }
diff --git a/force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls b/force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls
new file mode 100644
index 0000000..19aa39b
--- /dev/null
+++ b/force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls
@@ -0,0 +1,499 @@
+@isTest
+public with sharing class RetrospectiveWeeklyReportTest {
+        public static Account account1 = new Account();
+        public static Account account2 = new Account();
+        public static Contact contact1 = new Contact();
+        public static Contact contact2 = new Contact();
+        public static Product2 pro1 = new Product2();
+        public static Product2 pro2 = new Product2();
+        public static Product2 pro3 = new Product2();
+        public static FieldClassification__c fc1 = new FieldClassification__c();
+        public static FieldClassification__c fc2 = new FieldClassification__c();
+        public static FieldClassification__c fc3  = new FieldClassification__c();
+        public static FieldClassification__c fc4  = new FieldClassification__c();
+        public static User user = new User();
+        public static Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c();
+        public static Agency_Contact__c agency_contact = new Agency_Contact__c();
+        // 缁忛攢鍟嗘椿鍔ㄥ懆鎶ュ鍏� update by vivek end     
+        public static OlympusCalendar__c olympus_calendar = new OlympusCalendar__c();
+        
+        // // public static productCategories__c pca = new productCategories__c();
+        // public static WarlockClassification__c wcf = new WarlockClassification__c();
+        // public static EffectProgress__c etp = new EffectProgress__c();
+        
+        public static String report_id;
+        public static String report_header_id;
+        
+        /* 鐥呴櫌銆傘偝銉炽偪銈儓銆併儲銉笺偠銉笺�併偒銉兂銉�銉笺仾銇┿伄鍒濇湡銉囥兗銈夸綔銈�
+        */
+        private static void testInit() {
+            // 鍙栧紩鍏�
+            account1.Name = 'test1鍖婚櫌';
+            account1.RecordTypeId = '01210000000QemG';
+            insert account1;
+            
+            account2.Name = 'test1缁忛攢鍟�';
+            account2.RecordTypeId = '01210000000Qem1';
+            insert account2;
+            
+            // 鍙栧紩鍏堣铂浠昏��
+            contact1.AccountId = account1.Id;
+            contact1.FirstName = '璨换鑰�';
+            contact1.LastName = 'test1鍖婚櫌';
+            insert contact1;
+            
+            contact2.AccountId = account2.Id;
+            contact2.FirstName = '璨换鑰�';
+            contact2.LastName = 'test1缁忛攢鍟�';
+            insert contact2;
+    
+            Profile p = [select Id from Profile where Name = '901_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
+            user.ProfileId = p.Id;
+            user.UserPro_Type__c = 'ET';
+            user.ContactId = contact2.Id;
+            user.FirstName = '銉︺兗銈躲兗';
+            user.LastName = '銉嗐偣銉�';
+            user.Email = 'test_user@example.com';
+            user.emailencodingkey='UTF-8';
+            user.languagelocalekey='zh_CN';
+            user.localesidkey='ja_JP';
+            user.timezonesidkey='Asia/Shanghai';
+            user.Username = 'test_user@example.com';
+            user.Alias = '銉嗐儲';
+            user.CommunityNickname = '銉嗐偣銉堛儲銉笺偠銉�';
+            insert user;
+            
+            // 浠g悊搴楀尰闄�
+            agency_hospital_link.Name = 'test1浠g悊搴楀尰闄�';
+            agency_hospital_link.Hospital__c = account1.Id;
+            agency_hospital_link.Agency__c = account2.Id;
+            agency_hospital_link.OwnerId = user.Id;
+            agency_hospital_link.Agency_Campaign_Obj__c = true;
+            insert agency_hospital_link;
+            
+            // 鍏堢敓
+            agency_contact.Name = 'test1鍖婚櫌鍏堢敓';
+            agency_contact.Doctor_Division1__c = '闄㈤暱';
+            agency_contact.Type__c = '鍖荤敓';
+            agency_contact.Agency_Hospital__c = agency_hospital_link.Id;
+            agency_contact.OwnerId = user.Id;
+            insert agency_contact;
+
+            
+            pro1.Name='name01';
+            pro1.IsActive=true;
+            pro1.Family='GI';
+            pro1.Fixture_Model_No__c='n01';
+            pro1.Serial_Lot_No__c='S/N tracing';
+            pro1.Category3__c = 'ERCP';
+            pro1.Fixture_Model_No_T__c = 'n01';
+            pro1.ProductCode_Ext__c='pc01';
+            pro1.Manual_Entry__c=false;
+            insert pro1;
+
+            pro2.Name='name02';
+            pro2.IsActive=true;
+            pro2.Family='GI';
+            pro2.Fixture_Model_No__c='n01';
+            pro2.Serial_Lot_No__c='S/N tracing';
+            pro2.Category3__c = 'ERCP';
+            pro2.Fixture_Model_No_T__c = 'n01';
+            pro2.ProductCode_Ext__c='pc01';
+            pro2.Manual_Entry__c=false;
+            insert pro2;
+
+            pro3.Name='name03';
+            pro3.IsActive=true;
+            pro3.Family='GI';
+            pro3.Fixture_Model_No__c='n01';
+            pro3.Serial_Lot_No__c='S/N tracing';
+            pro3.Category3__c = 'ERCP';
+            pro3.Fixture_Model_No_T__c = 'n01';
+            pro3.ProductCode_Ext__c='pc01';
+            pro3.Manual_Entry__c=false;
+            insert pro3;
+            // 銈儶銉炽儜銈广偒銉兂銉�銉�
+            olympus_calendar.Date__c = Date.valueOf('2022-02-28');
+            olympus_calendar.OwnerId = user.Id;
+            insert olympus_calendar;
+            
+            fc1.Name = '1';
+            fc1.ProductCcategory__c = '瀹夌憺';
+            fc1.classification__c = 'ET';
+            insert fc1;
+            fc2.Name = '2';
+            fc2.WarlockClassification__c = '鍙栫煶姘斿泭';
+            fc2.ProductClassification__c = 'ERCP';
+            insert fc2;
+
+            fc3.Name = '3';
+            fc3.EffectProgress__c = '闄㈢骇瀹℃牳';
+            fc3.WorkRecord__c = '闄㈠唴鍏ラ櫌鐢宠';
+            insert fc3;
+
+            fc4.Name = '4';
+            fc4.productCategories__c = '鏃犵嚎瓒呭0鍒囧壊鍒�';
+            fc4.ET_ENG_classification__c = 'ENG';
+            fc4.ProductCcategory__c = '瀹夌憺';
+            insert fc4;
+        }
+        // @isTest public static void getProductListTest() {
+        //     testInit();
+        //     String select_ProductCcategory = pc.Id;
+            
+        //     System.runAs(user) {
+        //         // 鐥呴櫌銉偣銉堝彇寰�
+        //         List<Map<String,String>> test = RetrospectiveWeeklyReportController.selectProductCcategory01(select_ProductCcategory);
+        //         Map<String,String> test_data = new Map<String,String>();
+        //         test_data.put('label', agency_contact.Name);
+        //         test_data.put('value', agency_contact.Id);
+        //         System.assertEquals(test_data,null);
+        //     }
+        // }
+        @isTest public static void selectProductCcategoryTest() {
+            testInit();
+            String select_ProductCcategory = fc1.ProductCcategory__c;
+            
+            System.runAs(user) {
+                // 鐥呴櫌銉偣銉堝彇寰�
+                List<Map<String,String>> test = RetrospectiveWeeklyReportController.selectProductCcategory();
+                System.assertNotEquals(test, null);
+            }
+        }
+        @isTest public static void getalldataTest() {
+            testInit();
+            
+            System.runAs(user) {
+                // 鐥呴櫌銉偣銉堝彇寰�
+                RetrospectiveWeeklyReportController test = RetrospectiveWeeklyReportController.getalldata();
+                System.assertNotEquals(test, null);
+            }
+        }
+        @isTest
+        public static void createReportHeaderTest() {
+            testInit();
+            
+            System.runAs(user) {
+                // 閫卞牨銉樸儍銉�銉间綔鎴�
+                String name = '銉嗐偣銉� 銉︺兗銈躲兗';
+                String s_date = '2022-02-28';
+                String s_agency = contact2.Id;
+                String head_key = contact2.Id + ':20220228';
+                report_header_id = RetrospectiveWeeklyReportController.createReportHeader(name, s_date, s_agency, head_key);
+                
+                Agency_Report_Header__c data = [select Id, Name, Week__c, Agency_Person2__c, HeaderInputKey__c, OlympusDate__r.Date__c from Agency_Report_Header__c where HeaderInputKey__c = :head_key];
+                System.assertEquals(name + ' (' + s_date + ')', data.Name);
+                System.assertEquals(Date.valueOf(s_date), data.Week__c);
+                System.assertEquals(s_agency, data.Agency_Person2__c);
+                System.assertEquals(head_key, data.HeaderInputKey__c);
+                System.assertEquals(Date.valueOf(s_date), data.OlympusDate__r.Date__c);
+            }
+        }
+        @isTest public static void getDoctorListTest() {
+            testInit();
+            
+            System.runAs(user) {
+                List<Map<String,String>> doctor_data = RetrospectiveWeeklyReportController.getDoctorList(agency_hospital_link.Id);
+                Map<String,String> test_data = new Map<String,String>();
+                test_data.put('label', agency_contact.Name);
+                test_data.put('value', agency_contact.Id);
+                test_data.put('selected', 'false');
+                test_data.put('Doctor_Division1__c', agency_contact.Doctor_Division1__c);
+                System.assertEquals(test_data, doctor_data[1]);
+            }
+        }  
+        @isTest public static void selectProductClassificationc() {
+            testInit();
+            String str = 'ERCP';
+            System.runAs(user) {
+                List<Map<String,String>> doctor_data = RetrospectiveWeeklyReportController.selectProductClassificationc(str);
+                Map<String,String> test_data = new Map<String,String>();
+                test_data.put('label', fc2.WarlockClassification__c);
+                test_data.put('value', fc2.Id);
+                System.assertEquals(test_data, doctor_data[1]);
+            }
+        }
+        @isTest public static void selectPurposeTypes() {
+            testInit();
+            String str ='闄㈠唴鍏ラ櫌鐢宠';
+            System.runAs(user) {
+                List<Map<String,String>> doctor_data = RetrospectiveWeeklyReportController.selectPurposeTypes(str);
+                Map<String,String> test_data = new Map<String,String>();
+                test_data.put('label', fc3.EffectProgress__c);
+                test_data.put('value', fc3.Id);
+                System.assertEquals(test_data, doctor_data[1]);
+            }
+        }
+        @isTest public static void processData() {
+            
+            testInit();
+            OlympusCalendar__c oc1 = new OlympusCalendar__c();
+            oc1.Date__c = Date.valueOf('2022-3-1');
+            insert oc1;
+            OlympusCalendar__c oc2 = new OlympusCalendar__c();
+            oc2.Date__c = Date.valueOf('2022-3-2');
+            insert oc2;
+            OlympusCalendar__c oc3 = new OlympusCalendar__c();
+            oc3.Date__c = Date.valueOf('2022-2-28');
+            insert oc3;
+            Test.startTest();
+            System.runAs(user) {
+            String reports = RetrospectiveWeeklyReportController.processData('"鍛�,鎷呭綋,娲诲姩鏃�,鍖婚櫌,绉戝,缁忛攢鍟嗕汉鍛�,宸ヤ綔璁板綍,鍖婚櫌浜哄憳,浜у搧鍒嗙被(绗笁鍒嗙被),浣跨敤浜у搧1(浜у搧鍨嬪彿),浣跨敤浜у搧2,浣跨敤浜у搧3,鏁堟灉/杩涘害,绉戝鍚岀被鑰楁潗鏈堜娇鐢ㄩ噺,鏈+鍒嗙被,宸查噰鐢ㄥ叾浠栧搧鐗�,浜у搧鐢ㄩ噺,宸ヤ綔鏍囪\r\n2022-02-28,濮� 褰�,2022-03-03,闉嶅北涔濇床鍖婚櫌,ET,濮� 褰�,闄㈠唴鍏ラ櫌鐢宠,灏忎粯,ERCP,KD-6G17Q-1-A:鍋滄2005/10 G鍨嬪涓濅钩澶村垏寮�鍒�,KD-200Q-0730:涔冲ご鍒囧紑鍒�,KD-211Q-0720:楂橀鍒囧紑鍒�,闄㈢骇瀹℃牳,11,鍙栫煶姘斿泭,缇庤开浜�,,22,false\r\n2022-02-28,濮� 褰�,2022-03-03,闉嶅北涔濇床鍖婚櫌,ET,濮� 褰�,闄㈠唴鍏ラ櫌鐢宠,灏忎粯,ERCP,KD-6G17Q-1-A:鍋滄2005/10 G鍨嬪涓濅钩澶村垏寮�鍒�,KD-200Q-0730:涔冲ご鍒囧紑鍒�,KD-211Q-0720:楂橀鍒囧紑鍒�,闄㈢骇瀹℃牳,11,鍙栫煶姘斿泭,缇庤开浜�,,22,false\r\n','',null);
+            }
+            Test.stopTest();
+        }
+        @isTest static void saveAgencyReportTest() {
+            testInit();
+            
+            System.runAs(user) {
+                String name = '銉嗐偣銉� 銉︺兗銈躲兗';
+                String s_date = '2022-02-28';
+                String s_agency = contact2.Id;
+                String head_key = contact2.Id + ':20220228';
+                report_header_id = RetrospectiveWeeklyReportController.createReportHeader(name, s_date, s_agency, head_key);
+                
+                // 閫卞牨浣滄垚 String
+                String Department_Cateogy = '';
+                Decimal ConsumptionOfConsumables = 0;
+                Boolean WorkMark  = false;
+                Decimal warlocksNumber = 0;
+                String DealerPersonnel = '';
+                String ProductCcategory = '';
+                String productCategories = '';
+                String WarlockClassification = '';
+                String ProductClassification = '';
+                String WorkRecord = '';
+                String EffectProgress = '';
+                String Agency_Report_Header = '';
+                String Agency_Hospital = '';
+                String Person_In_Charge2 = '';
+                String doctor = '';
+                String Submit_date = '';
+                String UseProduct1 = '';
+                String UseProduct2 = '';
+                String UseProduct3 = '';
+                String StageName = '';
+                String oppAmount = '';
+                String oppOCMPrice = '';
+                String Close_Forecasted_Date = '';
+                String Report_Date = '';
+                Department_Cateogy = 'ET';
+                ConsumptionOfConsumables = 11;
+                WorkMark  = true;
+                warlocksNumber = 22;
+                DealerPersonnel = contact1.id;
+                ProductCcategory = fc1.ID;
+                productCategories = '';
+                WarlockClassification = fc2.ID;
+                ProductClassification = 'ERCP';
+                WorkRecord = '闄㈠唴鍏ラ櫌鐢宠';
+                EffectProgress = fc3.ID;
+                Agency_Report_Header = report_header_id;
+                Agency_Hospital = agency_hospital_link.Id;
+                Person_In_Charge2 = contact2.Id;
+                doctor = agency_contact.Id;
+                Submit_date = '2022-02-28';
+                UseProduct1 = pro1.id;
+                UseProduct2 = pro2.Id;
+                UseProduct3 = pro3.id;
+                StageName = '';
+                oppAmount = '';
+                oppOCMPrice = '';
+                Close_Forecasted_Date = '';
+                Report_Date = '2022-3-3';
+                report_id = RetrospectiveWeeklyReportController.saveAgencyReport(Department_Cateogy,ConsumptionOfConsumables,
+                            WorkMark,warlocksNumber,DealerPersonnel,ProductCcategory,productCategories,WarlockClassification,ProductClassification, WorkRecord,
+                            EffectProgress,Agency_Report_Header,
+                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                            UseProduct1, UseProduct2, UseProduct3,
+                            StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date);
+                
+                Agency_Report__c data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                from Agency_Report__c where id=:report_id];
+
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+                System.assertEquals(Agency_Report_Header, data.Agency_Report_Header__c);
+                System.assertEquals(Agency_Hospital, data.Agency_Hospital__c);
+                System.assertEquals(Person_In_Charge2, data.Person_In_Charge2__c);
+                System.assertEquals(doctor, data.doctor2__c);
+                System.assertEquals(Date.valueOf(Submit_date), data.Submit_date__c);
+            }
+        }
+        @isTest public static void editAgencyReportTest() {
+            saveAgencyReportTest();
+            
+            System.runAs(user) {
+                String Department_Cateogy = '';
+                Decimal ConsumptionOfConsumables = 0;
+                Boolean WorkMark  = false;
+                Decimal warlocksNumber = 0;
+                String DealerPersonnel = '';
+                String ProductCcategory = '';
+                String productCategories = '';
+                String WarlockClassification = '';
+                String ProductClassification = '';
+                String WorkRecord = '';
+                String EffectProgress = '';
+                String Agency_Report_Header = '';
+                String Agency_Hospital = '';
+                String Person_In_Charge2 = '';
+                String doctor = '';
+                String Submit_date = '';
+                String UseProduct1 = '';
+                String UseProduct2 = '';
+                String UseProduct3 = '';
+                String StageName = '';
+                String oppAmount = '';
+                String oppOCMPrice = '';
+                String Close_Forecasted_Date = '';
+                String Report_Date = '';
+                Department_Cateogy = 'ET';
+                ConsumptionOfConsumables = 11;
+                WorkMark  = true;
+                warlocksNumber = 22;
+                DealerPersonnel = contact1.id;
+                ProductCcategory = fc1.ID;
+                productCategories = '';
+                WarlockClassification = fc2.ID;
+                ProductClassification = 'ERCP';
+                WorkRecord = '闄㈠唴鍏ラ櫌鐢宠';
+                EffectProgress = fc3.Id;
+                Agency_Report_Header = report_header_id;
+                Agency_Hospital = agency_hospital_link.Id;
+                Person_In_Charge2 = contact2.Id;
+                doctor = agency_contact.Id;
+                Submit_date = '2022-02-28';
+                UseProduct1 = pro1.id;
+                UseProduct2 = pro2.Id;
+                UseProduct3 = pro3.id;
+                Report_Date = '2022-3-3';
+                Test.startTest();
+                // 閫卞牨绶ㄩ泦  
+                Department_Cateogy = 'BF';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                Agency_Report__c data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                                            from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+                
+                Department_Cateogy = 'GYN';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                            from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+    
+                Department_Cateogy = 'GS';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                                            from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+    
+                Department_Cateogy = 'URO';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                            from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+    
+                Department_Cateogy = 'ENT';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                                    ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                                    UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                                    from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+    
+                Department_Cateogy = 'ET';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                            from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+    
+                Department_Cateogy = 'OTH';
+                report_id = RetrospectiveWeeklyReportController.editAgencyReport(report_id,Department_Cateogy,ConsumptionOfConsumables,
+                                                            WorkMark,warlocksNumber,DealerPersonnel,WarlockClassification,ProductCcategory,productCategories,ProductClassification, 
+                                                            EffectProgress,WorkRecord,Agency_Report_Header,
+                                                            Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
+                                                            UseProduct1, UseProduct2, UseProduct3,
+                                                            Report_Date);
+                data = [select Id, Name, Department_Cateogy__c, ConsumptionOfConsumables__c, WorkRecord__c,EffectProgress__c,WarlockClassification__c,
+                            ProductCcategory__c, productCategories__c,warlocksNumber__c,WorkMark__c,ProductClassification__c,DealerPersonnel__c, Agency_Report_Header__c,Agency_Hospital__c,UseProduct1__c,
+                            UseProduct2__c, UseProduct3__c,  Person_In_Charge2__c,doctor2__c,Submit_date__c,Report_Date__c
+                            from Agency_Report__c where id=:report_id];
+                System.assertEquals(Department_Cateogy, data.Department_Cateogy__c);
+    
+                Test.stopTest();
+            }
+        }
+        @isTest public static void getReports() {
+            saveAgencyReportTest();
+            
+            System.runAs(user) {
+                String date_str = '2022-02-28';
+                String person_str = '';
+                Test.startTest();
+                RetrospectiveWeeklyReportController reports = RetrospectiveWeeklyReportController.getReports(date_str, person_str);
+                List<Agency_Report__c> report = RetrospectiveWeeklyReportController.getReportsById(report_id);
+                Test.stopTest();
+                system.assertEquals(report_id, report[0].Id);
+            }
+        }
+        @isTest public static void processData02() {
+            
+            testInit();
+            OlympusCalendar__c oc1 = new OlympusCalendar__c();
+            oc1.Date__c = Date.valueOf('2022-3-1');
+            insert oc1;
+            OlympusCalendar__c oc2 = new OlympusCalendar__c();
+            oc2.Date__c = Date.valueOf('2022-3-2');
+            insert oc2;
+            OlympusCalendar__c oc3 = new OlympusCalendar__c();
+            oc3.Date__c = Date.valueOf('2022-2-28');
+            insert oc3;
+            Test.startTest();
+            System.runAs(user) {
+            String reports = RetrospectiveWeeklyReportController.processData('"鍛�,鎷呭綋,娲诲姩鏃�,鍖婚櫌,绉戝,缁忛攢鍟嗕汉鍛�,宸ヤ綔璁板綍,鍖婚櫌浜哄憳,浜у搧鍒嗙被(绗笁鍒嗙被),浣跨敤浜у搧1(浜у搧鍨嬪彿),浣跨敤浜у搧2,浣跨敤浜у搧3,鏁堟灉/杩涘害,绉戝鍚岀被鑰楁潗鏈堜娇鐢ㄩ噺,鏈+鍒嗙被,宸查噰鐢ㄥ叾浠栧搧鐗�,浜у搧鐢ㄩ噺,宸ヤ綔鏍囪\r\n,,,,,,,,,,,,,,,,,,\r\n','',null);
+            }
+            Test.stopTest();
+        }
+    }
\ No newline at end of file
diff --git a/force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls-meta.xml b/force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls-meta.xml
new file mode 100644
index 0000000..dd61d1f
--- /dev/null
+++ b/force-app/main/default/classes/RetrospectiveWeeklyReportTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>52.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/SI_NewQuoteEntryController.cls b/force-app/main/default/classes/SI_NewQuoteEntryController.cls
index 2ca8205..f0e59a0 100644
--- a/force-app/main/default/classes/SI_NewQuoteEntryController.cls
+++ b/force-app/main/default/classes/SI_NewQuoteEntryController.cls
@@ -12,6 +12,8 @@
 
     //lastbuy  2022/2/9 fy start
     public Boolean filg { get; set; }
+    public Integer flglastbuy { get; set; }
+    public String errorProductmodel { get; set; }
     //lastbuy  2022/2/9 fy end
 
     public String excel_text { get; set; }
@@ -418,7 +420,8 @@
                     ,PricebookEntry.Product2.NoDiscount_Foreign__c 
                     ,Quote.Opportunity.Trade__c 
                     //澶栬锤澶氬勾淇� 2021/01/27 绮剧悽鎶�鏈� wql end
-
+                    //fy 棰勭暀浜у搧鏍囪瘑
+                    ,PricebookEntry.Product2.LastbuyProductFLG__c
                     //SFDC鍋滄棰勮 lt 20211009 start
                     ,PricebookEntry.Product2.Estimated_ConsumptionDueDate__c
                     //SFDC鍋滄棰勮 lt 20211009 end
@@ -817,7 +820,8 @@
                //NoDiscount 閲戦锛圲SD锛�
                ,NoDiscount_Foreign__c
                //澶栬锤澶氬勾淇� 2021/01/27 绮剧悽鎶�鏈� wql end
-
+                //fy 棰勭暀浜у搧鏍囪瘑
+                ,LastbuyProductFLG__c
                //SFDC鍋滄棰勮 lt 20211009 start
                ,Estimated_ConsumptionDueDate__c
                //SFDC鍋滄棰勮 lt 20211009 end
@@ -1230,7 +1234,8 @@
                         //NoDiscount 閲戦锛圲SD锛�
                         ,NoDiscount_Foreign__c
                         //澶栬锤澶氬勾淇� 2021/01/27 绮剧悽鎶�鏈� wql end
-
+                        //fy 棰勭暀浜у搧鏍囪瘑
+                        ,LastbuyProductFLG__c
                         //SFDC鍋滄棰勮 lt 20211009 start
                         ,Estimated_ConsumptionDueDate__c
                         //SFDC鍋滄棰勮 lt 20211009 end
@@ -1682,9 +1687,19 @@
             }
             //20220215 fy lastbuy start
             if(!ReservedProductVerification()){
-                errorflg = true;
-                errormessage =  '浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺' ;
-                return null;
+                if(flglastbuy==1){
+                    errorflg = true;
+                    errormessage =  '棰勭暀浜у搧琛ㄤ腑娌℃湁褰曞叆璇ユ姤浠风殑棰勭暀浜у搧' ;
+                    return null;
+                  }else if(flglastbuy==2){
+                    errorflg = true;
+                    errormessage =  errorProductmodel+'浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺' ;
+                    return null;
+                  }else if(flglastbuy==3){
+                    errorflg = true;
+                    errormessage =  '棰勭暀浜у搧'+errorProductmodel+'鏈綍鍏ラ鐣欎骇鍝佽〃';
+                    return null;
+                  }
             }
               //20220215 fy lastbuy end
             system.debug('PassFlg:'+PassFlg);
@@ -2774,26 +2789,79 @@
 public boolean ReservedProductVerification() {
     filg=true;
     Map<string,QuoteLineItem> quotlinitMap = new Map<string,QuoteLineItem>();
-    List<Id> lastProductFLGList = new List<Id>();
-    for(QELine qli : activities){
-      lastProductFLGList.add(qli.pageObject.PricebookEntry.Product2Id);
-      quotlinitMap.put(qli.pageObject.PricebookEntry.Product2Id,qli.pageObject);
+    List<Id> lastProductFLGListId = new List<Id>();
+    List<QuoteLineItem> lastProductFLGList = new List<QuoteLineItem>();
+    List<QuoteLineItem> act = new List<QuoteLineItem>();
+    List<QuoteLineItem> act2 = new List<QuoteLineItem>();
+    for(QELine aaa :activities){
+      if(aaa.pageObject.PricebookEntry.Product2Id!=null){
+        act.add(aaa.pageObject);
+      }
     }
-    if(lastProductFLGList!=null){
-        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGList and  effectiveFLG__c= true];
-        if(LastbuyObjList!=null){
-            for(LastbuyProduct__c lastbuypr :LastbuyObjList){
-              Decimal quoteLItemNum=0;
-              if(quotlinitMap.containsKey(lastbuypr.ProductName__c)){
-                  quoteLItemNum=quotlinitMap.get(lastbuypr.ProductName__c).Quantity__c;
-              }else{
-                  continue;
-              }
-              if(lastbuypr.LastbuyQuantity__c<quoteLItemNum){
-                filg=false;
-                break;
-              }
+    act2=act.deepClone();
+    Map<String,QuoteLineItem> map1 = new Map<String,QuoteLineItem>();
+    System.debug('activities1111111111112涓烘墍褰撲负澶氬!!!'+activities);
+    integer i =0;
+    for(QuoteLineItem pspsc :act2){
+      if(pspsc.PricebookEntry.Product2Id!=null){
+        if(map1.containsKey(pspsc.PricebookEntry.Product2Id)){
+          QuoteLineItem quoteLine = map1.get(pspsc.PricebookEntry.Product2Id);
+          quoteLine.Quantity__c =quoteLine.Quantity__c+pspsc.Quantity__c;
+          map1.put(pspsc.PricebookEntry.Product2Id,quoteLine);
+        }else{
+          map1.put(pspsc.PricebookEntry.Product2Id,pspsc);
+        }
+        // System.debug('34499879!!!'+activities);
+      }
+    }
+    System.debug('3434343!!!'+activities);
+    System.debug('5656565!!!'+map1);
+    for (QuoteLineItem value : map1.values()) {
+      if(value.PricebookEntry.Product2.LastbuyProductFLG__c){
+        lastProductFLGListId.add(value.PricebookEntry.Product2Id);
+        quotlinitMap.put(value.PricebookEntry.Product2Id,value);
+        lastProductFLGList.add(value);
+      }
+    }
+    System.debug('activities++++!!!'+activities);
+    System.debug('activities!!!'+map1.values());
+    System.debug('oppId!!!'+oppId);
+    System.debug('lastProductFLGList!!!'+lastProductFLGListId);
+    if(lastProductFLGListId!=null&&lastProductFLGListId.size()!=0){
+        List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : oppId and ProductName__c in :lastProductFLGListId and effectiveFLG__c = true];
+        Map<string,LastbuyProduct__c> LastbuyObjMap = new Map<string,LastbuyProduct__c>();
+        System.debug('LastbuyObjList+++++!!!'+LastbuyObjList);
+        if(LastbuyObjList!=null&&LastbuyObjList.size()!=0){
+          for(LastbuyProduct__c lastbuypr :LastbuyObjList){
+            LastbuyObjMap.put(lastbuypr.ProductName__c,lastbuypr);
+          }
+        }else{
+          flglastbuy=1;
+          filg=false;
+          return filg;
+        }
+        System.debug('LastbuyObjMap!!!'+LastbuyObjMap);
+        System.debug('lastProductFLGList+++++++!!!'+lastProductFLGList);
+        if(lastProductFLGList!=null&&lastProductFLGList.size()!=0){
+          for(QuoteLineItem lastbuypr :lastProductFLGList){
+            Decimal quoteLItemNum=0;
+            if(LastbuyObjMap.containsKey(lastbuypr.PricebookEntry.Product2Id)){
+                quoteLItemNum=LastbuyObjMap.get(lastbuypr.PricebookEntry.Product2Id).LastbuyQuantity__c;
+                System.debug('quoteLItemNum!!!'+quoteLItemNum);
+                System.debug('lastbuypr.pageObject.Quantity__c+++!!!'+lastbuypr.Quantity__c);
+                if(lastbuypr.Quantity__c>quoteLItemNum){
+                  errorProductmodel=lastbuypr.Asset_Model_No__c;
+                  flglastbuy=2;
+                  filg=false;
+                  break;
+                }
+            }else{
+              errorProductmodel=lastbuypr.Asset_Model_No__c;
+              flglastbuy=3;
+              filg=false;
+              break;
             }
+          }
         }
     }
     system.debug('filg====='+filg);
diff --git a/force-app/main/default/classes/SampleInventoryControllerTest.cls b/force-app/main/default/classes/SampleInventoryControllerTest.cls
index 5c852cb..71e649f 100644
--- a/force-app/main/default/classes/SampleInventoryControllerTest.cls
+++ b/force-app/main/default/classes/SampleInventoryControllerTest.cls
@@ -6,12 +6,21 @@
         if (rectCo.size() == 0) {
             throw new ControllerUtil.myException('not found 鍔炰簨澶� recodetype');
         }
+        List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Sample_order_list_detail__c' and Name = '鐩樼偣'];
+        if (rectCo.size() == 0) {
+            throw new ControllerUtil.myException('not found 鐩樼偣 recodetype');
+        }
         // 瀹㈡埛
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         Account Agency = new Account();
         Agency.RecordTypeId = rectCo[0].Id;
         Agency.Name = 'Katsu 銉嗐偣銉�';
         Agency.Quolified_Approve_Status__c = 'Draft';
         Agency.If_Need_Quolified__c = true;
+        Agency.ParentId = account2.Id;
         insert Agency;
         // 浜у搧
         Product2 product = new Product2();
@@ -55,7 +64,7 @@
         samOrderDetail.Standards__c        = 1;
         samOrderDetail.ItemQuantity__c     = 1;
         samOrderDetail.Inventory_Check__c  = 10;
-        samOrderDetail.RecordTypeId        = '0121m000000xWyw';
+        samOrderDetail.RecordTypeId        = rectCo1[0].Id;
         samOrderDetail.Inventory_Header__c = IHN.Id;
         insert samOrderDetail;
 
diff --git a/force-app/main/default/classes/SampleInventorySectionControllerTest.cls b/force-app/main/default/classes/SampleInventorySectionControllerTest.cls
index 6584609..50fdfcd 100644
--- a/force-app/main/default/classes/SampleInventorySectionControllerTest.cls
+++ b/force-app/main/default/classes/SampleInventorySectionControllerTest.cls
@@ -7,11 +7,16 @@
             throw new ControllerUtil.myException('not found 鍔炰簨澶� recodetype');
         }
         // 瀹㈡埛
+        Account account2 = new Account();
+		account2.Name = 'test1缁忛攢鍟�';
+        account2.RecordTypeId = '01210000000Qem1';
+        insert account2;
         Account Agency = new Account();
         Agency.RecordTypeId                = rectCo[0].Id;
         Agency.Name                        = 'Katsu 銉嗐偣銉�';
         Agency.Quolified_Approve_Status__c = 'Draft';
         Agency.If_Need_Quolified__c        = true;
+        Agency.ParentId = account2.Id;
         insert Agency;
 
         // 浜у搧
diff --git a/force-app/main/default/classes/SelectAssetEstimateVMController.cls b/force-app/main/default/classes/SelectAssetEstimateVMController.cls
index cd4eb7f..acfcd99 100644
--- a/force-app/main/default/classes/SelectAssetEstimateVMController.cls
+++ b/force-app/main/default/classes/SelectAssetEstimateVMController.cls
@@ -1,3 +1,4 @@
+/*gzw 浼樺寲Maximum view state size limit 杩藉姞 Transient */
 global class SelectAssetEstimateVMController {
     //test
     private String targetHospitalId = null;                                    // 浠婂緦绯诲垪鐥呴櫌鐢�
@@ -25,7 +26,7 @@
     public Asset ass { get; set; }
     // 2021銆�8銆�26 鍚堝悓鎶ヤ环椤甸潰鐨勪紭鍖栵紝鏃犱繚鏈夎澶囩偣妫�瀵硅薄閫夋嫨妗嗗彉榛� fxk end
     // 鐥呴櫌閰嶄笅銇磵鍏ユ鍣ㄣ伄鎯呭牨銈掓牸绱嶃仚銈嬨��
-    private List<Asset> assetRecords;                                               // TODO 绯诲垪鐥呴櫌銇牬鍚堛�併亾銇厤鍒椼伅鍥哄畾銇с亶銇亜銇с仚銆�
+    private Transient List<Asset> assetRecords;                                               // TODO 绯诲垪鐥呴櫌銇牬鍚堛�併亾銇厤鍒椼伅鍥哄畾銇с亶銇亜銇с仚銆�
     public List<AssetInfo> checkedAssets { get; set; }
     private List<AssetInfo> unCheckedAssets = new List<AssetInfo>();
     
@@ -3174,21 +3175,21 @@
     public class AssetInfo {
     // 鏂板悎鍚屽鍝佺‘淇濇彁渚� 褰撳墠鏍囪
     public Boolean etGFlg {get; set;}
-    public Integer lineNo {get; private set;}
+    public Transient Integer lineNo {get; private set;}
     public Boolean rec_checkBox_c {get; set;}
     public Asset rec { get; set; }
     public Maintenance_Contract_Asset_Estimate__c mcae { get; set; }
     public Boolean isManual { get; set; }
-    public Decimal orgPrice {get; private set;}
-    public Decimal orgPrice12 {get; private set;}
+    public Transient Decimal orgPrice {get; private set;}
+    public Transient Decimal orgPrice12 {get; private set;}
     // add by fxk 2021/9/9 鎺у埗鐐规瀵硅薄鏄惁鍙�� Star
     public Boolean CheckRows {get; private set;}
     // add by fxk 2021/9/9 鎺у埗鐐规瀵硅薄鏄惁鍙�� End
     
     //add by rentx 2020-11-12 LJPH-BV93RZ start
-    public String proName;
-    public String proSerialNumber;
-    public String proSerialName;
+    public Transient String proName;
+    public Transient String proSerialNumber;
+    public Transient String proSerialName;
     //add by rentx 2020-11-12 LJPH-BV93RZ end
     //add by mzy 2020-11-12 LJPH-BX9CVX start
     //public Date NoPartRiskDate;
diff --git a/force-app/main/default/classes/SimpleEventRegisterController.cls b/force-app/main/default/classes/SimpleEventRegisterController.cls
index 71263a9..cd29d41 100644
--- a/force-app/main/default/classes/SimpleEventRegisterController.cls
+++ b/force-app/main/default/classes/SimpleEventRegisterController.cls
@@ -1030,7 +1030,7 @@
                     }
                 }
                 if (this.targetEvent.Activity_Type2__c == '璨╁2搴�') {
-                    taskType = System.Label.AgencyVisit; // 缁忛攢鍟嗘嫓璁夸换鍔�
+                    taskType = System.Label.AgencyVisit; // 缁忛攢鍟嗘敮鎸佷换鍔�
                 }
                 if (this.targetEvent.Activity_Type2__c == '绀惧銈ゃ儥銉炽儓') {
                     taskType = System.Label.campaignFollow; // 瀛︽湳浼氳璺熻繘浠诲姟
@@ -1149,7 +1149,7 @@
                 taskAccType = '鐢ㄦ埛鎷滆';
             }
             if (this.targetEvent.Activity_Type2__c == '璨╁2搴�') {
-                taskAccType = '缁忛攢鍟嗘嫓璁�';
+                taskAccType = '缁忛攢鍟嗘敮鎸�';
             }
             if (this.targetEvent.Activity_Type2__c == '绀惧銈ゃ儥銉炽儓') {
                 taskAccType = '瀛︽湳浼氳';
@@ -1182,7 +1182,7 @@
                     taskAccType = '鐢ㄦ埛鎷滆';
                 }
                 if (this.targetEvent.Activity_Type2__c == '璨╁2搴�') {
-                    taskAccType = '缁忛攢鍟嗘嫓璁�';
+                    taskAccType = '缁忛攢鍟嗘敮鎸�';
                 }
                 if (this.targetEvent.Activity_Type2__c == '绀惧銈ゃ儥銉炽儓') {
                     taskAccType = '瀛︽湳浼氳';
diff --git a/force-app/main/default/classes/StaticParameter.cls b/force-app/main/default/classes/StaticParameter.cls
index e8862ac..c13c666 100644
--- a/force-app/main/default/classes/StaticParameter.cls
+++ b/force-app/main/default/classes/StaticParameter.cls
@@ -57,6 +57,9 @@
     public static Boolean EscapeOtherUpdateTenOwner = true;
 
     public static Boolean EscapeContactToUser = false;
+    
+    // 璺宠繃NFM701鎺ュ彛
+    public static Boolean EscapeNFM701Trigger = true;
 
     public StaticParameter(){
     }
diff --git a/force-app/main/default/classes/StatusPageController.cls b/force-app/main/default/classes/StatusPageController.cls
index 7508e54..8cf62b4 100644
--- a/force-app/main/default/classes/StatusPageController.cls
+++ b/force-app/main/default/classes/StatusPageController.cls
@@ -2,9 +2,6 @@
     public StatusPageController() {
         Inquiryform = new Inquiry_form__c();
     }
-    public String status{get;set;}
-    public String search{get;set;}
-    public String reason{get;set;}
     public Inquiry_form__c Inquiryform{get; set;}
 
     public void init(){
@@ -37,7 +34,14 @@
             if (String.isBlank(Inquiryform.Follow_Content__c) && String.isBlank(Inquiryform.Follow_Content_Other__c)) {
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '璺熻繘鍐呭涓嶈兘涓虹┖'));
             }
-        
+            if (String.isBlank(Inquiryform.Follow_Content__c)) {
+                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '璺熻繘鍐呭涓嶈兘涓虹┖'));
+            }
+            if ('鍏朵粬'.equals(Inquiryform.Follow_Content__c) && String.isBlank(Inquiryform.Follow_Content_Other__c)) {
+                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '璺熻繘鍐呭锛堝叾浠栵級涓嶈兘涓虹┖'));
+            }
+            // Date nowDT = Date.now();
+            Inquiryform.Follow_Date__c = Date.toDay();
             Inquiryform.Status__c = '03.宸茶窡杩�';
             update Inquiryform;
         }
diff --git a/force-app/main/default/classes/StatusPageControllerTest.cls b/force-app/main/default/classes/StatusPageControllerTest.cls
new file mode 100644
index 0000000..5c4011f
--- /dev/null
+++ b/force-app/main/default/classes/StatusPageControllerTest.cls
@@ -0,0 +1,352 @@
+@isTest
+private class StatusPageControllerTest {
+
+    static testMethod void testMethod1() {
+        //鍖婚櫌
+    	List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+        if (rectHp.size() == 0) {
+            return;
+        }
+        //绉戝
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'];
+        if (rectDpt.size() == 0) {
+            return;
+        }
+
+        
+		Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+
+		User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner;
+    	User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner2;
+
+
+
+    	Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
+        hp.FSE_GI_Main_Leader__c = hpOwner.Id;
+        hp.FSE_SP_Main_Leader__c = hpOwner2.Id;
+        insert hp;
+
+        //鎴樼暐绉戝
+        Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
+
+        Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt.Name         = '*';
+        dpt.Department_Name__c  = 'TestDepart';
+        dpt.ParentId            = dc.Id;
+        dpt.Department_Class__c = dc.Id;
+        dpt.Hospital__c         = hp.Id;
+        insert dpt;
+
+        Account dpt1 = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt1.Name         = '*';
+        dpt1.Department_Name__c  = 'TestDepart1';
+        dpt1.ParentId            = dc.Id;
+        dpt1.Department_Class__c = dc.Id;
+        dpt1.Hospital__c         = hp.Id;
+        insert dpt1;
+
+
+        Inquiry_form__c inquiryform = new Inquiry_form__c();
+        // inquiryform.Name = '2019102101';
+        inquiryform.Hospital_Name__c = dpt1.Id;
+        List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id];
+        inquiryform.Department_Class__c = dpecList[0].Department_Class__c;
+        inquiryform.Status__c ='01.鏈窡杩�';
+        inquiryform.Company__c ='鍖椾含鏌愭煇鏌愭祴璇曞叕鍙�';
+        inquiryform.Family_Name__c ='闈�';
+        inquiryform.Opportunity_Division__c = '璇环';
+        inquiryform.Phone__c = '13844756322';
+        inquiryform.Product1__c = '瓒呭0';
+        inquiryform.Request1__c = '闇�瑕佹姤浠�';
+        inquiryform.Reasons_options__c = '宸茬粡鏈夎浠�';
+        Test.startTest();
+        insert inquiryform;
+        PageReference page = new PageReference('/apex/StatusPage?id='+inquiryform.Id);
+		System.Test.setCurrentPage(page);
+		StatusPageController controller = new StatusPageController();
+		controller.init();
+		controller.save();
+		controller.savefo();
+    }
+    static testMethod void testMethod2() {
+        //鍖婚櫌
+    	List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+        if (rectHp.size() == 0) {
+            return;
+        }
+        //绉戝
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'];
+        if (rectDpt.size() == 0) {
+            return;
+        }
+
+        
+		Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+
+		User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner;
+    	User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner2;
+
+
+
+    	Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
+        hp.FSE_GI_Main_Leader__c = hpOwner.Id;
+        hp.FSE_SP_Main_Leader__c = hpOwner2.Id;
+        insert hp;
+
+        //鎴樼暐绉戝
+        Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
+
+        Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt.Name         = '*';
+        dpt.Department_Name__c  = 'TestDepart';
+        dpt.ParentId            = dc.Id;
+        dpt.Department_Class__c = dc.Id;
+        dpt.Hospital__c         = hp.Id;
+        insert dpt;
+
+        Account dpt1 = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt1.Name         = '*';
+        dpt1.Department_Name__c  = 'TestDepart1';
+        dpt1.ParentId            = dc.Id;
+        dpt1.Department_Class__c = dc.Id;
+        dpt1.Hospital__c         = hp.Id;
+        insert dpt1;
+
+
+        Inquiry_form__c inquiryform = new Inquiry_form__c();
+        // inquiryform.Name = '2019102101';
+        inquiryform.Hospital_Name__c = dpt1.Id;
+        List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id];
+        inquiryform.Department_Class__c = dpecList[0].Department_Class__c;
+        inquiryform.Status__c ='01.鏈窡杩�';
+        inquiryform.Company__c ='鍖椾含鏌愭煇鏌愭祴璇曞叕鍙�';
+        inquiryform.Family_Name__c ='闈�';
+        inquiryform.Opportunity_Division__c = '璇环';
+        inquiryform.Phone__c = '13844756322';
+        inquiryform.Product1__c = '瓒呭0';
+        inquiryform.Request1__c = '闇�瑕佹姤浠�';
+        inquiryform.Reasons_options__c = '瀹㈡埛鏃犳剰鍚�';
+        inquiryform.Follow_Content__c = '';
+        Test.startTest();
+        insert inquiryform;
+        PageReference page = new PageReference('/apex/StatusPage?id='+inquiryform.Id);
+		System.Test.setCurrentPage(page);
+		StatusPageController controller = new StatusPageController();
+		controller.init();
+		controller.save();
+		controller.savefo();
+    }
+    static testMethod void testMethod2_1() {
+        //鍖婚櫌
+    	List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+        if (rectHp.size() == 0) {
+            return;
+        }
+        //绉戝
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'];
+        if (rectDpt.size() == 0) {
+            return;
+        }
+
+        
+		Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+
+		User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner;
+    	User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner2;
+
+
+
+    	Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
+        hp.FSE_GI_Main_Leader__c = hpOwner.Id;
+        hp.FSE_SP_Main_Leader__c = hpOwner2.Id;
+        insert hp;
+
+        //鎴樼暐绉戝
+        Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
+
+        Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt.Name         = '*';
+        dpt.Department_Name__c  = 'TestDepart';
+        dpt.ParentId            = dc.Id;
+        dpt.Department_Class__c = dc.Id;
+        dpt.Hospital__c         = hp.Id;
+        insert dpt;
+
+        Account dpt1 = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt1.Name         = '*';
+        dpt1.Department_Name__c  = 'TestDepart1';
+        dpt1.ParentId            = dc.Id;
+        dpt1.Department_Class__c = dc.Id;
+        dpt1.Hospital__c         = hp.Id;
+        insert dpt1;
+
+
+        Inquiry_form__c inquiryform = new Inquiry_form__c();
+        // inquiryform.Name = '2019102101';
+        inquiryform.Hospital_Name__c = dpt1.Id;
+        List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id];
+        inquiryform.Department_Class__c = dpecList[0].Department_Class__c;
+        inquiryform.Status__c ='01.鏈窡杩�';
+        inquiryform.Company__c ='鍖椾含鏌愭煇鏌愭祴璇曞叕鍙�';
+        inquiryform.Family_Name__c ='闈�';
+        inquiryform.Opportunity_Division__c = '璇环';
+        inquiryform.Phone__c = '13844756322';
+        inquiryform.Product1__c = '瓒呭0';
+        inquiryform.Request1__c = '闇�瑕佹姤浠�';
+        inquiryform.Reasons_options__c = '';
+        inquiryform.Follow_Content__c = '';
+        Test.startTest();
+        insert inquiryform;
+        PageReference page = new PageReference('/apex/StatusPage?id='+inquiryform.Id);
+		System.Test.setCurrentPage(page);
+		StatusPageController controller = new StatusPageController();
+		controller.init();
+		controller.save();
+    }
+    static testMethod void testMethod3() {
+        //鍖婚櫌
+    	List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+        if (rectHp.size() == 0) {
+            return;
+        }
+        //绉戝
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'];
+        if (rectDpt.size() == 0) {
+            return;
+        }
+
+        
+		Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+
+		User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner;
+    	User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner2;
+
+
+
+    	Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
+        hp.FSE_GI_Main_Leader__c = hpOwner.Id;
+        hp.FSE_SP_Main_Leader__c = hpOwner2.Id;
+        insert hp;
+
+        //鎴樼暐绉戝
+        Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
+
+        Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt.Name         = '*';
+        dpt.Department_Name__c  = 'TestDepart';
+        dpt.ParentId            = dc.Id;
+        dpt.Department_Class__c = dc.Id;
+        dpt.Hospital__c         = hp.Id;
+        insert dpt;
+
+        Account dpt1 = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt1.Name         = '*';
+        dpt1.Department_Name__c  = 'TestDepart1';
+        dpt1.ParentId            = dc.Id;
+        dpt1.Department_Class__c = dc.Id;
+        dpt1.Hospital__c         = hp.Id;
+        insert dpt1;
+
+
+        Inquiry_form__c inquiryform = new Inquiry_form__c();
+        // inquiryform.Name = '2019102101';
+        inquiryform.Hospital_Name__c = dpt1.Id;
+        List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id];
+        inquiryform.Department_Class__c = dpecList[0].Department_Class__c;
+        inquiryform.Status__c ='01.鏈窡杩�';
+        inquiryform.Company__c ='鍖椾含鏌愭煇鏌愭祴璇曞叕鍙�';
+        inquiryform.Family_Name__c ='闈�';
+        inquiryform.Opportunity_Division__c = '璇环';
+        inquiryform.Phone__c = '13844756322';
+        inquiryform.Product1__c = '瓒呭0';
+        inquiryform.Request1__c = '闇�瑕佹姤浠�';
+        inquiryform.Reasons_options__c = '瀹㈡埛鏃犳剰鍚�';
+        inquiryform.Follow_Content_Other__c = '';
+        inquiryform.Follow_Content__c = '';
+        Test.startTest();
+        insert inquiryform;
+        PageReference page = new PageReference('/apex/FollowPage?id='+inquiryform.Id);
+		System.Test.setCurrentPage(page);
+		StatusPageController controller = new StatusPageController();
+		controller.init();
+		controller.savefo();
+    }
+    static testMethod void testMethod4() {
+        //鍖婚櫌
+    	List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'];
+        if (rectHp.size() == 0) {
+            return;
+        }
+        //绉戝
+        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI'];
+        if (rectDpt.size() == 0) {
+            return;
+        }
+
+        
+		Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin];
+
+		User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner;
+    	User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id);
+    	insert hpOwner2;
+
+
+
+    	Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id);
+        hp.FSE_GI_Main_Leader__c = hpOwner.Id;
+        hp.FSE_SP_Main_Leader__c = hpOwner2.Id;
+        insert hp;
+
+        //鎴樼暐绉戝
+        Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI'];
+
+        Account dpt = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt.Name         = '*';
+        dpt.Department_Name__c  = 'TestDepart';
+        dpt.ParentId            = dc.Id;
+        dpt.Department_Class__c = dc.Id;
+        dpt.Hospital__c         = hp.Id;
+        insert dpt;
+
+        Account dpt1 = new Account(RecordTypeId = rectDpt[0].Id);
+        dpt1.Name         = '*';
+        dpt1.Department_Name__c  = 'TestDepart1';
+        dpt1.ParentId            = dc.Id;
+        dpt1.Department_Class__c = dc.Id;
+        dpt1.Hospital__c         = hp.Id;
+        insert dpt1;
+
+
+        Inquiry_form__c inquiryform = new Inquiry_form__c();
+        // inquiryform.Name = '2019102101';
+        inquiryform.Hospital_Name__c = dpt1.Id;
+        List<Account> dpecList = [select Id,Department_Class__c from Account where Id =: dpt1.Id];
+        inquiryform.Department_Class__c = dpecList[0].Department_Class__c;
+        inquiryform.Status__c ='01.鏈窡杩�';
+        inquiryform.Company__c ='鍖椾含鏌愭煇鏌愭祴璇曞叕鍙�';
+        inquiryform.Family_Name__c ='闈�';
+        inquiryform.Opportunity_Division__c = '璇环';
+        inquiryform.Phone__c = '13844756322';
+        inquiryform.Product1__c = '瓒呭0';
+        inquiryform.Request1__c = '闇�瑕佹姤浠�';
+        inquiryform.Reasons_options__c = '瀹㈡埛鏃犳剰鍚�';
+        inquiryform.Follow_Content_Other__c = '';
+        inquiryform.Follow_Content__c = '鍏朵粬';
+        Test.startTest();
+        insert inquiryform;
+        PageReference page = new PageReference('/apex/FollowPage?id='+inquiryform.Id);
+		System.Test.setCurrentPage(page);
+		StatusPageController controller = new StatusPageController();
+		controller.init();
+		controller.savefo();
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/StatusPageControllerTest.cls-meta.xml b/force-app/main/default/classes/StatusPageControllerTest.cls-meta.xml
new file mode 100644
index 0000000..f3bac1f
--- /dev/null
+++ b/force-app/main/default/classes/StatusPageControllerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>41.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/TaskObjectTriggerHandle.cls b/force-app/main/default/classes/TaskObjectTriggerHandle.cls
index 5d8ee26..d898dfb 100644
--- a/force-app/main/default/classes/TaskObjectTriggerHandle.cls
+++ b/force-app/main/default/classes/TaskObjectTriggerHandle.cls
@@ -235,7 +235,7 @@
         taskPREMap.put('H灞傛嫓璁�','鐢ㄦ埛鎷滆:AccountName');
         taskPREMap.put('OPD','鐢ㄦ埛鎷滆:AccountName');
         taskPREMap.put('SLA鎶ュ憡涔︿换鍔�','鏈嶅姟鍚堝悓鍙戞斁鎶ュ憡涔︿换鍔★紙AccountName)');
-        taskPREMap.put('缁忛攢鍟嗘嫓璁�','缁忛攢鍟嗘嫓璁�:AccountName');
+        taskPREMap.put('缁忛攢鍟嗘敮鎸�','缁忛攢鍟嗘敮鎸�:AccountName');
         taskPREMap.put('瀛︽湳浼氳璺熻繘','瀛︽湳浼氳:CampaignName');
         taskPREMap.put('鏈嶅姟瀛f姤','鐢ㄦ埛鎷滆:AccountName');
         taskPREMap.put('鐩爣瀹㈡埛鎷滆','鐢ㄦ埛鎷滆:AccountName');
diff --git a/force-app/main/default/classes/TenderDeleteLwcController.cls b/force-app/main/default/classes/TenderDeleteLwcController.cls
index af1dc83..f54b859 100644
--- a/force-app/main/default/classes/TenderDeleteLwcController.cls
+++ b/force-app/main/default/classes/TenderDeleteLwcController.cls
@@ -2,7 +2,7 @@
     @AuraEnabled
     public static  String GetTenderinformationcData(String ParamIdStr) {
 
-         List<Tender_information__c> arrays = Database.query('Select Id, InfoId__c, Logical_delete__c, ProjectId__c, Retain_Tender__c From Tender_information__c Where id = : ParamIdStr');
+         List<Tender_information__c> arrays = Database.query('Select Id,Name,InfoId__c,Logical_delete__c,ProjectId__c,Retain_Tender__c From Tender_information__c Where id = : ParamIdStr');
          
          return JSON.serialize(arrays);
     }
@@ -58,9 +58,20 @@
 					insert addlinksList;
 				}
 			}
+			// 銆愬鎵樸�戞嫑鏍囬」鐩�-閫昏緫鍒犻櫎鐨勯」鐩渶瑕佽嚜鍔ㄥ彇娑堜笌璇环鐨勫叧绯� fy 2022.3.7 start
+			List<Tender_Opportunity_Link__c> linksListdelect = [select id, Opportunity__c, Tender_information__c
+			        from Tender_Opportunity_Link__c
+			        where Tender_information__c = :TenInfo.Id];
+			if(linksListdelect.size()>0){
+				delete linksListdelect;
+			}
+			// 銆愬鎵樸�戞嫑鏍囬」鐩�-閫昏緫鍒犻櫎鐨勯」鐩渶瑕佽嚜鍔ㄥ彇娑堜笌璇环鐨勫叧绯� fy 2022.3.7 end
 			// }
 			// 浜掓崲淇濈暀鎷涙姇鏍囦笌鍒犻櫎鎷涙姇鏍囩殑淇℃伅Id
 			TenInfo.Retain_Tender__c = BTen.Id;
+			// 銆愬鎵樸�戞嫑鏍囬」鐩�-閫昏緫鍒犻櫎鐨勯」鐩渶瑕佽嚜鍔ㄥ彇娑堜笌璇环鐨勫叧绯� fy 2022.3.7 start
+			TenInfo.Name = '閫昏緫鍒犻櫎:'+TenInfo.Name;
+			// 銆愬鎵樸�戞嫑鏍囬」鐩�-閫昏緫鍒犻櫎鐨勯」鐩渶瑕佽嚜鍔ㄥ彇娑堜笌璇环鐨勫叧绯� fy 2022.3.7 end
 			String BTenInfo = BTen.InfoId__c;
 			BTen.InfoId__c = TenInfo.InfoId__c;//淇濈暀鎷涙姇鏍囩殑淇℃伅Id璧嬬粰鍒犻櫎鎷涙姇鏍囩殑淇℃伅Id
 			TenInfo.InfoId__c = BTenInfo;//鍒犻櫎鎷涙姇鏍囩殑淇℃伅Id璧嬬粰淇濈暀鎷涙姇鏍囩殑淇℃伅Id
diff --git a/force-app/main/default/classes/TenderWebService.cls b/force-app/main/default/classes/TenderWebService.cls
index 47120fe..c4d3047 100644
--- a/force-app/main/default/classes/TenderWebService.cls
+++ b/force-app/main/default/classes/TenderWebService.cls
@@ -4,7 +4,7 @@
 	}
 	//鎷涙姇鏍囧弽閫昏緫鍒犻櫎
 	WebService static String ContraryLogicalDel(String DTenId) {
-		Tender_information__c DTenInfo = [Select Id, InfoId__c, Logical_delete__c, ProjectId__c, Retain_Tender__c From Tender_information__c Where id = : DTenId];
+		Tender_information__c DTenInfo = [Select Id,Name, InfoId__c, Logical_delete__c, ProjectId__c, Retain_Tender__c From Tender_information__c Where id = : DTenId];
 		// 鏇存柊鍒犻櫎鎷涙姇鏍�
 		List<Tender_information__c> updateTenInfoList = new List<Tender_information__c>();
 		// 鏇存柊淇濈暀鎷涙姇鏍�
@@ -62,6 +62,15 @@
 
 			// 浜掓崲淇濈暀鎷涙姇鏍囦笌鍒犻櫎鎷涙姇鏍囩殑淇℃伅Id
 			DTenInfo.Retain_Tender__c = BTen.Id;
+
+			if(String.isNotBlank(DTenInfo.Name)){
+				String Namesliep=DTenInfo.Name.substring(0,5);
+				system.debug('Namesliep++'+Namesliep);
+				system.debug('234234++'+Namesliep.equals('閫昏緫鍒犻櫎:'));
+				if(Namesliep.equals('閫昏緫鍒犻櫎:')){
+					DTenInfo.Name=DTenInfo.Name.substring(5);
+				}
+			}
 			String BTenInfo = BTen.InfoId__c;
 			BTen.InfoId__c = DTenInfo.InfoId__c;//淇濈暀鎷涙姇鏍囩殑淇℃伅Id璧嬬粰鍒犻櫎鎷涙姇鏍囩殑淇℃伅Id
 			DTenInfo.InfoId__c = BTenInfo;//鍒犻櫎鎷涙姇鏍囩殑淇℃伅Id璧嬬粰淇濈暀鎷涙姇鏍囩殑淇℃伅Id
diff --git a/force-app/main/default/classes/UploadOBPMController.cls b/force-app/main/default/classes/UploadOBPMController.cls
index d67f5c7..9b39eba 100644
--- a/force-app/main/default/classes/UploadOBPMController.cls
+++ b/force-app/main/default/classes/UploadOBPMController.cls
@@ -1,9 +1,10 @@
 public without sharing class UploadOBPMController {
     private String Id { get; set; }
     private String errorStr { get; set; }
-    public boolean hasError { get; set; }
+    public Boolean hasError { get; set; }
     public List<OBPMInfo> OBPMInfoList { get; set; }
     public Integer lineNo { get; set; }
+    public Boolean IF_Approved { get; set; }
 
     public UploadOBPMController() {
         Id = ApexPages.currentPage().getParameters().get('id');
@@ -13,17 +14,54 @@
         hasError = false;
         OBPMInfoList = new  List<OBPMInfo>();
         
-        List<Campaign> camList = [select id, Name, Shared_User__c from Campaign where id = :Id];
-        if (camList.size() == 0) {
+        Campaign cam = [select id, Name, Shared_User__c, IF_Approved__c, Shared_Editing__c, Carbon_Copy__c from Campaign where id = :Id];
+        if (cam == null || String.isBlank(cam.Id)) {
             ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '瀛︿細涓嶅瓨鍦ㄣ��'));
             hasError = true;
             return;
         }
+
+        IF_Approved = cam.IF_Approved__c;
+
+        List<String> user_nos = new List<String>();
+        if (String.isNotBlank(cam.Shared_Editing__c)) {
+            user_nos.addAll(cam.Shared_Editing__c.split(','));
+        }
+        if (String.isNotBlank(cam.Carbon_Copy__c)) {
+            user_nos.addAll(cam.Carbon_Copy__c.split(','));
+        }
+        List<User> users = new List<User>();
+        if (user_nos.size() > 0) {
+            users = [select Id, Employee_No__c from User where Employee_No__c in :user_nos];
+        }
+
         Integer line = 0;
-        for (Integer i = 0; i < 5; i++) {
-            line += 1;
-            OBPMInfo temp = new OBPMInfo(line, new Campaign());
-            OBPMInfoList.add(temp);
+        if (users != null && users.size() > 0) {
+            for(User u : users) {
+                line += 1;
+                Campaign t_cam = new Campaign();
+                t_cam.Shared_User__c = u.Id;
+                OBPMInfo temp = new OBPMInfo(line, t_cam);
+                if (String.isNotBlank(cam.Shared_Editing__c) && cam.Shared_Editing__c.contains(u.Employee_No__c)) {
+                    temp.Role = '鍏卞悓缂栬緫浜�';
+                } else if (String.isNotBlank(cam.Carbon_Copy__c) && cam.Carbon_Copy__c.contains(u.Employee_No__c)) {
+                    temp.Role = '鎶勯�佷汉';
+                } 
+                OBPMInfoList.add(temp);
+            }
+            if (users.size() < 5) {
+                Integer line_add = 5 - users.size();
+                for (Integer i = 0; i < line_add; i++) {
+                    OBPMInfo temp = new OBPMInfo(line, new Campaign());
+                    OBPMInfoList.add(temp);
+                }
+            }
+        } else {
+            for (Integer i = 0; i < 5; i++) {
+                line += 1;
+                OBPMInfo temp = new OBPMInfo(line, new Campaign());
+                OBPMInfoList.add(temp);
+            }
         }
     }
 
@@ -61,7 +99,7 @@
         return null;
     }
 
-    public PageReference uploadOBPM() {
+    public void uploadOBPM() {
         List<String> userIdList = new List<String>();
         Map<String,String> userMap = new Map<String,String>();
         List<Campaign> camList = new List<Campaign>();
@@ -72,8 +110,8 @@
             }
         }
         if(userIdList.size() > 0){
-            String SharedEditing;
-            String CarbonCopy;
+            String SharedEditing = '';
+            String CarbonCopy = '';
             List<User> userList = [select id, Employee_No__c from User where id = :userIdList];
             for(User user : userList){
                 userMap.put(user.id, user.Employee_No__c);
@@ -82,34 +120,38 @@
                 if(String.isNotBlank(ob.cam.Shared_User__c)){
                     if(userMap.containsKey(ob.cam.Shared_User__c)){
                         if(ob.Role == '鍏卞悓缂栬緫浜�'){
-                            SharedEditing += userMap.get(ob.cam.Shared_User__c) + ',';
+                            SharedEditing += String.isNotBlank(userMap.get(ob.cam.Shared_User__c))? userMap.get(ob.cam.Shared_User__c) + ',' : '';
                         } else if(ob.Role == '鎶勯�佷汉'){
-                            CarbonCopy += userMap.get(ob.cam.Shared_User__c) + ',';
+                            CarbonCopy += String.isNotBlank(userMap.get(ob.cam.Shared_User__c))? userMap.get(ob.cam.Shared_User__c) + ',' : '';
                         }
                     }
                 }
             }
             //鎴彇鎺塶ull鍜屾渶鍚庣殑閫楀彿
-            SharedEditing = SharedEditing.substring(4, SharedEditing.lastIndexOf(','));
-            CarbonCopy = CarbonCopy.substring(4, CarbonCopy.lastIndexOf(','));
+            SharedEditing = SharedEditing.length() > 0 ? SharedEditing.substring(0, SharedEditing.lastIndexOf(',')) : '';
+            CarbonCopy = CarbonCopy.length() > 0 ? CarbonCopy.substring(0, CarbonCopy.lastIndexOf(',')) : '';
             cam.Shared_Editing__c = SharedEditing;
             cam.Carbon_Copy__c = CarbonCopy;
             camList.add(cam);
         }
         errorStr = '';
         Savepoint sp = Database.setSavepoint();
-        try {
+        // try {
             if(camList.size() > 0){
                 update camList;
+
+                // 703鎺ュ彛瑙﹀彂
+                List<String> cam_ids = new List<String>();
+                cam_ids.add(cam.Id);
+                NFM703Controller.callout(null,cam_ids);
             }
-        } catch (System.Exception e) {
-            Database.rollback(sp);
-            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
-            errorStr = e.getMessage();
-            hasError = true;
-            return null;
-        }
-        return null;
+        // } catch (System.Exception e) {
+        //     Database.rollback(sp);
+        //     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage()));
+        //     errorStr = e.getMessage();
+        //     hasError = true;
+        //     return null;
+        // }
     }
 
     public class OBPMInfo {
diff --git a/force-app/main/default/classes/UploadOBPMControllerTest.cls b/force-app/main/default/classes/UploadOBPMControllerTest.cls
new file mode 100644
index 0000000..0aec29d
--- /dev/null
+++ b/force-app/main/default/classes/UploadOBPMControllerTest.cls
@@ -0,0 +1,75 @@
+@isTest
+private class UploadOBPMControllerTest {
+    public static Campaign cam;
+    
+    static void init(){
+        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Campaign' and Name = '1.瀛︿細/浼氳'];
+        if (rectCo.size() == 0) {
+            throw new ControllerUtil.myException('not found 1.瀛︿細/浼氳 recordtype');
+        }
+        System.runAs(new User(Id = Userinfo.getUserId())) {
+            User user = new User(Test_staff__c = true);
+            user.LastName = '_銈点兂銉栥儶銉冦偢';
+            user.FirstName = '銇�';
+            user.Alias = '銇�';
+            user.Email = 'olympusTest03@sunbridge.com';
+            user.Username = 'olympusTest03@sunbridge.com';
+            user.IsActive = true;
+            user.EmailEncodingKey = 'ISO-2022-JP';
+            user.TimeZoneSidKey = 'Asia/Tokyo';
+            user.LocaleSidKey = 'ja_JP';
+            user.LanguageLocaleKey = 'ja';
+            user.ProfileId = System.Label.ProfileId_SystemAdmin;
+            user.Province__c = '鍖椾含';
+            user.Dept__c = '鍖荤枟鍗庡寳钀ヤ笟鏈儴';
+            user.Use_Start_Date__c = Date.today().addMonths(-6);
+            insert user;
+            
+            cam = new Campaign();
+            cam.Name = 'test campaign';
+            cam.StartDate = Date.today().addDays(15);
+            cam.EndDate = Date.today().addDays(18);
+            cam.Name2__c = '1234';
+            cam.Status = '鐢宠涓�';
+            cam.Mailflg_after45__c = true;
+            cam.Mailflg_cancel__c = true;
+            cam.Mailflg_before15__c = true;
+            cam.Mailflg_before7__c = true;
+            cam.Mailflg_after3__c = true;
+            cam.HostName__c = '1';
+            cam.cooperatorCompany__c = '1';
+            cam.RecordTypeId = rectCo[0].Id;
+            cam.OwnerId = user.Id;
+            insert cam;
+        }
+    }
+
+    static testMethod void testSample_01() {
+        init();
+        User user = new User();
+        User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
+        System.runAs (thisUser) {
+            Profile p = [SELECT Id FROM Profile WHERE Name LIKE '%2B1%' Limit 1];
+            UserRole r = [SELECT Id FROM UserRole WHERE DeveloperName = 'beipin_huadong_staff' Limit 1];
+            user = new User(alias = 'test', email='test@acme.com', 
+                emailencodingkey='UTF-8', lastname='test', 
+                languagelocalekey='en_US', 
+                localesidkey='en_US', profileid = p.Id, userroleid = r.Id,
+                timezonesidkey='America/Los_Angeles', 
+                username='test@acme.com' + Datetime.now().getTime());
+            insert user;
+        }
+        PageReference page = new PageReference('/apex/BatchSelectRepairPage?id='+cam.Id);
+        System.Test.setCurrentPage(page);
+        System.Test.StartTest();
+        UploadOBPMController ub = new UploadOBPMController();
+        ub.init();
+        ub.OBPMInfoList[0].cam.Shared_User__c = user.Id;
+        ub.OBPMInfoList[0].Role = '鍏卞悓缂栬緫浜�';
+        ub.addLine();
+        ub.deleteLine();
+        ub.uploadOBPM();
+        System.Test.StopTest();
+    }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/UploadOBPMControllerTest.cls-meta.xml b/force-app/main/default/classes/UploadOBPMControllerTest.cls-meta.xml
new file mode 100644
index 0000000..dd61d1f
--- /dev/null
+++ b/force-app/main/default/classes/UploadOBPMControllerTest.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>52.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
diff --git a/force-app/main/default/classes/WeeklyReportCmp.cls b/force-app/main/default/classes/WeeklyReportCmp.cls
index 22e2175..f2e8ce8 100644
--- a/force-app/main/default/classes/WeeklyReportCmp.cls
+++ b/force-app/main/default/classes/WeeklyReportCmp.cls
@@ -86,7 +86,10 @@
 
         //闃舵 StageName__c
         this.allselectlist.put('StageName__c', WeeklyReportCmp.getPicklistValues('Agency_Opportunity__c','StageName__c'));
-
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+        // 鏀彺闇�姹� SupportNeeds__c
+        this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c'));
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
         // 鑱屼綅
 //        this.allselectlist.put('visitor_title__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','visitor_title__c'));
 
@@ -287,24 +290,24 @@
     */
 
     @RemoteAction
-    @AuraEnabled
-    public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
+    @AuraEnabled//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc
+    public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,String SupportNeedsc,
             String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
             String Product_Category1, String Product_Category2, String Product_Category3,
             String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
     {
         Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy, Purpose_Type, Agency_Report_Header,
             Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
-            Product_Category1, Product_Category2, Product_Category3,
-            Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date);
+            Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc
+            Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date,SupportNeedsc);
 
         agency_report = LightningUtil.insertAgencyReport(agency_report);
         return agency_report.Id;
     }
     public static Agency_Report__c makeAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
             String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
-            String Product_Category1, String Product_Category2, String Product_Category3,
-            String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
+            String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
+            String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc)
     {
         Agency_Report__c agency_report = new Agency_Report__c();
         Date week = Date.valueOf(Submit_date);
@@ -333,6 +336,9 @@
         if (doctor != '') { agency_report.doctor2__c = doctor; } else { agency_report.doctor2__c = null; }
         if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; }
         if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; }
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+        if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; }
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
         if (Agency_Report_Header != '') { agency_report.Agency_Report_Header__c = Agency_Report_Header; }
         if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; }
         //if (olympus_calendar_id != '') { agency_report.Submit_date_Calendar__c = olympus_calendar_id; }
@@ -371,13 +377,13 @@
     @AuraEnabled
     public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
                                         String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
-                                        String Product_Category1, String Product_Category2, String Product_Category3, 
-                                        String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
+                                        String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
+                                        String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc)
     {
         if (String.isBlank(Agency_Report_Id)) {
             return null;
-        }
-        Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c,
+        }//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
+        Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c,SupportNeeds__c,
                                           Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c
                                           from Agency_Report__c where id=:Agency_Report_Id];
         Date week = Date.valueOf(Submit_date);
@@ -397,11 +403,13 @@
         if (Agency_Hospital != '')  {
             LightningUtil.updateAccMaxActivityDate(Agency_Hospital, week);
         }
-
+        system.debug('Purpose_Type+++==++==='+Purpose_Type);
         // WRITE Agency Report__c
         if (doctor != '') { agency_report.doctor2__c = doctor; } else { agency_report.doctor2__c = null; }
         if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; }
         if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } else { agency_report.Purpose_Type__c = null; }
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
+        if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; }
         if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } else { agency_report.Agency_Hospital__c = null; }
         if (Product_Category1 != '') { agency_report.Product_Category1__c = Product_Category1; } else { agency_report.Product_Category1__c = null; }
         if (Product_Category2 != '') { agency_report.Product_Category2__c = Product_Category2; } else { agency_report.Product_Category2__c = null; }
diff --git a/force-app/main/default/classes/WeeklyReportCmpTest.cls b/force-app/main/default/classes/WeeklyReportCmpTest.cls
index 2b6b1da..5c88abf 100644
--- a/force-app/main/default/classes/WeeklyReportCmpTest.cls
+++ b/force-app/main/default/classes/WeeklyReportCmpTest.cls
@@ -43,8 +43,7 @@
         contact2.LastName = 'test1缁忛攢鍟�';
         insert contact2;
 
-      
-        Profile p = [select Id, name from Profile where name = '901_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
+        Profile p = [select Id from Profile where Name = '901_缁忛攢鍟嗘椿鍔ㄧ郴缁�'];
         user.ProfileId = p.Id;
         user.ContactId = contact2.Id;
         user.FirstName = '銉︺兗銈躲兗';
diff --git a/force-app/main/default/classes/updateESignBatch.cls b/force-app/main/default/classes/updateESignBatch.cls
index 0f55d79..44d1e72 100644
--- a/force-app/main/default/classes/updateESignBatch.cls
+++ b/force-app/main/default/classes/updateESignBatch.cls
@@ -1041,7 +1041,9 @@
             //寰幆鎵惧埌鏂囦欢id
             if (fileDeleteIdList.size() > 0) {
 
-                List<Attachment> attachMentList = [SELECT id, parentId, Body, Name, ContentType,Description  from Attachment where parentId = :fileDeleteIdList];
+                // 2022-02-28 shashiming Apex heap size too large
+                // 鍘绘帀Body瀛楁
+                List<Attachment> attachMentList = [SELECT id, parentId, Name, ContentType,Description  from Attachment where parentId = :fileDeleteIdList];
 
                 if (attachMentList.size() > 0) {
                     for (Attachment att : attachMentList) {
diff --git a/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Coverage_Correlation__c.field-meta.xml b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Coverage_Correlation__c.field-meta.xml
new file mode 100644
index 0000000..87e209f
--- /dev/null
+++ b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Coverage_Correlation__c.field-meta.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Renew_Coverage_Correlation__c</fullName>
+    <externalId>false</externalId>
+    <formula>Renew_Target_Correlation_Lightsource__c</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>缁鐩爣锛氬懆杈�</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>2</scale>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_1__c.field-meta.xml b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_1__c.field-meta.xml
new file mode 100644
index 0000000..50cbec3
--- /dev/null
+++ b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_1__c.field-meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Renew_Finish_Rigid_Mirror_1__c</fullName>
+    <externalId>false</externalId>
+    <label>瀹為檯缁鏁帮紙杞級锛氱數瀛愰暅</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_2__c.field-meta.xml b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_2__c.field-meta.xml
new file mode 100644
index 0000000..dad8c10
--- /dev/null
+++ b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Finish_Rigid_Mirror_2__c.field-meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Renew_Finish_Rigid_Mirror_2__c</fullName>
+    <externalId>false</externalId>
+    <label>瀹為檯缁鏁帮紙纭級锛氭硨灏跨鐢ㄧ‖鎬ч暅</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Correlation_Lightsource__c.field-meta.xml b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Correlation_Lightsource__c.field-meta.xml
new file mode 100644
index 0000000..0f7788c
--- /dev/null
+++ b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Correlation_Lightsource__c.field-meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Renew_Target_Correlation_Lightsource__c</fullName>
+    <externalId>false</externalId>
+    <label>缁鐩爣锛堝懆杈癸級锛氬厜婧�</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Rigid_Mirror_2__c.field-meta.xml b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Rigid_Mirror_2__c.field-meta.xml
new file mode 100644
index 0000000..9872d7f
--- /dev/null
+++ b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Rigid_Mirror_2__c.field-meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Renew_Target_Rigid_Mirror_2__c</fullName>
+    <externalId>false</externalId>
+    <label>缁鐩爣锛堢‖锛夛細娉屽翱绉戠敤纭�ч暅</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Soft_Mirror_2__c.field-meta.xml b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Soft_Mirror_2__c.field-meta.xml
new file mode 100644
index 0000000..ac34db5
--- /dev/null
+++ b/force-app/main/default/objects/Account_Service_Of_Target__c/fields/Renew_Target_Soft_Mirror_2__c.field-meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Renew_Target_Soft_Mirror_2__c</fullName>
+    <externalId>false</externalId>
+    <label>缁鐩爣锛堣蒋锛夛細榧诲捊鍠夐暅</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Agency_Report__c/fields/SupportNeeds__c.field-meta.xml b/force-app/main/default/objects/Agency_Report__c/fields/SupportNeeds__c.field-meta.xml
new file mode 100644
index 0000000..7d1d1eb
--- /dev/null
+++ b/force-app/main/default/objects/Agency_Report__c/fields/SupportNeeds__c.field-meta.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>SupportNeeds__c</fullName>
+    <externalId>false</externalId>
+    <label>鏀彺闇�姹�</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>缁翠慨澶囧搧</fullName>
+                <default>false</default>
+                <label>缁翠慨澶囧搧</label>
+            </value>
+            <value>
+                <fullName>灞曠ず/璇曠敤澶囧搧</fullName>
+                <default>false</default>
+                <label>灞曠ず/璇曠敤澶囧搧</label>
+            </value>
+            <value>
+                <fullName>鎷涙爣/璋堝垽鍗忓姪</fullName>
+                <default>false</default>
+                <label>鎷涙爣/璋堝垽鍗忓姪</label>
+            </value>
+            <value>
+                <fullName>瀛︽湳浼氳-绉戝浼�</fullName>
+                <default>false</default>
+                <label>瀛︽湳浼氳-绉戝浼�</label>
+            </value>
+            <value>
+                <fullName>瀛︽湳浼氳-瀛︽湳娌欓緳</fullName>
+                <default>false</default>
+                <label>瀛︽湳浼氳-瀛︽湳娌欓緳</label>
+            </value>
+            <value>
+                <fullName>鍖绘姢鍩硅-浜у搧浣跨敤鏂规硶鍙婃敞鎰忎簨椤�</fullName>
+                <default>false</default>
+                <label>鍖绘姢鍩硅-浜у搧浣跨敤鏂规硶鍙婃敞鎰忎簨椤�</label>
+            </value>
+            <value>
+                <fullName>鏁翠綋鍐呴暅瀹よВ鍐虫柟妗�</fullName>
+                <default>false</default>
+                <label>鏁翠綋鍐呴暅瀹よВ鍐虫柟妗�</label>
+            </value>
+            <value>
+                <fullName>鏁翠綋鎵嬫湳瀹よВ鍐虫柟妗�</fullName>
+                <default>false</default>
+                <label>鏁翠綋鎵嬫湳瀹よВ鍐虫柟妗�</label>
+            </value>
+            <value>
+                <fullName>鍞悗鐐规鏈嶅姟</fullName>
+                <default>false</default>
+                <label>鍞悗鐐规鏈嶅姟</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/Agency_Report__c/fields/WarlockClassification__c.field-meta.xml b/force-app/main/default/objects/Agency_Report__c/fields/WarlockClassification__c.field-meta.xml
new file mode 100644
index 0000000..a9a9ef0
--- /dev/null
+++ b/force-app/main/default/objects/Agency_Report__c/fields/WarlockClassification__c.field-meta.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>WarlockClassification__c</fullName>
+    <deleteConstraint>SetNull</deleteConstraint>
+    <externalId>false</externalId>
+    <label>鏈+鍒嗙被</label>
+    <referenceTo>FieldClassification__c</referenceTo>
+    <relationshipLabel>.鍛ㄦ姤鏄庣粏 (鏈+鍒嗙被)</relationshipLabel>
+    <relationshipName>WarlockClassification</relationshipName>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Lookup</type>
+</CustomField>
diff --git a/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner_Num__c.field-meta.xml b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner_Num__c.field-meta.xml
new file mode 100644
index 0000000..bd691db
--- /dev/null
+++ b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner_Num__c.field-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Adjudication_Owner_Num__c</fullName>
+    <externalId>false</externalId>
+    <formula>Owner:User.Employee_No__c</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>鐢宠浜哄憳宸ョ紪鐮�</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Text</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner__c.field-meta.xml b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner__c.field-meta.xml
new file mode 100644
index 0000000..889a71b
--- /dev/null
+++ b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Adjudication_Owner__c.field-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Adjudication_Owner__c</fullName>
+    <externalId>false</externalId>
+    <formula>Owner:User.Name__c</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>鍐宠鐢宠浜�</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Text</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Applicant_Dep__c.field-meta.xml b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Applicant_Dep__c.field-meta.xml
new file mode 100644
index 0000000..a077fc5
--- /dev/null
+++ b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/fields/Applicant_Dep__c.field-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Applicant_Dep__c</fullName>
+    <externalId>false</externalId>
+    <formula>Owner:User.Category5__c</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>鐢宠浜洪儴闂�</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Text</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Application_for_Conference_Adjudication__c/sharingReasons/Shared_Editor__c.sharingReason-meta.xml b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/sharingReasons/Shared_Editor__c.sharingReason-meta.xml
new file mode 100644
index 0000000..3295b12
--- /dev/null
+++ b/force-app/main/default/objects/Application_for_Conference_Adjudication__c/sharingReasons/Shared_Editor__c.sharingReason-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SharingReason xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Shared_Editor__c</fullName>
+    <label>鍏变韩缂栬緫浜�</label>
+</SharingReason>
diff --git a/force-app/main/default/objects/BatchIF_Log__c/listViews/NFM_702.listView-meta.xml b/force-app/main/default/objects/BatchIF_Log__c/listViews/NFM_702.listView-meta.xml
new file mode 100644
index 0000000..988db7d
--- /dev/null
+++ b/force-app/main/default/objects/BatchIF_Log__c/listViews/NFM_702.listView-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ListView xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>NFM_702</fullName>
+    <columns>NAME</columns>
+    <filterScope>Everything</filterScope>
+    <filters>
+        <field>Type__c</field>
+        <operation>equals</operation>
+        <value>NFM702</value>
+    </filters>
+    <label>NFM-702瀹㈡埛浜哄憳淇℃伅</label>
+    <language>zh_CN</language>
+</ListView>
diff --git a/force-app/main/default/objects/Consum_Apply_Equipment_Set_Detail__c/fields/demo_purpose2__c.field-meta.xml b/force-app/main/default/objects/Consum_Apply_Equipment_Set_Detail__c/fields/demo_purpose2__c.field-meta.xml
new file mode 100644
index 0000000..1a5c5de
--- /dev/null
+++ b/force-app/main/default/objects/Consum_Apply_Equipment_Set_Detail__c/fields/demo_purpose2__c.field-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>demo_purpose2__c</fullName>
+    <externalId>false</externalId>
+    <formula>Text( Consum_Apply__r.demo_purpose2__c )</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>鍑哄�熺洰鐨�</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Text</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/FieldClassification__c.object-meta.xml b/force-app/main/default/objects/FieldClassification__c/FieldClassification__c.object-meta.xml
new file mode 100644
index 0000000..8987868
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/FieldClassification__c.object-meta.xml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
+    <actionOverrides>
+        <actionName>Accept</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Accept</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Accept</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>CancelEdit</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>CancelEdit</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>CancelEdit</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Clone</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Clone</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Clone</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Delete</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Delete</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Delete</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Edit</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Edit</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Edit</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>List</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>List</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>List</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>New</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>New</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>New</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>SaveEdit</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>SaveEdit</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>SaveEdit</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Tab</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Tab</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>Tab</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>View</actionName>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>View</actionName>
+        <formFactor>Large</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <actionOverrides>
+        <actionName>View</actionName>
+        <formFactor>Small</formFactor>
+        <type>Default</type>
+    </actionOverrides>
+    <allowInChatterGroups>false</allowInChatterGroups>
+    <compactLayoutAssignment>SYSTEM</compactLayoutAssignment>
+    <deploymentStatus>Deployed</deploymentStatus>
+    <enableActivities>false</enableActivities>
+    <enableBulkApi>true</enableBulkApi>
+    <enableFeeds>false</enableFeeds>
+    <enableHistory>false</enableHistory>
+    <enableLicensing>false</enableLicensing>
+    <enableReports>false</enableReports>
+    <enableSearch>false</enableSearch>
+    <enableSharing>true</enableSharing>
+    <enableStreamingApi>true</enableStreamingApi>
+    <externalSharingModel>Private</externalSharingModel>
+    <label>杩芥函鍛ㄦ姤-瀛楁鍒嗙被</label>
+    <nameField>
+        <label>杩芥函鍛ㄦ姤-瀛楁鍒嗙被鍚嶇О</label>
+        <type>Text</type>
+    </nameField>
+    <searchLayouts></searchLayouts>
+    <sharingModel>ReadWrite</sharingModel>
+    <visibility>Public</visibility>
+</CustomObject>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/ET_ENG_classification__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/ET_ENG_classification__c.field-meta.xml
new file mode 100644
index 0000000..48bf7d8
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/ET_ENG_classification__c.field-meta.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>ET_ENG_classification__c</fullName>
+    <externalId>false</externalId>
+    <label>鍏朵粬鍝佺墝浜у搧绫诲埆鍒嗙被</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>ET</fullName>
+                <default>false</default>
+                <label>ET</label>
+            </value>
+            <value>
+                <fullName>ENG</fullName>
+                <default>false</default>
+                <label>ENG</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/EffectProgress__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/EffectProgress__c.field-meta.xml
new file mode 100644
index 0000000..fe18ad4
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/EffectProgress__c.field-meta.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>EffectProgress__c</fullName>
+    <externalId>false</externalId>
+    <label>鏁堟灉/杩涘害</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>璁ゅ彲</fullName>
+                <default>false</default>
+                <label>璁ゅ彲</label>
+            </value>
+            <value>
+                <fullName>涓珛</fullName>
+                <default>false</default>
+                <label>涓珛</label>
+            </value>
+            <value>
+                <fullName>涓嶈鍙�</fullName>
+                <default>false</default>
+                <label>涓嶈鍙�</label>
+            </value>
+            <value>
+                <fullName>绉戝鐢宠</fullName>
+                <default>false</default>
+                <label>绉戝鐢宠</label>
+            </value>
+            <value>
+                <fullName>鍣ㄦ绉戝鏍�</fullName>
+                <default>false</default>
+                <label>鍣ㄦ绉戝鏍�</label>
+            </value>
+            <value>
+                <fullName>闄㈢骇瀹℃牳</fullName>
+                <default>false</default>
+                <label>闄㈢骇瀹℃牳</label>
+            </value>
+            <value>
+                <fullName>鎷涙爣閲囪喘</fullName>
+                <default>false</default>
+                <label>鎷涙爣閲囪喘</label>
+            </value>
+            <value>
+                <fullName>鐢宠椹冲洖</fullName>
+                <default>false</default>
+                <label>鐢宠椹冲洖</label>
+            </value>
+            <value>
+                <fullName>鍒濇娌熼��</fullName>
+                <default>false</default>
+                <label>鍒濇娌熼��</label>
+            </value>
+            <value>
+                <fullName>鍚屾剰鍗忓姪</fullName>
+                <default>false</default>
+                <label>鍚屾剰鍗忓姪</label>
+            </value>
+            <value>
+                <fullName>宸叉彁浜ょ敵璇�</fullName>
+                <default>false</default>
+                <label>宸叉彁浜ょ敵璇�</label>
+            </value>
+            <value>
+                <fullName>鏈悓鎰忓崗鍔�</fullName>
+                <default>false</default>
+                <label>鏈悓鎰忓崗鍔�</label>
+            </value>
+            <value>
+                <fullName>涓村簥鍙嶉</fullName>
+                <default>false</default>
+                <label>涓村簥鍙嶉</label>
+            </value>
+            <value>
+                <fullName>OCSM璺熻繘</fullName>
+                <default>false</default>
+                <label>OCSM璺熻繘</label>
+            </value>
+            <value>
+                <fullName>闂鎺掗櫎</fullName>
+                <default>false</default>
+                <label>闂鎺掗櫎</label>
+            </value>
+            <value>
+                <fullName>鍙洖浜у搧瀵瑰簲</fullName>
+                <default>false</default>
+                <label>鍙洖浜у搧瀵瑰簲</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/ProductCcategory__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/ProductCcategory__c.field-meta.xml
new file mode 100644
index 0000000..713fd0b
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/ProductCcategory__c.field-meta.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>ProductCcategory__c</fullName>
+    <externalId>false</externalId>
+    <label>宸查噰鐢ㄥ叾浠栧搧鐗�</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>涓婃捣閫告��</fullName>
+                <default>false</default>
+                <label>涓婃捣閫告��</label>
+            </value>
+            <value>
+                <fullName>缇庤开浜�</fullName>
+                <default>false</default>
+                <label>缇庤开浜�</label>
+            </value>
+            <value>
+                <fullName>姝︽眽鍗婅竟澶�</fullName>
+                <default>false</default>
+                <label>姝︽眽鍗婅竟澶�</label>
+            </value>
+            <value>
+                <fullName>瀹夌憺</fullName>
+                <default>false</default>
+                <label>瀹夌憺</label>
+            </value>
+            <value>
+                <fullName>涔愬ゥ</fullName>
+                <default>false</default>
+                <label>涔愬ゥ</label>
+            </value>
+            <value>
+                <fullName>缇庢暒鍔涳紙鏌儬锛�</fullName>
+                <default>false</default>
+                <label>缇庢暒鍔涳紙鏌儬锛�</label>
+            </value>
+            <value>
+                <fullName>娴欐睙璧涜寰�</fullName>
+                <default>false</default>
+                <label>娴欐睙璧涜寰�</label>
+            </value>
+            <value>
+                <fullName>鍞痉搴�</fullName>
+                <default>false</default>
+                <label>鍞痉搴�</label>
+            </value>
+            <value>
+                <fullName>鑻忓窞浠ヨ搴�</fullName>
+                <default>false</default>
+                <label>鑻忓窞浠ヨ搴�</label>
+            </value>
+            <value>
+                <fullName>澶╂触鐟炲</fullName>
+                <default>false</default>
+                <label>澶╂触鐟炲</label>
+            </value>
+            <value>
+                <fullName>寮虹敓</fullName>
+                <default>false</default>
+                <label>寮虹敓</label>
+            </value>
+            <value>
+                <fullName>鍖椾含瀹夊拰</fullName>
+                <default>false</default>
+                <label>鍖椾含瀹夊拰</label>
+            </value>
+            <value>
+                <fullName>鍗椾含寰垱</fullName>
+                <default>false</default>
+                <label>鍗椾含寰垱</label>
+            </value>
+            <value>
+                <fullName>瀹夋澃鎬�</fullName>
+                <default>false</default>
+                <label>瀹夋澃鎬�</label>
+            </value>
+            <value>
+                <fullName>搴撳厠</fullName>
+                <default>false</default>
+                <label>搴撳厠</label>
+            </value>
+            <value>
+                <fullName>婀栧崡鍗婇檧</fullName>
+                <default>false</default>
+                <label>婀栧崡鍗婇檧</label>
+            </value>
+            <value>
+                <fullName>娉㈢</fullName>
+                <default>false</default>
+                <label>娉㈢</label>
+            </value>
+            <value>
+                <fullName>澶╂触鍘氬嚡</fullName>
+                <default>false</default>
+                <label>澶╂触鍘氬嚡</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/ProductClassification__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/ProductClassification__c.field-meta.xml
new file mode 100644
index 0000000..36d8be3
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/ProductClassification__c.field-meta.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>ProductClassification__c</fullName>
+    <externalId>false</externalId>
+    <label>浜у搧鍒嗙被</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>ERCP</fullName>
+                <default>false</default>
+                <label>ERCP</label>
+            </value>
+            <value>
+                <fullName>ESD</fullName>
+                <default>false</default>
+                <label>ESD</label>
+            </value>
+            <value>
+                <fullName>EUS</fullName>
+                <default>false</default>
+                <label>EUS</label>
+            </value>
+            <value>
+                <fullName>鍛煎惛绉�</fullName>
+                <default>false</default>
+                <label>鍛煎惛绉�</label>
+            </value>
+            <value>
+                <fullName>鍩虹</fullName>
+                <default>false</default>
+                <label>鍩虹</label>
+            </value>
+            <value>
+                <fullName>姝㈣</fullName>
+                <default>false</default>
+                <label>姝㈣</label>
+            </value>
+            <value>
+                <fullName>鍏朵粬</fullName>
+                <default>false</default>
+                <label>鍏朵粬</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/WarlockClassification__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/WarlockClassification__c.field-meta.xml
new file mode 100644
index 0000000..1459f1f
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/WarlockClassification__c.field-meta.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>WarlockClassification__c</fullName>
+    <externalId>false</externalId>
+    <label>鏈+鍒嗙被</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>瀵间笣</fullName>
+                <default>false</default>
+                <label>瀵间笣</label>
+            </value>
+            <value>
+                <fullName>鍙栫煶姘斿泭</fullName>
+                <default>false</default>
+                <label>鍙栫煶姘斿泭</label>
+            </value>
+            <value>
+                <fullName>鍙栫煶缃戠</fullName>
+                <default>false</default>
+                <label>鍙栫煶缃戠</label>
+            </value>
+            <value>
+                <fullName>涔冲ご鍒囧紑鍒�</fullName>
+                <default>false</default>
+                <label>涔冲ご鍒囧紑鍒�</label>
+            </value>
+            <value>
+                <fullName>纰庣煶鍣�</fullName>
+                <default>false</default>
+                <label>纰庣煶鍣�</label>
+            </value>
+            <value>
+                <fullName>IT绯荤矘鑶滃垏寮�鍒�</fullName>
+                <default>false</default>
+                <label>IT绯荤矘鑶滃垏寮�鍒�</label>
+            </value>
+            <value>
+                <fullName>楂橀娌荤枟閽�</fullName>
+                <default>false</default>
+                <label>楂橀娌荤枟閽�</label>
+            </value>
+            <value>
+                <fullName>鍏堢绯荤矘鑶滃垏寮�鍒�</fullName>
+                <default>false</default>
+                <label>鍏堢绯荤矘鑶滃垏寮�鍒�</label>
+            </value>
+            <value>
+                <fullName>鍚稿紩娲绘閽�</fullName>
+                <default>false</default>
+                <label>鍚稿紩娲绘閽�</label>
+            </value>
+            <value>
+                <fullName>娲绘閽�</fullName>
+                <default>false</default>
+                <label>娲绘閽�</label>
+            </value>
+            <value>
+                <fullName>娲绘濂楄</fullName>
+                <default>false</default>
+                <label>娲绘濂楄</label>
+            </value>
+            <value>
+                <fullName>缁嗚優鍒�</fullName>
+                <default>false</default>
+                <label>缁嗚優鍒�</label>
+            </value>
+            <value>
+                <fullName>鐢靛湀濂楀櫒</fullName>
+                <default>false</default>
+                <label>鐢靛湀濂楀櫒</label>
+            </value>
+            <value>
+                <fullName>娉ㄥ皠閽�</fullName>
+                <default>false</default>
+                <label>娉ㄥ皠閽�</label>
+            </value>
+            <value>
+                <fullName>缁撴墡瑁呯疆</fullName>
+                <default>false</default>
+                <label>缁撴墡瑁呯疆</label>
+            </value>
+            <value>
+                <fullName>姝㈣澶�</fullName>
+                <default>false</default>
+                <label>姝㈣澶�</label>
+            </value>
+            <value>
+                <fullName>鍏朵粬</fullName>
+                <default>false</default>
+                <label>鍏朵粬</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/WorkRecord__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/WorkRecord__c.field-meta.xml
new file mode 100644
index 0000000..e50e976
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/WorkRecord__c.field-meta.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>WorkRecord__c</fullName>
+    <externalId>false</externalId>
+    <label>宸ヤ綔璁板綍</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>SIS</fullName>
+                <default>false</default>
+                <label>SIS</label>
+            </value>
+            <value>
+                <fullName>绉戝浼�</fullName>
+                <default>false</default>
+                <label>绉戝浼�</label>
+            </value>
+            <value>
+                <fullName>闄㈠唴鍏ラ櫌鐢宠</fullName>
+                <default>false</default>
+                <label>闄㈠唴鍏ラ櫌鐢宠</label>
+            </value>
+            <value>
+                <fullName>鏀惰垂椤圭洰鐢宠</fullName>
+                <default>false</default>
+                <label>鏀惰垂椤圭洰鐢宠</label>
+            </value>
+            <value>
+                <fullName>涓村簥浣跨敤淇℃伅鏀堕泦</fullName>
+                <default>false</default>
+                <label>涓村簥浣跨敤淇℃伅鏀堕泦</label>
+            </value>
+            <value>
+                <fullName>甯傚満鎺ㄥ箍绫绘椿鍔�</fullName>
+                <default>false</default>
+                <label>甯傚満鎺ㄥ箍绫绘椿鍔�</label>
+            </value>
+            <value>
+                <fullName>QIS澶勭悊</fullName>
+                <default>false</default>
+                <label>QIS澶勭悊</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/classification__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/classification__c.field-meta.xml
new file mode 100644
index 0000000..d1900a3
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/classification__c.field-meta.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>classification__c</fullName>
+    <externalId>false</externalId>
+    <label>鍛ㄦ姤鍒嗙被</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>ET</fullName>
+                <default>false</default>
+                <label>ET</label>
+            </value>
+            <value>
+                <fullName>ENG</fullName>
+                <default>false</default>
+                <label>ENG</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/FieldClassification__c/fields/productCategories__c.field-meta.xml b/force-app/main/default/objects/FieldClassification__c/fields/productCategories__c.field-meta.xml
new file mode 100644
index 0000000..7108b25
--- /dev/null
+++ b/force-app/main/default/objects/FieldClassification__c/fields/productCategories__c.field-meta.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>productCategories__c</fullName>
+    <externalId>false</externalId>
+    <label>鍏朵粬鍝佺墝浜у搧绫诲埆</label>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Picklist</type>
+    <valueSet>
+        <restricted>true</restricted>
+        <valueSetDefinition>
+            <sorted>false</sorted>
+            <value>
+                <fullName>HD1000i锛堟崲鑳藉櫒涓�浣擄紝浣跨敤涓�娆″悗閿佹锛�</fullName>
+                <default>false</default>
+                <label>HD1000i锛堟崲鑳藉櫒涓�浣擄紝浣跨敤涓�娆″悗閿佹锛�</label>
+            </value>
+            <value>
+                <fullName>Focus锛堟棤杞欢閿侊級</fullName>
+                <default>false</default>
+                <label>Focus锛堟棤杞欢閿侊級</label>
+            </value>
+            <value>
+                <fullName>Focus CN 锛堜娇鐢ㄤ竴娆″悗閿佹锛�</fullName>
+                <default>false</default>
+                <label>Focus CN 锛堜娇鐢ㄤ竴娆″悗閿佹锛�</label>
+            </value>
+            <value>
+                <fullName>ACE+锛堟棤杞欢閿侊級</fullName>
+                <default>false</default>
+                <label>ACE+锛堟棤杞欢閿侊級</label>
+            </value>
+            <value>
+                <fullName>ACE+ CN锛堜娇鐢ㄤ竴娆″悗閿佹锛�</fullName>
+                <default>false</default>
+                <label>ACE+ CN锛堜娇鐢ㄤ竴娆″悗閿佹锛�</label>
+            </value>
+            <value>
+                <fullName>ACE+7锛堜娇鐢ㄤ竴娆″悗閿佹锛�</fullName>
+                <default>false</default>
+                <label>ACE+7锛堜娇鐢ㄤ竴娆″悗閿佹锛�</label>
+            </value>
+            <value>
+                <fullName>鏃犵嚎瓒呭0鍒囧壊鍒�</fullName>
+                <default>false</default>
+                <label>鏃犵嚎瓒呭0鍒囧壊鍒�</label>
+            </value>
+            <value>
+                <fullName>浜岀被璇侊紙闂悎5mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>浜岀被璇侊紙闂悎5mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>涓夌被璇侊紙闂悎5mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>涓夌被璇侊紙闂悎5mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>鍙噸澶嶄娇鐢ㄥ垁澶达紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>鍙噸澶嶄娇鐢ㄥ垁澶达紙闂悎3mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>涓�娆℃�т娇鐢ㄥ垁澶达紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>涓�娆℃�т娇鐢ㄥ垁澶达紙闂悎3mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>涓�娆℃�т娇鐢ㄥ垁澶达紙闂悎5mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>涓�娆℃�т娇鐢ㄥ垁澶达紙闂悎5mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>涓�娆℃�у垁澶达紙闂悎5mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>涓�娆℃�у垁澶达紙闂悎5mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>閲嶅鐢ㄥ垁澶达紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>閲嶅鐢ㄥ垁澶达紙闂悎3mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>涓�娆℃�у垁澶达紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>涓�娆℃�у垁澶达紙闂悎3mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>涓夌被璇侊紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>涓夌被璇侊紙闂悎3mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>浜岀被璇侊紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>浜岀被璇侊紙闂悎3mm琛�绠★級</label>
+            </value>
+            <value>
+                <fullName>鍏煎STMS鍒�澶寸殑鍒�澶达紙闂悎3mm琛�绠★級</fullName>
+                <default>false</default>
+                <label>鍏煎STMS鍒�澶寸殑鍒�澶达紙闂悎3mm琛�绠★級</label>
+            </value>
+        </valueSetDefinition>
+    </valueSet>
+</CustomField>
diff --git a/force-app/main/default/objects/Inquiry_form__c/fields/Follow_Date__c.field-meta.xml b/force-app/main/default/objects/Inquiry_form__c/fields/Follow_Date__c.field-meta.xml
new file mode 100644
index 0000000..95c464c
--- /dev/null
+++ b/force-app/main/default/objects/Inquiry_form__c/fields/Follow_Date__c.field-meta.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Follow_Date__c</fullName>
+    <externalId>false</externalId>
+    <label>璺熻繘鏃ユ湡</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Date</type>
+</CustomField>
diff --git a/force-app/main/default/objects/Inquiry_form__c/fields/No_Need_Date__c.field-meta.xml b/force-app/main/default/objects/Inquiry_form__c/fields/No_Need_Date__c.field-meta.xml
new file mode 100644
index 0000000..c96ba50
--- /dev/null
+++ b/force-app/main/default/objects/Inquiry_form__c/fields/No_Need_Date__c.field-meta.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>No_Need_Date__c</fullName>
+    <externalId>false</externalId>
+    <label>涓嶉渶瑕佹棩鏈�</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Date</type>
+</CustomField>
diff --git a/force-app/main/default/objects/Inquiry_form__c/fields/lead_Num__c.field-meta.xml b/force-app/main/default/objects/Inquiry_form__c/fields/lead_Num__c.field-meta.xml
new file mode 100644
index 0000000..2b4c928
--- /dev/null
+++ b/force-app/main/default/objects/Inquiry_form__c/fields/lead_Num__c.field-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>lead_Num__c</fullName>
+    <externalId>false</externalId>
+    <formula>Lead_link__r.Lead_No__c</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>鎰忓悜缂栫爜</label>
+    <required>false</required>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Text</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/Inventory_Header_Copy__c/webLinks/ClearStatus.webLink-meta.xml b/force-app/main/default/objects/Inventory_Header_Copy__c/webLinks/ClearStatus.webLink-meta.xml
new file mode 100644
index 0000000..3eb0f58
--- /dev/null
+++ b/force-app/main/default/objects/Inventory_Header_Copy__c/webLinks/ClearStatus.webLink-meta.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>ClearStatus</fullName>
+    <availability>online</availability>
+    <displayType>button</displayType>
+    <linkType>javascript</linkType>
+    <masterLabel>娓呴櫎鐩樼偣鐘舵��</masterLabel>
+    <openType>onClickJavaScript</openType>
+    <protected>false</protected>
+    <url>{!RequireScript(&quot;/soap/ajax/51.0/connection.js&quot;)}
+{!RequireScript(&quot;/soap/ajax/51.0/apex.js&quot;)}
+{!RequireScript(&quot;/resource/CommonUtilJs&quot;)}
+//2021-10-22 gwy 鐗堟湰鏇存敼涓�51.0
+var foo = function() {
+
+var result = sforce.connection.query(&quot;SELECT Id, Name, Inventory_Status__c FROM Inventory_Header_Copy__c WHERE Id=&apos;{!Inventory_Header_Copy__c.Id}&apos; OR Fixture_Header__c = &apos;{!Inventory_Header_Copy__c.Id}&apos;&quot;);
+
+var records = result.getArray(&quot;records&quot;);
+for(var i=0;i&lt;records.length;i++){
+    if (records[i].Inventory_Status__c != &apos;澶勭悊涓�&apos;&amp;&amp; records[i].Inventory_Status__c!=null) {
+        alert(records[i].Name+&apos;鐨勭洏鐐圭姸鎬佷负銆�&apos;+records[i].Inventory_Status__c+&apos;銆戯紝涓嶈兘娓呴櫎姝ょ洏鐐圭姸鎬併��&apos;);
+        return;
+    }
+}
+if (!confirm(&quot;璇风‘璁ゆ槸鍚﹁娓呴櫎鐩樼偣鐘舵�侊紵&quot;)) { 
+    return;
+}
+
+
+for(var i=0;i&lt;records.length;i++){
+    records[i].Inventory_Status__c = null; 
+}
+
+var result = sforce.connection.update(records); 
+var messages = getConnectDMLErrorMessages(result); 
+if (messages.length &gt; 0) {
+  alert(messages.join(&quot;\n&quot;));
+  return;
+}
+window.location.reload();
+
+}
+foo();</url>
+</WebLink>
diff --git a/force-app/main/default/objects/Inventory_Header__c/listViews/Viewguangdong.listView-meta.xml b/force-app/main/default/objects/Inventory_Header__c/listViews/Viewguangdong.listView-meta.xml
new file mode 100644
index 0000000..bfcc8f4
--- /dev/null
+++ b/force-app/main/default/objects/Inventory_Header__c/listViews/Viewguangdong.listView-meta.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ListView xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Viewguangdong</fullName>
+    <columns>NAME</columns>
+    <columns>UniqueKey__c</columns>
+    <columns>InventoryPIC__c</columns>
+    <columns>Inventory_Status__c</columns>
+    <filterScope>Everything</filterScope>
+    <filters>
+        <field>Internal_asset_location__c</field>
+        <operation>equals</operation>
+        <value>骞垮窞 澶囧搧涓績</value>
+    </filters>
+    <label>骞垮窞澶囧搧涓績</label>
+    <language>zh_CN</language>
+</ListView>
diff --git a/force-app/main/default/objects/LastbuyProduct__c/fields/RemainingNumber__c.field-meta.xml b/force-app/main/default/objects/LastbuyProduct__c/fields/RemainingNumber__c.field-meta.xml
new file mode 100644
index 0000000..cb97f6d
--- /dev/null
+++ b/force-app/main/default/objects/LastbuyProduct__c/fields/RemainingNumber__c.field-meta.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>RemainingNumber__c</fullName>
+    <externalId>false</externalId>
+    <formula>IF( ISBLANK( ActualQuantity__c ) ,  LastbuyQuantity__c ,  LastbuyQuantity__c  -  ActualQuantity__c )</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>鍓╀綑鏁伴噺</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/LastbuyProduct__c/validationRules/yuliudayu.validationRule-meta.xml b/force-app/main/default/objects/LastbuyProduct__c/validationRules/yuliudayu.validationRule-meta.xml
new file mode 100644
index 0000000..dae9d64
--- /dev/null
+++ b/force-app/main/default/objects/LastbuyProduct__c/validationRules/yuliudayu.validationRule-meta.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>yuliudayu</fullName>
+    <active>true</active>
+    <errorConditionFormula>!ISNULL(ActualQuantity__c) &amp;&amp; ActualQuantity__c &gt; LastbuyQuantity__c</errorConditionFormula>
+    <errorMessage>瀹為檯浣跨敤鏁伴噺涓嶈兘澶т簬棰勭暀鏁伴噺</errorMessage>
+</ValidationRule>
diff --git a/force-app/main/default/objects/Maintenance_Contract__c/fields/Equipment_Last_Money__c.field-meta.xml b/force-app/main/default/objects/Maintenance_Contract__c/fields/Equipment_Last_Money__c.field-meta.xml
new file mode 100644
index 0000000..ef44168
--- /dev/null
+++ b/force-app/main/default/objects/Maintenance_Contract__c/fields/Equipment_Last_Money__c.field-meta.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>Equipment_Last_Money__c</fullName>
+    <externalId>false</externalId>
+    <formula>Last_year_service_contract__r.Estimate_Cost_F__c</formula>
+    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>
+    <label>璁惧涓婃湡绛剧害閲戦</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>0</scale>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Currency</type>
+</CustomField>
diff --git a/force-app/main/default/objects/Rental_Apply_Equipment_Set_Detail__c/fields/ApplyToShipmentWorkTime__c.field-meta.xml b/force-app/main/default/objects/Rental_Apply_Equipment_Set_Detail__c/fields/ApplyToShipmentWorkTime__c.field-meta.xml
new file mode 100644
index 0000000..fc93d4b
--- /dev/null
+++ b/force-app/main/default/objects/Rental_Apply_Equipment_Set_Detail__c/fields/ApplyToShipmentWorkTime__c.field-meta.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>ApplyToShipmentWorkTime__c</fullName>
+    <externalId>false</externalId>
+    <label>鎻愪氦鐢宠鍒板鍝佸嚭搴撴椂闀�</label>
+    <precision>18</precision>
+    <required>false</required>
+    <scale>1</scale>
+    <trackFeedHistory>false</trackFeedHistory>
+    <trackHistory>false</trackHistory>
+    <trackTrending>false</trackTrending>
+    <type>Number</type>
+    <unique>false</unique>
+</CustomField>
diff --git a/force-app/main/default/objects/meeting_delay_apply__c/fields/IF_Approved_Old__c.field-meta.xml b/force-app/main/default/objects/meeting_delay_apply__c/fields/IF_Approved_Old__c.field-meta.xml
new file mode 100644
index 0000000..d78b391
--- /dev/null
+++ b/force-app/main/default/objects/meeting_delay_apply__c/fields/IF_Approved_Old__c.field-meta.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>IF_Approved_Old__c</fullName>
+    <defaultValue>false</defaultValue>
+    <externalId>false</externalId>
+    <label>鏄惁鐢宠鍐宠.</label>
+    <trackTrending>false</trackTrending>
+    <type>Checkbox</type>
+</CustomField>
diff --git a/force-app/main/default/objects/meeting_delay_apply__c/fields/MeetingApproved__c.field-meta.xml b/force-app/main/default/objects/meeting_delay_apply__c/fields/MeetingApproved__c.field-meta.xml
new file mode 100644
index 0000000..81be8b8
--- /dev/null
+++ b/force-app/main/default/objects/meeting_delay_apply__c/fields/MeetingApproved__c.field-meta.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
+    <fullName>MeetingApproved__c</fullName>
+    <deleteConstraint>SetNull</deleteConstraint>
+    <externalId>false</externalId>
+    <label>浼氳鍐宠鐢宠</label>
+    <referenceTo>Application_for_Conference_Adjudication__c</referenceTo>
+    <relationshipLabel>浼氳鍙樻洿鐢宠 (浼氳鍐宠鐢宠)</relationshipLabel>
+    <relationshipName>MeetingApproved_change</relationshipName>
+    <required>false</required>
+    <trackTrending>false</trackTrending>
+    <type>Lookup</type>
+</CustomField>
diff --git a/force-app/main/default/pages/BatchSelectRepairPage.page b/force-app/main/default/pages/BatchSelectRepairPage.page
index 3902036..a5291dd 100644
--- a/force-app/main/default/pages/BatchSelectRepairPage.page
+++ b/force-app/main/default/pages/BatchSelectRepairPage.page
@@ -1,12 +1,10 @@
 <apex:page id="Page" showHeader="false" sidebar="false" controller="BatchSelectRepairPageController" applyBodyTag="false" applyHtmlTag="false" action="{!init}">
-<head>
-    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
-    <!-- <apex:stylesheet value="{!URLFOR($Resource.jquerysuggestcss)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/> -->
-    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
-    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
+<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
+<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
+<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
+<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
+<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
+<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
     <title>鎵归噺閫夋嫨淇悊鍔熻兘</title>
     <style type="text/css">
         .pure-table {
@@ -16,7 +14,7 @@
             border: 1px solid #cbcbcb;
             width: 100%;
         }
- 
+
         .pure-table caption {
             color: #000;
             font: italic 85%/1 arial,sans-serif;
@@ -57,15 +55,15 @@
         //鍏ㄩ�夊姛鑳�
         function checkAll() {
             var cnt = j$(escapeVfId('raCnt')).val();
-            if (j$(escapeVfId('Page:Form:Block:j_id47:checkAll')).attr('checked') == 'checked') {
+            if (j$(escapeVfId('Page:Form:Block:j_id53:checkAll')).attr('checked') == 'checked') {
                 for (var i = 0; i < cnt; i++) {
-                    j$(escapeVfId('Page:Form:Block:j_id47:records:' + i + ':checklist')).attr('checked',true);
+                    j$(escapeVfId('Page:Form:Block:j_id53:records:' + i + ':checklist')).attr('checked',true);
                 }
-			} else {
+            } else {
                 for (var i = 0; i < cnt; i++) {
-                    j$(escapeVfId('Page:Form:Block:j_id47:records:' + i + ':checklist')).attr('checked',false);
+                    j$(escapeVfId('Page:Form:Block:j_id53:records:' + i + ':checklist')).attr('checked',false);
                 }
-			}     
+            }
         }
         //妫�绱㈠姛鑳�
         // function RetrievalBtnJS() {
@@ -88,83 +86,152 @@
         //     }
         // }
     </script>
-</head>
-<body>
-    <apex:form id="Form" style="margin:10px 10px;">
+    <apex:form id="allForm" style="margin: 10px 10px;">
         <apex:actionFunction name="RetrievalBtn" action="{!RetrievalBtn}" rerender="Form, message" onComplete="unblockUI();"/>
         <!-- <apex:actionFunction name="showPDF" action="{!showPDF}" rerender="Form, message" onComplete="unblockUI();" /> -->
         <!-- 鍚庡彴鎶ラ敊淇℃伅鏄剧ず鐨勫叧閿� -->
         <apex:outputPanel id="message">
             <apex:pageMessages ></apex:pageMessages>
         </apex:outputPanel>
-        <apex:pageBlock mode="maindetail" Id="Block">
-            <div style="position: relative;top:0;width:100%;">
-                <table>
-                    <tr>
-                        <td><apex:outputLabel value="妫�绱㈤儴" style="font-size:18px;font-weight:bold;padding-right: 5px;"/></td>                        
-                    </tr>
-                    <apex:repeat value="{!RevalInfoList}" var="reval" id="RevalInfoList">
-                    <tr>
-                        <td style="text-align: center;padding-right: 100px;">&nbsp;</td>
-                        <td style="text-align: center;padding-right: 100px;">
-                            <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="淇悊鍗曞彿"/>
-                            <apex:inputText id="RepairName" value="{!reval.RepairName}"/>
-                        </td>
-                        <td style="text-align: center;padding-right: 100px;">
-                            <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="SAP鍗曞彿"/>
-                            <apex:inputText id="SAPRepairNo" value="{!reval.SAPRepairNo}"/>
-                        </td>
-                        <td style="text-align: center;padding-right: 100px;">
-                            <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鍖婚櫌/绉戝"/>
-                            <apex:inputText id="HospitalName" value="{!reval.HospitalName}"/>
-                        </td>
-                        <td style="text-align: center;padding-right: 100px;">
-                            <apex:commandButton style="width:80px;" value="妫�绱�" action="{!RetrievalBtn}" onclick="blockme();" reRender="Form,message" onComplete="unblockUI();"/>
-                        </td>
-                    </tr>
-                    </apex:repeat>
-                </table>
-                <div style="font-size:12px; margin-top:10px">
-                    <apex:pageBlockSection title="璇︾粏淇℃伅" columns="1">
+        <apex:outputPanel id="allPanel">
+            <apex:pageBlock mode="maindetail" Id="allBlock">
+                <div style="position: relative; width:100%; ">
+                    <apex:pageBlock title="妫�绱㈠垪" id="Editable">
+                        <table>
+                            <tr><td style="text-align: left;padding-right: 100px;">&nbsp;</td></tr>
+                            <apex:repeat value="{!RevalInfoList}" var="reval" id="RevalInfoList">
+                            <tr>
+                                <!-- <td style="text-align: left;padding-right: 100px;">&nbsp;</td> -->
+                                <td style="text-align: right; width:200px;">
+                                    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鐘舵��2"/>
+                                </td>
+                                <td style="text-align: left;">
+                                    <apex:inputText id="Status2" value="{!reval.Status2}"/>
+                                </td>
+                                <td style="text-align: right; width:200px;">
+                                    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="RS淇悊鍗曞彿"/>
+                                </td>
+                                <td style="text-align: left;">
+                                    <apex:inputText id="RepairName" value="{!reval.RepairName}"/>
+                                </td>
+                                <td style="text-align: right; width:150px;">
+                                    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="SAP淇悊鍗曞彿"/>
+                                </td>
+                                <td style="text-align: left;padding-right: 100px;">
+                                    <apex:inputText id="SAPRepairNo" value="{!reval.SAPRepairNo}"/>
+                                </td>
+                            </tr>
+                            <tr><td style="text-align: left;padding-right: 100px;">&nbsp;</td></tr>
+                            <tr>
+                                <!-- <td style="text-align: left;padding-right: 100px;">&nbsp;</td> -->
+                                <td style="text-align: right; width:100px;">
+                                    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鏈鸿韩缂栫爜"/>
+                                </td>
+                                <td style="text-align: left;">
+                                    <apex:inputText id="SerialNumber" value="{!reval.SerialNumber}"/>
+                                </td>
+                                <td style="text-align: right; width:200px;">
+                                    <apex:outputLabel style="font-weight: bold; " value="淇悊濮旀墭鑰�"/>
+                                </td>
+                                <td style="text-align: left;">
+                                    <apex:inputField id="InchargeStaffName" value="{!reval.repair.Incharge_Staff__c}"/>
+                                </td>
+                                <td style="text-align: right; width:150px;">
+                                    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="FSE鐢宠鏃�"/>
+                                </td>
+                                <td style="text-align: left;padding-right: 80px;">
+                                    <apex:inputField id="FSE_ApplyForRepair_Day" value="{!reval.repair.Final_complete_day__c}"/>
+                                </td>
+                            </tr>
+                            </apex:repeat>
+                            <tr><td style="text-align: left;padding-right: 100px;">&nbsp;</td></tr>
+                            <tr>
+                                <td style="text-align: center;" colspan="6">
+                                    <apex:commandButton style="width:80px;" value="妫�绱�" action="{!RetrievalBtn}" onclick="blockme();" reRender="allForm,message" onComplete="unblockUI();"/>
+                                </td>
+                            </tr>
+                        </table>
+                    </apex:pageBlock>  
+                    <!-- <div style="font-size:12px;"> -->
+                    <apex:pageBlock title="璇︾粏淇℃伅" >
                         <input type="hidden" id="raCnt" value="{!RACount}" />
-                        <!-- <input type="hidden" id="raIdList" value="{!repairIdList}" /> -->
-                        <apex:outputPanel >
-                            <div style="text-align: center;"><apex:commandButton style="width:80px;" value="鎵撳嵃PDF" action="{!showPDF}" onclick="blockme();" reRender="Form,message" onComplete="unblockUI();"/></div>
-                            <div style="width:700px; height:700px; margin-left:100px; margin-top:10px;">
-                                <table class="pure-table pure-table-horizontal" id="theTable_header">
-                                    <tr style="background-color:#f2f3f3;">
-                                        <th style="align:left; width:10%"><apex:inputCheckbox id="checkAll" onclick="checkAll();" style="text-align:left;"/></th>
-                                        <th style="text-align:left; width:30%">淇悊鍗曞彿</th>
-                                        <th style="text-align:left; width:30%">绉戝</th>
-                                        <th style="text-align:left; width:30%">鍖婚櫌</th>
-                                    </tr>
-                                </table>
-                                <div style="height:500px; overflow:auto;">
-                                <table class="pure-table pure-table-horizontal" id="theTable_header" style="width: 100%">
-                                    <apex:repeat value="{!RAInfoList}" var="ra" id="records">
-                                    <tr>
-                                        <td align="left" width="10%">
-                                            <apex:inputCheckbox style="text-align:left;" id="checklist" value="{!ra.IFCheck}" />
-                                        </td>
-                                        <td align="left" width="30%">
-                                            <apex:outputField id="OTCode" value="{!ra.repair.Name}"/>
-                                        </td>
-                                        <td align="left" width="30%">
-                                            <apex:outputField id="Samplename" value="{!ra.repair.HP_Name__c}"/>
-                                        </td>
-                                        <td align="left" width="30%">
-                                            <apex:outputField id="Specs" value="{!ra.repair.Department_Name__c}"/>    
-                                        </td>
-                                    </tr>
-                                    </apex:repeat>
-                                </table>
-                                </div>
-                            </div>
-                        </apex:outputPanel>
-                    </apex:pageBlockSection>
+                        <apex:commandButton style="width:80px;" value="鎵撳嵃PDF" action="{!showPDF}" onclick="blockme();" reRender="allForm,message" onComplete="unblockUI();"/>
+                        <div style="width:100%;height:385px;overflow:auto;">
+                        <table class="pure-table pure-table-horizontal" id="theTable_header" style="width:99%; margin-top:10px;border-collapse: collapse;table-layout:fixed;">
+                            <tr style="background-color:#f2f3f3;">
+                                <th style="align:left; width:2%"><apex:inputCheckbox id="checkAll" onclick="checkAll();" style="text-align:left;"/></th>
+                                <th style="text-align:left; width:6%">鐘舵��1</th>
+                                <th style="text-align:left; width:6%">鐘舵��2</th>
+                                <th style="text-align:left; width:7%">RS淇悊鍗曞彿</th>
+                                <th style="text-align:left; width:10%">SAP淇悊鍗曞彿</th>
+                                <th style="text-align:left; width:10%">鍨嬪彿</th>
+                                <th style="text-align:left; width:5%">鏈鸿韩缂栧彿</th>
+                                <th style="text-align:left; width:8%">鍖婚櫌鍚嶇О</th>
+                                <th style="text-align:left; width:5%">鐪佷唤</th>
+                                <th style="text-align:left; width:5%">淇悊濮旀墭鑰�</th>
+                                <th style="text-align:left; width:8%">FSE鐢宠鏃ユ湡</th>
+                                <th style="text-align:left; width:5%">缁翠慨涓績</th>
+                                <th style="text-align:left; width:5%">鏈嶅姟鏂瑰紡</th>
+                                <th style="text-align:left; width:8%">鏈夋棤缁翠慨鍚堝悓瀵硅薄</th>
+                                <th style="text-align:left; width:8%">鏃犲伩鍖哄埆鏍囧織</th>
+                            </tr>
+                        </table>
+                        <table class="pure-table pure-table-horizontal" id="theTable_header" style="width:99%; border-collapse: collapse;table-layout:fixed;">
+                            <apex:repeat value="{!RAInfoList}" var="ra" id="records">
+                            <tr>
+                                <td align="left" width="2%">
+                                    <apex:inputCheckbox style="text-align:left;" id="checklist" value="{!ra.IFCheck}" />
+                                </td>
+                                <td align="left" width="6%">
+                                    <apex:outputField id="Status1" value="{!ra.repair.Status1__c}"/>
+                                </td>
+                                <td align="left" width="6%">
+                                    <apex:outputField id="Status2" value="{!ra.repair.Status2__c}"/>
+                                </td>
+                                <td align="left" width="7%">
+                                    <apex:outputField id="OTCode" value="{!ra.repair.Name}"/>
+                                </td>
+                                <td align="left" width="10%">
+                                    <apex:outputField id="SAP_Service_Repair_No" value="{!ra.repair.SAP_Service_Repair_No__c}"/>
+                                </td>
+                                <td align="left" width="10%">
+                                    <apex:outputField id="Delivered_Product" value="{!ra.repair.Delivered_Product__c}"/>
+                                </td>
+                                <td align="left" width="5%">
+                                    <apex:outputField id="SerialNumber" value="{!ra.repair.SerialNumber__c}"/>
+                                </td>
+                                <td align="left" width="8%">
+                                    <apex:outputField id="HP_Name" value="{!ra.repair.HP_Name__c}"/>
+                                </td>
+                                <td align="left" width="5%">
+                                    <apex:outputField id="State_Hospital" value="{!ra.repair.State_Hospital__c}"/>
+                                </td>
+                                <td align="left" width="5%">
+                                    <apex:outputField id="Incharge_Staff" value="{!ra.repair.Incharge_Staff__c}"/>
+                                </td>
+                                <td align="left" width="8%">
+                                    <apex:outputField id="FSE_ApplyForRepair_Day" value="{!ra.repair.FSE_ApplyForRepair_Day__c}"/>
+                                </td>
+                                <td align="left" width="5%">
+                                    <apex:outputField id="work_location_select" value="{!ra.repair.work_location_select__c}"/>
+                                </td>
+                                <td align="left" width="5%">
+                                    <apex:outputField id="On_site_repair" value="{!ra.repair.On_site_repair__c}"/>
+                                </td>
+                                <td align="center" width="8%">
+                                    <apex:outputField id="Number_of_EffectiveContract" value="{!ra.repair.Number_of_EffectiveContract__c}"/>
+                                </td>
+                                <td align="left" width="8%">
+                                    <apex:outputField id="NewProductGuaranteeObject" value="{!ra.repair.NewProductGuaranteeObject__c}"/>
+                                </td>
+                            </tr>
+                            </apex:repeat>
+                        </table>
+                        </div>
+                    </apex:pageBlock>
+                    <!-- </div> -->
                 </div>
-            </div>
-        </apex:pageBlock>
+            </apex:pageBlock>
+        </apex:outputPanel>
     </apex:form>
-</body>
 </apex:page>
\ No newline at end of file
diff --git a/force-app/main/default/pages/CampaignCreate.page b/force-app/main/default/pages/CampaignCreate.page
index c37623c..8b9bdd9 100644
--- a/force-app/main/default/pages/CampaignCreate.page
+++ b/force-app/main/default/pages/CampaignCreate.page
@@ -7,61 +7,55 @@
     <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
     <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
 	<script type="text/javascript">
-		function skip() {
-//			var test = window.location.search;
-			var str = '/701/e?cpn1=*';
-			if(getParam('RecordType') != null){
-				str += '&RecordType='+getParam('RecordType');
+		// function skipJS() {
+		// 	skipPage();
+		// }
+		// function ReturnWindowJs(){
+		// 	returnPage();
+		// }
+		function displayDecisionThemeJS(){
+			if(document.getElementById('j_id0:allForm:allBlock:Meeting_Approved_No').value != ''){
+				var MeetingApprovedName = document.getElementById('j_id0:allForm:allBlock:Meeting_Approved_No').value;
+				displayDecisionTheme(MeetingApprovedName);
 			}
-			if(getParam('CMRT') != null){
-				str += '&CMRT='+getParam('CMRT');
-			}
-			if(getParam('retURL') != null){
-				str += '&retURL='+getParam('retURL');
-			}
-			if(getParam('p8') != null){
-				str += '&p8='+getParam('p8');
-			}
-			if(getParam('CF00N10000002DIsr') != null){
-				str += '&CF00N10000002DIsr='+getParam('CF00N10000002DIsr');
-			}
-			if(getParam('ent') != null){
-				str += '&ent='+getParam('ent');
-			}
-			if(getParam('CF00N10000002DIsr_lkid') != null){
-				str += '&CF00N10000002DIsr_lkid='+getParam('CF00N10000002DIsr_lkid');
-			}
-			str += '&nooverride=1';
-			window.open(str,'_self');
-
 		}
-		function getParam(paramName) {
-    		paramValue = "", isFound = !1;
-    		if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
-        		arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
-        		while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
-    		}
-    		return paramValue == "" && (paramValue = null), paramValue
-		}
-		function closeWindowJs(){
-			window.location.href = 'https://ocsm--stagefull.my.salesforce.com/701/o';
+		function changeCheckbox(){
+			debugger
+			var as = j$(escapeVfId("j_id0:allForm:allBlock:isAdjudication")).value();
+			if(as==""){
+				changeCheckboxs('0');
+			}else{
+				changeCheckboxs('1');
+			}
 		}
 	</script>
 	<apex:form id="allForm">
+		<apex:actionFunction name="returnPage" action="{!returnPage}" rerender="allForm,allPanel,allBlock,records">
+        </apex:actionFunction>
+		<apex:actionFunction name="skipPage" action="{!skipPage}" rerender="allForm,allPanel,allBlock,records">
+        </apex:actionFunction>
+		<apex:actionFunction name="displayDecisionTheme" action="{!displayDecisionTheme}" rerender="allForm,allPanel,allBlock,records">
+			<apex:param name="firstParam" assignTo="{!MeetingApprovedName}" value="" /> 
+        </apex:actionFunction>
+		<apex:actionFunction name="changeCheckboxs" action="{!changeCheckboxs}" rerender="allForm,allPanel,allBlock,records">
+			<apex:param name="firstParam" assignTo="{!flag}" value="" /> 
+        </apex:actionFunction>
         <apex:outputPanel id="allPanel">
             <apex:pageBlock id="allBlock">
+				<input type="hidden" id="hasError" value="{!hasError}"/>
                 <apex:outputPanel id="message">
                     <apex:pageMessages />
                 </apex:outputPanel>
-                <table id="linetable" class="linetable" border="0" style="border-collapse: collapse;width:590px;table-layout:fixed;">
+                <table id="linetable" class="linetable" border="0" style="border-collapse: collapse;width:1000px;table-layout:fixed;">
                     <colgroup>
                         <col width="100px"/>
                         <col width="300px"/>
+                        <col width="350px"/>
                         <col width="300px"/>
                     </colgroup>
-                    <apex:repeat value="{!AdjudicationDataList}" var="AdInfo" id="records">
+                    <!-- <apex:repeat value="{!AdjudicationDataList}" var="AdInfo" id="records"> -->
                     <tr>
-                        <td align="left" colspan="3">
+                        <td align="left" colspan="4">
                             <apex:outputLabel value="> 鍐宠淇℃伅" style="font-size:22px;font-weight:bold;"/>
                         </td>
 					</tr>
@@ -69,34 +63,26 @@
 					<tr>
 						<td style="text-align: center;">&nbsp;</td>
 						<td style="text-align: left;">
-							<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鏄惁鐢宠鍐宠"/>
-							<apex:inputCheckbox id="isAdjudication" value="{!AdInfo.isAdjudication}"/>
+							<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="鏄惁闇�瑕佺敵璇峰喅瑁�"/>
+							<apex:inputField id="isAdjudication" value="{!AdjudicationDataobj.cam.IF_Approved__c}"  onchange="changeCheckbox();"/>
 						</td>
 						<td style="text-align: left;">
 							<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="浼氳鍐宠缂栫爜"/>
-							<apex:inputField id="Meeting_Approved_No" value="{!AdInfo.cam.Meeting_Approved_No__c}"/>
-						</td>
-					</tr>
-					<tr><td>&nbsp;</td></tr>
-					<tr>
-						<td style="text-align: center;">&nbsp;</td>
-						<td style="text-align: left;">
-							<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="浼氳鎶ュ憡"/>
-							<apex:inputField id="Meeting_Report" value="{!AdInfo.cam.Meeting_Report__c}"/>
+							<apex:inputField id="Meeting_Approved_No" value="{!AdjudicationDataobj.cam.Meeting_Approved_No__c}" onchange="displayDecisionThemeJS();"/>
 						</td>
 						<td style="text-align: left;">
-							<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="浼氳鍐宠缂栫爜(鏂囨湰)"/>
-							<apex:inputField id="MeetingApprovedNo" value="{!AdInfo.cam.MeetingApprovedNo__c}"/>
+							<apex:outputLabel style="font-weight: bold; padding-right: 8px;" value="浼氳鍐宠涓婚锛�"/>
+							<apex:outputText id="DecisionTheme" value="{!CampaignTheme}"/>
 						</td>
 					</tr>
 					<tr><td>&nbsp;</td></tr>
 					<tr>
 						<td align="center" colspan="3">
-							<apex:commandButton immediate="true" onclick="skip();" value="纭" style="width:50px;margin-right: 10px;"/>
-							<apex:commandButton immediate="true" onclick="closeWindowJs();" value="鍙栨秷" style="width:50px"/>
+							<apex:commandButton immediate="true" action="{!skipPage}" value="纭" style="width:50px;margin-right: 10px;"/>
+							<apex:commandButton immediate="true" action="{!returnPage}" value="鍙栨秷" style="width:50px"/>
 						</td>
 					</tr>
-                    </apex:repeat>
+                    <!-- </apex:repeat> -->
                 </table>
             </apex:pageBlock>
         </apex:outputPanel>
diff --git a/force-app/main/default/pages/CampaignMember.page b/force-app/main/default/pages/CampaignMember.page
index c02e94c..ba54e2c 100644
--- a/force-app/main/default/pages/CampaignMember.page
+++ b/force-app/main/default/pages/CampaignMember.page
@@ -212,7 +212,8 @@
                     '&lea20_lkid=' + campaignId +
                     '&CF00N10000004oN28=' + encodeURI(campaign) + 
                     '&CF00N10000004oN28_lkid=' + campaignId +
-                    '&lea5=' + encodeURI('瀛︿細/娌欓緳') + 
+                    // '&lea5=' + encodeURI('瀛︿細/娌欓緳') + 
+                    '&lea5=' + encodeURI('瀛︿細浼氳') + 
                     '&CF00N10000006qNtt=' + encodeURI(contactSDCName);
         }else{      
             //鏂板缓璇㈤棶鍗� URL  瀹㈡埛濮撳悕 绉戝  璇㈤棶鍗曟潵婧� 涓昏瀛︿細 鍏徃 鎰忓悜瀛︿細
@@ -224,7 +225,8 @@
                     '&CF00N1000000962nJ_lkid=' + accid +
                     '&CF00N1000000962n3=' + encodeURI(campaign) + 
                     '&CF00N1000000962n3_lkid=' + campaignId +
-                    '&00N1000000962nO=' + encodeURI('瀛︿細/娌欓緳') +
+                    // '&00N1000000962nO=' + encodeURI('瀛︿細/娌欓緳') +
+                    '&00N1000000962nO=' + encodeURI('瀛︿細浼氳') +
                     '&CF00N1000000962nC=' + encodeURI(records[0].Department_Class__r.Name)+
                     '&CF00N1000000962nC_lkid=' + encodeURI(records[0].Department_Class__c)+
                     '&Name='+encodeURI(username)+
diff --git a/force-app/main/default/pages/ConsumEquipmentSetReceived.page b/force-app/main/default/pages/ConsumEquipmentSetReceived.page
index a336cd5..4aec46b 100644
--- a/force-app/main/default/pages/ConsumEquipmentSetReceived.page
+++ b/force-app/main/default/pages/ConsumEquipmentSetReceived.page
@@ -40,7 +40,7 @@
   height: 100px;
   width: 30px;
 }
-/*add start by youc 2021-12-07 鑰楁潗杩芥函 -鏀惰揣 绠$悊缂栫爜 澶囧搧绠$悊鐮佽缃垚鍙 
+/*add start by youc 2021-12-07 鑰楁潗杩芥函 -鏀惰揣 绠$悊缂栫爜 澶囧搧绠$悊鐮佽缃垚鍙
 .col_ManagementCode__c input{
     border:none;   
     pointer-events: none;
@@ -49,7 +49,7 @@
     border:none;
     pointer-events: none;
 }
-*/
+ */
 .col_barcodeforReceipt__c{
     display: none; 
 }
@@ -108,7 +108,7 @@
             <tr>  <td align="right">绠$悊缂栫爜</td>         <td><span id="bianma"/></td>  </tr> -->
             <tr class="headerRow" height="30px">
                 <td class="headerRow  booleanColumn" onclick="document.getElementById('xiaomaCode').focus();return false" align="left">
-                    鐮佹灙鎵弿琚嬪瓙浜岀淮鐮�: <input id="xiaomaCode" onkeypress="return checkXiaoMa(event)" autofocus="autofocus" />
+                    鐮佹灙鎵弿琚嬪瓙鏉″舰鐮�: <input id="xiaomaCode" onkeypress="return checkXiaoMa(event)" autofocus="autofocus" />
                 </td>
                 <!-- <td class="headerRow  booleanColumn"> <input id="xiaomaCode" onkeypress="return checkXiaoMa(event)" autofocus="autofocus" /> </td> -->
                 <!-- <td class="headerRow  booleanColumn" colspan="8"/> -->
@@ -452,6 +452,7 @@
             //update  by     wangweipeng           2022/02/24          end
         }
         j$("#boxCode").val("");
+        setTimeout(function(){j$("#maqCode").focus();},300);
     }
 
     //4.鎵皬鐮佷箣鍚庡鐮佺殑鏍¢獙
@@ -522,12 +523,36 @@
                 return;
             }
             //鎵归噺璧嬪�肩殑涓�涓搷浣�
-            if (nowCode == 'AllmoveToBaoFei') {
+            if (nowCode == 'allMoveToBaoFei') {
                 if(tableId.rows.length > 0){
                     for(var i=1;i<tableId.rows.length;i++) {
                         tableId.children[0].children[i].children[7].children[0].checked = true;
                         tableId.children[0].children[i].children[8].children[0].checked = false;
                         tableId.children[0].children[i].children[9].children[0].checked = false;
+                    }
+                }            
+                
+                j$( '#xiaomaCode' ).val("");
+                return;
+            }
+            if (nowCode == 'allMoveToGuoqi') {
+                if(tableId.rows.length > 0){
+                    for(var i=1;i<tableId.rows.length;i++) {
+                        tableId.children[0].children[i].children[7].children[0].checked = false;
+                        tableId.children[0].children[i].children[8].children[0].checked = true;
+                        tableId.children[0].children[i].children[9].children[0].checked = false;
+                    }
+                }            
+                
+                j$( '#xiaomaCode' ).val("");
+                return;
+            }
+            if (nowCode == 'allShangJia') {
+                if(tableId.rows.length > 0){
+                    for(var i=1;i<tableId.rows.length;i++) {
+                        tableId.children[0].children[i].children[7].children[0].checked = false;
+                        tableId.children[0].children[i].children[8].children[0].checked = false;
+                        tableId.children[0].children[i].children[9].children[0].checked = true;
                     }
                 }            
                 
@@ -548,7 +573,7 @@
             var YZCode =SMCode+nowCode;
             //if (havCode.indexOf(nowCode) != -1) {
             if (havCode.indexOf(YZCode) != -1) {    
-                alert('璇ユ槑缁嗗凡淇濆瓨杩�,璇烽噸鏂板皾璇�');
+                alert('璇ユ槑缁嗗凡淇濆瓨杩�,涓嶈兘鍐嶈繘琛屼慨鏀�');
                 j$( '#xiaomaCode' ).val("");
                 return;
             }
@@ -556,18 +581,22 @@
             var aa = rowObj[0].children[17].children[1].value;
             //alert(aa);
             if (aa != null && aa.length > 0) {
-
                 //鍚戝脊鍑烘閲屾坊鍔犳槑缁嗚
                 //if (aa.indexOf(nowCode) == -1) {
                 if (aa.indexOf(YZCode) == -1) {
                     //alert('this.flag==='+this.flag);
                     if (this.flag == 'delConsumables') {
-                        alert('蹇呴』鍏堟壂鎻忚鍙栨秷鐨勫皬鐮�');
+                        alert('宸茶繘鍏ュ垹闄ゅ皬鐮佹搷浣滐紝璇锋壂鎻忔纭殑灏忕爜');
                         j$( '#xiaomaCode' ).val("");
                         this.flag = '';
                         return;
-                    }
-                    alert('鎵弿鐨勫皬鐮佸湪鍙戣揣鏄庣粏涓笉瀛樺湪锛岃閲嶆柊鎵弿!');
+                    } else if(nowCode != null && nowCode.length == 3 && !isNaN(nowCode)){
+                       }else{
+                          alert('褰撳墠灏忕爜涓嶆纭�');
+                          j$( '#xiaomaCode' ).val("");
+                          return;
+                       }
+                    alert('鎵弿鐨勫皬鐮佸湪鍙戣揣鏄庣粏涓笉瀛樺湪鎴栨湭瀵勫洖锛岃閲嶆柊鎵弿!');
                     j$( '#xiaomaCode' ).val("");
                     return;
                 }else{
@@ -575,7 +604,7 @@
                     // var tableId = document.getElementById("detailTb"); 
                     if(tableId.rows.length > 0){
                         for(var i=1;i<tableId.rows.length;i++) {
-                            //alert(nowCode+'=498='+tableId.rows[i].cells[6].innerHTML);
+                            console.log(nowCode+'=498='+tableId.rows[i].cells[6].innerHTML);
                             if(nowCode == tableId.rows[i].cells[6].innerHTML){
                                 if (this.flag == 'delConsumables') {
                                     //鍒犻櫎杩欎竴琛�
@@ -585,15 +614,31 @@
                                     return;
                                 }else{
                                     //灏忕爜宸插瓨鍦� 婊炲悗 鍏堝垹鍚庡姞 鐩稿綋浜庤鎵繖涓皬鐮佺殑閭d笁涓被鍨�
+                                    var bf1 = tableId.children[0].children[i].children[7].children[0].checked;
+                                    var gq1 = tableId.children[0].children[i].children[8].children[0].checked;
+                                    var sj1 = tableId.children[0].children[i].children[9].children[0].checked;
+                                    console.log(bf1+'=1='+gq1+'=='+sj1);
                                     tableId.rows[i].remove();
                                     j$( '#xiaomaCode' ).val("");
                                     // return;
-                                    alert('宸蹭负鎮ㄦ粸鍚�!');
-                                    break;
+                                    alert('灏忕爜宸叉壂鎻忥紝鏃犻渶鍐嶆鎵弿锛�');
+                                    // console.log(bf1+'=2='+gq1+'=='+sj1);
+                                    if (bf1) {
+                                         addRow(nowCode,'1');
+                                    }else if (gq1) {
+                                         addRow(nowCode,'2');
+                                    }else if (sj1) {
+                                         addRow(nowCode,'3');
+                                    }else{
+                                         addRow(nowCode,'');
+                                    }
+                                    //break;
+                                    return;
                                 }                                
                             }
                         }  
                     }
+                    console.log('鏂扮爜鐩存帴娣诲姞');
                     addRow(nowCode,'');
                 }
             }
@@ -709,6 +754,33 @@
             tableId.children[0].children[tableId.rows.length-1].children[8].children[0].checked = false;
             tableId.children[0].children[tableId.rows.length-1].children[9].children[0].checked = true;
             return false
+        } else if (ipadnowCode == 'allMoveToBaoFei') {//鎵归噺璧嬪�肩殑涓�涓搷浣�
+            if(tableId.rows.length > 0){
+                for(var i=1;i<tableId.rows.length;i++) {
+                    tableId.children[0].children[i].children[7].children[0].checked = true;
+                    tableId.children[0].children[i].children[8].children[0].checked = false;
+                    tableId.children[0].children[i].children[9].children[0].checked = false;
+                }
+            }            
+            return false
+        }else if (ipadnowCode == 'allMoveToGuoqi') {
+            if(tableId.rows.length > 0){
+                for(var i=1;i<tableId.rows.length;i++) {
+                    tableId.children[0].children[i].children[7].children[0].checked = false;
+                    tableId.children[0].children[i].children[8].children[0].checked = true;
+                    tableId.children[0].children[i].children[9].children[0].checked = false;
+                }
+            }            
+            return false
+        }else if (ipadnowCode == 'allShangJia') {
+            if(tableId.rows.length > 0){
+                for(var i=1;i<tableId.rows.length;i++) {
+                    tableId.children[0].children[i].children[7].children[0].checked = false;
+                    tableId.children[0].children[i].children[8].children[0].checked = false;
+                    tableId.children[0].children[i].children[9].children[0].checked = true;
+                }
+            }            
+            return false
         }
        
         var havCode = document.getElementById("havCode").value;
@@ -717,24 +789,27 @@
         var YZCode =SMCode+ipadnowCode;
         //if (havCode.indexOf(ipadnowCode) != -1) {
         if (havCode.indexOf(YZCode) != -1) {  
-            alert('璇ユ槑缁嗗凡淇濆瓨杩�,璇烽噸鏂板皾璇�')
+            alert('璇ユ槑缁嗗凡淇濆瓨杩�,涓嶈兘鍐嶈繘琛屼慨鏀�')
             return false;
         }
         //aa 鎷垮埌璇ヤ繚鏈夎澶囧搴旂殑鎵�鏈夊皬鐮� 鍒ゆ柇鏄惁瀛樺湪
         var aa = rowObj[0].children[17].children[1].value;
         if (aa != null && aa.length > 0) {
-
             //鍚戝脊鍑烘閲屾坊鍔犳槑缁嗚
             //if (aa.indexOf(ipadnowCode) == -1) {
             if (aa.indexOf(YZCode) == -1) {
                 console.log('3=='+ipadnowCode+'==='+ipadflag);
                 if (ipadflag == 'delConsumables') {
-                    alert('蹇呴』鍏堟壂鎻忚鍙栨秷鐨勫皬鐮�')
+                    alert('宸茶繘鍏ュ垹闄ゅ皬鐮佹搷浣滐紝璇锋壂鎻忔纭殑灏忕爜')
                     ipadflag = '';
 
                     return false;
+                }else if(ipadnowCode != null && ipadnowCode.length == 3 && !isNaN(ipadnowCode)){
+                }else{
+                  alert('褰撳墠灏忕爜涓嶆纭�');
+                  return;
                 }
-                alert('鎵弿鐨勫皬鐮佸湪鍙戣揣鏄庣粏涓笉瀛樺湪锛岃閲嶆柊鎵弿!')
+                alert('鎵弿鐨勫皬鐮佸湪鍙戣揣鏄庣粏涓笉瀛樺湪鎴栨湭瀵勫洖锛岃閲嶆柊鎵弿!')
                 return;
             }else{
                 //鍒ゆ柇鏄惁宸茬粡鎵弿杩�
@@ -754,6 +829,10 @@
                                  break;
                             }else{
                                 //灏忕爜宸插瓨鍦� 婊炲悗 鍏堝垹鍚庡姞 鐩稿綋浜庤鎵繖涓皬鐮佺殑閭d笁涓被鍨�
+                                var bf1 = tableId.children[0].children[i].children[7].children[0].checked;
+                                var gq1 = tableId.children[0].children[i].children[8].children[0].checked;
+                                var sj1 = tableId.children[0].children[i].children[9].children[0].checked;
+                                console.log(bf1+'=1='+gq1+'=='+sj1);
                                 tableId.rows[i].remove();
                                 // return;
                                 //alert('qqq')
@@ -762,10 +841,21 @@
                                 // });
                                 // j$
                                //alert(1)
-                               alert('宸蹭负鎮ㄦ粸鍚�!');
+                               alert('灏忕爜宸叉壂鎻忥紝鏃犻渶鍐嶆鎵弿锛�');
                                 //宸蹭负鎮ㄦ粸鍚�!
-                                //break;
-                            }                                
+                                //break;涔嬪墠灏辨槸娉ㄩ噴鐨�
+                                console.log(bf1+'=2='+gq1+'=='+sj1);
+                                if (bf1) {
+                                    addRow(ipadnowCode,'1');
+                                }else if (gq1) {
+                                    addRow(ipadnowCode,'2');
+                                }else if (sj1) {
+                                    addRow(ipadnowCode,'3');
+                                }else{
+                                     addRow(ipadnowCode,'');
+                                }
+                                return;
+                        }                                
                         }
                     }
                     // 
@@ -876,7 +966,7 @@
                 //add by youc 2021-12-07 end 鍒犻櫎杈撳叆妗嗗唴瀹� 骞跺厜鏍囪嚜鍔ㄥ畾浣嶅埌杈撳叆妗�
                 return false;
             } else if(allboxbarcode.indexOf(content250) == -1){
-               alert('鎵弿鐨勭洅涓庡彂璐ф椂涓嶄竴鑷达紝璇烽噸鏂版壂鎻�');
+               alert('鎵弿鐨勭洅涓庡彂璐ф椂涓嶄竴鑷存垨鏈瘎鍥烇紝璇烽噸鏂版壂鎻�');
                if(maqiang !='' && maqiang !=undefined){
                    j$("#maqCode").val("");
                    j$("#maqCode").focus();
diff --git a/force-app/main/default/pages/ConsumEquipmentSetShipment.page b/force-app/main/default/pages/ConsumEquipmentSetShipment.page
index 3d47fe9..af4d90c 100644
--- a/force-app/main/default/pages/ConsumEquipmentSetShipment.page
+++ b/force-app/main/default/pages/ConsumEquipmentSetShipment.page
@@ -36,12 +36,12 @@
   height: 100px;
   width: 30px;
 }
-/* add by rentx 2021-10-21 start 璁剧疆灞曠ず妗�
+/* add by rentx 2021-10-21 start 璁剧疆灞曠ず妗�  */
 .col_EquipmentManagementCode__c {display: none;}
 .col_Scroll{display: none;}
 .dataRow.col_Scroll{display: none;}
 .col_ManagementCode__c{display: none;}
- */
+
 .modal 
 {
     display:none;
@@ -142,8 +142,9 @@
                 <apex:commandButton onclick="qrsacn(0);return false;" value="鎵竴鎵�楁潗" rerender="allForm"/>
                 <apex:commandButton onclick="qrsacn(1);return false;" value="鎵竴鎵墿娴佸崟" rerender="allForm"/>
                 <apex:commandButton onclick="blockme();" action="{!send}" value="鍙戣揣" rerender="message" oncomplete="unblockUI();checkMessage();checEventFrame()"/>
-                <!-- add     wangweipeng          2021/01/10             start -->
-                <apex:commandButton onclick="window.open('/apex/ConsumTrialPDF?id={!parentId}');" value="璇曠敤琛�" rerender="allForm"/>
+                <!-- add     wangweipeng          2021/01/10      /apex/ConsumTrialPDF?id={!parentId}     ConsumEquipmentSetShipmentPDF   start -->
+                <apex:commandButton onclick="window.open('ConsumTrialPDF?id={!parentId}');" value="璇曠敤琛�" rerender="allForm"/>
+                <!--<a href="openSafri/apex/ConsumTrialPDF?id={!parentId}">璇曠敤琛�</a> -->
                 <!-- add     wangweipeng          2021/01/10             end -->
                 <!-- add by rentx 2021-10-21 start 鏂板鐮佹灙鎵弿 -->
                 <apex:commandButton onclick="document.getElementById('maqCode').focus();return false" id="maqCodeBtn"  value="鐮佹灙鎵弿锛�" style="padding: 6px;font-size: 110%;margin-right: 1px;"/>
@@ -181,7 +182,8 @@
                     <td >
                       <apex:outputLabel for="slipNo" value="鍙戣揣-杩愯緭鍗曞彿锛�" />
                       <apex:inputField id="slipNo" value="{!slip.Name}"/>
-                      <apex:commandButton action="{!searchSlip}" value="妫�绱�" style="padding: 6px;font-size: 110%;" rerender="allForm" oncomplete="checEventFrame()"/>
+                     <!-- <apex:commandButton action="{!searchSlip}" value="妫�绱�" style="padding: 6px;font-size: 110%;" rerender="allForm" oncomplete="checEventFrame()"/> -->
+                     <apex:commandButton action="{!searchSlip}" value="妫�绱�" style="padding: 6px;font-size: 110%;" rerender="searchBlock" oncomplete="checEventFrame()"/>
                     </td>
                     <td width="10px"></td>
                     <td >
@@ -243,6 +245,7 @@
 
                 j$("#tableData input[type=text]").on('change', function() {
                     let rownum = j$(this)[0].id.match(/oppTable\:(\d*)/)[1];
+                    alert('====rownum=='+rownum);
                     j$('input[name$="oppTable_L:'+rownum+':rowCheck"]').prop('checked', true).trigger("change");
                 })
 
@@ -254,8 +257,8 @@
                     }
                 }
                 //20220215 瀛楁闆嗕腑鐨勮緭鍏ユ鍙樻垚鍙锛屼笉鑳界洿鎺ュ彉鎴恠pan锛屽惁鍒欏悗鍙板彇涓嶅埌鍊�
-                j$("#tableData input[type=text]").attr("readonly",true);
-               j$("#tableData input[type=text]").attr("disabled","disabled");
+               //j$("#tableData input[type=text]").attr("readonly",true);  鍏堥殣钘忔帀
+               //j$("#tableData input[type=text]").attr("disabled","disabled");
             </script>
         </apex:outputPanel>
     </apex:outputPanel>
@@ -320,6 +323,9 @@
                 return false;
             }
             //鍒ゆ柇杩欎釜灏忕爜code 鏄惁绗﹀悎瑕佹眰 1:闀垮害鏄惁姝g‘ 2:鏄惁閲嶅杈撳叆 3:杈撳叆鐨勬槸鍚︿负3浣嶆暟瀛�
+           // var regNeg = /^[1-9]+[0-9]*]*$/; // 璐熸暣鏁�
+            //z<0||!(/^\d+$/.test(z))
+            // && nowCode>=0 && (/^\d+$/.test(nowCode))
             if(nowCode != null && nowCode.length == 3 && !isNaN(nowCode)){
                 //鑾峰彇鎵弿杩囩殑灏忕爜
                 var tableId = document.getElementById("detailTb"); 
@@ -480,7 +486,7 @@
 
         var code = paobj[0].children[9].children[0].value;  //.innerText; 
         var hecode = paobj[0].children[10].children[0].value;  //.innerText; 
-        alert('xiaoma'+code);
+        //alert('xiaoma'+code);
         if (code != null && code.length > 0) {
             //鍚戝脊鍑烘閲屾坊鍔犳槑缁嗚
             var arr = code.split(',');
@@ -513,7 +519,7 @@
         //j$(".modal").hide();
         j$("#myModal1").hide();
         scanType = null;
-        
+        j$("#maqCode").focus();
         if(numflag == 0 ){
             //鐢ㄦ埛鐐瑰嚮淇濆瓨 1.璁剧疆鏁伴噺鍒板彂璐т欢鏁颁笂   2.璁剧疆灏忕爜鍒版槑缁嗙殑澶囧搧绠$悊鐮佷笂
             if(numObj != null){
@@ -669,11 +675,12 @@
             checkObj.prop('checked', false);
         }
         var maqCode = j$( '#maqCode' ).val();
-        alert('==='+j$( '#maqCode' ).val());
-        if (maqCode !='' && maqCode !=undefined){
+        //alert('==='+j$( '#maqCode' ).val());
+        //if (maqCode !='' && maqCode !=undefined){
             j$("#maqCode").val("");
             j$("#maqCode").focus();
-        }
+            setTimeout(function(){j$("#maqCode").focus();},300);
+        //}
     }
     // <!-- add by qiuyj 2021-11-30 start  pc绔壂鐮佹敮鎸�-->
     j$(document).ready(function(){
@@ -687,6 +694,8 @@
                 return false;
             }
         });
+        setTimeout(function(){j$("#maqCode").focus();},300);
+
     });
     // add by qiuyj 2021-11-30 end  pc绔壂鐮佹敮鎸�
     // add by rentx 2021-10-19 end 鑰楁潗杩芥函 -鐮佹灙鎵爜涔嬪悗灞曠ず寮瑰嚭妗� 
@@ -777,8 +786,10 @@
         try{
         if (scanType == 1) {
             j$("input[name$='slipNo']").val(content);
+            scanType = null;
         }else if(scanType == 2){//add by youc 2021-12-01 寮瑰嚭妗嗕腑ipad鎵弿灏忕爜
             checkipadXiaoMa(content);
+            scanType = null;
         } else {
             
                  var tracingCode = content.substr(-8);//鎴彇鍚�8浣�
@@ -996,6 +1007,7 @@
             j$("#qrcode").focus();
             //add by qiuyj 2021-11-30 end  pc绔壂鐮佹敮鎸�-->
              //alert('鎵弿鏉″舰鐮佽浣跨敤App');
+             
         }
     }
 
diff --git a/force-app/main/default/pages/ContractDetailPDF.page b/force-app/main/default/pages/ContractDetailPDF.page
index 048c9ac..c72c76c 100644
--- a/force-app/main/default/pages/ContractDetailPDF.page
+++ b/force-app/main/default/pages/ContractDetailPDF.page
@@ -165,8 +165,9 @@
                          <c:PDFWbr targetStr="{!item.qli.NameForPrint__c}"/>
                 </apex:column>
                 <apex:column styleClass="detailRowString" style="vertical-align:text-top;width: 80px">
+                        <!-- lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲 -->
                         <!-- <apex:facet name="header">{!$Label.Quote_SFDA_Approbation_No}</apex:facet>  </br>-->
-                        <apex:facet name="header">娉ㄥ唽璇佸彿/ 澶囨鍑瘉缂栧彿</apex:facet>
+                        <apex:facet name="header">娉ㄥ唽璇佸彿/ 澶囨鍑瘉 <br/>缂栧彿</apex:facet>
                         <apex:outputText value="{!item.ApprobationNo_c}"/>
                 </apex:column>
                 <apex:column styleClass="detailRowString" style="vertical-align:text-top;width: 160px">
@@ -200,14 +201,14 @@
                         <apex:outputText value="銆�銆�"/>
                 </apex:column>
                 <apex:column styleClass="detailRowString" style="vertical-align:text-top; text-align: center;">
-                        <apex:facet name="header">鐗规畩淇濅慨骞撮檺</apex:facet>
+                        <apex:facet name="header">鐗规畩淇濅慨 骞撮檺</apex:facet>
                         <apex:outputText value="{!item.qli.GuaranteePeriod__c}"/>
                 </apex:column>
                 
                 <!-- lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  start -->
                 <apex:column styleClass="detailRowNumeric">
                         <apex:facet name="header">浜よ揣鏈�</apex:facet>
-                        <apex:outputText value="{!item.qli.PricebookEntry.Product2.DeliveryDate__c}"/>
+                        <apex:outputText value="{!item.qli.DeliveryDate__c}"/>
                 </apex:column>
                 <!-- lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  end -->
                 
@@ -368,10 +369,10 @@
                 </apex:column>
 
                 <!-- lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  start -->
-                <apex:column styleClass="detailRowNumeric">
+                <!-- <apex:column styleClass="detailRowNumeric">
                         <apex:facet name="header">浜よ揣鏈�</apex:facet>
-                        <apex:outputText value="{!item.qli.PricebookEntry.Product2.DeliveryDate__c}"/>
-                </apex:column>
+                        <apex:outputText value="{!item.qli.DeliveryDate__c}"/>
+                </apex:column> -->
                 <!-- lt 20220223 CHAN-CBW9FX 鐗规畩浜よ揣鏈熷奖鍝嶇殑瀵瑰簲  end -->
 
             </apex:dataTable>
diff --git a/force-app/main/default/pages/DirectAssign.page b/force-app/main/default/pages/DirectAssign.page
index 7c4da83..bfc9ddf 100644
--- a/force-app/main/default/pages/DirectAssign.page
+++ b/force-app/main/default/pages/DirectAssign.page
@@ -17,7 +17,6 @@
   <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
   <apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
 </head>
-<!-- note -->
    <apex:form id="allForm">
     <apex:outputPanel id="pageallPanel">
       <apex:pageBlock id="searchBlock" tabStyle="Report">
diff --git a/force-app/main/default/pages/EquipmentSetShippmentReceived2.page b/force-app/main/default/pages/EquipmentSetShippmentReceived2.page
index 1c8c51a..8644d9e 100644
--- a/force-app/main/default/pages/EquipmentSetShippmentReceived2.page
+++ b/force-app/main/default/pages/EquipmentSetShippmentReceived2.page
@@ -310,6 +310,29 @@
                             <span><apex:outputField id="inspectionResultNg1" value="{!esdInfo.rec.Inspection_result_NG__c}" style="margin:3px;width:75px;"/></span>
                             </apex:outputPanel>
                         </li>
+
+                        <li style="{!IF(esdInfo.rec.Inspection_result_NG__c='缁翠慨','','display: none;')}">
+                            <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Pre_NG_abord_reason__c.label}锛�</span>
+                            <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable,esdInfo.rec.Inspection_result_NG__c='缁翠慨')}">
+                            <span>
+                                <apex:inputField id="inspectionResultNG2" value="{!esdInfo.rec.Pre_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;"/>
+                            </span>
+                            <script>
+                                disabledShowNG() {
+                                    var inspection_result_NG = '{!esdInfo.rec.Inspection_result_NG__c}';
+                                    if(inspection_result_NG  != '搴熷純'){
+                                        j$(escapeVfId('allPage:allForm:esdList:' + ('{!indexloop}' - 1) + ':inspectionResultNG2')).prop("disabled", true);
+                                    }
+                                }
+                            </script>
+                            </apex:outputPanel>
+                            <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable),esdInfo.rec.Inspection_result_NG__c='缁翠慨')}">
+                                <span>
+                                    <apex:outputField value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;"></apex:outputField>
+                                </span>
+                            </apex:outputPanel>
+                        </li>
+
                         <li style="{!IF(esdInfo.quickCheck, 'background:#BBFF66;', '')}">
                             <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Pre_Inspection_Comment__c.label}锛� </span>
                             <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}">
diff --git a/force-app/main/default/pages/FollowPage.page b/force-app/main/default/pages/FollowPage.page
index d775cbf..e118b29 100644
--- a/force-app/main/default/pages/FollowPage.page
+++ b/force-app/main/default/pages/FollowPage.page
@@ -11,7 +11,13 @@
     	function save(){
     		var content = j$(escapeVfId('allPage:allForm:pageBlock:pageBlockSection:content')).value();
     		var contentOther = j$(escapeVfId('allPage:allForm:pageBlock:pageBlockSection:contentOther')).value();
-    		if ((content.trim() == '' || content.trim() == null) && (contentOther.trim() == null || contentOther.trim() == '')) {
+    		if ((content == '' || content == null) && (contentOther.trim() == null || contentOther.trim() == '')) {
+    			alert('璺熻繘鍐呭涓嶈兘涓虹┖锛�');
+                return;
+    		}else if (content == '鍏朵粬' && (contentOther.trim() == '' || contentOther.trim() == null)) {
+    			alert('璺熻繘鍐呭锛堝叾浠栵級涓嶈兘涓虹┖锛�');
+                return;
+    		}else if (content == '' || content == null) {
     			alert('璺熻繘鍐呭涓嶈兘涓虹┖锛�');
                 return;
     		}else{
@@ -28,12 +34,14 @@
 	    <apex:actionfunction action="{!savefo}" name="allSave" onComplete="check();unblockUI();"></apex:actionfunction>
 		<apex:pageBlock id="pageBlock">
 		    <apex:pageBlockSection id="pageBlockSection">
-					<apex:inputField id="content" value="{!Inquiryform.Follow_Content__c}" style="width: 155px"/>
+					<apex:inputField id="content" value="{!Inquiryform.Follow_Content__c}" />
 					<br />
 					<apex:inputField id="contentOther" value="{!Inquiryform.Follow_Content_Other__c}" style="width: 150px"/>
+					<br />
 			</apex:pageBlockSection>
-			<apex:pageblockbuttons >
-				<apex:commandbutton onclick="save();return false;" value="淇濆瓨"></apex:commandbutton>
+
+			<apex:pageblockbuttons location="bottom">
+				<apex:commandButton onclick="save();return false;" value="淇濆瓨"></apex:commandButton>
 			</apex:pageblockbuttons>
 		</apex:pageBlock>
 	</apex:form>
diff --git a/force-app/main/default/pages/InventoryReport.page b/force-app/main/default/pages/InventoryReport.page
index 327adb1..da68f79 100644
--- a/force-app/main/default/pages/InventoryReport.page
+++ b/force-app/main/default/pages/InventoryReport.page
@@ -392,15 +392,15 @@
                 </table>
                 <table class="inventoryReportTable" width="100%">
                     <tr>
-                        <td class="tdStyle-right">缁忕悊锛堝鎵癸級锛�</td>
+                        <td class="tdStyle-right">CL6 缁忕悊绾э紙瀹℃壒锛夛細</td>
                         <td class="tdStyle-left">
                             <apex:outputText id="ivconfirmJingli" value="{!ihObj.Jingli_Equipment__r.Name}" />
                         </td>
-                        <td class="tdStyle-right">閮ㄩ暱锛堝鎵癸級锛�</td>
+                        <td class="tdStyle-right">CL5 鎬荤洃绾э紙瀹℃壒锛夛細</td>
                         <td class="tdStyle-left">
                             <apex:outputText id="ivconfirmBuzhang" value="{!ihObj.Buzhang_Equipment__r.Name}" />
                         </td>
-                        <td class="tdStyle-right">鎬荤洃锛堝鎵癸級锛�</td>
+                        <td class="tdStyle-right">CL4 楂樼骇鎬荤洃锛堝鎵癸級锛�</td>
                         <td class="tdStyle-left">
                             <apex:outputText id="ivconfirmZongjian" value="{!ihObj.Zongjian_Equipment__r.Name}" />
                         </td>
diff --git a/force-app/main/default/pages/InventoryResultRecordCopy.page b/force-app/main/default/pages/InventoryResultRecordCopy.page
index 9512749..91a1654 100644
--- a/force-app/main/default/pages/InventoryResultRecordCopy.page
+++ b/force-app/main/default/pages/InventoryResultRecordCopy.page
@@ -256,7 +256,9 @@
         // 妫�绱㈡寜閽�
         function searchBtnJs() {
             blockme();
-            searchBtnFunc();
+            alert('娌$敤鍒扮殑鍔熻兘锛屼笉瑕佺偣浜嗭紝鍝堝搱鍝�');
+            unblockUI();
+            // searchBtnFunc();
         }
         function hasChangeFunc() {
             hasChange = true;
@@ -336,7 +338,8 @@
             </apex:selectList>
             <br/>
             <br/>
-            <apex:commandButton action="{!save}" value="纭畾" reRender="allForm" onclick="blockme()" oncomplete="unblockUI();j$('#myModal3').hide();changeFullScreen(true);if(j$(escapeVfId('allPage:allForm:doneFlg')).val()=='true') alert('淇濆瓨瀹屼簡')"/>
+            <!-- action="{!save}" -->
+            <apex:commandButton value="纭畾" reRender="allForm" onclick="blockme()" oncomplete="unblockUI();j$('#myModal3').hide();changeFullScreen(true);if(j$(escapeVfId('allPage:allForm:doneFlg')).val()=='true') alert('淇濆瓨瀹屼簡')"/>
             <apex:commandButton style="margin-left: 60px;" value="鍙栨秷" onclick="j$('#myModal3').hide();return false;"/>
           </div>
 
@@ -344,7 +347,9 @@
         <apex:actionFunction name="startInventory" action="{!startInventory}" rerender="allForm" onComplete="unblockUI()" />
         <!-- update by rentx 20210827 start 鑰楁潗鐩樼偣鏂规 -->
         <!-- <apex:actionFunction name="searchBtnFunc" action="{!searchBtn}" rerender="allForm" onComplete="unblockUI();changeFullScreen(true);" /> -->
-        <apex:actionFunction name="searchBtnFunc" action="{!searchBtn}" rerender="allForm" onComplete="unblockUI();changeFullScreen(true);addHistory();" />
+        <!-- 20220228 ljh 113鐩樼偣start -->
+        <!-- <apex:actionFunction name="searchBtnFunc" action="{!searchBtn}" rerender="allForm" onComplete="unblockUI();changeFullScreen(true);addHistory();" /> -->
+        <!-- 20220228 ljh 113鐩樼偣end -->
         <!-- update by rentx 20210827 end 鑰楁潗鐩樼偣鏂规 -->
         <!-- <apex:actionFunction name="checkQRCode" action="{!checkQRCode}" rerender="qrType,qrError,qrId,repeat_panel" onComplete="checkQRDone()" >
             <apex:param name="qrcode" value="" />
diff --git a/force-app/main/default/pages/LostReportEdit.page b/force-app/main/default/pages/LostReportEdit.page
index 57a3248..fbdc383 100644
--- a/force-app/main/default/pages/LostReportEdit.page
+++ b/force-app/main/default/pages/LostReportEdit.page
@@ -563,9 +563,9 @@
                 <!-- add by rentx 20210605 1635 start 璋冩嫧鐨� 澶囧搧涓績鎻愪氦 -->
 
                 <apex:outputText rendered="{!pBean.tr != null && ! !pBean.lr.isBeipin__c}" >
-                <!-- 缁忕悊 -->
+                <!-- CL6 缁忕悊绾� -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">缁忕悊锛�</td>
+                            <td class="topb2 leftb2 rightb2">CL6 缁忕悊绾э細</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -580,9 +580,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 閮ㄩ暱 -->
+                <!-- CL5 鎬荤洃绾� -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">閮ㄩ暱锛�</td>
+                            <td class="topb2 leftb2 rightb2">CL5 鎬荤洃绾э細</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -597,9 +597,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 澶囧搧涓績鎬荤洃 -->
+                <!-- 澶囧搧涓績CL4 楂樼骇鎬荤洃 -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">澶囧搧涓績鎬荤洃锛�</td>
+                            <td class="topb2 leftb2 rightb2">澶囧搧涓績CL4 楂樼骇鎬荤洃锛�</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -636,9 +636,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 缁忕悊 -->
+                <!-- CL6 缁忕悊绾� -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">缁忕悊锛�</td>
+                            <td class="topb2 leftb2 rightb2">CL6 缁忕悊绾э細</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -653,9 +653,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 閮ㄩ暱 -->
+                <!-- CL5 鎬荤洃绾� -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">閮ㄩ暱锛�</td>
+                            <td class="topb2 leftb2 rightb2">CL5 鎬荤洃绾э細</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -670,9 +670,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 鍓�荤洃 -->
+                <!-- 鍓疌L4 楂樼骇鎬荤洃-->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">鍓�荤洃锛�</td>
+                            <td class="topb2 leftb2 rightb2">鍓疌L4 楂樼骇鎬荤洃锛�</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -687,9 +687,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 鎬荤洃 -->
+                <!-- CL4 楂樼骇鎬荤洃 -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">鎬荤洃锛�</td>
+                            <td class="topb2 leftb2 rightb2">CL4 楂樼骇鎬荤洃锛�</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -704,9 +704,9 @@
                                 </apex:outputText>
                             </td>
                     </tr>
-                <!-- 缁熸嫭鎬荤洃 -->
+                <!-- CL3 鍓�昏-->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">缁熸嫭鎬荤洃锛�</td>
+                            <td class="topb2 leftb2 rightb2">CL3 鍓�昏锛�</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -761,15 +761,15 @@
                     </tr>
                 </apex:outputText>
                 
-                <!-- 濡傛灉鏄皟鎷ㄧ殑璇� 杩欎釜鑺傜偣鏄繍钀ラ儴闀� 濡傛灉鏄洏鐐圭殑璇濊繖涓妭鐐规槸澶囧搧涓績閮ㄩ暱 浣嗘槸鐩樼偣鍙栧緱瀹℃壒浜烘槸 杩愯惀閮ㄩ暱 1650 1650鏆備笉涓婄嚎 鍏堟敞閲婃帀-->
+                <!-- 濡傛灉鏄皟鎷ㄧ殑璇� 杩欎釜鑺傜偣鏄繍钀L5 鎬荤洃绾� 濡傛灉鏄洏鐐圭殑璇濊繖涓妭鐐规槸澶囧搧涓績CL5 鎬荤洃绾� 浣嗘槸鐩樼偣鍙栧緱瀹℃壒浜烘槸 杩愯惀CL5 鎬荤洃绾� 1650 1650鏆備笉涓婄嚎 鍏堟敞閲婃帀-->
                     <tr>
                         <apex:outputText rendered="{!pBean.lr.Inventory_Header__c!= null}" >
-                            <td class="topb2 leftb2 rightb2">澶囧搧涓績閮ㄩ暱锛�</td>
+                            <td class="topb2 leftb2 rightb2">澶囧搧涓績CL5 鎬荤洃绾э細</td>
                         </apex:outputText>
                         <apex:outputText rendered="{!pBean.tr != null && !pBean.lr.isBeipin__c}" >
-                            <td class="topb2 leftb2 rightb2">杩愯惀閮ㄩ暱锛�</td>
+                            <td class="topb2 leftb2 rightb2">杩愯惀CL5 鎬荤洃绾э細</td>
                         </apex:outputText>
-                        <!-- <td class="topb2 leftb2 rightb2">杩愯惀閮ㄩ暱锛�</td> -->
+                        <!-- <td class="topb2 leftb2 rightb2">杩愯惀CL5 鎬荤洃绾э細</td> -->
 
                     </tr>
                     <tr>
@@ -785,9 +785,9 @@
                             </apex:outputText>
                         </td>
                     </tr>
-                <!-- 澶囧搧涓績鎬荤洃 -->
+                <!-- 澶囧搧涓績CL4 楂樼骇鎬荤洃 -->
                     <tr>
-                            <td class="topb2 leftb2 rightb2">澶囧搧涓績鎬荤洃锛�</td>
+                            <td class="topb2 leftb2 rightb2">澶囧搧涓績CL4 楂樼骇鎬荤洃锛�</td>
                         </tr>
                         <tr>
                             <td class="leftb2 rightb2">
@@ -811,7 +811,7 @@
                 <!-- add by rentx 20210605 end -->
 
                     <tr>
-                        <td class="topb2 leftb2 rightb2">缁忕悊锛�</td>
+                        <td class="topb2 leftb2 rightb2">CL6 缁忕悊绾э細</td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -827,7 +827,7 @@
                         </td>
                     </tr>
                     <tr>
-                        <td class="topb leftb2 rightb2">閮ㄩ暱锛� </td>
+                        <td class="topb leftb2 rightb2">CL5 鎬荤洃绾э細 </td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -842,7 +842,7 @@
                         </td>
                     </tr>
                     <tr>
-                        <td class="topb leftb2 rightb2">鍓�荤洃锛� </td>
+                        <td class="topb leftb2 rightb2">鍓疌L4 楂樼骇鎬荤洃锛� </td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -857,7 +857,7 @@
                         </td>
                     </tr>
                     <tr>
-                        <td class="topb leftb2 rightb2">缁熸嫭鎬荤洃锛堟�荤洃锛夛細 </td>
+                        <td class="topb leftb2 rightb2">CL3 鍓�昏锛圕L4 楂樼骇鎬荤洃锛夛細 </td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -913,7 +913,7 @@
                         <td class="topb2 leftb2 rightb2 bottomb center" colspan="5">澶囧搧浣跨敤娉ㄦ剰浜嬮」</td>
                     </tr>
                     <tr>
-                        <td class="leftb2 rightb2 bottomb left"  colspan="5">1銆佸綋鍙戠敓鍥哄畾璧勪骇閬楀け銉荤洏浜忔儏鍐垫椂锛岀敵璇蜂汉椤诲~鍐欐湰銆婂浐瀹氳祫浜ч仐澶便兓鐩樹簭鎶ュ憡銆嬶紝閫愮骇鍚戞墍灞為儴闂ㄩ瀵兼眹鎶ワ紝骞跺彇寰楃粺鎷�荤洃鎵瑰噯銆�</td>
+                        <td class="leftb2 rightb2 bottomb left"  colspan="5">1銆佸綋鍙戠敓鍥哄畾璧勪骇閬楀け銉荤洏浜忔儏鍐垫椂锛岀敵璇蜂汉椤诲~鍐欐湰銆婂浐瀹氳祫浜ч仐澶便兓鐩樹簭鎶ュ憡銆嬶紝閫愮骇鍚戞墍灞為儴闂ㄩ瀵兼眹鎶ワ紝骞跺彇寰桟L3 鍓�昏鎵瑰噯銆�</td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2 bottomb left"  colspan="5">2銆佸浜庨仐澶辨垨鐩樹簭鐨勫浐瀹氳祫浜х敱鍏徃鍋氬嚭鏈�鍚庡鐞嗗喅瀹氥��</td>
diff --git a/force-app/main/default/pages/LostReportEditAsset.page b/force-app/main/default/pages/LostReportEditAsset.page
index 9bdfd1c..39f96b0 100644
--- a/force-app/main/default/pages/LostReportEditAsset.page
+++ b/force-app/main/default/pages/LostReportEditAsset.page
@@ -518,7 +518,7 @@
                 <table class="inventoryReportTable" style="width: 100%;margin-top: 0px; margin-bottom: 0px;">
                     <col style="width: 100%;" />
                     <tr>
-                        <td class="topb2 leftb2 rightb2">缁忕悊锛�</td>
+                        <td class="topb2 leftb2 rightb2">CL6 缁忕悊绾�:</td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -533,7 +533,7 @@
                         </td>
                     </tr>
                     <tr>
-                        <td class="topb leftb2 rightb2">閮ㄩ暱锛� </td>
+                        <td class="topb leftb2 rightb2">CL5 鎬荤洃绾э細 </td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -548,7 +548,7 @@
                         </td>
                     </tr>
                     <tr>
-                        <td class="topb leftb2 rightb2">缁熸嫭鎬荤洃锛堟�荤洃锛夛細 </td>
+                        <td class="topb leftb2 rightb2">CL3 鍓�昏锛圕L4 楂樼骇鎬荤洃锛夛細 </td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2">
@@ -636,7 +636,7 @@
                         <td class="topb2 leftb2 rightb2 bottomb center" colspan="5">澶囧搧浣跨敤娉ㄦ剰浜嬮」</td>
                     </tr>
                     <tr>
-                        <td class="leftb2 rightb2 bottomb left"  colspan="5">1銆佸綋鍙戠敓鍥哄畾璧勪骇閬楀け銉荤洏浜忔儏鍐垫椂锛岀敵璇蜂汉椤诲~鍐欐湰銆婂浐瀹氳祫浜ч仐澶便兓鐩樹簭鎶ュ憡銆嬶紝閫愮骇鍚戞墍灞為儴闂ㄩ瀵兼眹鎶ワ紝骞跺彇寰楃粺鎷�荤洃鎵瑰噯銆�</td>
+                        <td class="leftb2 rightb2 bottomb left"  colspan="5">1銆佸綋鍙戠敓鍥哄畾璧勪骇閬楀け銉荤洏浜忔儏鍐垫椂锛岀敵璇蜂汉椤诲~鍐欐湰銆婂浐瀹氳祫浜ч仐澶便兓鐩樹簭鎶ュ憡銆嬶紝閫愮骇鍚戞墍灞為儴闂ㄩ瀵兼眹鎶ワ紝骞跺彇寰桟L3 鍓�昏鎵瑰噯銆�</td>
                     </tr>
                     <tr>
                         <td class="leftb2 rightb2 bottomb left"  colspan="5">2銆佸浜庨仐澶辨垨鐩樹簭鐨勫浐瀹氳祫浜х敱鍏徃鍋氬嚭鏈�鍚庡鐞嗗喅瀹氥��</td>
diff --git a/force-app/main/default/pages/MaintenanceCommissionPDF.page b/force-app/main/default/pages/MaintenanceCommissionPDF.page
index a7fec5d..73136a0 100644
--- a/force-app/main/default/pages/MaintenanceCommissionPDF.page
+++ b/force-app/main/default/pages/MaintenanceCommissionPDF.page
@@ -75,13 +75,11 @@
                             </td>
                             <td width="45%" style="font-size:120%">&nbsp;濡傛湁鐮存崯,澶囨敞鎻忚堪:</td>
                         </tr>
-                    </table>
-                    <table width="100%" border="1" cellspacing="0" style="border-top-color: white;">
                         <tr>
-                            <td width="20%" class="label">娓呮礂娑堟瘨鏃堕棿</td>
-                            <td width="30%" class="middle"></td>
-                            <td width="20%" class="label">娓呮礂娑堟瘨鑰�</td>
-                            <td width="30%" class="middle"></td>
+                            <td width="15%" class="label">娓呮礂娑堟瘨鏃堕棿</td>
+                            <td colspan="2" class="middle"></td>
+                            <td width="10%" class="label">娓呮礂娑堟瘨鑰�</td>
+                            <td class="middle"></td>
                         </tr>
                     </table>
                     <table width="100%" border="1" cellspacing="0">
diff --git a/force-app/main/default/pages/Ordergoods.page b/force-app/main/default/pages/Ordergoods.page
index b913049..c1af136 100644
--- a/force-app/main/default/pages/Ordergoods.page
+++ b/force-app/main/default/pages/Ordergoods.page
@@ -7,11 +7,8 @@
 	    <script type="text/javascript">
 	        function checkAll() {
 			    var productCount = j$(escapeVfId('Page:mainForm:productInfoList:Size')).value();
-			    // alert(productCount);
 			    if (j$(escapeVfId('checkAll1')).attr('checked') == 'checked') {
-			        // alert(productCount);
 			        for (var i = 0; i < productCount; i++) {
-			        	// Page:mainForm:productInfoList:0:rowcheck
 			            j$(escapeVfId('Page:mainForm:productInfoList:' + i + ':rowcheck')).attr('checked',true);
 			        }
 			    } else {
@@ -20,13 +17,6 @@
 			        }
 			    }
 			}
-	        // 璺宠浆鍒版煡璇骇鍝佹
-	        // function searchProduct1(i, str) {
-			// 	//id="Page:mainForm:block2:productInfoList:1:proModel"
-			// 	j$(escapeVfId('Page:mainForm:productInfoList:' + (i-1) + ':proModel')).attr('readonly', true);
-			//     // j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Assert')).attr('readonly', true);
-			//     openPopup('/apex/OrderSearchProduct?lineno=' + i + '&val=' + str, 'setsearch', 950, 450, 'width=950,height=450,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
-			// }
 
 	        // 淇濆瓨鎸夐挳
 	        function SaveJs() {
@@ -79,103 +69,32 @@
 			//add 褰撴敹璐ф柟涓哄姙浜嬪鏃讹紝鏀惰揣鏂瑰湴鍧�涓哄姙浜嬪鍦板潃 2021/11/17 fxk
 			function resetDealer() {
 				// 鏀惰揣鏂�
-			    var ReceivePart = j$(escapeVfId('Page:mainForm:sampleReceivePart')).val();
-			    var AccAdress = '{!AccName.Address__c}';
+				var ReceivePart = j$(escapeVfId('Page:mainForm:sampleReceivePart')).val();
+				var AccAdress = '{!AccName.Address__c}';
 				var AccPhone = '{!AccName.Phone}';
-			    if (ReceivePart == '鍔炰簨澶�') {
-			    	j$(escapeVfId('Page:mainForm:Address')).val(AccAdress);
+				if (ReceivePart == '鍔炰簨澶�') {
+					j$(escapeVfId('Page:mainForm:Address')).val(AccAdress);
 					j$(escapeVfId('Page:mainForm:Phone')).val(AccPhone);
-			    }else {
-			    	j$(escapeVfId('Page:mainForm:Address')).val('');
+				}else {
+					j$(escapeVfId('Page:mainForm:Address')).val('');
 					j$(escapeVfId('Page:mainForm:Phone')).val('');
 					j$(escapeVfId('Page:mainForm:Contact')).val('');
-			    }
+				}
 			}
 
-			// function getLastLineNoNext(doc) {
-	        //     var hasRecordFlg = false;
-	        //     var lastLineNo = 0;
-	        //     for(var i=99; i>=0; i--){
-	        //         if (j$(escapeVfId('Page:mainForm:productInfoList:' + i + ':proModel')).value() != ''){
-	        //             if (!hasRecordFlg) {
-	        //                 lastLineNo = i;
-	        //             }
-	        //             hasRecordFlg = true;
-	        //         }
-	        //         if (hasRecordFlg == true) {
-	        //             if (j$(escapeVfId('Page:mainForm:productInfoList:' + i + ':proModel')).value() == ''){
-	        //                 var moveCheckbox = true;
-	        //                 lastLineNo = i;
-	        //             }
-	        //         }
-	        //     }
-	        //     if (hasRecordFlg) {
-	        //         lastLineNo = lastLineNo + 1;
-	        //     }
-	        //     return lastLineNo;
-	        // }
-
-		// 	function radioChecker(str) {
-    	// 	//error鍒濇湡鍖�
-    	// 	var lastLineNoNext = getLastLineNoNext(document);
-    	// 	try {
-        // 		var hasCheckedCnt = 0;
-        // 		for (var i = 0; i < lastLineNoNext; i++) {
-        //     		var iChecked = document.forms['Page:mainForm']['checklist'][i].checked;
-        //     		if (iChecked) {
-        //         		hasCheckedCnt++;
-        //         		if (hasCheckedCnt > 1) {
-        //             		// 濡傛灉鐭ラ亾鏄惁鏈夊浠舵鏌� break
-        //             		break;
-        //         		}
-        //     		}
-        // 		}
-        // 		if (hasCheckedCnt == 0) {
-		// 			throw '璇烽�変腑鐩稿簲鐨勮';
-        // 		}
-        // 		var hasCheckedCnt1 = 0; // 瀹為檯鍙互鍙樻洿鐨勪欢鏁�
-		// 		if (str == 'del') {
-        //     		for (var i = lastLineNoNext - 1; i >= 0; i--) {
-        //         		var iChecked = document.forms['Page:mainForm']['checklist'][i].checked;
-        //         		if (iChecked) {
-        //             		hasCheckedCnt1++;
-        //             		deletelist(i, document);
-        //         		}
-        //     		}
-        // 		} else {
-        //     		throw 'Unknow Operation';
-        // 		}
-        // 		if (str == 'del') {
-        //     		clearAllCheck();
-        // 		}
-    	// 	} catch (e) {
-        // 		alert(e);
-    	// 	}
-    	// 	return true;
-		// }
-
-		// 娓呴櫎鎵�閫夋鐨勫嬀
-        // function clearAllCheck() {
-        //     j$(escapeVfId("checkAll"))[0].checked = false;
-        //     var checklist = j$("input[name='checklist']");
-        //     for(var i = 0; i < checklist.length; i++){
-        //         checklist[i].checked = false;
-        //     }
-        // }
-		//鏂囨湰妗嗚緭鍏ュ��,澶嶉�夋鑷姩鎵撳嬀 thh 2021-12-15
-        function ComputePrice(j) {
-            var productCount = j$(escapeVfId('Page:mainForm:productInfoList:Size')).value();
-            for(var i = 0; i < productCount; i++){
-                var samNumber = document.getElementById("Page:mainForm:productInfoList:"+ i +":Number").value;
-                var checklist = j$("input[name='Page:mainForm:productInfoList:"+ i +":rowcheck']");
-                if(samNumber != null && samNumber != 0 && samNumber != ''){
-                    checklist[0].checked = true;
-                }else{
-                    checklist[0].checked = false;
-                }
-            }
-        }
-		
+			//鏂囨湰妗嗚緭鍏ュ��,澶嶉�夋鑷姩鎵撳嬀 thh 2021-12-15
+			function ComputePrice(j) {
+				var productCount = j$(escapeVfId('Page:mainForm:productInfoList:Size')).value();
+				for(var i = 0; i < productCount; i++){
+					var samNumber = document.getElementById("Page:mainForm:productInfoList:"+ i +":Number").value;
+					var checklist = j$("input[name='Page:mainForm:productInfoList:"+ i +":rowcheck']");
+					if(samNumber != null && samNumber != 0 && samNumber != ''){
+						checklist[0].checked = true;
+					}else{
+						checklist[0].checked = false;
+					}
+				}
+			}
 	    </script>
 	    <!-- 鏍峰紡 -->
 		<style type="text/css">
@@ -231,7 +150,6 @@
 				border-bottom-width: 0;
 			}
 			
-			/* 娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 start */
 	        /* 杩欓噷涓嶈�冭檻娴忚鍣ㄧ殑鍏煎鎬� */
 	        input[type="range"] {
 	            width: 100%;
@@ -302,283 +220,209 @@
 	            opacity: 1;
 	            font-weight:bold;
 	        }
-	        /* 娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 end */
-			
 		</style>
-
 	</head>
-	<!-- <body onload="init()"> -->
-		<apex:form id="mainForm">
-			
-
-        	<h1 style ="font-size: 30px; margin-left: 45%;">鏍锋湰璁㈣揣</h1>
-        	<!-- 鍒濆鍖栭〉闈紙榛樿鍗佽绌鸿锛� -->
-			<!-- <apex:actionFunction name="searchHospital" action="{!searchHospital}" rerender="mainForm,listsTable" onComplete="unblockUI();mainForm">
-        	</apex:actionFunction> -->
-        	<!-- 榛樿鍗佽绌鸿 -->
-        	<!-- <apex:actionFunction name="addrow" action="{!addrow}" rerender="message,listsTable" onComplete="unblockUI();"> -->
-        	<!-- </apex:actionFunction> -->
-        	<!-- 淇濆瓨鎸夐挳 -->
-        	<!-- <apex:actionFunction name="save" action="{!save}" rerender="message,theTable_Body,listsTable" onComplete="unblockUI();"> -->
-        	<apex:actionFunction name="save" action="{!save}" rerender="message,mainForm,listsTable" onComplete="SaveAllChecktime();unblockUI();">
-        	</apex:actionFunction>
-        	<!-- 鍒犻櫎鎸夐挳 -->
-        	<!-- <apex:actionFunction name="deleteBtn" action="{!deleteBtn}" rerender="message,mainForm,listsTable" onComplete="unblockUI();">
-        	</apex:actionFunction> -->
-        	<!-- 纭鎸夐挳 -->
-        	<apex:actionFunction name="confirmBtn" action="{!confirmBtn}" rerender="message,mainForm,listsTable" onComplete="SaveAllChecktime();unblockUI();">
-        	</apex:actionFunction>
-        	<!-- <apex:actionFunction name="resetDealer" action="{!Dummy}" rerender="listsTable" oncomplete="resetDealer();"></apex:actionFunction> -->
-			<!-- 娣诲姞琛�  20211103 lt -->
-			<!-- <apex:actionFunction action="{!addMultipleRow}" name="addMultipleRow" reRender="theTable_Body" oncomplete="unblockUI();">
-				<apex:param assignTo="{!rowIdx}" name="rowIdx" value=""/>
-			</apex:actionFunction> -->
-
-        	<apex:outputPanel id="listsTable">
-        		<!-- <apex:pageBlock id="block1"> -->
-        			<div style="width: 100%;text-align:center;margin:0 auto;">
-	        			<table id="datatable_header" class="pure-table pure-table-horizontal" border="1" style="border-collapse:collapse; table-layout:fixed;">
-	                    	<!-- 缁熶竴璁剧疆鍒楀搴� -->
-	                    	<colgroup>
-	                        	<col width="15%"/>
-	                    	</colgroup>
-	                    	<tr style="background-color:#f2f3f1;width:900px;">
-	                        	<th style="text-align: left;">瀹㈡埛:</th>
-	                        	<td style="text-align:left;">
-			                        <apex:outputLabel id="AccName" value="{!AccName.Name}" />
-			                    </td>
-								<th>
-									<td></td>
-								</th>
-	                    	</tr>
-							<!-- 20211115 lt start -->
-							<tr style="background-color:#f2f3f1;width:900px;">
-	                        	<th style="text-align: left;">鏀惰揣鏂�:</th>
-	                        	<td style="text-align:left;">
-
-	                        		<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-                                		<apex:outputField value="{!sampleOrder.ReceivePart__c}"/>
-                            		</apex:outputPanel>
-	                        		<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-                                		<apex:inputField id="sampleReceivePart" value="{!sampleOrder.ReceivePart__c}" onchange="resetDealer();return false;" />
-                            		</apex:outputPanel>
-	                        		<!-- <apex:inputField id="sampleReceivePart" value="{!sampleOrder.ReceivePart__c}" onchange="resetDealer();return false;" /> -->
-									<!-- <apex:selectList id="recevicePart"  style="width:177px;height:20px;" value="{!selection_rec}" disabled="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:selectOptions value="{!options_rec}" />										
-									</apex:selectList> -->
-									<!-- <apex:inputField style="width:177px;height:20px;" value="{!sampleOrder.ReceivePart__c}" /> -->
-			                    </td>
-								<th style="text-align:right;">閫佽揪鏂瑰湴鍧�:</th>
-								<td style="text-align:left;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-                                		<apex:outputField value="{!sampleOrder.DeliveryAddress__c}"/>
-                            		</apex:outputPanel>
-	                        		<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:inputField id="Address" value="{!sampleOrder.DeliveryAddress__c}" />
-									</apex:outputPanel>
-									<!-- <apex:inputHidden id="tempSize" value="{!tempSize}" /> -->
-								</td>
-	                    	</tr>
-							<!-- 20211115 lt end -->
-	                    	<tr style="background-color:#f2f3f3;width:900px;">
-	                    		<th style="text-align: left;">閫佽揪鏂硅仈绯讳汉:</th>
-	                    		<td style="text-align:left;">
-	                    			<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-                                		<apex:outputField value="{!sampleOrder.DeliveryContact__c}"/>
-                            		</apex:outputPanel>
-	                        		<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-			                    		<apex:inputField id="Contact" value="{!sampleOrder.DeliveryContact__c}" />
-			                    	</apex:outputPanel>
-		                    	</td>
-								<th style="text-align:right;">閫佽揪鏂圭數璇�:</th>
-								<td style="text-align:left;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-                                		<apex:outputField value="{!sampleOrder.DeliveryPhone__c}"/>
-                            		</apex:outputPanel>
-	                        		<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:inputField id="Phone" value="{!sampleOrder.DeliveryPhone__c}" />
-									</apex:outputPanel>
-								</td>
-	                    	</tr>
-                		</table>
-                	</div>
-					<!-- 鍚庡彴鎶ラ敊淇℃伅鏄剧ず鐨勫叧閿� -->
-					<apex:outputPanel id="message">
-						<apex:pageMessages ></apex:pageMessages>
-					</apex:outputPanel>
-					<input type="hidden" id="Page:mainForm:productInfoList:Size" value="{!tempSize}" />
-					<div id="iframelike" style="width: 100%; height: 400px; text-align:center;margin:0 auto;" >
-					<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',false,true)}" >
-						<table id="theTable_Body" class="pure-table pure-table-horizontal" border="1" style="border-collapse: collapse; table-layout:fixed;">
-							<tr style="background-color:#f2f3f3; width:900px; color: black;">
-								<th style="text-align:left; width:50px">鏌ヨ:</th>
-								<td style="text-align:left; width:180px">
-									<apex:inputText style="text-align:left;" id="selectlike" value="{!QueryTemp}" />
-								</td>
-								<td style="text-align:left;">
-									<apex:commandButton id="Query" value="鏌ヨ" style="width:100px;height:30px;" action="{!FuzzyQuery}" />
-								</td>
-							</tr>
-						</table>
-					</apex:outputPanel>
-					<table id="theTable_Body" class="pure-table pure-table-horizontal" border="1" style="border-collapse: collapse; table-layout:fixed;">
+	<apex:form id="mainForm">
+		<h1 style ="font-size: 30px; margin-left: 45%;">鏍锋湰璁㈣揣</h1>
+		<apex:actionFunction name="save" action="{!save}" rerender="message,mainForm,listsTable" onComplete="SaveAllChecktime();unblockUI();">
+		</apex:actionFunction>
+		<!-- 纭鎸夐挳 -->
+		<apex:actionFunction name="confirmBtn" action="{!confirmBtn}" rerender="message,mainForm,listsTable" onComplete="SaveAllChecktime();unblockUI();">
+		</apex:actionFunction>
+		<apex:outputPanel id="listsTable">
+			<!-- <apex:pageBlock id="block1"> -->
+				<div style="width: 100%;text-align:center;margin:0 auto;">
+					<table id="datatable_header" class="pure-table pure-table-horizontal" border="1" style="border-collapse:collapse; table-layout:fixed;">
+						<!-- 缁熶竴璁剧疆鍒楀搴� -->
 						<colgroup>
-							<col width="2%"/>
-							<col width="3%"/>
-							<col width="20%"/>
-							<col width="30%"/>
-							<col width="20%"/>
-							<col width="10%"/>
-							<col width="5%"/>
-							<col width="10%"/>
+							<col width="15%"/>
 						</colgroup>
-						<tr style="background-color:#f2f3f3;">
-							<th style="text-align:center"><input type="checkbox" id="checkAll1" onclick="checkAll();" style="width:10px;"/></th>
-							<th style="text-align:center;color: black;">NO</th>
-							<th style="text-align:center;color: black;">璧勬枡缂栫爜</th>
-							<th style="text-align:center;color: black;">璧勬枡鍚嶇О</th>
-							<th style="text-align:center;color: black;">璧勬枡鍒嗙被</th>
-							<th style="text-align:center;color: black;">鏁伴噺</th>
-							<th style="text-align:center;color: black;">瑙勬牸</th>
-							<th style="text-align:center;color: black;">鎬婚噺</th>	
+						<tr style="background-color:#f2f3f1;width:900px;">
+							<th style="text-align: left;">瀹㈡埛:</th>
+							<td style="text-align:left;">
+								<apex:outputLabel id="AccName" value="{!AccName.Name}" />
+							</td>
+							<th>
+								<td></td>
+							</th>
 						</tr>
-						<apex:repeat value="{!productInfoList}" var="pros" id="productInfoList">
-							<tr>
-								<!-- 鈿� -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:inputCheckbox value="{!pros.check}" id="rowcheck"/>
-									<apex:inputHidden id="ProIdHidden" value="{!pros.proId}"/>
-								</td>
+						<tr style="background-color:#f2f3f1;width:900px;">
+							<th style="text-align: left;">鏀惰揣鏂�:</th>
+							<td style="text-align:left;">
 
-								<!-- NO -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputLabel style="width:20px" id="indexNo" value="{!IF(pros.SOLDel.Pro_model__c == null,'',pros.lineNo)}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputLabel style="width:20px" value="{!IF(pros.pro.Asset_Model_No__c == null,'',pros.lineNo)}"/>
-									</apex:outputPanel>
-								</td>
-
-								<!-- 璧勬枡缂栫爜 -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputField value="{!pros.SOLDel.Pro_model__c}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputField style="width:90px" id="proModel" value="{!pros.pro.Asset_Model_No__c}"/>
-									</apex:outputPanel>
-								</td>
-
-								<!-- 璧勬枡鍚嶇О -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputText style="width:400px" id="SOLDelName" value="{!pros.SOLDel.Pro_Name__c}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputText style="width:400px" id="Name" value="{!pros.pro.Name}"/>
-									</apex:outputPanel>
-								</td>
-								
-								<!-- 璧勬枡鍒嗙被 -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputText style="width:400px" id="SOLDelClassification" value="{!pros.SOLDel.Sample_Classification__c}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputText style="width:400px" id="Classification" value="{!pros.pro.Sample_Classification__c}"/>
-									</apex:outputPanel>
-								</td>
-
-								<!-- 鏁堟湡 -->
-								<!-- <td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}">
-										<apex:outputField value="{!pros.SOLDel.TermDate__c}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputField style="width:90px" id="SFDA_Expiration_Date" value="{!pros.pro.SFDA_Expiration_Date__c}"/>
-									</apex:outputPanel>
-								</td> -->
-
-								<!-- 鏁伴噺 -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputField value="{!pros.SOLDel.ItemQuantity__c}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:inputField id="Number" style="width:80px" value="{!pros.SOLDel.ItemQuantity__c}" onblur="AllChecktime({!pros.lineNo});ComputePrice(this);return false;" />
-									</apex:outputPanel>
-								</td>
-
-								<!-- 瑙勬牸 -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputText value="{!pros.SOLDel.Standards__c}"/>
-									</apex:outputPanel>
-									<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
-										<apex:outputText style="width:30px" id="Packing_list_manual" value="{!if(pros.pro.Asset_Model_No__c == null , '',pros.pro.Packing_list_manual__c)}" />
-										<!-- <apex:inputHidden id="PackingHidden" value="{!pros.SOLDel.Standards__c}"/> -->
-									</apex:outputPanel>
-								</td>
-
-								<!-- 鎬婚噺 -->
-								<td class="dataCell" style="text-align:center;">
-									<apex:outputField style="margin-left:3px;margin-right:3px;width:25px" id="Total" value="{!pros.SOLDel.Total__c}">
-									</apex:outputField>
-								</td>
-							</tr>
-						</apex:repeat>
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField value="{!sampleOrder.ReceivePart__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:inputField id="sampleReceivePart" value="{!sampleOrder.ReceivePart__c}" onchange="resetDealer();return false;" />
+								</apex:outputPanel>
+							</td>
+							<th style="text-align:right;">閫佽揪鏂瑰湴鍧�:</th>
+							<td style="text-align:left;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField value="{!sampleOrder.DeliveryAddress__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:inputField id="Address" value="{!sampleOrder.DeliveryAddress__c}" />
+								</apex:outputPanel>
+								<!-- <apex:inputHidden id="tempSize" value="{!tempSize}" /> -->
+							</td>
+						</tr>
+						<!-- 20211115 lt end -->
+						<tr style="background-color:#f2f3f3;width:900px;">
+							<th style="text-align: left;">閫佽揪鏂硅仈绯讳汉:</th>
+							<td style="text-align:left;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField value="{!sampleOrder.DeliveryContact__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:inputField id="Contact" value="{!sampleOrder.DeliveryContact__c}" />
+								</apex:outputPanel>
+							</td>
+							<th style="text-align:right;">閫佽揪鏂圭數璇�:</th>
+							<td style="text-align:left;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField value="{!sampleOrder.DeliveryPhone__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:inputField id="Phone" value="{!sampleOrder.DeliveryPhone__c}" />
+								</apex:outputPanel>
+							</td>
+						</tr>
 					</table>
 				</div>
-                <div id="iframelike" style="width: 100%; height: 40px; text-align:center;margin:0 auto;" >
-					<table id="buttontable" border="0">
-						<tr>
-							<!-- <td style="width:100px;" align="left"><apex:commandButton value="澧炲姞琛�" style="width:100px;height:30px;" onclick="openAddMultipleRow(); return false;" rerender="{!displayFlg}"/></td> -->
-							<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',false,true)}">
-								<td style="width:100%;" align="right"><apex:commandButton id="preserve" value="淇濆瓨" style="width:100px;height:30px;" onclick="SaveJs();return false;" /></td>
-								<td align="right"><apex:commandButton id="sendOrder" value="鍙戦�佽璐�" style="width:100px;height:30px;" onclick="openAddMultipleRow(); return false;"/></td>
-							</apex:outputPanel>
-							<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}">
-								<td style="width:98%; position: absolute;" align="right"><apex:commandButton id="Return" value="杩斿洖" style="width:100px;height:30px;" action="{!ReturnBtn}" /></td>
-							</apex:outputPanel>
+				<!-- 鍚庡彴鎶ラ敊淇℃伅鏄剧ず鐨勫叧閿� -->
+				<apex:outputPanel id="message">
+					<apex:pageMessages ></apex:pageMessages>
+				</apex:outputPanel>
+				<input type="hidden" id="Page:mainForm:productInfoList:Size" value="{!tempSize}" />
+				<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',false,true)}" >
+					<table id="theTable_Body" class="pure-table pure-table-horizontal" border="1" style="border-collapse: collapse; table-layout:fixed;">
+						<tr style="background-color:#f2f3f3; width:900px; color: black;">
+							<th style="text-align:left; width:50px">鏌ヨ:</th>
+							<td style="text-align:left; width:180px">
+								<apex:inputText style="text-align:left;" id="selectlike" value="{!QueryTemp}" />
+							</td>
+							<td style="text-align:left;">
+								<apex:commandButton id="Query" value="鏌ヨ" style="width:100px;height:30px;" action="{!FuzzyQuery}" />
+							</td>
 						</tr>
 					</table>
-                </div>
-        	</apex:outputPanel>
-    	</apex:form>
+				</apex:outputPanel>
+				<div id="iframelike" style="width: 100%; height: 400px; text-align:center;margin:0 auto;" >
+				<table id="theTable_Body" class="pure-table pure-table-horizontal" border="1" style="border-collapse: collapse; table-layout:fixed;">
+					<colgroup>
+						<col width="2%"/>
+						<col width="3%"/>
+						<col width="20%"/>
+						<col width="30%"/>
+						<col width="20%"/>
+						<col width="10%"/>
+						<col width="5%"/>
+						<col width="10%"/>
+					</colgroup>
+					<tr style="background-color:#f2f3f3;">
+						<th style="text-align:center"><input type="checkbox" id="checkAll1" onclick="checkAll();" style="width:10px;"/></th>
+						<th style="text-align:center;color: black;">NO</th>
+						<th style="text-align:center;color: black;">璧勬枡缂栫爜</th>
+						<th style="text-align:center;color: black;">璧勬枡鍚嶇О</th>
+						<th style="text-align:center;color: black;">璧勬枡鍒嗙被</th>
+						<th style="text-align:center;color: black;">鏁伴噺</th>
+						<th style="text-align:center;color: black;">瑙勬牸</th>
+						<th style="text-align:center;color: black;">鎬婚噺</th>	
+					</tr>
+					<apex:repeat value="{!productInfoList}" var="pros" id="productInfoList">
+						<tr>
+							<!-- 鈿� -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:inputCheckbox value="{!pros.check}" id="rowcheck"/>
+								<apex:inputHidden id="ProIdHidden" value="{!pros.proId}"/>
+							</td>
 
-	<!-- </body> -->
+							<!-- NO -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputLabel style="width:20px" id="indexNo" value="{!IF(pros.SOLDel.Pro_model__c == null,'',pros.lineNo)}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputLabel style="width:20px" value="{!IF(pros.pro.Asset_Model_No__c == null,'',pros.lineNo)}"/>
+								</apex:outputPanel>
+							</td>
 
-	<!-- 20211103 lt -->
-	<!-- 娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 start -->
-    <!-- <script type="text/javascript">
-        //const duration = document.getElementById('dur');
-        
-        function changeV() {
-            var speed = document.getElementById('speed');
-            //durVal = parseFloat(duration.value);
-            spdVal = parseFloat(speed.value);
-            //const durationPercent = parseFloat(durVal, 2) * 100
-            const speedPercent = parseFloat((spdVal / 100), 2)*100;
-            //duration.style.backgroundSize = `${durationPercent}%, 100%`
-            speed.style.background = `linear-gradient(to right, #ffa200, white ${speedPercent}%, white`
-            document.getElementById("addMultipleRow").value= speed.value;
-            
-        };
-        function changeI() {
-            var speed = document.getElementById('speed');
-            //durVal = parseFloat(duration.value);
-            spdVal = parseFloat(document.getElementById("addMultipleRow").value);
-            //const durationPercent = parseFloat(durVal, 2) * 100
-            const speedPercent = parseFloat((spdVal / 100), 2)*100;
-            //duration.style.backgroundSize = `${durationPercent}%, 100%`
-            speed.style.background = `linear-gradient(to right, #ffa200, white ${speedPercent}%, white`
-            speed.value = document.getElementById("addMultipleRow").value;
+							<!-- 璧勬枡缂栫爜 -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField value="{!pros.SOLDel.Pro_model__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField style="width:90px" id="proModel" value="{!pros.pro.Asset_Model_No__c}"/>
+								</apex:outputPanel>
+							</td>
 
-        };
+							<!-- 璧勬枡鍚嶇О -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputText style="width:400px" id="SOLDelName" value="{!pros.SOLDel.Pro_Name__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputText style="width:400px" id="Name" value="{!pros.pro.Name}"/>
+								</apex:outputPanel>
+							</td>
+							
+							<!-- 璧勬枡鍒嗙被 -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputText style="width:400px" id="SOLDelClassification" value="{!pros.SOLDel.Sample_Classification__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputText style="width:400px" id="Classification" value="{!pros.pro.Sample_Classification__c}"/>
+								</apex:outputPanel>
+							</td>
 
-    </script> -->
-    <!-- //娣诲姞琛� html鐗规�у鍔犳粦鍔ㄦ潯 绮剧悽鎶�鏈� wql 2021/02/09 end -->
-	<!-- 20211103 lt -->
+							<!-- 鏁伴噺 -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputField value="{!pros.SOLDel.ItemQuantity__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:inputField id="Number" style="width:80px" value="{!pros.SOLDel.ItemQuantity__c}" onblur="AllChecktime({!pros.lineNo});ComputePrice(this);return false;" />
+								</apex:outputPanel>
+							</td>
 
+							<!-- 瑙勬牸 -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputText value="{!pros.SOLDel.Standards__c}"/>
+								</apex:outputPanel>
+								<apex:outputPanel rendered="{!!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}" >
+									<apex:outputText style="width:30px" id="Packing_list_manual" value="{!if(pros.pro.Asset_Model_No__c == null , '',pros.pro.Packing_list_manual__c)}" />
+									<!-- <apex:inputHidden id="PackingHidden" value="{!pros.SOLDel.Standards__c}"/> -->
+								</apex:outputPanel>
+							</td>
+
+							<!-- 鎬婚噺 -->
+							<td class="dataCell" style="text-align:center;">
+								<apex:outputField style="margin-left:3px;margin-right:3px;width:25px" id="Total" value="{!pros.SOLDel.Total__c}">
+								</apex:outputField>
+							</td>
+						</tr>
+					</apex:repeat>
+				</table>
+			</div>
+			<div id="iframelike" style="width: 100%; height: 40px; text-align:center;margin:0 auto;" >
+				<table id="buttontable" border="0">
+					<tr>
+						<!-- <td style="width:100px;" align="left"><apex:commandButton value="澧炲姞琛�" style="width:100px;height:30px;" onclick="openAddMultipleRow(); return false;" rerender="{!displayFlg}"/></td> -->
+						<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',false,true)}">
+							<td style="width:100%;" align="right"><apex:commandButton id="preserve" value="淇濆瓨" style="width:100px;height:30px;" onclick="SaveJs();return false;" /></td>
+							<td align="right"><apex:commandButton id="sendOrder" value="鍙戦�佽璐�" style="width:100px;height:30px;" onclick="openAddMultipleRow(); return false;"/></td>
+						</apex:outputPanel>
+						<apex:outputPanel rendered="{!IF(sampleOrder.Status__c='璁㈠崟宸插彂閫�',true,false)}">
+							<td style="width:98%; position: absolute;" align="right"><apex:commandButton id="Return" value="杩斿洖" style="width:100px;height:30px;" action="{!ReturnBtn}" /></td>
+						</apex:outputPanel>
+					</tr>
+				</table>
+			</div>
+		</apex:outputPanel>
+	</apex:form>
 </apex:page>
\ No newline at end of file
diff --git a/force-app/main/default/pages/StatusPage.page b/force-app/main/default/pages/StatusPage.page
index c721d2e..220b918 100644
--- a/force-app/main/default/pages/StatusPage.page
+++ b/force-app/main/default/pages/StatusPage.page
@@ -15,6 +15,10 @@
     			alert('涓嶉渶瑕佺悊鐢变笉鑳戒负绌�');
     			return;
     		}
+            if (chance.trim() == '' || chance.trim() == null) {
+                alert('涓嶉渶瑕佺悊鐢变笉鑳戒负绌�');
+                return;
+            }
     		if ((chance == '宸茬粡鏈夎浠�') && (name1.trim() == null || name1.trim() == "")) {
     			alert('宸叉湁璇环鍚嶇О涓嶈兘涓虹┖');
                 return;
@@ -39,7 +43,7 @@
 					<br />
 					<apex:inputField id="name1" value="{!Inquiryform.Opp_Name_Search__c}" style="width: 150px"/>
 			</apex:pageBlockSection>
-			<apex:pageblockbuttons >
+			<apex:pageblockbuttons location="bottom">
 				<apex:commandbutton onclick="save();return false;" value="淇濆瓨"></apex:commandbutton>
 			</apex:pageblockbuttons>
 		</apex:pageBlock>
diff --git a/force-app/main/default/pages/UploadOBPM.page b/force-app/main/default/pages/UploadOBPM.page
index f1176ee..56febb1 100644
--- a/force-app/main/default/pages/UploadOBPM.page
+++ b/force-app/main/default/pages/UploadOBPM.page
@@ -8,16 +8,22 @@
     <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
     <script>
         sforce.connection.sessionId = '{!$Api.Session_ID}';
-        function addJs(){
-            blockme();
-            addLine();
-        }
+        // function addJs(){
+        //     blockme();
+        //     addLine();
+        // }
         function uploadJs(){
-            blockme();
-            uploadOBPM();
+            var IF_Approved = j$(escapeVfId('IF_Approved')).value();
+            if(IF_Approved == 'true'){
+                blockme();
+                uploadOBPM();
+            } else{
+                alert("姝や細璁笉闇�瑕佺敵璇峰喅瑁侊紒");
+            }
         }
         function uploadSuccess(){
             alert('涓婁紶OBPM鎴愬姛锛�');
+            window.close();
         }
         function closeJs(){
             window.close();
@@ -36,17 +42,19 @@
         <apex:actionFunction name="uploadOBPM" action="{!uploadOBPM}" rerender="allForm,allPanel,allBlock,records" oncomplete="unblockUI();uploadSuccess();">
         </apex:actionFunction>
         <apex:outputPanel id="allPanel">
+            <input type="hidden" id="hasError" value="{!hasError}"/>
+            <input type="hidden" id="IF_Approved" value="{!IF_Approved}"/>
             <apex:pageBlock id="allBlock">
                 <apex:pageBlockButtons location="top">
-                    <apex:commandButton immediate="true" onclick="uploadJs();" value="涓婁紶OBPM" rerender="dummy"/>
-                    <apex:commandButton immediate="true" onclick="addJs();" value="娣诲姞琛�" rerender="dummy"/>
-                    <apex:commandButton immediate="true" onclick="closeJs();" value="鍏抽棴" rerender="dummy"/>
+                    <apex:commandButton immediate="true" onclick="uploadJs();return false;" value="涓婁紶OBPM"/>
+                    <apex:commandButton immediate="true" action="{!addLine}" onclick="blockme();" value="娣诲姞琛�"/>
+                    <apex:commandButton immediate="true" onclick="closeJs();" value="鍏抽棴"/>
                 </apex:pageBlockButtons>
-
                 <apex:outputPanel id="message">
                     <apex:pageMessages />
                 </apex:outputPanel>
-
+                <input type="hidden" id="hasError" value="{!hasError}"/>
+                <label>鐢宠鍐宠鏃跺闇�瑕佸叡鍚岀紪杈戜汉鍜屾妱閫佷汉锛岃濉叆涓嬭〃锛�</label>
                 <table class="linetable" border="1" style="border-collapse: collapse;width:590px;table-layout:fixed;">
                     <colgroup>
                         <col width="40px"/>
@@ -83,7 +91,7 @@
                                 <option value ="鍏卞悓缂栬緫浜�">鍏卞悓缂栬緫浜�</option>
                                 <option value ="鎶勯�佷汉">鎶勯�佷汉</option>
                             </select> -->
-                            <apex:selectList value="{!OBPMInfo.Role}" size="1" style="position: absolute;transform: translate(-40px, -3px);">
+                            <apex:selectList value="{!OBPMInfo.Role}" size="1" style="position: relative; top: 6px;">
                                 <apex:selectOptions value="{!items}"/>
                             </apex:selectList><p/>
                         </td>
diff --git a/force-app/main/default/triggers/AccountTrigger.trigger b/force-app/main/default/triggers/AccountTrigger.trigger
index e1fa5c8..1476603 100644
--- a/force-app/main/default/triggers/AccountTrigger.trigger
+++ b/force-app/main/default/triggers/AccountTrigger.trigger
@@ -131,26 +131,27 @@
         }
         //HWAG-B4PCZ5 2018-09-19 end 
         //NFM112 2021/11/10 start
-        String Idbox;
+        List<String> IdList = new List<String>();
         for(Account account : Trigger.new){
            Account old = Trigger.oldMap.get(account.Id);
            if(old.FirstParagraph__c != account.FirstParagraph__c  || old.MonthlyPayment__c != account.MonthlyPayment__c){
-                    Idbox = account.Id;
+                IdList.add(account.Id);
             }
         }
-        if(Idbox != null){
-            BatchIF_Log__c iflog = new BatchIF_Log__c();
-            iflog.Type__c = 'NFM112';
-            iflog.Log__c  = 'callout start\n';
-            insert iflog;
-            iflog = [Select Id, Name from BatchIF_Log__c where Id = :iflog.Id];
-            System.debug(Logginglevel.DEBUG, 'NFM112_' + iflog.Name + ' start');                  
-            NFM112Controller.executeNotFuture(iflog.Id, Idbox);
+        if(IdList.size()>0){
+            for(String Id : IdList){
+                BatchIF_Log__c iflog = new BatchIF_Log__c();
+                iflog.Type__c = 'NFM112';
+                iflog.Log__c  = 'callout start\n';
+                insert iflog;
+                //iflog = [Select Id, Name from BatchIF_Log__c where Id = :iflog.Id];
+                //System.debug(Logginglevel.DEBUG, 'NFM112_' + iflog.Name + ' start');                  
+                NFM112Controller.executeNotFuture(iflog.Id, Id);
+            }
         }
         //NFM112 2021/11/10 end
     }
-    
-    //add            wangweipeng              2022/02/10                            start
+ //add            wangweipeng              2022/02/10                            start
     //缁忛攢鍟嗙殑鎬ц川鍙戠敓鍙樺寲锛岄偅涔堥渶瑕佸彂閭欢锛屽叾涓竴涓敹浠朵汉涓哄ぇ鍖哄姪鐞�
     //澶у尯鍔╃悊锛氭牴鎹缁忛攢鍟嗘墍鍦ㄧ殑閭d釜澶у尯锛屾潵鍒ゆ柇鍒板簳鍙戠粰璋侊紝姣忎釜澶у尯鍔╃悊閮芥湁涓�涓汉锛岀洰鍓嶆槸瀛樺埌鑷畾涔夋簮鏁版嵁閲岄潰浜�
     if(Trigger.isBefore){
diff --git a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
index c4dc7c4..66423b2 100644
--- a/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
+++ b/force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
@@ -27,7 +27,6 @@
     }
 
         
-    system.debug('orderSet---------------1--------------'+orderSet);
     if (orderSet.size()>0){
         // 2018骞�8鏈�9鏃� HWAG-B3D9UV  鏇挎崲 SQL start by 寮犵帀灞�
         list<Consumable_order_details2__c> allresults = 
@@ -35,7 +34,6 @@
             Dealer_Returned__c, Dealer_Arrive__c, RemoveBox_No__c,Cancellation_Date__c
             FROM Consumable_order_details2__c
              WHERE Consumable_order_minor__c in :orderSet ];
-        system.debug('allresults'+allresults);
         // 2018骞�8鏈�9鏃� HWAG-B3D9UV  end by 寮犵帀灞�
         
         // 2018骞�8鏈�9鏃� HWAG-B3D9UV  鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪�� start by 寮犵帀灞�
@@ -103,71 +101,102 @@
 
         //鏇存柊娑堣�楀搧璁㈠崟鐨勫彂璐ф棩鏈�
         // 2018骞�8鏈�9鏃� HWAG-B3D9UV  鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪��  start by 寮犵帀灞�
-        map<string,Date> DeliverdateResults =  new map<string,Date>();
+        Set<string> resultsKeySet =  new Set<String>();
+        map<string,Date> DeliverdateResults =  new map<string,Date>();//鏈�鏂板彂璐ф椂闂�
+        map<string,Date> DeliverdateminResults =  new map<string,Date>();//鏈�鏃╁彂璐ф椂闂�
         for(Consumable_order_details2__c results1 : allresults){
             if(results1.Dealer_Arrive__c == true || results1.Dealer_Returned__c== true){
                 continue;
             }
             string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
-            system.debug('---------------2---------------' + DeliverdateResults.containsKey(Consumable_order_minor_str));
             if(DeliverdateResults.containsKey(Consumable_order_minor_str)){
                 if(DeliverdateResults.get(Consumable_order_minor_str)
                     < results1.Deliver_date__c
                     ){
                     DeliverdateResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+                    resultsKeySet.add(Consumable_order_minor_str);
                 }
-
             }else{
                 DeliverdateResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+                resultsKeySet.add(Consumable_order_minor_str);
             }
-        }
-
-        consumableOrderlist = new List<Consumable_Order__c>();
-        for (string key : DeliverdateResults.keySet()) {
-           if(DeliverdateResults.get(key)!=null){
-                Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
-                consumableOrder1.Id = key;
-                consumableOrder1.Shipment_Date__c = DeliverdateResults.get(key);
-                consumableOrderlist.add(consumableOrder1);
-            }
-
-        }
-        // 2018骞�8鏈�9鏃� HWAG-B3D9UV  鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪��  end by 寮犵帀灞�
-        
-        //鑾峰彇鏃╁彂璐ф棩鏈� start
-        system.debug('DeliverdateResults==============' + DeliverdateResults);
-        system.debug('璧板埌鏈�鏃╁彂璐ф棩鏈�');
-        map<string,Date> DeliverdateminResults =  new map<string,Date>();
-        for(Consumable_order_details2__c results1 : allresults){
-            if(results1.Dealer_Arrive__c == true || results1.Dealer_Returned__c== true){
-                continue;
-            }
-            string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
+            //鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part1 start
             if(DeliverdateminResults.containsKey(Consumable_order_minor_str)){
                 if(DeliverdateminResults.get(Consumable_order_minor_str)
                     > results1.Deliver_date__c
                     ){
-                        DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+                    DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+                    resultsKeySet.add(Consumable_order_minor_str);
                 }
-
             }else{
                 DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+                resultsKeySet.add(Consumable_order_minor_str);
             }
+            //鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part1 end
         }
-        List<Consumable_Order__c> consumableOrderminlist = new List<Consumable_Order__c>();
-        for (string key : DeliverdateminResults.keySet()) {
-           if(DeliverdateminResults.get(key)!=null){
-                Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
-                consumableOrder1.Id = key;
-                consumableOrder1.First_Delivery__c = DeliverdateResults.get(key);
-                consumableOrderminlist.add(consumableOrder1);
+        
+        //涓や釜DeliverdateResults.keySet()锛孌eliverdateminResults.keySet() 鍚堝苟浣滀负涓�涓狶ist 锛岄亶鍘哃ist
+        //鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part2 start
+        consumableOrderlist = new List<Consumable_Order__c>();
+        for(string temp : resultsKeySet){
+            Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
+            consumableOrder1.Id = temp;
+            if(DeliverdateResults.get(temp)!=null){
+                consumableOrder1.Shipment_Date__c = DeliverdateResults.get(temp);
             }
+            if(DeliverdateminResults.get(temp)!=null){
+                consumableOrder1.First_Delivery__c = DeliverdateResults.get(temp);
+            }
+            consumableOrderlist.add(consumableOrder1);
         }
+        
+        //鑾峰彇鏈�鏃╁彂璐ф椂闂� pk part2 end
+        // List<Consumable_Order__c> consumableOrderminlist = new List<Consumable_Order__c>();//鏈�鏃╁彂璐ф椂闂�
+        // for (string key : DeliverdateminResults.keySet()) {
+        //    if(DeliverdateminResults.get(key)!=null){
+        //         Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
+        //         consumableOrder1.Id = key;
+        //         consumableOrder1.First_Delivery__c = DeliverdateResults.get(key);
+        //         consumableOrderminlist.add(consumableOrder1);
+        //     }
+        // }
+        
+        // 2018骞�8鏈�9鏃� HWAG-B3D9UV  鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪��  end by 寮犵帀灞�
+        
+        //鑾峰彇鏃╁彂璐ф棩鏈� start
+        // system.debug('DeliverdateResults==============' + DeliverdateResults);
+        // system.debug('璧板埌鏈�鏃╁彂璐ф棩鏈�');
+        // map<string,Date> DeliverdateminResults =  new map<string,Date>();
+        // for(Consumable_order_details2__c results1 : allresults){
+        //     if(results1.Dealer_Arrive__c == true || results1.Dealer_Returned__c== true){
+        //         continue;
+        //     }
+        //     string Consumable_order_minor_str = String.valueOf(results1.Consumable_order_minor__c);
+        //     if(DeliverdateminResults.containsKey(Consumable_order_minor_str)){
+        //         if(DeliverdateminResults.get(Consumable_order_minor_str)
+        //             > results1.Deliver_date__c
+        //             ){
+        //                 DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+        //         }
 
-        if(consumableOrderminlist.size() > 0){
-            update consumableOrderminlist; 
-        }
-        system.debug('DeliverdateResults==============' + DeliverdateResults);
+        //     }else{
+        //         DeliverdateminResults.put(Consumable_order_minor_str,results1.Deliver_date__c);
+        //     }
+        // }
+        // List<Consumable_Order__c> consumableOrderminlist = new List<Consumable_Order__c>();
+        // for (string key : DeliverdateminResults.keySet()) {
+        //    if(DeliverdateminResults.get(key)!=null){
+        //         Consumable_Order__c consumableOrder1 = new Consumable_Order__c();
+        //         consumableOrder1.Id = key;
+        //         consumableOrder1.First_Delivery__c = DeliverdateResults.get(key);
+        //         consumableOrderminlist.add(consumableOrder1);
+        //     }
+        // }
+
+        // if(consumableOrderminlist.size() > 0){
+        //     update consumableOrderminlist; 
+        // }
+        // system.debug('DeliverdateResults==============' + DeliverdateResults);
         // //鑾峰彇鏈�鏃╁彂璐ф棩鏈� end
 
         /* 2018骞�8鏈�9鏃� HWAG-B3D9UV  鍘熸湁SQL 涓庤祴鍊� start by 寮犵帀灞�
@@ -191,7 +220,7 @@
         if (consumableOrderlist.size() > 0){
            update consumableOrderlist;
         }
-
+        
         //鏇存柊寰呯‘璁ゆ敹璐ф暟閲�
         // 2018骞�8鏈�9鏃� HWAG-B3D9UV  鏇挎崲涓嬮潰鍘熸湁SQL 浣跨敤 map 瀹屾垚璧嬪��  start by 寮犵帀灞�
         map<string,Integer> resultsMap2 =  new map<string,Integer>();
@@ -264,7 +293,6 @@
     if (trigger.isUpdate || trigger.isInsert || trigger.isDelete){
         if (trigger.isUpdate || trigger.isInsert){
             for (Consumable_order_details2__c detail2 : Trigger.New) {
-                system.debug('detail2==========='+detail2);
                 Consumable_order_details2__c oldDetail2 = null;
                 if (Trigger.isUpdate) oldDetail2 = Trigger.oldMap.get(detail2.Id);
                 if (detail2.Consumable_Arrived_order__c != null) {
@@ -297,7 +325,6 @@
             Map<Id, Consumable_order__c> arrivedMap = new Map<Id, Consumable_order__c>([select Id, RecordType.DeveloperName, Name from Consumable_order__c where Id in :arrivedSet]);
             List<Consumable_orderdetails__c> detail1List = [select Id, Name, Asset_Model_No__c, Consumable_count__c, Consumable_order__c from Consumable_orderdetails__c where Consumable_order__c in :arrivedSet];
             Map<String,Consumable_orderdetails__c> detail1Map = new Map<String,Consumable_orderdetails__c>();
-            system.debug('detail1List'+detail1List);
             for (Consumable_orderdetails__c detail1 : detail1List) {
                 String key = '' + detail1.Consumable_order__c + detail1.Asset_Model_No__c;
                 detail1Map.put(key, detail1);
@@ -353,13 +380,10 @@
             Map<String, String> assetModelNoMap = new Map<String, String>();
             if (trigger.isUpdate || trigger.isInsert){
                 for (Consumable_order_details2__c detail2 : Trigger.New) {  
-                    system.debug('detail2'+detail2);
                     //Dataloader銇у垵鏈熷湪搴櫥閷层倰銇椼仧銇傘仺銆併儑銉笺偪淇銇屽叆銇c仧銇ㄣ亶銇槑绱�1銇屾洿鏂般仌銈屻仾銇勩��
                     //if (trigger.isUpdate && detail2.ManualRegisteredStock__c == true) continue;                  
                     if (detail2.Consumable_Arrived_order__c == null) continue;
                     String key = '' + detail2.Consumable_Arrived_order__c + detail2.Asset_Model_No__c;
-                    system.debug('key'+key);
-                    system.debug('detail1Map==============>'+detail1Map);
                     //if (upsertMap.get(key) != null) continue;
                     Integer count = keyCount.get(key);
                     Consumable_orderdetails__c detail1 = detail1Map.get(key);
@@ -368,7 +392,6 @@
                     detail1.Consumable_Arrivecount__c = count;
                     if (detail1.Id == null) {
                         Consumable_order__c co = arrivedMap.get(detail2.Consumable_Arrived_order__c);
-                        system.debug('arrivedMap=============='+arrivedMap);
                         Integer index = noCount.get(co.Id);
                         if (index == null) index = 0;
                         if(assetModelNoMap.containsKey(detail2.Asset_Model_No__c)){
@@ -415,7 +438,6 @@
                         deletetMap.put(key,detail1);
                         continue;
                     }
-                    system.debug('detail1========================'+detail1);
                     if (detail1 == null) continue;
                     detail1.Consumable_Arrivecount__c = count;
 
diff --git a/force-app/main/default/triggers/FollowTrigger.trigger b/force-app/main/default/triggers/FollowTrigger.trigger
new file mode 100644
index 0000000..dfe2ef7
--- /dev/null
+++ b/force-app/main/default/triggers/FollowTrigger.trigger
@@ -0,0 +1,4 @@
+trigger FollowTrigger on Inquiry_form__c(after update) {
+    FollowTriggerHandler fth = new FollowTriggerHandler();
+    fth.run();
+}
\ No newline at end of file
diff --git a/force-app/main/default/triggers/FollowTrigger.trigger-meta.xml b/force-app/main/default/triggers/FollowTrigger.trigger-meta.xml
new file mode 100644
index 0000000..6205514
--- /dev/null
+++ b/force-app/main/default/triggers/FollowTrigger.trigger-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>41.0</apiVersion>
+    <status>Active</status>
+</ApexTrigger>
diff --git a/force-app/main/default/triggers/NFM007.trigger b/force-app/main/default/triggers/NFM007.trigger
index cda40ba..d49fe61 100644
--- a/force-app/main/default/triggers/NFM007.trigger
+++ b/force-app/main/default/triggers/NFM007.trigger
@@ -57,6 +57,9 @@
                             Id,
                             SFDA_Status__c,
                             PricebookEntry.Product2Id
+                            //lastbuy  2022/2/9 fy start
+                            ,Asset_Model_No__c
+                            //lastbuy  2022/2/9 fy end
 							// CHAN-BTF4XQ start
                             // 棰濆妫�绱骇鍝佹爣鍑嗗畾浠峰拰浜у搧鎴愭湰
                             ,Product_Cost__c,Product_ListPrice__c,Quantity__c
@@ -77,7 +80,16 @@
                             }
                             // CHAN-BTF4XQ end
                             //lastbuy  2022/2/9 fy start
-                            quotlinitMap.put(qli.PricebookEntry.Product2Id,qli);
+                            if(qli.PricebookEntry.Product2Id!=null){
+                                if(quotlinitMap.containsKey(qli.PricebookEntry.Product2Id)){
+                                    QuoteLineItem quoteLine = quotlinitMap.get(qli.PricebookEntry.Product2Id);
+                                    quoteLine.Quantity__c +=qli.Quantity__c;
+                                    quotlinitMap.put(qli.PricebookEntry.Product2Id,quoteLine);
+                                }else{
+                                    quotlinitMap.put(qli.PricebookEntry.Product2Id,qli);
+                                }
+                            }
+                            // quotlinitMap.put(qli.PricebookEntry.Product2Id,qli);
                             //lastbuy  2022/2/9 fy end
                         } 
 						if( CntCostOrListPrice > 0){
@@ -86,7 +98,9 @@
                         //CHAN-BWH2YW 20201221 you 鍔� 瀛楁 Correspond_Code__r start
                         //lastbuy  2022/2/9 fy
                         //鏂板棰勭暀浜у搧瀛楁LastbuyProductFLG__c
-                        List<String> lastProductFLGList= new List<String>();
+                        List<String> lastProductFLGIdList= new List<String>();
+                        List<Product2> lastProductFLGList = new List<Product2>();
+                        List<Product2> lastProductFLGListtest = new List<Product2>();
                         for (Product2 prd2: [Select Id,LastbuyProductFLG__c, Estimation_Entry_Possibility__c, SFDA_Status__c,Packing_list_manual__c,Correspond_Code__r.Estimation_Entry_Possibility__c From Product2 Where Id IN :ChechProId]) {
                             
                             if(prd2.Estimation_Entry_Possibility__c != '鈼�'){ 
@@ -97,39 +111,56 @@
                                 } 
                                  //CHAN-BWH2YW 20201221 you 鍔� 瀛楁 Correspond_Code__r end 
                             }
+                            lastProductFLGListtest.add(prd2);
                             //lastbuy  2022/2/9 fy start
                             if(prd2.LastbuyProductFLG__c){
-                                lastProductFLGList.add(prd2.Id);
+                                lastProductFLGIdList.add(prd2.Id);
+                                lastProductFLGList.add(prd2);
                             }
                             //lastbuy  2022/2/9 fy end
                         }
                         //lastbuy  2022/2/9 fy start
                         List<LastbuyProduct__c> upLastbuyObjList = new List<LastbuyProduct__c>();
-                        if(lastProductFLGList!=null){
-                            List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : opp.Id and ProductName__c in :lastProductFLGList and 	effectiveFLG__c = true];
-                            System.debug('bbbbbbbbbbbbbbb==='+lastProductFLGList);
-                            if(LastbuyObjList!=null){
+                        if(lastProductFLGIdList!=null && lastProductFLGIdList.size() !=0){
+                            List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : opp.Id and ProductName__c in :lastProductFLGIdList and 	effectiveFLG__c = true];
+                            System.debug('bbbbbbbbbbbbbbb==='+lastProductFLGIdList);
+                            Map<string,LastbuyProduct__c> LastbuyObjMap = new Map<string,LastbuyProduct__c>();
+                            if(LastbuyObjList!=null&&LastbuyObjList.size()!=0){
                                 for(LastbuyProduct__c lastbuypr :LastbuyObjList){
-                                    Decimal quoteLItemNum=0;
-                                    if(quotlinitMap.containsKey(lastbuypr.ProductName__c)){
-                                        quoteLItemNum=quotlinitMap.get(lastbuypr.ProductName__c).Quantity__c;
-                                    }else{
-                                        continue;
-                                    }
-                                    if(lastbuypr.LastbuyQuantity__c<quoteLItemNum){
-                                        opp.addError('浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺');
-                                    }else{
-                                        lastbuypr.ActualQuantity__c=quoteLItemNum;
-                                        lastbuypr.effectiveFLG__c=false;
-                                        upLastbuyObjList.add(lastbuypr);
-                                    }
-                                    System.debug('cccccccccccccc==='+lastbuypr);
+                                  LastbuyObjMap.put(lastbuypr.ProductName__c,lastbuypr);
                                 }
-                                System.debug('aaaaaaaaaaaaaa==='+LastbuyObjList);
-                                
+                                System.debug('fffffffffffffff==='+LastbuyObjList);
+                                if(lastProductFLGList!=null && lastProductFLGList.size() !=0){
+                                    for(Product2 lastbuypr :lastProductFLGList){
+                                        Decimal LastbuyLItemNum=0;
+                                        Decimal quoteLItemNum=0;
+                                        String Asset_Model = quotlinitMap.get(lastbuypr.Id).Asset_Model_No__c;
+                                        if(LastbuyObjMap.containsKey(lastbuypr.Id)){
+                                            LastbuyProduct__c lastbuyobj = LastbuyObjMap.get(lastbuypr.Id);
+                                            if(quotlinitMap.containsKey(lastbuypr.Id)){
+                                                LastbuyLItemNum=LastbuyObjMap.get(lastbuypr.Id).LastbuyQuantity__c;
+                                                quoteLItemNum=quotlinitMap.get(lastbuypr.Id).Quantity__c;
+                                                if(quoteLItemNum>LastbuyLItemNum){
+                                                    opp.addError(Asset_Model+'浜у搧鏁伴噺涓嶅彲瓒呰繃浜у搧棰勭暀鏁伴噺');
+                                                }else{
+                                                    lastbuyobj.ActualQuantity__c=quoteLItemNum;
+                                                    lastbuyobj.effectiveFLG__c=false;
+                                                    upLastbuyObjList.add(lastbuyobj);
+                                                }
+                                            }
+                                        }else{
+                                            opp.addError('棰勭暀浜у搧'+Asset_Model+'鏈綍鍏ラ鐣欎骇鍝佽〃');
+                                            System.debug('asdasdfasdfadsf閿欒鎻愮ず');
+                                        }
+                                        System.debug('cccccccccccccc==='+lastbuypr);
+                                    }
+                                    System.debug('aaaaaaaaaaaaaa==='+LastbuyObjList);
+                                    
+                                }
                             }else{
-                                opp.addError('棰勭暀琛ㄤ腑杩樻病鏈夋暟鎹�');
+                                opp.addError('棰勭暀浜у搧琛ㄤ腑娌℃湁褰曞叆璇ヨ浠风殑棰勭暀浜у搧');
                             }
+                            
                         }
                         System.debug('upLastbuyObjList==='+upLastbuyObjList);
                         if(upLastbuyObjList!=null){
diff --git a/force-app/main/default/triggers/OpportunityBefUpd.trigger b/force-app/main/default/triggers/OpportunityBefUpd.trigger
index da74437..51c22ea 100644
--- a/force-app/main/default/triggers/OpportunityBefUpd.trigger
+++ b/force-app/main/default/triggers/OpportunityBefUpd.trigger
@@ -129,7 +129,8 @@
                 raList = [Select Id,Follow_UP_Opp__c From Rental_Apply__c Where RA_Status_Text__c != '鍙栨秷' and Follow_UP_Opp__c IN :opIds];
             }else{
         //2.浠庤浠稩d涓煡璇㈠鍝佺姸鎬佷笉涓哄彇娑�(鐘舵�佷笉涓哄彇娑堜笖璇环涓湁s澶囧搧鐨勮瘽锛屽氨鎶ラ敊)    
-                raList = [Select Id,Follow_UP_Opp__c From Rental_Apply__c Where RA_Status_Text__c != '鍙栨秷' and RA_Status_Text__c != '瀹屼簡' and Follow_UP_Opp__c IN :opIds];   
+                //20220307 lt update and RA_Status_Text__c != '鑽夋涓�'  SWAG-CBXCYR 銆愬鎵樸�戝尰闄㈠悎骞舵暟鎹浆绉婚棶棰�
+                raList = [Select Id,Follow_UP_Opp__c From Rental_Apply__c Where RA_Status_Text__c != '鍙栨秷' and RA_Status_Text__c != '瀹屼簡' and RA_Status_Text__c != '鑽夋涓�' and Follow_UP_Opp__c IN :opIds];   
             }
             //3.灏嗗叾锛堟瘡涓浠峰搴旂殑澶囧搧锛夋斁鍏ap涓�
             Map<String,Rental_Apply__c> raMap = new Map<String,Rental_Apply__c>();
diff --git a/force-app/main/default/triggers/Repair.trigger b/force-app/main/default/triggers/Repair.trigger
index a4449e4..303efaa 100644
--- a/force-app/main/default/triggers/Repair.trigger
+++ b/force-app/main/default/triggers/Repair.trigger
@@ -66,8 +66,17 @@
             boolean defaultFlag = true;
             //add     wangweipeng               2021/12/09          end
             // 鑽夋涓慨鐞嗐仩銇戞洿鏂�
+            // GZW 鐗规畩澶勭悊 璺宠繃缁翠慨涓績鑷姩璧嬪�硷紝浠ユ墜閫変负鍑� start
+            // 鍒ゆ柇鏉′欢杩藉姞   && repair.Exc_work_location__c == false
+            if(repair.Exc_work_location__c){
+                defaultFlag = false;
+            }
+            // GZW 鐗规畩澶勭悊 璺宠繃缁翠慨涓績鑷姩璧嬪�硷紝浠ユ墜閫変负鍑� start
+
             if ((repair.Status__c == '鑽夋涓�' || String.isBlank(repair.Status__c)) == false) {
-                if (Trigger.isUpdate && repair.SAP_Transfer_time__c == null) {
+                // if (Trigger.isUpdate && repair.SAP_Transfer_time__c == null) {
+                if (Trigger.isUpdate && repair.SAP_Transfer_time__c == null && repair.Exc_work_location__c == false) {
+                
                     repair = RepairTrigger.updateWorkLocationSelect(repair, null);
                     defaultFlag = false;
                 }
@@ -79,7 +88,8 @@
 
             Boolean needsetnull = true;
             System.debug( '-----:鑷姩甯﹀嚭缁翠慨鍚堝悓11111' + middleTableList);
-            if (middleTableList == null) {
+            // if (middleTableList == null) {
+            if (middleTableList == null  && repair.Exc_work_location__c == false) {
                 if ((repair.NewProductGuarante_Txt__c == '2: 澶氬勾淇濅慨'
                         || repair.NewProductGuarante_Txt__c == '2: 鏈嶅姟澶氬勾淇濅慨'
                         || repair.NewProductGuarante_Txt__c == '8: 甯傚満澶氬勾淇濅慨')
@@ -114,7 +124,8 @@
                             repair.repairPlace__c = middleTable.Maintenance_Contract__r.SalesOfficeCode_selection__c;
                             //鏂板閫昏緫 HWAG-BKP5FB 绮剧悽绉戞妧 2020/03/19 Start
                             //wangweipeng   鍙戠敓鏁版嵁鍒癝AP浠ュ悗锛屼慨鐞嗙殑缁翠慨涓績涓嶈兘鍋氫慨鏀�
-                            if(repair.SAP_Transfer_time__c == null){
+                            // if(repair.SAP_Transfer_time__c == null){
+                            if(repair.SAP_Transfer_time__c == null  && repair.Exc_work_location__c == false){
                                 repair = RepairTrigger.updateWorkLocationSelect(repair, middleTable);    
                                 defaultFlag = false;
                             }
@@ -159,7 +170,8 @@
             // Boolean needsetnull = true;
             System.debug( '-----:鑷姩甯﹀嚭铏氭嫙缁翠慨鍚堝悓');
             System.debug( '-----:鑷姩甯﹀嚭铏氭嫙缁翠慨鍚堝悓' + middleTableVMList);
-            if (middleTableVMList == null) {
+            // if (middleTableVMList == null) {
+            if (middleTableVMList == null  && repair.Exc_work_location__c == false) {
                 if ((repair.NewProductGuarante_Txt__c == '2: 澶氬勾淇濅慨'
                         || repair.NewProductGuarante_Txt__c == '2: 鏈嶅姟澶氬勾淇濅慨'
                         || repair.NewProductGuarante_Txt__c == '8: 甯傚満澶氬勾淇濅慨')
@@ -180,7 +192,8 @@
                         repair.VM_Maintenance_Contract__c = middleTable.Maintenance_Contract__c;
                         needsetnull = false;
                         //鏂板閫昏緫 SLIU-BMMDWK 绮剧悽绉戞妧 2020/03/17 Start
-                        if (repair.VM_Maintenance_Contract__c != null) {
+                        // if (repair.VM_Maintenance_Contract__c != null) {
+                        if (repair.VM_Maintenance_Contract__c != null  && repair.Exc_work_location__c == false) {
                             repair = RepairTrigger.updateWorkLocationSelect(repair, middleTable);
                             defaultFlag = false;
                         }

--
Gitblit v1.9.1